@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.
|
@@ -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>${ge(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=za(n);if(a===null)return s;n=a;let i='<a href="'+n+'"';return e&&(i+=' title="'+ge(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=za(n);if(a===null)return ge(t);n=a;let i=`<img src="${n}" alt="${t}"`;return e&&(i+=` title="${ge(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:ge(n.text)}},Vt=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""}},Le=class Sa{options;renderer;textRenderer;constructor(e){this.options=e||Se,this.options.renderer=this.options.renderer||new Lt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Vt}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}},yt=class{options;block;constructor(n){this.options=n||Se}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?me.lex:me.lexInline}provideParser(){return this.block?Le.parse:Le.parseInline}},Ti=class{defaults=Rt();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Le;Renderer=Lt;TextRenderer=Vt;Lexer=me;Tokenizer=mt;Hooks=yt;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 Lt(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 mt(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 yt;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];yt.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 me.lex(n,e??this.defaults)}parser(n,e){return Le.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?me.lex:me.lexInline,c=i.hooks?i.hooks.provideParser():n?Le.parse:Le.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>"+ge(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},xe=new Ti;function D(n,e){return xe.parse(n,e)}D.options=D.setOptions=function(n){return xe.setOptions(n),D.defaults=xe.defaults,ka(D.defaults),D},D.getDefaults=Rt,D.defaults=Se,D.use=function(...n){return xe.use(...n),D.defaults=xe.defaults,ka(D.defaults),D},D.walkTokens=function(n,e){return xe.walkTokens(n,e)},D.parseInline=xe.parseInline,D.Parser=Le,D.parser=Le.parse,D.Renderer=Lt,D.TextRenderer=Vt,D.Lexer=me,D.lexer=me.lex,D.Tokenizer=mt,D.Hooks=yt,D.parse=D,D.options,D.setOptions,D.use,D.walkTokens,D.parseInline,Le.parse,me.lex;const{entries:Ba,setPrototypeOf:Ha,isFrozen:Si,getPrototypeOf:xi,getOwnPropertyDescriptor:ki}=Object;let{freeze:X,seal:re,create:Ie}=Object,{apply:Bt,construct:Ht}=typeof Reflect<"u"&&Reflect;X||(X=function(e){return e}),re||(re=function(e){return e}),Bt||(Bt=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)}),Ht||(Ht=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 Ge=_(Array.prototype.forEach),Ai=_(Array.prototype.lastIndexOf),Ua=_(Array.prototype.pop),Ze=_(Array.prototype.push),Ei=_(Array.prototype.splice),ee=Array.isArray,Ke=_(String.prototype.toLowerCase),Ut=_(String.prototype.toString),Qa=_(String.prototype.match),Re=_(String.prototype.replace),qa=_(String.prototype.indexOf),vi=_(String.prototype.trim),Di=_(Number.prototype.toString),Ii=_(Boolean.prototype.toString),Wa=typeof BigInt>"u"?null:_(BigInt.prototype.toString),Ya=typeof Symbol>"u"?null:_(Symbol.prototype.toString),P=_(Object.prototype.hasOwnProperty),Xe=_(Object.prototype.toString),J=_(RegExp.prototype.test),wt=Ri(TypeError);function _(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 Bt(n,e,s)}}function Ri(n){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return Ht(n,t)}}function b(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ke;if(Ha&&Ha(n,null),!ee(e))return n;let s=e.length;for(;s--;){let a=e[s];if(typeof a=="string"){const i=t(a);i!==a&&(Si(e)||(e[s]=i),a=i)}n[a]=!0}return n}function ji(n){for(let e=0;e<n.length;e++)P(n,e)||(n[e]=null);return n}function ae(n){const e=Ie(null);for(const[t,s]of Ba(n))P(n,t)&&(ee(s)?e[t]=ji(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=ae(s):e[t]=s);return e}function Ni(n){switch(typeof n){case"string":return n;case"number":return Di(n);case"boolean":return Ii(n);case"bigint":return Wa?Wa(n):"0";case"symbol":return Ya?Ya(n):"Symbol()";case"undefined":return Xe(n);case"function":case"object":{if(n===null)return Xe(n);const e=n,t=je(e,"toString");if(typeof t=="function"){const s=t(e);return typeof s=="string"?s:Xe(s)}return Xe(n)}default:return Xe(n)}}function je(n,e){for(;n!==null;){const s=ki(n,e);if(s){if(s.get)return _(s.get);if(typeof s.value=="function")return _(s.value)}n=xi(n)}function t(){return null}return t}function Pi(n){try{return J(n,""),!0}catch{return!1}}const Ja=X(["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"]),Qt=X(["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"]),qt=X(["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"]),Oi=X(["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"]),Wt=X(["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"]),_i=X(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ga=X(["#text"]),Za=X(["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"]),Yt=X(["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"]),Ka=X(["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"]),Ct=X(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Fi=re(/\{\{[\w\W]*|[\w\W]*\}\}/gm),zi=re(/<%[\w\W]*|[\w\W]*%>/gm),$i=re(/\$\{[\w\W]*/gm),Vi=re(/^data-[\-\w.\u00B7-\uFFFF]+$/),Bi=re(/^aria-[\-\w]+$/),Xa=re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hi=re(/^(?:\w+script|data):/i),Ui=re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),es=re(/^html$/i),Qi=re(/^[a-z][.\w]*(-[.\w]+)+$/i);var ts=Object.freeze({__proto__:null,ARIA_ATTR:Bi,ATTR_WHITESPACE:Ui,CUSTOM_ELEMENT:Qi,DATA_ATTR:Vi,DOCTYPE_NAME:es,ERB_EXPR:zi,IS_ALLOWED_URI:Xa,IS_SCRIPT_OR_DATA:Hi,MUSTACHE_EXPR:Fi,TMPLIT_EXPR:$i});const et={element:1,text:3,progressingInstruction:7,comment:8,document:9},qi=function(){return typeof window>"u"?null:window},Wi=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}},as=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ss(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qi();const e=m=>ss(m);if(e.version="3.4.1",e.removed=[],!n||!n.document||n.document.nodeType!==et.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=je(S,"cloneNode"),Q=je(S,"remove"),p=je(S,"nextSibling"),g=je(S,"childNodes"),w=je(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:F,createNodeIterator:he,createDocumentFragment:ne,getElementsByTagName:la}=t,{importNode:be}=s;let q=as();e.isSupported=typeof Ba=="function"&&typeof w=="function"&&F&&F.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:St,ERB_EXPR:xt,TMPLIT_EXPR:kt,DATA_ATTR:$n,ARIA_ATTR:Vn,IS_SCRIPT_OR_DATA:Bn,ATTR_WHITESPACE:Ls,CUSTOM_ELEMENT:Hn}=ts;let{IS_ALLOWED_URI:ys}=ts,W=null;const ws=b({},[...Ja,...Qt,...qt,...Wt,...Ga]);let G=null;const Cs=b({},[...Za,...Yt,...Ka,...Ct]);let O=Object.seal(Ie(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}})),lt=null,At=null;const Te=Object.seal(Ie(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ms=!0,ca=!0,bs=!1,Ts=!0,Ee=!1,ct=!0,ve=!1,ha=!1,ua=!1,Be=!1,Et=!1,vt=!1,Ss=!0,xs=!1;const ks="user-content-";let da=!0,ht=!1,He={},pe=null;const ga=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 As=null;const Es=b({},["audio","video","img","source","image","track"]);let pa=null;const vs=b({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Dt="http://www.w3.org/1998/Math/MathML",It="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let Ue=fe,fa=!1,ma=null;const Un=b({},[Dt,It,fe],Ut);let La=b({},["mi","mo","mn","ms","mtext"]),ya=b({},["annotation-xml"]);const Qn=b({},["title","style","font","a","script"]);let ut=null;const qn=["application/xhtml+xml","text/html"],Wn="text/html";let B=null,Qe=null;const Yn=t.createElement("form"),Ds=function(l){return l instanceof RegExp||l instanceof Function},wa=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Qe&&Qe===l)return;(!l||typeof l!="object")&&(l={}),l=ae(l),ut=qn.indexOf(l.PARSER_MEDIA_TYPE)===-1?Wn:l.PARSER_MEDIA_TYPE,B=ut==="application/xhtml+xml"?Ut:Ke,W=P(l,"ALLOWED_TAGS")&&ee(l.ALLOWED_TAGS)?b({},l.ALLOWED_TAGS,B):ws,G=P(l,"ALLOWED_ATTR")&&ee(l.ALLOWED_ATTR)?b({},l.ALLOWED_ATTR,B):Cs,ma=P(l,"ALLOWED_NAMESPACES")&&ee(l.ALLOWED_NAMESPACES)?b({},l.ALLOWED_NAMESPACES,Ut):Un,pa=P(l,"ADD_URI_SAFE_ATTR")&&ee(l.ADD_URI_SAFE_ATTR)?b(ae(vs),l.ADD_URI_SAFE_ATTR,B):vs,As=P(l,"ADD_DATA_URI_TAGS")&&ee(l.ADD_DATA_URI_TAGS)?b(ae(Es),l.ADD_DATA_URI_TAGS,B):Es,pe=P(l,"FORBID_CONTENTS")&&ee(l.FORBID_CONTENTS)?b({},l.FORBID_CONTENTS,B):ga,lt=P(l,"FORBID_TAGS")&&ee(l.FORBID_TAGS)?b({},l.FORBID_TAGS,B):ae({}),At=P(l,"FORBID_ATTR")&&ee(l.FORBID_ATTR)?b({},l.FORBID_ATTR,B):ae({}),He=P(l,"USE_PROFILES")?l.USE_PROFILES&&typeof l.USE_PROFILES=="object"?ae(l.USE_PROFILES):l.USE_PROFILES:!1,Ms=l.ALLOW_ARIA_ATTR!==!1,ca=l.ALLOW_DATA_ATTR!==!1,bs=l.ALLOW_UNKNOWN_PROTOCOLS||!1,Ts=l.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ee=l.SAFE_FOR_TEMPLATES||!1,ct=l.SAFE_FOR_XML!==!1,ve=l.WHOLE_DOCUMENT||!1,Be=l.RETURN_DOM||!1,Et=l.RETURN_DOM_FRAGMENT||!1,vt=l.RETURN_TRUSTED_TYPE||!1,ua=l.FORCE_BODY||!1,Ss=l.SANITIZE_DOM!==!1,xs=l.SANITIZE_NAMED_PROPS||!1,da=l.KEEP_CONTENT!==!1,ht=l.IN_PLACE||!1,ys=Pi(l.ALLOWED_URI_REGEXP)?l.ALLOWED_URI_REGEXP:Xa,Ue=typeof l.NAMESPACE=="string"?l.NAMESPACE:fe,La=P(l,"MATHML_TEXT_INTEGRATION_POINTS")&&l.MATHML_TEXT_INTEGRATION_POINTS&&typeof l.MATHML_TEXT_INTEGRATION_POINTS=="object"?ae(l.MATHML_TEXT_INTEGRATION_POINTS):b({},["mi","mo","mn","ms","mtext"]),ya=P(l,"HTML_INTEGRATION_POINTS")&&l.HTML_INTEGRATION_POINTS&&typeof l.HTML_INTEGRATION_POINTS=="object"?ae(l.HTML_INTEGRATION_POINTS):b({},["annotation-xml"]);const u=P(l,"CUSTOM_ELEMENT_HANDLING")&&l.CUSTOM_ELEMENT_HANDLING&&typeof l.CUSTOM_ELEMENT_HANDLING=="object"?ae(l.CUSTOM_ELEMENT_HANDLING):Ie(null);if(O=Ie(null),P(u,"tagNameCheck")&&Ds(u.tagNameCheck)&&(O.tagNameCheck=u.tagNameCheck),P(u,"attributeNameCheck")&&Ds(u.attributeNameCheck)&&(O.attributeNameCheck=u.attributeNameCheck),P(u,"allowCustomizedBuiltInElements")&&typeof u.allowCustomizedBuiltInElements=="boolean"&&(O.allowCustomizedBuiltInElements=u.allowCustomizedBuiltInElements),Ee&&(ca=!1),Et&&(Be=!0),He&&(W=b({},Ga),G=Ie(null),He.html===!0&&(b(W,Ja),b(G,Za)),He.svg===!0&&(b(W,Qt),b(G,Yt),b(G,Ct)),He.svgFilters===!0&&(b(W,qt),b(G,Yt),b(G,Ct)),He.mathMl===!0&&(b(W,Wt),b(G,Ka),b(G,Ct))),Te.tagCheck=null,Te.attributeCheck=null,P(l,"ADD_TAGS")&&(typeof l.ADD_TAGS=="function"?Te.tagCheck=l.ADD_TAGS:ee(l.ADD_TAGS)&&(W===ws&&(W=ae(W)),b(W,l.ADD_TAGS,B))),P(l,"ADD_ATTR")&&(typeof l.ADD_ATTR=="function"?Te.attributeCheck=l.ADD_ATTR:ee(l.ADD_ATTR)&&(G===Cs&&(G=ae(G)),b(G,l.ADD_ATTR,B))),P(l,"ADD_URI_SAFE_ATTR")&&ee(l.ADD_URI_SAFE_ATTR)&&b(pa,l.ADD_URI_SAFE_ATTR,B),P(l,"FORBID_CONTENTS")&&ee(l.FORBID_CONTENTS)&&(pe===ga&&(pe=ae(pe)),b(pe,l.FORBID_CONTENTS,B)),P(l,"ADD_FORBID_CONTENTS")&&ee(l.ADD_FORBID_CONTENTS)&&(pe===ga&&(pe=ae(pe)),b(pe,l.ADD_FORBID_CONTENTS,B)),da&&(W["#text"]=!0),ve&&b(W,["html","head","body"]),W.table&&(b(W,["tbody"]),delete lt.tbody),l.TRUSTED_TYPES_POLICY){if(typeof l.TRUSTED_TYPES_POLICY.createHTML!="function")throw wt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof l.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw wt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=l.TRUSTED_TYPES_POLICY,E=T.createHTML("")}else T===void 0&&(T=Wi(I,a)),T!==null&&typeof E=="string"&&(E=T.createHTML(""));X&&X(l),Qe=l},Is=b({},[...Qt,...qt,...Oi]),Rs=b({},[...Wt,..._i]),Jn=function(l){let u=w(l);(!u||!u.tagName)&&(u={namespaceURI:Ue,tagName:"template"});const f=Ke(l.tagName),j=Ke(u.tagName);return ma[l.namespaceURI]?l.namespaceURI===It?u.namespaceURI===fe?f==="svg":u.namespaceURI===Dt?f==="svg"&&(j==="annotation-xml"||La[j]):!!Is[f]:l.namespaceURI===Dt?u.namespaceURI===fe?f==="math":u.namespaceURI===It?f==="math"&&ya[j]:!!Rs[f]:l.namespaceURI===fe?u.namespaceURI===It&&!ya[j]||u.namespaceURI===Dt&&!La[j]?!1:!Rs[f]&&(Qn[f]||!Is[f]):!!(ut==="application/xhtml+xml"&&ma[l.namespaceURI]):!1},ue=function(l){Ze(e.removed,{element:l});try{w(l).removeChild(l)}catch{Q(l)}},De=function(l,u){try{Ze(e.removed,{attribute:u.getAttributeNode(l),from:u})}catch{Ze(e.removed,{attribute:null,from:u})}if(u.removeAttribute(l),l==="is")if(Be||Et)try{ue(u)}catch{}else try{u.setAttribute(l,"")}catch{}},js=function(l){let u=null,f=null;if(ua)l="<remove></remove>"+l;else{const z=Qa(l,/^[\r\n\t ]+/);f=z&&z[0]}ut==="application/xhtml+xml"&&Ue===fe&&(l='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+l+"</body></html>");const j=T?T.createHTML(l):l;if(Ue===fe)try{u=new y().parseFromString(j,ut)}catch{}if(!u||!u.documentElement){u=F.createDocument(Ue,"template",null);try{u.documentElement.innerHTML=fa?E:j}catch{}}const Z=u.body||u.documentElement;return l&&f&&Z.insertBefore(t.createTextNode(f),Z.childNodes[0]||null),Ue===fe?la.call(u,ve?"html":"body")[0]:ve?u.documentElement:Z},Ns=function(l){return he.call(l.ownerDocument||l,l,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Ca=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")},Ma=function(l){return typeof o=="function"&&l instanceof o};function Ce(m,l,u){Ge(m,f=>{f.call(e,l,u,Qe)})}const Ps=function(l){let u=null;if(Ce(q.beforeSanitizeElements,l,null),Ca(l))return ue(l),!0;const f=B(l.nodeName);if(Ce(q.uponSanitizeElement,l,{tagName:f,allowedTags:W}),ct&&l.hasChildNodes()&&!Ma(l.firstElementChild)&&J(/<[/\w!]/g,l.innerHTML)&&J(/<[/\w!]/g,l.textContent)||ct&&l.namespaceURI===fe&&f==="style"&&Ma(l.firstElementChild)||l.nodeType===et.progressingInstruction||ct&&l.nodeType===et.comment&&J(/<[/\w]/g,l.data))return ue(l),!0;if(lt[f]||!(Te.tagCheck instanceof Function&&Te.tagCheck(f))&&!W[f]){if(!lt[f]&&_s(f)&&(O.tagNameCheck instanceof RegExp&&J(O.tagNameCheck,f)||O.tagNameCheck instanceof Function&&O.tagNameCheck(f)))return!1;if(da&&!pe[f]){const j=w(l)||l.parentNode,Z=g(l)||l.childNodes;if(Z&&j){const z=Z.length;for(let ie=z-1;ie>=0;--ie){const le=x(Z[ie],!0);j.insertBefore(le,p(l))}}}return ue(l),!0}return l instanceof c&&!Jn(l)||(f==="noscript"||f==="noembed"||f==="noframes")&&J(/<\/no(script|embed|frames)/i,l.innerHTML)?(ue(l),!0):(Ee&&l.nodeType===et.text&&(u=l.textContent,Ge([St,xt,kt],j=>{u=Re(u,j," ")}),l.textContent!==u&&(Ze(e.removed,{element:l.cloneNode()}),l.textContent=u)),Ce(q.afterSanitizeElements,l,null),!1)},Os=function(l,u,f){if(At[u]||Ss&&(u==="id"||u==="name")&&(f in t||f in Yn))return!1;if(!(ca&&!At[u]&&J($n,u))){if(!(Ms&&J(Vn,u))){if(!(Te.attributeCheck instanceof Function&&Te.attributeCheck(u,l))){if(!G[u]||At[u]){if(!(_s(l)&&(O.tagNameCheck instanceof RegExp&&J(O.tagNameCheck,l)||O.tagNameCheck instanceof Function&&O.tagNameCheck(l))&&(O.attributeNameCheck instanceof RegExp&&J(O.attributeNameCheck,u)||O.attributeNameCheck instanceof Function&&O.attributeNameCheck(u,l))||u==="is"&&O.allowCustomizedBuiltInElements&&(O.tagNameCheck instanceof RegExp&&J(O.tagNameCheck,f)||O.tagNameCheck instanceof Function&&O.tagNameCheck(f))))return!1}else if(!pa[u]){if(!J(ys,Re(f,Ls,""))){if(!((u==="src"||u==="xlink:href"||u==="href")&&l!=="script"&&qa(f,"data:")===0&&As[l])){if(!(bs&&!J(Bn,Re(f,Ls,"")))){if(f)return!1}}}}}}}return!0},Gn=b({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),_s=function(l){return!Gn[Ke(l)]&&J(Hn,l)},Fs=function(l){Ce(q.beforeSanitizeAttributes,l,null);const{attributes:u}=l;if(!u||Ca(l))return;const f={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:G,forceKeepAttr:void 0};let j=u.length;for(;j--;){const Z=u[j],{name:z,namespaceURI:ie,value:le}=Z,de=B(z),ba=le;let Y=z==="value"?ba:vi(ba);if(f.attrName=de,f.attrValue=Y,f.keepAttr=!0,f.forceKeepAttr=void 0,Ce(q.uponSanitizeAttribute,l,f),Y=f.attrValue,xs&&(de==="id"||de==="name")&&qa(Y,ks)!==0&&(De(z,l),Y=ks+Y),ct&&J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Y)){De(z,l);continue}if(de==="attributename"&&Qa(Y,"href")){De(z,l);continue}if(f.forceKeepAttr)continue;if(!f.keepAttr){De(z,l);continue}if(!Ts&&J(/\/>/i,Y)){De(z,l);continue}Ee&&Ge([St,xt,kt],Vs=>{Y=Re(Y,Vs," ")});const $s=B(l.nodeName);if(!Os($s,de,Y)){De(z,l);continue}if(T&&typeof I=="object"&&typeof I.getAttributeType=="function"&&!ie)switch(I.getAttributeType($s,de)){case"TrustedHTML":{Y=T.createHTML(Y);break}case"TrustedScriptURL":{Y=T.createScriptURL(Y);break}}if(Y!==ba)try{ie?l.setAttributeNS(ie,z,Y):l.setAttribute(z,Y),Ca(l)?ue(l):Ua(e.removed)}catch{De(z,l)}}Ce(q.afterSanitizeAttributes,l,null)},zs=function(l){let u=null;const f=Ns(l);for(Ce(q.beforeSanitizeShadowDOM,l,null);u=f.nextNode();)Ce(q.uponSanitizeShadowNode,u,null),Ps(u),Fs(u),u.content instanceof i&&zs(u.content);Ce(q.afterSanitizeShadowDOM,l,null)};return e.sanitize=function(m){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=null,f=null,j=null,Z=null;if(fa=!m,fa&&(m="<!-->"),typeof m!="string"&&!Ma(m)&&(m=Ni(m),typeof m!="string"))throw wt("dirty is not a string, aborting");if(!e.isSupported)return m;if(ha||wa(l),e.removed=[],typeof m=="string"&&(ht=!1),ht){const le=m.nodeName;if(typeof le=="string"){const de=B(le);if(!W[de]||lt[de])throw wt("root node is forbidden and cannot be sanitized in-place")}}else if(m instanceof o)u=js("<!---->"),f=u.ownerDocument.importNode(m,!0),f.nodeType===et.element&&f.nodeName==="BODY"||f.nodeName==="HTML"?u=f:u.appendChild(f);else{if(!Be&&!Ee&&!ve&&m.indexOf("<")===-1)return T&&vt?T.createHTML(m):m;if(u=js(m),!u)return Be?null:vt?E:""}u&&ua&&ue(u.firstChild);const z=Ns(ht?m:u);for(;j=z.nextNode();)Ps(j),Fs(j),j.content instanceof i&&zs(j.content);if(ht)return m;if(Be){if(Ee){u.normalize();let le=u.innerHTML;Ge([St,xt,kt],de=>{le=Re(le,de," ")}),u.innerHTML=le}if(Et)for(Z=ne.call(u.ownerDocument);u.firstChild;)Z.appendChild(u.firstChild);else Z=u;return(G.shadowroot||G.shadowrootmode)&&(Z=be.call(s,Z,!0)),Z}let ie=ve?u.outerHTML:u.innerHTML;return ve&&W["!doctype"]&&u.ownerDocument&&u.ownerDocument.doctype&&u.ownerDocument.doctype.name&&J(es,u.ownerDocument.doctype.name)&&(ie="<!DOCTYPE "+u.ownerDocument.doctype.name+`>
|
|
57
|
-
`+ie),Ee&&Ge([St,xt,kt],le=>{ie=Re(ie,le," ")}),T&&vt?T.createHTML(ie):ie},e.setConfig=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wa(m),ha=!0},e.clearConfig=function(){Qe=null,ha=!1},e.isValidAttribute=function(m,l,u){Qe||wa({});const f=B(m),j=B(l);return Os(f,j,u)},e.addHook=function(m,l){typeof l=="function"&&Ze(q[m],l)},e.removeHook=function(m,l){if(l!==void 0){const u=Ai(q[m],l);return u===-1?void 0:Ei(q[m],u,1)[0]}return Ua(q[m])},e.removeHooks=function(m){q[m]=[]},e.removeAllHooks=function(){q=as()},e}var is=ss();class Yi{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 is.sanitize(D.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 is.sanitize(D.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 Jt{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 H{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 Ji{$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=N.mustache;parsedData=new Yi(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,Jt.deleteCookie(this.sessionId),Jt.deleteCookie("ms_visitorid")):this.sessionIdValue=Jt.getOrSetCookie(this.sessionId,e)}setIsInfiniteScroll(e){this.isInfiniteScroll=e}setSearchTerm(e){this.$searchTermChange.setValue(H.removeXSSRiskyTags(e))}setSearchLocation(e){this.$searchLocationChange.setValue(H.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(H.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 tt{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 ns{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 Gi(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=H.removeXSSRiskyTags(e[s].split(":")?.[0]),i=H.removeXSSRiskyTags(decodeURIComponent(e[s].split(":")?.[1])),r=H.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=H.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[page]"])),i=parseInt(a),r=isNaN(i)?1:i;let o=parseInt(H.removeXSSRiskyTags(s[this.routeName+"[itemsPerPage]"]));return isNaN(o)&&(o=10),{query:H.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[query]"]))||"",page:r,itemsPerPage:t??o,order:H.removeXSSRiskyTags(s[this.routeName+"[order]"])||"",facets:this.extractArrayOfFacetsFromQueryParameters(s)||[],model:H.removeXSSRiskyTags(s[this.routeName+"[model]"])||"",location:{address:H.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][address]"]||"")),radius:H.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][radius]"]||"")),lat:H.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lat]"]||"")),lon:H.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lon]"]||""))}}}}class Gi{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 Ne={question:"I_AM_A_QUESTION",notQuestion:"I_AM_NOT_A_QUESTION",close:"CLOSE"};class rs 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 os=10,Zi=13,ke=32;function Gt(n){}function Ki(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=Gt,onError:t=Gt,onRetry:s=Gt,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>"+ge(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},xe=new Ti;function D(n,e){return xe.parse(n,e)}D.options=D.setOptions=function(n){return xe.setOptions(n),D.defaults=xe.defaults,ka(D.defaults),D},D.getDefaults=Rt,D.defaults=Se,D.use=function(...n){return xe.use(...n),D.defaults=xe.defaults,ka(D.defaults),D},D.walkTokens=function(n,e){return xe.walkTokens(n,e)},D.parseInline=xe.parseInline,D.Parser=Le,D.parser=Le.parse,D.Renderer=Lt,D.TextRenderer=Vt,D.Lexer=me,D.lexer=me.lex,D.Tokenizer=mt,D.Hooks=yt,D.parse=D,D.options,D.setOptions,D.use,D.walkTokens,D.parseInline,Le.parse,me.lex;const{entries:Ba,setPrototypeOf:Ha,isFrozen:Si,getPrototypeOf:xi,getOwnPropertyDescriptor:ki}=Object;let{freeze:X,seal:re,create:Ie}=Object,{apply:Bt,construct:Ht}=typeof Reflect<"u"&&Reflect;X||(X=function(e){return e}),re||(re=function(e){return e}),Bt||(Bt=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)}),Ht||(Ht=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 Ge=_(Array.prototype.forEach),Ai=_(Array.prototype.lastIndexOf),Ua=_(Array.prototype.pop),Ze=_(Array.prototype.push),Ei=_(Array.prototype.splice),ee=Array.isArray,Ke=_(String.prototype.toLowerCase),Ut=_(String.prototype.toString),Qa=_(String.prototype.match),Re=_(String.prototype.replace),qa=_(String.prototype.indexOf),vi=_(String.prototype.trim),Di=_(Number.prototype.toString),Ii=_(Boolean.prototype.toString),Wa=typeof BigInt>"u"?null:_(BigInt.prototype.toString),Ya=typeof Symbol>"u"?null:_(Symbol.prototype.toString),P=_(Object.prototype.hasOwnProperty),Xe=_(Object.prototype.toString),J=_(RegExp.prototype.test),wt=Ri(TypeError);function _(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 Bt(n,e,s)}}function Ri(n){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return Ht(n,t)}}function b(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ke;if(Ha&&Ha(n,null),!ee(e))return n;let s=e.length;for(;s--;){let a=e[s];if(typeof a=="string"){const i=t(a);i!==a&&(Si(e)||(e[s]=i),a=i)}n[a]=!0}return n}function ji(n){for(let e=0;e<n.length;e++)P(n,e)||(n[e]=null);return n}function ae(n){const e=Ie(null);for(const[t,s]of Ba(n))P(n,t)&&(ee(s)?e[t]=ji(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=ae(s):e[t]=s);return e}function Ni(n){switch(typeof n){case"string":return n;case"number":return Di(n);case"boolean":return Ii(n);case"bigint":return Wa?Wa(n):"0";case"symbol":return Ya?Ya(n):"Symbol()";case"undefined":return Xe(n);case"function":case"object":{if(n===null)return Xe(n);const e=n,t=je(e,"toString");if(typeof t=="function"){const s=t(e);return typeof s=="string"?s:Xe(s)}return Xe(n)}default:return Xe(n)}}function je(n,e){for(;n!==null;){const s=ki(n,e);if(s){if(s.get)return _(s.get);if(typeof s.value=="function")return _(s.value)}n=xi(n)}function t(){return null}return t}function Pi(n){try{return J(n,""),!0}catch{return!1}}const Ja=X(["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"]),Qt=X(["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"]),qt=X(["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"]),Oi=X(["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"]),Wt=X(["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"]),_i=X(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ga=X(["#text"]),Za=X(["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"]),Yt=X(["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"]),Ka=X(["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"]),Ct=X(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Fi=re(/\{\{[\w\W]*|[\w\W]*\}\}/gm),zi=re(/<%[\w\W]*|[\w\W]*%>/gm),$i=re(/\$\{[\w\W]*/gm),Vi=re(/^data-[\-\w.\u00B7-\uFFFF]+$/),Bi=re(/^aria-[\-\w]+$/),Xa=re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hi=re(/^(?:\w+script|data):/i),Ui=re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),es=re(/^html$/i),Qi=re(/^[a-z][.\w]*(-[.\w]+)+$/i);var ts=Object.freeze({__proto__:null,ARIA_ATTR:Bi,ATTR_WHITESPACE:Ui,CUSTOM_ELEMENT:Qi,DATA_ATTR:Vi,DOCTYPE_NAME:es,ERB_EXPR:zi,IS_ALLOWED_URI:Xa,IS_SCRIPT_OR_DATA:Hi,MUSTACHE_EXPR:Fi,TMPLIT_EXPR:$i});const et={element:1,text:3,progressingInstruction:7,comment:8,document:9},qi=function(){return typeof window>"u"?null:window},Wi=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}},as=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ss(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qi();const e=m=>ss(m);if(e.version="3.4.2",e.removed=[],!n||!n.document||n.document.nodeType!==et.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=je(S,"cloneNode"),Q=je(S,"remove"),p=je(S,"nextSibling"),g=je(S,"childNodes"),w=je(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:F,createNodeIterator:he,createDocumentFragment:ne,getElementsByTagName:la}=t,{importNode:be}=s;let q=as();e.isSupported=typeof Ba=="function"&&typeof w=="function"&&F&&F.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:St,ERB_EXPR:xt,TMPLIT_EXPR:kt,DATA_ATTR:$n,ARIA_ATTR:Vn,IS_SCRIPT_OR_DATA:Bn,ATTR_WHITESPACE:Ls,CUSTOM_ELEMENT:Hn}=ts;let{IS_ALLOWED_URI:ys}=ts,W=null;const ws=b({},[...Ja,...Qt,...qt,...Wt,...Ga]);let G=null;const Cs=b({},[...Za,...Yt,...Ka,...Ct]);let O=Object.seal(Ie(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}})),lt=null,At=null;const Te=Object.seal(Ie(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ms=!0,ca=!0,bs=!1,Ts=!0,Ee=!1,ct=!0,ve=!1,ha=!1,ua=!1,Be=!1,Et=!1,vt=!1,Ss=!0,xs=!1;const ks="user-content-";let da=!0,ht=!1,He={},pe=null;const ga=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 As=null;const Es=b({},["audio","video","img","source","image","track"]);let pa=null;const vs=b({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Dt="http://www.w3.org/1998/Math/MathML",It="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let Ue=fe,fa=!1,ma=null;const Un=b({},[Dt,It,fe],Ut);let La=b({},["mi","mo","mn","ms","mtext"]),ya=b({},["annotation-xml"]);const Qn=b({},["title","style","font","a","script"]);let ut=null;const qn=["application/xhtml+xml","text/html"],Wn="text/html";let B=null,Qe=null;const Yn=t.createElement("form"),Ds=function(l){return l instanceof RegExp||l instanceof Function},wa=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Qe&&Qe===l)return;(!l||typeof l!="object")&&(l={}),l=ae(l),ut=qn.indexOf(l.PARSER_MEDIA_TYPE)===-1?Wn:l.PARSER_MEDIA_TYPE,B=ut==="application/xhtml+xml"?Ut:Ke,W=P(l,"ALLOWED_TAGS")&&ee(l.ALLOWED_TAGS)?b({},l.ALLOWED_TAGS,B):ws,G=P(l,"ALLOWED_ATTR")&&ee(l.ALLOWED_ATTR)?b({},l.ALLOWED_ATTR,B):Cs,ma=P(l,"ALLOWED_NAMESPACES")&&ee(l.ALLOWED_NAMESPACES)?b({},l.ALLOWED_NAMESPACES,Ut):Un,pa=P(l,"ADD_URI_SAFE_ATTR")&&ee(l.ADD_URI_SAFE_ATTR)?b(ae(vs),l.ADD_URI_SAFE_ATTR,B):vs,As=P(l,"ADD_DATA_URI_TAGS")&&ee(l.ADD_DATA_URI_TAGS)?b(ae(Es),l.ADD_DATA_URI_TAGS,B):Es,pe=P(l,"FORBID_CONTENTS")&&ee(l.FORBID_CONTENTS)?b({},l.FORBID_CONTENTS,B):ga,lt=P(l,"FORBID_TAGS")&&ee(l.FORBID_TAGS)?b({},l.FORBID_TAGS,B):ae({}),At=P(l,"FORBID_ATTR")&&ee(l.FORBID_ATTR)?b({},l.FORBID_ATTR,B):ae({}),He=P(l,"USE_PROFILES")?l.USE_PROFILES&&typeof l.USE_PROFILES=="object"?ae(l.USE_PROFILES):l.USE_PROFILES:!1,Ms=l.ALLOW_ARIA_ATTR!==!1,ca=l.ALLOW_DATA_ATTR!==!1,bs=l.ALLOW_UNKNOWN_PROTOCOLS||!1,Ts=l.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ee=l.SAFE_FOR_TEMPLATES||!1,ct=l.SAFE_FOR_XML!==!1,ve=l.WHOLE_DOCUMENT||!1,Be=l.RETURN_DOM||!1,Et=l.RETURN_DOM_FRAGMENT||!1,vt=l.RETURN_TRUSTED_TYPE||!1,ua=l.FORCE_BODY||!1,Ss=l.SANITIZE_DOM!==!1,xs=l.SANITIZE_NAMED_PROPS||!1,da=l.KEEP_CONTENT!==!1,ht=l.IN_PLACE||!1,ys=Pi(l.ALLOWED_URI_REGEXP)?l.ALLOWED_URI_REGEXP:Xa,Ue=typeof l.NAMESPACE=="string"?l.NAMESPACE:fe,La=P(l,"MATHML_TEXT_INTEGRATION_POINTS")&&l.MATHML_TEXT_INTEGRATION_POINTS&&typeof l.MATHML_TEXT_INTEGRATION_POINTS=="object"?ae(l.MATHML_TEXT_INTEGRATION_POINTS):b({},["mi","mo","mn","ms","mtext"]),ya=P(l,"HTML_INTEGRATION_POINTS")&&l.HTML_INTEGRATION_POINTS&&typeof l.HTML_INTEGRATION_POINTS=="object"?ae(l.HTML_INTEGRATION_POINTS):b({},["annotation-xml"]);const u=P(l,"CUSTOM_ELEMENT_HANDLING")&&l.CUSTOM_ELEMENT_HANDLING&&typeof l.CUSTOM_ELEMENT_HANDLING=="object"?ae(l.CUSTOM_ELEMENT_HANDLING):Ie(null);if(O=Ie(null),P(u,"tagNameCheck")&&Ds(u.tagNameCheck)&&(O.tagNameCheck=u.tagNameCheck),P(u,"attributeNameCheck")&&Ds(u.attributeNameCheck)&&(O.attributeNameCheck=u.attributeNameCheck),P(u,"allowCustomizedBuiltInElements")&&typeof u.allowCustomizedBuiltInElements=="boolean"&&(O.allowCustomizedBuiltInElements=u.allowCustomizedBuiltInElements),Ee&&(ca=!1),Et&&(Be=!0),He&&(W=b({},Ga),G=Ie(null),He.html===!0&&(b(W,Ja),b(G,Za)),He.svg===!0&&(b(W,Qt),b(G,Yt),b(G,Ct)),He.svgFilters===!0&&(b(W,qt),b(G,Yt),b(G,Ct)),He.mathMl===!0&&(b(W,Wt),b(G,Ka),b(G,Ct))),Te.tagCheck=null,Te.attributeCheck=null,P(l,"ADD_TAGS")&&(typeof l.ADD_TAGS=="function"?Te.tagCheck=l.ADD_TAGS:ee(l.ADD_TAGS)&&(W===ws&&(W=ae(W)),b(W,l.ADD_TAGS,B))),P(l,"ADD_ATTR")&&(typeof l.ADD_ATTR=="function"?Te.attributeCheck=l.ADD_ATTR:ee(l.ADD_ATTR)&&(G===Cs&&(G=ae(G)),b(G,l.ADD_ATTR,B))),P(l,"ADD_URI_SAFE_ATTR")&&ee(l.ADD_URI_SAFE_ATTR)&&b(pa,l.ADD_URI_SAFE_ATTR,B),P(l,"FORBID_CONTENTS")&&ee(l.FORBID_CONTENTS)&&(pe===ga&&(pe=ae(pe)),b(pe,l.FORBID_CONTENTS,B)),P(l,"ADD_FORBID_CONTENTS")&&ee(l.ADD_FORBID_CONTENTS)&&(pe===ga&&(pe=ae(pe)),b(pe,l.ADD_FORBID_CONTENTS,B)),da&&(W["#text"]=!0),ve&&b(W,["html","head","body"]),W.table&&(b(W,["tbody"]),delete lt.tbody),l.TRUSTED_TYPES_POLICY){if(typeof l.TRUSTED_TYPES_POLICY.createHTML!="function")throw wt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof l.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw wt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=l.TRUSTED_TYPES_POLICY,E=T.createHTML("")}else T===void 0&&(T=Wi(I,a)),T!==null&&typeof E=="string"&&(E=T.createHTML(""));X&&X(l),Qe=l},Is=b({},[...Qt,...qt,...Oi]),Rs=b({},[...Wt,..._i]),Jn=function(l){let u=w(l);(!u||!u.tagName)&&(u={namespaceURI:Ue,tagName:"template"});const f=Ke(l.tagName),R=Ke(u.tagName);return ma[l.namespaceURI]?l.namespaceURI===It?u.namespaceURI===fe?f==="svg":u.namespaceURI===Dt?f==="svg"&&(R==="annotation-xml"||La[R]):!!Is[f]:l.namespaceURI===Dt?u.namespaceURI===fe?f==="math":u.namespaceURI===It?f==="math"&&ya[R]:!!Rs[f]:l.namespaceURI===fe?u.namespaceURI===It&&!ya[R]||u.namespaceURI===Dt&&!La[R]?!1:!Rs[f]&&(Qn[f]||!Is[f]):!!(ut==="application/xhtml+xml"&&ma[l.namespaceURI]):!1},ue=function(l){Ze(e.removed,{element:l});try{w(l).removeChild(l)}catch{Q(l)}},De=function(l,u){try{Ze(e.removed,{attribute:u.getAttributeNode(l),from:u})}catch{Ze(e.removed,{attribute:null,from:u})}if(u.removeAttribute(l),l==="is")if(Be||Et)try{ue(u)}catch{}else try{u.setAttribute(l,"")}catch{}},js=function(l){let u=null,f=null;if(ua)l="<remove></remove>"+l;else{const z=Qa(l,/^[\r\n\t ]+/);f=z&&z[0]}ut==="application/xhtml+xml"&&Ue===fe&&(l='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+l+"</body></html>");const R=T?T.createHTML(l):l;if(Ue===fe)try{u=new y().parseFromString(R,ut)}catch{}if(!u||!u.documentElement){u=F.createDocument(Ue,"template",null);try{u.documentElement.innerHTML=fa?E:R}catch{}}const Z=u.body||u.documentElement;return l&&f&&Z.insertBefore(t.createTextNode(f),Z.childNodes[0]||null),Ue===fe?la.call(u,ve?"html":"body")[0]:ve?u.documentElement:Z},Ns=function(l){return he.call(l.ownerDocument||l,l,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Ca=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")},Ma=function(l){return typeof o=="function"&&l instanceof o};function Ce(m,l,u){Ge(m,f=>{f.call(e,l,u,Qe)})}const Ps=function(l){let u=null;if(Ce(q.beforeSanitizeElements,l,null),Ca(l))return ue(l),!0;const f=B(l.nodeName);if(Ce(q.uponSanitizeElement,l,{tagName:f,allowedTags:W}),ct&&l.hasChildNodes()&&!Ma(l.firstElementChild)&&J(/<[/\w!]/g,l.innerHTML)&&J(/<[/\w!]/g,l.textContent)||ct&&l.namespaceURI===fe&&f==="style"&&Ma(l.firstElementChild)||l.nodeType===et.progressingInstruction||ct&&l.nodeType===et.comment&&J(/<[/\w]/g,l.data))return ue(l),!0;if(lt[f]||!(Te.tagCheck instanceof Function&&Te.tagCheck(f))&&!W[f]){if(!lt[f]&&_s(f)&&(O.tagNameCheck instanceof RegExp&&J(O.tagNameCheck,f)||O.tagNameCheck instanceof Function&&O.tagNameCheck(f)))return!1;if(da&&!pe[f]){const R=w(l)||l.parentNode,Z=g(l)||l.childNodes;if(Z&&R){const z=Z.length;for(let ie=z-1;ie>=0;--ie){const le=x(Z[ie],!0);R.insertBefore(le,p(l))}}}return ue(l),!0}return l instanceof c&&!Jn(l)||(f==="noscript"||f==="noembed"||f==="noframes")&&J(/<\/no(script|embed|frames)/i,l.innerHTML)?(ue(l),!0):(Ee&&l.nodeType===et.text&&(u=l.textContent,Ge([St,xt,kt],R=>{u=Re(u,R," ")}),l.textContent!==u&&(Ze(e.removed,{element:l.cloneNode()}),l.textContent=u)),Ce(q.afterSanitizeElements,l,null),!1)},Os=function(l,u,f){if(At[u]||Ss&&(u==="id"||u==="name")&&(f in t||f in Yn))return!1;const R=G[u]||Te.attributeCheck instanceof Function&&Te.attributeCheck(u,l);if(!(ca&&!At[u]&&J($n,u))){if(!(Ms&&J(Vn,u))){if(!R||At[u]){if(!(_s(l)&&(O.tagNameCheck instanceof RegExp&&J(O.tagNameCheck,l)||O.tagNameCheck instanceof Function&&O.tagNameCheck(l))&&(O.attributeNameCheck instanceof RegExp&&J(O.attributeNameCheck,u)||O.attributeNameCheck instanceof Function&&O.attributeNameCheck(u,l))||u==="is"&&O.allowCustomizedBuiltInElements&&(O.tagNameCheck instanceof RegExp&&J(O.tagNameCheck,f)||O.tagNameCheck instanceof Function&&O.tagNameCheck(f))))return!1}else if(!pa[u]){if(!J(ys,Re(f,Ls,""))){if(!((u==="src"||u==="xlink:href"||u==="href")&&l!=="script"&&qa(f,"data:")===0&&As[l])){if(!(bs&&!J(Bn,Re(f,Ls,"")))){if(f)return!1}}}}}}return!0},Gn=b({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),_s=function(l){return!Gn[Ke(l)]&&J(Hn,l)},Fs=function(l){Ce(q.beforeSanitizeAttributes,l,null);const{attributes:u}=l;if(!u||Ca(l))return;const f={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:G,forceKeepAttr:void 0};let R=u.length;for(;R--;){const Z=u[R],{name:z,namespaceURI:ie,value:le}=Z,de=B(z),ba=le;let Y=z==="value"?ba:vi(ba);if(f.attrName=de,f.attrValue=Y,f.keepAttr=!0,f.forceKeepAttr=void 0,Ce(q.uponSanitizeAttribute,l,f),Y=f.attrValue,xs&&(de==="id"||de==="name")&&qa(Y,ks)!==0&&(De(z,l),Y=ks+Y),ct&&J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Y)){De(z,l);continue}if(de==="attributename"&&Qa(Y,"href")){De(z,l);continue}if(f.forceKeepAttr)continue;if(!f.keepAttr){De(z,l);continue}if(!Ts&&J(/\/>/i,Y)){De(z,l);continue}Ee&&Ge([St,xt,kt],Vs=>{Y=Re(Y,Vs," ")});const $s=B(l.nodeName);if(!Os($s,de,Y)){De(z,l);continue}if(T&&typeof I=="object"&&typeof I.getAttributeType=="function"&&!ie)switch(I.getAttributeType($s,de)){case"TrustedHTML":{Y=T.createHTML(Y);break}case"TrustedScriptURL":{Y=T.createScriptURL(Y);break}}if(Y!==ba)try{ie?l.setAttributeNS(ie,z,Y):l.setAttribute(z,Y),Ca(l)?ue(l):Ua(e.removed)}catch{De(z,l)}}Ce(q.afterSanitizeAttributes,l,null)},zs=function(l){let u=null;const f=Ns(l);for(Ce(q.beforeSanitizeShadowDOM,l,null);u=f.nextNode();)Ce(q.uponSanitizeShadowNode,u,null),Ps(u),Fs(u),u.content instanceof i&&zs(u.content);Ce(q.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(fa=!m,fa&&(m="<!-->"),typeof m!="string"&&!Ma(m)&&(m=Ni(m),typeof m!="string"))throw wt("dirty is not a string, aborting");if(!e.isSupported)return m;if(ha||wa(l),e.removed=[],typeof m=="string"&&(ht=!1),ht){const le=m.nodeName;if(typeof le=="string"){const de=B(le);if(!W[de]||lt[de])throw wt("root node is forbidden and cannot be sanitized in-place")}}else if(m instanceof o)u=js("<!---->"),f=u.ownerDocument.importNode(m,!0),f.nodeType===et.element&&f.nodeName==="BODY"||f.nodeName==="HTML"?u=f:u.appendChild(f);else{if(!Be&&!Ee&&!ve&&m.indexOf("<")===-1)return T&&vt?T.createHTML(m):m;if(u=js(m),!u)return Be?null:vt?E:""}u&&ua&&ue(u.firstChild);const z=Ns(ht?m:u);for(;R=z.nextNode();)Ps(R),Fs(R),R.content instanceof i&&zs(R.content);if(ht)return m;if(Be){if(Ee){u.normalize();let le=u.innerHTML;Ge([St,xt,kt],de=>{le=Re(le,de," ")}),u.innerHTML=le}if(Et)for(Z=ne.call(u.ownerDocument);u.firstChild;)Z.appendChild(u.firstChild);else Z=u;return(G.shadowroot||G.shadowrootmode)&&(Z=be.call(s,Z,!0)),Z}let ie=ve?u.outerHTML:u.innerHTML;return ve&&W["!doctype"]&&u.ownerDocument&&u.ownerDocument.doctype&&u.ownerDocument.doctype.name&&J(es,u.ownerDocument.doctype.name)&&(ie="<!DOCTYPE "+u.ownerDocument.doctype.name+`>
|
|
57
|
+
`+ie),Ee&&Ge([St,xt,kt],le=>{ie=Re(ie,le," ")}),T&&vt?T.createHTML(ie):ie},e.setConfig=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wa(m),ha=!0},e.clearConfig=function(){Qe=null,ha=!1},e.isValidAttribute=function(m,l,u){Qe||wa({});const f=B(m),R=B(l);return Os(f,R,u)},e.addHook=function(m,l){typeof l=="function"&&Ze(q[m],l)},e.removeHook=function(m,l){if(l!==void 0){const u=Ai(q[m],l);return u===-1?void 0:Ei(q[m],u,1)[0]}return Ua(q[m])},e.removeHooks=function(m){q[m]=[]},e.removeAllHooks=function(){q=as()},e}var is=ss();class Yi{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 is.sanitize(D.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 is.sanitize(D.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 Jt{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 H{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 Ji{$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=N.mustache;parsedData=new Yi(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,Jt.deleteCookie(this.sessionId),Jt.deleteCookie("ms_visitorid")):this.sessionIdValue=Jt.getOrSetCookie(this.sessionId,e)}setIsInfiniteScroll(e){this.isInfiniteScroll=e}setSearchTerm(e){this.$searchTermChange.setValue(H.removeXSSRiskyTags(e))}setSearchLocation(e){this.$searchLocationChange.setValue(H.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(H.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 tt{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 ns{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 Gi(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=H.removeXSSRiskyTags(e[s].split(":")?.[0]),i=H.removeXSSRiskyTags(decodeURIComponent(e[s].split(":")?.[1])),r=H.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=H.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[page]"])),i=parseInt(a),r=isNaN(i)?1:i;let o=parseInt(H.removeXSSRiskyTags(s[this.routeName+"[itemsPerPage]"]));return isNaN(o)&&(o=10),{query:H.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[query]"]))||"",page:r,itemsPerPage:t??o,order:H.removeXSSRiskyTags(s[this.routeName+"[order]"])||"",facets:this.extractArrayOfFacetsFromQueryParameters(s)||[],model:H.removeXSSRiskyTags(s[this.routeName+"[model]"])||"",location:{address:H.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][address]"]||"")),radius:H.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][radius]"]||"")),lat:H.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lat]"]||"")),lon:H.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lon]"]||""))}}}}class Gi{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 Ne={question:"I_AM_A_QUESTION",notQuestion:"I_AM_NOT_A_QUESTION",close:"CLOSE"};class rs 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 os=10,Zi=13,ke=32;function Gt(n){}function Ki(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=Gt,onError:t=Gt,onRetry:s=Gt,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)===ke?g+6:g+5,F=p.slice(E,w);if(h===0&&p.charCodeAt(w+1)===os){e({id:o,event:d,data:F}),o=void 0,c="",d=void 0,g=w+2,w=p.indexOf(`
|
|
@@ -63,7 +63,7 @@ ${F}`,h++}else cs(p,g,T)?d=p.slice(p.charCodeAt(g+6)===ke?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)===Zi&&p.charCodeAt(g)===os&&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 be=p.charCodeAt(g+5)===ke?g+6:g+5,q=p.slice(be,w);c=h===0?q:`${c}
|
|
65
65
|
${q}`,h++;return}if(cs(p,g,T)){d=p.slice(p.charCodeAt(g+6)===ke?g+7:g+6,w)||void 0;return}if(T===105&&p.charCodeAt(g+1)===100&&p.charCodeAt(g+2)===58){const be=p.slice(p.charCodeAt(g+3)===ke?g+4:g+3,w);o=be.includes("\0")?void 0:be;return}if(T===58){if(a){const be=p.slice(g,w);a(be.slice(p.charCodeAt(g+1)===ke?2:1))}return}const E=p.slice(g,w),F=E.indexOf(":");if(F===-1){S(E,"",E);return}const he=E.slice(0,F),ne=E.charCodeAt(F+1)===ke?2:1,la=E.slice(F+ne);S(he,la,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 rs(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:w}));break;default:t(new rs(`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 Q(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:Q}}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 cs(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 hs 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(us(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e(us(this),t)}}function Xi(n){const e=globalThis.DOMException;return typeof e=="function"?new e(n,"SyntaxError"):new SyntaxError(n)}function Zt(n){return n instanceof Error?"errors"in n&&Array.isArray(n.errors)?n.errors.map(Zt).join(", "):"cause"in n&&n.cause instanceof Error?`${n}: ${Zt(n.cause)}`:n.message:`${n}`}function us(n){return{type:n.type,message:n.message,code:n.code,defaultPrevented:n.defaultPrevented,cancelable:n.cancelable,timeStamp:n.timeStamp}}var ds=n=>{throw TypeError(n)},Kt=(n,e,t)=>e.has(n)||ds("Cannot "+t),k=(n,e,t)=>(Kt(n,e,"read from private field"),t?t.call(n):e.get(n)),$=(n,e,t)=>e.has(n)?ds("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),R=(n,e,t,s)=>(Kt(n,e,"write to private field"),e.set(n,t),t),ye=(n,e,t)=>(Kt(n,e,"access private method"),t),se,Ae,Pe,Mt,bt,at,Oe,st,Me,_e,Fe,ze,it,ce,Xt,ea,ta,gs,aa,sa,nt,ia,na;class Tt extends EventTarget{constructor(e,t){var s,a;super(),$(this,ce),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,$(this,se),$(this,Ae),$(this,Pe),$(this,Mt),$(this,bt),$(this,at),$(this,Oe),$(this,st,null),$(this,Me),$(this,_e),$(this,Fe,null),$(this,ze,null),$(this,it,null),$(this,ea,async i=>{var r;k(this,_e).reset();const{body:o,redirected:c,status:h,headers:d}=i;if(h===204){ye(this,ce,nt).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(c?R(this,Pe,new URL(i.url)):R(this,Pe,void 0),h!==200){ye(this,ce,nt).call(this,`Non-200 status code (${h})`,h);return}if(!(d.get("content-type")||"").startsWith("text/event-stream")){ye(this,ce,nt).call(this,'Invalid content type, expected "text/event-stream"',h);return}if(k(this,se)===this.CLOSED)return;R(this,se,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)){ye(this,ce,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:Q}=await I.read();Q&&k(this,_e).feed(y.decode(Q,{stream:!x})),x&&(S=!1,k(this,_e).reset(),ye(this,ce,ia).call(this))}while(S)}),$(this,ta,i=>{R(this,Me,void 0),!(i.name==="AbortError"||i.type==="aborted")&&ye(this,ce,ia).call(this,Zt(i))}),$(this,aa,i=>{typeof i.id=="string"&&R(this,st,i.id);const r=new MessageEvent(i.event||"message",{data:i.data,origin:k(this,Pe)?k(this,Pe).origin:k(this,Ae).origin,lastEventId:i.id||""});k(this,ze)&&(!i.event||i.event==="message")&&k(this,ze).call(this,r),this.dispatchEvent(r)}),$(this,sa,i=>{R(this,at,i)}),$(this,na,()=>{R(this,Oe,void 0),k(this,se)===this.CONNECTING&&ye(this,ce,Xt).call(this)});try{if(e instanceof URL)R(this,Ae,e);else if(typeof e=="string")R(this,Ae,new URL(e,en()));else throw new Error("Invalid URL")}catch{throw Xi("An invalid or illegal string was specified")}R(this,_e,Ki({onEvent:k(this,aa),onRetry:k(this,sa)})),R(this,se,this.CONNECTING),R(this,at,3e3),R(this,bt,(s=t?.fetch)!=null?s:globalThis.fetch),R(this,Mt,(a=t?.withCredentials)!=null?a:!1),ye(this,ce,Xt).call(this)}get readyState(){return k(this,se)}get url(){return k(this,Ae).href}get withCredentials(){return k(this,Mt)}get onerror(){return k(this,Fe)}set onerror(e){R(this,Fe,e)}get onmessage(){return k(this,ze)}set onmessage(e){R(this,ze,e)}get onopen(){return k(this,it)}set onopen(e){R(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,Oe)&&clearTimeout(k(this,Oe)),k(this,se)!==this.CLOSED&&(k(this,Me)&&k(this,Me).abort(),R(this,se,this.CLOSED),R(this,Me,void 0))}}se=new WeakMap,Ae=new WeakMap,Pe=new WeakMap,Mt=new WeakMap,bt=new WeakMap,at=new WeakMap,Oe=new WeakMap,st=new WeakMap,Me=new WeakMap,_e=new WeakMap,Fe=new WeakMap,ze=new WeakMap,it=new WeakMap,ce=new WeakSet,Xt=function(){R(this,se,this.CONNECTING),R(this,Me,new AbortController),k(this,bt)(k(this,Ae),ye(this,ce,gs).call(this)).then(k(this,ea)).catch(k(this,ta))},ea=new WeakMap,ta=new WeakMap,gs=function(){var n;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...k(this,st)?{"Last-Event-ID":k(this,st)}:void 0},cache:"no-store",signal:(n=k(this,Me))==null?void 0:n.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},aa=new WeakMap,sa=new WeakMap,nt=function(n,e){var t;k(this,se)!==this.CLOSED&&R(this,se,this.CLOSED);const s=new hs("error",{code:e,message:n});(t=k(this,Fe))==null||t.call(this,s),this.dispatchEvent(s)},ia=function(n,e){var t;if(k(this,se)===this.CLOSED)return;R(this,se,this.CONNECTING);const s=new hs("error",{code:e,message:n});(t=k(this,Fe))==null||t.call(this,s),this.dispatchEvent(s),R(this,Oe,setTimeout(k(this,na),k(this,at)))},na=new WeakMap,Tt.CONNECTING=0,Tt.OPEN=1,Tt.CLOSED=2;function en(){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 we{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 tn{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=tt.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 Tt(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===Ne.question||i.data===Ne.notQuestion){i.data===Ne.question?(this.dataLayer.setAnswerLoading(!0),this.dataLayer.setIsQuestion(!0)):(a.setAnswerLoading(!1),this.dataLayer.setIsQuestion(!1)),a.setAnswerData("");return}if(i.data===Ne.close){we.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 an=Object.prototype.toString,$e=Array.isArray||function(e){return an.call(e)==="[object Array]"};function ra(n){return typeof n=="function"}function sn(n){return $e(n)?"array":typeof n}function oa(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function ps(n,e){return n!=null&&typeof n=="object"&&e in n}function nn(n,e){return n!=null&&typeof n!="object"&&n.hasOwnProperty&&n.hasOwnProperty(e)}var rn=RegExp.prototype.test;function on(n,e){return rn.call(n,e)}var ln=/\S/;function cn(n){return!on(ln,n)}var hn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function un(n){return String(n).replace(/[&<>"'`=\/]/g,function(t){return hn[t]})}var dn=/\s*/,gn=/\s+/,fs=/\s*=/,pn=/\s*\}/,fn=/#|\^|\/|>|\{|&|=|!/;function mn(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(gn,2)),!$e(ne)||ne.length!==2)throw new Error("Invalid tags: "+ne);C=new RegExp(oa(ne[0])+"\\s*"),y=new RegExp("\\s*"+oa(ne[1])),I=new RegExp("\\s*"+oa("}"+ne[1]))}S(e||A.tags);for(var x=new rt(n),Q,p,g,w,T,E;!x.eos();){if(Q=x.pos,g=x.scanUntil(C),g)for(var F=0,he=g.length;F<he;++F)w=g.charAt(F),cn(w)?(i.push(a.length),c+=w):(o=!0,t=!0,c+=" "),a.push(["text",w,Q,Q+1]),Q+=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 rs(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:w}));break;default:t(new rs(`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 Q(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:Q}}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 cs(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 hs 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(us(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e(us(this),t)}}function Xi(n){const e=globalThis.DOMException;return typeof e=="function"?new e(n,"SyntaxError"):new SyntaxError(n)}function Zt(n){return n instanceof Error?"errors"in n&&Array.isArray(n.errors)?n.errors.map(Zt).join(", "):"cause"in n&&n.cause instanceof Error?`${n}: ${Zt(n.cause)}`:n.message:`${n}`}function us(n){return{type:n.type,message:n.message,code:n.code,defaultPrevented:n.defaultPrevented,cancelable:n.cancelable,timeStamp:n.timeStamp}}var ds=n=>{throw TypeError(n)},Kt=(n,e,t)=>e.has(n)||ds("Cannot "+t),k=(n,e,t)=>(Kt(n,e,"read from private field"),t?t.call(n):e.get(n)),$=(n,e,t)=>e.has(n)?ds("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),j=(n,e,t,s)=>(Kt(n,e,"write to private field"),e.set(n,t),t),ye=(n,e,t)=>(Kt(n,e,"access private method"),t),se,Ae,Pe,Mt,bt,at,Oe,st,Me,_e,Fe,ze,it,ce,Xt,ea,ta,gs,aa,sa,nt,ia,na;class Tt extends EventTarget{constructor(e,t){var s,a;super(),$(this,ce),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,$(this,se),$(this,Ae),$(this,Pe),$(this,Mt),$(this,bt),$(this,at),$(this,Oe),$(this,st,null),$(this,Me),$(this,_e),$(this,Fe,null),$(this,ze,null),$(this,it,null),$(this,ea,async i=>{var r;k(this,_e).reset();const{body:o,redirected:c,status:h,headers:d}=i;if(h===204){ye(this,ce,nt).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(c?j(this,Pe,new URL(i.url)):j(this,Pe,void 0),h!==200){ye(this,ce,nt).call(this,`Non-200 status code (${h})`,h);return}if(!(d.get("content-type")||"").startsWith("text/event-stream")){ye(this,ce,nt).call(this,'Invalid content type, expected "text/event-stream"',h);return}if(k(this,se)===this.CLOSED)return;j(this,se,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)){ye(this,ce,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:Q}=await I.read();Q&&k(this,_e).feed(y.decode(Q,{stream:!x})),x&&(S=!1,k(this,_e).reset(),ye(this,ce,ia).call(this))}while(S)}),$(this,ta,i=>{j(this,Me,void 0),!(i.name==="AbortError"||i.type==="aborted")&&ye(this,ce,ia).call(this,Zt(i))}),$(this,aa,i=>{typeof i.id=="string"&&j(this,st,i.id);const r=new MessageEvent(i.event||"message",{data:i.data,origin:k(this,Pe)?k(this,Pe).origin:k(this,Ae).origin,lastEventId:i.id||""});k(this,ze)&&(!i.event||i.event==="message")&&k(this,ze).call(this,r),this.dispatchEvent(r)}),$(this,sa,i=>{j(this,at,i)}),$(this,na,()=>{j(this,Oe,void 0),k(this,se)===this.CONNECTING&&ye(this,ce,Xt).call(this)});try{if(e instanceof URL)j(this,Ae,e);else if(typeof e=="string")j(this,Ae,new URL(e,en()));else throw new Error("Invalid URL")}catch{throw Xi("An invalid or illegal string was specified")}j(this,_e,Ki({onEvent:k(this,aa),onRetry:k(this,sa)})),j(this,se,this.CONNECTING),j(this,at,3e3),j(this,bt,(s=t?.fetch)!=null?s:globalThis.fetch),j(this,Mt,(a=t?.withCredentials)!=null?a:!1),ye(this,ce,Xt).call(this)}get readyState(){return k(this,se)}get url(){return k(this,Ae).href}get withCredentials(){return k(this,Mt)}get onerror(){return k(this,Fe)}set onerror(e){j(this,Fe,e)}get onmessage(){return k(this,ze)}set onmessage(e){j(this,ze,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,Oe)&&clearTimeout(k(this,Oe)),k(this,se)!==this.CLOSED&&(k(this,Me)&&k(this,Me).abort(),j(this,se,this.CLOSED),j(this,Me,void 0))}}se=new WeakMap,Ae=new WeakMap,Pe=new WeakMap,Mt=new WeakMap,bt=new WeakMap,at=new WeakMap,Oe=new WeakMap,st=new WeakMap,Me=new WeakMap,_e=new WeakMap,Fe=new WeakMap,ze=new WeakMap,it=new WeakMap,ce=new WeakSet,Xt=function(){j(this,se,this.CONNECTING),j(this,Me,new AbortController),k(this,bt)(k(this,Ae),ye(this,ce,gs).call(this)).then(k(this,ea)).catch(k(this,ta))},ea=new WeakMap,ta=new WeakMap,gs=function(){var n;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...k(this,st)?{"Last-Event-ID":k(this,st)}:void 0},cache:"no-store",signal:(n=k(this,Me))==null?void 0:n.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},aa=new WeakMap,sa=new WeakMap,nt=function(n,e){var t;k(this,se)!==this.CLOSED&&j(this,se,this.CLOSED);const s=new hs("error",{code:e,message:n});(t=k(this,Fe))==null||t.call(this,s),this.dispatchEvent(s)},ia=function(n,e){var t;if(k(this,se)===this.CLOSED)return;j(this,se,this.CONNECTING);const s=new hs("error",{code:e,message:n});(t=k(this,Fe))==null||t.call(this,s),this.dispatchEvent(s),j(this,Oe,setTimeout(k(this,na),k(this,at)))},na=new WeakMap,Tt.CONNECTING=0,Tt.OPEN=1,Tt.CLOSED=2;function en(){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 we{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 tn{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=tt.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 Tt(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===Ne.question||i.data===Ne.notQuestion){i.data===Ne.question?(this.dataLayer.setAnswerLoading(!0),this.dataLayer.setIsQuestion(!0)):(a.setAnswerLoading(!1),this.dataLayer.setIsQuestion(!1)),a.setAnswerData("");return}if(i.data===Ne.close){we.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 an=Object.prototype.toString,$e=Array.isArray||function(e){return an.call(e)==="[object Array]"};function ra(n){return typeof n=="function"}function sn(n){return $e(n)?"array":typeof n}function oa(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function ps(n,e){return n!=null&&typeof n=="object"&&e in n}function nn(n,e){return n!=null&&typeof n!="object"&&n.hasOwnProperty&&n.hasOwnProperty(e)}var rn=RegExp.prototype.test;function on(n,e){return rn.call(n,e)}var ln=/\S/;function cn(n){return!on(ln,n)}var hn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function un(n){return String(n).replace(/[&<>"'`=\/]/g,function(t){return hn[t]})}var dn=/\s*/,gn=/\s+/,fs=/\s*=/,pn=/\s*\}/,fn=/#|\^|\/|>|\{|&|=|!/;function mn(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(gn,2)),!$e(ne)||ne.length!==2)throw new Error("Invalid tags: "+ne);C=new RegExp(oa(ne[0])+"\\s*"),y=new RegExp("\\s*"+oa(ne[1])),I=new RegExp("\\s*"+oa("}"+ne[1]))}S(e||A.tags);for(var x=new rt(n),Q,p,g,w,T,E;!x.eos();){if(Q=x.pos,g=x.scanUntil(C),g)for(var F=0,he=g.length;F<he;++F)w=g.charAt(F),cn(w)?(i.push(a.length),c+=w):(o=!0,t=!0,c+=" "),a.push(["text",w,Q,Q+1]),Q+=1,w===`
|
|
67
67
|
`&&(d(),c="",h=0,t=!1);if(!x.scan(C))break;if(r=!0,p=x.scan(fn)||"name",x.scan(dn),p==="="?(g=x.scanUntil(fs),x.scan(fs),x.scanUntil(y)):p==="{"?(g=x.scanUntil(I),x.scan(pn),x.scanUntil(y),p="&"):g=x.scanUntil(y),!x.scan(y))throw new Error("Unclosed tag at "+x.pos);if(p==">"?T=[p,g,Q,x.pos,c,h,t]:T=[p,g,Q,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 '+Q);if(E[1]!==g)throw new Error('Unclosed section "'+E[1]+'" at '+Q)}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 yn(Ln(a))}function Ln(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 yn(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 rt(n){this.string=n,this.tail=n,this.pos=0}rt.prototype.eos=function(){return this.tail===""},rt.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},rt.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 Ve(n,e){this.view=n,this.cache={".":this.view},this.parent=e}Ve.prototype.push=function(e){return new Ve(e,this)},Ve.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=ps(i,r[o])||nn(i,r[o])),i=i[r[o++]];else i=a.view[e],c=ps(a.view,e);if(c){s=i;break}a=a.parent}t[e]=s}return ra(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=mn(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 Ve?t:new Ve(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($e(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(ra(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||$e(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=ra(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 $e(e)?e:e&&typeof e=="object"?e.tags:void 0},te.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!$e(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){ot.templateCache=n},get templateCache(){return ot.templateCache}},ot=new te;A.clearCache=function(){return ot.clearCache()},A.parse=function(e,t){return ot.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 "'+sn(e)+'" was given as the first argument for mustache#render(template, view, partials)');return ot.render(e,t,s,a)},A.escape=un,A.Scanner=rt,A.Context=Ve,A.Writer=te;const wn={main:{template:`
|