@searchstax-inc/searchstudio-ux-js 4.2.1 → 4.2.2
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the "searchstudio-ux-js" project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [4.2.2]
|
|
6
|
+
### Features
|
|
7
|
+
- Added tabbed-nav-sample in samples repository
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
- Fixed searchObject modification of itemsPerPage in beforeSearch hook to work as expected
|
|
10
|
+
|
|
5
11
|
## [4.2.1]
|
|
6
12
|
### Bug Fixes
|
|
7
13
|
- fixed answer first word being sometimes cut off and cached answers not being shown.
|
|
@@ -53,8 +53,8 @@ ${n}</tr>
|
|
|
53
53
|
`}tablecell(n){const e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
|
|
54
54
|
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${fe(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){const s=this.parser.parseInline(t),a=Ka(n);if(a===null)return s;n=a;let i='<a href="'+n+'"';return e&&(i+=' title="'+fe(e)+'"'),i+=">"+s+"</a>",i}image({href:n,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));const a=Ka(n);if(a===null)return fe(t);n=a;let i=`<img src="${n}" alt="${t}"`;return e&&(i+=` title="${fe(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:fe(n.text)}},ba=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},Ce=class sa{options;renderer;textRenderer;constructor(e){this.options=e||De,this.options.renderer=this.options.renderer||new Et,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ba}static parse(e,t){return new sa(t).parse(e)}static parseInline(e,t){return new sa(t).parseInline(e)}parse(e,t=!0){let s="";for(let a=0;a<e.length;a++){const i=e[a];if(this.options.extensions?.renderers?.[i.type]){const o=i,c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){s+=c||"";continue}}const r=i;switch(r.type){case"space":{s+=this.renderer.space(r);continue}case"hr":{s+=this.renderer.hr(r);continue}case"heading":{s+=this.renderer.heading(r);continue}case"code":{s+=this.renderer.code(r);continue}case"table":{s+=this.renderer.table(r);continue}case"blockquote":{s+=this.renderer.blockquote(r);continue}case"list":{s+=this.renderer.list(r);continue}case"html":{s+=this.renderer.html(r);continue}case"paragraph":{s+=this.renderer.paragraph(r);continue}case"text":{let o=r,c=this.renderer.text(o);for(;a+1<e.length&&e[a+1].type==="text";)o=e[++a],c+=`
|
|
55
55
|
`+this.renderer.text(o);t?s+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):s+=c;continue}default:{const o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}parseInline(e,t=this.renderer){let s="";for(let a=0;a<e.length;a++){const i=e[a];if(this.options.extensions?.renderers?.[i.type]){const o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=o||"";continue}}const r=i;switch(r.type){case"escape":{s+=t.text(r);break}case"html":{s+=t.html(r);break}case"link":{s+=t.link(r);break}case"image":{s+=t.image(r);break}case"strong":{s+=t.strong(r);break}case"em":{s+=t.em(r);break}case"codespan":{s+=t.codespan(r);break}case"br":{s+=t.br(r);break}case"del":{s+=t.del(r);break}case"text":{s+=t.text(r);break}default:{const o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}},Tt=class{options;block;constructor(n){this.options=n||De}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?we.lex:we.lexInline}provideParser(){return this.block?Ce.parse:Ce.parseInline}},ji=class{defaults=pa();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ce;Renderer=Et;TextRenderer=ba;Lexer=we;Tokenizer=At;Hooks=Tt;constructor(...n){this.use(...n)}walkTokens(n,e){let t=[];for(const s of n)switch(t=t.concat(e.call(this,s)),s.type){case"table":{const a=s;for(const i of a.header)t=t.concat(this.walkTokens(i.tokens,e));for(const i of a.rows)for(const r of i)t=t.concat(this.walkTokens(r.tokens,e));break}case"list":{const a=s;t=t.concat(this.walkTokens(a.items,e));break}default:{const a=s;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(i=>{const r=a[i].flat(1/0);t=t.concat(this.walkTokens(r,e))}):a.tokens&&(t=t.concat(this.walkTokens(a.tokens,e)))}}return t}use(...n){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{const s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const i=e.renderers[a.name];i?e.renderers[a.name]=function(...r){let o=a.renderer.apply(this,r);return o===!1&&(o=i.apply(this,r)),o}:e.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=e[a.level];i?i.unshift(a.tokenizer):e[a.level]=[a.tokenizer],a.start&&(a.level==="block"?e.startBlock?e.startBlock.push(a.start):e.startBlock=[a.start]:a.level==="inline"&&(e.startInline?e.startInline.push(a.start):e.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(e.childTokens[a.name]=a.childTokens)}),s.extensions=e),t.renderer){const a=this.defaults.renderer||new Et(this.defaults);for(const i in t.renderer){if(!(i in a))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const r=i,o=t.renderer[r],c=a[r];a[r]=(...h)=>{let d=o.apply(a,h);return d===!1&&(d=c.apply(a,h)),d||""}}s.renderer=a}if(t.tokenizer){const a=this.defaults.tokenizer||new At(this.defaults);for(const i in t.tokenizer){if(!(i in a))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const r=i,o=t.tokenizer[r],c=a[r];a[r]=(...h)=>{let d=o.apply(a,h);return d===!1&&(d=c.apply(a,h)),d}}s.tokenizer=a}if(t.hooks){const a=this.defaults.hooks||new Tt;for(const i in t.hooks){if(!(i in a))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const r=i,o=t.hooks[r],c=a[r];Tt.passThroughHooks.has(i)?a[r]=h=>{if(this.defaults.async)return Promise.resolve(o.call(a,h)).then(C=>c.call(a,C));const d=o.call(a,h);return c.call(a,d)}:a[r]=(...h)=>{let d=o.apply(a,h);return d===!1&&(d=c.apply(a,h)),d}}s.hooks=a}if(t.walkTokens){const a=this.defaults.walkTokens,i=t.walkTokens;s.walkTokens=function(r){let o=[];return o.push(i.call(this,r)),a&&(o=o.concat(a.call(this,r))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return we.lex(n,e??this.defaults)}parser(n,e){return Ce.parse(n,e??this.defaults)}parseMarkdown(n){return(t,s)=>{const a={...s},i={...this.defaults,...a},r=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&a.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=n);const o=i.hooks?i.hooks.provideLexer():n?we.lex:we.lexInline,c=i.hooks?i.hooks.provideParser():n?Ce.parse:Ce.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(h=>o(h,i)).then(h=>i.hooks?i.hooks.processAllTokens(h):h).then(h=>i.walkTokens?Promise.all(this.walkTokens(h,i.walkTokens)).then(()=>h):h).then(h=>c(h,i)).then(h=>i.hooks?i.hooks.postprocess(h):h).catch(r);try{i.hooks&&(t=i.hooks.preprocess(t));let h=o(t,i);i.hooks&&(h=i.hooks.processAllTokens(h)),i.walkTokens&&this.walkTokens(h,i.walkTokens);let d=c(h,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}catch(h){return r(h)}}}onError(n,e){return t=>{if(t.message+=`
|
|
56
|
-
Please report this to https://github.com/markedjs/marked.`,n){const s="<p>An error occurred:</p><pre>"+fe(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},ve=new ji;function v(n,e){return ve.parse(n,e)}v.options=v.setOptions=function(n){return ve.setOptions(n),v.defaults=ve.defaults,xs(v.defaults),v};v.getDefaults=pa;v.defaults=De;v.use=function(...n){return ve.use(...n),v.defaults=ve.defaults,xs(v.defaults),v};v.walkTokens=function(n,e){return ve.walkTokens(n,e)};v.parseInline=ve.parseInline;v.Parser=Ce;v.parser=Ce.parse;v.Renderer=Et;v.TextRenderer=ba;v.Lexer=we;v.lexer=we.lex;v.Tokenizer=At;v.Hooks=Tt;v.parse=v;v.options;v.setOptions;v.use;v.walkTokens;v.parseInline;Ce.parse;we.lex;const{entries:Os,setPrototypeOf:ts,isFrozen:Ni,getPrototypeOf:Pi,getOwnPropertyDescriptor:Oi}=Object;let{freeze:ee,seal:le,create:Oe}=Object,{apply:ia,construct:na}=typeof Reflect<"u"&&Reflect;ee||(ee=function(e){return e});le||(le=function(e){return e});ia||(ia=function(e,t){for(var s=arguments.length,a=new Array(s>2?s-2:0),i=2;i<s;i++)a[i-2]=arguments[i];return e.apply(t,a)});na||(na=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),a=1;a<t;a++)s[a-1]=arguments[a];return new e(...s)});const Ke=z(Array.prototype.forEach),_i=z(Array.prototype.lastIndexOf),as=z(Array.prototype.pop),Xe=z(Array.prototype.push),Fi=z(Array.prototype.splice),K=Array.isArray,at=z(String.prototype.toLowerCase),Wt=z(String.prototype.toString),ss=z(String.prototype.match),Pe=z(String.prototype.replace),is=z(String.prototype.indexOf),zi=z(String.prototype.trim),$i=z(Number.prototype.toString),Vi=z(Boolean.prototype.toString),ns=typeof BigInt>"u"?null:z(BigInt.prototype.toString),rs=typeof Symbol>"u"?null:z(Symbol.prototype.toString),N=z(Object.prototype.hasOwnProperty),et=z(Object.prototype.toString),G=z(RegExp.prototype.test),Mt=Bi(TypeError);function z(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,s=new Array(t>1?t-1:0),a=1;a<t;a++)s[a-1]=arguments[a];return ia(n,e,s)}}function Bi(n){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return na(n,t)}}function b(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:at;if(ts&&ts(n,null),!K(e))return n;let s=e.length;for(;s--;){let a=e[s];if(typeof a=="string"){const i=t(a);i!==a&&(Ni(e)||(e[s]=i),a=i)}n[a]=!0}return n}function Hi(n){for(let e=0;e<n.length;e++)N(n,e)||(n[e]=null);return n}function se(n){const e=Oe(null);for(const[t,s]of Os(n))N(n,t)&&(K(s)?e[t]=Hi(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=se(s):e[t]=s);return e}function Ui(n){switch(typeof n){case"string":return n;case"number":return $i(n);case"boolean":return Vi(n);case"bigint":return ns?ns(n):"0";case"symbol":return rs?rs(n):"Symbol()";case"undefined":return et(n);case"function":case"object":{if(n===null)return et(n);const e=n,t=_e(e,"toString");if(typeof t=="function"){const s=t(e);return typeof s=="string"?s:et(s)}return et(n)}default:return et(n)}}function _e(n,e){for(;n!==null;){const s=Oi(n,e);if(s){if(s.get)return z(s.get);if(typeof s.value=="function")return z(s.value)}n=Pi(n)}function t(){return null}return t}function Qi(n){try{return G(n,""),!0}catch{return!1}}const os=ee(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Yt=ee(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Jt=ee(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),qi=ee(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Gt=ee(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Wi=ee(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ls=ee(["#text"]),cs=ee(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Zt=ee(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),hs=ee(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),bt=ee(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Yi=le(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ji=le(/<%[\w\W]*|[\w\W]*%>/gm),Gi=le(/\$\{[\w\W]*/gm),Zi=le(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ki=le(/^aria-[\-\w]+$/),_s=le(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Xi=le(/^(?:\w+script|data):/i),en=le(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fs=le(/^html$/i),tn=le(/^[a-z][.\w]*(-[.\w]+)+$/i);var us=Object.freeze({__proto__:null,ARIA_ATTR:Ki,ATTR_WHITESPACE:en,CUSTOM_ELEMENT:tn,DATA_ATTR:Zi,DOCTYPE_NAME:Fs,ERB_EXPR:Ji,IS_ALLOWED_URI:_s,IS_SCRIPT_OR_DATA:Xi,MUSTACHE_EXPR:Yi,TMPLIT_EXPR:Gi});const tt={element:1,text:3,progressingInstruction:7,comment:8,document:9},an=function(){return typeof window>"u"?null:window},sn=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null;const a="data-tt-policy-suffix";t&&t.hasAttribute(a)&&(s=t.getAttribute(a));const i="dompurify"+(s?"#"+s:"");try{return e.createPolicy(i,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},ds=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function zs(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:an();const e=m=>zs(m);if(e.version="3.4.1",e.removed=[],!n||!n.document||n.document.nodeType!==tt.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const s=t,a=s.currentScript,{DocumentFragment:i,HTMLTemplateElement:r,Node:o,Element:c,NodeFilter:h,NamedNodeMap:d=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:C,DOMParser:y,trustedTypes:I}=n,S=c.prototype,x=_e(S,"cloneNode"),H=_e(S,"remove"),p=_e(S,"nextSibling"),g=_e(S,"childNodes"),w=_e(S,"parentNode");if(typeof r=="function"){const m=t.createElement("template");m.content&&m.content.ownerDocument&&(t=m.content.ownerDocument)}let T,E="";const{implementation:_,createNodeIterator:ce,createDocumentFragment:ne,getElementsByTagName:Rt}=t,{importNode:Me}=s;let U=ds();e.isSupported=typeof Os=="function"&&typeof w=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:dt,ERB_EXPR:gt,TMPLIT_EXPR:pt,DATA_ATTR:Vs,ARIA_ATTR:Bs,IS_SCRIPT_OR_DATA:Hs,ATTR_WHITESPACE:xa,CUSTOM_ELEMENT:Us}=us;let{IS_ALLOWED_URI:ka}=us,Q=null;const Aa=b({},[...os,...Yt,...Jt,...Gt,...ls]);let J=null;const Ea=b({},[...cs,...Zt,...hs,...bt]);let O=Object.seal(Oe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),qe=null,ft=null;const be=Object.seal(Oe(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let va=!0,jt=!0,Da=!1,Ia=!0,Se=!1,We=!0,xe=!1,Nt=!1,Pt=!1,Ie=!1,mt=!1,Lt=!1,Ra=!0,ja=!1;const Na="user-content-";let Ot=!0,Ye=!1,Re={},ge=null;const _t=b({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Pa=null;const Oa=b({},["audio","video","img","source","image","track"]);let Ft=null;const _a=b({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yt="http://www.w3.org/1998/Math/MathML",wt="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml";let je=pe,zt=!1,$t=null;const Qs=b({},[yt,wt,pe],Wt);let Vt=b({},["mi","mo","mn","ms","mtext"]),Bt=b({},["annotation-xml"]);const qs=b({},["title","style","font","a","script"]);let Je=null;const Ws=["application/xhtml+xml","text/html"],Ys="text/html";let $=null,Ne=null;const Js=t.createElement("form"),Fa=function(l){return l instanceof RegExp||l instanceof Function},Ht=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ne&&Ne===l)return;(!l||typeof l!="object")&&(l={}),l=se(l),Je=Ws.indexOf(l.PARSER_MEDIA_TYPE)===-1?Ys:l.PARSER_MEDIA_TYPE,$=Je==="application/xhtml+xml"?Wt:at,Q=N(l,"ALLOWED_TAGS")&&K(l.ALLOWED_TAGS)?b({},l.ALLOWED_TAGS,$):Aa,J=N(l,"ALLOWED_ATTR")&&K(l.ALLOWED_ATTR)?b({},l.ALLOWED_ATTR,$):Ea,$t=N(l,"ALLOWED_NAMESPACES")&&K(l.ALLOWED_NAMESPACES)?b({},l.ALLOWED_NAMESPACES,Wt):Qs,Ft=N(l,"ADD_URI_SAFE_ATTR")&&K(l.ADD_URI_SAFE_ATTR)?b(se(_a),l.ADD_URI_SAFE_ATTR,$):_a,Pa=N(l,"ADD_DATA_URI_TAGS")&&K(l.ADD_DATA_URI_TAGS)?b(se(Oa),l.ADD_DATA_URI_TAGS,$):Oa,ge=N(l,"FORBID_CONTENTS")&&K(l.FORBID_CONTENTS)?b({},l.FORBID_CONTENTS,$):_t,qe=N(l,"FORBID_TAGS")&&K(l.FORBID_TAGS)?b({},l.FORBID_TAGS,$):se({}),ft=N(l,"FORBID_ATTR")&&K(l.FORBID_ATTR)?b({},l.FORBID_ATTR,$):se({}),Re=N(l,"USE_PROFILES")?l.USE_PROFILES&&typeof l.USE_PROFILES=="object"?se(l.USE_PROFILES):l.USE_PROFILES:!1,va=l.ALLOW_ARIA_ATTR!==!1,jt=l.ALLOW_DATA_ATTR!==!1,Da=l.ALLOW_UNKNOWN_PROTOCOLS||!1,Ia=l.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Se=l.SAFE_FOR_TEMPLATES||!1,We=l.SAFE_FOR_XML!==!1,xe=l.WHOLE_DOCUMENT||!1,Ie=l.RETURN_DOM||!1,mt=l.RETURN_DOM_FRAGMENT||!1,Lt=l.RETURN_TRUSTED_TYPE||!1,Pt=l.FORCE_BODY||!1,Ra=l.SANITIZE_DOM!==!1,ja=l.SANITIZE_NAMED_PROPS||!1,Ot=l.KEEP_CONTENT!==!1,Ye=l.IN_PLACE||!1,ka=Qi(l.ALLOWED_URI_REGEXP)?l.ALLOWED_URI_REGEXP:_s,je=typeof l.NAMESPACE=="string"?l.NAMESPACE:pe,Vt=N(l,"MATHML_TEXT_INTEGRATION_POINTS")&&l.MATHML_TEXT_INTEGRATION_POINTS&&typeof l.MATHML_TEXT_INTEGRATION_POINTS=="object"?se(l.MATHML_TEXT_INTEGRATION_POINTS):b({},["mi","mo","mn","ms","mtext"]),Bt=N(l,"HTML_INTEGRATION_POINTS")&&l.HTML_INTEGRATION_POINTS&&typeof l.HTML_INTEGRATION_POINTS=="object"?se(l.HTML_INTEGRATION_POINTS):b({},["annotation-xml"]);const u=N(l,"CUSTOM_ELEMENT_HANDLING")&&l.CUSTOM_ELEMENT_HANDLING&&typeof l.CUSTOM_ELEMENT_HANDLING=="object"?se(l.CUSTOM_ELEMENT_HANDLING):Oe(null);if(O=Oe(null),N(u,"tagNameCheck")&&Fa(u.tagNameCheck)&&(O.tagNameCheck=u.tagNameCheck),N(u,"attributeNameCheck")&&Fa(u.attributeNameCheck)&&(O.attributeNameCheck=u.attributeNameCheck),N(u,"allowCustomizedBuiltInElements")&&typeof u.allowCustomizedBuiltInElements=="boolean"&&(O.allowCustomizedBuiltInElements=u.allowCustomizedBuiltInElements),Se&&(jt=!1),mt&&(Ie=!0),Re&&(Q=b({},ls),J=Oe(null),Re.html===!0&&(b(Q,os),b(J,cs)),Re.svg===!0&&(b(Q,Yt),b(J,Zt),b(J,bt)),Re.svgFilters===!0&&(b(Q,Jt),b(J,Zt),b(J,bt)),Re.mathMl===!0&&(b(Q,Gt),b(J,hs),b(J,bt))),be.tagCheck=null,be.attributeCheck=null,N(l,"ADD_TAGS")&&(typeof l.ADD_TAGS=="function"?be.tagCheck=l.ADD_TAGS:K(l.ADD_TAGS)&&(Q===Aa&&(Q=se(Q)),b(Q,l.ADD_TAGS,$))),N(l,"ADD_ATTR")&&(typeof l.ADD_ATTR=="function"?be.attributeCheck=l.ADD_ATTR:K(l.ADD_ATTR)&&(J===Ea&&(J=se(J)),b(J,l.ADD_ATTR,$))),N(l,"ADD_URI_SAFE_ATTR")&&K(l.ADD_URI_SAFE_ATTR)&&b(Ft,l.ADD_URI_SAFE_ATTR,$),N(l,"FORBID_CONTENTS")&&K(l.FORBID_CONTENTS)&&(ge===_t&&(ge=se(ge)),b(ge,l.FORBID_CONTENTS,$)),N(l,"ADD_FORBID_CONTENTS")&&K(l.ADD_FORBID_CONTENTS)&&(ge===_t&&(ge=se(ge)),b(ge,l.ADD_FORBID_CONTENTS,$)),Ot&&(Q["#text"]=!0),xe&&b(Q,["html","head","body"]),Q.table&&(b(Q,["tbody"]),delete qe.tbody),l.TRUSTED_TYPES_POLICY){if(typeof l.TRUSTED_TYPES_POLICY.createHTML!="function")throw Mt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof l.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Mt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=l.TRUSTED_TYPES_POLICY,E=T.createHTML("")}else T===void 0&&(T=sn(I,a)),T!==null&&typeof E=="string"&&(E=T.createHTML(""));ee&&ee(l),Ne=l},za=b({},[...Yt,...Jt,...qi]),$a=b({},[...Gt,...Wi]),Gs=function(l){let u=w(l);(!u||!u.tagName)&&(u={namespaceURI:je,tagName:"template"});const f=at(l.tagName),R=at(u.tagName);return $t[l.namespaceURI]?l.namespaceURI===wt?u.namespaceURI===pe?f==="svg":u.namespaceURI===yt?f==="svg"&&(R==="annotation-xml"||Vt[R]):!!za[f]:l.namespaceURI===yt?u.namespaceURI===pe?f==="math":u.namespaceURI===wt?f==="math"&&Bt[R]:!!$a[f]:l.namespaceURI===pe?u.namespaceURI===wt&&!Bt[R]||u.namespaceURI===yt&&!Vt[R]?!1:!$a[f]&&(qs[f]||!za[f]):!!(Je==="application/xhtml+xml"&&$t[l.namespaceURI]):!1},he=function(l){Xe(e.removed,{element:l});try{w(l).removeChild(l)}catch{H(l)}},ke=function(l,u){try{Xe(e.removed,{attribute:u.getAttributeNode(l),from:u})}catch{Xe(e.removed,{attribute:null,from:u})}if(u.removeAttribute(l),l==="is")if(Ie||mt)try{he(u)}catch{}else try{u.setAttribute(l,"")}catch{}},Va=function(l){let u=null,f=null;if(Pt)l="<remove></remove>"+l;else{const F=ss(l,/^[\r\n\t ]+/);f=F&&F[0]}Je==="application/xhtml+xml"&&je===pe&&(l='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+l+"</body></html>");const R=T?T.createHTML(l):l;if(je===pe)try{u=new y().parseFromString(R,Je)}catch{}if(!u||!u.documentElement){u=_.createDocument(je,"template",null);try{u.documentElement.innerHTML=zt?E:R}catch{}}const Z=u.body||u.documentElement;return l&&f&&Z.insertBefore(t.createTextNode(f),Z.childNodes[0]||null),je===pe?Rt.call(u,xe?"html":"body")[0]:xe?u.documentElement:Z},Ba=function(l){return ce.call(l.ownerDocument||l,l,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Ut=function(l){return l instanceof C&&(typeof l.nodeName!="string"||typeof l.textContent!="string"||typeof l.removeChild!="function"||!(l.attributes instanceof d)||typeof l.removeAttribute!="function"||typeof l.setAttribute!="function"||typeof l.namespaceURI!="string"||typeof l.insertBefore!="function"||typeof l.hasChildNodes!="function")},Qt=function(l){return typeof o=="function"&&l instanceof o};function me(m,l,u){Ke(m,f=>{f.call(e,l,u,Ne)})}const Ha=function(l){let u=null;if(me(U.beforeSanitizeElements,l,null),Ut(l))return he(l),!0;const f=$(l.nodeName);if(me(U.uponSanitizeElement,l,{tagName:f,allowedTags:Q}),We&&l.hasChildNodes()&&!Qt(l.firstElementChild)&&G(/<[/\w!]/g,l.innerHTML)&&G(/<[/\w!]/g,l.textContent)||We&&l.namespaceURI===pe&&f==="style"&&Qt(l.firstElementChild)||l.nodeType===tt.progressingInstruction||We&&l.nodeType===tt.comment&&G(/<[/\w]/g,l.data))return he(l),!0;if(qe[f]||!(be.tagCheck instanceof Function&&be.tagCheck(f))&&!Q[f]){if(!qe[f]&&Qa(f)&&(O.tagNameCheck instanceof RegExp&&G(O.tagNameCheck,f)||O.tagNameCheck instanceof Function&&O.tagNameCheck(f)))return!1;if(Ot&&!ge[f]){const R=w(l)||l.parentNode,Z=g(l)||l.childNodes;if(Z&&R){const F=Z.length;for(let ae=F-1;ae>=0;--ae){const re=x(Z[ae],!0);R.insertBefore(re,p(l))}}}return he(l),!0}return l instanceof c&&!Gs(l)||(f==="noscript"||f==="noembed"||f==="noframes")&&G(/<\/no(script|embed|frames)/i,l.innerHTML)?(he(l),!0):(Se&&l.nodeType===tt.text&&(u=l.textContent,Ke([dt,gt,pt],R=>{u=Pe(u,R," ")}),l.textContent!==u&&(Xe(e.removed,{element:l.cloneNode()}),l.textContent=u)),me(U.afterSanitizeElements,l,null),!1)},Ua=function(l,u,f){if(ft[u]||Ra&&(u==="id"||u==="name")&&(f in t||f in Js))return!1;if(!(jt&&!ft[u]&&G(Vs,u))){if(!(va&&G(Bs,u))){if(!(be.attributeCheck instanceof Function&&be.attributeCheck(u,l))){if(!J[u]||ft[u]){if(!(Qa(l)&&(O.tagNameCheck instanceof RegExp&&G(O.tagNameCheck,l)||O.tagNameCheck instanceof Function&&O.tagNameCheck(l))&&(O.attributeNameCheck instanceof RegExp&&G(O.attributeNameCheck,u)||O.attributeNameCheck instanceof Function&&O.attributeNameCheck(u,l))||u==="is"&&O.allowCustomizedBuiltInElements&&(O.tagNameCheck instanceof RegExp&&G(O.tagNameCheck,f)||O.tagNameCheck instanceof Function&&O.tagNameCheck(f))))return!1}else if(!Ft[u]){if(!G(ka,Pe(f,xa,""))){if(!((u==="src"||u==="xlink:href"||u==="href")&&l!=="script"&&is(f,"data:")===0&&Pa[l])){if(!(Da&&!G(Hs,Pe(f,xa,"")))){if(f)return!1}}}}}}}return!0},Zs=b({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Qa=function(l){return!Zs[at(l)]&&G(Us,l)},qa=function(l){me(U.beforeSanitizeAttributes,l,null);const{attributes:u}=l;if(!u||Ut(l))return;const f={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0};let R=u.length;for(;R--;){const Z=u[R],{name:F,namespaceURI:ae,value:re}=Z,ue=$(F),qt=re;let q=F==="value"?qt:zi(qt);if(f.attrName=ue,f.attrValue=q,f.keepAttr=!0,f.forceKeepAttr=void 0,me(U.uponSanitizeAttribute,l,f),q=f.attrValue,ja&&(ue==="id"||ue==="name")&&is(q,Na)!==0&&(ke(F,l),q=Na+q),We&&G(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,q)){ke(F,l);continue}if(ue==="attributename"&&ss(q,"href")){ke(F,l);continue}if(f.forceKeepAttr)continue;if(!f.keepAttr){ke(F,l);continue}if(!Ia&&G(/\/>/i,q)){ke(F,l);continue}Se&&Ke([dt,gt,pt],Ja=>{q=Pe(q,Ja," ")});const Ya=$(l.nodeName);if(!Ua(Ya,ue,q)){ke(F,l);continue}if(T&&typeof I=="object"&&typeof I.getAttributeType=="function"&&!ae)switch(I.getAttributeType(Ya,ue)){case"TrustedHTML":{q=T.createHTML(q);break}case"TrustedScriptURL":{q=T.createScriptURL(q);break}}if(q!==qt)try{ae?l.setAttributeNS(ae,F,q):l.setAttribute(F,q),Ut(l)?he(l):as(e.removed)}catch{ke(F,l)}}me(U.afterSanitizeAttributes,l,null)},Wa=function(l){let u=null;const f=Ba(l);for(me(U.beforeSanitizeShadowDOM,l,null);u=f.nextNode();)me(U.uponSanitizeShadowNode,u,null),Ha(u),qa(u),u.content instanceof i&&Wa(u.content);me(U.afterSanitizeShadowDOM,l,null)};return e.sanitize=function(m){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=null,f=null,R=null,Z=null;if(zt=!m,zt&&(m="<!-->"),typeof m!="string"&&!Qt(m)&&(m=Ui(m),typeof m!="string"))throw Mt("dirty is not a string, aborting");if(!e.isSupported)return m;if(Nt||Ht(l),e.removed=[],typeof m=="string"&&(Ye=!1),Ye){const re=m.nodeName;if(typeof re=="string"){const ue=$(re);if(!Q[ue]||qe[ue])throw Mt("root node is forbidden and cannot be sanitized in-place")}}else if(m instanceof o)u=Va("<!---->"),f=u.ownerDocument.importNode(m,!0),f.nodeType===tt.element&&f.nodeName==="BODY"||f.nodeName==="HTML"?u=f:u.appendChild(f);else{if(!Ie&&!Se&&!xe&&m.indexOf("<")===-1)return T&&Lt?T.createHTML(m):m;if(u=Va(m),!u)return Ie?null:Lt?E:""}u&&Pt&&he(u.firstChild);const F=Ba(Ye?m:u);for(;R=F.nextNode();)Ha(R),qa(R),R.content instanceof i&&Wa(R.content);if(Ye)return m;if(Ie){if(Se){u.normalize();let re=u.innerHTML;Ke([dt,gt,pt],ue=>{re=Pe(re,ue," ")}),u.innerHTML=re}if(mt)for(Z=ne.call(u.ownerDocument);u.firstChild;)Z.appendChild(u.firstChild);else Z=u;return(J.shadowroot||J.shadowrootmode)&&(Z=Me.call(s,Z,!0)),Z}let ae=xe?u.outerHTML:u.innerHTML;return xe&&Q["!doctype"]&&u.ownerDocument&&u.ownerDocument.doctype&&u.ownerDocument.doctype.name&&G(Fs,u.ownerDocument.doctype.name)&&(ae="<!DOCTYPE "+u.ownerDocument.doctype.name+`>
|
|
57
|
-
`+ae),Se&&Ke([dt,gt,pt],re=>{ae=Pe(ae,re," ")}),T&&Lt?T.createHTML(ae):ae},e.setConfig=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ht(m),Nt=!0},e.clearConfig=function(){Ne=null,Nt=!1},e.isValidAttribute=function(m,l,u){Ne||Ht({});const f=$(m),R=$(l);return Ua(f,R,u)},e.addHook=function(m,l){typeof l=="function"&&Xe(U[m],l)},e.removeHook=function(m,l){if(l!==void 0){const u=_i(U[m],l);return u===-1?void 0:Fi(U[m],u,1)[0]}return as(U[m])},e.removeHooks=function(m){U[m]=[]},e.removeAllHooks=function(){U=ds()},e}var gs=zs();class nn{dataLayer;constructor(e){this.dataLayer=e}get answerWidgetShowMoreLimit(){return this.dataLayer.answerWidgetShowMoreLimit??100}get currentPage(){return this.dataLayer.searchObject?.page}get totalPages(){return this.resultsPerPage===0?0:Math.ceil(this.totalResults/this.resultsPerPage)}get totalResults(){return this.dataLayer.searchResultsMetadata?.totalResultsValue||0}get resultsPerPage(){return this.dataLayer.itemsPerPage||0}get sortOptions(){return this.dataLayer.searchResultsMetadata?.sorting.options||[]}get selectedSortOption(){return this.dataLayer.searchResultsMetadata?.sorting.selectedSortOption||""}get startResultIndex(){return(this.dataLayer.searchObject?.page-1)*this.resultsPerPage+1}get endResultIndex(){const e=(this.dataLayer.searchObject?.page-1)*this.resultsPerPage+(this.resultsPerPage??0);return e>this.totalResults?this.totalResults:e}get isFirstPage(){return this.dataLayer.searchObject?.page===1}get isLastPage(){return this.dataLayer.searchObject?.page>=Math.ceil(this.totalResults/this.resultsPerPage)}get percentageOfResultsLoaded(){return this.endResultIndex/this.totalResults*100}get results(){return this.dataLayer.searchResults??[]}get autoCorrectedQuery(){return this.dataLayer.searchResultsMetadata?.autoCorrectedQuery||""}get originalQuery(){return this.dataLayer.searchObject?.query||""}get getAnswerData(){return this.dataLayer.getAnswerData||""}get shouldShowAnswerLoadMore(){return this.dataLayer.getAnswerData.split(" ").length>this.answerWidgetShowMoreLimit}get answerTruncated(){return this.dataLayer.getAnswerData.split(" ").slice(0,this.answerWidgetShowMoreLimit).join(" ")+"..."}get fullAnswerFormatted(){return gs.sanitize(v.parse(this.dataLayer.getAnswerData)).replace(/<a /g,'<a target="_blank" class="searchstax-answer-link" rel="noopener noreferrer" ')}get answerLoading(){return this.dataLayer.answerLoading}get shouldShowAnswerError(){return this.dataLayer.answerError}get locationError(){return this.dataLayer.locationError}get shouldShowAnswer(){return(this.dataLayer.getAnswerData!==""||this.dataLayer.parsedData.answerLoading||this.shouldShowAnswerError)&&this.dataLayer.searchObject.query!=="*"}get searchTerm(){return this.dataLayer.searchResultsMetadata?.autoCorrectedQuery||this.dataLayer.searchObject?.query||""}get locationSearchEnabled(){return this.dataLayer.locationEnabled??!1}get locationSearchDistanceEnabled(){return(this.dataLayer.searchLocationConfig?.locationValuesOverride?.locationDistanceEnabled?this.dataLayer.searchLocationConfig?.locationValuesOverride?.locationDistanceEnabled:this.dataLayer.searchResultsMetadata?.location?.filter?.enabled)??!1}get locationSearchDistanceValues(){const e=this.dataLayer.searchLocationConfig?.locationValuesOverride?.filterValues??this.dataLayer.searchResultsMetadata?.location?.filter?.values,t=this.dataLayer.searchLocationConfig?.locationValuesOverride?.filterUnit??this.dataLayer.searchResultsMetadata?.location?.unit;return!e||e.length===0?[]:e.map(a=>({label:a==="any"?"Any Distance":a+" "+(t??""),value:a,isSelected:a===this.dataLayer.searchRadius})).sort((a,i)=>{const r=a.value==="any"?0:parseFloat(a.value),o=i.value==="any"?0:parseFloat(i.value);return r-o})}get shouldShowLocationDistanceDropdown(){return this.locationSearchDistanceEnabled&&this.locationSearchDistanceValues.length>1}get searchingEverything(){return this.searchTerm==="*"}get firstSearchHappened(){return this.dataLayer.firstSearchHappened}get isInfiniteScroll(){return this.dataLayer.isInfiniteScroll??!1}get answerErrorMessage(){return gs.sanitize(v.parse(this.dataLayer.answerErrorMessage)).replace("<br>","")}get searchExecuted(){return this.dataLayer.searchObject?.query!==void 0&&this.dataLayer.searchObject?.query!=="undefined"&&this.dataLayer.searchObject?.query!==""}get selectedFacets(){const e=this.dataLayer.searchFacetsCached??this.dataLayer.searchFacets;return e?(this.dataLayer.searchObject?.facets??[]).map(a=>{const i=a.name,r=a.value,o=e.find(c=>c.name===i);if(o){const c=o.values.find(h=>h.type==="range"?!1:h.type==="checkbox"?'"'+h.value+'"'===r:!1);if(c)return c}return null}).filter(a=>a!==null):[]}get cachedANDFacets(){let e="";for(const t of this.dataLayer.searchObject.facets)(t.type==="and"||t.type==="tabs")&&(e+=JSON.stringify(t));return e}get relatedSearches(){const e=this.dataLayer.searchRelatedSearches??[];return e[e.length-1]&&(e[e.length-1].last=!0),e}get externalPromotions(){return this.dataLayer.searchExternalPromotions??[]}get data(){return{currentPage:this.currentPage,totalPages:this.totalPages,totalResults:this.totalResults,resultsPerPage:this.resultsPerPage,startResultIndex:this.startResultIndex,endResultIndex:this.endResultIndex,isFirstPage:this.isFirstPage,isLastPage:this.isLastPage,results:this.results,searchTerm:this.searchTerm!=="undefined"?this.searchTerm:"",autoCorrectedQuery:this.autoCorrectedQuery,originalQuery:this.originalQuery,selectedFacets:this.selectedFacets,searchExecuted:this.searchExecuted,searchingEverything:this.searchingEverything,relatedSearches:this.relatedSearches,hasRelatedSearches:this.relatedSearches.length>0,externalPromotions:this.externalPromotions,hasExternalPromotions:this.externalPromotions.length>0,hasResults:this.results.length>0,hasResultsOrExternalPromotions:this.results.length>0||this.externalPromotions.length>0,answer:this.getAnswerData,answerTruncated:this.answerTruncated,fullAnswerFormatted:this.fullAnswerFormatted,shouldShowAnswerLoadMore:this.shouldShowAnswerLoadMore,answerLoading:this.answerLoading,shouldShowAnswer:this.shouldShowAnswer,isInfiniteScroll:this.isInfiniteScroll,percentageOfResultsLoaded:this.percentageOfResultsLoaded,firstSearchHappened:this.firstSearchHappened,sortOptions:this.sortOptions,selectedSortOption:this.selectedSortOption,shouldShowAnswerError:this.shouldShowAnswerError,answerErrorMessage:this.answerErrorMessage,locationSearchEnabled:this.locationSearchEnabled,locationSearchDistanceEnabled:this.locationSearchDistanceEnabled,locationSearchDistanceValues:this.locationSearchDistanceValues,shouldShowLocationDistanceDropdown:this.shouldShowLocationDistanceDropdown,locationError:this.locationError}}get trackingData(){return{searchTerm:this.searchTerm,trackApiKey:this.dataLayer.searchstaxConfig?.trackApiKey??"",session:this.dataLayer.sessionIdValue,language:this.dataLayer.language,recordsPerPage:this.dataLayer.searchResultsMetadata?.recordsPerPageValue??0,totalResults:this.dataLayer.searchResultsMetadata?.totalResultsValue??0,currentPage:this.dataLayer.currentPage,latencyVal:this.dataLayer.searchResultsMetadata?.latency??0,...this.dataLayer.model?{model:this.dataLayer.model}:{}}}}class oe{static deepEqual(e,t){const s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;for(const i of s){const r=e[i],o=t[i],c=this.isObject(r)&&this.isObject(o);if(c&&!this.deepEqual(r,o)||!c&&r!==o)return!1}return!0}static isObject(e){return e!=null&&typeof e=="object"}}class M{value;observers={};constructor(e){this.value=e,this.observers={}}subscribe(e,t){const s=Math.random().toString(36).substring(2,15),a=t||s;return this.observers[a]=e,e(this.value),a}unsubscribe(e){this.observers[e]&&delete this.observers[e]}subscribeOnce(e){const t=Math.random().toString(36).substring(2,15),s=a=>{e(a),this.unsubscribe(t)};this.subscribe(s,t)}subscribeTwice(e){const t=Math.random().toString(36).substring(2,15);let s=0;const a=i=>{s++,e(i),s>=2&&this.unsubscribe(t)};this.subscribe(a,t)}subscribeUntil(e,t,s=6e3,a=!0){const i=Math.random().toString(36).substring(2,15),r=o=>{o===t&&(e(o),this.unsubscribe(i))};return this.value===t?(e(this.value),null):(this.subscribe(r,i),setTimeout(()=>{a&&this.observers[i]&&e(this.value),this.unsubscribe(i)},s),i)}subscribeUntilHasValue(e,t=6e3,s=!0){const a=Math.random().toString(36).substring(2,15),i=r=>{r!=null&&(e(r),this.unsubscribe(a))};return this.value!==null&&this.value!==void 0?(e(this.value),null):(this.subscribe(i,a),t>0&&setTimeout(()=>{s&&this.observers[a]&&e(this.value),this.unsubscribe(a)},t),i)}setValue(e){this.value=e,this.notify()}getValue(){return this.value}notify(){for(const e in this.observers)if(Object.prototype.hasOwnProperty.call(this.observers,e)){const t=this.observers[e];typeof t=="function"&&t(this.value)}}}class Kt{static getOrSetCookie(e,t){let s=this.getCookie(e);return s==null&&(s=t??this.makeid(25),this.setCookie(e,s,{secure:!0,"max-age":3600})),s}static deleteCookie(e){this.getCookie(e)&&this.setCookie(e,"",{secure:!0,"max-age":-1})}static makeid(e){let t="";const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=s.length;for(let i=0;i<e;i++)t+=s.charAt(Math.floor(Math.random()*a));return t}static getCookie(e){const t=typeof document<"u"?document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")+"=([^;]*)")):null;return t?decodeURIComponent(t[1]):void 0}static setCookie(e,t,s){const a={path:"/",...s};s.expires instanceof Date&&(a.expires=s.expires.toUTCString());let i=encodeURIComponent(e)+"="+encodeURIComponent(t);for(const r in a){i+="; "+r;const o=a[r];o!==!0&&(i+="="+o)}typeof document<"u"&&(document.cookie=i)}}class Y{static removeXSSRiskyTags(e){var t="script|style|iframe|object|embed|form|input|button",s=new RegExp("</?("+t+")(\\s[^>]*)?>","gi");return e?e.replace(s,""):""}}class rn{$searchTermChange=new M("");$searchLocationChange=new M("");$searchLocationCoordinatesDecoded=new M("");$searchLatChange=new M("");$searchLongChange=new M("");$searchRadiusChange=new M(void 0);$loadingChange=new M(!1);$locationError=new M(!1);$searchResults=new M(null);$searchResultsMetadata=new M(null);$searchAutosuggest=new M(null);$searchFacets=new M(null);$searchFacetsCached=new M(null);$searchFacetsCachedTabs=new M(null);$searchstaxConfig=new M(null);$autosuggestResults=new M(null);$itemsPerPage=new M(void 0);$searchObject=new M({query:"",itemsPerPage:void 0,page:99999999,order:"",facets:[],additionalProps:[],location:{term:void 0,radius:void 0,lat:void 0,lon:void 0},model:""});$searchRelatedSearches=new M(null);$searchInputConfig=new M(null);$searchLocationConfig=new M(null);$searchExternalPromotions=new M(null);$facetsTemplateData=new M(null);$selectedFacetsTemplateData=new M(null);$paginationData=new M(null);$answerData=new M(null);$searchFeedbackData=new M(null);$inputWidgetTemplateData=new M(null);$locationWidgetTemplateData=new M(null);$searchSortingData=new M(null);$searchRelatedSearchesData=new M(null);$searchExternalPromotionsData=new M(null);$cookiesDisabled=new M(null);$locationDecodingLoading=new M(!1);$answer=new M("");$language=new M("en");$model=new M("");$answerLoading=new M(!1);$locationEnabled=new M(null);$answerError=new M(!1);$answerErrorMessage=new M("");$isQuestion=new M(!1);$inputTemplateRendered=new M(!1);currentPageValue=1;isAnswerWidgetCreatedValue=!1;renderingEngineValue=P.mustache;parsedData=new nn(this);sessionId;sessionIdValue=null;autoCorrect=!0;forceNotCorrect=!1;lastSearchValue="";turnAIAnswerGenerationOn=!1;questionURL="";isInfiniteScroll=!1;firstSearchHappened=!1;facetsWereSet=!1;answerWidgetShowMoreLimit=100;searchHelper;searchResultUnparsed;constructor(e,t){this.sessionId=e,t&&(this.sessionIdValue=t),this.cookieHandlingCallback(t),this.$cookiesDisabled.subscribe(()=>{this.cookieHandlingCallback(t)})}cookieHandlingCallback(e){this.cookiesDisabled?(this.sessionIdValue=null,Kt.deleteCookie(this.sessionId),Kt.deleteCookie("ms_visitorid")):this.sessionIdValue=Kt.getOrSetCookie(this.sessionId,e)}setIsInfiniteScroll(e){this.isInfiniteScroll=e}setSearchTerm(e){this.$searchTermChange.setValue(Y.removeXSSRiskyTags(e))}setSearchLocation(e){this.$searchLocationChange.setValue(Y.removeXSSRiskyTags(e))}setSearchRadius(e){this.$searchRadiusChange.setValue(e)}setRenderingEngine(e){this.renderingEngineValue=e}setCurrentPage(e){this.currentPageValue=e}setIsAnswerWidgetCreated(e){this.isAnswerWidgetCreatedValue=e}setLoading(e){this.$loadingChange.setValue(e)}setSearchResults(e){this.firstSearchHappened=!0,(!oe.deepEqual(e,this.searchResults??[""])||this.facetsWereSet)&&(this.facetsWereSet=!1,this.$searchResults.setValue(e))}setSearchResultsMetadata(e){oe.deepEqual(e,this.searchResultsMetadata??{})||this.$searchResultsMetadata.setValue(e)}setSearchAutosuggest(e){this.$searchAutosuggest.setValue(e)}setSearchObject(e){let t=e;t={...t,itemsPerPage:this.itemsPerPage,model:this.model},this.searchstaxConfig?.hooks?.beforeSearch&&t&&(t=this.searchstaxConfig.hooks.beforeSearch(t)),t&&(!oe.deepEqual(t,this.searchObject??{})||this.forceNotCorrect)&&this.$searchObject.setValue(t)}setSearchFacets(e){this.facetsWereSet=!0,oe.deepEqual(e,this.searchFacets??[])||this.$searchFacets.setValue(e)}setSearchFacetsCached(e){oe.deepEqual(e,this.searchFacetsCached??[])||this.$searchFacetsCached.setValue(e)}setSearchFacetsCachedTabs(e){oe.deepEqual(e,this.searchFacetsCachedTabs??[])||this.$searchFacetsCachedTabs.setValue(e)}setSearchRelatedSearches(e){oe.deepEqual(e,this.searchRelatedSearches??[])||this.$searchRelatedSearches.setValue(e)}setSearchExternalPromotions(e){oe.deepEqual(e,this.searchExternalPromotions??[])||this.$searchExternalPromotions.setValue(e)}setLanguage(e){this.$language.setValue(e)}setModel(e){this.$model.setValue(e)}setSearchstaxConfig(e){this.$searchstaxConfig.setValue(e)}setSearchInputConfig(e){this.$searchInputConfig.setValue(e)}setSearchLocationConfig(e){this.$searchLocationConfig.setValue(e)}setAutosuggestResults(e){this.$autosuggestResults.setValue(e)}setFacetsTemplateData(e){this.$facetsTemplateData.setValue(e)}setSelectedFacetsTemplateData(e){this.$selectedFacetsTemplateData.setValue(e)}setPaginationData(e){this.$paginationData.setValue(e)}setAnswerFullData(e){this.$answerData.setValue(e)}setSearchFeedbackData(e){this.$searchFeedbackData.setValue(e)}setSearchSortingData(e){this.$searchSortingData.setValue(e)}setRelatedSearchesData(e){this.$searchRelatedSearchesData.setValue(e)}setExternalPromotionsData(e){this.$searchExternalPromotionsData.setValue(e)}setCookiesDisabled(e){this.$cookiesDisabled.setValue(e)}setAnswerData(e){this.$answer.setValue(e)}setItemsPerPage(e){this.$itemsPerPage.setValue(e)}setAnswerLoading(e){this.$answerLoading.setValue(e)}setAnswerError(e){this.$answerError.setValue(e)}setIsQuestion(e){this.$isQuestion.setValue(e)}setAnswerErrorMessage(e){this.$answerErrorMessage.setValue(e)}setLocationDecodingLoading(e){this.$locationDecodingLoading.setValue(e)}setSearchLat(e){this.$searchLatChange.setValue(e)}setSearchLong(e){this.$searchLongChange.setValue(e)}setInputTemplateRendered(e){this.$inputTemplateRendered.setValue(e)}setLocationError(e){this.$locationError.setValue(e)}setInputWidgetTemplateData(e){this.$inputWidgetTemplateData.setValue(e)}setLocationWidgetTemplateData(e){this.$locationWidgetTemplateData.setValue(e)}setLocationCoordinatesDecoded(e){this.$searchLocationCoordinatesDecoded.setValue(Y.removeXSSRiskyTags(e))}setLocationEnabled(e){this.$locationEnabled.setValue(e)}setSearchResultUnparsedData(e){this.searchResultUnparsed=e}get getAnswerData(){return this.$answer.getValue()}get searchstaxConfig(){return this.$searchstaxConfig.getValue()}get searchFacets(){return this.$searchFacets.getValue()?JSON.parse(JSON.stringify(this.$searchFacets.getValue())):null}get searchFacetsCached(){return this.$searchFacetsCached.getValue()?JSON.parse(JSON.stringify(this.$searchFacetsCached.getValue())):null}get searchFacetsCachedTabs(){return this.$searchFacetsCachedTabs.getValue()?JSON.parse(JSON.stringify(this.$searchFacetsCachedTabs.getValue())):null}get searchResults(){return this.$searchResults.getValue()?JSON.parse(JSON.stringify(this.$searchResults.getValue())):null}get searchTerm(){return this.$searchTermChange.getValue()}get searchLocation(){return this.$searchLocationChange.getValue()}get searchRadius(){return this.$searchRadiusChange.getValue()}get loading(){return this.$loadingChange.getValue()}get searchAutosuggest(){return this.$searchAutosuggest.getValue()}get searchResultsMetadata(){return this.$searchResultsMetadata.getValue()?JSON.parse(JSON.stringify(this.$searchResultsMetadata.getValue())):null}get currentPage(){return this.$searchObject.getValue().page??this.currentPageValue}get isAnswerWidgetCreated(){return this.isAnswerWidgetCreatedValue}get renderingEngine(){return this.renderingEngineValue}get searchObject(){return JSON.parse(JSON.stringify(this.$searchObject.getValue()))}get searchRelatedSearches(){return this.$searchRelatedSearches.getValue()?JSON.parse(JSON.stringify(this.$searchRelatedSearches.getValue())):null}get searchExternalPromotions(){return this.$searchExternalPromotions.getValue()?JSON.parse(JSON.stringify(this.$searchExternalPromotions.getValue())):null}get language(){return this.$language.getValue()}get model(){return this.$model.getValue()}get searchInputConfig(){return this.$searchInputConfig.getValue()}get searchLocationConfig(){return this.$searchLocationConfig.getValue()}get answerConfig(){return this.$answer.getValue()}get autosuggestResults(){return this.$autosuggestResults.getValue()}get facetsTemplateData(){return this.$facetsTemplateData.getValue()}get selectedFacetsTemplateData(){return this.$selectedFacetsTemplateData.getValue()}get paginationData(){return this.$paginationData.getValue()}get searchFeedbackData(){return this.$searchFeedbackData.getValue()}get searchSortingData(){return this.$searchSortingData.getValue()}get searchRelatedSearchesData(){return this.$searchRelatedSearchesData.getValue()}get searchExternalPromotionsData(){return this.$searchExternalPromotionsData.getValue()}get cookiesDisabled(){return(this.$cookiesDisabled.getValue()??!1)||!navigator.cookieEnabled}get itemsPerPage(){return this.$itemsPerPage.getValue()}get answerFullData(){return this.$answerData.getValue()}get answerLoading(){return this.$answerLoading.getValue()}get isQuestion(){return this.$isQuestion.getValue()}get answerError(){return this.$answerError.getValue()}get answerErrorMessage(){return this.$answerErrorMessage.getValue()}get locationDecodingLoading(){return this.$locationDecodingLoading.getValue()}get searchLat(){return this.$searchLatChange.getValue()}get searchLong(){return this.$searchLongChange.getValue()}get inputTemplateRendered(){return this.$inputTemplateRendered.getValue()}get locationError(){return this.$locationError.getValue()}get inputWidgetTemplateData(){return this.$inputWidgetTemplateData.getValue()}get locationWidgetTemplateData(){return this.$locationWidgetTemplateData.getValue()}get searchLocationCoordinatesDecoded(){return this.$searchLocationCoordinatesDecoded.getValue()}get locationEnabled(){return this.$locationEnabled.getValue()}get searchResultUnparsedData(){return this.searchResultUnparsed}}class st{static combineResultsWithMetadata(e){const t=[],s=parseInt(e.response.start+"");return e.response.docs.forEach((a,i)=>{const r=a[e.responseHeader.params.uniqueId]??"",o={custom:null,uniqueId:r,position:s+1+i,ribbon:this.doesMapExist("ribbon",e)?this.getValueByKey("ribbon",a,e,r):null,paths:this.doesMapExist("paths",e)?this.getValueByKey("paths",a,e,r):null,url:this.doesMapExist("url",e)?this.getValueByKey("url",a,e,r):null,title:this.doesMapExist("title",e)?this.getValueByKey("title",a,e,r):null,titleTracking:this.doesMapExist("title",e)?this.getValueByKey("title",a,e,r,!0):null,promoted:a["[elevated]"]?a["[elevated]"]:!1,thumbnail:this.doesMapExist("thumbnail",e)?this.getValueByKey("thumbnail",a,e,r):null,date:this.doesMapExist("date",e)?this.getValueByKey("date",a,e,r):null,snippet:this.doesMapExist("snippet",e)?this.getValueByKey("snippet",a,e,r):null,description:this.doesMapExist("description",e)?this.getValueByKey("description",a,e,r):null,distance:this.doesMapExist("distance",e)&&this.getValueByKey("distance",a,e,r)!=="Infinity"&&this.getValueByKey("distance",a,e,r)?Math.floor(this.getValueByKey("distance",a,e,r)):null,unit:e.metadata.locationSearch?.unit??"",unmappedFields:this.getUnmappedFields(a,e,r),allFields:this.getAllFields(a,e)};t.push(o)}),t}static extractFacets(e){const t=[];if(e.metadata.facets)for(const s of e.metadata.facets){let a={values:[]};if(a.name=s.name,a.label=s.label,s.name in e.facet_counts.facet_fields){const i=e.facet_counts.facet_fields[s.name];for(let r=0;r<i.length;r+=2){const o={};o.value=i[r],o.parentName=a.name,o.count=i[r+1],o.type="checkbox",a.values.push(o)}}a.values.length>0&&t.push(a)}return t}static extractSearchResultsMetadata(e){let t="",s={selectedSortOption:"",options:[]},a={enabled:!1,field:"",unit:"",filter:{enabled:!1,values:[],label:"",defaultValue:""}};if(e.metadata.locationSearch&&(a={enabled:e.metadata.locationSearch.enabled,field:e.metadata.locationSearch.field,unit:e.metadata.locationSearch.unit,filter:{enabled:e.metadata.locationSearch.filter?.enabled??!1,values:e.metadata.locationSearch.filter?.values??[],label:e.metadata.locationSearch.filter?.label??"",defaultValue:e.metadata.locationSearch.filter?.defaultValue??""}}),e.metadata.results.find(i=>i.result_card==="date")?.name,s.options=[],e.metadata.sorts?.length){const i=e.metadata.sorts.map(r=>({value:r.label,key:r.name+" "+r.order}));s.options=[{key:"",value:"Relevance"},...i]}return t=e?.spellcheck?.suggestions?.[1]?.suggestion?.[0]??"",typeof t!="string"&&(t=t?.word??""),{recordsPerPageValue:parseInt(e.responseHeader.params.rows),startDocVal:parseInt(e.response.start+""),totalResultsValue:parseInt(e.response.numFound+""),latency:parseInt(e.responseHeader.QTime+""),endDocValue:parseInt(e.responseHeader.params.rows)+parseInt(e.response.start+""),spellingSuggestion:t,autoCorrectedQuery:e.responseHeader.params.autoCorrectedQ??"",impressions:this.getImpressions(e),sorting:s,location:a,isLocationMapped:this.doesMapExist("distance",e)}}static getImpressions(e){const t=[],s=this.combineResultsWithMetadata(e);for(const a in s){const i=s[a],r={};r.cDocId=this.getDataForAnalytics(i.uniqueId),i.title&&(r.cDocTitle=this.getDataForAnalytics(i.titleTracking)),r.position=i.position,t.push(r)}return t}static getDataForAnalytics(e){return e!==null?typeof e>"u"?"":typeof e=="string"?e:typeof e.join<"u"?e[0]:e:""}static findResultByUniqueId(e,t){return t.find(s=>s.uniqueId===e)??null}static getUnmappedFields(e,t,s){const a=t.metadata.results.filter(r=>r.result_card==="").map(r=>r.name),i=[];for(const r of a)if(Object.keys(e).includes(r)){const o=Array.isArray(e[r])?this.getHighlightedResults(r,e[r].join(", "),s,t):this.getHighlightedResults(r,e[r]+"",s,t);i.push({key:r,value:o,isImage:this.checkIfImage(e[r])})}return i}static checkIfImage(e){return e===void 0?!1:typeof e!="string"?Array.isArray(e)&&e[0]?/\.(gif|jpe?g|tiff?|png|webp|bmp)$/i.test(e[0]):!1:/\.(gif|jpe?g|tiff?|png|webp|bmp)$/i.test(e)}static getAllFields(e,t){const s=t.metadata.results.map(i=>i.name),a=[];for(const i of Object.keys(e))s.indexOf(i)!==-1&&a.push({key:i,value:e[i],isImage:this.checkIfImage(e[i])});return a}static doesMapExist(e,t){return t.metadata.results.find(s=>s.result_card===e)!==void 0}static getValueByKey(e,t,s,a,i=!1){const r=s.metadata.results.find(c=>c.result_card===e);if(r===void 0)return null;const o=t[r.name];return o===void 0?null:typeof o=="string"?i?o:this.getHighlightedResults(r.name,o,a,s):typeof o=="number"?o:Array.isArray(o)?i?o.join(", "):this.getHighlightedResults(r.name,o.join(", "),a,s):null}static getHighlightedResults(e,t,s,a){if(a.highlighting&&s in a.highlighting){let i=a.highlighting[s];if(i&&e in i){let r=i[e];const o=this.cleanValue(r);if(o!=="")return o}}return t}static cleanValue(e){return e===null?"":typeof e=="string"?e:Array.isArray(e)?e.join(" "):""}}class ps{routeName="searchstax";ignoredKeys=[];queryStringHelper;titleParser;constructor(e){e.routeName&&(this.routeName=e.routeName),e.ignoredKeys&&(this.ignoredKeys=e.ignoredKeys),e.title&&(this.titleParser=e.title),this.queryStringHelper=new on(this.routeName)}updateUrl(e){const t=this.searchObjectToUrl(e);let s=typeof document<"u"?document?.title:"";this.titleParser&&(s=this.titleParser(e)),typeof document<"u"&&(document.title=s),window?.location.href!==t&&window?.history.replaceState(window.history.state,s,t)}searchObjectToUrl(e){return this.queryStringHelper.urlHasQueryParams(window?.location.href??"")?window?.location.href.split("?")[0]+"?"+this.queryStringHelper.stringify(this.searchObjectToParams(e),{ignoredKeys:this.ignoredKeys}):window?.location.href+"?"+this.queryStringHelper.stringify(this.searchObjectToParams(e),{ignoredKeys:this.ignoredKeys})}searchObjectToParams(e){const t={},s=e.page||1;if(e.query&&(t[this.routeName+"[query]"]=encodeURIComponent(e.query)),e.page&&(t[this.routeName+"[page]"]=s+""),e.order&&(t[this.routeName+"[order]"]=e.order),e.itemsPerPage&&e.itemsPerPage!==10&&(t[this.routeName+"[itemsPerPage]"]=e.itemsPerPage+""),e.location)for(const a in e.location){const i=e.location[a];i&&(t[this.routeName+`[location][${a}]`]=i)}if(e.facets)for(const a in e.facets){const i=e.facets[a].type+":"+encodeURIComponent(e.facets[a].name)+":"+encodeURIComponent(e.facets[a].value);t[this.routeName+`[facets][${a}]`]=i}if(e.model&&(t[this.routeName+"[model]"]=e.model),this.queryStringHelper.urlHasQueryParams(window?.location.href??"")){const a=this.queryStringHelper.urlToParams(window?.location.href??"");for(const i in a)i.startsWith(this.routeName)&&delete a[i];return{...a,...t}}else return t}extractParamsThatDoNotStartWithRouteName(e){const t={};for(const s in e)s.startsWith(this.routeName)||(t[s]=e[s]);return t}extractArrayOfFacetsFromQueryParameters(e){const t=[];for(const s in e)if(s.startsWith(this.routeName+"[facets]")){const a=Y.removeXSSRiskyTags(e[s].split(":")?.[0]),i=Y.removeXSSRiskyTags(decodeURIComponent(e[s].split(":")?.[1])),r=Y.removeXSSRiskyTags(decodeURIComponent(e[s].split(":")?.[2]));t.push({type:a,name:i,value:r})}return t}urlToSearchObject(e,t){const s=this.queryStringHelper.urlToParams(e),a=Y.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[page]"])),i=parseInt(a),r=isNaN(i)?1:i;let o=parseInt(Y.removeXSSRiskyTags(s[this.routeName+"[itemsPerPage]"]));return isNaN(o)&&(o=10),{query:Y.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[query]"]))||"",page:r,itemsPerPage:t??o,order:Y.removeXSSRiskyTags(s[this.routeName+"[order]"])||"",facets:this.extractArrayOfFacetsFromQueryParameters(s)||[],model:Y.removeXSSRiskyTags(s[this.routeName+"[model]"])||"",location:{address:Y.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][address]"]||"")),radius:Y.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][radius]"]||"")),lat:Y.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lat]"]||"")),lon:Y.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lon]"]||""))}}}}class on{routeName="";constructor(e){this.routeName=e}stringify=(e,t)=>{const s=this.filterOutIgnoredKeys(e,t.ignoredKeys);return Object.keys(s).map(a=>{const i=s[a];return Array.isArray(i)?i.map(r=>`${a}=${r}`).join("&"):`${a}=${i}`}).join("&")};filterOutIgnoredKeys(e,t){const s=t||[],a={};return Object.keys(e).forEach(i=>{s.includes(i)||e[i]!==""&&(a[i]=e[i])}),a}urlToParams(e){const t={},s=e.split("?")[1];return s&&s.split("&").forEach(a=>{const[i,r]=a.split("=");t[i]=r}),t}doesParamContainRouteName(e){return e.indexOf(this.routeName)!==-1}urlHasQueryParams(e){return e.indexOf("?")!==-1}}const Ve={question:"I_AM_A_QUESTION",notQuestion:"I_AM_NOT_A_QUESTION",close:"CLOSE"};class fs extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const ms=10,ln=13,Ae=32;function Xt(n){}function cn(n){if(typeof n=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=Xt,onError:t=Xt,onRetry:s=Xt,onComment:a}=n,i=[];let r=!0,o,c="",h=0,d;function C(p){if(r&&(r=!1,p.charCodeAt(0)===239&&p.charCodeAt(1)===187&&p.charCodeAt(2)===191&&(p=p.slice(3))),i.length===0){const T=y(p);T!==""&&i.push(T);return}if(p.indexOf(`
|
|
56
|
+
Please report this to https://github.com/markedjs/marked.`,n){const s="<p>An error occurred:</p><pre>"+fe(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},ve=new ji;function v(n,e){return ve.parse(n,e)}v.options=v.setOptions=function(n){return ve.setOptions(n),v.defaults=ve.defaults,xs(v.defaults),v};v.getDefaults=pa;v.defaults=De;v.use=function(...n){return ve.use(...n),v.defaults=ve.defaults,xs(v.defaults),v};v.walkTokens=function(n,e){return ve.walkTokens(n,e)};v.parseInline=ve.parseInline;v.Parser=Ce;v.parser=Ce.parse;v.Renderer=Et;v.TextRenderer=ba;v.Lexer=we;v.lexer=we.lex;v.Tokenizer=At;v.Hooks=Tt;v.parse=v;v.options;v.setOptions;v.use;v.walkTokens;v.parseInline;Ce.parse;we.lex;const{entries:Os,setPrototypeOf:ts,isFrozen:Ni,getPrototypeOf:Pi,getOwnPropertyDescriptor:Oi}=Object;let{freeze:ee,seal:le,create:Oe}=Object,{apply:ia,construct:na}=typeof Reflect<"u"&&Reflect;ee||(ee=function(e){return e});le||(le=function(e){return e});ia||(ia=function(e,t){for(var s=arguments.length,a=new Array(s>2?s-2:0),i=2;i<s;i++)a[i-2]=arguments[i];return e.apply(t,a)});na||(na=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),a=1;a<t;a++)s[a-1]=arguments[a];return new e(...s)});const Ke=z(Array.prototype.forEach),_i=z(Array.prototype.lastIndexOf),as=z(Array.prototype.pop),Xe=z(Array.prototype.push),Fi=z(Array.prototype.splice),K=Array.isArray,at=z(String.prototype.toLowerCase),Wt=z(String.prototype.toString),ss=z(String.prototype.match),Pe=z(String.prototype.replace),is=z(String.prototype.indexOf),zi=z(String.prototype.trim),$i=z(Number.prototype.toString),Vi=z(Boolean.prototype.toString),ns=typeof BigInt>"u"?null:z(BigInt.prototype.toString),rs=typeof Symbol>"u"?null:z(Symbol.prototype.toString),N=z(Object.prototype.hasOwnProperty),et=z(Object.prototype.toString),G=z(RegExp.prototype.test),Mt=Bi(TypeError);function z(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,s=new Array(t>1?t-1:0),a=1;a<t;a++)s[a-1]=arguments[a];return ia(n,e,s)}}function Bi(n){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return na(n,t)}}function b(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:at;if(ts&&ts(n,null),!K(e))return n;let s=e.length;for(;s--;){let a=e[s];if(typeof a=="string"){const i=t(a);i!==a&&(Ni(e)||(e[s]=i),a=i)}n[a]=!0}return n}function Hi(n){for(let e=0;e<n.length;e++)N(n,e)||(n[e]=null);return n}function se(n){const e=Oe(null);for(const[t,s]of Os(n))N(n,t)&&(K(s)?e[t]=Hi(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=se(s):e[t]=s);return e}function Ui(n){switch(typeof n){case"string":return n;case"number":return $i(n);case"boolean":return Vi(n);case"bigint":return ns?ns(n):"0";case"symbol":return rs?rs(n):"Symbol()";case"undefined":return et(n);case"function":case"object":{if(n===null)return et(n);const e=n,t=_e(e,"toString");if(typeof t=="function"){const s=t(e);return typeof s=="string"?s:et(s)}return et(n)}default:return et(n)}}function _e(n,e){for(;n!==null;){const s=Oi(n,e);if(s){if(s.get)return z(s.get);if(typeof s.value=="function")return z(s.value)}n=Pi(n)}function t(){return null}return t}function Qi(n){try{return G(n,""),!0}catch{return!1}}const os=ee(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Yt=ee(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Jt=ee(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),qi=ee(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Gt=ee(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Wi=ee(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ls=ee(["#text"]),cs=ee(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Zt=ee(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),hs=ee(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),bt=ee(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Yi=le(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ji=le(/<%[\w\W]*|[\w\W]*%>/gm),Gi=le(/\$\{[\w\W]*/gm),Zi=le(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ki=le(/^aria-[\-\w]+$/),_s=le(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Xi=le(/^(?:\w+script|data):/i),en=le(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fs=le(/^html$/i),tn=le(/^[a-z][.\w]*(-[.\w]+)+$/i);var us=Object.freeze({__proto__:null,ARIA_ATTR:Ki,ATTR_WHITESPACE:en,CUSTOM_ELEMENT:tn,DATA_ATTR:Zi,DOCTYPE_NAME:Fs,ERB_EXPR:Ji,IS_ALLOWED_URI:_s,IS_SCRIPT_OR_DATA:Xi,MUSTACHE_EXPR:Yi,TMPLIT_EXPR:Gi});const tt={element:1,text:3,progressingInstruction:7,comment:8,document:9},an=function(){return typeof window>"u"?null:window},sn=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null;const a="data-tt-policy-suffix";t&&t.hasAttribute(a)&&(s=t.getAttribute(a));const i="dompurify"+(s?"#"+s:"");try{return e.createPolicy(i,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},ds=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function zs(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:an();const e=m=>zs(m);if(e.version="3.4.2",e.removed=[],!n||!n.document||n.document.nodeType!==tt.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const s=t,a=s.currentScript,{DocumentFragment:i,HTMLTemplateElement:r,Node:o,Element:c,NodeFilter:h,NamedNodeMap:d=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:C,DOMParser:y,trustedTypes:I}=n,S=c.prototype,x=_e(S,"cloneNode"),H=_e(S,"remove"),p=_e(S,"nextSibling"),g=_e(S,"childNodes"),w=_e(S,"parentNode");if(typeof r=="function"){const m=t.createElement("template");m.content&&m.content.ownerDocument&&(t=m.content.ownerDocument)}let T,E="";const{implementation:_,createNodeIterator:ce,createDocumentFragment:ne,getElementsByTagName:Rt}=t,{importNode:Me}=s;let U=ds();e.isSupported=typeof Os=="function"&&typeof w=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:dt,ERB_EXPR:gt,TMPLIT_EXPR:pt,DATA_ATTR:Vs,ARIA_ATTR:Bs,IS_SCRIPT_OR_DATA:Hs,ATTR_WHITESPACE:xa,CUSTOM_ELEMENT:Us}=us;let{IS_ALLOWED_URI:ka}=us,Q=null;const Aa=b({},[...os,...Yt,...Jt,...Gt,...ls]);let J=null;const Ea=b({},[...cs,...Zt,...hs,...bt]);let O=Object.seal(Oe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),qe=null,ft=null;const be=Object.seal(Oe(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let va=!0,jt=!0,Da=!1,Ia=!0,Se=!1,We=!0,xe=!1,Nt=!1,Pt=!1,Ie=!1,mt=!1,Lt=!1,Ra=!0,ja=!1;const Na="user-content-";let Ot=!0,Ye=!1,Re={},ge=null;const _t=b({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Pa=null;const Oa=b({},["audio","video","img","source","image","track"]);let Ft=null;const _a=b({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yt="http://www.w3.org/1998/Math/MathML",wt="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml";let je=pe,zt=!1,$t=null;const Qs=b({},[yt,wt,pe],Wt);let Vt=b({},["mi","mo","mn","ms","mtext"]),Bt=b({},["annotation-xml"]);const qs=b({},["title","style","font","a","script"]);let Je=null;const Ws=["application/xhtml+xml","text/html"],Ys="text/html";let $=null,Ne=null;const Js=t.createElement("form"),Fa=function(l){return l instanceof RegExp||l instanceof Function},Ht=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ne&&Ne===l)return;(!l||typeof l!="object")&&(l={}),l=se(l),Je=Ws.indexOf(l.PARSER_MEDIA_TYPE)===-1?Ys:l.PARSER_MEDIA_TYPE,$=Je==="application/xhtml+xml"?Wt:at,Q=N(l,"ALLOWED_TAGS")&&K(l.ALLOWED_TAGS)?b({},l.ALLOWED_TAGS,$):Aa,J=N(l,"ALLOWED_ATTR")&&K(l.ALLOWED_ATTR)?b({},l.ALLOWED_ATTR,$):Ea,$t=N(l,"ALLOWED_NAMESPACES")&&K(l.ALLOWED_NAMESPACES)?b({},l.ALLOWED_NAMESPACES,Wt):Qs,Ft=N(l,"ADD_URI_SAFE_ATTR")&&K(l.ADD_URI_SAFE_ATTR)?b(se(_a),l.ADD_URI_SAFE_ATTR,$):_a,Pa=N(l,"ADD_DATA_URI_TAGS")&&K(l.ADD_DATA_URI_TAGS)?b(se(Oa),l.ADD_DATA_URI_TAGS,$):Oa,ge=N(l,"FORBID_CONTENTS")&&K(l.FORBID_CONTENTS)?b({},l.FORBID_CONTENTS,$):_t,qe=N(l,"FORBID_TAGS")&&K(l.FORBID_TAGS)?b({},l.FORBID_TAGS,$):se({}),ft=N(l,"FORBID_ATTR")&&K(l.FORBID_ATTR)?b({},l.FORBID_ATTR,$):se({}),Re=N(l,"USE_PROFILES")?l.USE_PROFILES&&typeof l.USE_PROFILES=="object"?se(l.USE_PROFILES):l.USE_PROFILES:!1,va=l.ALLOW_ARIA_ATTR!==!1,jt=l.ALLOW_DATA_ATTR!==!1,Da=l.ALLOW_UNKNOWN_PROTOCOLS||!1,Ia=l.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Se=l.SAFE_FOR_TEMPLATES||!1,We=l.SAFE_FOR_XML!==!1,xe=l.WHOLE_DOCUMENT||!1,Ie=l.RETURN_DOM||!1,mt=l.RETURN_DOM_FRAGMENT||!1,Lt=l.RETURN_TRUSTED_TYPE||!1,Pt=l.FORCE_BODY||!1,Ra=l.SANITIZE_DOM!==!1,ja=l.SANITIZE_NAMED_PROPS||!1,Ot=l.KEEP_CONTENT!==!1,Ye=l.IN_PLACE||!1,ka=Qi(l.ALLOWED_URI_REGEXP)?l.ALLOWED_URI_REGEXP:_s,je=typeof l.NAMESPACE=="string"?l.NAMESPACE:pe,Vt=N(l,"MATHML_TEXT_INTEGRATION_POINTS")&&l.MATHML_TEXT_INTEGRATION_POINTS&&typeof l.MATHML_TEXT_INTEGRATION_POINTS=="object"?se(l.MATHML_TEXT_INTEGRATION_POINTS):b({},["mi","mo","mn","ms","mtext"]),Bt=N(l,"HTML_INTEGRATION_POINTS")&&l.HTML_INTEGRATION_POINTS&&typeof l.HTML_INTEGRATION_POINTS=="object"?se(l.HTML_INTEGRATION_POINTS):b({},["annotation-xml"]);const u=N(l,"CUSTOM_ELEMENT_HANDLING")&&l.CUSTOM_ELEMENT_HANDLING&&typeof l.CUSTOM_ELEMENT_HANDLING=="object"?se(l.CUSTOM_ELEMENT_HANDLING):Oe(null);if(O=Oe(null),N(u,"tagNameCheck")&&Fa(u.tagNameCheck)&&(O.tagNameCheck=u.tagNameCheck),N(u,"attributeNameCheck")&&Fa(u.attributeNameCheck)&&(O.attributeNameCheck=u.attributeNameCheck),N(u,"allowCustomizedBuiltInElements")&&typeof u.allowCustomizedBuiltInElements=="boolean"&&(O.allowCustomizedBuiltInElements=u.allowCustomizedBuiltInElements),Se&&(jt=!1),mt&&(Ie=!0),Re&&(Q=b({},ls),J=Oe(null),Re.html===!0&&(b(Q,os),b(J,cs)),Re.svg===!0&&(b(Q,Yt),b(J,Zt),b(J,bt)),Re.svgFilters===!0&&(b(Q,Jt),b(J,Zt),b(J,bt)),Re.mathMl===!0&&(b(Q,Gt),b(J,hs),b(J,bt))),be.tagCheck=null,be.attributeCheck=null,N(l,"ADD_TAGS")&&(typeof l.ADD_TAGS=="function"?be.tagCheck=l.ADD_TAGS:K(l.ADD_TAGS)&&(Q===Aa&&(Q=se(Q)),b(Q,l.ADD_TAGS,$))),N(l,"ADD_ATTR")&&(typeof l.ADD_ATTR=="function"?be.attributeCheck=l.ADD_ATTR:K(l.ADD_ATTR)&&(J===Ea&&(J=se(J)),b(J,l.ADD_ATTR,$))),N(l,"ADD_URI_SAFE_ATTR")&&K(l.ADD_URI_SAFE_ATTR)&&b(Ft,l.ADD_URI_SAFE_ATTR,$),N(l,"FORBID_CONTENTS")&&K(l.FORBID_CONTENTS)&&(ge===_t&&(ge=se(ge)),b(ge,l.FORBID_CONTENTS,$)),N(l,"ADD_FORBID_CONTENTS")&&K(l.ADD_FORBID_CONTENTS)&&(ge===_t&&(ge=se(ge)),b(ge,l.ADD_FORBID_CONTENTS,$)),Ot&&(Q["#text"]=!0),xe&&b(Q,["html","head","body"]),Q.table&&(b(Q,["tbody"]),delete qe.tbody),l.TRUSTED_TYPES_POLICY){if(typeof l.TRUSTED_TYPES_POLICY.createHTML!="function")throw Mt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof l.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Mt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=l.TRUSTED_TYPES_POLICY,E=T.createHTML("")}else T===void 0&&(T=sn(I,a)),T!==null&&typeof E=="string"&&(E=T.createHTML(""));ee&&ee(l),Ne=l},za=b({},[...Yt,...Jt,...qi]),$a=b({},[...Gt,...Wi]),Gs=function(l){let u=w(l);(!u||!u.tagName)&&(u={namespaceURI:je,tagName:"template"});const f=at(l.tagName),R=at(u.tagName);return $t[l.namespaceURI]?l.namespaceURI===wt?u.namespaceURI===pe?f==="svg":u.namespaceURI===yt?f==="svg"&&(R==="annotation-xml"||Vt[R]):!!za[f]:l.namespaceURI===yt?u.namespaceURI===pe?f==="math":u.namespaceURI===wt?f==="math"&&Bt[R]:!!$a[f]:l.namespaceURI===pe?u.namespaceURI===wt&&!Bt[R]||u.namespaceURI===yt&&!Vt[R]?!1:!$a[f]&&(qs[f]||!za[f]):!!(Je==="application/xhtml+xml"&&$t[l.namespaceURI]):!1},he=function(l){Xe(e.removed,{element:l});try{w(l).removeChild(l)}catch{H(l)}},ke=function(l,u){try{Xe(e.removed,{attribute:u.getAttributeNode(l),from:u})}catch{Xe(e.removed,{attribute:null,from:u})}if(u.removeAttribute(l),l==="is")if(Ie||mt)try{he(u)}catch{}else try{u.setAttribute(l,"")}catch{}},Va=function(l){let u=null,f=null;if(Pt)l="<remove></remove>"+l;else{const F=ss(l,/^[\r\n\t ]+/);f=F&&F[0]}Je==="application/xhtml+xml"&&je===pe&&(l='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+l+"</body></html>");const R=T?T.createHTML(l):l;if(je===pe)try{u=new y().parseFromString(R,Je)}catch{}if(!u||!u.documentElement){u=_.createDocument(je,"template",null);try{u.documentElement.innerHTML=zt?E:R}catch{}}const Z=u.body||u.documentElement;return l&&f&&Z.insertBefore(t.createTextNode(f),Z.childNodes[0]||null),je===pe?Rt.call(u,xe?"html":"body")[0]:xe?u.documentElement:Z},Ba=function(l){return ce.call(l.ownerDocument||l,l,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Ut=function(l){return l instanceof C&&(typeof l.nodeName!="string"||typeof l.textContent!="string"||typeof l.removeChild!="function"||!(l.attributes instanceof d)||typeof l.removeAttribute!="function"||typeof l.setAttribute!="function"||typeof l.namespaceURI!="string"||typeof l.insertBefore!="function"||typeof l.hasChildNodes!="function")},Qt=function(l){return typeof o=="function"&&l instanceof o};function me(m,l,u){Ke(m,f=>{f.call(e,l,u,Ne)})}const Ha=function(l){let u=null;if(me(U.beforeSanitizeElements,l,null),Ut(l))return he(l),!0;const f=$(l.nodeName);if(me(U.uponSanitizeElement,l,{tagName:f,allowedTags:Q}),We&&l.hasChildNodes()&&!Qt(l.firstElementChild)&&G(/<[/\w!]/g,l.innerHTML)&&G(/<[/\w!]/g,l.textContent)||We&&l.namespaceURI===pe&&f==="style"&&Qt(l.firstElementChild)||l.nodeType===tt.progressingInstruction||We&&l.nodeType===tt.comment&&G(/<[/\w]/g,l.data))return he(l),!0;if(qe[f]||!(be.tagCheck instanceof Function&&be.tagCheck(f))&&!Q[f]){if(!qe[f]&&Qa(f)&&(O.tagNameCheck instanceof RegExp&&G(O.tagNameCheck,f)||O.tagNameCheck instanceof Function&&O.tagNameCheck(f)))return!1;if(Ot&&!ge[f]){const R=w(l)||l.parentNode,Z=g(l)||l.childNodes;if(Z&&R){const F=Z.length;for(let ae=F-1;ae>=0;--ae){const re=x(Z[ae],!0);R.insertBefore(re,p(l))}}}return he(l),!0}return l instanceof c&&!Gs(l)||(f==="noscript"||f==="noembed"||f==="noframes")&&G(/<\/no(script|embed|frames)/i,l.innerHTML)?(he(l),!0):(Se&&l.nodeType===tt.text&&(u=l.textContent,Ke([dt,gt,pt],R=>{u=Pe(u,R," ")}),l.textContent!==u&&(Xe(e.removed,{element:l.cloneNode()}),l.textContent=u)),me(U.afterSanitizeElements,l,null),!1)},Ua=function(l,u,f){if(ft[u]||Ra&&(u==="id"||u==="name")&&(f in t||f in Js))return!1;const R=J[u]||be.attributeCheck instanceof Function&&be.attributeCheck(u,l);if(!(jt&&!ft[u]&&G(Vs,u))){if(!(va&&G(Bs,u))){if(!R||ft[u]){if(!(Qa(l)&&(O.tagNameCheck instanceof RegExp&&G(O.tagNameCheck,l)||O.tagNameCheck instanceof Function&&O.tagNameCheck(l))&&(O.attributeNameCheck instanceof RegExp&&G(O.attributeNameCheck,u)||O.attributeNameCheck instanceof Function&&O.attributeNameCheck(u,l))||u==="is"&&O.allowCustomizedBuiltInElements&&(O.tagNameCheck instanceof RegExp&&G(O.tagNameCheck,f)||O.tagNameCheck instanceof Function&&O.tagNameCheck(f))))return!1}else if(!Ft[u]){if(!G(ka,Pe(f,xa,""))){if(!((u==="src"||u==="xlink:href"||u==="href")&&l!=="script"&&is(f,"data:")===0&&Pa[l])){if(!(Da&&!G(Hs,Pe(f,xa,"")))){if(f)return!1}}}}}}return!0},Zs=b({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Qa=function(l){return!Zs[at(l)]&&G(Us,l)},qa=function(l){me(U.beforeSanitizeAttributes,l,null);const{attributes:u}=l;if(!u||Ut(l))return;const f={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0};let R=u.length;for(;R--;){const Z=u[R],{name:F,namespaceURI:ae,value:re}=Z,ue=$(F),qt=re;let q=F==="value"?qt:zi(qt);if(f.attrName=ue,f.attrValue=q,f.keepAttr=!0,f.forceKeepAttr=void 0,me(U.uponSanitizeAttribute,l,f),q=f.attrValue,ja&&(ue==="id"||ue==="name")&&is(q,Na)!==0&&(ke(F,l),q=Na+q),We&&G(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,q)){ke(F,l);continue}if(ue==="attributename"&&ss(q,"href")){ke(F,l);continue}if(f.forceKeepAttr)continue;if(!f.keepAttr){ke(F,l);continue}if(!Ia&&G(/\/>/i,q)){ke(F,l);continue}Se&&Ke([dt,gt,pt],Ja=>{q=Pe(q,Ja," ")});const Ya=$(l.nodeName);if(!Ua(Ya,ue,q)){ke(F,l);continue}if(T&&typeof I=="object"&&typeof I.getAttributeType=="function"&&!ae)switch(I.getAttributeType(Ya,ue)){case"TrustedHTML":{q=T.createHTML(q);break}case"TrustedScriptURL":{q=T.createScriptURL(q);break}}if(q!==qt)try{ae?l.setAttributeNS(ae,F,q):l.setAttribute(F,q),Ut(l)?he(l):as(e.removed)}catch{ke(F,l)}}me(U.afterSanitizeAttributes,l,null)},Wa=function(l){let u=null;const f=Ba(l);for(me(U.beforeSanitizeShadowDOM,l,null);u=f.nextNode();)me(U.uponSanitizeShadowNode,u,null),Ha(u),qa(u),u.content instanceof i&&Wa(u.content);me(U.afterSanitizeShadowDOM,l,null)};return e.sanitize=function(m){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=null,f=null,R=null,Z=null;if(zt=!m,zt&&(m="<!-->"),typeof m!="string"&&!Qt(m)&&(m=Ui(m),typeof m!="string"))throw Mt("dirty is not a string, aborting");if(!e.isSupported)return m;if(Nt||Ht(l),e.removed=[],typeof m=="string"&&(Ye=!1),Ye){const re=m.nodeName;if(typeof re=="string"){const ue=$(re);if(!Q[ue]||qe[ue])throw Mt("root node is forbidden and cannot be sanitized in-place")}}else if(m instanceof o)u=Va("<!---->"),f=u.ownerDocument.importNode(m,!0),f.nodeType===tt.element&&f.nodeName==="BODY"||f.nodeName==="HTML"?u=f:u.appendChild(f);else{if(!Ie&&!Se&&!xe&&m.indexOf("<")===-1)return T&&Lt?T.createHTML(m):m;if(u=Va(m),!u)return Ie?null:Lt?E:""}u&&Pt&&he(u.firstChild);const F=Ba(Ye?m:u);for(;R=F.nextNode();)Ha(R),qa(R),R.content instanceof i&&Wa(R.content);if(Ye)return m;if(Ie){if(Se){u.normalize();let re=u.innerHTML;Ke([dt,gt,pt],ue=>{re=Pe(re,ue," ")}),u.innerHTML=re}if(mt)for(Z=ne.call(u.ownerDocument);u.firstChild;)Z.appendChild(u.firstChild);else Z=u;return(J.shadowroot||J.shadowrootmode)&&(Z=Me.call(s,Z,!0)),Z}let ae=xe?u.outerHTML:u.innerHTML;return xe&&Q["!doctype"]&&u.ownerDocument&&u.ownerDocument.doctype&&u.ownerDocument.doctype.name&&G(Fs,u.ownerDocument.doctype.name)&&(ae="<!DOCTYPE "+u.ownerDocument.doctype.name+`>
|
|
57
|
+
`+ae),Se&&Ke([dt,gt,pt],re=>{ae=Pe(ae,re," ")}),T&&Lt?T.createHTML(ae):ae},e.setConfig=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ht(m),Nt=!0},e.clearConfig=function(){Ne=null,Nt=!1},e.isValidAttribute=function(m,l,u){Ne||Ht({});const f=$(m),R=$(l);return Ua(f,R,u)},e.addHook=function(m,l){typeof l=="function"&&Xe(U[m],l)},e.removeHook=function(m,l){if(l!==void 0){const u=_i(U[m],l);return u===-1?void 0:Fi(U[m],u,1)[0]}return as(U[m])},e.removeHooks=function(m){U[m]=[]},e.removeAllHooks=function(){U=ds()},e}var gs=zs();class nn{dataLayer;constructor(e){this.dataLayer=e}get answerWidgetShowMoreLimit(){return this.dataLayer.answerWidgetShowMoreLimit??100}get currentPage(){return this.dataLayer.searchObject?.page}get totalPages(){return this.resultsPerPage===0?0:Math.ceil(this.totalResults/this.resultsPerPage)}get totalResults(){return this.dataLayer.searchResultsMetadata?.totalResultsValue||0}get resultsPerPage(){return this.dataLayer.itemsPerPage||0}get sortOptions(){return this.dataLayer.searchResultsMetadata?.sorting.options||[]}get selectedSortOption(){return this.dataLayer.searchResultsMetadata?.sorting.selectedSortOption||""}get startResultIndex(){return(this.dataLayer.searchObject?.page-1)*this.resultsPerPage+1}get endResultIndex(){const e=(this.dataLayer.searchObject?.page-1)*this.resultsPerPage+(this.resultsPerPage??0);return e>this.totalResults?this.totalResults:e}get isFirstPage(){return this.dataLayer.searchObject?.page===1}get isLastPage(){return this.dataLayer.searchObject?.page>=Math.ceil(this.totalResults/this.resultsPerPage)}get percentageOfResultsLoaded(){return this.endResultIndex/this.totalResults*100}get results(){return this.dataLayer.searchResults??[]}get autoCorrectedQuery(){return this.dataLayer.searchResultsMetadata?.autoCorrectedQuery||""}get originalQuery(){return this.dataLayer.searchObject?.query||""}get getAnswerData(){return this.dataLayer.getAnswerData||""}get shouldShowAnswerLoadMore(){return this.dataLayer.getAnswerData.split(" ").length>this.answerWidgetShowMoreLimit}get answerTruncated(){return this.dataLayer.getAnswerData.split(" ").slice(0,this.answerWidgetShowMoreLimit).join(" ")+"..."}get fullAnswerFormatted(){return gs.sanitize(v.parse(this.dataLayer.getAnswerData)).replace(/<a /g,'<a target="_blank" class="searchstax-answer-link" rel="noopener noreferrer" ')}get answerLoading(){return this.dataLayer.answerLoading}get shouldShowAnswerError(){return this.dataLayer.answerError}get locationError(){return this.dataLayer.locationError}get shouldShowAnswer(){return(this.dataLayer.getAnswerData!==""||this.dataLayer.parsedData.answerLoading||this.shouldShowAnswerError)&&this.dataLayer.searchObject.query!=="*"}get searchTerm(){return this.dataLayer.searchResultsMetadata?.autoCorrectedQuery||this.dataLayer.searchObject?.query||""}get locationSearchEnabled(){return this.dataLayer.locationEnabled??!1}get locationSearchDistanceEnabled(){return(this.dataLayer.searchLocationConfig?.locationValuesOverride?.locationDistanceEnabled?this.dataLayer.searchLocationConfig?.locationValuesOverride?.locationDistanceEnabled:this.dataLayer.searchResultsMetadata?.location?.filter?.enabled)??!1}get locationSearchDistanceValues(){const e=this.dataLayer.searchLocationConfig?.locationValuesOverride?.filterValues??this.dataLayer.searchResultsMetadata?.location?.filter?.values,t=this.dataLayer.searchLocationConfig?.locationValuesOverride?.filterUnit??this.dataLayer.searchResultsMetadata?.location?.unit;return!e||e.length===0?[]:e.map(a=>({label:a==="any"?"Any Distance":a+" "+(t??""),value:a,isSelected:a===this.dataLayer.searchRadius})).sort((a,i)=>{const r=a.value==="any"?0:parseFloat(a.value),o=i.value==="any"?0:parseFloat(i.value);return r-o})}get shouldShowLocationDistanceDropdown(){return this.locationSearchDistanceEnabled&&this.locationSearchDistanceValues.length>1}get searchingEverything(){return this.searchTerm==="*"}get firstSearchHappened(){return this.dataLayer.firstSearchHappened}get isInfiniteScroll(){return this.dataLayer.isInfiniteScroll??!1}get answerErrorMessage(){return gs.sanitize(v.parse(this.dataLayer.answerErrorMessage)).replace("<br>","")}get searchExecuted(){return this.dataLayer.searchObject?.query!==void 0&&this.dataLayer.searchObject?.query!=="undefined"&&this.dataLayer.searchObject?.query!==""}get selectedFacets(){const e=this.dataLayer.searchFacetsCached??this.dataLayer.searchFacets;return e?(this.dataLayer.searchObject?.facets??[]).map(a=>{const i=a.name,r=a.value,o=e.find(c=>c.name===i);if(o){const c=o.values.find(h=>h.type==="range"?!1:h.type==="checkbox"?'"'+h.value+'"'===r:!1);if(c)return c}return null}).filter(a=>a!==null):[]}get cachedANDFacets(){let e="";for(const t of this.dataLayer.searchObject.facets)(t.type==="and"||t.type==="tabs")&&(e+=JSON.stringify(t));return e}get relatedSearches(){const e=this.dataLayer.searchRelatedSearches??[];return e[e.length-1]&&(e[e.length-1].last=!0),e}get externalPromotions(){return this.dataLayer.searchExternalPromotions??[]}get data(){return{currentPage:this.currentPage,totalPages:this.totalPages,totalResults:this.totalResults,resultsPerPage:this.resultsPerPage,startResultIndex:this.startResultIndex,endResultIndex:this.endResultIndex,isFirstPage:this.isFirstPage,isLastPage:this.isLastPage,results:this.results,searchTerm:this.searchTerm!=="undefined"?this.searchTerm:"",autoCorrectedQuery:this.autoCorrectedQuery,originalQuery:this.originalQuery,selectedFacets:this.selectedFacets,searchExecuted:this.searchExecuted,searchingEverything:this.searchingEverything,relatedSearches:this.relatedSearches,hasRelatedSearches:this.relatedSearches.length>0,externalPromotions:this.externalPromotions,hasExternalPromotions:this.externalPromotions.length>0,hasResults:this.results.length>0,hasResultsOrExternalPromotions:this.results.length>0||this.externalPromotions.length>0,answer:this.getAnswerData,answerTruncated:this.answerTruncated,fullAnswerFormatted:this.fullAnswerFormatted,shouldShowAnswerLoadMore:this.shouldShowAnswerLoadMore,answerLoading:this.answerLoading,shouldShowAnswer:this.shouldShowAnswer,isInfiniteScroll:this.isInfiniteScroll,percentageOfResultsLoaded:this.percentageOfResultsLoaded,firstSearchHappened:this.firstSearchHappened,sortOptions:this.sortOptions,selectedSortOption:this.selectedSortOption,shouldShowAnswerError:this.shouldShowAnswerError,answerErrorMessage:this.answerErrorMessage,locationSearchEnabled:this.locationSearchEnabled,locationSearchDistanceEnabled:this.locationSearchDistanceEnabled,locationSearchDistanceValues:this.locationSearchDistanceValues,shouldShowLocationDistanceDropdown:this.shouldShowLocationDistanceDropdown,locationError:this.locationError}}get trackingData(){return{searchTerm:this.searchTerm,trackApiKey:this.dataLayer.searchstaxConfig?.trackApiKey??"",session:this.dataLayer.sessionIdValue,language:this.dataLayer.language,recordsPerPage:this.dataLayer.searchResultsMetadata?.recordsPerPageValue??0,totalResults:this.dataLayer.searchResultsMetadata?.totalResultsValue??0,currentPage:this.dataLayer.currentPage,latencyVal:this.dataLayer.searchResultsMetadata?.latency??0,...this.dataLayer.model?{model:this.dataLayer.model}:{}}}}class oe{static deepEqual(e,t){const s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;for(const i of s){const r=e[i],o=t[i],c=this.isObject(r)&&this.isObject(o);if(c&&!this.deepEqual(r,o)||!c&&r!==o)return!1}return!0}static isObject(e){return e!=null&&typeof e=="object"}}class M{value;observers={};constructor(e){this.value=e,this.observers={}}subscribe(e,t){const s=Math.random().toString(36).substring(2,15),a=t||s;return this.observers[a]=e,e(this.value),a}unsubscribe(e){this.observers[e]&&delete this.observers[e]}subscribeOnce(e){const t=Math.random().toString(36).substring(2,15),s=a=>{e(a),this.unsubscribe(t)};this.subscribe(s,t)}subscribeTwice(e){const t=Math.random().toString(36).substring(2,15);let s=0;const a=i=>{s++,e(i),s>=2&&this.unsubscribe(t)};this.subscribe(a,t)}subscribeUntil(e,t,s=6e3,a=!0){const i=Math.random().toString(36).substring(2,15),r=o=>{o===t&&(e(o),this.unsubscribe(i))};return this.value===t?(e(this.value),null):(this.subscribe(r,i),setTimeout(()=>{a&&this.observers[i]&&e(this.value),this.unsubscribe(i)},s),i)}subscribeUntilHasValue(e,t=6e3,s=!0){const a=Math.random().toString(36).substring(2,15),i=r=>{r!=null&&(e(r),this.unsubscribe(a))};return this.value!==null&&this.value!==void 0?(e(this.value),null):(this.subscribe(i,a),t>0&&setTimeout(()=>{s&&this.observers[a]&&e(this.value),this.unsubscribe(a)},t),i)}setValue(e){this.value=e,this.notify()}getValue(){return this.value}notify(){for(const e in this.observers)if(Object.prototype.hasOwnProperty.call(this.observers,e)){const t=this.observers[e];typeof t=="function"&&t(this.value)}}}class Kt{static getOrSetCookie(e,t){let s=this.getCookie(e);return s==null&&(s=t??this.makeid(25),this.setCookie(e,s,{secure:!0,"max-age":3600})),s}static deleteCookie(e){this.getCookie(e)&&this.setCookie(e,"",{secure:!0,"max-age":-1})}static makeid(e){let t="";const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=s.length;for(let i=0;i<e;i++)t+=s.charAt(Math.floor(Math.random()*a));return t}static getCookie(e){const t=typeof document<"u"?document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")+"=([^;]*)")):null;return t?decodeURIComponent(t[1]):void 0}static setCookie(e,t,s){const a={path:"/",...s};s.expires instanceof Date&&(a.expires=s.expires.toUTCString());let i=encodeURIComponent(e)+"="+encodeURIComponent(t);for(const r in a){i+="; "+r;const o=a[r];o!==!0&&(i+="="+o)}typeof document<"u"&&(document.cookie=i)}}class Y{static removeXSSRiskyTags(e){var t="script|style|iframe|object|embed|form|input|button",s=new RegExp("</?("+t+")(\\s[^>]*)?>","gi");return e?e.replace(s,""):""}}class rn{$searchTermChange=new M("");$searchLocationChange=new M("");$searchLocationCoordinatesDecoded=new M("");$searchLatChange=new M("");$searchLongChange=new M("");$searchRadiusChange=new M(void 0);$loadingChange=new M(!1);$locationError=new M(!1);$searchResults=new M(null);$searchResultsMetadata=new M(null);$searchAutosuggest=new M(null);$searchFacets=new M(null);$searchFacetsCached=new M(null);$searchFacetsCachedTabs=new M(null);$searchstaxConfig=new M(null);$autosuggestResults=new M(null);$itemsPerPage=new M(void 0);$searchObject=new M({query:"",itemsPerPage:void 0,page:99999999,order:"",facets:[],additionalProps:[],location:{term:void 0,radius:void 0,lat:void 0,lon:void 0},model:""});$searchRelatedSearches=new M(null);$searchInputConfig=new M(null);$searchLocationConfig=new M(null);$searchExternalPromotions=new M(null);$facetsTemplateData=new M(null);$selectedFacetsTemplateData=new M(null);$paginationData=new M(null);$answerData=new M(null);$searchFeedbackData=new M(null);$inputWidgetTemplateData=new M(null);$locationWidgetTemplateData=new M(null);$searchSortingData=new M(null);$searchRelatedSearchesData=new M(null);$searchExternalPromotionsData=new M(null);$cookiesDisabled=new M(null);$locationDecodingLoading=new M(!1);$answer=new M("");$language=new M("en");$model=new M("");$answerLoading=new M(!1);$locationEnabled=new M(null);$answerError=new M(!1);$answerErrorMessage=new M("");$isQuestion=new M(!1);$inputTemplateRendered=new M(!1);currentPageValue=1;isAnswerWidgetCreatedValue=!1;renderingEngineValue=P.mustache;parsedData=new nn(this);sessionId;sessionIdValue=null;autoCorrect=!0;forceNotCorrect=!1;lastSearchValue="";turnAIAnswerGenerationOn=!1;questionURL="";isInfiniteScroll=!1;firstSearchHappened=!1;facetsWereSet=!1;answerWidgetShowMoreLimit=100;searchHelper;searchResultUnparsed;constructor(e,t){this.sessionId=e,t&&(this.sessionIdValue=t),this.cookieHandlingCallback(t),this.$cookiesDisabled.subscribe(()=>{this.cookieHandlingCallback(t)})}cookieHandlingCallback(e){this.cookiesDisabled?(this.sessionIdValue=null,Kt.deleteCookie(this.sessionId),Kt.deleteCookie("ms_visitorid")):this.sessionIdValue=Kt.getOrSetCookie(this.sessionId,e)}setIsInfiniteScroll(e){this.isInfiniteScroll=e}setSearchTerm(e){this.$searchTermChange.setValue(Y.removeXSSRiskyTags(e))}setSearchLocation(e){this.$searchLocationChange.setValue(Y.removeXSSRiskyTags(e))}setSearchRadius(e){this.$searchRadiusChange.setValue(e)}setRenderingEngine(e){this.renderingEngineValue=e}setCurrentPage(e){this.currentPageValue=e}setIsAnswerWidgetCreated(e){this.isAnswerWidgetCreatedValue=e}setLoading(e){this.$loadingChange.setValue(e)}setSearchResults(e){this.firstSearchHappened=!0,(!oe.deepEqual(e,this.searchResults??[""])||this.facetsWereSet)&&(this.facetsWereSet=!1,this.$searchResults.setValue(e))}setSearchResultsMetadata(e){oe.deepEqual(e,this.searchResultsMetadata??{})||this.$searchResultsMetadata.setValue(e)}setSearchAutosuggest(e){this.$searchAutosuggest.setValue(e)}setSearchObject(e){let t=e;t={...t,itemsPerPage:this.itemsPerPage,model:this.model},this.searchstaxConfig?.hooks?.beforeSearch&&t&&(t=this.searchstaxConfig.hooks.beforeSearch(t)),t&&(!oe.deepEqual(t,this.searchObject??{})||this.forceNotCorrect)&&(this.searchObject.itemsPerPage!==t.itemsPerPage&&t.itemsPerPage!==void 0&&this.setItemsPerPage(t.itemsPerPage),this.$searchObject.setValue(t))}setSearchFacets(e){this.facetsWereSet=!0,oe.deepEqual(e,this.searchFacets??[])||this.$searchFacets.setValue(e)}setSearchFacetsCached(e){oe.deepEqual(e,this.searchFacetsCached??[])||this.$searchFacetsCached.setValue(e)}setSearchFacetsCachedTabs(e){oe.deepEqual(e,this.searchFacetsCachedTabs??[])||this.$searchFacetsCachedTabs.setValue(e)}setSearchRelatedSearches(e){oe.deepEqual(e,this.searchRelatedSearches??[])||this.$searchRelatedSearches.setValue(e)}setSearchExternalPromotions(e){oe.deepEqual(e,this.searchExternalPromotions??[])||this.$searchExternalPromotions.setValue(e)}setLanguage(e){this.$language.setValue(e)}setModel(e){this.$model.setValue(e)}setSearchstaxConfig(e){this.$searchstaxConfig.setValue(e)}setSearchInputConfig(e){this.$searchInputConfig.setValue(e)}setSearchLocationConfig(e){this.$searchLocationConfig.setValue(e)}setAutosuggestResults(e){this.$autosuggestResults.setValue(e)}setFacetsTemplateData(e){this.$facetsTemplateData.setValue(e)}setSelectedFacetsTemplateData(e){this.$selectedFacetsTemplateData.setValue(e)}setPaginationData(e){this.$paginationData.setValue(e)}setAnswerFullData(e){this.$answerData.setValue(e)}setSearchFeedbackData(e){this.$searchFeedbackData.setValue(e)}setSearchSortingData(e){this.$searchSortingData.setValue(e)}setRelatedSearchesData(e){this.$searchRelatedSearchesData.setValue(e)}setExternalPromotionsData(e){this.$searchExternalPromotionsData.setValue(e)}setCookiesDisabled(e){this.$cookiesDisabled.setValue(e)}setAnswerData(e){this.$answer.setValue(e)}setItemsPerPage(e){this.$itemsPerPage.setValue(e)}setAnswerLoading(e){this.$answerLoading.setValue(e)}setAnswerError(e){this.$answerError.setValue(e)}setIsQuestion(e){this.$isQuestion.setValue(e)}setAnswerErrorMessage(e){this.$answerErrorMessage.setValue(e)}setLocationDecodingLoading(e){this.$locationDecodingLoading.setValue(e)}setSearchLat(e){this.$searchLatChange.setValue(e)}setSearchLong(e){this.$searchLongChange.setValue(e)}setInputTemplateRendered(e){this.$inputTemplateRendered.setValue(e)}setLocationError(e){this.$locationError.setValue(e)}setInputWidgetTemplateData(e){this.$inputWidgetTemplateData.setValue(e)}setLocationWidgetTemplateData(e){this.$locationWidgetTemplateData.setValue(e)}setLocationCoordinatesDecoded(e){this.$searchLocationCoordinatesDecoded.setValue(Y.removeXSSRiskyTags(e))}setLocationEnabled(e){this.$locationEnabled.setValue(e)}setSearchResultUnparsedData(e){this.searchResultUnparsed=e}get getAnswerData(){return this.$answer.getValue()}get searchstaxConfig(){return this.$searchstaxConfig.getValue()}get searchFacets(){return this.$searchFacets.getValue()?JSON.parse(JSON.stringify(this.$searchFacets.getValue())):null}get searchFacetsCached(){return this.$searchFacetsCached.getValue()?JSON.parse(JSON.stringify(this.$searchFacetsCached.getValue())):null}get searchFacetsCachedTabs(){return this.$searchFacetsCachedTabs.getValue()?JSON.parse(JSON.stringify(this.$searchFacetsCachedTabs.getValue())):null}get searchResults(){return this.$searchResults.getValue()?JSON.parse(JSON.stringify(this.$searchResults.getValue())):null}get searchTerm(){return this.$searchTermChange.getValue()}get searchLocation(){return this.$searchLocationChange.getValue()}get searchRadius(){return this.$searchRadiusChange.getValue()}get loading(){return this.$loadingChange.getValue()}get searchAutosuggest(){return this.$searchAutosuggest.getValue()}get searchResultsMetadata(){return this.$searchResultsMetadata.getValue()?JSON.parse(JSON.stringify(this.$searchResultsMetadata.getValue())):null}get currentPage(){return this.$searchObject.getValue().page??this.currentPageValue}get isAnswerWidgetCreated(){return this.isAnswerWidgetCreatedValue}get renderingEngine(){return this.renderingEngineValue}get searchObject(){return JSON.parse(JSON.stringify(this.$searchObject.getValue()))}get searchRelatedSearches(){return this.$searchRelatedSearches.getValue()?JSON.parse(JSON.stringify(this.$searchRelatedSearches.getValue())):null}get searchExternalPromotions(){return this.$searchExternalPromotions.getValue()?JSON.parse(JSON.stringify(this.$searchExternalPromotions.getValue())):null}get language(){return this.$language.getValue()}get model(){return this.$model.getValue()}get searchInputConfig(){return this.$searchInputConfig.getValue()}get searchLocationConfig(){return this.$searchLocationConfig.getValue()}get answerConfig(){return this.$answer.getValue()}get autosuggestResults(){return this.$autosuggestResults.getValue()}get facetsTemplateData(){return this.$facetsTemplateData.getValue()}get selectedFacetsTemplateData(){return this.$selectedFacetsTemplateData.getValue()}get paginationData(){return this.$paginationData.getValue()}get searchFeedbackData(){return this.$searchFeedbackData.getValue()}get searchSortingData(){return this.$searchSortingData.getValue()}get searchRelatedSearchesData(){return this.$searchRelatedSearchesData.getValue()}get searchExternalPromotionsData(){return this.$searchExternalPromotionsData.getValue()}get cookiesDisabled(){return(this.$cookiesDisabled.getValue()??!1)||!navigator.cookieEnabled}get itemsPerPage(){return this.$itemsPerPage.getValue()}get answerFullData(){return this.$answerData.getValue()}get answerLoading(){return this.$answerLoading.getValue()}get isQuestion(){return this.$isQuestion.getValue()}get answerError(){return this.$answerError.getValue()}get answerErrorMessage(){return this.$answerErrorMessage.getValue()}get locationDecodingLoading(){return this.$locationDecodingLoading.getValue()}get searchLat(){return this.$searchLatChange.getValue()}get searchLong(){return this.$searchLongChange.getValue()}get inputTemplateRendered(){return this.$inputTemplateRendered.getValue()}get locationError(){return this.$locationError.getValue()}get inputWidgetTemplateData(){return this.$inputWidgetTemplateData.getValue()}get locationWidgetTemplateData(){return this.$locationWidgetTemplateData.getValue()}get searchLocationCoordinatesDecoded(){return this.$searchLocationCoordinatesDecoded.getValue()}get locationEnabled(){return this.$locationEnabled.getValue()}get searchResultUnparsedData(){return this.searchResultUnparsed}}class st{static combineResultsWithMetadata(e){const t=[],s=parseInt(e.response.start+"");return e.response.docs.forEach((a,i)=>{const r=a[e.responseHeader.params.uniqueId]??"",o={custom:null,uniqueId:r,position:s+1+i,ribbon:this.doesMapExist("ribbon",e)?this.getValueByKey("ribbon",a,e,r):null,paths:this.doesMapExist("paths",e)?this.getValueByKey("paths",a,e,r):null,url:this.doesMapExist("url",e)?this.getValueByKey("url",a,e,r):null,title:this.doesMapExist("title",e)?this.getValueByKey("title",a,e,r):null,titleTracking:this.doesMapExist("title",e)?this.getValueByKey("title",a,e,r,!0):null,promoted:a["[elevated]"]?a["[elevated]"]:!1,thumbnail:this.doesMapExist("thumbnail",e)?this.getValueByKey("thumbnail",a,e,r):null,date:this.doesMapExist("date",e)?this.getValueByKey("date",a,e,r):null,snippet:this.doesMapExist("snippet",e)?this.getValueByKey("snippet",a,e,r):null,description:this.doesMapExist("description",e)?this.getValueByKey("description",a,e,r):null,distance:this.doesMapExist("distance",e)&&this.getValueByKey("distance",a,e,r)!=="Infinity"&&this.getValueByKey("distance",a,e,r)?Math.floor(this.getValueByKey("distance",a,e,r)):null,unit:e.metadata.locationSearch?.unit??"",unmappedFields:this.getUnmappedFields(a,e,r),allFields:this.getAllFields(a,e)};t.push(o)}),t}static extractFacets(e){const t=[];if(e.metadata.facets)for(const s of e.metadata.facets){let a={values:[]};if(a.name=s.name,a.label=s.label,s.name in e.facet_counts.facet_fields){const i=e.facet_counts.facet_fields[s.name];for(let r=0;r<i.length;r+=2){const o={};o.value=i[r],o.parentName=a.name,o.count=i[r+1],o.type="checkbox",a.values.push(o)}}a.values.length>0&&t.push(a)}return t}static extractSearchResultsMetadata(e){let t="",s={selectedSortOption:"",options:[]},a={enabled:!1,field:"",unit:"",filter:{enabled:!1,values:[],label:"",defaultValue:""}};if(e.metadata.locationSearch&&(a={enabled:e.metadata.locationSearch.enabled,field:e.metadata.locationSearch.field,unit:e.metadata.locationSearch.unit,filter:{enabled:e.metadata.locationSearch.filter?.enabled??!1,values:e.metadata.locationSearch.filter?.values??[],label:e.metadata.locationSearch.filter?.label??"",defaultValue:e.metadata.locationSearch.filter?.defaultValue??""}}),e.metadata.results.find(i=>i.result_card==="date")?.name,s.options=[],e.metadata.sorts?.length){const i=e.metadata.sorts.map(r=>({value:r.label,key:r.name+" "+r.order}));s.options=[{key:"",value:"Relevance"},...i]}return t=e?.spellcheck?.suggestions?.[1]?.suggestion?.[0]??"",typeof t!="string"&&(t=t?.word??""),{recordsPerPageValue:parseInt(e.responseHeader.params.rows),startDocVal:parseInt(e.response.start+""),totalResultsValue:parseInt(e.response.numFound+""),latency:parseInt(e.responseHeader.QTime+""),endDocValue:parseInt(e.responseHeader.params.rows)+parseInt(e.response.start+""),spellingSuggestion:t,autoCorrectedQuery:e.responseHeader.params.autoCorrectedQ??"",impressions:this.getImpressions(e),sorting:s,location:a,isLocationMapped:this.doesMapExist("distance",e)}}static getImpressions(e){const t=[],s=this.combineResultsWithMetadata(e);for(const a in s){const i=s[a],r={};r.cDocId=this.getDataForAnalytics(i.uniqueId),i.title&&(r.cDocTitle=this.getDataForAnalytics(i.titleTracking)),r.position=i.position,t.push(r)}return t}static getDataForAnalytics(e){return e!==null?typeof e>"u"?"":typeof e=="string"?e:typeof e.join<"u"?e[0]:e:""}static findResultByUniqueId(e,t){return t.find(s=>s.uniqueId===e)??null}static getUnmappedFields(e,t,s){const a=t.metadata.results.filter(r=>r.result_card==="").map(r=>r.name),i=[];for(const r of a)if(Object.keys(e).includes(r)){const o=Array.isArray(e[r])?this.getHighlightedResults(r,e[r].join(", "),s,t):this.getHighlightedResults(r,e[r]+"",s,t);i.push({key:r,value:o,isImage:this.checkIfImage(e[r])})}return i}static checkIfImage(e){return e===void 0?!1:typeof e!="string"?Array.isArray(e)&&e[0]?/\.(gif|jpe?g|tiff?|png|webp|bmp)$/i.test(e[0]):!1:/\.(gif|jpe?g|tiff?|png|webp|bmp)$/i.test(e)}static getAllFields(e,t){const s=t.metadata.results.map(i=>i.name),a=[];for(const i of Object.keys(e))s.indexOf(i)!==-1&&a.push({key:i,value:e[i],isImage:this.checkIfImage(e[i])});return a}static doesMapExist(e,t){return t.metadata.results.find(s=>s.result_card===e)!==void 0}static getValueByKey(e,t,s,a,i=!1){const r=s.metadata.results.find(c=>c.result_card===e);if(r===void 0)return null;const o=t[r.name];return o===void 0?null:typeof o=="string"?i?o:this.getHighlightedResults(r.name,o,a,s):typeof o=="number"?o:Array.isArray(o)?i?o.join(", "):this.getHighlightedResults(r.name,o.join(", "),a,s):null}static getHighlightedResults(e,t,s,a){if(a.highlighting&&s in a.highlighting){let i=a.highlighting[s];if(i&&e in i){let r=i[e];const o=this.cleanValue(r);if(o!=="")return o}}return t}static cleanValue(e){return e===null?"":typeof e=="string"?e:Array.isArray(e)?e.join(" "):""}}class ps{routeName="searchstax";ignoredKeys=[];queryStringHelper;titleParser;constructor(e){e.routeName&&(this.routeName=e.routeName),e.ignoredKeys&&(this.ignoredKeys=e.ignoredKeys),e.title&&(this.titleParser=e.title),this.queryStringHelper=new on(this.routeName)}updateUrl(e){const t=this.searchObjectToUrl(e);let s=typeof document<"u"?document?.title:"";this.titleParser&&(s=this.titleParser(e)),typeof document<"u"&&(document.title=s),window?.location.href!==t&&window?.history.replaceState(window.history.state,s,t)}searchObjectToUrl(e){return this.queryStringHelper.urlHasQueryParams(window?.location.href??"")?window?.location.href.split("?")[0]+"?"+this.queryStringHelper.stringify(this.searchObjectToParams(e),{ignoredKeys:this.ignoredKeys}):window?.location.href+"?"+this.queryStringHelper.stringify(this.searchObjectToParams(e),{ignoredKeys:this.ignoredKeys})}searchObjectToParams(e){const t={},s=e.page||1;if(e.query&&(t[this.routeName+"[query]"]=encodeURIComponent(e.query)),e.page&&(t[this.routeName+"[page]"]=s+""),e.order&&(t[this.routeName+"[order]"]=e.order),e.itemsPerPage&&e.itemsPerPage!==10&&(t[this.routeName+"[itemsPerPage]"]=e.itemsPerPage+""),e.location)for(const a in e.location){const i=e.location[a];i&&(t[this.routeName+`[location][${a}]`]=i)}if(e.facets)for(const a in e.facets){const i=e.facets[a].type+":"+encodeURIComponent(e.facets[a].name)+":"+encodeURIComponent(e.facets[a].value);t[this.routeName+`[facets][${a}]`]=i}if(e.model&&(t[this.routeName+"[model]"]=e.model),this.queryStringHelper.urlHasQueryParams(window?.location.href??"")){const a=this.queryStringHelper.urlToParams(window?.location.href??"");for(const i in a)i.startsWith(this.routeName)&&delete a[i];return{...a,...t}}else return t}extractParamsThatDoNotStartWithRouteName(e){const t={};for(const s in e)s.startsWith(this.routeName)||(t[s]=e[s]);return t}extractArrayOfFacetsFromQueryParameters(e){const t=[];for(const s in e)if(s.startsWith(this.routeName+"[facets]")){const a=Y.removeXSSRiskyTags(e[s].split(":")?.[0]),i=Y.removeXSSRiskyTags(decodeURIComponent(e[s].split(":")?.[1])),r=Y.removeXSSRiskyTags(decodeURIComponent(e[s].split(":")?.[2]));t.push({type:a,name:i,value:r})}return t}urlToSearchObject(e,t){const s=this.queryStringHelper.urlToParams(e),a=Y.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[page]"])),i=parseInt(a),r=isNaN(i)?1:i;let o=parseInt(Y.removeXSSRiskyTags(s[this.routeName+"[itemsPerPage]"]));return isNaN(o)&&(o=10),{query:Y.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[query]"]))||"",page:r,itemsPerPage:t??o,order:Y.removeXSSRiskyTags(s[this.routeName+"[order]"])||"",facets:this.extractArrayOfFacetsFromQueryParameters(s)||[],model:Y.removeXSSRiskyTags(s[this.routeName+"[model]"])||"",location:{address:Y.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][address]"]||"")),radius:Y.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][radius]"]||"")),lat:Y.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lat]"]||"")),lon:Y.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lon]"]||""))}}}}class on{routeName="";constructor(e){this.routeName=e}stringify=(e,t)=>{const s=this.filterOutIgnoredKeys(e,t.ignoredKeys);return Object.keys(s).map(a=>{const i=s[a];return Array.isArray(i)?i.map(r=>`${a}=${r}`).join("&"):`${a}=${i}`}).join("&")};filterOutIgnoredKeys(e,t){const s=t||[],a={};return Object.keys(e).forEach(i=>{s.includes(i)||e[i]!==""&&(a[i]=e[i])}),a}urlToParams(e){const t={},s=e.split("?")[1];return s&&s.split("&").forEach(a=>{const[i,r]=a.split("=");t[i]=r}),t}doesParamContainRouteName(e){return e.indexOf(this.routeName)!==-1}urlHasQueryParams(e){return e.indexOf("?")!==-1}}const Ve={question:"I_AM_A_QUESTION",notQuestion:"I_AM_NOT_A_QUESTION",close:"CLOSE"};class fs extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const ms=10,ln=13,Ae=32;function Xt(n){}function cn(n){if(typeof n=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=Xt,onError:t=Xt,onRetry:s=Xt,onComment:a}=n,i=[];let r=!0,o,c="",h=0,d;function C(p){if(r&&(r=!1,p.charCodeAt(0)===239&&p.charCodeAt(1)===187&&p.charCodeAt(2)===191&&(p=p.slice(3))),i.length===0){const T=y(p);T!==""&&i.push(T);return}if(p.indexOf(`
|
|
58
58
|
`)===-1&&p.indexOf("\r")===-1){i.push(p);return}i.push(p);const g=i.join("");i.length=0;const w=y(g);w!==""&&i.push(w)}function y(p){let g=0;if(p.indexOf("\r")===-1){let w=p.indexOf(`
|
|
59
59
|
`,g);for(;w!==-1;){if(g===w){h>0&&e({id:o,event:d,data:c}),o=void 0,c="",h=0,d=void 0,g=w+1,w=p.indexOf(`
|
|
60
60
|
`,g);continue}const T=p.charCodeAt(g);if(Ls(p,g,T)){const E=p.charCodeAt(g+5)===Ae?g+6:g+5,_=p.slice(E,w);if(h===0&&p.charCodeAt(w+1)===ms){e({id:o,event:d,data:_}),o=void 0,c="",d=void 0,g=w+2,w=p.indexOf(`
|
|
@@ -63,7 +63,7 @@ ${_}`,h++}else ys(p,g,T)?d=p.slice(p.charCodeAt(g+6)===Ae?g+7:g+6,w)||void 0:I(p
|
|
|
63
63
|
`,g)}return p.slice(g)}for(;g<p.length;){const w=p.indexOf("\r",g),T=p.indexOf(`
|
|
64
64
|
`,g);let E=-1;if(w!==-1&&T!==-1?E=w<T?w:T:w!==-1?w===p.length-1?E=-1:E=w:T!==-1&&(E=T),E===-1)break;I(p,g,E),g=E+1,p.charCodeAt(g-1)===ln&&p.charCodeAt(g)===ms&&g++}return p.slice(g)}function I(p,g,w){if(g===w){x();return}const T=p.charCodeAt(g);if(Ls(p,g,T)){const Me=p.charCodeAt(g+5)===Ae?g+6:g+5,U=p.slice(Me,w);c=h===0?U:`${c}
|
|
65
65
|
${U}`,h++;return}if(ys(p,g,T)){d=p.slice(p.charCodeAt(g+6)===Ae?g+7:g+6,w)||void 0;return}if(T===105&&p.charCodeAt(g+1)===100&&p.charCodeAt(g+2)===58){const Me=p.slice(p.charCodeAt(g+3)===Ae?g+4:g+3,w);o=Me.includes("\0")?void 0:Me;return}if(T===58){if(a){const Me=p.slice(g,w);a(Me.slice(p.charCodeAt(g+1)===Ae?2:1))}return}const E=p.slice(g,w),_=E.indexOf(":");if(_===-1){S(E,"",E);return}const ce=E.slice(0,_),ne=E.charCodeAt(_+1)===Ae?2:1,Rt=E.slice(_+ne);S(ce,Rt,E)}function S(p,g,w){switch(p){case"event":d=g||void 0;break;case"data":c=h===0?g:`${c}
|
|
66
|
-
${g}`,h++;break;case"id":o=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?s(parseInt(g,10)):t(new fs(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:w}));break;default:t(new fs(`Unknown field "${p.length>20?`${p.slice(0,20)}…`:p}"`,{type:"unknown-field",field:p,value:g,line:w}));break}}function x(){h>0&&e({id:o,event:d,data:c}),o=void 0,c="",h=0,d=void 0}function H(p={}){if(p.consume&&i.length>0){const g=i.join("");I(g,0,g.length)}r=!0,o=void 0,c="",h=0,d=void 0,i.length=0}return{feed:C,reset:H}}function Ls(n,e,t){return t===100&&n.charCodeAt(e+1)===97&&n.charCodeAt(e+2)===116&&n.charCodeAt(e+3)===97&&n.charCodeAt(e+4)===58}function ys(n,e,t){return t===101&&n.charCodeAt(e+1)===118&&n.charCodeAt(e+2)===101&&n.charCodeAt(e+3)===110&&n.charCodeAt(e+4)===116&&n.charCodeAt(e+5)===58}class ws extends Event{constructor(e,t){var s,a;super(e),this.code=(s=t?.code)!=null?s:void 0,this.message=(a=t?.message)!=null?a:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,t,s){return s(Cs(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e(Cs(this),t)}}function hn(n){const e=globalThis.DOMException;return typeof e=="function"?new e(n,"SyntaxError"):new SyntaxError(n)}function ra(n){return n instanceof Error?"errors"in n&&Array.isArray(n.errors)?n.errors.map(ra).join(", "):"cause"in n&&n.cause instanceof Error?`${n}: ${ra(n.cause)}`:n.message:`${n}`}function Cs(n){return{type:n.type,message:n.message,code:n.code,defaultPrevented:n.defaultPrevented,cancelable:n.cancelable,timeStamp:n.timeStamp}}var $s=n=>{throw TypeError(n)},Ta=(n,e,t)=>e.has(n)||$s("Cannot "+t),k=(n,e,t)=>(Ta(n,e,"read from private field"),t?t.call(n):e.get(n)),V=(n,e,t)=>e.has(n)?$s("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),j=(n,e,t,s)=>(Ta(n,e,"write to private field"),e.set(n,t),t),Le=(n,e,t)=>(Ta(n,e,"access private method"),t),ie,Ee,Fe,St,vt,ot,Be,lt,Te,ze,He,$e,it,de,oa,la,ca,Ms,ha,ua,nt,da,ga;class xt extends EventTarget{constructor(e,t){var s,a;super(),V(this,de),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,V(this,ie),V(this,Ee),V(this,Fe),V(this,St),V(this,vt),V(this,ot),V(this,Be),V(this,lt,null),V(this,Te),V(this,ze),V(this,He,null),V(this,$e,null),V(this,it,null),V(this,la,async i=>{var r;k(this,ze).reset();const{body:o,redirected:c,status:h,headers:d}=i;if(h===204){Le(this,de,nt).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(c?j(this,Fe,new URL(i.url)):j(this,Fe,void 0),h!==200){Le(this,de,nt).call(this,`Non-200 status code (${h})`,h);return}if(!(d.get("content-type")||"").startsWith("text/event-stream")){Le(this,de,nt).call(this,'Invalid content type, expected "text/event-stream"',h);return}if(k(this,ie)===this.CLOSED)return;j(this,ie,this.OPEN);const C=new Event("open");if((r=k(this,it))==null||r.call(this,C),this.dispatchEvent(C),typeof o!="object"||!o||!("getReader"in o)){Le(this,de,nt).call(this,"Invalid response body, expected a web ReadableStream",h),this.close();return}const y=new TextDecoder,I=o.getReader();let S=!0;do{const{done:x,value:H}=await I.read();H&&k(this,ze).feed(y.decode(H,{stream:!x})),x&&(S=!1,k(this,ze).reset(),Le(this,de,da).call(this))}while(S)}),V(this,ca,i=>{j(this,Te,void 0),!(i.name==="AbortError"||i.type==="aborted")&&Le(this,de,da).call(this,ra(i))}),V(this,ha,i=>{typeof i.id=="string"&&j(this,lt,i.id);const r=new MessageEvent(i.event||"message",{data:i.data,origin:k(this,Fe)?k(this,Fe).origin:k(this,Ee).origin,lastEventId:i.id||""});k(this,$e)&&(!i.event||i.event==="message")&&k(this,$e).call(this,r),this.dispatchEvent(r)}),V(this,ua,i=>{j(this,ot,i)}),V(this,ga,()=>{j(this,Be,void 0),k(this,ie)===this.CONNECTING&&Le(this,de,oa).call(this)});try{if(e instanceof URL)j(this,Ee,e);else if(typeof e=="string")j(this,Ee,new URL(e,un()));else throw new Error("Invalid URL")}catch{throw hn("An invalid or illegal string was specified")}j(this,ze,cn({onEvent:k(this,ha),onRetry:k(this,ua)})),j(this,ie,this.CONNECTING),j(this,ot,3e3),j(this,vt,(s=t?.fetch)!=null?s:globalThis.fetch),j(this,St,(a=t?.withCredentials)!=null?a:!1),Le(this,de,oa).call(this)}get readyState(){return k(this,ie)}get url(){return k(this,Ee).href}get withCredentials(){return k(this,St)}get onerror(){return k(this,He)}set onerror(e){j(this,He,e)}get onmessage(){return k(this,$e)}set onmessage(e){j(this,$e,e)}get onopen(){return k(this,it)}set onopen(e){j(this,it,e)}addEventListener(e,t,s){const a=t;super.addEventListener(e,a,s)}removeEventListener(e,t,s){const a=t;super.removeEventListener(e,a,s)}close(){k(this,Be)&&clearTimeout(k(this,Be)),k(this,ie)!==this.CLOSED&&(k(this,Te)&&k(this,Te).abort(),j(this,ie,this.CLOSED),j(this,Te,void 0))}}ie=new WeakMap,Ee=new WeakMap,Fe=new WeakMap,St=new WeakMap,vt=new WeakMap,ot=new WeakMap,Be=new WeakMap,lt=new WeakMap,Te=new WeakMap,ze=new WeakMap,He=new WeakMap,$e=new WeakMap,it=new WeakMap,de=new WeakSet,oa=function(){j(this,ie,this.CONNECTING),j(this,Te,new AbortController),k(this,vt)(k(this,Ee),Le(this,de,Ms).call(this)).then(k(this,la)).catch(k(this,ca))},la=new WeakMap,ca=new WeakMap,Ms=function(){var n;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...k(this,lt)?{"Last-Event-ID":k(this,lt)}:void 0},cache:"no-store",signal:(n=k(this,Te))==null?void 0:n.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},ha=new WeakMap,ua=new WeakMap,nt=function(n,e){var t;k(this,ie)!==this.CLOSED&&j(this,ie,this.CLOSED);const s=new ws("error",{code:e,message:n});(t=k(this,He))==null||t.call(this,s),this.dispatchEvent(s)},da=function(n,e){var t;if(k(this,ie)===this.CLOSED)return;j(this,ie,this.CONNECTING);const s=new ws("error",{code:e,message:n});(t=k(this,He))==null||t.call(this,s),this.dispatchEvent(s),j(this,Be,setTimeout(k(this,ga),k(this,ot)))},ga=new WeakMap,xt.CONNECTING=0,xt.OPEN=1,xt.CLOSED=2;function un(){const n="document"in globalThis?globalThis.document:void 0;return n&&typeof n=="object"&&"baseURI"in n&&typeof n.baseURI=="string"?n.baseURI:void 0}class ye{static subscribedToClickEvent=!1;static attachAnalyticsScript(e){window._msq=window._msq||[];const s=e||"https://static.searchstax.com/studio-js/v4/js/studio-analytics.js";if(!document.querySelector(`script[src="${s}"]`)){var i=document.createElement("script");i.type="text/javascript",i.src=s;var r=document.getElementsByTagName("script")[0];r.parentNode&&r.parentNode.insertBefore(i,r)}}static msq=()=>typeof window<"u"&&window?._msq?window?._msq:[];static trackClick(e){const t={key:e.trackApiKey,query:e.searchTerm,shownHits:e.recordsPerPage,totalHits:e.totalResults,pageNo:e.currentPage,latency:e.latencyVal,session:e.session,cDocId:e.result.uniqueId,cDocTitle:e.result.titleTracking,position:e.result.position,language:e.language,model:e.model};return new Promise((s,a)=>{const i=["trackClick",t];t.key?this.msq().push(i,(function(r,o){JSON.stringify(r)===JSON.stringify(t)&&o?s():a()}).bind(this)):a()})}static trackAnswerLinkClick(e){const t={key:e.trackApiKey,question:e.searchTerm,session:e.session,href:e.href,language:e.language,model:e.model,answer:e.answer};return new Promise((s,a)=>{const i=["answerSourceClick",t];t.key?this.msq().push(i,(function(r,o){JSON.stringify(r)===JSON.stringify(t)&&o?s():a()}).bind(this)):a()})}static trackSearch(e){const t={key:e.trackApiKey,query:e.searchTerm,shownHits:e.recordsPerPage,totalHits:e.totalResults,pageNo:e.currentPage,latency:e.latencyVal,session:e.session,language:e.language,model:e.model,impressions:e.impressions};setTimeout(()=>{t.key&&this.msq().push(["track",t])},0)}static trackRelatedSearchClick(e){const t={session:e.session,key:e.trackApiKey,query:e.relatedSearch.search_term,position:e.relatedSearch.position,relatedSearch:e.relatedSearch.related_search,pageNo:1,shownHits:e.totalRelatredSearches,totalHits:e.totalRelatredSearches,language:e.language,model:e.model};setTimeout(()=>{t.key&&this.msq().push(["trackRelatedSearchClick",t])},0)}static trackRelatedSearches(e){const t={session:e.session,key:e.trackApiKey,query:e.searchTerm,latency:e.latencyVal,language:e.language,model:e.model,impressions:e.impressions,pageNo:1,shownHits:e.totalRelatredSearches,totalHits:e.totalRelatredSearches};setTimeout(()=>{t.key&&this.msq().push(["trackRelatedSearch",t])},0)}static trackAnswerData(e){const t={session:e.session,key:e.trackApiKey,question:e.searchTerm,answer:e.answer,language:e.language,model:e.model,is_question:e.isQuestion+""};setTimeout(()=>{t.key&&this.msq().push(["trackquestionanswer",t])},0)}static trackFeedback(e){setTimeout(()=>{this.msq().push(["trackSearchSatisfaction",{key:e.trackApiKey,email:e.email,score:e.rating,comments:e.feedback,language:e.language,model:e.model}])},0)}}class dn{cachedQuery="";cachedANDFacets="";url="";relatedSearches="";suggester="";authHeader;authHeaderRelated;trackApiKey="";session="";searchAuthType;searchAuth="";controllerSearch;signalSearch;controllerSuggest;signalSuggest;_authToken="";resolveFn;dataLayer;constructor(e,t){this.dataLayer=t,this.url=e.searchURL,this.dataLayer.setLanguage(e.language),this.suggester=e.suggesterURL,this.trackApiKey=e.trackApiKey,this.session=e.sessionId,this.searchAuthType=e.authType,this.searchAuth=e.searchAuth,this.authHeader=new Headers,this.authHeader.append("Accept","application/json"),this._authToken=this.searchAuthType==="token"?`Token ${e.searchAuth}`:`Basic ${e.searchAuth}`,this.authHeader.append("Authorization",this._authToken),this.authHeaderRelated=new Headers,this.authHeaderRelated.append("Accept","application/json"),this.authHeaderRelated.append("Authorization",e.searchAuth)}generateFacetQuery(e,t){let s=[];if(!t)e.forEach(function(a){const i=a.name+':"'+a.value+'"';s=s.concat("fq="+decodeURIComponent(i).replace(" "," "))});else{const a={};e.forEach(function(r){const o=r.name+":"+r.value,c=decodeURIComponent(o).replace(" "," ").split(":");a[c[0]]?a[c[0]].push(c[1]):a[c[0]]=[c[1]]});let i="";for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)){const o=a[r],c=r;for(const h of o)i+=i===""?` ${c}:"${h}"`:` OR ${c}:"${h}"`}s=s.concat("fq="+i.trim())}return s=s.map(a=>a.replace(/&/g,"%26").replace(/\+/g,"%2B")),s.length?"&"+s.join("&"):""}generateLocationQuery(e){let t="";if(e.lat&&e.lon){const s=Math.floor(parseFloat(e.lat)*100)/100,a=Math.floor(parseFloat(e.lon)*100)/100;t+=`&pt=${s},${a}`}return e.radius&&t!==""&&e.radius!=="any"&&(t+=`&distanceFilter=${e.radius}`),t}getRelatedSearches(e,t,s,a){const i=new Headers;i.append("Accept","application/json"),i.append("Authorization",s),fetch(t+"?search="+encodeURIComponent(e.query)+"&language="+this.dataLayer.language,{method:"GET",headers:i,credentials:"same-origin"}).then(r=>r.json()).then(r=>{a(r)})}cacheFacets(e){return new Promise(t=>{if(this.resolveFn=t,this.dataLayer.searchObject.query!==this.cachedQuery||this.cachedANDFacets+e!==this.dataLayer.parsedData.cachedANDFacets+e){this.cachedANDFacets=this.dataLayer.parsedData.cachedANDFacets+e,this.cachedQuery=this.dataLayer.searchObject.query;const s=[this.dataLayer.searchObject.facets.filter(a=>e?!1:a.type==="and"||a.type==="tabs")].flat();this.search({query:this.dataLayer.searchObject.query??"*",itemsPerPage:void 0,page:1,order:"",facets:s,additionalProps:this.dataLayer.searchObject.additionalProps,location:this.dataLayer.searchObject.location,model:this.dataLayer.model},this.cacheFacetsCallback.bind(this),!0,!1,e)}else this.resolveFn()})}cacheFacetsCallback(e,t){let s=st.extractFacets(e);t?this.dataLayer.setSearchFacetsCachedTabs(s):this.dataLayer.setSearchFacetsCached(s),this.resolveFn&&this.resolveFn()}search(e,t,s=!1,a=!1,i=!1){if(e.query&&e.query!=="undefined"){this.dataLayer.setSearchTerm(e.query),this.dataLayer.setLoading(!0),this.controllerSearch&&this.controllerSearch.abort(),this.controllerSearch=new AbortController,this.signalSearch=this.controllerSearch.signal;const r=this.url+this.generateQueryParams(e,a),o={method:"GET",headers:this.authHeader,credentials:"same-origin",signal:this.signalSearch};s&&delete o.signal,fetch(r,o).then(c=>c.json()).then(c=>{this.dataLayer.setLoading(!1),t(c,i)}).catch(()=>{this.dataLayer.setLoading(!1)})}}generateQueryParams(e,t){let s=(e.itemsPerPage?e.itemsPerPage:0)*(e.page-1),a=e.order?`&sort=${e.order}`:"";const i=new Proxy(new URLSearchParams(window?.location.search??""),{get:(c,h)=>c.get(h)??""}),r=i.languageVariant?"&fq=_language:"+i.languageVariant:"",o=e.model??this.dataLayer.model;return"?q="+encodeURIComponent(e.query.trim())+"&start="+s+this.toQueryString(e.additionalProps??[])+this.generateFacetQuery(e.facets.filter(c=>c.type==="or"||c.type==="showUnavailable"),!0)+this.generateLocationQuery(e.location)+this.generateFacetQuery(e.facets.filter(c=>c.type==="and"||c.type==="tabs"),!1)+a+`&spellcheck.correct=${this.dataLayer.autoCorrect&&!t}`+(o?`&model=${o}`:"")+"&language="+this.dataLayer.language+r}startSSE(e,t){if(!this.dataLayer.turnAIAnswerGenerationOn||e==="*"||this.dataLayer.searchObject.page!==1)return;const s=new xt(this.dataLayer.questionURL+this.generateQueryParams(this.dataLayer.searchObject),{fetch:(i,r)=>fetch(i,{...r,headers:{...r?.headers,Authorization:this._authToken}})}),a=this.dataLayer;return s.onmessage=i=>{if(i.data===Ve.question||i.data===Ve.notQuestion){i.data===Ve.question?(this.dataLayer.setAnswerLoading(!0),this.dataLayer.setIsQuestion(!0)):(a.setAnswerLoading(!1),this.dataLayer.setIsQuestion(!1)),a.setAnswerData("");return}if(i.data===Ve.close){ye.trackAnswerData({...a.parsedData.trackingData,answer:a.$answer.getValue(),isQuestion:this.dataLayer.isQuestion}),a.setAnswerLoading(!1),s.close();return}if(i.data.indexOf("[!CAUTION]")!==-1){a.setAnswerError(!0),a.setAnswerErrorMessage("We're having trouble generating an answer. Please try again."),s.close();return}if(i.data.indexOf("[comment]: <> ({")!==-1)try{const r=i.data.split("[comment]: <> ({");if(r.length<2){t(i.data);return}const o=r[1].split("})");if(o.length<2){t(i.data);return}const c=o[0],h=JSON.parse("{"+c+"}");this.dataLayer.answerWidgetShowMoreLimit=h.displayShowMoreAfter,h.showMoreEnabled||(this.dataLayer.answerWidgetShowMoreLimit=1e17);const d=o.slice(1).join("})");t(d)}catch{t(i.data)}else t(i.data)},s.addEventListener("error",i=>{(i.code===401||i.code===500)&&(a.setAnswerErrorMessage("We're having trouble generating an answer. Please try again."),a.setAnswerError(!0))}),s.onerror=()=>{a.setAnswerLoading(!1),s.close()},s}suggest(e,t,s){if(this.controllerSuggest&&this.controllerSuggest.abort(),this.suggester.trim()==="")return;this.controllerSuggest=new AbortController,this.signalSuggest=this.controllerSuggest.signal;const a=this.suggester+"?q="+e.trim()+this.toQueryString(s)+"&language="+this.dataLayer.language;fetch(a,{method:"GET",headers:this.authHeader,credentials:"same-origin",signal:this.signalSuggest}).then(i=>i.json()).then(i=>{t(i)}).catch(()=>()=>{})}fields(){return this.fields}toQueryString(e){if(e.length===0)return"";const t=[];for(const s of e)t.push(encodeURIComponent(s.key)+"="+encodeURIComponent(s.value));return"&"+t.join("&")}}var gn=Object.prototype.toString,Qe=Array.isArray||function(e){return gn.call(e)==="[object Array]"};function Sa(n){return typeof n=="function"}function pn(n){return Qe(n)?"array":typeof n}function ea(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function bs(n,e){return n!=null&&typeof n=="object"&&e in n}function fn(n,e){return n!=null&&typeof n!="object"&&n.hasOwnProperty&&n.hasOwnProperty(e)}var mn=RegExp.prototype.test;function Ln(n,e){return mn.call(n,e)}var yn=/\S/;function wn(n){return!Ln(yn,n)}var Cn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function Mn(n){return String(n).replace(/[&<>"'`=\/]/g,function(t){return Cn[t]})}var bn=/\s*/,Tn=/\s+/,Ts=/\s*=/,Sn=/\s*\}/,xn=/#|\^|\/|>|\{|&|=|!/;function kn(n,e){if(!n)return[];var t=!1,s=[],a=[],i=[],r=!1,o=!1,c="",h=0;function d(){if(r&&!o)for(;i.length;)delete a[i.pop()];else i=[];r=!1,o=!1}var C,y,I;function S(ne){if(typeof ne=="string"&&(ne=ne.split(Tn,2)),!Qe(ne)||ne.length!==2)throw new Error("Invalid tags: "+ne);C=new RegExp(ea(ne[0])+"\\s*"),y=new RegExp("\\s*"+ea(ne[1])),I=new RegExp("\\s*"+ea("}"+ne[1]))}S(e||A.tags);for(var x=new ut(n),H,p,g,w,T,E;!x.eos();){if(H=x.pos,g=x.scanUntil(C),g)for(var _=0,ce=g.length;_<ce;++_)w=g.charAt(_),wn(w)?(i.push(a.length),c+=w):(o=!0,t=!0,c+=" "),a.push(["text",w,H,H+1]),H+=1,w===`
|
|
66
|
+
${g}`,h++;break;case"id":o=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?s(parseInt(g,10)):t(new fs(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:w}));break;default:t(new fs(`Unknown field "${p.length>20?`${p.slice(0,20)}…`:p}"`,{type:"unknown-field",field:p,value:g,line:w}));break}}function x(){h>0&&e({id:o,event:d,data:c}),o=void 0,c="",h=0,d=void 0}function H(p={}){if(p.consume&&i.length>0){const g=i.join("");I(g,0,g.length)}r=!0,o=void 0,c="",h=0,d=void 0,i.length=0}return{feed:C,reset:H}}function Ls(n,e,t){return t===100&&n.charCodeAt(e+1)===97&&n.charCodeAt(e+2)===116&&n.charCodeAt(e+3)===97&&n.charCodeAt(e+4)===58}function ys(n,e,t){return t===101&&n.charCodeAt(e+1)===118&&n.charCodeAt(e+2)===101&&n.charCodeAt(e+3)===110&&n.charCodeAt(e+4)===116&&n.charCodeAt(e+5)===58}class ws extends Event{constructor(e,t){var s,a;super(e),this.code=(s=t?.code)!=null?s:void 0,this.message=(a=t?.message)!=null?a:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,t,s){return s(Cs(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e(Cs(this),t)}}function hn(n){const e=globalThis.DOMException;return typeof e=="function"?new e(n,"SyntaxError"):new SyntaxError(n)}function ra(n){return n instanceof Error?"errors"in n&&Array.isArray(n.errors)?n.errors.map(ra).join(", "):"cause"in n&&n.cause instanceof Error?`${n}: ${ra(n.cause)}`:n.message:`${n}`}function Cs(n){return{type:n.type,message:n.message,code:n.code,defaultPrevented:n.defaultPrevented,cancelable:n.cancelable,timeStamp:n.timeStamp}}var $s=n=>{throw TypeError(n)},Ta=(n,e,t)=>e.has(n)||$s("Cannot "+t),k=(n,e,t)=>(Ta(n,e,"read from private field"),t?t.call(n):e.get(n)),V=(n,e,t)=>e.has(n)?$s("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),j=(n,e,t,s)=>(Ta(n,e,"write to private field"),e.set(n,t),t),Le=(n,e,t)=>(Ta(n,e,"access private method"),t),ie,Ee,Fe,St,vt,ot,Be,lt,Te,ze,He,$e,it,de,oa,la,ca,Ms,ha,ua,nt,da,ga;class xt extends EventTarget{constructor(e,t){var s,a;super(),V(this,de),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,V(this,ie),V(this,Ee),V(this,Fe),V(this,St),V(this,vt),V(this,ot),V(this,Be),V(this,lt,null),V(this,Te),V(this,ze),V(this,He,null),V(this,$e,null),V(this,it,null),V(this,la,async i=>{var r;k(this,ze).reset();const{body:o,redirected:c,status:h,headers:d}=i;if(h===204){Le(this,de,nt).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(c?j(this,Fe,new URL(i.url)):j(this,Fe,void 0),h!==200){Le(this,de,nt).call(this,`Non-200 status code (${h})`,h);return}if(!(d.get("content-type")||"").startsWith("text/event-stream")){Le(this,de,nt).call(this,'Invalid content type, expected "text/event-stream"',h);return}if(k(this,ie)===this.CLOSED)return;j(this,ie,this.OPEN);const C=new Event("open");if((r=k(this,it))==null||r.call(this,C),this.dispatchEvent(C),typeof o!="object"||!o||!("getReader"in o)){Le(this,de,nt).call(this,"Invalid response body, expected a web ReadableStream",h),this.close();return}const y=new TextDecoder,I=o.getReader();let S=!0;do{const{done:x,value:H}=await I.read();H&&k(this,ze).feed(y.decode(H,{stream:!x})),x&&(S=!1,k(this,ze).reset(),Le(this,de,da).call(this))}while(S)}),V(this,ca,i=>{j(this,Te,void 0),!(i.name==="AbortError"||i.type==="aborted")&&Le(this,de,da).call(this,ra(i))}),V(this,ha,i=>{typeof i.id=="string"&&j(this,lt,i.id);const r=new MessageEvent(i.event||"message",{data:i.data,origin:k(this,Fe)?k(this,Fe).origin:k(this,Ee).origin,lastEventId:i.id||""});k(this,$e)&&(!i.event||i.event==="message")&&k(this,$e).call(this,r),this.dispatchEvent(r)}),V(this,ua,i=>{j(this,ot,i)}),V(this,ga,()=>{j(this,Be,void 0),k(this,ie)===this.CONNECTING&&Le(this,de,oa).call(this)});try{if(e instanceof URL)j(this,Ee,e);else if(typeof e=="string")j(this,Ee,new URL(e,un()));else throw new Error("Invalid URL")}catch{throw hn("An invalid or illegal string was specified")}j(this,ze,cn({onEvent:k(this,ha),onRetry:k(this,ua)})),j(this,ie,this.CONNECTING),j(this,ot,3e3),j(this,vt,(s=t?.fetch)!=null?s:globalThis.fetch),j(this,St,(a=t?.withCredentials)!=null?a:!1),Le(this,de,oa).call(this)}get readyState(){return k(this,ie)}get url(){return k(this,Ee).href}get withCredentials(){return k(this,St)}get onerror(){return k(this,He)}set onerror(e){j(this,He,e)}get onmessage(){return k(this,$e)}set onmessage(e){j(this,$e,e)}get onopen(){return k(this,it)}set onopen(e){j(this,it,e)}addEventListener(e,t,s){const a=t;super.addEventListener(e,a,s)}removeEventListener(e,t,s){const a=t;super.removeEventListener(e,a,s)}close(){k(this,Be)&&clearTimeout(k(this,Be)),k(this,ie)!==this.CLOSED&&(k(this,Te)&&k(this,Te).abort(),j(this,ie,this.CLOSED),j(this,Te,void 0))}}ie=new WeakMap,Ee=new WeakMap,Fe=new WeakMap,St=new WeakMap,vt=new WeakMap,ot=new WeakMap,Be=new WeakMap,lt=new WeakMap,Te=new WeakMap,ze=new WeakMap,He=new WeakMap,$e=new WeakMap,it=new WeakMap,de=new WeakSet,oa=function(){j(this,ie,this.CONNECTING),j(this,Te,new AbortController),k(this,vt)(k(this,Ee),Le(this,de,Ms).call(this)).then(k(this,la)).catch(k(this,ca))},la=new WeakMap,ca=new WeakMap,Ms=function(){var n;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...k(this,lt)?{"Last-Event-ID":k(this,lt)}:void 0},cache:"no-store",signal:(n=k(this,Te))==null?void 0:n.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},ha=new WeakMap,ua=new WeakMap,nt=function(n,e){var t;k(this,ie)!==this.CLOSED&&j(this,ie,this.CLOSED);const s=new ws("error",{code:e,message:n});(t=k(this,He))==null||t.call(this,s),this.dispatchEvent(s)},da=function(n,e){var t;if(k(this,ie)===this.CLOSED)return;j(this,ie,this.CONNECTING);const s=new ws("error",{code:e,message:n});(t=k(this,He))==null||t.call(this,s),this.dispatchEvent(s),j(this,Be,setTimeout(k(this,ga),k(this,ot)))},ga=new WeakMap,xt.CONNECTING=0,xt.OPEN=1,xt.CLOSED=2;function un(){const n="document"in globalThis?globalThis.document:void 0;return n&&typeof n=="object"&&"baseURI"in n&&typeof n.baseURI=="string"?n.baseURI:void 0}class ye{static subscribedToClickEvent=!1;static attachAnalyticsScript(e){window._msq=window._msq||[];const s=e||"https://static.searchstax.com/studio-js/v4/js/studio-analytics.js";if(!document.querySelector(`script[src="${s}"]`)){var i=document.createElement("script");i.type="text/javascript",i.src=s;var r=document.getElementsByTagName("script")[0];r.parentNode&&r.parentNode.insertBefore(i,r)}}static msq=()=>typeof window<"u"&&window?._msq?window?._msq:[];static trackClick(e){const t={key:e.trackApiKey,query:e.searchTerm,shownHits:e.recordsPerPage,totalHits:e.totalResults,pageNo:e.currentPage,latency:e.latencyVal,session:e.session,cDocId:e.result.uniqueId,cDocTitle:e.result.titleTracking,position:e.result.position,language:e.language,model:e.model};return new Promise((s,a)=>{const i=["trackClick",t];t.key?this.msq().push(i,(function(r,o){JSON.stringify(r)===JSON.stringify(t)&&o?s():a()}).bind(this)):a()})}static trackAnswerLinkClick(e){const t={key:e.trackApiKey,question:e.searchTerm,session:e.session,href:e.href,language:e.language,model:e.model,answer:e.answer};return new Promise((s,a)=>{const i=["answerSourceClick",t];t.key?this.msq().push(i,(function(r,o){JSON.stringify(r)===JSON.stringify(t)&&o?s():a()}).bind(this)):a()})}static trackSearch(e){const t={key:e.trackApiKey,query:e.searchTerm,shownHits:e.recordsPerPage,totalHits:e.totalResults,pageNo:e.currentPage,latency:e.latencyVal,session:e.session,language:e.language,model:e.model,impressions:e.impressions};setTimeout(()=>{t.key&&this.msq().push(["track",t])},0)}static trackRelatedSearchClick(e){const t={session:e.session,key:e.trackApiKey,query:e.relatedSearch.search_term,position:e.relatedSearch.position,relatedSearch:e.relatedSearch.related_search,pageNo:1,shownHits:e.totalRelatredSearches,totalHits:e.totalRelatredSearches,language:e.language,model:e.model};setTimeout(()=>{t.key&&this.msq().push(["trackRelatedSearchClick",t])},0)}static trackRelatedSearches(e){const t={session:e.session,key:e.trackApiKey,query:e.searchTerm,latency:e.latencyVal,language:e.language,model:e.model,impressions:e.impressions,pageNo:1,shownHits:e.totalRelatredSearches,totalHits:e.totalRelatredSearches};setTimeout(()=>{t.key&&this.msq().push(["trackRelatedSearch",t])},0)}static trackAnswerData(e){const t={session:e.session,key:e.trackApiKey,question:e.searchTerm,answer:e.answer,language:e.language,model:e.model,is_question:e.isQuestion+""};setTimeout(()=>{t.key&&this.msq().push(["trackquestionanswer",t])},0)}static trackFeedback(e){setTimeout(()=>{this.msq().push(["trackSearchSatisfaction",{key:e.trackApiKey,email:e.email,score:e.rating,comments:e.feedback,language:e.language,model:e.model}])},0)}}class dn{cachedQuery="";cachedANDFacets="";url="";relatedSearches="";suggester="";authHeader;authHeaderRelated;trackApiKey="";session="";searchAuthType;searchAuth="";controllerSearch;signalSearch;controllerSuggest;signalSuggest;_authToken="";resolveFn;dataLayer;constructor(e,t){this.dataLayer=t,this.url=e.searchURL,this.dataLayer.setLanguage(e.language),this.suggester=e.suggesterURL,this.trackApiKey=e.trackApiKey,this.session=e.sessionId,this.searchAuthType=e.authType,this.searchAuth=e.searchAuth,this.authHeader=new Headers,this.authHeader.append("Accept","application/json"),this._authToken=this.searchAuthType==="token"?`Token ${e.searchAuth}`:`Basic ${e.searchAuth}`,this.authHeader.append("Authorization",this._authToken),this.authHeaderRelated=new Headers,this.authHeaderRelated.append("Accept","application/json"),this.authHeaderRelated.append("Authorization",e.searchAuth)}generateFacetQuery(e,t){let s=[];if(!t)e.forEach(function(a){const i=a.name+':"'+a.value+'"';s=s.concat("fq="+decodeURIComponent(i).replace(" "," "))});else{const a={};e.forEach(function(r){const o=r.name+":"+r.value,c=decodeURIComponent(o).replace(" "," ").split(":");a[c[0]]?a[c[0]].push(c[1]):a[c[0]]=[c[1]]});let i="";for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)){const o=a[r],c=r;for(const h of o)i+=i===""?` ${c}:"${h}"`:` OR ${c}:"${h}"`}s=s.concat("fq="+i.trim())}return s=s.map(a=>a.replace(/&/g,"%26").replace(/\+/g,"%2B")),s.length?"&"+s.join("&"):""}generateLocationQuery(e){let t="";if(e.lat&&e.lon){const s=Math.floor(parseFloat(e.lat)*100)/100,a=Math.floor(parseFloat(e.lon)*100)/100;t+=`&pt=${s},${a}`}return e.radius&&t!==""&&e.radius!=="any"&&(t+=`&distanceFilter=${e.radius}`),t}getRelatedSearches(e,t,s,a){const i=new Headers;i.append("Accept","application/json"),i.append("Authorization",s),fetch(t+"?search="+encodeURIComponent(e.query)+"&language="+this.dataLayer.language,{method:"GET",headers:i,credentials:"same-origin"}).then(r=>r.json()).then(r=>{a(r)})}cacheFacets(e){return new Promise(t=>{if(this.resolveFn=t,this.dataLayer.searchObject.query!==this.cachedQuery||this.cachedANDFacets+e!==this.dataLayer.parsedData.cachedANDFacets+e){this.cachedANDFacets=this.dataLayer.parsedData.cachedANDFacets+e,this.cachedQuery=this.dataLayer.searchObject.query;const s=[this.dataLayer.searchObject.facets.filter(a=>e?!1:a.type==="and"||a.type==="tabs")].flat();this.search({query:this.dataLayer.searchObject.query??"*",itemsPerPage:void 0,page:1,order:"",facets:s,additionalProps:this.dataLayer.searchObject.additionalProps,location:this.dataLayer.searchObject.location,model:this.dataLayer.model},this.cacheFacetsCallback.bind(this),!0,!1,e)}else this.resolveFn()})}cacheFacetsCallback(e,t){let s=st.extractFacets(e);t?this.dataLayer.setSearchFacetsCachedTabs(s):this.dataLayer.setSearchFacetsCached(s),this.resolveFn&&this.resolveFn()}search(e,t,s=!1,a=!1,i=!1){if(e.query&&e.query!=="undefined"){this.dataLayer.setSearchTerm(e.query),this.dataLayer.setLoading(!0),this.controllerSearch&&this.controllerSearch.abort(),this.controllerSearch=new AbortController,this.signalSearch=this.controllerSearch.signal;const r=this.url+this.generateQueryParams(e,a),o={method:"GET",headers:this.authHeader,credentials:"same-origin",signal:this.signalSearch};s&&delete o.signal,fetch(r,o).then(c=>c.json()).then(c=>{this.dataLayer.setLoading(!1),t(c,i)}).catch(()=>{this.dataLayer.setLoading(!1)})}}generateQueryParams(e,t){let s=(e.itemsPerPage?e.itemsPerPage:0)*(e.page-1),a=e.order?`&sort=${e.order}`:"";const i=e.itemsPerPage!==void 0?`&rows=${e.itemsPerPage}`:"",r=new Proxy(new URLSearchParams(window?.location.search??""),{get:(h,d)=>h.get(d)??""}),o=r.languageVariant?"&fq=_language:"+r.languageVariant:"",c=e.model??this.dataLayer.model;return"?q="+encodeURIComponent(e.query.trim())+"&start="+s+this.toQueryString(e.additionalProps??[])+this.generateFacetQuery(e.facets.filter(h=>h.type==="or"||h.type==="showUnavailable"),!0)+this.generateLocationQuery(e.location)+this.generateFacetQuery(e.facets.filter(h=>h.type==="and"||h.type==="tabs"),!1)+a+i+`&spellcheck.correct=${this.dataLayer.autoCorrect&&!t}`+(c?`&model=${c}`:"")+"&language="+this.dataLayer.language+o}startSSE(e,t){if(!this.dataLayer.turnAIAnswerGenerationOn||e==="*"||this.dataLayer.searchObject.page!==1)return;const s=new xt(this.dataLayer.questionURL+this.generateQueryParams(this.dataLayer.searchObject),{fetch:(i,r)=>fetch(i,{...r,headers:{...r?.headers,Authorization:this._authToken}})}),a=this.dataLayer;return s.onmessage=i=>{if(i.data===Ve.question||i.data===Ve.notQuestion){i.data===Ve.question?(this.dataLayer.setAnswerLoading(!0),this.dataLayer.setIsQuestion(!0)):(a.setAnswerLoading(!1),this.dataLayer.setIsQuestion(!1)),a.setAnswerData("");return}if(i.data===Ve.close){ye.trackAnswerData({...a.parsedData.trackingData,answer:a.$answer.getValue(),isQuestion:this.dataLayer.isQuestion}),a.setAnswerLoading(!1),s.close();return}if(i.data.indexOf("[!CAUTION]")!==-1){a.setAnswerError(!0),a.setAnswerErrorMessage("We're having trouble generating an answer. Please try again."),s.close();return}if(i.data.indexOf("[comment]: <> ({")!==-1)try{const r=i.data.split("[comment]: <> ({");if(r.length<2){t(i.data);return}const o=r[1].split("})");if(o.length<2){t(i.data);return}const c=o[0],h=JSON.parse("{"+c+"}");this.dataLayer.answerWidgetShowMoreLimit=h.displayShowMoreAfter,h.showMoreEnabled||(this.dataLayer.answerWidgetShowMoreLimit=1e17);const d=o.slice(1).join("})");t(d)}catch{t(i.data)}else t(i.data)},s.addEventListener("error",i=>{(i.code===401||i.code===500)&&(a.setAnswerErrorMessage("We're having trouble generating an answer. Please try again."),a.setAnswerError(!0))}),s.onerror=()=>{a.setAnswerLoading(!1),s.close()},s}suggest(e,t,s){if(this.controllerSuggest&&this.controllerSuggest.abort(),this.suggester.trim()==="")return;this.controllerSuggest=new AbortController,this.signalSuggest=this.controllerSuggest.signal;const a=this.suggester+"?q="+e.trim()+this.toQueryString(s)+"&language="+this.dataLayer.language;fetch(a,{method:"GET",headers:this.authHeader,credentials:"same-origin",signal:this.signalSuggest}).then(i=>i.json()).then(i=>{t(i)}).catch(()=>()=>{})}fields(){return this.fields}toQueryString(e){if(e.length===0)return"";const t=[];for(const s of e)t.push(encodeURIComponent(s.key)+"="+encodeURIComponent(s.value));return"&"+t.join("&")}}var gn=Object.prototype.toString,Qe=Array.isArray||function(e){return gn.call(e)==="[object Array]"};function Sa(n){return typeof n=="function"}function pn(n){return Qe(n)?"array":typeof n}function ea(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function bs(n,e){return n!=null&&typeof n=="object"&&e in n}function fn(n,e){return n!=null&&typeof n!="object"&&n.hasOwnProperty&&n.hasOwnProperty(e)}var mn=RegExp.prototype.test;function Ln(n,e){return mn.call(n,e)}var yn=/\S/;function wn(n){return!Ln(yn,n)}var Cn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function Mn(n){return String(n).replace(/[&<>"'`=\/]/g,function(t){return Cn[t]})}var bn=/\s*/,Tn=/\s+/,Ts=/\s*=/,Sn=/\s*\}/,xn=/#|\^|\/|>|\{|&|=|!/;function kn(n,e){if(!n)return[];var t=!1,s=[],a=[],i=[],r=!1,o=!1,c="",h=0;function d(){if(r&&!o)for(;i.length;)delete a[i.pop()];else i=[];r=!1,o=!1}var C,y,I;function S(ne){if(typeof ne=="string"&&(ne=ne.split(Tn,2)),!Qe(ne)||ne.length!==2)throw new Error("Invalid tags: "+ne);C=new RegExp(ea(ne[0])+"\\s*"),y=new RegExp("\\s*"+ea(ne[1])),I=new RegExp("\\s*"+ea("}"+ne[1]))}S(e||A.tags);for(var x=new ut(n),H,p,g,w,T,E;!x.eos();){if(H=x.pos,g=x.scanUntil(C),g)for(var _=0,ce=g.length;_<ce;++_)w=g.charAt(_),wn(w)?(i.push(a.length),c+=w):(o=!0,t=!0,c+=" "),a.push(["text",w,H,H+1]),H+=1,w===`
|
|
67
67
|
`&&(d(),c="",h=0,t=!1);if(!x.scan(C))break;if(r=!0,p=x.scan(xn)||"name",x.scan(bn),p==="="?(g=x.scanUntil(Ts),x.scan(Ts),x.scanUntil(y)):p==="{"?(g=x.scanUntil(I),x.scan(Sn),x.scanUntil(y),p="&"):g=x.scanUntil(y),!x.scan(y))throw new Error("Unclosed tag at "+x.pos);if(p==">"?T=[p,g,H,x.pos,c,h,t]:T=[p,g,H,x.pos],h++,a.push(T),p==="#"||p==="^")s.push(T);else if(p==="/"){if(E=s.pop(),!E)throw new Error('Unopened section "'+g+'" at '+H);if(E[1]!==g)throw new Error('Unclosed section "'+E[1]+'" at '+H)}else p==="name"||p==="{"||p==="&"?o=!0:p==="="&&S(g)}if(d(),E=s.pop(),E)throw new Error('Unclosed section "'+E[1]+'" at '+x.pos);return En(An(a))}function An(n){for(var e=[],t,s,a=0,i=n.length;a<i;++a)t=n[a],t&&(t[0]==="text"&&s&&s[0]==="text"?(s[1]+=t[1],s[3]=t[3]):(e.push(t),s=t));return e}function En(n){for(var e=[],t=e,s=[],a,i,r=0,o=n.length;r<o;++r)switch(a=n[r],a[0]){case"#":case"^":t.push(a),s.push(a),t=a[4]=[];break;case"/":i=s.pop(),i[5]=a[2],t=s.length>0?s[s.length-1][4]:e;break;default:t.push(a)}return e}function ut(n){this.string=n,this.tail=n,this.pos=0}ut.prototype.eos=function(){return this.tail===""};ut.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var s=t[0];return this.tail=this.tail.substring(s.length),this.pos+=s.length,s};ut.prototype.scanUntil=function(e){var t=this.tail.search(e),s;switch(t){case-1:s=this.tail,this.tail="";break;case 0:s="";break;default:s=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=s.length,s};function Ue(n,e){this.view=n,this.cache={".":this.view},this.parent=e}Ue.prototype.push=function(e){return new Ue(e,this)};Ue.prototype.lookup=function(e){var t=this.cache,s;if(t.hasOwnProperty(e))s=t[e];else{for(var a=this,i,r,o,c=!1;a;){if(e.indexOf(".")>0)for(i=a.view,r=e.split("."),o=0;i!=null&&o<r.length;)o===r.length-1&&(c=bs(i,r[o])||fn(i,r[o])),i=i[r[o++]];else i=a.view[e],c=bs(a.view,e);if(c){s=i;break}a=a.parent}t[e]=s}return Sa(s)&&(s=s.call(this.view)),s};function te(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}te.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};te.prototype.parse=function(e,t){var s=this.templateCache,a=e+":"+(t||A.tags).join(":"),i=typeof s<"u",r=i?s.get(a):void 0;return r==null&&(r=kn(e,t),i&&s.set(a,r)),r};te.prototype.render=function(e,t,s,a){var i=this.getConfigTags(a),r=this.parse(e,i),o=t instanceof Ue?t:new Ue(t,void 0);return this.renderTokens(r,o,s,e,a)};te.prototype.renderTokens=function(e,t,s,a,i){for(var r="",o,c,h,d=0,C=e.length;d<C;++d)h=void 0,o=e[d],c=o[0],c==="#"?h=this.renderSection(o,t,s,a,i):c==="^"?h=this.renderInverted(o,t,s,a,i):c===">"?h=this.renderPartial(o,t,s,i):c==="&"?h=this.unescapedValue(o,t):c==="name"?h=this.escapedValue(o,t,i):c==="text"&&(h=this.rawValue(o)),h!==void 0&&(r+=h);return r};te.prototype.renderSection=function(e,t,s,a,i){var r=this,o="",c=t.lookup(e[1]);function h(y){return r.render(y,t,s,i)}if(c){if(Qe(c))for(var d=0,C=c.length;d<C;++d)o+=this.renderTokens(e[4],t.push(c[d]),s,a,i);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")o+=this.renderTokens(e[4],t.push(c),s,a,i);else if(Sa(c)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(t.view,a.slice(e[3],e[5]),h),c!=null&&(o+=c)}else o+=this.renderTokens(e[4],t,s,a,i);return o}};te.prototype.renderInverted=function(e,t,s,a,i){var r=t.lookup(e[1]);if(!r||Qe(r)&&r.length===0)return this.renderTokens(e[4],t,s,a,i)};te.prototype.indentPartial=function(e,t,s){for(var a=t.replace(/[^ \t]/g,""),i=e.split(`
|
|
68
68
|
`),r=0;r<i.length;r++)i[r].length&&(r>0||!s)&&(i[r]=a+i[r]);return i.join(`
|
|
69
69
|
`)};te.prototype.renderPartial=function(e,t,s,a){if(s){var i=this.getConfigTags(a),r=Sa(s)?s(e[1]):s[e[1]];if(r!=null){var o=e[6],c=e[5],h=e[4],d=r;c==0&&h&&(d=this.indentPartial(r,h,o));var C=this.parse(d,i);return this.renderTokens(C,t,s,d,a)}}};te.prototype.unescapedValue=function(e,t){var s=t.lookup(e[1]);if(s!=null)return s};te.prototype.escapedValue=function(e,t,s){var a=this.getConfigEscape(s)||A.escape,i=t.lookup(e[1]);if(i!=null)return typeof i=="number"&&a===A.escape?String(i):a(i)};te.prototype.rawValue=function(e){return e[1]};te.prototype.getConfigTags=function(e){return Qe(e)?e:e&&typeof e=="object"?e.tags:void 0};te.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!Qe(e))return e.escape};var A={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(n){ct.templateCache=n},get templateCache(){return ct.templateCache}},ct=new te;A.clearCache=function(){return ct.clearCache()};A.parse=function(e,t){return ct.parse(e,t)};A.render=function(e,t,s,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+pn(e)+'" was given as the first argument for mustache#render(template, view, partials)');return ct.render(e,t,s,a)};A.escape=Mn;A.Scanner=ut;A.Context=Ue;A.Writer=te;const vn={main:{template:`
|