@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 @@ ${i}</tr>
|
|
|
53
53
|
`}tablecell(i){const e=this.parser.parseInline(i.tokens),t=i.header?"th":"td";return(i.align?`<${t} align="${i.align}">`:`<${t}>`)+e+`</${t}>
|
|
54
54
|
`}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${de(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:e,tokens:t}){const s=this.parser.parseInline(t),a=os(i);if(a===null)return s;i=a;let r='<a href="'+i+'"';return e&&(r+=' title="'+de(e)+'"'),r+=">"+s+"</a>",r}image({href:i,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));const a=os(i);if(a===null)return de(t);i=a;let r=`<img src="${i}" alt="${t}"`;return e&&(r+=` title="${de(e)}"`),r+=">",r}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:de(i.text)}},ta=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}},fe=class Sa{options;renderer;textRenderer;constructor(e){this.options=e||Ae,this.options.renderer=this.options.renderer||new kt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ta}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 r=e[a];if(this.options.extensions?.renderers?.[r.type]){const o=r,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){s+=l||"";continue}}const n=r;switch(n.type){case"space":{s+=this.renderer.space(n);continue}case"hr":{s+=this.renderer.hr(n);continue}case"heading":{s+=this.renderer.heading(n);continue}case"code":{s+=this.renderer.code(n);continue}case"table":{s+=this.renderer.table(n);continue}case"blockquote":{s+=this.renderer.blockquote(n);continue}case"list":{s+=this.renderer.list(n);continue}case"html":{s+=this.renderer.html(n);continue}case"paragraph":{s+=this.renderer.paragraph(n);continue}case"text":{let o=n,l=this.renderer.text(o);for(;a+1<e.length&&e[a+1].type==="text";)o=e[++a],l+=`
|
|
55
55
|
`+this.renderer.text(o);t?s+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):s+=l;continue}default:{const o='Token with "'+n.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 r=e[a];if(this.options.extensions?.renderers?.[r.type]){const o=this.options.extensions.renderers[r.type].call({parser:this},r);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){s+=o||"";continue}}const n=r;switch(n.type){case"escape":{s+=t.text(n);break}case"html":{s+=t.html(n);break}case"link":{s+=t.link(n);break}case"image":{s+=t.image(n);break}case"strong":{s+=t.strong(n);break}case"em":{s+=t.em(n);break}case"codespan":{s+=t.codespan(n);break}case"br":{s+=t.br(n);break}case"del":{s+=t.del(n);break}case"text":{s+=t.text(n);break}default:{const o='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}},Tt=class{options;block;constructor(i){this.options=i||Ae}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}provideLexer(){return this.block?me.lex:me.lexInline}provideParser(){return this.block?fe.parse:fe.parseInline}},ji=class{defaults=Ut();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=fe;Renderer=kt;TextRenderer=ta;Lexer=me;Tokenizer=xt;Hooks=Tt;constructor(...i){this.use(...i)}walkTokens(i,e){let t=[];for(const s of i)switch(t=t.concat(e.call(this,s)),s.type){case"table":{const a=s;for(const r of a.header)t=t.concat(this.walkTokens(r.tokens,e));for(const r of a.rows)for(const n of r)t=t.concat(this.walkTokens(n.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(r=>{const n=a[r].flat(1/0);t=t.concat(this.walkTokens(n,e))}):a.tokens&&(t=t.concat(this.walkTokens(a.tokens,e)))}}return t}use(...i){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return i.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 r=e.renderers[a.name];r?e.renderers[a.name]=function(...n){let o=a.renderer.apply(this,n);return o===!1&&(o=r.apply(this,n)),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 r=e[a.level];r?r.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 kt(this.defaults);for(const r in t.renderer){if(!(r in a))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const n=r,o=t.renderer[n],l=a[n];a[n]=(...h)=>{let m=o.apply(a,h);return m===!1&&(m=l.apply(a,h)),m||""}}s.renderer=a}if(t.tokenizer){const a=this.defaults.tokenizer||new xt(this.defaults);for(const r in t.tokenizer){if(!(r in a))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const n=r,o=t.tokenizer[n],l=a[n];a[n]=(...h)=>{let m=o.apply(a,h);return m===!1&&(m=l.apply(a,h)),m}}s.tokenizer=a}if(t.hooks){const a=this.defaults.hooks||new Tt;for(const r in t.hooks){if(!(r in a))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const n=r,o=t.hooks[n],l=a[n];Tt.passThroughHooks.has(r)?a[n]=h=>{if(this.defaults.async)return Promise.resolve(o.call(a,h)).then(L=>l.call(a,L));const m=o.call(a,h);return l.call(a,m)}:a[n]=(...h)=>{let m=o.apply(a,h);return m===!1&&(m=l.apply(a,h)),m}}s.hooks=a}if(t.walkTokens){const a=this.defaults.walkTokens,r=t.walkTokens;s.walkTokens=function(n){let o=[];return o.push(r.call(this,n)),a&&(o=o.concat(a.call(this,n))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,e){return me.lex(i,e??this.defaults)}parser(i,e){return fe.parse(i,e??this.defaults)}parseMarkdown(i){return(e,t)=>{const s={...t},a={...this.defaults,...s},r=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&s.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 e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));a.hooks&&(a.hooks.options=a,a.hooks.block=i);const n=a.hooks?a.hooks.provideLexer():i?me.lex:me.lexInline,o=a.hooks?a.hooks.provideParser():i?fe.parse:fe.parseInline;if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(e):e).then(l=>n(l,a)).then(l=>a.hooks?a.hooks.processAllTokens(l):l).then(l=>a.walkTokens?Promise.all(this.walkTokens(l,a.walkTokens)).then(()=>l):l).then(l=>o(l,a)).then(l=>a.hooks?a.hooks.postprocess(l):l).catch(r);try{a.hooks&&(e=a.hooks.preprocess(e));let l=n(e,a);a.hooks&&(l=a.hooks.processAllTokens(l)),a.walkTokens&&this.walkTokens(l,a.walkTokens);let h=o(l,a);return a.hooks&&(h=a.hooks.postprocess(h)),h}catch(l){return r(l)}}}onError(i,e){return t=>{if(t.message+=`
|
|
56
|
-
Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An error occurred:</p><pre>"+de(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},ve=new ji;function E(i,e){return ve.parse(i,e)}E.options=E.setOptions=function(i){return ve.setOptions(i),E.defaults=ve.defaults,Ya(E.defaults),E},E.getDefaults=Ut,E.defaults=Ae,E.use=function(...i){return ve.use(...i),E.defaults=ve.defaults,Ya(E.defaults),E},E.walkTokens=function(i,e){return ve.walkTokens(i,e)},E.parseInline=ve.parseInline,E.Parser=fe,E.parser=fe.parse,E.Renderer=kt,E.TextRenderer=ta,E.Lexer=me,E.lexer=me.lex,E.Tokenizer=xt,E.Hooks=Tt,E.parse=E,E.options,E.setOptions,E.use,E.walkTokens,E.parseInline,fe.parse,me.lex;const{entries:hs,setPrototypeOf:us,isFrozen:Ri,getPrototypeOf:Ni,getOwnPropertyDescriptor:Oi}=Object;let{freeze:K,seal:re,create:Oe}=Object,{apply:aa,construct:sa}=typeof Reflect<"u"&&Reflect;K||(K=function(i){return i}),re||(re=function(i){return i}),aa||(aa=function(i,e){for(var t=arguments.length,s=new Array(t>2?t-2:0),a=2;a<t;a++)s[a-2]=arguments[a];return i.apply(e,s)}),sa||(sa=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;s<e;s++)t[s-1]=arguments[s];return new i(...t)});const et=z(Array.prototype.forEach),Pi=z(Array.prototype.lastIndexOf),ds=z(Array.prototype.pop),tt=z(Array.prototype.push),Fi=z(Array.prototype.splice),ee=Array.isArray,at=z(String.prototype.toLowerCase),ia=z(String.prototype.toString),gs=z(String.prototype.match),Pe=z(String.prototype.replace),ps=z(String.prototype.indexOf),zi=z(String.prototype.trim),$i=z(Number.prototype.toString),_i=z(Boolean.prototype.toString),ms=typeof BigInt>"u"?null:z(BigInt.prototype.toString),fs=typeof Symbol>"u"?null:z(Symbol.prototype.toString),O=z(Object.prototype.hasOwnProperty),st=z(Object.prototype.toString),G=z(RegExp.prototype.test),At=Vi(TypeError);function z(i){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 aa(i,e,s)}}function Vi(i){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return sa(i,t)}}function C(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:at;if(us&&us(i,null),!ee(e))return i;let s=e.length;for(;s--;){let a=e[s];if(typeof a=="string"){const r=t(a);r!==a&&(Ri(e)||(e[s]=r),a=r)}i[a]=!0}return i}function Qi(i){for(let e=0;e<i.length;e++)O(i,e)||(i[e]=null);return i}function ae(i){const e=Oe(null);for(const[t,s]of hs(i))O(i,t)&&(ee(s)?e[t]=Qi(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=ae(s):e[t]=s);return e}function Bi(i){switch(typeof i){case"string":return i;case"number":return $i(i);case"boolean":return _i(i);case"bigint":return ms?ms(i):"0";case"symbol":return fs?fs(i):"Symbol()";case"undefined":return st(i);case"function":case"object":{if(i===null)return st(i);const e=i,t=Fe(e,"toString");if(typeof t=="function"){const s=t(e);return typeof s=="string"?s:st(s)}return st(i)}default:return st(i)}}function Fe(i,e){for(;i!==null;){const s=Oi(i,e);if(s){if(s.get)return z(s.get);if(typeof s.value=="function")return z(s.value)}i=Ni(i)}function t(){return null}return t}function Hi(i){try{return G(i,""),!0}catch{return!1}}const Ls=K(["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"]),ra=K(["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"]),na=K(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),qi=K(["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"]),oa=K(["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"]),Ui=K(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ys=K(["#text"]),ws=K(["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"]),ca=K(["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"]),Ms=K(["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"]),vt=K(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Wi=re(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Yi=re(/<%[\w\W]*|[\w\W]*%>/gm),Ji=re(/\$\{[\w\W]*/gm),Gi=re(/^data-[\-\w.\u00B7-\uFFFF]+$/),Zi=re(/^aria-[\-\w]+$/),Cs=re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Xi=re(/^(?:\w+script|data):/i),Ki=re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bs=re(/^html$/i),er=re(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ss=Object.freeze({__proto__:null,ARIA_ATTR:Zi,ATTR_WHITESPACE:Ki,CUSTOM_ELEMENT:er,DATA_ATTR:Gi,DOCTYPE_NAME:bs,ERB_EXPR:Yi,IS_ALLOWED_URI:Cs,IS_SCRIPT_OR_DATA:Xi,MUSTACHE_EXPR:Wi,TMPLIT_EXPR:Ji});const it={element:1,text:3,progressingInstruction:7,comment:8,document:9},tr=function(){return typeof window>"u"?null:window},ar=function(i,e){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let t=null;const s="data-tt-policy-suffix";e&&e.hasAttribute(s)&&(t=e.getAttribute(s));const a="dompurify"+(t?"#"+t:"");try{return i.createPolicy(a,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},xs=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ks(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tr();const e=c=>ks(c);if(e.version="3.4.1",e.removed=[],!i||!i.document||i.document.nodeType!==it.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const s=t,a=s.currentScript,{DocumentFragment:r,HTMLTemplateElement:n,Node:o,Element:l,NodeFilter:h,NamedNodeMap:m=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:L,DOMParser:M,trustedTypes:I}=i,k=l.prototype,S=Fe(k,"cloneNode"),Q=Fe(k,"remove"),g=Fe(k,"nextSibling"),d=Fe(k,"childNodes"),y=Fe(k,"parentNode");if(typeof n=="function"){const c=t.createElement("template");c.content&&c.content.ownerDocument&&(t=c.content.ownerDocument)}let b,A="";const{implementation:F,createNodeIterator:oe,createDocumentFragment:ie,getElementsByTagName:jt}=t,{importNode:we}=s;let B=xs();e.isSupported=typeof hs=="function"&&typeof y=="function"&&F&&F.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:dt,ERB_EXPR:gt,TMPLIT_EXPR:pt,DATA_ATTR:$s,ARIA_ATTR:_s,IS_SCRIPT_OR_DATA:Vs,ATTR_WHITESPACE:xa,CUSTOM_ELEMENT:Qs}=Ss;let{IS_ALLOWED_URI:ka}=Ss,H=null;const Ta=C({},[...Ls,...ra,...na,...oa,...ys]);let Y=null;const Aa=C({},[...ws,...ca,...Ms,...vt]);let P=Object.seal(Oe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ue=null,mt=null;const Me=Object.seal(Oe(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let va=!0,Rt=!0,Ea=!1,Ia=!0,Se=!1,We=!0,xe=!1,Nt=!1,Ot=!1,De=!1,ft=!1,Lt=!1,Da=!0,ja=!1;const Ra="user-content-";let Pt=!0,Ye=!1,je={},le=null;const Ft=C({},["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 Na=null;const Oa=C({},["audio","video","img","source","image","track"]);let zt=null;const Pa=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yt="http://www.w3.org/1998/Math/MathML",wt="http://www.w3.org/2000/svg",he="http://www.w3.org/1999/xhtml";let Re=he,$t=!1,_t=null;const Bs=C({},[yt,wt,he],ia);let Vt=C({},["mi","mo","mn","ms","mtext"]),Qt=C({},["annotation-xml"]);const Hs=C({},["title","style","font","a","script"]);let Je=null;const qs=["application/xhtml+xml","text/html"],Us="text/html";let $=null,Ne=null;const Ws=t.createElement("form"),Fa=function(c){return c instanceof RegExp||c instanceof Function},Bt=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ne&&Ne===c)return;(!c||typeof c!="object")&&(c={}),c=ae(c),Je=qs.indexOf(c.PARSER_MEDIA_TYPE)===-1?Us:c.PARSER_MEDIA_TYPE,$=Je==="application/xhtml+xml"?ia:at,H=O(c,"ALLOWED_TAGS")&&ee(c.ALLOWED_TAGS)?C({},c.ALLOWED_TAGS,$):Ta,Y=O(c,"ALLOWED_ATTR")&&ee(c.ALLOWED_ATTR)?C({},c.ALLOWED_ATTR,$):Aa,_t=O(c,"ALLOWED_NAMESPACES")&&ee(c.ALLOWED_NAMESPACES)?C({},c.ALLOWED_NAMESPACES,ia):Bs,zt=O(c,"ADD_URI_SAFE_ATTR")&&ee(c.ADD_URI_SAFE_ATTR)?C(ae(Pa),c.ADD_URI_SAFE_ATTR,$):Pa,Na=O(c,"ADD_DATA_URI_TAGS")&&ee(c.ADD_DATA_URI_TAGS)?C(ae(Oa),c.ADD_DATA_URI_TAGS,$):Oa,le=O(c,"FORBID_CONTENTS")&&ee(c.FORBID_CONTENTS)?C({},c.FORBID_CONTENTS,$):Ft,Ue=O(c,"FORBID_TAGS")&&ee(c.FORBID_TAGS)?C({},c.FORBID_TAGS,$):ae({}),mt=O(c,"FORBID_ATTR")&&ee(c.FORBID_ATTR)?C({},c.FORBID_ATTR,$):ae({}),je=O(c,"USE_PROFILES")?c.USE_PROFILES&&typeof c.USE_PROFILES=="object"?ae(c.USE_PROFILES):c.USE_PROFILES:!1,va=c.ALLOW_ARIA_ATTR!==!1,Rt=c.ALLOW_DATA_ATTR!==!1,Ea=c.ALLOW_UNKNOWN_PROTOCOLS||!1,Ia=c.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Se=c.SAFE_FOR_TEMPLATES||!1,We=c.SAFE_FOR_XML!==!1,xe=c.WHOLE_DOCUMENT||!1,De=c.RETURN_DOM||!1,ft=c.RETURN_DOM_FRAGMENT||!1,Lt=c.RETURN_TRUSTED_TYPE||!1,Ot=c.FORCE_BODY||!1,Da=c.SANITIZE_DOM!==!1,ja=c.SANITIZE_NAMED_PROPS||!1,Pt=c.KEEP_CONTENT!==!1,Ye=c.IN_PLACE||!1,ka=Hi(c.ALLOWED_URI_REGEXP)?c.ALLOWED_URI_REGEXP:Cs,Re=typeof c.NAMESPACE=="string"?c.NAMESPACE:he,Vt=O(c,"MATHML_TEXT_INTEGRATION_POINTS")&&c.MATHML_TEXT_INTEGRATION_POINTS&&typeof c.MATHML_TEXT_INTEGRATION_POINTS=="object"?ae(c.MATHML_TEXT_INTEGRATION_POINTS):C({},["mi","mo","mn","ms","mtext"]),Qt=O(c,"HTML_INTEGRATION_POINTS")&&c.HTML_INTEGRATION_POINTS&&typeof c.HTML_INTEGRATION_POINTS=="object"?ae(c.HTML_INTEGRATION_POINTS):C({},["annotation-xml"]);const u=O(c,"CUSTOM_ELEMENT_HANDLING")&&c.CUSTOM_ELEMENT_HANDLING&&typeof c.CUSTOM_ELEMENT_HANDLING=="object"?ae(c.CUSTOM_ELEMENT_HANDLING):Oe(null);if(P=Oe(null),O(u,"tagNameCheck")&&Fa(u.tagNameCheck)&&(P.tagNameCheck=u.tagNameCheck),O(u,"attributeNameCheck")&&Fa(u.attributeNameCheck)&&(P.attributeNameCheck=u.attributeNameCheck),O(u,"allowCustomizedBuiltInElements")&&typeof u.allowCustomizedBuiltInElements=="boolean"&&(P.allowCustomizedBuiltInElements=u.allowCustomizedBuiltInElements),Se&&(Rt=!1),ft&&(De=!0),je&&(H=C({},ys),Y=Oe(null),je.html===!0&&(C(H,Ls),C(Y,ws)),je.svg===!0&&(C(H,ra),C(Y,ca),C(Y,vt)),je.svgFilters===!0&&(C(H,na),C(Y,ca),C(Y,vt)),je.mathMl===!0&&(C(H,oa),C(Y,Ms),C(Y,vt))),Me.tagCheck=null,Me.attributeCheck=null,O(c,"ADD_TAGS")&&(typeof c.ADD_TAGS=="function"?Me.tagCheck=c.ADD_TAGS:ee(c.ADD_TAGS)&&(H===Ta&&(H=ae(H)),C(H,c.ADD_TAGS,$))),O(c,"ADD_ATTR")&&(typeof c.ADD_ATTR=="function"?Me.attributeCheck=c.ADD_ATTR:ee(c.ADD_ATTR)&&(Y===Aa&&(Y=ae(Y)),C(Y,c.ADD_ATTR,$))),O(c,"ADD_URI_SAFE_ATTR")&&ee(c.ADD_URI_SAFE_ATTR)&&C(zt,c.ADD_URI_SAFE_ATTR,$),O(c,"FORBID_CONTENTS")&&ee(c.FORBID_CONTENTS)&&(le===Ft&&(le=ae(le)),C(le,c.FORBID_CONTENTS,$)),O(c,"ADD_FORBID_CONTENTS")&&ee(c.ADD_FORBID_CONTENTS)&&(le===Ft&&(le=ae(le)),C(le,c.ADD_FORBID_CONTENTS,$)),Pt&&(H["#text"]=!0),xe&&C(H,["html","head","body"]),H.table&&(C(H,["tbody"]),delete Ue.tbody),c.TRUSTED_TYPES_POLICY){if(typeof c.TRUSTED_TYPES_POLICY.createHTML!="function")throw At('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof c.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw At('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=c.TRUSTED_TYPES_POLICY,A=b.createHTML("")}else b===void 0&&(b=ar(I,a)),b!==null&&typeof A=="string"&&(A=b.createHTML(""));K&&K(c),Ne=c},za=C({},[...ra,...na,...qi]),$a=C({},[...oa,...Ui]),Ys=function(c){let u=y(c);(!u||!u.tagName)&&(u={namespaceURI:Re,tagName:"template"});const p=at(c.tagName),D=at(u.tagName);return _t[c.namespaceURI]?c.namespaceURI===wt?u.namespaceURI===he?p==="svg":u.namespaceURI===yt?p==="svg"&&(D==="annotation-xml"||Vt[D]):!!za[p]:c.namespaceURI===yt?u.namespaceURI===he?p==="math":u.namespaceURI===wt?p==="math"&&Qt[D]:!!$a[p]:c.namespaceURI===he?u.namespaceURI===wt&&!Qt[D]||u.namespaceURI===yt&&!Vt[D]?!1:!$a[p]&&(Hs[p]||!za[p]):!!(Je==="application/xhtml+xml"&&_t[c.namespaceURI]):!1},ke=function(c){tt(e.removed,{element:c});try{y(c).removeChild(c)}catch{Q(c)}},Te=function(c,u){try{tt(e.removed,{attribute:u.getAttributeNode(c),from:u})}catch{tt(e.removed,{attribute:null,from:u})}if(u.removeAttribute(c),c==="is")if(De||ft)try{ke(u)}catch{}else try{u.setAttribute(c,"")}catch{}},_a=function(c){let u=null,p=null;if(Ot)c="<remove></remove>"+c;else{const R=gs(c,/^[\r\n\t ]+/);p=R&&R[0]}Je==="application/xhtml+xml"&&Re===he&&(c='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+c+"</body></html>");const D=b?b.createHTML(c):c;if(Re===he)try{u=new M().parseFromString(D,Je)}catch{}if(!u||!u.documentElement){u=F.createDocument(Re,"template",null);try{u.documentElement.innerHTML=$t?A:D}catch{}}const J=u.body||u.documentElement;return c&&p&&J.insertBefore(t.createTextNode(p),J.childNodes[0]||null),Re===he?jt.call(u,xe?"html":"body")[0]:xe?u.documentElement:J},Va=function(c){return oe.call(c.ownerDocument||c,c,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Ht=function(c){return c instanceof L&&(typeof c.nodeName!="string"||typeof c.textContent!="string"||typeof c.removeChild!="function"||!(c.attributes instanceof m)||typeof c.removeAttribute!="function"||typeof c.setAttribute!="function"||typeof c.namespaceURI!="string"||typeof c.insertBefore!="function"||typeof c.hasChildNodes!="function")},qt=function(c){return typeof o=="function"&&c instanceof o};function ge(c,u,p){et(c,D=>{D.call(e,u,p,Ne)})}const Qa=function(c){let u=null;if(ge(B.beforeSanitizeElements,c,null),Ht(c))return ke(c),!0;const p=$(c.nodeName);if(ge(B.uponSanitizeElement,c,{tagName:p,allowedTags:H}),We&&c.hasChildNodes()&&!qt(c.firstElementChild)&&G(/<[/\w!]/g,c.innerHTML)&&G(/<[/\w!]/g,c.textContent)||We&&c.namespaceURI===he&&p==="style"&&qt(c.firstElementChild)||c.nodeType===it.progressingInstruction||We&&c.nodeType===it.comment&&G(/<[/\w]/g,c.data))return ke(c),!0;if(Ue[p]||!(Me.tagCheck instanceof Function&&Me.tagCheck(p))&&!H[p]){if(!Ue[p]&&Ha(p)&&(P.tagNameCheck instanceof RegExp&&G(P.tagNameCheck,p)||P.tagNameCheck instanceof Function&&P.tagNameCheck(p)))return!1;if(Pt&&!le[p]){const D=y(c)||c.parentNode,J=d(c)||c.childNodes;if(J&&D){const R=J.length;for(let pe=R-1;pe>=0;--pe){const ue=S(J[pe],!0);D.insertBefore(ue,g(c))}}}return ke(c),!0}return c instanceof l&&!Ys(c)||(p==="noscript"||p==="noembed"||p==="noframes")&&G(/<\/no(script|embed|frames)/i,c.innerHTML)?(ke(c),!0):(Se&&c.nodeType===it.text&&(u=c.textContent,et([dt,gt,pt],D=>{u=Pe(u,D," ")}),c.textContent!==u&&(tt(e.removed,{element:c.cloneNode()}),c.textContent=u)),ge(B.afterSanitizeElements,c,null),!1)},Ba=function(c,u,p){if(mt[u]||Da&&(u==="id"||u==="name")&&(p in t||p in Ws))return!1;if(!(Rt&&!mt[u]&&G($s,u))&&!(va&&G(_s,u))&&!(Me.attributeCheck instanceof Function&&Me.attributeCheck(u,c))){if(!Y[u]||mt[u]){if(!(Ha(c)&&(P.tagNameCheck instanceof RegExp&&G(P.tagNameCheck,c)||P.tagNameCheck instanceof Function&&P.tagNameCheck(c))&&(P.attributeNameCheck instanceof RegExp&&G(P.attributeNameCheck,u)||P.attributeNameCheck instanceof Function&&P.attributeNameCheck(u,c))||u==="is"&&P.allowCustomizedBuiltInElements&&(P.tagNameCheck instanceof RegExp&&G(P.tagNameCheck,p)||P.tagNameCheck instanceof Function&&P.tagNameCheck(p))))return!1}else if(!zt[u]&&!G(ka,Pe(p,xa,""))&&!((u==="src"||u==="xlink:href"||u==="href")&&c!=="script"&&ps(p,"data:")===0&&Na[c])&&!(Ea&&!G(Vs,Pe(p,xa,"")))&&p)return!1}return!0},Js=C({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ha=function(c){return!Js[at(c)]&&G(Qs,c)},qa=function(c){ge(B.beforeSanitizeAttributes,c,null);const{attributes:u}=c;if(!u||Ht(c))return;const p={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let D=u.length;for(;D--;){const J=u[D],{name:R,namespaceURI:pe,value:ue}=J,Z=$(R),Ce=ue;let q=R==="value"?Ce:zi(Ce);if(p.attrName=Z,p.attrValue=q,p.keepAttr=!0,p.forceKeepAttr=void 0,ge(B.uponSanitizeAttribute,c,p),q=p.attrValue,ja&&(Z==="id"||Z==="name")&&ps(q,Ra)!==0&&(Te(R,c),q=Ra+q),We&&G(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,q)){Te(R,c);continue}if(Z==="attributename"&&gs(q,"href")){Te(R,c);continue}if(p.forceKeepAttr)continue;if(!p.keepAttr){Te(R,c);continue}if(!Ia&&G(/\/>/i,q)){Te(R,c);continue}Se&&et([dt,gt,pt],Gs=>{q=Pe(q,Gs," ")});const Wa=$(c.nodeName);if(!Ba(Wa,Z,q)){Te(R,c);continue}if(b&&typeof I=="object"&&typeof I.getAttributeType=="function"&&!pe)switch(I.getAttributeType(Wa,Z)){case"TrustedHTML":{q=b.createHTML(q);break}case"TrustedScriptURL":{q=b.createScriptURL(q);break}}if(q!==Ce)try{pe?c.setAttributeNS(pe,R,q):c.setAttribute(R,q),Ht(c)?ke(c):ds(e.removed)}catch{Te(R,c)}}ge(B.afterSanitizeAttributes,c,null)},Ua=function(c){let u=null;const p=Va(c);for(ge(B.beforeSanitizeShadowDOM,c,null);u=p.nextNode();)ge(B.uponSanitizeShadowNode,u,null),Qa(u),qa(u),u.content instanceof r&&Ua(u.content);ge(B.afterSanitizeShadowDOM,c,null)};return e.sanitize=function(c){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=null,D=null,J=null,R=null;if($t=!c,$t&&(c="<!-->"),typeof c!="string"&&!qt(c)&&(c=Bi(c),typeof c!="string"))throw At("dirty is not a string, aborting");if(!e.isSupported)return c;if(Nt||Bt(u),e.removed=[],typeof c=="string"&&(Ye=!1),Ye){const Z=c.nodeName;if(typeof Z=="string"){const Ce=$(Z);if(!H[Ce]||Ue[Ce])throw At("root node is forbidden and cannot be sanitized in-place")}}else if(c instanceof o)p=_a("<!---->"),D=p.ownerDocument.importNode(c,!0),D.nodeType===it.element&&D.nodeName==="BODY"||D.nodeName==="HTML"?p=D:p.appendChild(D);else{if(!De&&!Se&&!xe&&c.indexOf("<")===-1)return b&&Lt?b.createHTML(c):c;if(p=_a(c),!p)return De?null:Lt?A:""}p&&Ot&&ke(p.firstChild);const pe=Va(Ye?c:p);for(;J=pe.nextNode();)Qa(J),qa(J),J.content instanceof r&&Ua(J.content);if(Ye)return c;if(De){if(Se){p.normalize();let Z=p.innerHTML;et([dt,gt,pt],Ce=>{Z=Pe(Z,Ce," ")}),p.innerHTML=Z}if(ft)for(R=ie.call(p.ownerDocument);p.firstChild;)R.appendChild(p.firstChild);else R=p;return(Y.shadowroot||Y.shadowrootmode)&&(R=we.call(s,R,!0)),R}let ue=xe?p.outerHTML:p.innerHTML;return xe&&H["!doctype"]&&p.ownerDocument&&p.ownerDocument.doctype&&p.ownerDocument.doctype.name&&G(bs,p.ownerDocument.doctype.name)&&(ue="<!DOCTYPE "+p.ownerDocument.doctype.name+`>
|
|
57
|
-
`+ue),Se&&et([dt,gt,pt],Z=>{ue=Pe(ue,Z," ")}),b&&Lt?b.createHTML(ue):ue},e.setConfig=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Bt(c),Nt=!0},e.clearConfig=function(){Ne=null,Nt=!1},e.isValidAttribute=function(c,u,p){Ne||Bt({});const D=$(c),J=$(u);return Ba(D,J,p)},e.addHook=function(c,u){typeof u=="function"&&tt(B[c],u)},e.removeHook=function(c,u){if(u!==void 0){const p=Pi(B[c],u);return p===-1?void 0:Fi(B[c],p,1)[0]}return ds(B[c])},e.removeHooks=function(c){B[c]=[]},e.removeAllHooks=function(){B=xs()},e}var Ts=ks();class sr{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 Ts.sanitize(E.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(s=>({label:s==="any"?"Any Distance":s+" "+(t??""),value:s,isSelected:s===this.dataLayer.searchRadius})).sort((s,a)=>{const r=s.value==="any"?0:parseFloat(s.value),n=a.value==="any"?0:parseFloat(a.value);return r-n})}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 Ts.sanitize(E.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(t=>{const s=t.name,a=t.value,r=e.find(n=>n.name===s);if(r){const n=r.values.find(o=>o.type==="range"?!1:o.type==="checkbox"?'"'+o.value+'"'===a:!1);if(n)return n}return null}).filter(t=>t!==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 ne{static deepEqual(e,t){const s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;for(const r of s){const n=e[r],o=t[r],l=this.isObject(n)&&this.isObject(o);if(l&&!this.deepEqual(n,o)||!l&&n!==o)return!1}return!0}static isObject(e){return e!=null&&typeof e=="object"}}class w{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=r=>{s++,e(r),s>=2&&this.unsubscribe(t)};this.subscribe(a,t)}subscribeUntil(e,t,s=6e3,a=!0){const r=Math.random().toString(36).substring(2,15),n=o=>{o===t&&(e(o),this.unsubscribe(r))};return this.value===t?(e(this.value),null):(this.subscribe(n,r),setTimeout(()=>{a&&this.observers[r]&&e(this.value),this.unsubscribe(r)},s),r)}subscribeUntilHasValue(e,t=6e3,s=!0){const a=Math.random().toString(36).substring(2,15),r=n=>{n!=null&&(e(n),this.unsubscribe(a))};return this.value!==null&&this.value!==void 0?(e(this.value),null):(this.subscribe(r,a),t>0&&setTimeout(()=>{s&&this.observers[a]&&e(this.value),this.unsubscribe(a)},t),r)}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 la{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 r=0;r<e;r++)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 r=encodeURIComponent(e)+"="+encodeURIComponent(t);for(const n in a){r+="; "+n;const o=a[n];o!==!0&&(r+="="+o)}typeof document<"u"&&(document.cookie=r)}}class U{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 ir{$searchTermChange=new w("");$searchLocationChange=new w("");$searchLocationCoordinatesDecoded=new w("");$searchLatChange=new w("");$searchLongChange=new w("");$searchRadiusChange=new w(void 0);$loadingChange=new w(!1);$locationError=new w(!1);$searchResults=new w(null);$searchResultsMetadata=new w(null);$searchAutosuggest=new w(null);$searchFacets=new w(null);$searchFacetsCached=new w(null);$searchFacetsCachedTabs=new w(null);$searchstaxConfig=new w(null);$autosuggestResults=new w(null);$itemsPerPage=new w(void 0);$searchObject=new w({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 w(null);$searchInputConfig=new w(null);$searchLocationConfig=new w(null);$searchExternalPromotions=new w(null);$facetsTemplateData=new w(null);$selectedFacetsTemplateData=new w(null);$paginationData=new w(null);$answerData=new w(null);$searchFeedbackData=new w(null);$inputWidgetTemplateData=new w(null);$locationWidgetTemplateData=new w(null);$searchSortingData=new w(null);$searchRelatedSearchesData=new w(null);$searchExternalPromotionsData=new w(null);$cookiesDisabled=new w(null);$locationDecodingLoading=new w(!1);$answer=new w("");$language=new w("en");$model=new w("");$answerLoading=new w(!1);$locationEnabled=new w(null);$answerError=new w(!1);$answerErrorMessage=new w("");$isQuestion=new w(!1);$inputTemplateRendered=new w(!1);currentPageValue=1;isAnswerWidgetCreatedValue=!1;renderingEngineValue=N.mustache;parsedData=new sr(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,la.deleteCookie(this.sessionId),la.deleteCookie("ms_visitorid")):this.sessionIdValue=la.getOrSetCookie(this.sessionId,e)}setIsInfiniteScroll(e){this.isInfiniteScroll=e}setSearchTerm(e){this.$searchTermChange.setValue(U.removeXSSRiskyTags(e))}setSearchLocation(e){this.$searchLocationChange.setValue(U.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,(!ne.deepEqual(e,this.searchResults??[""])||this.facetsWereSet)&&(this.facetsWereSet=!1,this.$searchResults.setValue(e))}setSearchResultsMetadata(e){ne.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&&(!ne.deepEqual(t,this.searchObject??{})||this.forceNotCorrect)&&this.$searchObject.setValue(t)}setSearchFacets(e){this.facetsWereSet=!0,ne.deepEqual(e,this.searchFacets??[])||this.$searchFacets.setValue(e)}setSearchFacetsCached(e){ne.deepEqual(e,this.searchFacetsCached??[])||this.$searchFacetsCached.setValue(e)}setSearchFacetsCachedTabs(e){ne.deepEqual(e,this.searchFacetsCachedTabs??[])||this.$searchFacetsCachedTabs.setValue(e)}setSearchRelatedSearches(e){ne.deepEqual(e,this.searchRelatedSearches??[])||this.$searchRelatedSearches.setValue(e)}setSearchExternalPromotions(e){ne.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(U.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 rt{static combineResultsWithMetadata(e){const t=[],s=parseInt(e.response.start+"");return e.response.docs.forEach((a,r)=>{const n=a[e.responseHeader.params.uniqueId]??"",o={custom:null,uniqueId:n,position:s+1+r,ribbon:this.doesMapExist("ribbon",e)?this.getValueByKey("ribbon",a,e,n):null,paths:this.doesMapExist("paths",e)?this.getValueByKey("paths",a,e,n):null,url:this.doesMapExist("url",e)?this.getValueByKey("url",a,e,n):null,title:this.doesMapExist("title",e)?this.getValueByKey("title",a,e,n):null,titleTracking:this.doesMapExist("title",e)?this.getValueByKey("title",a,e,n,!0):null,promoted:a["[elevated]"]?a["[elevated]"]:!1,thumbnail:this.doesMapExist("thumbnail",e)?this.getValueByKey("thumbnail",a,e,n):null,date:this.doesMapExist("date",e)?this.getValueByKey("date",a,e,n):null,snippet:this.doesMapExist("snippet",e)?this.getValueByKey("snippet",a,e,n):null,description:this.doesMapExist("description",e)?this.getValueByKey("description",a,e,n):null,distance:this.doesMapExist("distance",e)&&this.getValueByKey("distance",a,e,n)!=="Infinity"&&this.getValueByKey("distance",a,e,n)?Math.floor(this.getValueByKey("distance",a,e,n)):null,unit:e.metadata.locationSearch?.unit??"",unmappedFields:this.getUnmappedFields(a,e,n),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 r=e.facet_counts.facet_fields[s.name];for(let n=0;n<r.length;n+=2){const o={};o.value=r[n],o.parentName=a.name,o.count=r[n+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(r=>r.result_card==="date")?.name,s.options=[],e.metadata.sorts?.length){const r=e.metadata.sorts.map(n=>({value:n.label,key:n.name+" "+n.order}));s.options=[{key:"",value:"Relevance"},...r]}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 r=s[a],n={};n.cDocId=this.getDataForAnalytics(r.uniqueId),r.title&&(n.cDocTitle=this.getDataForAnalytics(r.titleTracking)),n.position=r.position,t.push(n)}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(n=>n.result_card==="").map(n=>n.name),r=[];for(const n of a)if(Object.keys(e).includes(n)){const o=Array.isArray(e[n])?this.getHighlightedResults(n,e[n].join(", "),s,t):this.getHighlightedResults(n,e[n]+"",s,t);r.push({key:n,value:o,isImage:this.checkIfImage(e[n])})}return r}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(r=>r.name),a=[];for(const r of Object.keys(e))s.indexOf(r)!==-1&&a.push({key:r,value:e[r],isImage:this.checkIfImage(e[r])});return a}static doesMapExist(e,t){return t.metadata.results.find(s=>s.result_card===e)!==void 0}static getValueByKey(e,t,s,a,r=!1){const n=s.metadata.results.find(l=>l.result_card===e);if(n===void 0)return null;const o=t[n.name];return o===void 0?null:typeof o=="string"?r?o:this.getHighlightedResults(n.name,o,a,s):typeof o=="number"?o:Array.isArray(o)?r?o.join(", "):this.getHighlightedResults(n.name,o.join(", "),a,s):null}static getHighlightedResults(e,t,s,a){if(a.highlighting&&s in a.highlighting){let r=a.highlighting[s];if(r&&e in r){let n=r[e];const o=this.cleanValue(n);if(o!=="")return o}}return t}static cleanValue(e){return e===null?"":typeof e=="string"?e:Array.isArray(e)?e.join(" "):""}}class As{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 rr(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 r=e.location[a];r&&(t[this.routeName+`[location][${a}]`]=r)}if(e.facets)for(const a in e.facets){const r=e.facets[a].type+":"+encodeURIComponent(e.facets[a].name)+":"+encodeURIComponent(e.facets[a].value);t[this.routeName+`[facets][${a}]`]=r}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 r in a)r.startsWith(this.routeName)&&delete a[r];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=U.removeXSSRiskyTags(e[s].split(":")?.[0]),r=U.removeXSSRiskyTags(decodeURIComponent(e[s].split(":")?.[1])),n=U.removeXSSRiskyTags(decodeURIComponent(e[s].split(":")?.[2]));t.push({type:a,name:r,value:n})}return t}urlToSearchObject(e,t){const s=this.queryStringHelper.urlToParams(e),a=U.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[page]"])),r=parseInt(a),n=isNaN(r)?1:r;let o=parseInt(U.removeXSSRiskyTags(s[this.routeName+"[itemsPerPage]"]));return isNaN(o)&&(o=10),{query:U.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[query]"]))||"",page:n,itemsPerPage:t??o,order:U.removeXSSRiskyTags(s[this.routeName+"[order]"])||"",facets:this.extractArrayOfFacetsFromQueryParameters(s)||[],model:U.removeXSSRiskyTags(s[this.routeName+"[model]"])||"",location:{address:U.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][address]"]||"")),radius:U.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][radius]"]||"")),lat:U.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lat]"]||"")),lon:U.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lon]"]||""))}}}}class rr{routeName="";constructor(e){this.routeName=e}stringify=(e,t)=>{const s=this.filterOutIgnoredKeys(e,t.ignoredKeys);return Object.keys(s).map(a=>{const r=s[a];return Array.isArray(r)?r.map(n=>`${a}=${n}`).join("&"):`${a}=${r}`}).join("&")};filterOutIgnoredKeys(e,t){const s=t||[],a={};return Object.keys(e).forEach(r=>{s.includes(r)||e[r]!==""&&(a[r]=e[r])}),a}urlToParams(e){const t={},s=e.split("?")[1];return s&&s.split("&").forEach(a=>{const[r,n]=a.split("=");t[r]=n}),t}doesParamContainRouteName(e){return e.indexOf(this.routeName)!==-1}urlHasQueryParams(e){return e.indexOf("?")!==-1}}const ze={question:"I_AM_A_QUESTION",notQuestion:"I_AM_NOT_A_QUESTION",close:"CLOSE"};class vs 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 Es=10,nr=13,Ee=32;function ha(i){}function or(i){if(typeof i=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=ha,onError:t=ha,onRetry:s=ha,onComment:a}=i,r=[];let n=!0,o,l="",h=0,m;function L(g){if(n&&(n=!1,g.charCodeAt(0)===239&&g.charCodeAt(1)===187&&g.charCodeAt(2)===191&&(g=g.slice(3))),r.length===0){const b=M(g);b!==""&&r.push(b);return}if(g.indexOf(`
|
|
56
|
+
Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An error occurred:</p><pre>"+de(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},ve=new ji;function E(i,e){return ve.parse(i,e)}E.options=E.setOptions=function(i){return ve.setOptions(i),E.defaults=ve.defaults,Ya(E.defaults),E},E.getDefaults=Ut,E.defaults=Ae,E.use=function(...i){return ve.use(...i),E.defaults=ve.defaults,Ya(E.defaults),E},E.walkTokens=function(i,e){return ve.walkTokens(i,e)},E.parseInline=ve.parseInline,E.Parser=fe,E.parser=fe.parse,E.Renderer=kt,E.TextRenderer=ta,E.Lexer=me,E.lexer=me.lex,E.Tokenizer=xt,E.Hooks=Tt,E.parse=E,E.options,E.setOptions,E.use,E.walkTokens,E.parseInline,fe.parse,me.lex;const{entries:hs,setPrototypeOf:us,isFrozen:Ri,getPrototypeOf:Ni,getOwnPropertyDescriptor:Oi}=Object;let{freeze:K,seal:re,create:Oe}=Object,{apply:aa,construct:sa}=typeof Reflect<"u"&&Reflect;K||(K=function(i){return i}),re||(re=function(i){return i}),aa||(aa=function(i,e){for(var t=arguments.length,s=new Array(t>2?t-2:0),a=2;a<t;a++)s[a-2]=arguments[a];return i.apply(e,s)}),sa||(sa=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;s<e;s++)t[s-1]=arguments[s];return new i(...t)});const et=z(Array.prototype.forEach),Pi=z(Array.prototype.lastIndexOf),ds=z(Array.prototype.pop),tt=z(Array.prototype.push),Fi=z(Array.prototype.splice),ee=Array.isArray,at=z(String.prototype.toLowerCase),ia=z(String.prototype.toString),gs=z(String.prototype.match),Pe=z(String.prototype.replace),ps=z(String.prototype.indexOf),zi=z(String.prototype.trim),$i=z(Number.prototype.toString),_i=z(Boolean.prototype.toString),ms=typeof BigInt>"u"?null:z(BigInt.prototype.toString),fs=typeof Symbol>"u"?null:z(Symbol.prototype.toString),O=z(Object.prototype.hasOwnProperty),st=z(Object.prototype.toString),G=z(RegExp.prototype.test),At=Vi(TypeError);function z(i){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 aa(i,e,s)}}function Vi(i){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return sa(i,t)}}function C(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:at;if(us&&us(i,null),!ee(e))return i;let s=e.length;for(;s--;){let a=e[s];if(typeof a=="string"){const r=t(a);r!==a&&(Ri(e)||(e[s]=r),a=r)}i[a]=!0}return i}function Qi(i){for(let e=0;e<i.length;e++)O(i,e)||(i[e]=null);return i}function ae(i){const e=Oe(null);for(const[t,s]of hs(i))O(i,t)&&(ee(s)?e[t]=Qi(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=ae(s):e[t]=s);return e}function Bi(i){switch(typeof i){case"string":return i;case"number":return $i(i);case"boolean":return _i(i);case"bigint":return ms?ms(i):"0";case"symbol":return fs?fs(i):"Symbol()";case"undefined":return st(i);case"function":case"object":{if(i===null)return st(i);const e=i,t=Fe(e,"toString");if(typeof t=="function"){const s=t(e);return typeof s=="string"?s:st(s)}return st(i)}default:return st(i)}}function Fe(i,e){for(;i!==null;){const s=Oi(i,e);if(s){if(s.get)return z(s.get);if(typeof s.value=="function")return z(s.value)}i=Ni(i)}function t(){return null}return t}function Hi(i){try{return G(i,""),!0}catch{return!1}}const Ls=K(["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"]),ra=K(["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"]),na=K(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),qi=K(["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"]),oa=K(["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"]),Ui=K(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ys=K(["#text"]),ws=K(["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"]),ca=K(["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"]),Ms=K(["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"]),vt=K(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Wi=re(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Yi=re(/<%[\w\W]*|[\w\W]*%>/gm),Ji=re(/\$\{[\w\W]*/gm),Gi=re(/^data-[\-\w.\u00B7-\uFFFF]+$/),Zi=re(/^aria-[\-\w]+$/),Cs=re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Xi=re(/^(?:\w+script|data):/i),Ki=re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bs=re(/^html$/i),er=re(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ss=Object.freeze({__proto__:null,ARIA_ATTR:Zi,ATTR_WHITESPACE:Ki,CUSTOM_ELEMENT:er,DATA_ATTR:Gi,DOCTYPE_NAME:bs,ERB_EXPR:Yi,IS_ALLOWED_URI:Cs,IS_SCRIPT_OR_DATA:Xi,MUSTACHE_EXPR:Wi,TMPLIT_EXPR:Ji});const it={element:1,text:3,progressingInstruction:7,comment:8,document:9},tr=function(){return typeof window>"u"?null:window},ar=function(i,e){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let t=null;const s="data-tt-policy-suffix";e&&e.hasAttribute(s)&&(t=e.getAttribute(s));const a="dompurify"+(t?"#"+t:"");try{return i.createPolicy(a,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},xs=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ks(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tr();const e=c=>ks(c);if(e.version="3.4.2",e.removed=[],!i||!i.document||i.document.nodeType!==it.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const s=t,a=s.currentScript,{DocumentFragment:r,HTMLTemplateElement:n,Node:o,Element:l,NodeFilter:h,NamedNodeMap:m=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:L,DOMParser:M,trustedTypes:I}=i,k=l.prototype,S=Fe(k,"cloneNode"),Q=Fe(k,"remove"),g=Fe(k,"nextSibling"),d=Fe(k,"childNodes"),y=Fe(k,"parentNode");if(typeof n=="function"){const c=t.createElement("template");c.content&&c.content.ownerDocument&&(t=c.content.ownerDocument)}let b,A="";const{implementation:F,createNodeIterator:oe,createDocumentFragment:ie,getElementsByTagName:jt}=t,{importNode:we}=s;let B=xs();e.isSupported=typeof hs=="function"&&typeof y=="function"&&F&&F.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:dt,ERB_EXPR:gt,TMPLIT_EXPR:pt,DATA_ATTR:$s,ARIA_ATTR:_s,IS_SCRIPT_OR_DATA:Vs,ATTR_WHITESPACE:xa,CUSTOM_ELEMENT:Qs}=Ss;let{IS_ALLOWED_URI:ka}=Ss,H=null;const Ta=C({},[...Ls,...ra,...na,...oa,...ys]);let Y=null;const Aa=C({},[...ws,...ca,...Ms,...vt]);let P=Object.seal(Oe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ue=null,mt=null;const Me=Object.seal(Oe(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let va=!0,Rt=!0,Ea=!1,Ia=!0,Se=!1,We=!0,xe=!1,Nt=!1,Ot=!1,De=!1,ft=!1,Lt=!1,Da=!0,ja=!1;const Ra="user-content-";let Pt=!0,Ye=!1,je={},le=null;const Ft=C({},["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 Na=null;const Oa=C({},["audio","video","img","source","image","track"]);let zt=null;const Pa=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yt="http://www.w3.org/1998/Math/MathML",wt="http://www.w3.org/2000/svg",he="http://www.w3.org/1999/xhtml";let Re=he,$t=!1,_t=null;const Bs=C({},[yt,wt,he],ia);let Vt=C({},["mi","mo","mn","ms","mtext"]),Qt=C({},["annotation-xml"]);const Hs=C({},["title","style","font","a","script"]);let Je=null;const qs=["application/xhtml+xml","text/html"],Us="text/html";let $=null,Ne=null;const Ws=t.createElement("form"),Fa=function(c){return c instanceof RegExp||c instanceof Function},Bt=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ne&&Ne===c)return;(!c||typeof c!="object")&&(c={}),c=ae(c),Je=qs.indexOf(c.PARSER_MEDIA_TYPE)===-1?Us:c.PARSER_MEDIA_TYPE,$=Je==="application/xhtml+xml"?ia:at,H=O(c,"ALLOWED_TAGS")&&ee(c.ALLOWED_TAGS)?C({},c.ALLOWED_TAGS,$):Ta,Y=O(c,"ALLOWED_ATTR")&&ee(c.ALLOWED_ATTR)?C({},c.ALLOWED_ATTR,$):Aa,_t=O(c,"ALLOWED_NAMESPACES")&&ee(c.ALLOWED_NAMESPACES)?C({},c.ALLOWED_NAMESPACES,ia):Bs,zt=O(c,"ADD_URI_SAFE_ATTR")&&ee(c.ADD_URI_SAFE_ATTR)?C(ae(Pa),c.ADD_URI_SAFE_ATTR,$):Pa,Na=O(c,"ADD_DATA_URI_TAGS")&&ee(c.ADD_DATA_URI_TAGS)?C(ae(Oa),c.ADD_DATA_URI_TAGS,$):Oa,le=O(c,"FORBID_CONTENTS")&&ee(c.FORBID_CONTENTS)?C({},c.FORBID_CONTENTS,$):Ft,Ue=O(c,"FORBID_TAGS")&&ee(c.FORBID_TAGS)?C({},c.FORBID_TAGS,$):ae({}),mt=O(c,"FORBID_ATTR")&&ee(c.FORBID_ATTR)?C({},c.FORBID_ATTR,$):ae({}),je=O(c,"USE_PROFILES")?c.USE_PROFILES&&typeof c.USE_PROFILES=="object"?ae(c.USE_PROFILES):c.USE_PROFILES:!1,va=c.ALLOW_ARIA_ATTR!==!1,Rt=c.ALLOW_DATA_ATTR!==!1,Ea=c.ALLOW_UNKNOWN_PROTOCOLS||!1,Ia=c.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Se=c.SAFE_FOR_TEMPLATES||!1,We=c.SAFE_FOR_XML!==!1,xe=c.WHOLE_DOCUMENT||!1,De=c.RETURN_DOM||!1,ft=c.RETURN_DOM_FRAGMENT||!1,Lt=c.RETURN_TRUSTED_TYPE||!1,Ot=c.FORCE_BODY||!1,Da=c.SANITIZE_DOM!==!1,ja=c.SANITIZE_NAMED_PROPS||!1,Pt=c.KEEP_CONTENT!==!1,Ye=c.IN_PLACE||!1,ka=Hi(c.ALLOWED_URI_REGEXP)?c.ALLOWED_URI_REGEXP:Cs,Re=typeof c.NAMESPACE=="string"?c.NAMESPACE:he,Vt=O(c,"MATHML_TEXT_INTEGRATION_POINTS")&&c.MATHML_TEXT_INTEGRATION_POINTS&&typeof c.MATHML_TEXT_INTEGRATION_POINTS=="object"?ae(c.MATHML_TEXT_INTEGRATION_POINTS):C({},["mi","mo","mn","ms","mtext"]),Qt=O(c,"HTML_INTEGRATION_POINTS")&&c.HTML_INTEGRATION_POINTS&&typeof c.HTML_INTEGRATION_POINTS=="object"?ae(c.HTML_INTEGRATION_POINTS):C({},["annotation-xml"]);const u=O(c,"CUSTOM_ELEMENT_HANDLING")&&c.CUSTOM_ELEMENT_HANDLING&&typeof c.CUSTOM_ELEMENT_HANDLING=="object"?ae(c.CUSTOM_ELEMENT_HANDLING):Oe(null);if(P=Oe(null),O(u,"tagNameCheck")&&Fa(u.tagNameCheck)&&(P.tagNameCheck=u.tagNameCheck),O(u,"attributeNameCheck")&&Fa(u.attributeNameCheck)&&(P.attributeNameCheck=u.attributeNameCheck),O(u,"allowCustomizedBuiltInElements")&&typeof u.allowCustomizedBuiltInElements=="boolean"&&(P.allowCustomizedBuiltInElements=u.allowCustomizedBuiltInElements),Se&&(Rt=!1),ft&&(De=!0),je&&(H=C({},ys),Y=Oe(null),je.html===!0&&(C(H,Ls),C(Y,ws)),je.svg===!0&&(C(H,ra),C(Y,ca),C(Y,vt)),je.svgFilters===!0&&(C(H,na),C(Y,ca),C(Y,vt)),je.mathMl===!0&&(C(H,oa),C(Y,Ms),C(Y,vt))),Me.tagCheck=null,Me.attributeCheck=null,O(c,"ADD_TAGS")&&(typeof c.ADD_TAGS=="function"?Me.tagCheck=c.ADD_TAGS:ee(c.ADD_TAGS)&&(H===Ta&&(H=ae(H)),C(H,c.ADD_TAGS,$))),O(c,"ADD_ATTR")&&(typeof c.ADD_ATTR=="function"?Me.attributeCheck=c.ADD_ATTR:ee(c.ADD_ATTR)&&(Y===Aa&&(Y=ae(Y)),C(Y,c.ADD_ATTR,$))),O(c,"ADD_URI_SAFE_ATTR")&&ee(c.ADD_URI_SAFE_ATTR)&&C(zt,c.ADD_URI_SAFE_ATTR,$),O(c,"FORBID_CONTENTS")&&ee(c.FORBID_CONTENTS)&&(le===Ft&&(le=ae(le)),C(le,c.FORBID_CONTENTS,$)),O(c,"ADD_FORBID_CONTENTS")&&ee(c.ADD_FORBID_CONTENTS)&&(le===Ft&&(le=ae(le)),C(le,c.ADD_FORBID_CONTENTS,$)),Pt&&(H["#text"]=!0),xe&&C(H,["html","head","body"]),H.table&&(C(H,["tbody"]),delete Ue.tbody),c.TRUSTED_TYPES_POLICY){if(typeof c.TRUSTED_TYPES_POLICY.createHTML!="function")throw At('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof c.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw At('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=c.TRUSTED_TYPES_POLICY,A=b.createHTML("")}else b===void 0&&(b=ar(I,a)),b!==null&&typeof A=="string"&&(A=b.createHTML(""));K&&K(c),Ne=c},za=C({},[...ra,...na,...qi]),$a=C({},[...oa,...Ui]),Ys=function(c){let u=y(c);(!u||!u.tagName)&&(u={namespaceURI:Re,tagName:"template"});const p=at(c.tagName),D=at(u.tagName);return _t[c.namespaceURI]?c.namespaceURI===wt?u.namespaceURI===he?p==="svg":u.namespaceURI===yt?p==="svg"&&(D==="annotation-xml"||Vt[D]):!!za[p]:c.namespaceURI===yt?u.namespaceURI===he?p==="math":u.namespaceURI===wt?p==="math"&&Qt[D]:!!$a[p]:c.namespaceURI===he?u.namespaceURI===wt&&!Qt[D]||u.namespaceURI===yt&&!Vt[D]?!1:!$a[p]&&(Hs[p]||!za[p]):!!(Je==="application/xhtml+xml"&&_t[c.namespaceURI]):!1},ke=function(c){tt(e.removed,{element:c});try{y(c).removeChild(c)}catch{Q(c)}},Te=function(c,u){try{tt(e.removed,{attribute:u.getAttributeNode(c),from:u})}catch{tt(e.removed,{attribute:null,from:u})}if(u.removeAttribute(c),c==="is")if(De||ft)try{ke(u)}catch{}else try{u.setAttribute(c,"")}catch{}},_a=function(c){let u=null,p=null;if(Ot)c="<remove></remove>"+c;else{const R=gs(c,/^[\r\n\t ]+/);p=R&&R[0]}Je==="application/xhtml+xml"&&Re===he&&(c='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+c+"</body></html>");const D=b?b.createHTML(c):c;if(Re===he)try{u=new M().parseFromString(D,Je)}catch{}if(!u||!u.documentElement){u=F.createDocument(Re,"template",null);try{u.documentElement.innerHTML=$t?A:D}catch{}}const J=u.body||u.documentElement;return c&&p&&J.insertBefore(t.createTextNode(p),J.childNodes[0]||null),Re===he?jt.call(u,xe?"html":"body")[0]:xe?u.documentElement:J},Va=function(c){return oe.call(c.ownerDocument||c,c,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Ht=function(c){return c instanceof L&&(typeof c.nodeName!="string"||typeof c.textContent!="string"||typeof c.removeChild!="function"||!(c.attributes instanceof m)||typeof c.removeAttribute!="function"||typeof c.setAttribute!="function"||typeof c.namespaceURI!="string"||typeof c.insertBefore!="function"||typeof c.hasChildNodes!="function")},qt=function(c){return typeof o=="function"&&c instanceof o};function ge(c,u,p){et(c,D=>{D.call(e,u,p,Ne)})}const Qa=function(c){let u=null;if(ge(B.beforeSanitizeElements,c,null),Ht(c))return ke(c),!0;const p=$(c.nodeName);if(ge(B.uponSanitizeElement,c,{tagName:p,allowedTags:H}),We&&c.hasChildNodes()&&!qt(c.firstElementChild)&&G(/<[/\w!]/g,c.innerHTML)&&G(/<[/\w!]/g,c.textContent)||We&&c.namespaceURI===he&&p==="style"&&qt(c.firstElementChild)||c.nodeType===it.progressingInstruction||We&&c.nodeType===it.comment&&G(/<[/\w]/g,c.data))return ke(c),!0;if(Ue[p]||!(Me.tagCheck instanceof Function&&Me.tagCheck(p))&&!H[p]){if(!Ue[p]&&Ha(p)&&(P.tagNameCheck instanceof RegExp&&G(P.tagNameCheck,p)||P.tagNameCheck instanceof Function&&P.tagNameCheck(p)))return!1;if(Pt&&!le[p]){const D=y(c)||c.parentNode,J=d(c)||c.childNodes;if(J&&D){const R=J.length;for(let pe=R-1;pe>=0;--pe){const ue=S(J[pe],!0);D.insertBefore(ue,g(c))}}}return ke(c),!0}return c instanceof l&&!Ys(c)||(p==="noscript"||p==="noembed"||p==="noframes")&&G(/<\/no(script|embed|frames)/i,c.innerHTML)?(ke(c),!0):(Se&&c.nodeType===it.text&&(u=c.textContent,et([dt,gt,pt],D=>{u=Pe(u,D," ")}),c.textContent!==u&&(tt(e.removed,{element:c.cloneNode()}),c.textContent=u)),ge(B.afterSanitizeElements,c,null),!1)},Ba=function(c,u,p){if(mt[u]||Da&&(u==="id"||u==="name")&&(p in t||p in Ws))return!1;const D=Y[u]||Me.attributeCheck instanceof Function&&Me.attributeCheck(u,c);if(!(Rt&&!mt[u]&&G($s,u))&&!(va&&G(_s,u))){if(!D||mt[u]){if(!(Ha(c)&&(P.tagNameCheck instanceof RegExp&&G(P.tagNameCheck,c)||P.tagNameCheck instanceof Function&&P.tagNameCheck(c))&&(P.attributeNameCheck instanceof RegExp&&G(P.attributeNameCheck,u)||P.attributeNameCheck instanceof Function&&P.attributeNameCheck(u,c))||u==="is"&&P.allowCustomizedBuiltInElements&&(P.tagNameCheck instanceof RegExp&&G(P.tagNameCheck,p)||P.tagNameCheck instanceof Function&&P.tagNameCheck(p))))return!1}else if(!zt[u]&&!G(ka,Pe(p,xa,""))&&!((u==="src"||u==="xlink:href"||u==="href")&&c!=="script"&&ps(p,"data:")===0&&Na[c])&&!(Ea&&!G(Vs,Pe(p,xa,"")))&&p)return!1}return!0},Js=C({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ha=function(c){return!Js[at(c)]&&G(Qs,c)},qa=function(c){ge(B.beforeSanitizeAttributes,c,null);const{attributes:u}=c;if(!u||Ht(c))return;const p={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let D=u.length;for(;D--;){const J=u[D],{name:R,namespaceURI:pe,value:ue}=J,Z=$(R),Ce=ue;let q=R==="value"?Ce:zi(Ce);if(p.attrName=Z,p.attrValue=q,p.keepAttr=!0,p.forceKeepAttr=void 0,ge(B.uponSanitizeAttribute,c,p),q=p.attrValue,ja&&(Z==="id"||Z==="name")&&ps(q,Ra)!==0&&(Te(R,c),q=Ra+q),We&&G(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,q)){Te(R,c);continue}if(Z==="attributename"&&gs(q,"href")){Te(R,c);continue}if(p.forceKeepAttr)continue;if(!p.keepAttr){Te(R,c);continue}if(!Ia&&G(/\/>/i,q)){Te(R,c);continue}Se&&et([dt,gt,pt],Gs=>{q=Pe(q,Gs," ")});const Wa=$(c.nodeName);if(!Ba(Wa,Z,q)){Te(R,c);continue}if(b&&typeof I=="object"&&typeof I.getAttributeType=="function"&&!pe)switch(I.getAttributeType(Wa,Z)){case"TrustedHTML":{q=b.createHTML(q);break}case"TrustedScriptURL":{q=b.createScriptURL(q);break}}if(q!==Ce)try{pe?c.setAttributeNS(pe,R,q):c.setAttribute(R,q),Ht(c)?ke(c):ds(e.removed)}catch{Te(R,c)}}ge(B.afterSanitizeAttributes,c,null)},Ua=function(c){let u=null;const p=Va(c);for(ge(B.beforeSanitizeShadowDOM,c,null);u=p.nextNode();)ge(B.uponSanitizeShadowNode,u,null),Qa(u),qa(u),u.content instanceof r&&Ua(u.content);ge(B.afterSanitizeShadowDOM,c,null)};return e.sanitize=function(c){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=null,D=null,J=null,R=null;if($t=!c,$t&&(c="<!-->"),typeof c!="string"&&!qt(c)&&(c=Bi(c),typeof c!="string"))throw At("dirty is not a string, aborting");if(!e.isSupported)return c;if(Nt||Bt(u),e.removed=[],typeof c=="string"&&(Ye=!1),Ye){const Z=c.nodeName;if(typeof Z=="string"){const Ce=$(Z);if(!H[Ce]||Ue[Ce])throw At("root node is forbidden and cannot be sanitized in-place")}}else if(c instanceof o)p=_a("<!---->"),D=p.ownerDocument.importNode(c,!0),D.nodeType===it.element&&D.nodeName==="BODY"||D.nodeName==="HTML"?p=D:p.appendChild(D);else{if(!De&&!Se&&!xe&&c.indexOf("<")===-1)return b&&Lt?b.createHTML(c):c;if(p=_a(c),!p)return De?null:Lt?A:""}p&&Ot&&ke(p.firstChild);const pe=Va(Ye?c:p);for(;J=pe.nextNode();)Qa(J),qa(J),J.content instanceof r&&Ua(J.content);if(Ye)return c;if(De){if(Se){p.normalize();let Z=p.innerHTML;et([dt,gt,pt],Ce=>{Z=Pe(Z,Ce," ")}),p.innerHTML=Z}if(ft)for(R=ie.call(p.ownerDocument);p.firstChild;)R.appendChild(p.firstChild);else R=p;return(Y.shadowroot||Y.shadowrootmode)&&(R=we.call(s,R,!0)),R}let ue=xe?p.outerHTML:p.innerHTML;return xe&&H["!doctype"]&&p.ownerDocument&&p.ownerDocument.doctype&&p.ownerDocument.doctype.name&&G(bs,p.ownerDocument.doctype.name)&&(ue="<!DOCTYPE "+p.ownerDocument.doctype.name+`>
|
|
57
|
+
`+ue),Se&&et([dt,gt,pt],Z=>{ue=Pe(ue,Z," ")}),b&&Lt?b.createHTML(ue):ue},e.setConfig=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Bt(c),Nt=!0},e.clearConfig=function(){Ne=null,Nt=!1},e.isValidAttribute=function(c,u,p){Ne||Bt({});const D=$(c),J=$(u);return Ba(D,J,p)},e.addHook=function(c,u){typeof u=="function"&&tt(B[c],u)},e.removeHook=function(c,u){if(u!==void 0){const p=Pi(B[c],u);return p===-1?void 0:Fi(B[c],p,1)[0]}return ds(B[c])},e.removeHooks=function(c){B[c]=[]},e.removeAllHooks=function(){B=xs()},e}var Ts=ks();class sr{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 Ts.sanitize(E.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(s=>({label:s==="any"?"Any Distance":s+" "+(t??""),value:s,isSelected:s===this.dataLayer.searchRadius})).sort((s,a)=>{const r=s.value==="any"?0:parseFloat(s.value),n=a.value==="any"?0:parseFloat(a.value);return r-n})}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 Ts.sanitize(E.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(t=>{const s=t.name,a=t.value,r=e.find(n=>n.name===s);if(r){const n=r.values.find(o=>o.type==="range"?!1:o.type==="checkbox"?'"'+o.value+'"'===a:!1);if(n)return n}return null}).filter(t=>t!==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 ne{static deepEqual(e,t){const s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;for(const r of s){const n=e[r],o=t[r],l=this.isObject(n)&&this.isObject(o);if(l&&!this.deepEqual(n,o)||!l&&n!==o)return!1}return!0}static isObject(e){return e!=null&&typeof e=="object"}}class w{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=r=>{s++,e(r),s>=2&&this.unsubscribe(t)};this.subscribe(a,t)}subscribeUntil(e,t,s=6e3,a=!0){const r=Math.random().toString(36).substring(2,15),n=o=>{o===t&&(e(o),this.unsubscribe(r))};return this.value===t?(e(this.value),null):(this.subscribe(n,r),setTimeout(()=>{a&&this.observers[r]&&e(this.value),this.unsubscribe(r)},s),r)}subscribeUntilHasValue(e,t=6e3,s=!0){const a=Math.random().toString(36).substring(2,15),r=n=>{n!=null&&(e(n),this.unsubscribe(a))};return this.value!==null&&this.value!==void 0?(e(this.value),null):(this.subscribe(r,a),t>0&&setTimeout(()=>{s&&this.observers[a]&&e(this.value),this.unsubscribe(a)},t),r)}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 la{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 r=0;r<e;r++)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 r=encodeURIComponent(e)+"="+encodeURIComponent(t);for(const n in a){r+="; "+n;const o=a[n];o!==!0&&(r+="="+o)}typeof document<"u"&&(document.cookie=r)}}class U{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 ir{$searchTermChange=new w("");$searchLocationChange=new w("");$searchLocationCoordinatesDecoded=new w("");$searchLatChange=new w("");$searchLongChange=new w("");$searchRadiusChange=new w(void 0);$loadingChange=new w(!1);$locationError=new w(!1);$searchResults=new w(null);$searchResultsMetadata=new w(null);$searchAutosuggest=new w(null);$searchFacets=new w(null);$searchFacetsCached=new w(null);$searchFacetsCachedTabs=new w(null);$searchstaxConfig=new w(null);$autosuggestResults=new w(null);$itemsPerPage=new w(void 0);$searchObject=new w({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 w(null);$searchInputConfig=new w(null);$searchLocationConfig=new w(null);$searchExternalPromotions=new w(null);$facetsTemplateData=new w(null);$selectedFacetsTemplateData=new w(null);$paginationData=new w(null);$answerData=new w(null);$searchFeedbackData=new w(null);$inputWidgetTemplateData=new w(null);$locationWidgetTemplateData=new w(null);$searchSortingData=new w(null);$searchRelatedSearchesData=new w(null);$searchExternalPromotionsData=new w(null);$cookiesDisabled=new w(null);$locationDecodingLoading=new w(!1);$answer=new w("");$language=new w("en");$model=new w("");$answerLoading=new w(!1);$locationEnabled=new w(null);$answerError=new w(!1);$answerErrorMessage=new w("");$isQuestion=new w(!1);$inputTemplateRendered=new w(!1);currentPageValue=1;isAnswerWidgetCreatedValue=!1;renderingEngineValue=N.mustache;parsedData=new sr(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,la.deleteCookie(this.sessionId),la.deleteCookie("ms_visitorid")):this.sessionIdValue=la.getOrSetCookie(this.sessionId,e)}setIsInfiniteScroll(e){this.isInfiniteScroll=e}setSearchTerm(e){this.$searchTermChange.setValue(U.removeXSSRiskyTags(e))}setSearchLocation(e){this.$searchLocationChange.setValue(U.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,(!ne.deepEqual(e,this.searchResults??[""])||this.facetsWereSet)&&(this.facetsWereSet=!1,this.$searchResults.setValue(e))}setSearchResultsMetadata(e){ne.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&&(!ne.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,ne.deepEqual(e,this.searchFacets??[])||this.$searchFacets.setValue(e)}setSearchFacetsCached(e){ne.deepEqual(e,this.searchFacetsCached??[])||this.$searchFacetsCached.setValue(e)}setSearchFacetsCachedTabs(e){ne.deepEqual(e,this.searchFacetsCachedTabs??[])||this.$searchFacetsCachedTabs.setValue(e)}setSearchRelatedSearches(e){ne.deepEqual(e,this.searchRelatedSearches??[])||this.$searchRelatedSearches.setValue(e)}setSearchExternalPromotions(e){ne.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(U.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 rt{static combineResultsWithMetadata(e){const t=[],s=parseInt(e.response.start+"");return e.response.docs.forEach((a,r)=>{const n=a[e.responseHeader.params.uniqueId]??"",o={custom:null,uniqueId:n,position:s+1+r,ribbon:this.doesMapExist("ribbon",e)?this.getValueByKey("ribbon",a,e,n):null,paths:this.doesMapExist("paths",e)?this.getValueByKey("paths",a,e,n):null,url:this.doesMapExist("url",e)?this.getValueByKey("url",a,e,n):null,title:this.doesMapExist("title",e)?this.getValueByKey("title",a,e,n):null,titleTracking:this.doesMapExist("title",e)?this.getValueByKey("title",a,e,n,!0):null,promoted:a["[elevated]"]?a["[elevated]"]:!1,thumbnail:this.doesMapExist("thumbnail",e)?this.getValueByKey("thumbnail",a,e,n):null,date:this.doesMapExist("date",e)?this.getValueByKey("date",a,e,n):null,snippet:this.doesMapExist("snippet",e)?this.getValueByKey("snippet",a,e,n):null,description:this.doesMapExist("description",e)?this.getValueByKey("description",a,e,n):null,distance:this.doesMapExist("distance",e)&&this.getValueByKey("distance",a,e,n)!=="Infinity"&&this.getValueByKey("distance",a,e,n)?Math.floor(this.getValueByKey("distance",a,e,n)):null,unit:e.metadata.locationSearch?.unit??"",unmappedFields:this.getUnmappedFields(a,e,n),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 r=e.facet_counts.facet_fields[s.name];for(let n=0;n<r.length;n+=2){const o={};o.value=r[n],o.parentName=a.name,o.count=r[n+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(r=>r.result_card==="date")?.name,s.options=[],e.metadata.sorts?.length){const r=e.metadata.sorts.map(n=>({value:n.label,key:n.name+" "+n.order}));s.options=[{key:"",value:"Relevance"},...r]}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 r=s[a],n={};n.cDocId=this.getDataForAnalytics(r.uniqueId),r.title&&(n.cDocTitle=this.getDataForAnalytics(r.titleTracking)),n.position=r.position,t.push(n)}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(n=>n.result_card==="").map(n=>n.name),r=[];for(const n of a)if(Object.keys(e).includes(n)){const o=Array.isArray(e[n])?this.getHighlightedResults(n,e[n].join(", "),s,t):this.getHighlightedResults(n,e[n]+"",s,t);r.push({key:n,value:o,isImage:this.checkIfImage(e[n])})}return r}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(r=>r.name),a=[];for(const r of Object.keys(e))s.indexOf(r)!==-1&&a.push({key:r,value:e[r],isImage:this.checkIfImage(e[r])});return a}static doesMapExist(e,t){return t.metadata.results.find(s=>s.result_card===e)!==void 0}static getValueByKey(e,t,s,a,r=!1){const n=s.metadata.results.find(l=>l.result_card===e);if(n===void 0)return null;const o=t[n.name];return o===void 0?null:typeof o=="string"?r?o:this.getHighlightedResults(n.name,o,a,s):typeof o=="number"?o:Array.isArray(o)?r?o.join(", "):this.getHighlightedResults(n.name,o.join(", "),a,s):null}static getHighlightedResults(e,t,s,a){if(a.highlighting&&s in a.highlighting){let r=a.highlighting[s];if(r&&e in r){let n=r[e];const o=this.cleanValue(n);if(o!=="")return o}}return t}static cleanValue(e){return e===null?"":typeof e=="string"?e:Array.isArray(e)?e.join(" "):""}}class As{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 rr(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 r=e.location[a];r&&(t[this.routeName+`[location][${a}]`]=r)}if(e.facets)for(const a in e.facets){const r=e.facets[a].type+":"+encodeURIComponent(e.facets[a].name)+":"+encodeURIComponent(e.facets[a].value);t[this.routeName+`[facets][${a}]`]=r}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 r in a)r.startsWith(this.routeName)&&delete a[r];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=U.removeXSSRiskyTags(e[s].split(":")?.[0]),r=U.removeXSSRiskyTags(decodeURIComponent(e[s].split(":")?.[1])),n=U.removeXSSRiskyTags(decodeURIComponent(e[s].split(":")?.[2]));t.push({type:a,name:r,value:n})}return t}urlToSearchObject(e,t){const s=this.queryStringHelper.urlToParams(e),a=U.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[page]"])),r=parseInt(a),n=isNaN(r)?1:r;let o=parseInt(U.removeXSSRiskyTags(s[this.routeName+"[itemsPerPage]"]));return isNaN(o)&&(o=10),{query:U.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[query]"]))||"",page:n,itemsPerPage:t??o,order:U.removeXSSRiskyTags(s[this.routeName+"[order]"])||"",facets:this.extractArrayOfFacetsFromQueryParameters(s)||[],model:U.removeXSSRiskyTags(s[this.routeName+"[model]"])||"",location:{address:U.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][address]"]||"")),radius:U.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][radius]"]||"")),lat:U.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lat]"]||"")),lon:U.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lon]"]||""))}}}}class rr{routeName="";constructor(e){this.routeName=e}stringify=(e,t)=>{const s=this.filterOutIgnoredKeys(e,t.ignoredKeys);return Object.keys(s).map(a=>{const r=s[a];return Array.isArray(r)?r.map(n=>`${a}=${n}`).join("&"):`${a}=${r}`}).join("&")};filterOutIgnoredKeys(e,t){const s=t||[],a={};return Object.keys(e).forEach(r=>{s.includes(r)||e[r]!==""&&(a[r]=e[r])}),a}urlToParams(e){const t={},s=e.split("?")[1];return s&&s.split("&").forEach(a=>{const[r,n]=a.split("=");t[r]=n}),t}doesParamContainRouteName(e){return e.indexOf(this.routeName)!==-1}urlHasQueryParams(e){return e.indexOf("?")!==-1}}const ze={question:"I_AM_A_QUESTION",notQuestion:"I_AM_NOT_A_QUESTION",close:"CLOSE"};class vs 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 Es=10,nr=13,Ee=32;function ha(i){}function or(i){if(typeof i=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=ha,onError:t=ha,onRetry:s=ha,onComment:a}=i,r=[];let n=!0,o,l="",h=0,m;function L(g){if(n&&(n=!1,g.charCodeAt(0)===239&&g.charCodeAt(1)===187&&g.charCodeAt(2)===191&&(g=g.slice(3))),r.length===0){const b=M(g);b!==""&&r.push(b);return}if(g.indexOf(`
|
|
58
58
|
`)===-1&&g.indexOf("\r")===-1){r.push(g);return}r.push(g);const d=r.join("");r.length=0;const y=M(d);y!==""&&r.push(y)}function M(g){let d=0;if(g.indexOf("\r")===-1){let y=g.indexOf(`
|
|
59
59
|
`,d);for(;y!==-1;){if(d===y){h>0&&e({id:o,event:m,data:l}),o=void 0,l="",h=0,m=void 0,d=y+1,y=g.indexOf(`
|
|
60
60
|
`,d);continue}const b=g.charCodeAt(d);if(Is(g,d,b)){const A=g.charCodeAt(d+5)===Ee?d+6:d+5,F=g.slice(A,y);if(h===0&&g.charCodeAt(y+1)===Es){e({id:o,event:m,data:F}),o=void 0,l="",m=void 0,d=y+2,y=g.indexOf(`
|
|
@@ -63,7 +63,7 @@ ${F}`,h++}else Ds(g,d,b)?m=g.slice(g.charCodeAt(d+6)===Ee?d+7:d+6,y)||void 0:I(g
|
|
|
63
63
|
`,d)}return g.slice(d)}for(;d<g.length;){const y=g.indexOf("\r",d),b=g.indexOf(`
|
|
64
64
|
`,d);let A=-1;if(y!==-1&&b!==-1?A=y<b?y:b:y!==-1?y===g.length-1?A=-1:A=y:b!==-1&&(A=b),A===-1)break;I(g,d,A),d=A+1,g.charCodeAt(d-1)===nr&&g.charCodeAt(d)===Es&&d++}return g.slice(d)}function I(g,d,y){if(d===y){S();return}const b=g.charCodeAt(d);if(Is(g,d,b)){const we=g.charCodeAt(d+5)===Ee?d+6:d+5,B=g.slice(we,y);l=h===0?B:`${l}
|
|
65
65
|
${B}`,h++;return}if(Ds(g,d,b)){m=g.slice(g.charCodeAt(d+6)===Ee?d+7:d+6,y)||void 0;return}if(b===105&&g.charCodeAt(d+1)===100&&g.charCodeAt(d+2)===58){const we=g.slice(g.charCodeAt(d+3)===Ee?d+4:d+3,y);o=we.includes("\0")?void 0:we;return}if(b===58){if(a){const we=g.slice(d,y);a(we.slice(g.charCodeAt(d+1)===Ee?2:1))}return}const A=g.slice(d,y),F=A.indexOf(":");if(F===-1){k(A,"",A);return}const oe=A.slice(0,F),ie=A.charCodeAt(F+1)===Ee?2:1,jt=A.slice(F+ie);k(oe,jt,A)}function k(g,d,y){switch(g){case"event":m=d||void 0;break;case"data":l=h===0?d:`${l}
|
|
66
|
-
${d}`,h++;break;case"id":o=d.includes("\0")?void 0:d;break;case"retry":/^\d+$/.test(d)?s(parseInt(d,10)):t(new vs(`Invalid \`retry\` value: "${d}"`,{type:"invalid-retry",value:d,line:y}));break;default:t(new vs(`Unknown field "${g.length>20?`${g.slice(0,20)}\u2026`:g}"`,{type:"unknown-field",field:g,value:d,line:y}));break}}function S(){h>0&&e({id:o,event:m,data:l}),o=void 0,l="",h=0,m=void 0}function Q(g={}){if(g.consume&&r.length>0){const d=r.join("");I(d,0,d.length)}n=!0,o=void 0,l="",h=0,m=void 0,r.length=0}return{feed:L,reset:Q}}function Is(i,e,t){return t===100&&i.charCodeAt(e+1)===97&&i.charCodeAt(e+2)===116&&i.charCodeAt(e+3)===97&&i.charCodeAt(e+4)===58}function Ds(i,e,t){return t===101&&i.charCodeAt(e+1)===118&&i.charCodeAt(e+2)===101&&i.charCodeAt(e+3)===110&&i.charCodeAt(e+4)===116&&i.charCodeAt(e+5)===58}class js 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(Rs(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e(Rs(this),t)}}function cr(i){const e=globalThis.DOMException;return typeof e=="function"?new e(i,"SyntaxError"):new SyntaxError(i)}function ua(i){return i instanceof Error?"errors"in i&&Array.isArray(i.errors)?i.errors.map(ua).join(", "):"cause"in i&&i.cause instanceof Error?`${i}: ${ua(i.cause)}`:i.message:`${i}`}function Rs(i){return{type:i.type,message:i.message,code:i.code,defaultPrevented:i.defaultPrevented,cancelable:i.cancelable,timeStamp:i.timeStamp}}var Ns=i=>{throw TypeError(i)},da=(i,e,t)=>e.has(i)||Ns("Cannot "+t),x=(i,e,t)=>(da(i,e,"read from private field"),t?t.call(i):e.get(i)),_=(i,e,t)=>e.has(i)?Ns("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),j=(i,e,t,s)=>(da(i,e,"write to private field"),e.set(i,t),t),Le=(i,e,t)=>(da(i,e,"access private method"),t),se,Ie,$e,Et,It,nt,_e,ot,be,Ve,Qe,Be,ct,ce,ga,pa,ma,Os,fa,La,lt,ya,wa;class Dt extends EventTarget{constructor(e,t){var s,a;super(),_(this,ce),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,_(this,se),_(this,Ie),_(this,$e),_(this,Et),_(this,It),_(this,nt),_(this,_e),_(this,ot,null),_(this,be),_(this,Ve),_(this,Qe,null),_(this,Be,null),_(this,ct,null),_(this,pa,async r=>{var n;x(this,Ve).reset();const{body:o,redirected:l,status:h,headers:m}=r;if(h===204){Le(this,ce,lt).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?j(this,$e,new URL(r.url)):j(this,$e,void 0),h!==200){Le(this,ce,lt).call(this,`Non-200 status code (${h})`,h);return}if(!(m.get("content-type")||"").startsWith("text/event-stream")){Le(this,ce,lt).call(this,'Invalid content type, expected "text/event-stream"',h);return}if(x(this,se)===this.CLOSED)return;j(this,se,this.OPEN);const L=new Event("open");if((n=x(this,ct))==null||n.call(this,L),this.dispatchEvent(L),typeof o!="object"||!o||!("getReader"in o)){Le(this,ce,lt).call(this,"Invalid response body, expected a web ReadableStream",h),this.close();return}const M=new TextDecoder,I=o.getReader();let k=!0;do{const{done:S,value:Q}=await I.read();Q&&x(this,Ve).feed(M.decode(Q,{stream:!S})),S&&(k=!1,x(this,Ve).reset(),Le(this,ce,ya).call(this))}while(k)}),_(this,ma,r=>{j(this,be,void 0),!(r.name==="AbortError"||r.type==="aborted")&&Le(this,ce,ya).call(this,ua(r))}),_(this,fa,r=>{typeof r.id=="string"&&j(this,ot,r.id);const n=new MessageEvent(r.event||"message",{data:r.data,origin:x(this,$e)?x(this,$e).origin:x(this,Ie).origin,lastEventId:r.id||""});x(this,Be)&&(!r.event||r.event==="message")&&x(this,Be).call(this,n),this.dispatchEvent(n)}),_(this,La,r=>{j(this,nt,r)}),_(this,wa,()=>{j(this,_e,void 0),x(this,se)===this.CONNECTING&&Le(this,ce,ga).call(this)});try{if(e instanceof URL)j(this,Ie,e);else if(typeof e=="string")j(this,Ie,new URL(e,lr()));else throw new Error("Invalid URL")}catch{throw cr("An invalid or illegal string was specified")}j(this,Ve,or({onEvent:x(this,fa),onRetry:x(this,La)})),j(this,se,this.CONNECTING),j(this,nt,3e3),j(this,It,(s=t?.fetch)!=null?s:globalThis.fetch),j(this,Et,(a=t?.withCredentials)!=null?a:!1),Le(this,ce,ga).call(this)}get readyState(){return x(this,se)}get url(){return x(this,Ie).href}get withCredentials(){return x(this,Et)}get onerror(){return x(this,Qe)}set onerror(e){j(this,Qe,e)}get onmessage(){return x(this,Be)}set onmessage(e){j(this,Be,e)}get onopen(){return x(this,ct)}set onopen(e){j(this,ct,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(){x(this,_e)&&clearTimeout(x(this,_e)),x(this,se)!==this.CLOSED&&(x(this,be)&&x(this,be).abort(),j(this,se,this.CLOSED),j(this,be,void 0))}}se=new WeakMap,Ie=new WeakMap,$e=new WeakMap,Et=new WeakMap,It=new WeakMap,nt=new WeakMap,_e=new WeakMap,ot=new WeakMap,be=new WeakMap,Ve=new WeakMap,Qe=new WeakMap,Be=new WeakMap,ct=new WeakMap,ce=new WeakSet,ga=function(){j(this,se,this.CONNECTING),j(this,be,new AbortController),x(this,It)(x(this,Ie),Le(this,ce,Os).call(this)).then(x(this,pa)).catch(x(this,ma))},pa=new WeakMap,ma=new WeakMap,Os=function(){var i;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...x(this,ot)?{"Last-Event-ID":x(this,ot)}:void 0},cache:"no-store",signal:(i=x(this,be))==null?void 0:i.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},fa=new WeakMap,La=new WeakMap,lt=function(i,e){var t;x(this,se)!==this.CLOSED&&j(this,se,this.CLOSED);const s=new js("error",{code:e,message:i});(t=x(this,Qe))==null||t.call(this,s),this.dispatchEvent(s)},ya=function(i,e){var t;if(x(this,se)===this.CLOSED)return;j(this,se,this.CONNECTING);const s=new js("error",{code:e,message:i});(t=x(this,Qe))==null||t.call(this,s),this.dispatchEvent(s),j(this,_e,setTimeout(x(this,wa),x(this,nt)))},wa=new WeakMap,Dt.CONNECTING=0,Dt.OPEN=1,Dt.CLOSED=2;function lr(){const i="document"in globalThis?globalThis.document:void 0;return i&&typeof i=="object"&&"baseURI"in i&&typeof i.baseURI=="string"?i.baseURI:void 0}class ye{static subscribedToClickEvent=!1;static attachAnalyticsScript(e){window._msq=window._msq||[];const t=e||"https://static.searchstax.com/studio-js/v4/js/studio-analytics.js";if(!document.querySelector(`script[src="${t}"]`)){var s=document.createElement("script");s.type="text/javascript",s.src=t;var a=document.getElementsByTagName("script")[0];a.parentNode&&a.parentNode.insertBefore(s,a)}}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 r=["trackClick",t];t.key?this.msq().push(r,(function(n,o){JSON.stringify(n)===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 r=["answerSourceClick",t];t.key?this.msq().push(r,(function(n,o){JSON.stringify(n)===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 hr{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 r=a.name+':"'+a.value+'"';s=s.concat("fq="+decodeURIComponent(r).replace(" "," "))});else{const a={};e.forEach(function(n){const o=n.name+":"+n.value,l=decodeURIComponent(o).replace(" "," ").split(":");a[l[0]]?a[l[0]].push(l[1]):a[l[0]]=[l[1]]});let r="";for(const n in a)if(Object.prototype.hasOwnProperty.call(a,n)){const o=a[n],l=n;for(const h of o)r+=r===""?` ${l}:"${h}"`:` OR ${l}:"${h}"`}s=s.concat("fq="+r.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 r=new Headers;r.append("Accept","application/json"),r.append("Authorization",s),fetch(t+"?search="+encodeURIComponent(e.query)+"&language="+this.dataLayer.language,{method:"GET",headers:r,credentials:"same-origin"}).then(n=>n.json()).then(n=>{a(n)})}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=rt.extractFacets(e);t?this.dataLayer.setSearchFacetsCachedTabs(s):this.dataLayer.setSearchFacetsCached(s),this.resolveFn&&this.resolveFn()}search(e,t,s=!1,a=!1,r=!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 n=this.url+this.generateQueryParams(e,a),o={method:"GET",headers:this.authHeader,credentials:"same-origin",signal:this.signalSearch};s&&delete o.signal,fetch(n,o).then(l=>l.json()).then(l=>{this.dataLayer.setLoading(!1),t(l,r)}).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 r=new Proxy(new URLSearchParams(window?.location.search??""),{get:(l,h)=>l.get(h)??""}),n=r.languageVariant?"&fq=_language:"+r.languageVariant:"",o=e.model??this.dataLayer.model;return"?q="+encodeURIComponent(e.query.trim())+"&start="+s+this.toQueryString(e.additionalProps??[])+this.generateFacetQuery(e.facets.filter(l=>l.type==="or"||l.type==="showUnavailable"),!0)+this.generateLocationQuery(e.location)+this.generateFacetQuery(e.facets.filter(l=>l.type==="and"||l.type==="tabs"),!1)+a+`&spellcheck.correct=${this.dataLayer.autoCorrect&&!t}`+(o?`&model=${o}`:"")+"&language="+this.dataLayer.language+n}startSSE(e,t){if(!this.dataLayer.turnAIAnswerGenerationOn||e==="*"||this.dataLayer.searchObject.page!==1)return;const s=new Dt(this.dataLayer.questionURL+this.generateQueryParams(this.dataLayer.searchObject),{fetch:(r,n)=>fetch(r,{...n,headers:{...n?.headers,Authorization:this._authToken}})}),a=this.dataLayer;return s.onmessage=r=>{if(r.data===ze.question||r.data===ze.notQuestion){r.data===ze.question?(this.dataLayer.setAnswerLoading(!0),this.dataLayer.setIsQuestion(!0)):(a.setAnswerLoading(!1),this.dataLayer.setIsQuestion(!1)),a.setAnswerData("");return}if(r.data===ze.close){ye.trackAnswerData({...a.parsedData.trackingData,answer:a.$answer.getValue(),isQuestion:this.dataLayer.isQuestion}),a.setAnswerLoading(!1),s.close();return}if(r.data.indexOf("[!CAUTION]")!==-1){a.setAnswerError(!0),a.setAnswerErrorMessage("We're having trouble generating an answer. Please try again."),s.close();return}if(r.data.indexOf("[comment]: <> ({")!==-1)try{const n=r.data.split("[comment]: <> ({");if(n.length<2){t(r.data);return}const o=n[1].split("})");if(o.length<2){t(r.data);return}const l=o[0],h=JSON.parse("{"+l+"}");this.dataLayer.answerWidgetShowMoreLimit=h.displayShowMoreAfter,h.showMoreEnabled||(this.dataLayer.answerWidgetShowMoreLimit=1e17);const m=o.slice(1).join("})");t(m)}catch{t(r.data)}else t(r.data)},s.addEventListener("error",r=>{(r.code===401||r.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(r=>r.json()).then(r=>{t(r)}).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 ur=Object.prototype.toString,He=Array.isArray||function(i){return ur.call(i)==="[object Array]"};function Ma(i){return typeof i=="function"}function dr(i){return He(i)?"array":typeof i}function Ca(i){return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ps(i,e){return i!=null&&typeof i=="object"&&e in i}function gr(i,e){return i!=null&&typeof i!="object"&&i.hasOwnProperty&&i.hasOwnProperty(e)}var pr=RegExp.prototype.test;function mr(i,e){return pr.call(i,e)}var fr=/\S/;function Lr(i){return!mr(fr,i)}var yr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function wr(i){return String(i).replace(/[&<>"'`=\/]/g,function(e){return yr[e]})}var Mr=/\s*/,Cr=/\s+/,Fs=/\s*=/,br=/\s*\}/,Sr=/#|\^|\/|>|\{|&|=|!/;function xr(i,e){if(!i)return[];var t=!1,s=[],a=[],r=[],n=!1,o=!1,l="",h=0;function m(){if(n&&!o)for(;r.length;)delete a[r.pop()];else r=[];n=!1,o=!1}var L,M,I;function k(ie){if(typeof ie=="string"&&(ie=ie.split(Cr,2)),!He(ie)||ie.length!==2)throw new Error("Invalid tags: "+ie);L=new RegExp(Ca(ie[0])+"\\s*"),M=new RegExp("\\s*"+Ca(ie[1])),I=new RegExp("\\s*"+Ca("}"+ie[1]))}k(e||T.tags);for(var S=new ht(i),Q,g,d,y,b,A;!S.eos();){if(Q=S.pos,d=S.scanUntil(L),d)for(var F=0,oe=d.length;F<oe;++F)y=d.charAt(F),Lr(y)?(r.push(a.length),l+=y):(o=!0,t=!0,l+=" "),a.push(["text",y,Q,Q+1]),Q+=1,y===`
|
|
66
|
+
${d}`,h++;break;case"id":o=d.includes("\0")?void 0:d;break;case"retry":/^\d+$/.test(d)?s(parseInt(d,10)):t(new vs(`Invalid \`retry\` value: "${d}"`,{type:"invalid-retry",value:d,line:y}));break;default:t(new vs(`Unknown field "${g.length>20?`${g.slice(0,20)}\u2026`:g}"`,{type:"unknown-field",field:g,value:d,line:y}));break}}function S(){h>0&&e({id:o,event:m,data:l}),o=void 0,l="",h=0,m=void 0}function Q(g={}){if(g.consume&&r.length>0){const d=r.join("");I(d,0,d.length)}n=!0,o=void 0,l="",h=0,m=void 0,r.length=0}return{feed:L,reset:Q}}function Is(i,e,t){return t===100&&i.charCodeAt(e+1)===97&&i.charCodeAt(e+2)===116&&i.charCodeAt(e+3)===97&&i.charCodeAt(e+4)===58}function Ds(i,e,t){return t===101&&i.charCodeAt(e+1)===118&&i.charCodeAt(e+2)===101&&i.charCodeAt(e+3)===110&&i.charCodeAt(e+4)===116&&i.charCodeAt(e+5)===58}class js 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(Rs(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e(Rs(this),t)}}function cr(i){const e=globalThis.DOMException;return typeof e=="function"?new e(i,"SyntaxError"):new SyntaxError(i)}function ua(i){return i instanceof Error?"errors"in i&&Array.isArray(i.errors)?i.errors.map(ua).join(", "):"cause"in i&&i.cause instanceof Error?`${i}: ${ua(i.cause)}`:i.message:`${i}`}function Rs(i){return{type:i.type,message:i.message,code:i.code,defaultPrevented:i.defaultPrevented,cancelable:i.cancelable,timeStamp:i.timeStamp}}var Ns=i=>{throw TypeError(i)},da=(i,e,t)=>e.has(i)||Ns("Cannot "+t),x=(i,e,t)=>(da(i,e,"read from private field"),t?t.call(i):e.get(i)),_=(i,e,t)=>e.has(i)?Ns("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),j=(i,e,t,s)=>(da(i,e,"write to private field"),e.set(i,t),t),Le=(i,e,t)=>(da(i,e,"access private method"),t),se,Ie,$e,Et,It,nt,_e,ot,be,Ve,Qe,Be,ct,ce,ga,pa,ma,Os,fa,La,lt,ya,wa;class Dt extends EventTarget{constructor(e,t){var s,a;super(),_(this,ce),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,_(this,se),_(this,Ie),_(this,$e),_(this,Et),_(this,It),_(this,nt),_(this,_e),_(this,ot,null),_(this,be),_(this,Ve),_(this,Qe,null),_(this,Be,null),_(this,ct,null),_(this,pa,async r=>{var n;x(this,Ve).reset();const{body:o,redirected:l,status:h,headers:m}=r;if(h===204){Le(this,ce,lt).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?j(this,$e,new URL(r.url)):j(this,$e,void 0),h!==200){Le(this,ce,lt).call(this,`Non-200 status code (${h})`,h);return}if(!(m.get("content-type")||"").startsWith("text/event-stream")){Le(this,ce,lt).call(this,'Invalid content type, expected "text/event-stream"',h);return}if(x(this,se)===this.CLOSED)return;j(this,se,this.OPEN);const L=new Event("open");if((n=x(this,ct))==null||n.call(this,L),this.dispatchEvent(L),typeof o!="object"||!o||!("getReader"in o)){Le(this,ce,lt).call(this,"Invalid response body, expected a web ReadableStream",h),this.close();return}const M=new TextDecoder,I=o.getReader();let k=!0;do{const{done:S,value:Q}=await I.read();Q&&x(this,Ve).feed(M.decode(Q,{stream:!S})),S&&(k=!1,x(this,Ve).reset(),Le(this,ce,ya).call(this))}while(k)}),_(this,ma,r=>{j(this,be,void 0),!(r.name==="AbortError"||r.type==="aborted")&&Le(this,ce,ya).call(this,ua(r))}),_(this,fa,r=>{typeof r.id=="string"&&j(this,ot,r.id);const n=new MessageEvent(r.event||"message",{data:r.data,origin:x(this,$e)?x(this,$e).origin:x(this,Ie).origin,lastEventId:r.id||""});x(this,Be)&&(!r.event||r.event==="message")&&x(this,Be).call(this,n),this.dispatchEvent(n)}),_(this,La,r=>{j(this,nt,r)}),_(this,wa,()=>{j(this,_e,void 0),x(this,se)===this.CONNECTING&&Le(this,ce,ga).call(this)});try{if(e instanceof URL)j(this,Ie,e);else if(typeof e=="string")j(this,Ie,new URL(e,lr()));else throw new Error("Invalid URL")}catch{throw cr("An invalid or illegal string was specified")}j(this,Ve,or({onEvent:x(this,fa),onRetry:x(this,La)})),j(this,se,this.CONNECTING),j(this,nt,3e3),j(this,It,(s=t?.fetch)!=null?s:globalThis.fetch),j(this,Et,(a=t?.withCredentials)!=null?a:!1),Le(this,ce,ga).call(this)}get readyState(){return x(this,se)}get url(){return x(this,Ie).href}get withCredentials(){return x(this,Et)}get onerror(){return x(this,Qe)}set onerror(e){j(this,Qe,e)}get onmessage(){return x(this,Be)}set onmessage(e){j(this,Be,e)}get onopen(){return x(this,ct)}set onopen(e){j(this,ct,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(){x(this,_e)&&clearTimeout(x(this,_e)),x(this,se)!==this.CLOSED&&(x(this,be)&&x(this,be).abort(),j(this,se,this.CLOSED),j(this,be,void 0))}}se=new WeakMap,Ie=new WeakMap,$e=new WeakMap,Et=new WeakMap,It=new WeakMap,nt=new WeakMap,_e=new WeakMap,ot=new WeakMap,be=new WeakMap,Ve=new WeakMap,Qe=new WeakMap,Be=new WeakMap,ct=new WeakMap,ce=new WeakSet,ga=function(){j(this,se,this.CONNECTING),j(this,be,new AbortController),x(this,It)(x(this,Ie),Le(this,ce,Os).call(this)).then(x(this,pa)).catch(x(this,ma))},pa=new WeakMap,ma=new WeakMap,Os=function(){var i;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...x(this,ot)?{"Last-Event-ID":x(this,ot)}:void 0},cache:"no-store",signal:(i=x(this,be))==null?void 0:i.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},fa=new WeakMap,La=new WeakMap,lt=function(i,e){var t;x(this,se)!==this.CLOSED&&j(this,se,this.CLOSED);const s=new js("error",{code:e,message:i});(t=x(this,Qe))==null||t.call(this,s),this.dispatchEvent(s)},ya=function(i,e){var t;if(x(this,se)===this.CLOSED)return;j(this,se,this.CONNECTING);const s=new js("error",{code:e,message:i});(t=x(this,Qe))==null||t.call(this,s),this.dispatchEvent(s),j(this,_e,setTimeout(x(this,wa),x(this,nt)))},wa=new WeakMap,Dt.CONNECTING=0,Dt.OPEN=1,Dt.CLOSED=2;function lr(){const i="document"in globalThis?globalThis.document:void 0;return i&&typeof i=="object"&&"baseURI"in i&&typeof i.baseURI=="string"?i.baseURI:void 0}class ye{static subscribedToClickEvent=!1;static attachAnalyticsScript(e){window._msq=window._msq||[];const t=e||"https://static.searchstax.com/studio-js/v4/js/studio-analytics.js";if(!document.querySelector(`script[src="${t}"]`)){var s=document.createElement("script");s.type="text/javascript",s.src=t;var a=document.getElementsByTagName("script")[0];a.parentNode&&a.parentNode.insertBefore(s,a)}}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 r=["trackClick",t];t.key?this.msq().push(r,(function(n,o){JSON.stringify(n)===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 r=["answerSourceClick",t];t.key?this.msq().push(r,(function(n,o){JSON.stringify(n)===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 hr{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 r=a.name+':"'+a.value+'"';s=s.concat("fq="+decodeURIComponent(r).replace(" "," "))});else{const a={};e.forEach(function(n){const o=n.name+":"+n.value,l=decodeURIComponent(o).replace(" "," ").split(":");a[l[0]]?a[l[0]].push(l[1]):a[l[0]]=[l[1]]});let r="";for(const n in a)if(Object.prototype.hasOwnProperty.call(a,n)){const o=a[n],l=n;for(const h of o)r+=r===""?` ${l}:"${h}"`:` OR ${l}:"${h}"`}s=s.concat("fq="+r.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 r=new Headers;r.append("Accept","application/json"),r.append("Authorization",s),fetch(t+"?search="+encodeURIComponent(e.query)+"&language="+this.dataLayer.language,{method:"GET",headers:r,credentials:"same-origin"}).then(n=>n.json()).then(n=>{a(n)})}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=rt.extractFacets(e);t?this.dataLayer.setSearchFacetsCachedTabs(s):this.dataLayer.setSearchFacetsCached(s),this.resolveFn&&this.resolveFn()}search(e,t,s=!1,a=!1,r=!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 n=this.url+this.generateQueryParams(e,a),o={method:"GET",headers:this.authHeader,credentials:"same-origin",signal:this.signalSearch};s&&delete o.signal,fetch(n,o).then(l=>l.json()).then(l=>{this.dataLayer.setLoading(!1),t(l,r)}).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 r=e.itemsPerPage!==void 0?`&rows=${e.itemsPerPage}`:"",n=new Proxy(new URLSearchParams(window?.location.search??""),{get:(h,m)=>h.get(m)??""}),o=n.languageVariant?"&fq=_language:"+n.languageVariant:"",l=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+r+`&spellcheck.correct=${this.dataLayer.autoCorrect&&!t}`+(l?`&model=${l}`:"")+"&language="+this.dataLayer.language+o}startSSE(e,t){if(!this.dataLayer.turnAIAnswerGenerationOn||e==="*"||this.dataLayer.searchObject.page!==1)return;const s=new Dt(this.dataLayer.questionURL+this.generateQueryParams(this.dataLayer.searchObject),{fetch:(r,n)=>fetch(r,{...n,headers:{...n?.headers,Authorization:this._authToken}})}),a=this.dataLayer;return s.onmessage=r=>{if(r.data===ze.question||r.data===ze.notQuestion){r.data===ze.question?(this.dataLayer.setAnswerLoading(!0),this.dataLayer.setIsQuestion(!0)):(a.setAnswerLoading(!1),this.dataLayer.setIsQuestion(!1)),a.setAnswerData("");return}if(r.data===ze.close){ye.trackAnswerData({...a.parsedData.trackingData,answer:a.$answer.getValue(),isQuestion:this.dataLayer.isQuestion}),a.setAnswerLoading(!1),s.close();return}if(r.data.indexOf("[!CAUTION]")!==-1){a.setAnswerError(!0),a.setAnswerErrorMessage("We're having trouble generating an answer. Please try again."),s.close();return}if(r.data.indexOf("[comment]: <> ({")!==-1)try{const n=r.data.split("[comment]: <> ({");if(n.length<2){t(r.data);return}const o=n[1].split("})");if(o.length<2){t(r.data);return}const l=o[0],h=JSON.parse("{"+l+"}");this.dataLayer.answerWidgetShowMoreLimit=h.displayShowMoreAfter,h.showMoreEnabled||(this.dataLayer.answerWidgetShowMoreLimit=1e17);const m=o.slice(1).join("})");t(m)}catch{t(r.data)}else t(r.data)},s.addEventListener("error",r=>{(r.code===401||r.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(r=>r.json()).then(r=>{t(r)}).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 ur=Object.prototype.toString,He=Array.isArray||function(i){return ur.call(i)==="[object Array]"};function Ma(i){return typeof i=="function"}function dr(i){return He(i)?"array":typeof i}function Ca(i){return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ps(i,e){return i!=null&&typeof i=="object"&&e in i}function gr(i,e){return i!=null&&typeof i!="object"&&i.hasOwnProperty&&i.hasOwnProperty(e)}var pr=RegExp.prototype.test;function mr(i,e){return pr.call(i,e)}var fr=/\S/;function Lr(i){return!mr(fr,i)}var yr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function wr(i){return String(i).replace(/[&<>"'`=\/]/g,function(e){return yr[e]})}var Mr=/\s*/,Cr=/\s+/,Fs=/\s*=/,br=/\s*\}/,Sr=/#|\^|\/|>|\{|&|=|!/;function xr(i,e){if(!i)return[];var t=!1,s=[],a=[],r=[],n=!1,o=!1,l="",h=0;function m(){if(n&&!o)for(;r.length;)delete a[r.pop()];else r=[];n=!1,o=!1}var L,M,I;function k(ie){if(typeof ie=="string"&&(ie=ie.split(Cr,2)),!He(ie)||ie.length!==2)throw new Error("Invalid tags: "+ie);L=new RegExp(Ca(ie[0])+"\\s*"),M=new RegExp("\\s*"+Ca(ie[1])),I=new RegExp("\\s*"+Ca("}"+ie[1]))}k(e||T.tags);for(var S=new ht(i),Q,g,d,y,b,A;!S.eos();){if(Q=S.pos,d=S.scanUntil(L),d)for(var F=0,oe=d.length;F<oe;++F)y=d.charAt(F),Lr(y)?(r.push(a.length),l+=y):(o=!0,t=!0,l+=" "),a.push(["text",y,Q,Q+1]),Q+=1,y===`
|
|
67
67
|
`&&(m(),l="",h=0,t=!1);if(!S.scan(L))break;if(n=!0,g=S.scan(Sr)||"name",S.scan(Mr),g==="="?(d=S.scanUntil(Fs),S.scan(Fs),S.scanUntil(M)):g==="{"?(d=S.scanUntil(I),S.scan(br),S.scanUntil(M),g="&"):d=S.scanUntil(M),!S.scan(M))throw new Error("Unclosed tag at "+S.pos);if(g==">"?b=[g,d,Q,S.pos,l,h,t]:b=[g,d,Q,S.pos],h++,a.push(b),g==="#"||g==="^")s.push(b);else if(g==="/"){if(A=s.pop(),!A)throw new Error('Unopened section "'+d+'" at '+Q);if(A[1]!==d)throw new Error('Unclosed section "'+A[1]+'" at '+Q)}else g==="name"||g==="{"||g==="&"?o=!0:g==="="&&k(d)}if(m(),A=s.pop(),A)throw new Error('Unclosed section "'+A[1]+'" at '+S.pos);return Tr(kr(a))}function kr(i){for(var e=[],t,s,a=0,r=i.length;a<r;++a)t=i[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 Tr(i){for(var e=[],t=e,s=[],a,r,n=0,o=i.length;n<o;++n)switch(a=i[n],a[0]){case"#":case"^":t.push(a),s.push(a),t=a[4]=[];break;case"/":r=s.pop(),r[5]=a[2],t=s.length>0?s[s.length-1][4]:e;break;default:t.push(a)}return e}function ht(i){this.string=i,this.tail=i,this.pos=0}ht.prototype.eos=function(){return this.tail===""},ht.prototype.scan=function(i){var e=this.tail.match(i);if(!e||e.index!==0)return"";var t=e[0];return this.tail=this.tail.substring(t.length),this.pos+=t.length,t},ht.prototype.scanUntil=function(i){var e=this.tail.search(i),t;switch(e){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,e),this.tail=this.tail.substring(e)}return this.pos+=t.length,t};function qe(i,e){this.view=i,this.cache={".":this.view},this.parent=e}qe.prototype.push=function(i){return new qe(i,this)},qe.prototype.lookup=function(i){var e=this.cache,t;if(e.hasOwnProperty(i))t=e[i];else{for(var s=this,a,r,n,o=!1;s;){if(i.indexOf(".")>0)for(a=s.view,r=i.split("."),n=0;a!=null&&n<r.length;)n===r.length-1&&(o=Ps(a,r[n])||gr(a,r[n])),a=a[r[n++]];else a=s.view[i],o=Ps(s.view,i);if(o){t=a;break}s=s.parent}e[i]=t}return Ma(t)&&(t=t.call(this.view)),t};function te(){this.templateCache={_cache:{},set:function(i,e){this._cache[i]=e},get:function(i){return this._cache[i]},clear:function(){this._cache={}}}}te.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()},te.prototype.parse=function(i,e){var t=this.templateCache,s=i+":"+(e||T.tags).join(":"),a=typeof t<"u",r=a?t.get(s):void 0;return r==null&&(r=xr(i,e),a&&t.set(s,r)),r},te.prototype.render=function(i,e,t,s){var a=this.getConfigTags(s),r=this.parse(i,a),n=e instanceof qe?e:new qe(e,void 0);return this.renderTokens(r,n,t,i,s)},te.prototype.renderTokens=function(i,e,t,s,a){for(var r="",n,o,l,h=0,m=i.length;h<m;++h)l=void 0,n=i[h],o=n[0],o==="#"?l=this.renderSection(n,e,t,s,a):o==="^"?l=this.renderInverted(n,e,t,s,a):o===">"?l=this.renderPartial(n,e,t,a):o==="&"?l=this.unescapedValue(n,e):o==="name"?l=this.escapedValue(n,e,a):o==="text"&&(l=this.rawValue(n)),l!==void 0&&(r+=l);return r},te.prototype.renderSection=function(i,e,t,s,a){var r=this,n="",o=e.lookup(i[1]);function l(L){return r.render(L,e,t,a)}if(o){if(He(o))for(var h=0,m=o.length;h<m;++h)n+=this.renderTokens(i[4],e.push(o[h]),t,s,a);else if(typeof o=="object"||typeof o=="string"||typeof o=="number")n+=this.renderTokens(i[4],e.push(o),t,s,a);else if(Ma(o)){if(typeof s!="string")throw new Error("Cannot use higher-order sections without the original template");o=o.call(e.view,s.slice(i[3],i[5]),l),o!=null&&(n+=o)}else n+=this.renderTokens(i[4],e,t,s,a);return n}},te.prototype.renderInverted=function(i,e,t,s,a){var r=e.lookup(i[1]);if(!r||He(r)&&r.length===0)return this.renderTokens(i[4],e,t,s,a)},te.prototype.indentPartial=function(i,e,t){for(var s=e.replace(/[^ \t]/g,""),a=i.split(`
|
|
68
68
|
`),r=0;r<a.length;r++)a[r].length&&(r>0||!t)&&(a[r]=s+a[r]);return a.join(`
|
|
69
69
|
`)},te.prototype.renderPartial=function(i,e,t,s){if(t){var a=this.getConfigTags(s),r=Ma(t)?t(i[1]):t[i[1]];if(r!=null){var n=i[6],o=i[5],l=i[4],h=r;o==0&&l&&(h=this.indentPartial(r,l,n));var m=this.parse(h,a);return this.renderTokens(m,e,t,h,s)}}},te.prototype.unescapedValue=function(i,e){var t=e.lookup(i[1]);if(t!=null)return t},te.prototype.escapedValue=function(i,e,t){var s=this.getConfigEscape(t)||T.escape,a=e.lookup(i[1]);if(a!=null)return typeof a=="number"&&s===T.escape?String(a):s(a)},te.prototype.rawValue=function(i){return i[1]},te.prototype.getConfigTags=function(i){return He(i)?i:i&&typeof i=="object"?i.tags:void 0},te.prototype.getConfigEscape=function(i){if(i&&typeof i=="object"&&!He(i))return i.escape};var T={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(i){ut.templateCache=i},get templateCache(){return ut.templateCache}},ut=new te;T.clearCache=function(){return ut.clearCache()},T.parse=function(i,e){return ut.parse(i,e)},T.render=function(i,e,t,s){if(typeof i!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+dr(i)+'" was given as the first argument for mustache#render(template, view, partials)');return ut.render(i,e,t,s)},T.escape=wr,T.Scanner=ht,T.Context=qe,T.Writer=te;const Ar={main:{template:`
|