@searchstax-inc/searchstudio-ux-react 2.0.0 → 4.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/README.md +41 -5
- package/README.mustache +39 -5
- package/dist/@searchstax-inc/components/SearchstaxAnswerWidget.d.ts +1 -1
- package/dist/@searchstax-inc/components/SearchstaxResultWidget.d.ts +1 -0
- package/dist/@searchstax-inc/searchstudio-ux-react.cjs +52 -62
- package/dist/@searchstax-inc/searchstudio-ux-react.iife.js +59 -69
- package/dist/@searchstax-inc/searchstudio-ux-react.mjs +1814 -2140
- package/package.json +9 -6
|
@@ -1,79 +1,69 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(ue,j){"use strict";var Jt={exports:{}},at={};/**
|
|
2
2
|
* @license React
|
|
3
|
-
* react-jsx-runtime.production.
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var za;function Bs(){if(za)return at;za=1;var i=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(s,a,r){var o=null;if(r!==void 0&&(o=""+r),a.key!==void 0&&(o=""+a.key),"key"in a){r={};for(var n in a)n!=="key"&&(r[n]=a[n])}else r=a;return a=r.ref,{$$typeof:i,type:s,key:o,ref:a!==void 0?a:null,props:r}}return at.Fragment=e,at.jsx=t,at.jsxs=t,at}var st={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
13
|
-
* Copyright (c)
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+tt+g}}var st=!1,it;{var fa=typeof WeakMap=="function"?WeakMap:Map;it=new fa}function Oe(g,w){if(!g||st)return"";{var M=it.get(g);if(M!==void 0)return M}var I;st=!0;var $=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var B;B=Ne.current,Ne.current=null,ma();try{if(w){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(J){I=J}Reflect.construct(g,[],z)}else{try{z.call()}catch(J){I=J}g.call(z.prototype)}}else{try{throw Error()}catch(J){I=J}g()}}catch(J){if(J&&I&&typeof J.stack=="string"){for(var h=J.stack.split(`
|
|
19
|
-
`),b=I.stack.split(`
|
|
20
|
-
`),v=h.length-1,E=b.length-1;v>=1&&E>=0&&h[v]!==b[E];)E--;for(;v>=1&&E>=0;v--,E--)if(h[v]!==b[E]){if(v!==1||E!==1)do if(v--,E--,E<0||h[v]!==b[E]){var H=`
|
|
21
|
-
`+h[v].replace(" at new "," at ");return g.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",g.displayName)),typeof g=="function"&&it.set(g,H),H}while(v>=1&&E>=0);break}}}finally{st=!1,Ne.current=B,K(),Error.prepareStackTrace=$}var Y=g?g.displayName||g.name:"",ce=Y?at(Y):"";return typeof g=="function"&&it.set(g,ce),ce}function ft(g,w,M){return Oe(g,!1)}function Pe(g){var w=g.prototype;return!!(w&&w.isReactComponent)}function Be(g,w,M){if(g==null)return"";if(typeof g=="function")return Oe(g,Pe(g));if(typeof g=="string")return at(g);switch(g){case c:return at("Suspense");case p:return at("SuspenseList")}if(typeof g=="object")switch(g.$$typeof){case l:return ft(g.render);case f:return Be(g.type,w,M);case m:{var I=g,$=I._payload,B=I._init;try{return Be(B($),w,M)}catch{}}}return""}var Fe=Object.prototype.hasOwnProperty,ze={},rt=j.ReactDebugCurrentFrame;function _e(g){if(g){var w=g._owner,M=Be(g.type,g._source,w?w.type:null);rt.setExtraStackFrame(M)}else rt.setExtraStackFrame(null)}function La(g,w,M,I,$){{var B=Function.call.bind(Fe);for(var z in g)if(B(g,z)){var h=void 0;try{if(typeof g[z]!="function"){var b=Error((I||"React class")+": "+M+" type `"+z+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof g[z]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw b.name="Invariant Violation",b}h=g[z](w,z,I,M,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(v){h=v}h&&!(h instanceof Error)&&(_e($),T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",I||"React class",M,z,typeof h),_e(null)),h instanceof Error&&!(h.message in ze)&&(ze[h.message]=!0,_e($),T("Failed %s type: %s",M,h.message),_e(null))}}}var ya=Array.isArray;function Qt(g){return ya(g)}function Ut(g){{var w=typeof Symbol=="function"&&Symbol.toStringTag,M=w&&g[Symbol.toStringTag]||g.constructor.name||"Object";return M}}function nt(g){try{return $e(g),!1}catch{return!0}}function $e(g){return""+g}function We(g){if(nt(g))return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ut(g)),$e(g)}var He=j.ReactCurrentOwner,wa={key:!0,ref:!0,__self:!0,__source:!0},Bt,Lt,yt;yt={};function wt(g){if(Fe.call(g,"ref")){var w=Object.getOwnPropertyDescriptor(g,"ref").get;if(w&&w.isReactWarning)return!1}return g.ref!==void 0}function vt(g){if(Fe.call(g,"key")){var w=Object.getOwnPropertyDescriptor(g,"key").get;if(w&&w.isReactWarning)return!1}return g.key!==void 0}function ke(g,w){if(typeof g.ref=="string"&&He.current&&w&&He.current.stateNode!==w){var M=le(He.current.type);yt[M]||(T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',le(He.current.type),g.ref),yt[M]=!0)}}function Ye(g,w){{var M=function(){Bt||(Bt=!0,T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",w))};M.isReactWarning=!0,Object.defineProperty(g,"key",{get:M,configurable:!0})}}function Ht(g,w){{var M=function(){Lt||(Lt=!0,T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",w))};M.isReactWarning=!0,Object.defineProperty(g,"ref",{get:M,configurable:!0})}}var Yt=function(g,w,M,I,$,B,z){var h={$$typeof:e,type:g,key:w,ref:M,props:z,_owner:B};return h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(h,"_self",{configurable:!1,enumerable:!1,writable:!1,value:I}),Object.defineProperty(h,"_source",{configurable:!1,enumerable:!1,writable:!1,value:$}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h};function is(g,w,M,I,$){{var B,z={},h=null,b=null;M!==void 0&&(We(M),h=""+M),vt(w)&&(We(w.key),h=""+w.key),wt(w)&&(b=w.ref,ke(w,$));for(B in w)Fe.call(w,B)&&!wa.hasOwnProperty(B)&&(z[B]=w[B]);if(g&&g.defaultProps){var v=g.defaultProps;for(B in v)z[B]===void 0&&(z[B]=v[B])}if(h||b){var E=typeof g=="function"?g.displayName||g.name||"Unknown":g;h&&Ye(z,E),b&&Ht(z,E)}return Yt(g,h,b,$,I,He.current,z)}}var qe=j.ReactCurrentOwner,ot=j.ReactDebugCurrentFrame;function Je(g){if(g){var w=g._owner,M=Be(g.type,g._source,w?w.type:null);ot.setExtraStackFrame(M)}else ot.setExtraStackFrame(null)}var Ve;Ve=!1;function qt(g){return typeof g=="object"&&g!==null&&g.$$typeof===e}function va(){{if(qe.current){var g=le(qe.current.type);if(g)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+g+"`."}return""}}function ae(g){{if(g!==void 0){var w=g.fileName.replace(/^.*[\\\/]/,""),M=g.lineNumber;return`
|
|
24
|
-
|
|
25
|
-
Check your code at `+w+":"+M+"."}return""}}var Qe={};function rs(g){{var w=va();if(!w){var M=typeof g=="string"?g:g.displayName||g.name;M&&(w=`
|
|
26
|
-
|
|
27
|
-
Check the top-level render call using <`+M+">.")}return w}}function Jt(g,w){{if(!g._store||g._store.validated||g.key!=null)return;g._store.validated=!0;var M=rs(w);if(Qe[M])return;Qe[M]=!0;var I="";g&&g._owner&&g._owner!==qe.current&&(I=" It was passed a child from "+le(g._owner.type)+"."),Je(g),T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',M,I),Je(null)}}function xt(g,w){{if(typeof g!="object")return;if(Qt(g))for(var M=0;M<g.length;M++){var I=g[M];qt(I)&&Jt(I,w)}else if(qt(g))g._store&&(g._store.validated=!0);else if(g){var $=C(g);if(typeof $=="function"&&$!==g.entries)for(var B=$.call(g),z;!(z=B.next()).done;)qt(z.value)&&Jt(z.value,w)}}}function xa(g){{var w=g.type;if(w==null||typeof w=="string")return;var M;if(typeof w=="function")M=w.propTypes;else if(typeof w=="object"&&(w.$$typeof===l||w.$$typeof===f))M=w.propTypes;else return;if(M){var I=le(w);La(M,g.props,"prop",I,g)}else if(w.PropTypes!==void 0&&!Ve){Ve=!0;var $=le(w);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",$||"Unknown")}typeof w.getDefaultProps=="function"&&!w.getDefaultProps.isReactClassApproved&&T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ba(g){{for(var w=Object.keys(g.props),M=0;M<w.length;M++){var I=w[M];if(I!=="children"&&I!=="key"){Je(g),T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",I),Je(null);break}}g.ref!==null&&(Je(g),T("Invalid attribute `ref` supplied to `React.Fragment`."),Je(null))}}var Ca={};function Ee(g,w,M,I,$,B){{var z=je(g);if(!z){var h="";(g===void 0||typeof g=="object"&&g!==null&&Object.keys(g).length===0)&&(h+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var b=ae($);b?h+=b:h+=va();var v;g===null?v="null":Qt(g)?v="array":g!==void 0&&g.$$typeof===e?(v="<"+(le(g.type)||"Unknown")+" />",h=" Did you accidentally export a JSX literal instead of a component?"):v=typeof g,T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",v,h)}var E=is(g,w,M,$,B);if(E==null)return E;if(z){var H=w.children;if(H!==void 0)if(I)if(Qt(H)){for(var Y=0;Y<H.length;Y++)xt(H[Y],g);Object.freeze&&Object.freeze(H)}else T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else xt(H,g)}if(Fe.call(w,"key")){var ce=le(g),J=Object.keys(w).filter(function(ne){return ne!=="key"}),we=J.length>0?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}";if(!Ca[ce+we]){var Kt=J.length>0?"{"+J.join(": ..., ")+": ...}":"{}";T(`A props object containing a "key" prop is being spread into JSX:
|
|
17
|
+
*/var _a;function Ys(){return _a||(_a=1,process.env.NODE_ENV!=="production"&&function(){function i(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===xe?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case f:return"Fragment";case k:return"Profiler";case x:return"StrictMode";case D:return"Suspense";case q:return"SuspenseList";case Z:return"Activity"}if(typeof y=="object")switch(typeof y.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),y.$$typeof){case w:return"Portal";case F:return(y.displayName||"Context")+".Provider";case I:return(y._context.displayName||"Context")+".Consumer";case A:var S=y.render;return y=y.displayName,y||(y=S.displayName||S.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case T:return S=y.displayName||null,S!==null?S:i(y.type)||"Memo";case _:S=y._payload,y=y._init;try{return i(y(S))}catch{}}return null}function e(y){return""+y}function t(y){try{e(y);var S=!1}catch{S=!0}if(S){S=console;var H=S.error,P=typeof Symbol=="function"&&Symbol.toStringTag&&y[Symbol.toStringTag]||y.constructor.name||"Object";return H.call(S,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",P),e(y)}}function s(y){if(y===f)return"<>";if(typeof y=="object"&&y!==null&&y.$$typeof===_)return"<...>";try{var S=i(y);return S?"<"+S+">":"<...>"}catch{return"<...>"}}function a(){var y=Q.A;return y===null?null:y.getOwner()}function r(){return Error("react-stack-top-frame")}function o(y){if(he.call(y,"key")){var S=Object.getOwnPropertyDescriptor(y,"key").get;if(S&&S.isReactWarning)return!1}return y.key!==void 0}function n(y,S){function H(){Ft||(Ft=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",S))}H.isReactWarning=!0,Object.defineProperty(y,"key",{get:H,configurable:!0})}function l(){var y=i(this.type);return zt[y]||(zt[y]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),y=this.props.ref,y!==void 0?y:null}function c(y,S,H,P,Le,z,je,Fe){return H=z.ref,y={$$typeof:L,type:y,key:S,props:z,_owner:Le},(H!==void 0?H:null)!==null?Object.defineProperty(y,"ref",{enumerable:!1,get:l}):Object.defineProperty(y,"ref",{enumerable:!1,value:null}),y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(y,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(y,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:je}),Object.defineProperty(y,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Fe}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y}function g(y,S,H,P,Le,z,je,Fe){var K=S.children;if(K!==void 0)if(P)if(Ne(K)){for(P=0;P<K.length;P++)m(K[P]);Object.freeze&&Object.freeze(K)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(K);if(he.call(S,"key")){K=i(y);var be=Object.keys(S).filter(function(Wt){return Wt!=="key"});P=0<be.length?"{key: someKey, "+be.join(": ..., ")+": ...}":"{key: someKey}",$t[K+P]||(be=0<be.length?"{"+be.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
28
18
|
let props = %s;
|
|
29
19
|
<%s {...props} />
|
|
30
20
|
React keys must be passed directly to JSX without using spread:
|
|
31
21
|
let props = %s;
|
|
32
|
-
<%s key={someKey} {...props} />`,
|
|
33
|
-
]`).replace("lheading",
|
|
22
|
+
<%s key={someKey} {...props} />`,P,K,be,K),$t[K+P]=!0)}if(K=null,H!==void 0&&(t(H),K=""+H),o(S)&&(t(S.key),K=""+S.key),"key"in S){H={};for(var qe in S)qe!=="key"&&(H[qe]=S[qe])}else H=S;return K&&n(H,typeof y=="function"?y.displayName||y.name||"Unknown":y),c(y,K,z,Le,a(),H,je,Fe)}function m(y){typeof y=="object"&&y!==null&&y.$$typeof===L&&y._store&&(y._store.validated=1)}var p=j,L=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),F=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),xe=Symbol.for("react.client.reference"),Q=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=Object.prototype.hasOwnProperty,Ne=Array.isArray,ve=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(y){return y()}};var Ft,zt={},_t=p.react_stack_bottom_frame.bind(p,r)(),xt=ve(s(r)),$t={};st.Fragment=f,st.jsx=function(y,S,H,P,Le){var z=1e4>Q.recentlyCreatedOwnerStacks++;return g(y,S,H,!1,P,Le,z?Error("react-stack-top-frame"):_t,z?ve(s(y)):xt)},st.jsxs=function(y,S,H,P,Le){var z=1e4>Q.recentlyCreatedOwnerStacks++;return g(y,S,H,!0,P,Le,z?Error("react-stack-top-frame"):_t,z?ve(s(y)):xt)}}()),st}process.env.NODE_ENV==="production"?Jt.exports=Bs():Jt.exports=Ys();var u=Jt.exports,qs=Object.defineProperty,Js=(i,e,t)=>e in i?qs(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,h=(i,e,t)=>(Js(i,typeof e!="symbol"?e+"":e,t),t),B=(i=>(i[i.mustache=0]="mustache",i[i.vue=1]="vue",i[i.react=2]="react",i[i.angular=3]="angular",i))(B||{});function Gt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var De=Gt();function $a(i){De=i}var it={exec:()=>null};function $(i,e=""){let t=typeof i=="string"?i:i.source;const s={replace:(a,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(se.caret,"$1"),t=t.replace(a,o),s},getRegex:()=>new RegExp(t,e)};return s}var se={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i")},Gs=/^(?:[ \t]*(?:\n|$))+/,Ks=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Zs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,rt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xs=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Kt=/(?:[*+-]|\d{1,9}[.)])/,Wa=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Qa=$(Wa).replace(/bull/g,Kt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ei=$(Wa).replace(/bull/g,Kt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Zt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ti=/^[^\n]+/,Xt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ai=$(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),si=$(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Kt).getRegex(),Mt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ea=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ii=$("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ea).replace("tag",Mt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Va=$(Zt).replace("hr",rt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Mt).getRegex(),ri=$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Va).getRegex(),ta={blockquote:ri,code:Ks,def:ai,fences:Zs,heading:Xs,hr:rt,html:ii,lheading:Qa,list:si,newline:Gs,paragraph:Va,table:it,text:ti},Ha=$("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",rt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Mt).getRegex(),ni={...ta,lheading:ei,table:Ha,paragraph:$(Zt).replace("hr",rt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ha).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Mt).getRegex()},oi={...ta,html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ea).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:it,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$(Zt).replace("hr",rt).replace("heading",` *#{1,6} *[^
|
|
23
|
+
]`).replace("lheading",Qa).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},li=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ci=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ua=/^( {2,}|\\)\n(?!\s*$)/,hi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ct=/[\p{P}\p{S}]/u,aa=/[\s\p{P}\p{S}]/u,Ba=/[^\s\p{P}\p{S}]/u,ui=$(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,aa).getRegex(),Ya=/(?!~)[\p{P}\p{S}]/u,di=/(?!~)[\s\p{P}\p{S}]/u,gi=/(?:[^\s\p{P}\p{S}]|~)/u,pi=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,qa=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,mi=$(qa,"u").replace(/punct/g,Ct).getRegex(),fi=$(qa,"u").replace(/punct/g,Ya).getRegex(),Ja="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Li=$(Ja,"gu").replace(/notPunctSpace/g,Ba).replace(/punctSpace/g,aa).replace(/punct/g,Ct).getRegex(),yi=$(Ja,"gu").replace(/notPunctSpace/g,gi).replace(/punctSpace/g,di).replace(/punct/g,Ya).getRegex(),wi=$("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ba).replace(/punctSpace/g,aa).replace(/punct/g,Ct).getRegex(),xi=$(/\\(punct)/,"gu").replace(/punct/g,Ct).getRegex(),vi=$(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),bi=$(ea).replace("(?:-->|$)","-->").getRegex(),Mi=$("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",bi).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),St=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ci=$(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",St).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ga=$(/^!?\[(label)\]\[(ref)\]/).replace("label",St).replace("ref",Xt).getRegex(),Ka=$(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xt).getRegex(),Si=$("reflink|nolink(?!\\()","g").replace("reflink",Ga).replace("nolink",Ka).getRegex(),sa={_backpedal:it,anyPunctuation:xi,autolink:vi,blockSkip:pi,br:Ua,code:ci,del:it,emStrongLDelim:mi,emStrongRDelimAst:Li,emStrongRDelimUnd:wi,escape:li,link:Ci,nolink:Ka,punctuation:ui,reflink:Ga,reflinkSearch:Si,tag:Mi,text:hi,url:it},ki={...sa,link:$(/^!?\[(label)\]\((.*?)\)/).replace("label",St).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",St).getRegex()},ia={...sa,emStrongRDelimAst:yi,emStrongLDelim:fi,url:$(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ti={...ia,br:$(Ua).replace("{2,}","*").getRegex(),text:$(ia.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},kt={normal:ta,gfm:ni,pedantic:oi},nt={normal:sa,gfm:ia,breaks:Ti,pedantic:ki},ji={"&":"&","<":"<",">":">",'"':""","'":"'"},Za=i=>ji[i];function we(i,e){if(e){if(se.escapeTest.test(i))return i.replace(se.escapeReplace,Za)}else if(se.escapeTestNoEncode.test(i))return i.replace(se.escapeReplaceNoEncode,Za);return i}function Xa(i){try{i=encodeURI(i).replace(se.percentDecode,"%")}catch{return null}return i}function es(i,e){var t;const s=i.replace(se.findPipe,(o,n,l)=>{let c=!1,g=n;for(;--g>=0&&l[g]==="\\";)c=!c;return c?"|":" |"}),a=s.split(se.splitPipe);let r=0;if(a[0].trim()||a.shift(),a.length>0&&!((t=a.at(-1))!=null&&t.trim())&&a.pop(),e)if(a.length>e)a.splice(e);else for(;a.length<e;)a.push("");for(;r<a.length;r++)a[r]=a[r].trim().replace(se.slashPipe,"|");return a}function ot(i,e,t){const s=i.length;if(s===0)return"";let a=0;for(;a<s;){const r=i.charAt(s-a-1);if(r===e&&!t)a++;else if(r!==e&&t)a++;else break}return i.slice(0,s-a)}function Ei(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<i.length;s++)if(i[s]==="\\")s++;else if(i[s]===e[0])t++;else if(i[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function ts(i,e,t,s,a){const r=e.href,o=e.title||null,n=i[1].replace(a.other.outputLinkReplace,"$1");s.state.inLink=!0;const l={type:i[0].charAt(0)==="!"?"image":"link",raw:t,href:r,title:o,text:n,tokens:s.inlineTokens(n)};return s.state.inLink=!1,l}function Ai(i,e,t){const s=i.match(t.other.indentCodeCompensation);if(s===null)return e;const a=s[1];return e.split(`
|
|
34
24
|
`).map(r=>{const o=r.match(t.other.beginningSpace);if(o===null)return r;const[n]=o;return n.length>=a.length?r.slice(a.length):r}).join(`
|
|
35
|
-
`)}var
|
|
36
|
-
`)}}}fences(i){const e=this.rules.block.fences.exec(i);if(e){const t=e[0],s=
|
|
37
|
-
`)}}blockquote(i){const e=this.rules.block.blockquote.exec(i);if(e){let t=
|
|
25
|
+
`)}var Tt=class{constructor(i){h(this,"options"),h(this,"rules"),h(this,"lexer"),this.options=i||De}space(i){const e=this.rules.block.newline.exec(i);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(i){const e=this.rules.block.code.exec(i);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:ot(t,`
|
|
26
|
+
`)}}}fences(i){const e=this.rules.block.fences.exec(i);if(e){const t=e[0],s=Ai(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(i){const e=this.rules.block.heading.exec(i);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const s=ot(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(i){const e=this.rules.block.hr.exec(i);if(e)return{type:"hr",raw:ot(e[0],`
|
|
27
|
+
`)}}blockquote(i){const e=this.rules.block.blockquote.exec(i);if(e){let t=ot(e[0],`
|
|
38
28
|
`).split(`
|
|
39
29
|
`),s="",a="";const r=[];for(;t.length>0;){let o=!1;const n=[];let l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))n.push(t[l]),o=!0;else if(!o)n.push(t[l]);else break;t=t.slice(l);const c=n.join(`
|
|
40
|
-
`),
|
|
30
|
+
`),g=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
41
31
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
42
32
|
${c}`:c,a=a?`${a}
|
|
43
|
-
${
|
|
33
|
+
${g}`:g;const m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(g,r,!0),this.lexer.state.top=m,t.length===0)break;const p=r.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){const L=p,w=L.raw+`
|
|
44
34
|
`+t.join(`
|
|
45
|
-
`),
|
|
35
|
+
`),f=this.blockquote(w);r[r.length-1]=f,s=s.substring(0,s.length-L.raw.length)+f.raw,a=a.substring(0,a.length-L.text.length)+f.text;break}else if((p==null?void 0:p.type)==="list"){const L=p,w=L.raw+`
|
|
46
36
|
`+t.join(`
|
|
47
|
-
`),
|
|
48
|
-
`);continue}}return{type:"blockquote",raw:s,tokens:r,text:a}}}list(i){let e=this.rules.block.list.exec(i);if(e){let t=e[1].trim();const s=t.length>1,a={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");const r=this.rules.other.listItemRegex(t);let o=!1;for(;i;){let l=!1,c="",
|
|
49
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,
|
|
50
|
-
`,1)[0],
|
|
51
|
-
`,i=i.substring(
|
|
52
|
-
`,1)[0];let
|
|
53
|
-
`+
|
|
54
|
-
`+
|
|
55
|
-
`,i=i.substring(
|
|
56
|
-
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(s.length===a.length){for(const n of a)this.rules.other.tableAlignRight.test(n)?o.align.push("right"):this.rules.other.tableAlignCenter.test(n)?o.align.push("center"):this.rules.other.tableAlignLeft.test(n)?o.align.push("left"):o.align.push(null);for(let n=0;n<s.length;n++)o.header.push({text:s[n],tokens:this.lexer.inline(s[n]),header:!0,align:o.align[n]});for(const n of r)o.rows.push(
|
|
57
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(i){const e=this.rules.block.text.exec(i);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(i){const e=this.rules.inline.escape.exec(i);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(i){const e=this.rules.inline.tag.exec(i);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(i){const e=this.rules.inline.link.exec(i);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const r=
|
|
58
|
-
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){var a,r,o;for(this.options.pedantic&&(e=e.replace(
|
|
37
|
+
`),f=this.list(w);r[r.length-1]=f,s=s.substring(0,s.length-p.raw.length)+f.raw,a=a.substring(0,a.length-L.raw.length)+f.raw,t=w.substring(r.at(-1).raw.length).split(`
|
|
38
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:r,text:a}}}list(i){let e=this.rules.block.list.exec(i);if(e){let t=e[1].trim();const s=t.length>1,a={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");const r=this.rules.other.listItemRegex(t);let o=!1;for(;i;){let l=!1,c="",g="";if(!(e=r.exec(i))||this.rules.block.hr.test(i))break;c=e[0],i=i.substring(c.length);let m=e[2].split(`
|
|
39
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),p=i.split(`
|
|
40
|
+
`,1)[0],L=!m.trim(),w=0;if(this.options.pedantic?(w=2,g=m.trimStart()):L?w=e[1].length+1:(w=e[2].search(this.rules.other.nonSpaceChar),w=w>4?1:w,g=m.slice(w),w+=e[1].length),L&&this.rules.other.blankLine.test(p)&&(c+=p+`
|
|
41
|
+
`,i=i.substring(p.length+1),l=!0),!l){const k=this.rules.other.nextBulletRegex(w),I=this.rules.other.hrRegex(w),F=this.rules.other.fencesBeginRegex(w),A=this.rules.other.headingBeginRegex(w),D=this.rules.other.htmlBeginRegex(w);for(;i;){const q=i.split(`
|
|
42
|
+
`,1)[0];let T;if(p=q,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),T=p):T=p.replace(this.rules.other.tabCharGlobal," "),F.test(p)||A.test(p)||D.test(p)||k.test(p)||I.test(p))break;if(T.search(this.rules.other.nonSpaceChar)>=w||!p.trim())g+=`
|
|
43
|
+
`+T.slice(w);else{if(L||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||F.test(m)||A.test(m)||I.test(m))break;g+=`
|
|
44
|
+
`+p}!L&&!p.trim()&&(L=!0),c+=q+`
|
|
45
|
+
`,i=i.substring(q.length+1),m=T.slice(w)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0));let f=null,x;this.options.gfm&&(f=this.rules.other.listIsTask.exec(g),f&&(x=f[0]!=="[ ] ",g=g.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:c,task:!!f,checked:x,loose:!1,text:g,tokens:[]}),a.raw+=c}const n=a.items.at(-1);if(n)n.raw=n.raw.trimEnd(),n.text=n.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let l=0;l<a.items.length;l++)if(this.lexer.state.top=!1,a.items[l].tokens=this.lexer.blockTokens(a.items[l].text,[]),!a.loose){const c=a.items[l].tokens.filter(m=>m.type==="space"),g=c.length>0&&c.some(m=>this.rules.other.anyLine.test(m.raw));a.loose=g}if(a.loose)for(let l=0;l<a.items.length;l++)a.items[l].loose=!0;return a}}html(i){const e=this.rules.block.html.exec(i);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(i){const e=this.rules.block.def.exec(i);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:a}}}table(i){var e;const t=this.rules.block.table.exec(i);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const s=es(t[1]),a=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(e=t[3])!=null&&e.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
46
|
+
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(s.length===a.length){for(const n of a)this.rules.other.tableAlignRight.test(n)?o.align.push("right"):this.rules.other.tableAlignCenter.test(n)?o.align.push("center"):this.rules.other.tableAlignLeft.test(n)?o.align.push("left"):o.align.push(null);for(let n=0;n<s.length;n++)o.header.push({text:s[n],tokens:this.lexer.inline(s[n]),header:!0,align:o.align[n]});for(const n of r)o.rows.push(es(n,o.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[c]})));return o}}lheading(i){const e=this.rules.block.lheading.exec(i);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(i){const e=this.rules.block.paragraph.exec(i);if(e){const t=e[1].charAt(e[1].length-1)===`
|
|
47
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(i){const e=this.rules.block.text.exec(i);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(i){const e=this.rules.inline.escape.exec(i);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(i){const e=this.rules.inline.tag.exec(i);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(i){const e=this.rules.inline.link.exec(i);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const r=ot(t.slice(0,-1),"\\");if((t.length-r.length)%2===0)return}else{const r=Ei(e[2],"()");if(r===-2)return;if(r>-1){const o=(e[0].indexOf("!")===0?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],a="";if(this.options.pedantic){const r=this.rules.other.pedanticHrefTitle.exec(s);r&&(s=r[1],a=r[3])}else a=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),ts(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(i,e){let t;if((t=this.rules.inline.reflink.exec(i))||(t=this.rules.inline.nolink.exec(i))){const s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=e[s.toLowerCase()];if(!a){const r=t[0].charAt(0);return{type:"text",raw:r,text:r}}return ts(t,a,t[0],this.lexer,this.rules)}}emStrong(i,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(i);if(!(!s||s[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!t||this.rules.inline.punctuation.exec(t))){const a=[...s[0]].length-1;let r,o,n=a,l=0;const c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*i.length+a);(s=c.exec(e))!=null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(o=[...r].length,s[3]||s[4]){n+=o;continue}else if((s[5]||s[6])&&a%3&&!((a+o)%3)){l+=o;continue}if(n-=o,n>0)continue;o=Math.min(o,o+n+l);const g=[...s[0]][0].length,m=i.slice(0,a+s.index+g+o);if(Math.min(a,o)%2){const L=m.slice(1,-1);return{type:"em",raw:m,text:L,tokens:this.lexer.inlineTokens(L)}}const p=m.slice(2,-2);return{type:"strong",raw:m,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(i){const e=this.rules.inline.code.exec(i);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const s=this.rules.other.nonSpaceChar.test(t),a=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&a&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(i){const e=this.rules.inline.br.exec(i);if(e)return{type:"br",raw:e[0]}}del(i){const e=this.rules.inline.del.exec(i);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(i){const e=this.rules.inline.autolink.exec(i);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(i){var e;let t;if(t=this.rules.inline.url.exec(i)){let s,a;if(t[2]==="@")s=t[0],a="mailto:"+s;else{let r;do r=t[0],t[0]=((e=this.rules.inline._backpedal.exec(t[0]))==null?void 0:e[0])??"";while(r!==t[0]);s=t[0],t[1]==="www."?a="http://"+t[0]:a=t[0]}return{type:"link",raw:t[0],text:s,href:a,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(i){const e=this.rules.inline.text.exec(i);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},Ce=class Pa{constructor(e){h(this,"tokens"),h(this,"options"),h(this,"state"),h(this,"tokenizer"),h(this,"inlineQueue"),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||De,this.options.tokenizer=this.options.tokenizer||new Tt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:se,block:kt.normal,inline:nt.normal};this.options.pedantic?(t.block=kt.pedantic,t.inline=nt.pedantic):this.options.gfm&&(t.block=kt.gfm,this.options.breaks?t.inline=nt.breaks:t.inline=nt.gfm),this.tokenizer.rules=t}static get rules(){return{block:kt,inline:nt}}static lex(e,t){return new Pa(t).lex(e)}static lexInline(e,t){return new Pa(t).inlineTokens(e)}lex(e){e=e.replace(se.carriageReturn,`
|
|
48
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){var a,r,o;for(this.options.pedantic&&(e=e.replace(se.tabCharGlobal," ").replace(se.spaceLine,""));e;){let n;if((r=(a=this.options.extensions)==null?void 0:a.block)!=null&&r.some(c=>(n=c.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);const c=t.at(-1);n.raw.length===1&&c!==void 0?c.raw+=`
|
|
59
49
|
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);const c=t.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
60
50
|
`+n.raw,c.text+=`
|
|
61
51
|
`+n.text,this.inlineQueue.at(-1).src=c.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);const c=t.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
62
52
|
`+n.raw,c.text+=`
|
|
63
|
-
`+n.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let l=e;if((o=this.options.extensions)!=null&&o.startBlock){let c=1/0;const
|
|
53
|
+
`+n.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let l=e;if((o=this.options.extensions)!=null&&o.startBlock){let c=1/0;const g=e.slice(1);let m;this.options.extensions.startBlock.forEach(p=>{m=p.call({lexer:this},g),typeof m=="number"&&m>=0&&(c=Math.min(c,m))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(this.state.top&&(n=this.tokenizer.paragraph(l))){const c=t.at(-1);s&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=`
|
|
64
54
|
`+n.raw,c.text+=`
|
|
65
55
|
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(n),s=l.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);const c=t.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=`
|
|
66
56
|
`+n.raw,c.text+=`
|
|
67
|
-
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(n);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var s,a,r;let o=e,n=null;if(this.tokens.links){const
|
|
68
|
-
`;return a?'<pre><code class="language-'+
|
|
69
|
-
`:"<pre><code>"+(t?r:
|
|
57
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(n);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var s,a,r;let o=e,n=null;if(this.tokens.links){const g=Object.keys(this.tokens.links);if(g.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)g.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,n.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(n=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let l=!1,c="";for(;e;){l||(c=""),l=!1;let g;if((a=(s=this.options.extensions)==null?void 0:s.inline)!=null&&a.some(p=>(g=p.call({lexer:this},e,t))?(e=e.substring(g.raw.length),t.push(g),!0):!1))continue;if(g=this.tokenizer.escape(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.tag(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.link(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(g.raw.length);const p=t.at(-1);g.type==="text"&&(p==null?void 0:p.type)==="text"?(p.raw+=g.raw,p.text+=g.text):t.push(g);continue}if(g=this.tokenizer.emStrong(e,o,c)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.codespan(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.br(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.del(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.autolink(e)){e=e.substring(g.raw.length),t.push(g);continue}if(!this.state.inLink&&(g=this.tokenizer.url(e))){e=e.substring(g.raw.length),t.push(g);continue}let m=e;if((r=this.options.extensions)!=null&&r.startInline){let p=1/0;const L=e.slice(1);let w;this.options.extensions.startInline.forEach(f=>{w=f.call({lexer:this},L),typeof w=="number"&&w>=0&&(p=Math.min(p,w))}),p<1/0&&p>=0&&(m=e.substring(0,p+1))}if(g=this.tokenizer.inlineText(m)){e=e.substring(g.raw.length),g.raw.slice(-1)!=="_"&&(c=g.raw.slice(-1)),l=!0;const p=t.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=g.raw,p.text+=g.text):t.push(g);continue}if(e){const p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return t}},jt=class{constructor(i){h(this,"options"),h(this,"parser"),this.options=i||De}space(i){return""}code({text:i,lang:e,escaped:t}){var s;const a=(s=(e||"").match(se.notSpaceStart))==null?void 0:s[0],r=i.replace(se.endingNewline,"")+`
|
|
58
|
+
`;return a?'<pre><code class="language-'+we(a)+'">'+(t?r:we(r,!0))+`</code></pre>
|
|
59
|
+
`:"<pre><code>"+(t?r:we(r,!0))+`</code></pre>
|
|
70
60
|
`}blockquote({tokens:i}){return`<blockquote>
|
|
71
61
|
${this.parser.parse(i)}</blockquote>
|
|
72
62
|
`}html({text:i}){return i}heading({tokens:i,depth:e}){return`<h${e}>${this.parser.parseInline(i)}</h${e}>
|
|
73
63
|
`}hr(i){return`<hr>
|
|
74
64
|
`}list(i){const e=i.ordered,t=i.start;let s="";for(let o=0;o<i.items.length;o++){const n=i.items[o];s+=this.listitem(n)}const a=e?"ol":"ul",r=e&&t!==1?' start="'+t+'"':"";return"<"+a+r+`>
|
|
75
65
|
`+s+"</"+a+`>
|
|
76
|
-
`}listitem(i){var e;let t="";if(i.task){const s=this.checkbox({checked:!!i.checked});i.loose?((e=i.tokens[0])==null?void 0:e.type)==="paragraph"?(i.tokens[0].text=s+" "+i.tokens[0].text,i.tokens[0].tokens&&i.tokens[0].tokens.length>0&&i.tokens[0].tokens[0].type==="text"&&(i.tokens[0].tokens[0].text=s+" "+
|
|
66
|
+
`}listitem(i){var e;let t="";if(i.task){const s=this.checkbox({checked:!!i.checked});i.loose?((e=i.tokens[0])==null?void 0:e.type)==="paragraph"?(i.tokens[0].text=s+" "+i.tokens[0].text,i.tokens[0].tokens&&i.tokens[0].tokens.length>0&&i.tokens[0].tokens[0].type==="text"&&(i.tokens[0].tokens[0].text=s+" "+we(i.tokens[0].tokens[0].text),i.tokens[0].tokens[0].escaped=!0)):i.tokens.unshift({type:"text",raw:s+" ",text:s+" ",escaped:!0}):t+=s+" "}return t+=this.parser.parse(i.tokens,!!i.loose),`<li>${t}</li>
|
|
77
67
|
`}checkbox({checked:i}){return"<input "+(i?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:i}){return`<p>${this.parser.parseInline(i)}</p>
|
|
78
68
|
`}table(i){let e="",t="";for(let a=0;a<i.header.length;a++)t+=this.tablecell(i.header[a]);e+=this.tablerow({text:t});let s="";for(let a=0;a<i.rows.length;a++){const r=i.rows[a];t="";for(let o=0;o<r.length;o++)t+=this.tablecell(r[o]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
79
69
|
<thead>
|
|
@@ -82,20 +72,20 @@ ${this.parser.parse(i)}</blockquote>
|
|
|
82
72
|
`}tablerow({text:i}){return`<tr>
|
|
83
73
|
${i}</tr>
|
|
84
74
|
`}tablecell(i){const e=this.parser.parseInline(i.tokens),t=i.header?"th":"td";return(i.align?`<${t} align="${i.align}">`:`<${t}>`)+e+`</${t}>
|
|
85
|
-
`}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>${
|
|
86
|
-
`+this.renderer.text(c);t?r+=this.renderer.paragraph({type:"paragraph",raw:
|
|
87
|
-
Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An error occurred:</p><pre>"+Te(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},Ze=new _i;function Q(i,e){return Ze.parse(i,e)}Q.options=Q.setOptions=function(i){return Ze.setOptions(i),Q.defaults=Ze.defaults,hs(Q.defaults),Q},Q.getDefaults=Ta,Q.defaults=Ke,Q.use=function(...i){return Ze.use(...i),Q.defaults=Ze.defaults,hs(Q.defaults),Q},Q.walkTokens=function(i,e){return Ze.walkTokens(i,e)},Q.parseInline=Ze.parseInline,Q.Parser=Ie,Q.parser=Ie.parse,Q.Renderer=sa,Q.TextRenderer=Pa,Q.Lexer=Ae,Q.lexer=Ae.lex,Q.Tokenizer=aa,Q.Hooks=ia,Q.parse=Q,Q.options,Q.setOptions,Q.use,Q.walkTokens,Q.parseInline,Ie.parse,Ae.lex;/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:ks,setPrototypeOf:Ts,isFrozen:$i,getPrototypeOf:Wi,getOwnPropertyDescriptor:Vi}=Object;let{freeze:ue,seal:xe,create:js}=Object,{apply:za,construct:_a}=typeof Reflect<"u"&&Reflect;ue||(ue=function(i){return i}),xe||(xe=function(i){return i}),za||(za=function(i,e,t){return i.apply(e,t)}),_a||(_a=function(i,e){return new i(...e)});const ra=ge(Array.prototype.forEach),Qi=ge(Array.prototype.lastIndexOf),Es=ge(Array.prototype.pop),jt=ge(Array.prototype.push),Ui=ge(Array.prototype.splice),na=ge(String.prototype.toLowerCase),$a=ge(String.prototype.toString),As=ge(String.prototype.match),Et=ge(String.prototype.replace),Bi=ge(String.prototype.indexOf),Hi=ge(String.prototype.trim),be=ge(Object.prototype.hasOwnProperty),de=ge(RegExp.prototype.test),At=Yi(TypeError);function ge(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 za(i,e,s)}}function Yi(i){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return _a(i,t)}}function O(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:na;Ts&&Ts(i,null);let s=e.length;for(;s--;){let a=e[s];if(typeof a=="string"){const r=t(a);r!==a&&($i(e)||(e[s]=r),a=r)}i[a]=!0}return i}function qi(i){for(let e=0;e<i.length;e++)be(i,e)||(i[e]=null);return i}function Re(i){const e=js(null);for(const[t,s]of ks(i))be(i,t)&&(Array.isArray(s)?e[t]=qi(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=Re(s):e[t]=s);return e}function It(i,e){for(;i!==null;){const s=Vi(i,e);if(s){if(s.get)return ge(s.get);if(typeof s.value=="function")return ge(s.value)}i=Wi(i)}function t(){return null}return t}const Is=ue(["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","section","select","shadow","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"]),Wa=ue(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Va=ue(["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"]),Ji=ue(["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"]),Qa=ue(["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"]),Gi=ue(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Rs=ue(["#text"]),Ds=ue(["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","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ua=ue(["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","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"]),Ns=ue(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),oa=ue(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ki=xe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Zi=xe(/<%[\w\W]*|[\w\W]*%>/gm),Xi=xe(/\$\{[\w\W]*/gm),er=xe(/^data-[\-\w.\u00B7-\uFFFF]+$/),tr=xe(/^aria-[\-\w]+$/),Os=xe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ar=xe(/^(?:\w+script|data):/i),sr=xe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ps=xe(/^html$/i),ir=xe(/^[a-z][.\w]*(-[.\w]+)+$/i);var Fs=Object.freeze({__proto__:null,ARIA_ATTR:tr,ATTR_WHITESPACE:sr,CUSTOM_ELEMENT:ir,DATA_ATTR:er,DOCTYPE_NAME:Ps,ERB_EXPR:Zi,IS_ALLOWED_URI:Os,IS_SCRIPT_OR_DATA:ar,MUSTACHE_EXPR:Ki,TMPLIT_EXPR:Xi});const Rt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},rr=function(){return typeof window>"u"?null:window},nr=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}},zs=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function _s(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rr();const e=h=>_s(h);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==Rt.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const s=t,a=s.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:n,Element:l,NodeFilter:c,NamedNodeMap:p=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:f,DOMParser:m,trustedTypes:y}=i,x=l.prototype,L=It(x,"cloneNode"),C=It(x,"remove"),j=It(x,"nextSibling"),T=It(x,"childNodes"),W=It(x,"parentNode");if(typeof o=="function"){const h=t.createElement("template");h.content&&h.content.ownerDocument&&(t=h.content.ownerDocument)}let N,F="";const{implementation:X,createNodeIterator:A,createDocumentFragment:U,getElementsByTagName:ie}=t,{importNode:je}=s;let q=zs();e.isSupported=typeof ks=="function"&&typeof W=="function"&&X&&X.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Le,ERB_EXPR:le,TMPLIT_EXPR:ye,DATA_ATTR:et,ARIA_ATTR:da,IS_SCRIPT_OR_DATA:ga,ATTR_WHITESPACE:$t,CUSTOM_ELEMENT:pa}=Fs;let{IS_ALLOWED_URI:Wt}=Fs,ee=null;const Vt=O({},[...Is,...Wa,...Va,...Qa,...Rs]);let te=null;const ma=O({},[...Ds,...Ua,...Ns,...oa]);let K=Object.seal(js(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}})),Ne=null,tt=null,at=!0,st=!0,it=!1,fa=!0,Oe=!1,ft=!0,Pe=!1,Be=!1,Fe=!1,ze=!1,rt=!1,_e=!1,La=!0,ya=!1;const Qt="user-content-";let Ut=!0,nt=!1,$e={},We=null;const He=O({},["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 wa=null;const Bt=O({},["audio","video","img","source","image","track"]);let Lt=null;const yt=O({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),wt="http://www.w3.org/1998/Math/MathML",vt="http://www.w3.org/2000/svg",ke="http://www.w3.org/1999/xhtml";let Ye=ke,Ht=!1,Yt=null;const is=O({},[wt,vt,ke],$a);let qe=O({},["mi","mo","mn","ms","mtext"]),ot=O({},["annotation-xml"]);const Je=O({},["title","style","font","a","script"]);let Ve=null;const qt=["application/xhtml+xml","text/html"],va="text/html";let ae=null,Qe=null;const rs=t.createElement("form"),Jt=function(h){return h instanceof RegExp||h instanceof Function},xt=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Qe&&Qe===h)){if((!h||typeof h!="object")&&(h={}),h=Re(h),Ve=qt.indexOf(h.PARSER_MEDIA_TYPE)===-1?va:h.PARSER_MEDIA_TYPE,ae=Ve==="application/xhtml+xml"?$a:na,ee=be(h,"ALLOWED_TAGS")?O({},h.ALLOWED_TAGS,ae):Vt,te=be(h,"ALLOWED_ATTR")?O({},h.ALLOWED_ATTR,ae):ma,Yt=be(h,"ALLOWED_NAMESPACES")?O({},h.ALLOWED_NAMESPACES,$a):is,Lt=be(h,"ADD_URI_SAFE_ATTR")?O(Re(yt),h.ADD_URI_SAFE_ATTR,ae):yt,wa=be(h,"ADD_DATA_URI_TAGS")?O(Re(Bt),h.ADD_DATA_URI_TAGS,ae):Bt,We=be(h,"FORBID_CONTENTS")?O({},h.FORBID_CONTENTS,ae):He,Ne=be(h,"FORBID_TAGS")?O({},h.FORBID_TAGS,ae):Re({}),tt=be(h,"FORBID_ATTR")?O({},h.FORBID_ATTR,ae):Re({}),$e=be(h,"USE_PROFILES")?h.USE_PROFILES:!1,at=h.ALLOW_ARIA_ATTR!==!1,st=h.ALLOW_DATA_ATTR!==!1,it=h.ALLOW_UNKNOWN_PROTOCOLS||!1,fa=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Oe=h.SAFE_FOR_TEMPLATES||!1,ft=h.SAFE_FOR_XML!==!1,Pe=h.WHOLE_DOCUMENT||!1,ze=h.RETURN_DOM||!1,rt=h.RETURN_DOM_FRAGMENT||!1,_e=h.RETURN_TRUSTED_TYPE||!1,Fe=h.FORCE_BODY||!1,La=h.SANITIZE_DOM!==!1,ya=h.SANITIZE_NAMED_PROPS||!1,Ut=h.KEEP_CONTENT!==!1,nt=h.IN_PLACE||!1,Wt=h.ALLOWED_URI_REGEXP||Os,Ye=h.NAMESPACE||ke,qe=h.MATHML_TEXT_INTEGRATION_POINTS||qe,ot=h.HTML_INTEGRATION_POINTS||ot,K=h.CUSTOM_ELEMENT_HANDLING||{},h.CUSTOM_ELEMENT_HANDLING&&Jt(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=h.CUSTOM_ELEMENT_HANDLING.tagNameCheck),h.CUSTOM_ELEMENT_HANDLING&&Jt(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Oe&&(st=!1),rt&&(ze=!0),$e&&(ee=O({},Rs),te=[],$e.html===!0&&(O(ee,Is),O(te,Ds)),$e.svg===!0&&(O(ee,Wa),O(te,Ua),O(te,oa)),$e.svgFilters===!0&&(O(ee,Va),O(te,Ua),O(te,oa)),$e.mathMl===!0&&(O(ee,Qa),O(te,Ns),O(te,oa))),h.ADD_TAGS&&(ee===Vt&&(ee=Re(ee)),O(ee,h.ADD_TAGS,ae)),h.ADD_ATTR&&(te===ma&&(te=Re(te)),O(te,h.ADD_ATTR,ae)),h.ADD_URI_SAFE_ATTR&&O(Lt,h.ADD_URI_SAFE_ATTR,ae),h.FORBID_CONTENTS&&(We===He&&(We=Re(We)),O(We,h.FORBID_CONTENTS,ae)),Ut&&(ee["#text"]=!0),Pe&&O(ee,["html","head","body"]),ee.table&&(O(ee,["tbody"]),delete Ne.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw At('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw At('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');N=h.TRUSTED_TYPES_POLICY,F=N.createHTML("")}else N===void 0&&(N=nr(y,a)),N!==null&&typeof F=="string"&&(F=N.createHTML(""));ue&&ue(h),Qe=h}},xa=O({},[...Wa,...Va,...Ji]),ba=O({},[...Qa,...Gi]),Ca=function(h){let b=W(h);(!b||!b.tagName)&&(b={namespaceURI:Ye,tagName:"template"});const v=na(h.tagName),E=na(b.tagName);return Yt[h.namespaceURI]?h.namespaceURI===vt?b.namespaceURI===ke?v==="svg":b.namespaceURI===wt?v==="svg"&&(E==="annotation-xml"||qe[E]):!!xa[v]:h.namespaceURI===wt?b.namespaceURI===ke?v==="math":b.namespaceURI===vt?v==="math"&&ot[E]:!!ba[v]:h.namespaceURI===ke?b.namespaceURI===vt&&!ot[E]||b.namespaceURI===wt&&!qe[E]?!1:!ba[v]&&(Je[v]||!xa[v]):!!(Ve==="application/xhtml+xml"&&Yt[h.namespaceURI]):!1},Ee=function(h){jt(e.removed,{element:h});try{W(h).removeChild(h)}catch{C(h)}},Ge=function(h,b){try{jt(e.removed,{attribute:b.getAttributeNode(h),from:b})}catch{jt(e.removed,{attribute:null,from:b})}if(b.removeAttribute(h),h==="is")if(ze||rt)try{Ee(b)}catch{}else try{b.setAttribute(h,"")}catch{}},Ma=function(h){let b=null,v=null;if(Fe)h="<remove></remove>"+h;else{const Y=As(h,/^[\r\n\t ]+/);v=Y&&Y[0]}Ve==="application/xhtml+xml"&&Ye===ke&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const E=N?N.createHTML(h):h;if(Ye===ke)try{b=new m().parseFromString(E,Ve)}catch{}if(!b||!b.documentElement){b=X.createDocument(Ye,"template",null);try{b.documentElement.innerHTML=Ht?F:E}catch{}}const H=b.body||b.documentElement;return h&&v&&H.insertBefore(t.createTextNode(v),H.childNodes[0]||null),Ye===ke?ie.call(b,Pe?"html":"body")[0]:Pe?b.documentElement:H},Sa=function(h){return A.call(h.ownerDocument||h,h,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Gt=function(h){return h instanceof f&&(typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||!(h.attributes instanceof p)||typeof h.removeAttribute!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function")},g=function(h){return typeof n=="function"&&h instanceof n};function w(h,b,v){ra(h,E=>{E.call(e,b,v,Qe)})}const M=function(h){let b=null;if(w(q.beforeSanitizeElements,h,null),Gt(h))return Ee(h),!0;const v=ae(h.nodeName);if(w(q.uponSanitizeElement,h,{tagName:v,allowedTags:ee}),ft&&h.hasChildNodes()&&!g(h.firstElementChild)&&de(/<[/\w!]/g,h.innerHTML)&&de(/<[/\w!]/g,h.textContent)||h.nodeType===Rt.progressingInstruction||ft&&h.nodeType===Rt.comment&&de(/<[/\w]/g,h.data))return Ee(h),!0;if(!ee[v]||Ne[v]){if(!Ne[v]&&$(v)&&(K.tagNameCheck instanceof RegExp&&de(K.tagNameCheck,v)||K.tagNameCheck instanceof Function&&K.tagNameCheck(v)))return!1;if(Ut&&!We[v]){const E=W(h)||h.parentNode,H=T(h)||h.childNodes;if(H&&E){const Y=H.length;for(let ce=Y-1;ce>=0;--ce){const J=L(H[ce],!0);J.__removalCount=(h.__removalCount||0)+1,E.insertBefore(J,j(h))}}}return Ee(h),!0}return h instanceof l&&!Ca(h)||(v==="noscript"||v==="noembed"||v==="noframes")&&de(/<\/no(script|embed|frames)/i,h.innerHTML)?(Ee(h),!0):(Oe&&h.nodeType===Rt.text&&(b=h.textContent,ra([Le,le,ye],E=>{b=Et(b,E," ")}),h.textContent!==b&&(jt(e.removed,{element:h.cloneNode()}),h.textContent=b)),w(q.afterSanitizeElements,h,null),!1)},I=function(h,b,v){if(La&&(b==="id"||b==="name")&&(v in t||v in rs))return!1;if(!(st&&!tt[b]&&de(et,b))&&!(at&&de(da,b))){if(!te[b]||tt[b]){if(!($(h)&&(K.tagNameCheck instanceof RegExp&&de(K.tagNameCheck,h)||K.tagNameCheck instanceof Function&&K.tagNameCheck(h))&&(K.attributeNameCheck instanceof RegExp&&de(K.attributeNameCheck,b)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(b))||b==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&de(K.tagNameCheck,v)||K.tagNameCheck instanceof Function&&K.tagNameCheck(v))))return!1}else if(!Lt[b]&&!de(Wt,Et(v,$t,""))&&!((b==="src"||b==="xlink:href"||b==="href")&&h!=="script"&&Bi(v,"data:")===0&&wa[h])&&!(it&&!de(ga,Et(v,$t,"")))&&v)return!1}return!0},$=function(h){return h!=="annotation-xml"&&As(h,pa)},B=function(h){w(q.beforeSanitizeAttributes,h,null);const{attributes:b}=h;if(!b||Gt(h))return;const v={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0};let E=b.length;for(;E--;){const H=b[E],{name:Y,namespaceURI:ce,value:J}=H,we=ae(Y),Kt=J;let ne=Y==="value"?Kt:Hi(Kt);if(v.attrName=we,v.attrValue=ne,v.keepAttr=!0,v.forceKeepAttr=void 0,w(q.uponSanitizeAttribute,h,v),ne=v.attrValue,ya&&(we==="id"||we==="name")&&(Ge(Y,h),ne=Qt+ne),ft&&de(/((--!?|])>)|<\/(style|title)/i,ne)){Ge(Y,h);continue}if(v.forceKeepAttr)continue;if(!v.keepAttr){Ge(Y,h);continue}if(!fa&&de(/\/>/i,ne)){Ge(Y,h);continue}Oe&&ra([Le,le,ye],xn=>{ne=Et(ne,xn," ")});const Xs=ae(h.nodeName);if(!I(Xs,we,ne)){Ge(Y,h);continue}if(N&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!ce)switch(y.getAttributeType(Xs,we)){case"TrustedHTML":{ne=N.createHTML(ne);break}case"TrustedScriptURL":{ne=N.createScriptURL(ne);break}}if(ne!==Kt)try{ce?h.setAttributeNS(ce,Y,ne):h.setAttribute(Y,ne),Gt(h)?Ee(h):Es(e.removed)}catch{Ge(Y,h)}}w(q.afterSanitizeAttributes,h,null)},z=function h(b){let v=null;const E=Sa(b);for(w(q.beforeSanitizeShadowDOM,b,null);v=E.nextNode();)w(q.uponSanitizeShadowNode,v,null),M(v),B(v),v.content instanceof r&&h(v.content);w(q.afterSanitizeShadowDOM,b,null)};return e.sanitize=function(h){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=null,E=null,H=null,Y=null;if(Ht=!h,Ht&&(h="<!-->"),typeof h!="string"&&!g(h))if(typeof h.toString=="function"){if(h=h.toString(),typeof h!="string")throw At("dirty is not a string, aborting")}else throw At("toString is not a function");if(!e.isSupported)return h;if(Be||xt(b),e.removed=[],typeof h=="string"&&(nt=!1),nt){if(h.nodeName){const we=ae(h.nodeName);if(!ee[we]||Ne[we])throw At("root node is forbidden and cannot be sanitized in-place")}}else if(h instanceof n)v=Ma("<!---->"),E=v.ownerDocument.importNode(h,!0),E.nodeType===Rt.element&&E.nodeName==="BODY"||E.nodeName==="HTML"?v=E:v.appendChild(E);else{if(!ze&&!Oe&&!Pe&&h.indexOf("<")===-1)return N&&_e?N.createHTML(h):h;if(v=Ma(h),!v)return ze?null:_e?F:""}v&&Fe&&Ee(v.firstChild);const ce=Sa(nt?h:v);for(;H=ce.nextNode();)M(H),B(H),H.content instanceof r&&z(H.content);if(nt)return h;if(ze){if(rt)for(Y=U.call(v.ownerDocument);v.firstChild;)Y.appendChild(v.firstChild);else Y=v;return(te.shadowroot||te.shadowrootmode)&&(Y=je.call(s,Y,!0)),Y}let J=Pe?v.outerHTML:v.innerHTML;return Pe&&ee["!doctype"]&&v.ownerDocument&&v.ownerDocument.doctype&&v.ownerDocument.doctype.name&&de(Ps,v.ownerDocument.doctype.name)&&(J="<!DOCTYPE "+v.ownerDocument.doctype.name+`>
|
|
88
|
-
`+J),Oe&&ra([Le,le,ye],we=>{J=Et(J,we," ")}),N&&_e?N.createHTML(J):J},e.setConfig=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xt(h),Be=!0},e.clearConfig=function(){Qe=null,Be=!1},e.isValidAttribute=function(h,b,v){Qe||xt({});const E=ae(h),H=ae(b);return I(E,H,v)},e.addHook=function(h,b){typeof b=="function"&&jt(q[h],b)},e.removeHook=function(h,b){if(b!==void 0){const v=Qi(q[h],b);return v===-1?void 0:Ui(q[h],v,1)[0]}return Es(q[h])},e.removeHooks=function(h){q[h]=[]},e.removeAllHooks=function(){q=zs()},e}var $s=_s();class or{constructor(e){u(this,"dataLayer"),this.dataLayer=e}get answerWidgetShowMoreLimit(){return this.dataLayer.answerWidgetShowMoreLimit??100}get currentPage(){var e;return(e=this.dataLayer.searchObject)==null?void 0:e.page}get totalResults(){var e;return((e=this.dataLayer.searchResultsMetadata)==null?void 0:e.totalResultsValue)||0}get resultsPerPage(){return this.dataLayer.itemsPerPage||0}get sortOptions(){var e;return((e=this.dataLayer.searchResultsMetadata)==null?void 0:e.sorting.options)||[]}get selectedSortOption(){var e;return((e=this.dataLayer.searchResultsMetadata)==null?void 0:e.sorting.selectedSortOption)||""}get startResultIndex(){var e;return(((e=this.dataLayer.searchObject)==null?void 0:e.page)-1)*this.resultsPerPage+1}get endResultIndex(){var e;const t=(((e=this.dataLayer.searchObject)==null?void 0:e.page)-1)*this.resultsPerPage+(this.resultsPerPage??0);return t>this.totalResults?this.totalResults:t}get isFirstPage(){var e;return((e=this.dataLayer.searchObject)==null?void 0:e.page)===1}get isLastPage(){var e;return((e=this.dataLayer.searchObject)==null?void 0:e.page)>=Math.ceil(this.totalResults/this.resultsPerPage)}get percentageOfResultsLoaded(){return this.endResultIndex/this.totalResults*100}get results(){return this.dataLayer.searchResults??[]}get autoCorrectedQuery(){var e;return((e=this.dataLayer.searchResultsMetadata)==null?void 0:e.autoCorrectedQuery)||""}get originalQuery(){var e;return((e=this.dataLayer.searchObject)==null?void 0:e.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 $s.sanitize(Q.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(){var e,t;return((e=this.dataLayer.searchResultsMetadata)==null?void 0:e.autoCorrectedQuery)||((t=this.dataLayer.searchObject)==null?void 0:t.query)||""}get locationSearchEnabled(){return this.dataLayer.locationEnabled??!1}get locationSearchDistanceEnabled(){var e,t,s,a,r,o,n;return((t=(e=this.dataLayer.searchLocationConfig)==null?void 0:e.locationValuesOverride)!=null&&t.locationDistanceEnabled?(a=(s=this.dataLayer.searchLocationConfig)==null?void 0:s.locationValuesOverride)==null?void 0:a.locationDistanceEnabled:(n=(o=(r=this.dataLayer.searchResultsMetadata)==null?void 0:r.location)==null?void 0:o.filter)==null?void 0:n.enabled)??!1}get locationSearchDistanceValues(){var e,t,s,a,r,o,n,l,c;const p=((t=(e=this.dataLayer.searchLocationConfig)==null?void 0:e.locationValuesOverride)==null?void 0:t.filterValues)??((r=(a=(s=this.dataLayer.searchResultsMetadata)==null?void 0:s.location)==null?void 0:a.filter)==null?void 0:r.values),f=((n=(o=this.dataLayer.searchLocationConfig)==null?void 0:o.locationValuesOverride)==null?void 0:n.filterUnit)??((c=(l=this.dataLayer.searchResultsMetadata)==null?void 0:l.location)==null?void 0:c.unit);return!p||p.length===0?[]:p.map(m=>({label:m==="any"?"Any Distance":m+" "+(f??""),value:m,isSelected:m===this.dataLayer.searchRadius})).sort((m,y)=>{const x=m.value==="any"?0:parseFloat(m.value),L=y.value==="any"?0:parseFloat(y.value);return x-L})}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 $s.sanitize(Q.parse(this.dataLayer.answerErrorMessage)).replace("<br>","")}get searchExecuted(){var e,t,s;return((e=this.dataLayer.searchObject)==null?void 0:e.query)!==void 0&&((t=this.dataLayer.searchObject)==null?void 0:t.query)!=="undefined"&&((s=this.dataLayer.searchObject)==null?void 0:s.query)!==""}get selectedFacets(){var e;const t=this.dataLayer.searchFacetsCached??this.dataLayer.searchFacets;return t?(((e=this.dataLayer.searchObject)==null?void 0:e.facets)??[]).map(s=>{const a=s.name,r=s.value,o=t.find(n=>n.name===a);if(o){const n=o.values.find(l=>l.type==="range"?!1:l.type==="checkbox"?'"'+l.value+'"'===r:!1);if(n)return n}return null}).filter(s=>s!==null):[]}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,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(){var e,t,s,a;return{searchTerm:this.searchTerm,trackApiKey:((e=this.dataLayer.searchstaxConfig)==null?void 0:e.trackApiKey)??"",session:this.dataLayer.sessionIdValue,language:this.dataLayer.language,recordsPerPage:((t=this.dataLayer.searchResultsMetadata)==null?void 0:t.recordsPerPageValue)??0,totalResults:((s=this.dataLayer.searchResultsMetadata)==null?void 0:s.totalResultsValue)??0,currentPage:this.dataLayer.currentPage,latencyVal:((a=this.dataLayer.searchResultsMetadata)==null?void 0:a.latency)??0,...this.dataLayer.model?{model:this.dataLayer.model}:{}}}}class Ce{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 o=e[r],n=t[r],l=this.isObject(o)&&this.isObject(n);if(l&&!this.deepEqual(o,n)||!l&&o!==n)return!1}return!0}static isObject(e){return e!=null&&typeof e=="object"}}class D{constructor(e){u(this,"value"),u(this,"observers",{}),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),o=n=>{n===t&&(e(n),this.unsubscribe(r))};return this.value===t?(e(this.value),null):(this.subscribe(o,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=o=>{o!=null&&(e(o),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 Ba{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 o in a){r+="; "+o;const n=a[o];n!==!0&&(r+="="+n)}typeof document<"u"&&(document.cookie=r)}}class oe{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 lr{constructor(e,t){u(this,"$searchTermChange",new D("")),u(this,"$searchLocationChange",new D("")),u(this,"$searchLocationCoordinatesDecoded",new D("")),u(this,"$searchLatChange",new D("")),u(this,"$searchLongChange",new D("")),u(this,"$searchRadiusChange",new D(void 0)),u(this,"$loadingChange",new D(!1)),u(this,"$locationError",new D(!1)),u(this,"$searchResults",new D(null)),u(this,"$searchResultsMetadata",new D(null)),u(this,"$searchAutosuggest",new D(null)),u(this,"$searchFacets",new D(null)),u(this,"$searchFacetsCached",new D(null)),u(this,"$searchstaxConfig",new D(null)),u(this,"$autosuggestResults",new D(null)),u(this,"$itemsPerPage",new D(void 0)),u(this,"$searchObject",new D({query:"",itemsPerPage:void 0,page:99999999,order:"",facets:[],additionalProps:[],location:{term:void 0,radius:void 0,lat:void 0,lon:void 0},model:""})),u(this,"$searchRelatedSearches",new D(null)),u(this,"$searchInputConfig",new D(null)),u(this,"$searchLocationConfig",new D(null)),u(this,"$searchExternalPromotions",new D(null)),u(this,"$facetsTemplateData",new D(null)),u(this,"$selectedFacetsTemplateData",new D(null)),u(this,"$paginationData",new D(null)),u(this,"$answerData",new D(null)),u(this,"$searchFeedbackData",new D(null)),u(this,"$inputWidgetTemplateData",new D(null)),u(this,"$locationWidgetTemplateData",new D(null)),u(this,"$searchSortingData",new D(null)),u(this,"$searchRelatedSearchesData",new D(null)),u(this,"$searchExternalPromotionsData",new D(null)),u(this,"$cookiesDisabled",new D(null)),u(this,"$locationDecodingLoading",new D(!1)),u(this,"$answer",new D("")),u(this,"$language",new D("en")),u(this,"$model",new D("")),u(this,"$answerLoading",new D(!1)),u(this,"$locationEnabled",new D(null)),u(this,"$answerError",new D(!1)),u(this,"$answerErrorMessage",new D("")),u(this,"$isQuestion",new D(!1)),u(this,"$inputTemplateRendered",new D(!1)),u(this,"currentPageValue",1),u(this,"isAnswerWidgetCreatedValue",!1),u(this,"renderingEngineValue",Z.mustache),u(this,"parsedData",new or(this)),u(this,"sessionId"),u(this,"sessionIdValue",null),u(this,"autoCorrect",!0),u(this,"forceNotCorrect",!1),u(this,"lastSearchValue",""),u(this,"turnAIAnswerGenerationOn",!1),u(this,"questionURL",""),u(this,"isInfiniteScroll",!1),u(this,"firstSearchHappened",!1),u(this,"facetsWereSet",!1),u(this,"answerWidgetShowMoreLimit",100),u(this,"searchHelper"),this.sessionId=e,t&&(this.sessionIdValue=t),this.cookieHandlingCallback(t),this.$cookiesDisabled.subscribe(()=>{this.cookieHandlingCallback(t)})}cookieHandlingCallback(e){this.cookiesDisabled?(this.sessionIdValue=null,Ba.deleteCookie(this.sessionId),Ba.deleteCookie("ms_visitorid")):this.sessionIdValue=Ba.getOrSetCookie(this.sessionId,e)}setIsInfiniteScroll(e){this.isInfiniteScroll=e}setSearchTerm(e){this.$searchTermChange.setValue(oe.removeXSSRiskyTags(e))}setSearchLocation(e){this.$searchLocationChange.setValue(oe.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,(!Ce.deepEqual(e,this.searchResults??[""])||this.facetsWereSet)&&(this.facetsWereSet=!1,this.$searchResults.setValue(e))}setSearchResultsMetadata(e){Ce.deepEqual(e,this.searchResultsMetadata??{})||this.$searchResultsMetadata.setValue(e)}setSearchAutosuggest(e){this.$searchAutosuggest.setValue(e)}setSearchObject(e){var t,s;let a=e;a={...a,itemsPerPage:this.itemsPerPage,model:this.model},(s=(t=this.searchstaxConfig)==null?void 0:t.hooks)!=null&&s.beforeSearch&&a&&(a=this.searchstaxConfig.hooks.beforeSearch(a)),a&&(!Ce.deepEqual(a,this.searchObject??{})||this.forceNotCorrect)&&this.$searchObject.setValue(a)}setSearchFacets(e){this.facetsWereSet=!0,Ce.deepEqual(e,this.searchFacets??[])||this.$searchFacets.setValue(e)}setSearchFacetsCached(e){Ce.deepEqual(e,this.searchFacetsCached??[])||this.$searchFacetsCached.setValue(e)}setSearchRelatedSearches(e){Ce.deepEqual(e,this.searchRelatedSearches??[])||this.$searchRelatedSearches.setValue(e)}setSearchExternalPromotions(e){Ce.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(oe.removeXSSRiskyTags(e))}setLocationEnabled(e){this.$locationEnabled.setValue(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 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()}}class Dt{static combineResultsWithMetadata(e){const t=[],s=parseInt(e.response.start+"");return e.response.docs.forEach((a,r)=>{var o;const n=a[e.responseHeader.params.uniqueId]??"",l={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:((o=e.metadata.locationSearch)==null?void 0:o.unit)??"",unmappedFields:this.getUnmappedFields(a,e,n),allFields:this.getAllFields(a,e)};t.push(l)}),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 o=0;o<r.length;o+=2){const n={};n.value=r[o],n.parentName=a.name,n.count=r[o+1],n.type="checkbox",a.values.push(n)}}a.values.length>0&&t.push(a)}return t}static extractSearchResultsMetadata(e){var t,s,a,r,o,n,l,c,p,f;let m="",y={selectedSortOption:"",options:[]},x={enabled:!1,field:"",unit:"",filter:{enabled:!1,values:[],label:"",defaultValue:""}};e.metadata.locationSearch&&(x={enabled:e.metadata.locationSearch.enabled,field:e.metadata.locationSearch.field,unit:e.metadata.locationSearch.unit,filter:{enabled:((t=e.metadata.locationSearch.filter)==null?void 0:t.enabled)??!1,values:((s=e.metadata.locationSearch.filter)==null?void 0:s.values)??[],label:((a=e.metadata.locationSearch.filter)==null?void 0:a.label)??"",defaultValue:((r=e.metadata.locationSearch.filter)==null?void 0:r.defaultValue)??""}});let L=(o=e.metadata.results.find(C=>C.result_card==="date"))==null?void 0:o.name;if(y.options=[{key:"",value:"Relevance"},{key:L+" desc",value:"Most Recent"}],(n=e.metadata.sorts)!=null&&n.length){const C=e.metadata.sorts.map(j=>({value:j.label,key:j.name+" "+j.order}));y.options=[{key:"",value:"Relevance"},...C]}return m=((f=(p=(c=(l=e==null?void 0:e.spellcheck)==null?void 0:l.suggestions)==null?void 0:c[1])==null?void 0:p.suggestion)==null?void 0:f[0])??"",typeof m!="string"&&(m=(m==null?void 0:m.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:m,autoCorrectedQuery:e.responseHeader.params.autoCorrectedQ??"",impressions:this.getImpressions(e),sorting:y,location:x,isLocationMapped:this.doesMapExist("distance",e)}}static getImpressions(e){const t=[],s=this.combineResultsWithMetadata(e);for(const a in s){const r=s[a],o={};o.cDocId=this.getDataForAnalytics(r.uniqueId),r.title&&(o.cDocTitle=this.getDataForAnalytics(r.title)),o.position=r.position,t.push(o)}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(o=>o.result_card==="").map(o=>o.name),r=[];for(const o of a)if(Object.keys(e).includes(o)){const n=Array.isArray(e[o])?this.getHighlightedResults(o,e[o].join(", "),s,t):this.getHighlightedResults(o,e[o]+"",s,t);r.push({key:o,value:n,isImage:this.checkIfImage(e[o])})}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 o=s.metadata.results.find(l=>l.result_card===e);if(o===void 0)return null;const n=t[o.name];return n===void 0?null:typeof n=="string"?r?n:this.getHighlightedResults(o.name,n,a,s):typeof n=="number"?n:Array.isArray(n)?r?n.join(", "):this.getHighlightedResults(o.name,n.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 o=r[e];const n=this.cleanValue(o);if(n!=="")return n}}return t}static cleanValue(e){return e===null?"":typeof e=="string"?e:Array.isArray(e)?e.join(" "):""}}class Ws{constructor(e){u(this,"routeName","searchstax"),u(this,"ignoredKeys",[]),u(this,"queryStringHelper"),u(this,"titleParser"),e.routeName&&(this.routeName=e.routeName),e.ignoredKeys&&(this.ignoredKeys=e.ignoredKeys),e.title&&(this.titleParser=e.title),this.queryStringHelper=new cr(this.routeName)}updateUrl(e){const t=this.searchObjectToUrl(e);let s=typeof document<"u"?document==null?void 0:document.title:"";this.titleParser&&(s=this.titleParser(e)),typeof document<"u"&&(document.title=s),(window==null?void 0:window.location.href)!==t&&(window==null||window.history.replaceState(window.history.state,s,t))}searchObjectToUrl(e){return this.queryStringHelper.urlHasQueryParams((window==null?void 0:window.location.href)??"")?(window==null?void 0:window.location.href.split("?")[0])+"?"+this.queryStringHelper.stringify(this.searchObjectToParams(e),{ignoredKeys:this.ignoredKeys}):(window==null?void 0: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.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==null?void 0:window.location.href)??"")){const a=this.queryStringHelper.urlToParams((window==null?void 0: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){var t,s,a;const r=[];for(const o in e)if(o.startsWith(this.routeName+"[facets]")){const n=oe.removeXSSRiskyTags((t=e[o].split(":"))==null?void 0:t[0]),l=oe.removeXSSRiskyTags(decodeURIComponent((s=e[o].split(":"))==null?void 0:s[1])),c=oe.removeXSSRiskyTags(decodeURIComponent((a=e[o].split(":"))==null?void 0:a[2]));r.push({type:n,name:l,value:c})}return r}urlToSearchObject(e,t){const s=this.queryStringHelper.urlToParams(e),a=oe.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[page]"])),r=parseInt(a),o=isNaN(r)?1:r;return{query:oe.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[query]"]))||"",page:o,itemsPerPage:t,order:oe.removeXSSRiskyTags(s[this.routeName+"[order]"])||"",facets:this.extractArrayOfFacetsFromQueryParameters(s)||[],model:oe.removeXSSRiskyTags(s[this.routeName+"[model]"])||"",location:{address:oe.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][address]"]||"")),radius:oe.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][radius]"]||"")),lat:oe.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lat]"]||"")),lon:oe.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lon]"]||""))}}}}class cr{constructor(e){u(this,"routeName",""),u(this,"stringify",(t,s)=>{const a=this.filterOutIgnoredKeys(t,s.ignoredKeys);return Object.keys(a).map(r=>{const o=a[r];return Array.isArray(o)?o.map(n=>`${r}=${n}`).join("&"):`${r}=${o}`}).join("&")}),this.routeName=e}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,o]=a.split("=");t[r]=o}),t}doesParamContainRouteName(e){return e.indexOf(this.routeName)!==-1}urlHasQueryParams(e){return e.indexOf("?")!==-1}}const lt={questionURL:"http://smartsearch-dev.searchstax.co/completion/?q=",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}}function Ha(i){}function hr(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;let r="",o=!0,n,l="",c="";function p(L){const C=o?L.replace(/^\xEF\xBB\xBF/,""):L,[j,T]=ur(`${r}${C}`);for(const W of j)f(W);r=T,o=!1}function f(L){if(L===""){y();return}if(L.startsWith(":")){a&&a(L.slice(L.startsWith(": ")?2:1));return}const C=L.indexOf(":");if(C!==-1){const j=L.slice(0,C),T=L[C+1]===" "?2:1,W=L.slice(C+T);m(j,W,L);return}m(L,"",L)}function m(L,C,j){switch(L){case"event":c=C;break;case"data":l=`${l}${C}
|
|
89
|
-
`;break;case"id":n=
|
|
90
|
-
`)?l.slice(0,-1):l}),n=void 0,l="",c=""}function
|
|
91
|
-
`,s);let o=-1;if(a!==-1&&r!==-1?o=Math.min(a,r):a!==-1?o=a:r!==-1&&(o=r),o===-1){t=i.slice(s);break}else{const n=i.slice(s,o);e.push(n),s=o+1,i[s-1]==="\r"&&i[s]===`
|
|
92
|
-
`&&s++}}return[e,t]}class Qs extends Event{constructor(e,t){var s,a;super(e),this.code=(s=t==null?void 0:t.code)!=null?s:void 0,this.message=(a=t==null?void 0:t.message)!=null?a:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,t,s){return s(Us(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e(Us(this),t)}}function dr(i){const e=globalThis.DOMException;return typeof e=="function"?new e(i,"SyntaxError"):new SyntaxError(i)}function Ya(i){return i instanceof Error?"errors"in i&&Array.isArray(i.errors)?i.errors.map(Ya).join(", "):"cause"in i&&i.cause instanceof Error?`${i}: ${Ya(i.cause)}`:i.message:`${i}`}function Us(i){return{type:i.type,message:i.message,code:i.code,defaultPrevented:i.defaultPrevented,cancelable:i.cancelable,timeStamp:i.timeStamp}}var Bs=i=>{throw TypeError(i)},qa=(i,e,t)=>e.has(i)||Bs("Cannot "+t),P=(i,e,t)=>(qa(i,e,"read from private field"),t?t.call(i):e.get(i)),se=(i,e,t)=>e.has(i)?Bs("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),G=(i,e,t,s)=>(qa(i,e,"write to private field"),e.set(i,t),t),De=(i,e,t)=>(qa(i,e,"access private method"),t),me,Xe,ct,la,ca,Nt,ht,Ot,Ue,ut,dt,gt,Pt,Me,Ja,Ga,Ka,Hs,Za,Xa,Ft,es,ts;class ha extends EventTarget{constructor(e,t){var s,a;super(),se(this,Me),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,se(this,me),se(this,Xe),se(this,ct),se(this,la),se(this,ca),se(this,Nt),se(this,ht),se(this,Ot,null),se(this,Ue),se(this,ut),se(this,dt,null),se(this,gt,null),se(this,Pt,null),se(this,Ga,async r=>{var o;P(this,ut).reset();const{body:n,redirected:l,status:c,headers:p}=r;if(c===204){De(this,Me,Ft).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?G(this,ct,new URL(r.url)):G(this,ct,void 0),c!==200){De(this,Me,Ft).call(this,`Non-200 status code (${c})`,c);return}if(!(p.get("content-type")||"").startsWith("text/event-stream")){De(this,Me,Ft).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(P(this,me)===this.CLOSED)return;G(this,me,this.OPEN);const f=new Event("open");if((o=P(this,Pt))==null||o.call(this,f),this.dispatchEvent(f),typeof n!="object"||!n||!("getReader"in n)){De(this,Me,Ft).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const m=new TextDecoder,y=n.getReader();let x=!0;do{const{done:L,value:C}=await y.read();C&&P(this,ut).feed(m.decode(C,{stream:!L})),L&&(x=!1,P(this,ut).reset(),De(this,Me,es).call(this))}while(x)}),se(this,Ka,r=>{G(this,Ue,void 0),!(r.name==="AbortError"||r.type==="aborted")&&De(this,Me,es).call(this,Ya(r))}),se(this,Za,r=>{typeof r.id=="string"&&G(this,Ot,r.id);const o=new MessageEvent(r.event||"message",{data:r.data,origin:P(this,ct)?P(this,ct).origin:P(this,Xe).origin,lastEventId:r.id||""});P(this,gt)&&(!r.event||r.event==="message")&&P(this,gt).call(this,o),this.dispatchEvent(o)}),se(this,Xa,r=>{G(this,Nt,r)}),se(this,ts,()=>{G(this,ht,void 0),P(this,me)===this.CONNECTING&&De(this,Me,Ja).call(this)});try{if(e instanceof URL)G(this,Xe,e);else if(typeof e=="string")G(this,Xe,new URL(e,gr()));else throw new Error("Invalid URL")}catch{throw dr("An invalid or illegal string was specified")}G(this,ut,hr({onEvent:P(this,Za),onRetry:P(this,Xa)})),G(this,me,this.CONNECTING),G(this,Nt,3e3),G(this,ca,(s=t==null?void 0:t.fetch)!=null?s:globalThis.fetch),G(this,la,(a=t==null?void 0:t.withCredentials)!=null?a:!1),De(this,Me,Ja).call(this)}get readyState(){return P(this,me)}get url(){return P(this,Xe).href}get withCredentials(){return P(this,la)}get onerror(){return P(this,dt)}set onerror(e){G(this,dt,e)}get onmessage(){return P(this,gt)}set onmessage(e){G(this,gt,e)}get onopen(){return P(this,Pt)}set onopen(e){G(this,Pt,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(){P(this,ht)&&clearTimeout(P(this,ht)),P(this,me)!==this.CLOSED&&(P(this,Ue)&&P(this,Ue).abort(),G(this,me,this.CLOSED),G(this,Ue,void 0))}}me=new WeakMap,Xe=new WeakMap,ct=new WeakMap,la=new WeakMap,ca=new WeakMap,Nt=new WeakMap,ht=new WeakMap,Ot=new WeakMap,Ue=new WeakMap,ut=new WeakMap,dt=new WeakMap,gt=new WeakMap,Pt=new WeakMap,Me=new WeakSet,Ja=function(){G(this,me,this.CONNECTING),G(this,Ue,new AbortController),P(this,ca)(P(this,Xe),De(this,Me,Hs).call(this)).then(P(this,Ga)).catch(P(this,Ka))},Ga=new WeakMap,Ka=new WeakMap,Hs=function(){var i;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...P(this,Ot)?{"Last-Event-ID":P(this,Ot)}:void 0},cache:"no-store",signal:(i=P(this,Ue))==null?void 0:i.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},Za=new WeakMap,Xa=new WeakMap,Ft=function(i,e){var t;P(this,me)!==this.CLOSED&&G(this,me,this.CLOSED);const s=new Qs("error",{code:e,message:i});(t=P(this,dt))==null||t.call(this,s),this.dispatchEvent(s)},es=function(i,e){var t;if(P(this,me)===this.CLOSED)return;G(this,me,this.CONNECTING);const s=new Qs("error",{code:e,message:i});(t=P(this,dt))==null||t.call(this,s),this.dispatchEvent(s),G(this,ht,setTimeout(P(this,ts),P(this,Nt)))},ts=new WeakMap,ha.CONNECTING=0,ha.OPEN=1,ha.CLOSED=2;function gr(){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 Se{static attachAnalyticsScript(e){window._msq=window._msq||[];const t="https://static.searchstax.com/studio-js/v3/js/studio-analytics.js";if(document.querySelector(`script[src="${t}"]`))return;const s=e||t;var a=document.createElement("script");a.type="text/javascript",a.src=s;var r=document.getElementsByTagName("script")[0];r.parentNode&&r.parentNode.insertBefore(a,r)}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(o,n){JSON.stringify(o)===JSON.stringify(t)&&n?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(o,n){JSON.stringify(o)===JSON.stringify(t)&&n?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)}}u(Se,"subscribedToClickEvent",!1),u(Se,"msq",()=>typeof window<"u"&&window!=null&&window._msq?window==null?void 0:window._msq:[]);class pr{constructor(e,t){u(this,"cachedQuery",""),u(this,"url",""),u(this,"relatedSearches",""),u(this,"suggester",""),u(this,"authHeader"),u(this,"authHeaderRelated"),u(this,"trackApiKey",""),u(this,"session",""),u(this,"searchAuthType"),u(this,"searchAuth",""),u(this,"controllerSearch"),u(this,"signalSearch"),u(this,"controllerSuggest"),u(this,"signalSuggest"),u(this,"_authToken",""),u(this,"dataLayer"),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(r){const o=r.name+":"+r.value,n=decodeURIComponent(o).replace(" "," ").split(":");a[n[0]]?a[n[0]].push(n[1]):a[n[0]]=[n[1]]});for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)){const o=a[r],n=r;let l="";for(const c of o)l+=` ${n}:"${c}"`;s=s.concat("fq="+l.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(o=>o.json()).then(o=>{a(o)})}cacheFacets(){this.dataLayer.searchObject.query!==this.cachedQuery&&(this.cachedQuery=this.dataLayer.searchObject.query,this.search({query:this.dataLayer.searchObject.query??"*",itemsPerPage:void 0,page:1,order:"",facets:[],additionalProps:this.dataLayer.searchObject.additionalProps,location:this.dataLayer.searchObject.location,model:this.dataLayer.model},this.cacheFacetsCallback.bind(this),!0))}cacheFacetsCallback(e){let t=Dt.extractFacets(e);this.dataLayer.setSearchFacetsCached(t)}search(e,t,s=!1,a=!1){if(e.query&&e.query!=="undefined"){this.dataLayer.setSearchTerm(e.query),this.dataLayer.setLoading(!0),this.controllerSearch&&this.controllerSearch.abort(),this.controllerSearch=new AbortController,this.signalSearch=this.controllerSearch.signal;const r=new Proxy(new URLSearchParams((window==null?void 0:window.location.search)??""),{get:(m,y)=>m.get(y)??""}),o=r.languageVariant?"&fq=_language:"+r.languageVariant:"";let n=e.itemsPerPage,l=(e.itemsPerPage?e.itemsPerPage:0)*(e.page-1),c=e.order?`&sort=${e.order}`:"";const p=this.url+"?q="+encodeURIComponent(e.query.trim())+"&start="+l+this.toQueryString(e.additionalProps??[])+this.generateFacetQuery(e.facets.filter(m=>m.type==="or"||m.type==="showUnavailable"),!0)+this.generateLocationQuery(e.location)+this.generateFacetQuery(e.facets.filter(m=>m.type==="and"||m.type==="tabs"),!1)+c+`&spellcheck.correct=${this.dataLayer.autoCorrect&&!a}`+(n?`&rows=${n}`:"")+(this.dataLayer.model?`&model=${this.dataLayer.model}`:"")+"&language="+this.dataLayer.language+o,f={method:"GET",headers:this.authHeader,credentials:"same-origin",signal:this.signalSearch};s&&delete f.signal,fetch(p,f).then(m=>m.json()).then(m=>{this.dataLayer.setLoading(!1),t(m)}).catch(()=>{this.dataLayer.setLoading(!1)})}}startSSE(e,t){if(!this.dataLayer.turnAIAnswerGenerationOn||e==="*"||this.dataLayer.searchObject.page!==1)return;const s=this.dataLayer.model?`&model=${this.dataLayer.model}`:"",a=new ha(this.dataLayer.questionURL+"?q="+e+"&language="+this.dataLayer.language+s+`&spellcheck.correct=${this.dataLayer.autoCorrect}`,{fetch:(o,n)=>fetch(o,{...n,headers:{...n==null?void 0:n.headers,Authorization:this._authToken}})}),r=this.dataLayer;return a.onmessage=o=>{if(o.data===lt.question||o.data===lt.notQuestion){o.data===lt.question?(this.dataLayer.setAnswerLoading(!0),this.dataLayer.setIsQuestion(!0)):(r.setAnswerLoading(!1),this.dataLayer.setIsQuestion(!1)),r.setAnswerData("");return}if(o.data===lt.close){Se.trackAnswerData({...r.parsedData.trackingData,answer:r.$answer.getValue(),isQuestion:this.dataLayer.isQuestion}),r.setAnswerLoading(!1),a.close();return}if(o.data.indexOf("[!CAUTION]")!==-1){r.setAnswerError(!0),r.setAnswerErrorMessage("We're having trouble generating an answer. Please try again."),a.close();return}t(o.data)},a.addEventListener("error",o=>{(o.code===401||o.code===500)&&(r.setAnswerErrorMessage("We're having trouble generating an answer. Please try again."),r.setAnswerError(!0))}),a.onerror=()=>{r.setAnswerLoading(!1),a.close()},a}suggest(e,t,s){this.controllerSuggest&&this.controllerSuggest.abort(),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("&")}}/*!
|
|
75
|
+
`}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>${we(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=Xa(i);if(a===null)return s;i=a;let r='<a href="'+i+'"';return e&&(r+=' title="'+we(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=Xa(i);if(a===null)return we(t);i=a;let r=`<img src="${i}" alt="${t}"`;return e&&(r+=` title="${we(e)}"`),r+=">",r}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:we(i.text)}},ra=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""}},Se=class Fa{constructor(e){h(this,"options"),h(this,"renderer"),h(this,"textRenderer"),this.options=e||De,this.options.renderer=this.options.renderer||new jt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ra}static parse(e,t){return new Fa(t).parse(e)}static parseInline(e,t){return new Fa(t).parseInline(e)}parse(e,t=!0){var s,a;let r="";for(let o=0;o<e.length;o++){const n=e[o];if((a=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&a[n.type]){const c=n,g=this.options.extensions.renderers[c.type].call({parser:this},c);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){r+=g||"";continue}}const l=n;switch(l.type){case"space":{r+=this.renderer.space(l);continue}case"hr":{r+=this.renderer.hr(l);continue}case"heading":{r+=this.renderer.heading(l);continue}case"code":{r+=this.renderer.code(l);continue}case"table":{r+=this.renderer.table(l);continue}case"blockquote":{r+=this.renderer.blockquote(l);continue}case"list":{r+=this.renderer.list(l);continue}case"html":{r+=this.renderer.html(l);continue}case"paragraph":{r+=this.renderer.paragraph(l);continue}case"text":{let c=l,g=this.renderer.text(c);for(;o+1<e.length&&e[o+1].type==="text";)c=e[++o],g+=`
|
|
76
|
+
`+this.renderer.text(c);t?r+=this.renderer.paragraph({type:"paragraph",raw:g,text:g,tokens:[{type:"text",raw:g,text:g,escaped:!0}]}):r+=g;continue}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}parseInline(e,t=this.renderer){var s,a;let r="";for(let o=0;o<e.length;o++){const n=e[o];if((a=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&a[n.type]){const c=this.options.extensions.renderers[n.type].call({parser:this},n);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){r+=c||"";continue}}const l=n;switch(l.type){case"escape":{r+=t.text(l);break}case"html":{r+=t.html(l);break}case"link":{r+=t.link(l);break}case"image":{r+=t.image(l);break}case"strong":{r+=t.strong(l);break}case"em":{r+=t.em(l);break}case"codespan":{r+=t.codespan(l);break}case"br":{r+=t.br(l);break}case"del":{r+=t.del(l);break}case"text":{r+=t.text(l);break}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}},na,Et=(na=class{constructor(i){h(this,"options"),h(this,"block"),this.options=i||De}preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}provideLexer(){return this.block?Ce.lex:Ce.lexInline}provideParser(){return this.block?Se.parse:Se.parseInline}},h(na,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),na),Ii=class{constructor(...i){h(this,"defaults",Gt()),h(this,"options",this.setOptions),h(this,"parse",this.parseMarkdown(!0)),h(this,"parseInline",this.parseMarkdown(!1)),h(this,"Parser",Se),h(this,"Renderer",jt),h(this,"TextRenderer",ra),h(this,"Lexer",Ce),h(this,"Tokenizer",Tt),h(this,"Hooks",Et),this.use(...i)}walkTokens(i,e){var t,s;let a=[];for(const r of i)switch(a=a.concat(e.call(this,r)),r.type){case"table":{const o=r;for(const n of o.header)a=a.concat(this.walkTokens(n.tokens,e));for(const n of o.rows)for(const l of n)a=a.concat(this.walkTokens(l.tokens,e));break}case"list":{const o=r;a=a.concat(this.walkTokens(o.items,e));break}default:{const o=r;(s=(t=this.defaults.extensions)==null?void 0:t.childTokens)!=null&&s[o.type]?this.defaults.extensions.childTokens[o.type].forEach(n=>{const l=o[n].flat(1/0);a=a.concat(this.walkTokens(l,e))}):o.tokens&&(a=a.concat(this.walkTokens(o.tokens,e)))}}return a}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(...o){let n=a.renderer.apply(this,o);return n===!1&&(n=r.apply(this,o)),n}: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 jt(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 o=r,n=t.renderer[o],l=a[o];a[o]=(...c)=>{let g=n.apply(a,c);return g===!1&&(g=l.apply(a,c)),g||""}}s.renderer=a}if(t.tokenizer){const a=this.defaults.tokenizer||new Tt(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 o=r,n=t.tokenizer[o],l=a[o];a[o]=(...c)=>{let g=n.apply(a,c);return g===!1&&(g=l.apply(a,c)),g}}s.tokenizer=a}if(t.hooks){const a=this.defaults.hooks||new Et;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 o=r,n=t.hooks[o],l=a[o];Et.passThroughHooks.has(r)?a[o]=c=>{if(this.defaults.async)return Promise.resolve(n.call(a,c)).then(m=>l.call(a,m));const g=n.call(a,c);return l.call(a,g)}:a[o]=(...c)=>{let g=n.apply(a,c);return g===!1&&(g=l.apply(a,c)),g}}s.hooks=a}if(t.walkTokens){const a=this.defaults.walkTokens,r=t.walkTokens;s.walkTokens=function(o){let n=[];return n.push(r.call(this,o)),a&&(n=n.concat(a.call(this,o))),n}}this.defaults={...this.defaults,...s}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,e){return Ce.lex(i,e??this.defaults)}parser(i,e){return Se.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 o=a.hooks?a.hooks.provideLexer():i?Ce.lex:Ce.lexInline,n=a.hooks?a.hooks.provideParser():i?Se.parse:Se.parseInline;if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(e):e).then(l=>o(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=>n(l,a)).then(l=>a.hooks?a.hooks.postprocess(l):l).catch(r);try{a.hooks&&(e=a.hooks.preprocess(e));let l=o(e,a);a.hooks&&(l=a.hooks.processAllTokens(l)),a.walkTokens&&this.walkTokens(l,a.walkTokens);let c=n(l,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}catch(l){return r(l)}}}onError(i,e){return t=>{if(t.message+=`
|
|
77
|
+
Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An error occurred:</p><pre>"+we(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},Oe=new Ii;function W(i,e){return Oe.parse(i,e)}W.options=W.setOptions=function(i){return Oe.setOptions(i),W.defaults=Oe.defaults,$a(W.defaults),W},W.getDefaults=Gt,W.defaults=De,W.use=function(...i){return Oe.use(...i),W.defaults=Oe.defaults,$a(W.defaults),W},W.walkTokens=function(i,e){return Oe.walkTokens(i,e)},W.parseInline=Oe.parseInline,W.Parser=Se,W.parser=Se.parse,W.Renderer=jt,W.TextRenderer=ra,W.Lexer=Ce,W.lexer=Ce.lex,W.Tokenizer=Tt,W.Hooks=Et,W.parse=W,W.options,W.setOptions,W.use,W.walkTokens,W.parseInline,Se.parse,Ce.lex;/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:as,setPrototypeOf:ss,isFrozen:Ri,getPrototypeOf:Ni,getOwnPropertyDescriptor:Di}=Object;let{freeze:ie,seal:de,create:is}=Object,{apply:oa,construct:la}=typeof Reflect<"u"&&Reflect;ie||(ie=function(i){return i}),de||(de=function(i){return i}),oa||(oa=function(i,e,t){return i.apply(e,t)}),la||(la=function(i,e){return new i(...e)});const At=ne(Array.prototype.forEach),Oi=ne(Array.prototype.lastIndexOf),rs=ne(Array.prototype.pop),lt=ne(Array.prototype.push),Pi=ne(Array.prototype.splice),It=ne(String.prototype.toLowerCase),ca=ne(String.prototype.toString),ns=ne(String.prototype.match),ct=ne(String.prototype.replace),Fi=ne(String.prototype.indexOf),zi=ne(String.prototype.trim),ge=ne(Object.prototype.hasOwnProperty),re=ne(RegExp.prototype.test),ht=_i(TypeError);function ne(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 oa(i,e,s)}}function _i(i){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return la(i,t)}}function R(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:It;ss&&ss(i,null);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 $i(i){for(let e=0;e<i.length;e++)ge(i,e)||(i[e]=null);return i}function ke(i){const e=is(null);for(const[t,s]of as(i))ge(i,t)&&(Array.isArray(s)?e[t]=$i(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=ke(s):e[t]=s);return e}function ut(i,e){for(;i!==null;){const s=Di(i,e);if(s){if(s.get)return ne(s.get);if(typeof s.value=="function")return ne(s.value)}i=Ni(i)}function t(){return null}return t}const os=ie(["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","section","select","shadow","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"]),ha=ie(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ua=ie(["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"]),Wi=ie(["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"]),da=ie(["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"]),Qi=ie(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ls=ie(["#text"]),cs=ie(["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","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ga=ie(["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","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),hs=ie(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),Rt=ie(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Vi=de(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Hi=de(/<%[\w\W]*|[\w\W]*%>/gm),Ui=de(/\$\{[\w\W]*/gm),Bi=de(/^data-[\-\w.\u00B7-\uFFFF]+$/),Yi=de(/^aria-[\-\w]+$/),us=de(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qi=de(/^(?:\w+script|data):/i),Ji=de(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ds=de(/^html$/i),Gi=de(/^[a-z][.\w]*(-[.\w]+)+$/i);var gs=Object.freeze({__proto__:null,ARIA_ATTR:Yi,ATTR_WHITESPACE:Ji,CUSTOM_ELEMENT:Gi,DATA_ATTR:Bi,DOCTYPE_NAME:ds,ERB_EXPR:Hi,IS_ALLOWED_URI:us,IS_SCRIPT_OR_DATA:qi,MUSTACHE_EXPR:Vi,TMPLIT_EXPR:Ui});const dt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ki=function(){return typeof window>"u"?null:window},Zi=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}},ps=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ms(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ki();const e=d=>ms(d);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==dt.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const s=t,a=s.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:n,Element:l,NodeFilter:c,NamedNodeMap:g=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:m,DOMParser:p,trustedTypes:L}=i,w=l.prototype,f=ut(w,"cloneNode"),x=ut(w,"remove"),k=ut(w,"nextSibling"),I=ut(w,"childNodes"),F=ut(w,"parentNode");if(typeof o=="function"){const d=t.createElement("template");d.content&&d.content.ownerDocument&&(t=d.content.ownerDocument)}let A,D="";const{implementation:q,createNodeIterator:T,createDocumentFragment:_,getElementsByTagName:Z}=t,{importNode:xe}=s;let Q=ps();e.isSupported=typeof as=="function"&&typeof F=="function"&&q&&q.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:he,ERB_EXPR:Ne,TMPLIT_EXPR:ve,DATA_ATTR:Ft,ARIA_ATTR:zt,IS_SCRIPT_OR_DATA:_t,ATTR_WHITESPACE:xt,CUSTOM_ELEMENT:$t}=gs;let{IS_ALLOWED_URI:y}=gs,S=null;const H=R({},[...os,...ha,...ua,...da,...ls]);let P=null;const Le=R({},[...cs,...ga,...hs,...Rt]);let z=Object.seal(is(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}})),je=null,Fe=null,K=!0,be=!0,qe=!1,Wt=!0,Je=!1,Qt=!0,ze=!1,Ta=!1,ja=!1,Ge=!1,Vt=!1,Ht=!1,Es=!0,As=!1;const gn="user-content-";let Ea=!0,vt=!1,Ke={},Ze=null;const Is=R({},["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 Rs=null;const Ns=R({},["audio","video","img","source","image","track"]);let Aa=null;const Ds=R({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ut="http://www.w3.org/1998/Math/MathML",Bt="http://www.w3.org/2000/svg",Ee="http://www.w3.org/1999/xhtml";let Xe=Ee,Ia=!1,Ra=null;const pn=R({},[Ut,Bt,Ee],ca);let Yt=R({},["mi","mo","mn","ms","mtext"]),qt=R({},["annotation-xml"]);const mn=R({},["title","style","font","a","script"]);let bt=null;const fn=["application/xhtml+xml","text/html"],Ln="text/html";let X=null,et=null;const yn=t.createElement("form"),Os=function(d){return d instanceof RegExp||d instanceof Function},Na=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(et&&et===d)){if((!d||typeof d!="object")&&(d={}),d=ke(d),bt=fn.indexOf(d.PARSER_MEDIA_TYPE)===-1?Ln:d.PARSER_MEDIA_TYPE,X=bt==="application/xhtml+xml"?ca:It,S=ge(d,"ALLOWED_TAGS")?R({},d.ALLOWED_TAGS,X):H,P=ge(d,"ALLOWED_ATTR")?R({},d.ALLOWED_ATTR,X):Le,Ra=ge(d,"ALLOWED_NAMESPACES")?R({},d.ALLOWED_NAMESPACES,ca):pn,Aa=ge(d,"ADD_URI_SAFE_ATTR")?R(ke(Ds),d.ADD_URI_SAFE_ATTR,X):Ds,Rs=ge(d,"ADD_DATA_URI_TAGS")?R(ke(Ns),d.ADD_DATA_URI_TAGS,X):Ns,Ze=ge(d,"FORBID_CONTENTS")?R({},d.FORBID_CONTENTS,X):Is,je=ge(d,"FORBID_TAGS")?R({},d.FORBID_TAGS,X):ke({}),Fe=ge(d,"FORBID_ATTR")?R({},d.FORBID_ATTR,X):ke({}),Ke=ge(d,"USE_PROFILES")?d.USE_PROFILES:!1,K=d.ALLOW_ARIA_ATTR!==!1,be=d.ALLOW_DATA_ATTR!==!1,qe=d.ALLOW_UNKNOWN_PROTOCOLS||!1,Wt=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Je=d.SAFE_FOR_TEMPLATES||!1,Qt=d.SAFE_FOR_XML!==!1,ze=d.WHOLE_DOCUMENT||!1,Ge=d.RETURN_DOM||!1,Vt=d.RETURN_DOM_FRAGMENT||!1,Ht=d.RETURN_TRUSTED_TYPE||!1,ja=d.FORCE_BODY||!1,Es=d.SANITIZE_DOM!==!1,As=d.SANITIZE_NAMED_PROPS||!1,Ea=d.KEEP_CONTENT!==!1,vt=d.IN_PLACE||!1,y=d.ALLOWED_URI_REGEXP||us,Xe=d.NAMESPACE||Ee,Yt=d.MATHML_TEXT_INTEGRATION_POINTS||Yt,qt=d.HTML_INTEGRATION_POINTS||qt,z=d.CUSTOM_ELEMENT_HANDLING||{},d.CUSTOM_ELEMENT_HANDLING&&Os(d.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=d.CUSTOM_ELEMENT_HANDLING.tagNameCheck),d.CUSTOM_ELEMENT_HANDLING&&Os(d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(z.allowCustomizedBuiltInElements=d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Je&&(be=!1),Vt&&(Ge=!0),Ke&&(S=R({},ls),P=[],Ke.html===!0&&(R(S,os),R(P,cs)),Ke.svg===!0&&(R(S,ha),R(P,ga),R(P,Rt)),Ke.svgFilters===!0&&(R(S,ua),R(P,ga),R(P,Rt)),Ke.mathMl===!0&&(R(S,da),R(P,hs),R(P,Rt))),d.ADD_TAGS&&(S===H&&(S=ke(S)),R(S,d.ADD_TAGS,X)),d.ADD_ATTR&&(P===Le&&(P=ke(P)),R(P,d.ADD_ATTR,X)),d.ADD_URI_SAFE_ATTR&&R(Aa,d.ADD_URI_SAFE_ATTR,X),d.FORBID_CONTENTS&&(Ze===Is&&(Ze=ke(Ze)),R(Ze,d.FORBID_CONTENTS,X)),Ea&&(S["#text"]=!0),ze&&R(S,["html","head","body"]),S.table&&(R(S,["tbody"]),delete je.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw ht('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ht('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=d.TRUSTED_TYPES_POLICY,D=A.createHTML("")}else A===void 0&&(A=Zi(L,a)),A!==null&&typeof D=="string"&&(D=A.createHTML(""));ie&&ie(d),et=d}},Ps=R({},[...ha,...ua,...Wi]),Fs=R({},[...da,...Qi]),wn=function(d){let M=F(d);(!M||!M.tagName)&&(M={namespaceURI:Xe,tagName:"template"});const v=It(d.tagName),V=It(M.tagName);return Ra[d.namespaceURI]?d.namespaceURI===Bt?M.namespaceURI===Ee?v==="svg":M.namespaceURI===Ut?v==="svg"&&(V==="annotation-xml"||Yt[V]):!!Ps[v]:d.namespaceURI===Ut?M.namespaceURI===Ee?v==="math":M.namespaceURI===Bt?v==="math"&&qt[V]:!!Fs[v]:d.namespaceURI===Ee?M.namespaceURI===Bt&&!qt[V]||M.namespaceURI===Ut&&!Yt[V]?!1:!Fs[v]&&(mn[v]||!Ps[v]):!!(bt==="application/xhtml+xml"&&Ra[d.namespaceURI]):!1},_e=function(d){lt(e.removed,{element:d});try{F(d).removeChild(d)}catch{x(d)}},tt=function(d,M){try{lt(e.removed,{attribute:M.getAttributeNode(d),from:M})}catch{lt(e.removed,{attribute:null,from:M})}if(M.removeAttribute(d),d==="is")if(Ge||Vt)try{_e(M)}catch{}else try{M.setAttribute(d,"")}catch{}},zs=function(d){let M=null,v=null;if(ja)d="<remove></remove>"+d;else{const Y=ns(d,/^[\r\n\t ]+/);v=Y&&Y[0]}bt==="application/xhtml+xml"&&Xe===Ee&&(d='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+d+"</body></html>");const V=A?A.createHTML(d):d;if(Xe===Ee)try{M=new p().parseFromString(V,bt)}catch{}if(!M||!M.documentElement){M=q.createDocument(Xe,"template",null);try{M.documentElement.innerHTML=Ia?D:V}catch{}}const te=M.body||M.documentElement;return d&&v&&te.insertBefore(t.createTextNode(v),te.childNodes[0]||null),Xe===Ee?Z.call(M,ze?"html":"body")[0]:ze?M.documentElement:te},_s=function(d){return T.call(d.ownerDocument||d,d,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Da=function(d){return d instanceof m&&(typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||!(d.attributes instanceof g)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function")},$s=function(d){return typeof n=="function"&&d instanceof n};function Ae(d,M,v){At(d,V=>{V.call(e,M,v,et)})}const Ws=function(d){let M=null;if(Ae(Q.beforeSanitizeElements,d,null),Da(d))return _e(d),!0;const v=X(d.nodeName);if(Ae(Q.uponSanitizeElement,d,{tagName:v,allowedTags:S}),Qt&&d.hasChildNodes()&&!$s(d.firstElementChild)&&re(/<[/\w!]/g,d.innerHTML)&&re(/<[/\w!]/g,d.textContent)||d.nodeType===dt.progressingInstruction||Qt&&d.nodeType===dt.comment&&re(/<[/\w]/g,d.data))return _e(d),!0;if(!S[v]||je[v]){if(!je[v]&&Vs(v)&&(z.tagNameCheck instanceof RegExp&&re(z.tagNameCheck,v)||z.tagNameCheck instanceof Function&&z.tagNameCheck(v)))return!1;if(Ea&&!Ze[v]){const V=F(d)||d.parentNode,te=I(d)||d.childNodes;if(te&&V){const Y=te.length;for(let Ie=Y-1;Ie>=0;--Ie){const ye=f(te[Ie],!0);ye.__removalCount=(d.__removalCount||0)+1,V.insertBefore(ye,k(d))}}}return _e(d),!0}return d instanceof l&&!wn(d)||(v==="noscript"||v==="noembed"||v==="noframes")&&re(/<\/no(script|embed|frames)/i,d.innerHTML)?(_e(d),!0):(Je&&d.nodeType===dt.text&&(M=d.textContent,At([he,Ne,ve],V=>{M=ct(M,V," ")}),d.textContent!==M&&(lt(e.removed,{element:d.cloneNode()}),d.textContent=M)),Ae(Q.afterSanitizeElements,d,null),!1)},Qs=function(d,M,v){if(Es&&(M==="id"||M==="name")&&(v in t||v in yn))return!1;if(!(be&&!Fe[M]&&re(Ft,M))&&!(K&&re(zt,M))){if(!P[M]||Fe[M]){if(!(Vs(d)&&(z.tagNameCheck instanceof RegExp&&re(z.tagNameCheck,d)||z.tagNameCheck instanceof Function&&z.tagNameCheck(d))&&(z.attributeNameCheck instanceof RegExp&&re(z.attributeNameCheck,M)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(M))||M==="is"&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&re(z.tagNameCheck,v)||z.tagNameCheck instanceof Function&&z.tagNameCheck(v))))return!1}else if(!Aa[M]&&!re(y,ct(v,xt,""))&&!((M==="src"||M==="xlink:href"||M==="href")&&d!=="script"&&Fi(v,"data:")===0&&Rs[d])&&!(qe&&!re(_t,ct(v,xt,"")))&&v)return!1}return!0},Vs=function(d){return d!=="annotation-xml"&&ns(d,$t)},Hs=function(d){Ae(Q.beforeSanitizeAttributes,d,null);const{attributes:M}=d;if(!M||Da(d))return;const v={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:P,forceKeepAttr:void 0};let V=M.length;for(;V--;){const te=M[V],{name:Y,namespaceURI:Ie,value:ye}=te,Me=X(Y),Oa=ye;let ae=Y==="value"?Oa:zi(Oa);if(v.attrName=Me,v.attrValue=ae,v.keepAttr=!0,v.forceKeepAttr=void 0,Ae(Q.uponSanitizeAttribute,d,v),ae=v.attrValue,As&&(Me==="id"||Me==="name")&&(tt(Y,d),ae=gn+ae),Qt&&re(/((--!?|])>)|<\/(style|title)/i,ae)){tt(Y,d);continue}if(v.forceKeepAttr)continue;if(!v.keepAttr){tt(Y,d);continue}if(!Wt&&re(/\/>/i,ae)){tt(Y,d);continue}Je&&At([he,Ne,ve],vn=>{ae=ct(ae,vn," ")});const Us=X(d.nodeName);if(!Qs(Us,Me,ae)){tt(Y,d);continue}if(A&&typeof L=="object"&&typeof L.getAttributeType=="function"&&!Ie)switch(L.getAttributeType(Us,Me)){case"TrustedHTML":{ae=A.createHTML(ae);break}case"TrustedScriptURL":{ae=A.createScriptURL(ae);break}}if(ae!==Oa)try{Ie?d.setAttributeNS(Ie,Y,ae):d.setAttribute(Y,ae),Da(d)?_e(d):rs(e.removed)}catch{tt(Y,d)}}Ae(Q.afterSanitizeAttributes,d,null)},xn=function d(M){let v=null;const V=_s(M);for(Ae(Q.beforeSanitizeShadowDOM,M,null);v=V.nextNode();)Ae(Q.uponSanitizeShadowNode,v,null),Ws(v),Hs(v),v.content instanceof r&&d(v.content);Ae(Q.afterSanitizeShadowDOM,M,null)};return e.sanitize=function(d){let M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=null,V=null,te=null,Y=null;if(Ia=!d,Ia&&(d="<!-->"),typeof d!="string"&&!$s(d))if(typeof d.toString=="function"){if(d=d.toString(),typeof d!="string")throw ht("dirty is not a string, aborting")}else throw ht("toString is not a function");if(!e.isSupported)return d;if(Ta||Na(M),e.removed=[],typeof d=="string"&&(vt=!1),vt){if(d.nodeName){const Me=X(d.nodeName);if(!S[Me]||je[Me])throw ht("root node is forbidden and cannot be sanitized in-place")}}else if(d instanceof n)v=zs("<!---->"),V=v.ownerDocument.importNode(d,!0),V.nodeType===dt.element&&V.nodeName==="BODY"||V.nodeName==="HTML"?v=V:v.appendChild(V);else{if(!Ge&&!Je&&!ze&&d.indexOf("<")===-1)return A&&Ht?A.createHTML(d):d;if(v=zs(d),!v)return Ge?null:Ht?D:""}v&&ja&&_e(v.firstChild);const Ie=_s(vt?d:v);for(;te=Ie.nextNode();)Ws(te),Hs(te),te.content instanceof r&&xn(te.content);if(vt)return d;if(Ge){if(Vt)for(Y=_.call(v.ownerDocument);v.firstChild;)Y.appendChild(v.firstChild);else Y=v;return(P.shadowroot||P.shadowrootmode)&&(Y=xe.call(s,Y,!0)),Y}let ye=ze?v.outerHTML:v.innerHTML;return ze&&S["!doctype"]&&v.ownerDocument&&v.ownerDocument.doctype&&v.ownerDocument.doctype.name&&re(ds,v.ownerDocument.doctype.name)&&(ye="<!DOCTYPE "+v.ownerDocument.doctype.name+`>
|
|
78
|
+
`+ye),Je&&At([he,Ne,ve],Me=>{ye=ct(ye,Me," ")}),A&&Ht?A.createHTML(ye):ye},e.setConfig=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Na(d),Ta=!0},e.clearConfig=function(){et=null,Ta=!1},e.isValidAttribute=function(d,M,v){et||Na({});const V=X(d),te=X(M);return Qs(V,te,v)},e.addHook=function(d,M){typeof M=="function"&<(Q[d],M)},e.removeHook=function(d,M){if(M!==void 0){const v=Oi(Q[d],M);return v===-1?void 0:Pi(Q[d],v,1)[0]}return rs(Q[d])},e.removeHooks=function(d){Q[d]=[]},e.removeAllHooks=function(){Q=ps()},e}var fs=ms();class Xi{constructor(e){h(this,"dataLayer"),this.dataLayer=e}get answerWidgetShowMoreLimit(){return this.dataLayer.answerWidgetShowMoreLimit??100}get currentPage(){var e;return(e=this.dataLayer.searchObject)==null?void 0:e.page}get totalResults(){var e;return((e=this.dataLayer.searchResultsMetadata)==null?void 0:e.totalResultsValue)||0}get resultsPerPage(){return this.dataLayer.itemsPerPage||0}get sortOptions(){var e;return((e=this.dataLayer.searchResultsMetadata)==null?void 0:e.sorting.options)||[]}get selectedSortOption(){var e;return((e=this.dataLayer.searchResultsMetadata)==null?void 0:e.sorting.selectedSortOption)||""}get startResultIndex(){var e;return(((e=this.dataLayer.searchObject)==null?void 0:e.page)-1)*this.resultsPerPage+1}get endResultIndex(){var e;const t=(((e=this.dataLayer.searchObject)==null?void 0:e.page)-1)*this.resultsPerPage+(this.resultsPerPage??0);return t>this.totalResults?this.totalResults:t}get isFirstPage(){var e;return((e=this.dataLayer.searchObject)==null?void 0:e.page)===1}get isLastPage(){var e;return((e=this.dataLayer.searchObject)==null?void 0:e.page)>=Math.ceil(this.totalResults/this.resultsPerPage)}get percentageOfResultsLoaded(){return this.endResultIndex/this.totalResults*100}get results(){return this.dataLayer.searchResults??[]}get autoCorrectedQuery(){var e;return((e=this.dataLayer.searchResultsMetadata)==null?void 0:e.autoCorrectedQuery)||""}get originalQuery(){var e;return((e=this.dataLayer.searchObject)==null?void 0:e.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 fs.sanitize(W.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(){var e,t;return((e=this.dataLayer.searchResultsMetadata)==null?void 0:e.autoCorrectedQuery)||((t=this.dataLayer.searchObject)==null?void 0:t.query)||""}get locationSearchEnabled(){return this.dataLayer.locationEnabled??!1}get locationSearchDistanceEnabled(){var e,t,s,a,r,o,n;return((t=(e=this.dataLayer.searchLocationConfig)==null?void 0:e.locationValuesOverride)!=null&&t.locationDistanceEnabled?(a=(s=this.dataLayer.searchLocationConfig)==null?void 0:s.locationValuesOverride)==null?void 0:a.locationDistanceEnabled:(n=(o=(r=this.dataLayer.searchResultsMetadata)==null?void 0:r.location)==null?void 0:o.filter)==null?void 0:n.enabled)??!1}get locationSearchDistanceValues(){var e,t,s,a,r,o,n,l,c;const g=((t=(e=this.dataLayer.searchLocationConfig)==null?void 0:e.locationValuesOverride)==null?void 0:t.filterValues)??((r=(a=(s=this.dataLayer.searchResultsMetadata)==null?void 0:s.location)==null?void 0:a.filter)==null?void 0:r.values),m=((n=(o=this.dataLayer.searchLocationConfig)==null?void 0:o.locationValuesOverride)==null?void 0:n.filterUnit)??((c=(l=this.dataLayer.searchResultsMetadata)==null?void 0:l.location)==null?void 0:c.unit);return!g||g.length===0?[]:g.map(p=>({label:p==="any"?"Any Distance":p+" "+(m??""),value:p,isSelected:p===this.dataLayer.searchRadius})).sort((p,L)=>{const w=p.value==="any"?0:parseFloat(p.value),f=L.value==="any"?0:parseFloat(L.value);return w-f})}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 fs.sanitize(W.parse(this.dataLayer.answerErrorMessage)).replace("<br>","")}get searchExecuted(){var e,t,s;return((e=this.dataLayer.searchObject)==null?void 0:e.query)!==void 0&&((t=this.dataLayer.searchObject)==null?void 0:t.query)!=="undefined"&&((s=this.dataLayer.searchObject)==null?void 0:s.query)!==""}get selectedFacets(){var e;const t=this.dataLayer.searchFacetsCached??this.dataLayer.searchFacets;return t?(((e=this.dataLayer.searchObject)==null?void 0:e.facets)??[]).map(s=>{const a=s.name,r=s.value,o=t.find(n=>n.name===a);if(o){const n=o.values.find(l=>l.type==="range"?!1:l.type==="checkbox"?'"'+l.value+'"'===r:!1);if(n)return n}return null}).filter(s=>s!==null):[]}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,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(){var e,t,s,a;return{searchTerm:this.searchTerm,trackApiKey:((e=this.dataLayer.searchstaxConfig)==null?void 0:e.trackApiKey)??"",session:this.dataLayer.sessionIdValue,language:this.dataLayer.language,recordsPerPage:((t=this.dataLayer.searchResultsMetadata)==null?void 0:t.recordsPerPageValue)??0,totalResults:((s=this.dataLayer.searchResultsMetadata)==null?void 0:s.totalResultsValue)??0,currentPage:this.dataLayer.currentPage,latencyVal:((a=this.dataLayer.searchResultsMetadata)==null?void 0:a.latency)??0,...this.dataLayer.model?{model:this.dataLayer.model}:{}}}}class pe{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 o=e[r],n=t[r],l=this.isObject(o)&&this.isObject(n);if(l&&!this.deepEqual(o,n)||!l&&o!==n)return!1}return!0}static isObject(e){return e!=null&&typeof e=="object"}}class E{constructor(e){h(this,"value"),h(this,"observers",{}),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),o=n=>{n===t&&(e(n),this.unsubscribe(r))};return this.value===t?(e(this.value),null):(this.subscribe(o,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=o=>{o!=null&&(e(o),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 pa{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 o in a){r+="; "+o;const n=a[o];n!==!0&&(r+="="+n)}typeof document<"u"&&(document.cookie=r)}}class ee{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 er{constructor(e,t){h(this,"$searchTermChange",new E("")),h(this,"$searchLocationChange",new E("")),h(this,"$searchLocationCoordinatesDecoded",new E("")),h(this,"$searchLatChange",new E("")),h(this,"$searchLongChange",new E("")),h(this,"$searchRadiusChange",new E(void 0)),h(this,"$loadingChange",new E(!1)),h(this,"$locationError",new E(!1)),h(this,"$searchResults",new E(null)),h(this,"$searchResultsMetadata",new E(null)),h(this,"$searchAutosuggest",new E(null)),h(this,"$searchFacets",new E(null)),h(this,"$searchFacetsCached",new E(null)),h(this,"$searchstaxConfig",new E(null)),h(this,"$autosuggestResults",new E(null)),h(this,"$itemsPerPage",new E(void 0)),h(this,"$searchObject",new E({query:"",itemsPerPage:void 0,page:99999999,order:"",facets:[],additionalProps:[],location:{term:void 0,radius:void 0,lat:void 0,lon:void 0},model:""})),h(this,"$searchRelatedSearches",new E(null)),h(this,"$searchInputConfig",new E(null)),h(this,"$searchLocationConfig",new E(null)),h(this,"$searchExternalPromotions",new E(null)),h(this,"$facetsTemplateData",new E(null)),h(this,"$selectedFacetsTemplateData",new E(null)),h(this,"$paginationData",new E(null)),h(this,"$answerData",new E(null)),h(this,"$searchFeedbackData",new E(null)),h(this,"$inputWidgetTemplateData",new E(null)),h(this,"$locationWidgetTemplateData",new E(null)),h(this,"$searchSortingData",new E(null)),h(this,"$searchRelatedSearchesData",new E(null)),h(this,"$searchExternalPromotionsData",new E(null)),h(this,"$cookiesDisabled",new E(null)),h(this,"$locationDecodingLoading",new E(!1)),h(this,"$answer",new E("")),h(this,"$language",new E("en")),h(this,"$model",new E("")),h(this,"$answerLoading",new E(!1)),h(this,"$locationEnabled",new E(null)),h(this,"$answerError",new E(!1)),h(this,"$answerErrorMessage",new E("")),h(this,"$isQuestion",new E(!1)),h(this,"$inputTemplateRendered",new E(!1)),h(this,"currentPageValue",1),h(this,"isAnswerWidgetCreatedValue",!1),h(this,"renderingEngineValue",B.mustache),h(this,"parsedData",new Xi(this)),h(this,"sessionId"),h(this,"sessionIdValue",null),h(this,"autoCorrect",!0),h(this,"forceNotCorrect",!1),h(this,"lastSearchValue",""),h(this,"turnAIAnswerGenerationOn",!1),h(this,"questionURL",""),h(this,"isInfiniteScroll",!1),h(this,"firstSearchHappened",!1),h(this,"facetsWereSet",!1),h(this,"answerWidgetShowMoreLimit",100),h(this,"searchHelper"),this.sessionId=e,t&&(this.sessionIdValue=t),this.cookieHandlingCallback(t),this.$cookiesDisabled.subscribe(()=>{this.cookieHandlingCallback(t)})}cookieHandlingCallback(e){this.cookiesDisabled?(this.sessionIdValue=null,pa.deleteCookie(this.sessionId),pa.deleteCookie("ms_visitorid")):this.sessionIdValue=pa.getOrSetCookie(this.sessionId,e)}setIsInfiniteScroll(e){this.isInfiniteScroll=e}setSearchTerm(e){this.$searchTermChange.setValue(ee.removeXSSRiskyTags(e))}setSearchLocation(e){this.$searchLocationChange.setValue(ee.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,(!pe.deepEqual(e,this.searchResults??[""])||this.facetsWereSet)&&(this.facetsWereSet=!1,this.$searchResults.setValue(e))}setSearchResultsMetadata(e){pe.deepEqual(e,this.searchResultsMetadata??{})||this.$searchResultsMetadata.setValue(e)}setSearchAutosuggest(e){this.$searchAutosuggest.setValue(e)}setSearchObject(e){var t,s;let a=e;a={...a,itemsPerPage:this.itemsPerPage,model:this.model},(s=(t=this.searchstaxConfig)==null?void 0:t.hooks)!=null&&s.beforeSearch&&a&&(a=this.searchstaxConfig.hooks.beforeSearch(a)),a&&(!pe.deepEqual(a,this.searchObject??{})||this.forceNotCorrect)&&this.$searchObject.setValue(a)}setSearchFacets(e){this.facetsWereSet=!0,pe.deepEqual(e,this.searchFacets??[])||this.$searchFacets.setValue(e)}setSearchFacetsCached(e){pe.deepEqual(e,this.searchFacetsCached??[])||this.$searchFacetsCached.setValue(e)}setSearchRelatedSearches(e){pe.deepEqual(e,this.searchRelatedSearches??[])||this.$searchRelatedSearches.setValue(e)}setSearchExternalPromotions(e){pe.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(ee.removeXSSRiskyTags(e))}setLocationEnabled(e){this.$locationEnabled.setValue(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 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()}}class gt{static combineResultsWithMetadata(e){const t=[],s=parseInt(e.response.start+"");return e.response.docs.forEach((a,r)=>{var o;const n=a[e.responseHeader.params.uniqueId]??"",l={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:((o=e.metadata.locationSearch)==null?void 0:o.unit)??"",unmappedFields:this.getUnmappedFields(a,e,n),allFields:this.getAllFields(a,e)};t.push(l)}),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 o=0;o<r.length;o+=2){const n={};n.value=r[o],n.parentName=a.name,n.count=r[o+1],n.type="checkbox",a.values.push(n)}}a.values.length>0&&t.push(a)}return t}static extractSearchResultsMetadata(e){var t,s,a,r,o,n,l,c,g,m;let p="",L={selectedSortOption:"",options:[]},w={enabled:!1,field:"",unit:"",filter:{enabled:!1,values:[],label:"",defaultValue:""}};e.metadata.locationSearch&&(w={enabled:e.metadata.locationSearch.enabled,field:e.metadata.locationSearch.field,unit:e.metadata.locationSearch.unit,filter:{enabled:((t=e.metadata.locationSearch.filter)==null?void 0:t.enabled)??!1,values:((s=e.metadata.locationSearch.filter)==null?void 0:s.values)??[],label:((a=e.metadata.locationSearch.filter)==null?void 0:a.label)??"",defaultValue:((r=e.metadata.locationSearch.filter)==null?void 0:r.defaultValue)??""}});let f=(o=e.metadata.results.find(x=>x.result_card==="date"))==null?void 0:o.name;if(L.options=[{key:"",value:"Relevance"},{key:f+" desc",value:"Most Recent"}],(n=e.metadata.sorts)!=null&&n.length){const x=e.metadata.sorts.map(k=>({value:k.label,key:k.name+" "+k.order}));L.options=[{key:"",value:"Relevance"},...x]}return p=((m=(g=(c=(l=e==null?void 0:e.spellcheck)==null?void 0:l.suggestions)==null?void 0:c[1])==null?void 0:g.suggestion)==null?void 0:m[0])??"",typeof p!="string"&&(p=(p==null?void 0:p.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:p,autoCorrectedQuery:e.responseHeader.params.autoCorrectedQ??"",impressions:this.getImpressions(e),sorting:L,location:w,isLocationMapped:this.doesMapExist("distance",e)}}static getImpressions(e){const t=[],s=this.combineResultsWithMetadata(e);for(const a in s){const r=s[a],o={};o.cDocId=this.getDataForAnalytics(r.uniqueId),r.title&&(o.cDocTitle=this.getDataForAnalytics(r.title)),o.position=r.position,t.push(o)}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(o=>o.result_card==="").map(o=>o.name),r=[];for(const o of a)if(Object.keys(e).includes(o)){const n=Array.isArray(e[o])?this.getHighlightedResults(o,e[o].join(", "),s,t):this.getHighlightedResults(o,e[o]+"",s,t);r.push({key:o,value:n,isImage:this.checkIfImage(e[o])})}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 o=s.metadata.results.find(l=>l.result_card===e);if(o===void 0)return null;const n=t[o.name];return n===void 0?null:typeof n=="string"?r?n:this.getHighlightedResults(o.name,n,a,s):typeof n=="number"?n:Array.isArray(n)?r?n.join(", "):this.getHighlightedResults(o.name,n.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 o=r[e];const n=this.cleanValue(o);if(n!=="")return n}}return t}static cleanValue(e){return e===null?"":typeof e=="string"?e:Array.isArray(e)?e.join(" "):""}}class Ls{constructor(e){h(this,"routeName","searchstax"),h(this,"ignoredKeys",[]),h(this,"queryStringHelper"),h(this,"titleParser"),e.routeName&&(this.routeName=e.routeName),e.ignoredKeys&&(this.ignoredKeys=e.ignoredKeys),e.title&&(this.titleParser=e.title),this.queryStringHelper=new tr(this.routeName)}updateUrl(e){const t=this.searchObjectToUrl(e);let s=typeof document<"u"?document==null?void 0:document.title:"";this.titleParser&&(s=this.titleParser(e)),typeof document<"u"&&(document.title=s),(window==null?void 0:window.location.href)!==t&&(window==null||window.history.replaceState(window.history.state,s,t))}searchObjectToUrl(e){return this.queryStringHelper.urlHasQueryParams((window==null?void 0:window.location.href)??"")?(window==null?void 0:window.location.href.split("?")[0])+"?"+this.queryStringHelper.stringify(this.searchObjectToParams(e),{ignoredKeys:this.ignoredKeys}):(window==null?void 0: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.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==null?void 0:window.location.href)??"")){const a=this.queryStringHelper.urlToParams((window==null?void 0: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){var t,s,a;const r=[];for(const o in e)if(o.startsWith(this.routeName+"[facets]")){const n=ee.removeXSSRiskyTags((t=e[o].split(":"))==null?void 0:t[0]),l=ee.removeXSSRiskyTags(decodeURIComponent((s=e[o].split(":"))==null?void 0:s[1])),c=ee.removeXSSRiskyTags(decodeURIComponent((a=e[o].split(":"))==null?void 0:a[2]));r.push({type:n,name:l,value:c})}return r}urlToSearchObject(e,t){const s=this.queryStringHelper.urlToParams(e),a=ee.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[page]"])),r=parseInt(a),o=isNaN(r)?1:r;return{query:ee.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[query]"]))||"",page:o,itemsPerPage:t,order:ee.removeXSSRiskyTags(s[this.routeName+"[order]"])||"",facets:this.extractArrayOfFacetsFromQueryParameters(s)||[],model:ee.removeXSSRiskyTags(s[this.routeName+"[model]"])||"",location:{address:ee.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][address]"]||"")),radius:ee.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][radius]"]||"")),lat:ee.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lat]"]||"")),lon:ee.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[location][lon]"]||""))}}}}class tr{constructor(e){h(this,"routeName",""),h(this,"stringify",(t,s)=>{const a=this.filterOutIgnoredKeys(t,s.ignoredKeys);return Object.keys(a).map(r=>{const o=a[r];return Array.isArray(o)?o.map(n=>`${r}=${n}`).join("&"):`${r}=${o}`}).join("&")}),this.routeName=e}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,o]=a.split("=");t[r]=o}),t}doesParamContainRouteName(e){return e.indexOf(this.routeName)!==-1}urlHasQueryParams(e){return e.indexOf("?")!==-1}}const $e={questionURL:"http://smartsearch-dev.searchstax.co/completion/?q=",question:"I_AM_A_QUESTION",notQuestion:"I_AM_NOT_A_QUESTION",close:"CLOSE"};class ys 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}}function ma(i){}function ar(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=ma,onError:t=ma,onRetry:s=ma,onComment:a}=i;let r="",o=!0,n,l="",c="";function g(f){const x=o?f.replace(/^\xEF\xBB\xBF/,""):f,[k,I]=sr(`${r}${x}`);for(const F of k)m(F);r=I,o=!1}function m(f){if(f===""){L();return}if(f.startsWith(":")){a&&a(f.slice(f.startsWith(": ")?2:1));return}const x=f.indexOf(":");if(x!==-1){const k=f.slice(0,x),I=f[x+1]===" "?2:1,F=f.slice(x+I);p(k,F,f);return}p(f,"",f)}function p(f,x,k){switch(f){case"event":c=x;break;case"data":l=`${l}${x}
|
|
79
|
+
`;break;case"id":n=x.includes("\0")?void 0:x;break;case"retry":/^\d+$/.test(x)?s(parseInt(x,10)):t(new ys(`Invalid \`retry\` value: "${x}"`,{type:"invalid-retry",value:x,line:k}));break;default:t(new ys(`Unknown field "${f.length>20?`${f.slice(0,20)}…`:f}"`,{type:"unknown-field",field:f,value:x,line:k}));break}}function L(){l.length>0&&e({id:n,event:c||void 0,data:l.endsWith(`
|
|
80
|
+
`)?l.slice(0,-1):l}),n=void 0,l="",c=""}function w(f={}){r&&f.consume&&m(r),o=!0,n=void 0,l="",c="",r=""}return{feed:g,reset:w}}function sr(i){const e=[];let t="",s=0;for(;s<i.length;){const a=i.indexOf("\r",s),r=i.indexOf(`
|
|
81
|
+
`,s);let o=-1;if(a!==-1&&r!==-1?o=Math.min(a,r):a!==-1?a===i.length-1?o=-1:o=a:r!==-1&&(o=r),o===-1){t=i.slice(s);break}else{const n=i.slice(s,o);e.push(n),s=o+1,i[s-1]==="\r"&&i[s]===`
|
|
82
|
+
`&&s++}}return[e,t]}class ws extends Event{constructor(e,t){var s,a;super(e),this.code=(s=t==null?void 0:t.code)!=null?s:void 0,this.message=(a=t==null?void 0:t.message)!=null?a:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,t,s){return s(xs(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e(xs(this),t)}}function ir(i){const e=globalThis.DOMException;return typeof e=="function"?new e(i,"SyntaxError"):new SyntaxError(i)}function fa(i){return i instanceof Error?"errors"in i&&Array.isArray(i.errors)?i.errors.map(fa).join(", "):"cause"in i&&i.cause instanceof Error?`${i}: ${fa(i.cause)}`:i.message:`${i}`}function xs(i){return{type:i.type,message:i.message,code:i.code,defaultPrevented:i.defaultPrevented,cancelable:i.cancelable,timeStamp:i.timeStamp}}var vs=i=>{throw TypeError(i)},La=(i,e,t)=>e.has(i)||vs("Cannot "+t),N=(i,e,t)=>(La(i,e,"read from private field"),t?t.call(i):e.get(i)),J=(i,e,t)=>e.has(i)?vs("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),U=(i,e,t,s)=>(La(i,e,"write to private field"),e.set(i,t),t),Te=(i,e,t)=>(La(i,e,"access private method"),t),le,Pe,We,Nt,Dt,pt,Qe,mt,Re,Ve,He,Ue,ft,me,ya,wa,xa,bs,va,ba,Lt,Ma,Ca;class Ot extends EventTarget{constructor(e,t){var s,a;super(),J(this,me),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,J(this,le),J(this,Pe),J(this,We),J(this,Nt),J(this,Dt),J(this,pt),J(this,Qe),J(this,mt,null),J(this,Re),J(this,Ve),J(this,He,null),J(this,Ue,null),J(this,ft,null),J(this,wa,async r=>{var o;N(this,Ve).reset();const{body:n,redirected:l,status:c,headers:g}=r;if(c===204){Te(this,me,Lt).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?U(this,We,new URL(r.url)):U(this,We,void 0),c!==200){Te(this,me,Lt).call(this,`Non-200 status code (${c})`,c);return}if(!(g.get("content-type")||"").startsWith("text/event-stream")){Te(this,me,Lt).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(N(this,le)===this.CLOSED)return;U(this,le,this.OPEN);const m=new Event("open");if((o=N(this,ft))==null||o.call(this,m),this.dispatchEvent(m),typeof n!="object"||!n||!("getReader"in n)){Te(this,me,Lt).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const p=new TextDecoder,L=n.getReader();let w=!0;do{const{done:f,value:x}=await L.read();x&&N(this,Ve).feed(p.decode(x,{stream:!f})),f&&(w=!1,N(this,Ve).reset(),Te(this,me,Ma).call(this))}while(w)}),J(this,xa,r=>{U(this,Re,void 0),!(r.name==="AbortError"||r.type==="aborted")&&Te(this,me,Ma).call(this,fa(r))}),J(this,va,r=>{typeof r.id=="string"&&U(this,mt,r.id);const o=new MessageEvent(r.event||"message",{data:r.data,origin:N(this,We)?N(this,We).origin:N(this,Pe).origin,lastEventId:r.id||""});N(this,Ue)&&(!r.event||r.event==="message")&&N(this,Ue).call(this,o),this.dispatchEvent(o)}),J(this,ba,r=>{U(this,pt,r)}),J(this,Ca,()=>{U(this,Qe,void 0),N(this,le)===this.CONNECTING&&Te(this,me,ya).call(this)});try{if(e instanceof URL)U(this,Pe,e);else if(typeof e=="string")U(this,Pe,new URL(e,rr()));else throw new Error("Invalid URL")}catch{throw ir("An invalid or illegal string was specified")}U(this,Ve,ar({onEvent:N(this,va),onRetry:N(this,ba)})),U(this,le,this.CONNECTING),U(this,pt,3e3),U(this,Dt,(s=t==null?void 0:t.fetch)!=null?s:globalThis.fetch),U(this,Nt,(a=t==null?void 0:t.withCredentials)!=null?a:!1),Te(this,me,ya).call(this)}get readyState(){return N(this,le)}get url(){return N(this,Pe).href}get withCredentials(){return N(this,Nt)}get onerror(){return N(this,He)}set onerror(e){U(this,He,e)}get onmessage(){return N(this,Ue)}set onmessage(e){U(this,Ue,e)}get onopen(){return N(this,ft)}set onopen(e){U(this,ft,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(){N(this,Qe)&&clearTimeout(N(this,Qe)),N(this,le)!==this.CLOSED&&(N(this,Re)&&N(this,Re).abort(),U(this,le,this.CLOSED),U(this,Re,void 0))}}le=new WeakMap,Pe=new WeakMap,We=new WeakMap,Nt=new WeakMap,Dt=new WeakMap,pt=new WeakMap,Qe=new WeakMap,mt=new WeakMap,Re=new WeakMap,Ve=new WeakMap,He=new WeakMap,Ue=new WeakMap,ft=new WeakMap,me=new WeakSet,ya=function(){U(this,le,this.CONNECTING),U(this,Re,new AbortController),N(this,Dt)(N(this,Pe),Te(this,me,bs).call(this)).then(N(this,wa)).catch(N(this,xa))},wa=new WeakMap,xa=new WeakMap,bs=function(){var i;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...N(this,mt)?{"Last-Event-ID":N(this,mt)}:void 0},cache:"no-store",signal:(i=N(this,Re))==null?void 0:i.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},va=new WeakMap,ba=new WeakMap,Lt=function(i,e){var t;N(this,le)!==this.CLOSED&&U(this,le,this.CLOSED);const s=new ws("error",{code:e,message:i});(t=N(this,He))==null||t.call(this,s),this.dispatchEvent(s)},Ma=function(i,e){var t;if(N(this,le)===this.CLOSED)return;U(this,le,this.CONNECTING);const s=new ws("error",{code:e,message:i});(t=N(this,He))==null||t.call(this,s),this.dispatchEvent(s),U(this,Qe,setTimeout(N(this,Ca),N(this,pt)))},Ca=new WeakMap,Ot.CONNECTING=0,Ot.OPEN=1,Ot.CLOSED=2;function rr(){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 fe{static attachAnalyticsScript(e){window._msq=window._msq||[];const t="https://static.searchstax.com/studio-js/v4/js/studio-analytics.js";if(document.querySelector(`script[src="${t}"]`))return;const s=e||t;var a=document.createElement("script");a.type="text/javascript",a.src=s;var r=document.getElementsByTagName("script")[0];r.parentNode&&r.parentNode.insertBefore(a,r)}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(o,n){JSON.stringify(o)===JSON.stringify(t)&&n?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(o,n){JSON.stringify(o)===JSON.stringify(t)&&n?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)}}h(fe,"subscribedToClickEvent",!1),h(fe,"msq",()=>typeof window<"u"&&window!=null&&window._msq?window==null?void 0:window._msq:[]);class nr{constructor(e,t){h(this,"cachedQuery",""),h(this,"url",""),h(this,"relatedSearches",""),h(this,"suggester",""),h(this,"authHeader"),h(this,"authHeaderRelated"),h(this,"trackApiKey",""),h(this,"session",""),h(this,"searchAuthType"),h(this,"searchAuth",""),h(this,"controllerSearch"),h(this,"signalSearch"),h(this,"controllerSuggest"),h(this,"signalSuggest"),h(this,"_authToken",""),h(this,"dataLayer"),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(r){const o=r.name+":"+r.value,n=decodeURIComponent(o).replace(" "," ").split(":");a[n[0]]?a[n[0]].push(n[1]):a[n[0]]=[n[1]]});for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)){const o=a[r],n=r;let l="";for(const c of o)l+=` ${n}:"${c}"`;s=s.concat("fq="+l.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(o=>o.json()).then(o=>{a(o)})}cacheFacets(){this.dataLayer.searchObject.query!==this.cachedQuery&&(this.cachedQuery=this.dataLayer.searchObject.query,this.search({query:this.dataLayer.searchObject.query??"*",itemsPerPage:void 0,page:1,order:"",facets:[],additionalProps:this.dataLayer.searchObject.additionalProps,location:this.dataLayer.searchObject.location,model:this.dataLayer.model},this.cacheFacetsCallback.bind(this),!0))}cacheFacetsCallback(e){let t=gt.extractFacets(e);this.dataLayer.setSearchFacetsCached(t)}search(e,t,s=!1,a=!1){if(e.query&&e.query!=="undefined"){this.dataLayer.setSearchTerm(e.query),this.dataLayer.setLoading(!0),this.controllerSearch&&this.controllerSearch.abort(),this.controllerSearch=new AbortController,this.signalSearch=this.controllerSearch.signal;const r=this.url+this.generateQueryParams(e,a),o={method:"GET",headers:this.authHeader,credentials:"same-origin",signal:this.signalSearch};s&&delete o.signal,fetch(r,o).then(n=>n.json()).then(n=>{this.dataLayer.setLoading(!1),t(n)}).catch(()=>{this.dataLayer.setLoading(!1)})}}generateQueryParams(e,t){let s=(e.itemsPerPage?e.itemsPerPage:0)*(e.page-1),a=e.order?`&sort=${e.order}`:"",r=e.itemsPerPage;const o=new Proxy(new URLSearchParams((window==null?void 0:window.location.search)??""),{get:(l,c)=>l.get(c)??""}),n=o.languageVariant?"&fq=_language:"+o.languageVariant:"";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}`+(r?`&rows=${r}`:"")+(this.dataLayer.model?`&model=${this.dataLayer.model}`:"")+"&language="+this.dataLayer.language+n}startSSE(e,t){if(!this.dataLayer.turnAIAnswerGenerationOn||e==="*"||this.dataLayer.searchObject.page!==1)return;const s=new Ot(this.dataLayer.questionURL+this.generateQueryParams(this.dataLayer.searchObject),{fetch:(r,o)=>fetch(r,{...o,headers:{...o==null?void 0:o.headers,Authorization:this._authToken}})}),a=this.dataLayer;return s.onmessage=r=>{if(r.data===$e.question||r.data===$e.notQuestion){r.data===$e.question?(this.dataLayer.setAnswerLoading(!0),this.dataLayer.setIsQuestion(!0)):(a.setAnswerLoading(!1),this.dataLayer.setIsQuestion(!1)),a.setAnswerData("");return}if(r.data===$e.close){fe.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}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){this.controllerSuggest&&this.controllerSuggest.abort(),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("&")}}/*!
|
|
93
83
|
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
94
84
|
* http://github.com/janl/mustache.js
|
|
95
|
-
*/var
|
|
96
|
-
`&&(
|
|
85
|
+
*/var or=Object.prototype.toString,Be=Array.isArray||function(i){return or.call(i)==="[object Array]"};function Sa(i){return typeof i=="function"}function lr(i){return Be(i)?"array":typeof i}function ka(i){return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ms(i,e){return i!=null&&typeof i=="object"&&e in i}function cr(i,e){return i!=null&&typeof i!="object"&&i.hasOwnProperty&&i.hasOwnProperty(e)}var hr=RegExp.prototype.test;function ur(i,e){return hr.call(i,e)}var dr=/\S/;function gr(i){return!ur(dr,i)}var pr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function mr(i){return String(i).replace(/[&<>"'`=\/]/g,function(e){return pr[e]})}var fr=/\s*/,Lr=/\s+/,Cs=/\s*=/,yr=/\s*\}/,wr=/#|\^|\/|>|\{|&|=|!/;function xr(i,e){if(!i)return[];var t=!1,s=[],a=[],r=[],o=!1,n=!1,l="",c=0;function g(){if(o&&!n)for(;r.length;)delete a[r.pop()];else r=[];o=!1,n=!1}var m,p,L;function w(_){if(typeof _=="string"&&(_=_.split(Lr,2)),!Be(_)||_.length!==2)throw new Error("Invalid tags: "+_);m=new RegExp(ka(_[0])+"\\s*"),p=new RegExp("\\s*"+ka(_[1])),L=new RegExp("\\s*"+ka("}"+_[1]))}w(e||O.tags);for(var f=new yt(i),x,k,I,F,A,D;!f.eos();){if(x=f.pos,I=f.scanUntil(m),I)for(var q=0,T=I.length;q<T;++q)F=I.charAt(q),gr(F)?(r.push(a.length),l+=F):(n=!0,t=!0,l+=" "),a.push(["text",F,x,x+1]),x+=1,F===`
|
|
86
|
+
`&&(g(),l="",c=0,t=!1);if(!f.scan(m))break;if(o=!0,k=f.scan(wr)||"name",f.scan(fr),k==="="?(I=f.scanUntil(Cs),f.scan(Cs),f.scanUntil(p)):k==="{"?(I=f.scanUntil(L),f.scan(yr),f.scanUntil(p),k="&"):I=f.scanUntil(p),!f.scan(p))throw new Error("Unclosed tag at "+f.pos);if(k==">"?A=[k,I,x,f.pos,l,c,t]:A=[k,I,x,f.pos],c++,a.push(A),k==="#"||k==="^")s.push(A);else if(k==="/"){if(D=s.pop(),!D)throw new Error('Unopened section "'+I+'" at '+x);if(D[1]!==I)throw new Error('Unclosed section "'+D[1]+'" at '+x)}else k==="name"||k==="{"||k==="&"?n=!0:k==="="&&w(I)}if(g(),D=s.pop(),D)throw new Error('Unclosed section "'+D[1]+'" at '+f.pos);return br(vr(a))}function vr(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 br(i){for(var e=[],t=e,s=[],a,r,o=0,n=i.length;o<n;++o)switch(a=i[o],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 yt(i){this.string=i,this.tail=i,this.pos=0}yt.prototype.eos=function(){return this.tail===""},yt.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},yt.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 Ye(i,e){this.view=i,this.cache={".":this.view},this.parent=e}Ye.prototype.push=function(i){return new Ye(i,this)},Ye.prototype.lookup=function(i){var e=this.cache,t;if(e.hasOwnProperty(i))t=e[i];else{for(var s=this,a,r,o,n=!1;s;){if(i.indexOf(".")>0)for(a=s.view,r=i.split("."),o=0;a!=null&&o<r.length;)o===r.length-1&&(n=Ms(a,r[o])||cr(a,r[o])),a=a[r[o++]];else a=s.view[i],n=Ms(s.view,i);if(n){t=a;break}s=s.parent}e[i]=t}return Sa(t)&&(t=t.call(this.view)),t};function oe(){this.templateCache={_cache:{},set:function(i,e){this._cache[i]=e},get:function(i){return this._cache[i]},clear:function(){this._cache={}}}}oe.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()},oe.prototype.parse=function(i,e){var t=this.templateCache,s=i+":"+(e||O.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},oe.prototype.render=function(i,e,t,s){var a=this.getConfigTags(s),r=this.parse(i,a),o=e instanceof Ye?e:new Ye(e,void 0);return this.renderTokens(r,o,t,i,s)},oe.prototype.renderTokens=function(i,e,t,s,a){for(var r="",o,n,l,c=0,g=i.length;c<g;++c)l=void 0,o=i[c],n=o[0],n==="#"?l=this.renderSection(o,e,t,s,a):n==="^"?l=this.renderInverted(o,e,t,s,a):n===">"?l=this.renderPartial(o,e,t,a):n==="&"?l=this.unescapedValue(o,e):n==="name"?l=this.escapedValue(o,e,a):n==="text"&&(l=this.rawValue(o)),l!==void 0&&(r+=l);return r},oe.prototype.renderSection=function(i,e,t,s,a){var r=this,o="",n=e.lookup(i[1]);function l(m){return r.render(m,e,t,a)}if(n){if(Be(n))for(var c=0,g=n.length;c<g;++c)o+=this.renderTokens(i[4],e.push(n[c]),t,s,a);else if(typeof n=="object"||typeof n=="string"||typeof n=="number")o+=this.renderTokens(i[4],e.push(n),t,s,a);else if(Sa(n)){if(typeof s!="string")throw new Error("Cannot use higher-order sections without the original template");n=n.call(e.view,s.slice(i[3],i[5]),l),n!=null&&(o+=n)}else o+=this.renderTokens(i[4],e,t,s,a);return o}},oe.prototype.renderInverted=function(i,e,t,s,a){var r=e.lookup(i[1]);if(!r||Be(r)&&r.length===0)return this.renderTokens(i[4],e,t,s,a)},oe.prototype.indentPartial=function(i,e,t){for(var s=e.replace(/[^ \t]/g,""),a=i.split(`
|
|
97
87
|
`),r=0;r<a.length;r++)a[r].length&&(r>0||!t)&&(a[r]=s+a[r]);return a.join(`
|
|
98
|
-
`)},
|
|
88
|
+
`)},oe.prototype.renderPartial=function(i,e,t,s){if(t){var a=this.getConfigTags(s),r=Sa(t)?t(i[1]):t[i[1]];if(r!=null){var o=i[6],n=i[5],l=i[4],c=r;n==0&&l&&(c=this.indentPartial(r,l,o));var g=this.parse(c,a);return this.renderTokens(g,e,t,c,s)}}},oe.prototype.unescapedValue=function(i,e){var t=e.lookup(i[1]);if(t!=null)return t},oe.prototype.escapedValue=function(i,e,t){var s=this.getConfigEscape(t)||O.escape,a=e.lookup(i[1]);if(a!=null)return typeof a=="number"&&s===O.escape?String(a):s(a)},oe.prototype.rawValue=function(i){return i[1]},oe.prototype.getConfigTags=function(i){return Be(i)?i:i&&typeof i=="object"?i.tags:void 0},oe.prototype.getConfigEscape=function(i){if(i&&typeof i=="object"&&!Be(i))return i.escape};var O={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){wt.templateCache=i},get templateCache(){return wt.templateCache}},wt=new oe;O.clearCache=function(){return wt.clearCache()},O.parse=function(i,e){return wt.parse(i,e)},O.render=function(i,e,t,s){if(typeof i!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+lr(i)+'" was given as the first argument for mustache#render(template, view, partials)');return wt.render(i,e,t,s)},O.escape=mr,O.Scanner=yt,O.Context=Ye,O.Writer=oe;const Mr={main:{template:`
|
|
99
89
|
{{#shouldShowAnswer}}
|
|
100
90
|
<div class="searchstax-answer-wrap">
|
|
101
91
|
<div class="searchstax-answer-icon"></div>
|
|
@@ -132,7 +122,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An err
|
|
|
132
122
|
</div>
|
|
133
123
|
</div>
|
|
134
124
|
{{/shouldShowAnswer}}
|
|
135
|
-
`}},
|
|
125
|
+
`}},Cr={mainTemplate:{template:`
|
|
136
126
|
{{#hasExternalPromotions}}
|
|
137
127
|
<div class="searchstax-external-promotions-container" id="searchstax-external-promotions-container" data-test-id="searchstax-external-promotions-container">
|
|
138
128
|
External promotions go here
|
|
@@ -158,7 +148,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An err
|
|
|
158
148
|
</p>
|
|
159
149
|
{{/url}}
|
|
160
150
|
</div>
|
|
161
|
-
`}},
|
|
151
|
+
`}},Sr={mainTemplateDesktop:{template:`
|
|
162
152
|
{{#hasResultsOrExternalPromotions}}
|
|
163
153
|
<div class="searchstax-facets-container-desktop"></div>
|
|
164
154
|
{{/hasResultsOrExternalPromotions}}
|
|
@@ -216,7 +206,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An err
|
|
|
216
206
|
<div class="searchstax-facets-pill-label">{{value}} ({{count}})</div>
|
|
217
207
|
<div class="searchstax-facets-pill-icon-close"></div>
|
|
218
208
|
</div>
|
|
219
|
-
`,containerClass:"searchstax-facets-pill-facets"}},
|
|
209
|
+
`,containerClass:"searchstax-facets-pill-facets"}},kr={mainTemplate:{template:`
|
|
220
210
|
{{#results.length}}
|
|
221
211
|
<div class="searchstax-pagination-container" data-test-id="searchstax-pagination-container">
|
|
222
212
|
<div class="searchstax-pagination-content">
|
|
@@ -234,7 +224,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An err
|
|
|
234
224
|
<a class="searchstax-pagination-load-more" data-test-id="searchstax-pagination-load-more" tabindex="0">Show More</a>
|
|
235
225
|
{{/isLastPage}}
|
|
236
226
|
{{/results.length}}
|
|
237
|
-
`,loadMoreButtonClass:"searchstax-pagination-load-more"}},
|
|
227
|
+
`,loadMoreButtonClass:"searchstax-pagination-load-more"}},Tr={main:{template:`
|
|
238
228
|
{{#hasRelatedSearches}}
|
|
239
229
|
<div class="searchstax-related-searches-container" data-test-id="searchstax-related-searches-container" id="searchstax-related-searches-container">
|
|
240
230
|
Related searches: <span id="searchstax-related-searches"></span>
|
|
@@ -249,7 +239,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An err
|
|
|
249
239
|
<span class="searchstax-related-search searchstax-related-search-item" data-test-id="searchstax-related-search-item" aria-label="Related search: {{related_search}}" tabindex="0">
|
|
250
240
|
{{ related_search }}{{^last}}<span>,</span>{{/last}}
|
|
251
241
|
</span>
|
|
252
|
-
`,relatedSearchContainerClass:"searchstax-related-search-item"}},
|
|
242
|
+
`,relatedSearchContainerClass:"searchstax-related-search-item"}},jr={main:{template:`
|
|
253
243
|
{{#searchExecuted}}
|
|
254
244
|
<a href="#searchstax-search-results" data-test-id="searchstax-skip" class="searchstax-skip">Skip to results section</a>
|
|
255
245
|
<h4 class="searchstax-feedback-container" data-test-id="searchstax-feedback-container">
|
|
@@ -263,7 +253,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An err
|
|
|
263
253
|
{{/hasResults}}
|
|
264
254
|
</h4>
|
|
265
255
|
{{/searchExecuted}}
|
|
266
|
-
`,originalQueryClass:"searchstax-feedback-original-query"}},
|
|
256
|
+
`,originalQueryClass:"searchstax-feedback-original-query"}},Er={mainTemplate:{template:`
|
|
267
257
|
<div class="searchstax-search-input-container searchstax-search-input-container-new {{#locationEnabled}}searchstax-alternative-render{{/locationEnabled}}">
|
|
268
258
|
<div class="searchstax-search-input-wrapper">
|
|
269
259
|
<input type="text" id="searchstax-search-input" class="searchstax-search-input" placeholder="SEARCH FOR..." aria-label="Search" />
|
|
@@ -273,7 +263,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An err
|
|
|
273
263
|
</div>
|
|
274
264
|
`,searchInputId:"searchstax-search-input"},autosuggestItemTemplate:{template:`
|
|
275
265
|
<div class="searchstax-autosuggest-item-term-container">{{{term}}}</div>
|
|
276
|
-
`}},
|
|
266
|
+
`}},Ar={mainTemplate:{template:`
|
|
277
267
|
<div class="searchstax-location-input-container" data-test-id="searchstax-location-input-container">
|
|
278
268
|
<div class="searchstax-location-input-wrapper">
|
|
279
269
|
<span class="searchstax-location-input-label">NEAR</span>
|
|
@@ -291,14 +281,14 @@ Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An err
|
|
|
291
281
|
{{/shouldShowLocationDistanceDropdown}}
|
|
292
282
|
</div>
|
|
293
283
|
</div>
|
|
294
|
-
`,locationInputId:"searchstax-location-input",radiusInputId:"searchstax-location-radius-select",currentLocationActionButtonId:"searchstax-location-get-current-location"}},
|
|
284
|
+
`,locationInputId:"searchstax-location-input",radiusInputId:"searchstax-location-radius-select",currentLocationActionButtonId:"searchstax-location-get-current-location"}},Ir={mainTemplate:{template:`
|
|
295
285
|
<section aria-label="search results container" tabindex="0">
|
|
296
286
|
<div class="searchstax-search-results-container" id="searchstax-search-results-container" data-test-id="searchstax-search-results-container">
|
|
297
287
|
<div class="searchstax-search-results" id="searchstax-search-results"></div>
|
|
298
288
|
</div>
|
|
299
289
|
</section>
|
|
300
290
|
`,searchResultsContainerId:"searchstax-search-results",searchResultsAccessibilityId:"searchstax-search-results-accessibility-announcement"},searchResultTemplate:{template:`
|
|
301
|
-
<a href="{{url}}" data-searchstax-unique-result-id="{{uniqueId}}" data-test-id="searchstax-result-item-link" class="searchstax-result-item-link searchstax-result-item-link-wrapping" tabindex="0">
|
|
291
|
+
<a href="{{url}}" data-searchstax-unique-result-id="{{uniqueId}}" data-test-id="searchstax-result-item-link" class="searchstax-result-item-link searchstax-result-item-link-wrapping" tabindex="0" aria-labelledby="title-{{uniqueId}}">
|
|
302
292
|
<div class="searchstax-search-result searchstax-search-result-wrapping {{#thumbnail}} has-thumbnail {{/thumbnail}}">
|
|
303
293
|
{{#promoted}}
|
|
304
294
|
<div class="searchstax-search-result-promoted" data-test-id="searchstax-search-result-promoted"></div>
|
|
@@ -314,7 +304,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An err
|
|
|
314
304
|
<img alt="" src="{{thumbnail}}" alt="image" class="searchstax-thumbnail" data-test-id="searchstax-thumbnail">
|
|
315
305
|
{{/thumbnail}}
|
|
316
306
|
<div class="searchstax-search-result-title-container" data-test-id="searchstax-search-result-title-container">
|
|
317
|
-
<h3 class="searchstax-search-result-title">{{{title}}}</h3>
|
|
307
|
+
<h3 class="searchstax-search-result-title" id="title-{{uniqueId}}">{{{title}}}</h3>
|
|
318
308
|
</div>
|
|
319
309
|
|
|
320
310
|
{{#paths}}
|
|
@@ -364,7 +354,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An err
|
|
|
364
354
|
</ul>
|
|
365
355
|
</div>
|
|
366
356
|
{{/searchExecuted}}
|
|
367
|
-
`}}
|
|
357
|
+
`}},Rr={main:{template:`
|
|
368
358
|
{{#searchExecuted}}
|
|
369
359
|
{{#hasResultsOrExternalPromotions}}
|
|
370
360
|
<div class="searchstax-sorting-container" data-test-id="searchstax-sorting-container">
|
|
@@ -379,7 +369,7 @@ Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An err
|
|
|
379
369
|
</div>
|
|
380
370
|
{{/hasResultsOrExternalPromotions}}
|
|
381
371
|
{{/searchExecuted}}
|
|
382
|
-
`,selectId:"searchstax-search-order-select"}},
|
|
372
|
+
`,selectId:"searchstax-search-order-select"}},ce={mainTemplate:{template:`
|
|
383
373
|
<div class="sf-widget-container">
|
|
384
374
|
<div id="sf-widget" class="sf-main">
|
|
385
375
|
<a href="#" id="searchstax-open-feedback" class="sf-open-feedback" tabindex="0" aria-label="Open Search Feedback">[ - ] Search Feedback</a>
|
|
@@ -415,8 +405,8 @@ Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An err
|
|
|
415
405
|
</div>
|
|
416
406
|
</div>
|
|
417
407
|
<div class="sf-comments sf-form-group">
|
|
418
|
-
<label
|
|
419
|
-
<textarea maxlength="{{maxLength}}" class="sf-form-control" id="sf-comments" placeholder="Enter any comments relating to your search experience">{{feedbackTextArea}}</textarea>
|
|
408
|
+
<label>Comments <small> (<span class="searchstax-characters-remaining-container">2000</span> characters remaining)</small></label>
|
|
409
|
+
<textarea aria-label="Comments" maxlength="{{maxLength}}" class="sf-form-control" id="sf-comments" placeholder="Enter any comments relating to your search experience">{{feedbackTextArea}}</textarea>
|
|
420
410
|
</div>
|
|
421
411
|
<div class="sf-email sf-form-group">
|
|
422
412
|
<label for="sf-email">Email</label>
|
|
@@ -427,8 +417,8 @@ Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An err
|
|
|
427
417
|
</div>
|
|
428
418
|
</div>
|
|
429
419
|
<div class="sf-modal-footer">
|
|
430
|
-
<a href="http://searchstax.com/" target="_blank" class="left">
|
|
431
|
-
<img alt="Searchstax logo" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI0LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxMzEuNSAzOS44IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxMzEuNSAzOS44OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6I2Q2MzIwMjt9Cgkuc3Qxe2ZpbGw6IzMzNDc1QTt9Cgkuc3Qye2VuYWJsZS1iYWNrZ3JvdW5kOm5ldyAgICA7fQo8L3N0eWxlPgo8Zz4KCTxnIGlkPSJsb2dvX3g1Rl9jb2xvcl8xXyI+CgkJPGc+CgkJCTxnPgoJCQkJPGcgaWQ9IlhNTElEXzhfIj4KCQkJCQk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMC4zLDMxLjhMMS44LDMxYzAuMS0wLjEsMC4zLTAuMSwwLjUsMGw3LjQsNC4yYzAuMSwwLjEsMC4zLDAuMSwwLjUsMGw3LjMtNC4yYzAuMi0wLjEsMC4zLTAuMSwwLjUsMAoJCQkJCQlsMS40LDAuOWMwLjMsMC4yLDAuMywwLjYsMCwwLjhsLTkuMiw1LjRjLTAuMSwwLjEtMC4zLDAuMS0wLjUsMGwtOS40LTUuNEMwLDMyLjUsMCwzMiwwLjMsMzEuOHoiLz4KCQkJCTwvZz4KCQkJCTxnIGlkPSJYTUxJRF83XyI+CgkJCQkJPHBhdGggY2xhc3M9InN0MCIgZD0iTTAuMywyNi41bDEuNi0wLjljMC4xLTAuMSwwLjMtMC4xLDAuNSwwbDcuMiw0LjJjMC4xLDAuMSwwLjMsMC4xLDAuNSwwbDcuMy00LjJjMC4xLTAuMSwwLjItMC4yLDAuMi0wLjQKCQkJCQkJVjI0YzAtMC40LTAuNC0wLjYtMC43LTAuNGwtNi43LDMuOWMtMC4xLDAuMS0wLjMsMC4xLTAuNSwwTDAuMiwyMmMtMC4zLTAuMi0wLjMtMC42LDAtMC44bDkuMy01LjVjMC4xLTAuMSwwLjMtMC4xLDAuNSwwCgkJCQkJCWw1LjMsM2MwLjMsMC4yLDAuMywwLjYsMCwwLjhsLTEuNCwwLjljLTAuMiwwLjEtMC4zLDAuMS0wLjUsMGwtMy40LTJjLTAuMi0wLjEtMC4zLTAuMS0wLjUsMGwtNC40LDIuN2MtMC4zLDAuMi0wLjMsMC42LDAsMC44CgkJCQkJCWw0LjQsMi42YzAuMSwwLjEsMC4zLDAuMSwwLjUsMGw3LjMtNC4yYzAuMS0wLjEsMC4zLTAuMSwwLjUsMGwyLDEuMWMwLjIsMC4xLDAuMiwwLjIsMC4yLDAuNHY0LjdjMCwwLjItMC4xLDAuMy0wLjIsMC40CgkJCQkJCWwtOS42LDUuN2MtMC4xLDAuMS0wLjMsMC4xLTAuNSwwbC05LjQtNS41Qy0wLjEsMjcuMi0wLjEsMjYuNywwLjMsMjYuNXoiLz4KCQkJCTwvZz4KCQkJPC9nPgoJCQk8ZyBpZD0iRElOX3g1Rl9OZXh0X3g1Rl9MVF94NUZfUHJvX3g1Rl9MaWdodF94MEFfXzFfIj4KCQkJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0yNC45LDMxLjNjLTAuMS0wLjEtMC4xLTAuMiwwLTAuMmwwLjQtMC41YzAuMS0wLjEsMC4yLTAuMSwwLjIsMGMwLjcsMC42LDEuOSwxLjEsMy4yLDEuMQoJCQkJCWMxLjgsMCwyLjgtMC45LDIuOC0yLjJjMC0xLjEtMC42LTEuOS0yLjYtMi4xbC0wLjUtMC4xYy0yLjEtMC4zLTMuMi0xLjMtMy4yLTIuOWMwLTEuOSwxLjQtMy4xLDMuNS0zLjFjMS4yLDAsMi40LDAuNCwzLjEsMC45CgkJCQkJYzAuMSwwLDAuMSwwLjEsMCwwLjJsLTAuMywwLjVjLTAuMSwwLjEtMC4xLDAuMS0wLjIsMGMtMC45LTAuNS0xLjctMC44LTIuNy0wLjhjLTEuNiwwLTIuNSwwLjktMi41LDIuMWMwLDEuMSwwLjcsMS44LDIuNiwyLjEKCQkJCQlsMC41LDAuMWMyLjIsMC4zLDMuMiwxLjMsMy4yLDNjMCwxLjktMS4zLDMuMi0zLjksMy4yQzI3LjEsMzIuNiwyNS43LDMyLDI0LjksMzEuM3oiLz4KCQkJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0zNi42LDIxLjZjMC0wLjEsMC4xLTAuMiwwLjItMC4yaDYuM2MwLjEsMCwwLjIsMC4xLDAuMiwwLjJ2MC42YzAsMC4xLTAuMSwwLjItMC4yLDAuMmgtNQoJCQkJCWMtMC4zLDAtMC42LDAuMy0wLjYsMC42djNjMCwwLjMsMC4zLDAuNiwwLjYsMC42aDQuMmMwLjEsMCwwLjIsMC4xLDAuMiwwLjJ2MC42YzAsMC4xLTAuMSwwLjItMC4yLDAuMmgtNC4yCgkJCQkJYy0wLjMsMC0wLjYsMC4zLTAuNiwwLjZWMzFjMCwwLjMsMC4zLDAuNiwwLjYsMC42aDVjMC4xLDAsMC4yLDAuMSwwLjIsMC4ydjAuNmMwLDAuMS0wLjEsMC4yLTAuMiwwLjJoLTYuMwoJCQkJCWMtMC4xLDAtMC4yLTAuMS0wLjItMC4yVjIxLjZ6Ii8+CgkJCQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNNTAuMSwyMS42YzAtMC4xLDAuMS0wLjIsMC4yLTAuMmgwLjZjMC4xLDAsMC4yLDAuMSwwLjIsMC4ybDMuOCwxMC43YzAsMC4xLDAsMC4yLTAuMSwwLjJoLTAuNwoJCQkJCWMtMC4xLDAtMC4yLDAtMC4yLTAuMkw1MywyOS45Yy0wLjEtMC4yLTAuMi0wLjMtMC40LTAuM2gtNC4xYy0wLjIsMC0wLjQsMC4xLTAuNCwwLjNsLTAuOSwyLjRjMCwwLjEtMC4xLDAuMi0wLjIsMC4yaC0wLjYKCQkJCQljLTAuMSwwLTAuMS0wLjEtMC4xLTAuMkw1MC4xLDIxLjZ6IE01MS45LDI4LjdjMC4zLDAsMC42LTAuMywwLjQtMC42TDUwLjUsMjNsMCwwbC0xLjgsNWMtMC4xLDAuMywwLjEsMC42LDAuNCwwLjZoMi44VjI4Ljd6IgoJCQkJCS8+CgkJCQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNNjUsMzIuNGMtMC4xLDAtMC4xLDAtMC4yLTAuMWwtMi4zLTQuOGgtMC4ySDYwYy0wLjMsMC0wLjYsMC4zLTAuNiwwLjZ2NC4yYzAsMC4xLTAuMSwwLjItMC4yLDAuMmgtMC42CgkJCQkJYy0wLjEsMC0wLjItMC4xLTAuMi0wLjJWMjEuNmMwLTAuMSwwLjEtMC4yLDAuMi0wLjJoMy43YzIuMSwwLDMuNCwxLjIsMy40LDNjMCwxLjMtMC42LDIuMy0xLjgsMi44Yy0wLjMsMC4xLTAuNCwwLjQtMC4yLDAuNgoJCQkJCWwyLjEsNC40YzAuMSwwLjEsMCwwLjItMC4xLDAuMkg2NUw2NSwzMi40eiBNNjQuOCwyNC41YzAtMS40LTAuOS0yLjItMi40LTIuMkg2MGMtMC4zLDAtMC42LDAuMy0wLjYsMC42djMuMgoJCQkJCWMwLDAuMywwLjMsMC42LDAuNiwwLjZoMi4zQzYzLjksMjYuNiw2NC44LDI1LjksNjQuOCwyNC41eiIvPgoJCQkJPHBhdGggY2xhc3M9InN0MSIgZD0iTTY5LjYsMjYuOWMwLTAuOCwwLTEuNSwwLjEtMS45YzAuMi0yLjMsMi4zLTQuMSw0LjYtMy42YzEuMSwwLjIsMS45LDAuOSwyLjQsMS45YzAsMC4xLDAsMC4yLDAsMC4yCgkJCQkJbC0wLjUsMC4zYy0wLjEsMC0wLjIsMC0wLjItMC4xYy0wLjUtMC45LTEuMy0xLjYtMi41LTEuNmMtMS4zLDAtMi4yLDAuNi0yLjYsMS44Yy0wLjEsMC40LTAuMiwxLjEtMC4yLDNjMCwxLjgsMC4xLDIuNSwwLjIsMwoJCQkJCWMwLjQsMS4yLDEuMiwxLjgsMi42LDEuOGMxLjIsMCwyLTAuNiwyLjUtMS42YzAtMC4xLDAuMS0wLjEsMC4yLTAuMWwwLjUsMC4zYzAuMSwwLDAuMSwwLjEsMCwwLjJjLTAuNiwxLjMtMS44LDItMy4zLDIKCQkJCQljLTEuNywwLTIuOS0wLjgtMy41LTIuNUM2OS43LDI5LjYsNjkuNiwyOC44LDY5LjYsMjYuOXoiLz4KCQkJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik04MC42LDIxLjZjMC0wLjEsMC4xLTAuMiwwLjItMC4yaDAuNmMwLjEsMCwwLjIsMC4xLDAuMiwwLjJ2NC4yYzAsMC4zLDAuMywwLjYsMC42LDAuNmg0LjUKCQkJCQljMC4zLDAsMC42LTAuMywwLjYtMC42di00LjJjMC0wLjEsMC4xLTAuMiwwLjItMC4yaDAuNmMwLjEsMCwwLjIsMC4xLDAuMiwwLjJ2MTAuN2MwLDAuMS0wLjEsMC4yLTAuMiwwLjJoLTAuNgoJCQkJCWMtMC4xLDAtMC4yLTAuMS0wLjItMC4ydi00LjRjMC0wLjMtMC4zLTAuNi0wLjYtMC42aC00LjVjLTAuMywwLTAuNiwwLjMtMC42LDAuNnY0LjRjMCwwLjEtMC4xLDAuMi0wLjIsMC4yaC0wLjYKCQkJCQljLTAuMSwwLTAuMi0wLjEtMC4yLTAuMlYyMS42TDgwLjYsMjEuNnoiLz4KCQkJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik05Mi4zLDMxLjNjLTAuMS0wLjEtMC4xLTAuMiwwLTAuMmwwLjQtMC41YzAuMS0wLjEsMC4yLTAuMSwwLjIsMGMwLjcsMC42LDEuOSwxLjEsMy4yLDEuMQoJCQkJCWMxLjgsMCwyLjgtMC45LDIuOC0yLjJjMC0xLjEtMC42LTEuOS0yLjYtMi4xbC0wLjUtMC4xYy0yLjEtMC4zLTMuMi0xLjMtMy4yLTIuOWMwLTEuOSwxLjQtMy4xLDMuNS0zLjFjMS4yLDAsMi40LDAuNCwzLjEsMC45CgkJCQkJYzAuMSwwLDAuMSwwLjEsMCwwLjJsLTAuMywwLjVjLTAuMSwwLjEtMC4xLDAuMS0wLjIsMGMtMC45LTAuNS0xLjctMC44LTIuNy0wLjhjLTEuNiwwLTIuNSwwLjktMi41LDIuMWMwLDEuMSwwLjcsMS44LDIuNiwyLjEKCQkJCQlsMC41LDAuMWMyLjIsMC4zLDMuMiwxLjMsMy4yLDNjMCwxLjktMS4zLDMuMi0zLjksMy4yQzk0LjUsMzIuNiw5MywzMiw5Mi4zLDMxLjN6Ii8+CgkJCQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMTA2LjIsMzIuNGMtMC4xLDAtMC4yLTAuMS0wLjItMC4ydi05LjRjMC0wLjMtMC4zLTAuNi0wLjYtMC42aC0yLjdjLTAuMSwwLTAuMi0wLjEtMC4yLTAuMnYtMC42CgkJCQkJYzAtMC4xLDAuMS0wLjIsMC4yLTAuMmg3LjRjMC4xLDAsMC4yLDAuMSwwLjIsMC4yVjIyYzAsMC4xLTAuMSwwLjItMC4yLDAuMmgtMi43Yy0wLjMsMC0wLjYsMC4zLTAuNiwwLjZ2OS40CgkJCQkJYzAsMC4xLTAuMSwwLjItMC4yLDAuMkgxMDYuMkwxMDYuMiwzMi40eiIvPgoJCQkJPHBhdGggY2xhc3M9InN0MSIgZD0iTTExNS41LDIxLjZjMC0wLjEsMC4xLTAuMiwwLjItMC4yaDAuNmMwLjEsMCwwLjIsMC4xLDAuMiwwLjJsMy44LDEwLjdjMCwwLjEsMCwwLjItMC4xLDAuMmgtMC42CgkJCQkJYy0wLjEsMC0wLjIsMC0wLjItMC4ybC0wLjktMi40Yy0wLjEtMC4yLTAuMi0wLjMtMC40LTAuM0gxMTRjLTAuMiwwLTAuNCwwLjEtMC40LDAuM2wtMC45LDIuNGMwLDAuMS0wLjEsMC4yLTAuMiwwLjJoLTAuNgoJCQkJCWMtMC4xLDAtMC4xLTAuMS0wLjEtMC4yTDExNS41LDIxLjZ6IE0xMTcuNCwyOC43YzAuMywwLDAuNi0wLjMsMC40LTAuNkwxMTYsMjNsMCwwbC0xLjgsNS4xYy0wLjEsMC4zLDAuMSwwLjYsMC40LDAuNkgxMTcuNHoiCgkJCQkJLz4KCQkJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0xMjkuOSwzMi40Yy0wLjEsMC0wLjIsMC0wLjItMC4xbC0yLjgtNC43bDAsMGwtMi44LDQuN2MwLDAuMS0wLjEsMC4xLTAuMiwwLjFoLTAuNwoJCQkJCWMtMC4xLDAtMC4xLTAuMS0wLjEtMC4ybDMuMi01LjNjMC4xLTAuMiwwLjEtMC4zLDAtMC41bC0yLjktNC44Yy0wLjEtMC4xLDAtMC4yLDAuMS0wLjJoMC43YzAuMSwwLDAuMiwwLDAuMiwwLjFsMi41LDQuMmwwLDAKCQkJCQlsMi41LTQuMmMwLjEtMC4xLDAuMS0wLjEsMC4yLTAuMWgwLjdjMC4xLDAsMC4xLDAuMSwwLjEsMC4ybC0yLjksNC44Yy0wLjEsMC4yLTAuMSwwLjMsMCwwLjVsMy4yLDUuM2MwLDAuMSwwLDAuMi0wLjEsMC4yCgkJCQkJSDEyOS45TDEyOS45LDMyLjR6Ii8+CgkJCTwvZz4KCQk8L2c+Cgk8L2c+Cgk8ZyBjbGFzcz0ic3QyIj4KCQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMS40LDIuMUMyLDIsMi42LDEuOSwzLjUsMS45YzEsMCwxLjgsMC4yLDIuMywwLjdjMC40LDAuNCwwLjcsMSwwLjcsMS43QzYuNCw1LDYuMiw1LjYsNS44LDYKCQkJQzUuMyw2LjYsNC40LDYuOSwzLjMsNi45Yy0wLjMsMC0wLjYsMC0wLjgtMC4xVjEwaC0xVjIuMXogTTIuNSw2QzIuNyw2LDMsNiwzLjQsNmMxLjMsMCwyLTAuNiwyLTEuN2MwLTEuMS0wLjgtMS42LTEuOS0xLjYKCQkJYy0wLjUsMC0wLjgsMC0xLDAuMVY2eiIvPgoJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0xMi44LDcuMWMwLDIuMS0xLjUsMy4xLTIuOSwzLjFjLTEuNiwwLTIuOC0xLjItMi44LTNjMC0xLjksMS4zLTMuMSwyLjktMy4xQzExLjYsNC4xLDEyLjgsNS4zLDEyLjgsNy4xegoJCQkgTTguMSw3LjJjMCwxLjMsMC43LDIuMiwxLjgsMi4yYzEsMCwxLjgtMC45LDEuOC0yLjNjMC0xLTAuNS0yLjItMS43LTIuMkM4LjcsNC45LDguMSw2LDguMSw3LjJ6Ii8+CgkJPHBhdGggY2xhc3M9InN0MSIgZD0iTTE0LjQsNC4ybDAuOCwzYzAuMiwwLjYsMC4zLDEuMiwwLjQsMS44aDBjMC4xLTAuNiwwLjMtMS4yLDAuNS0xLjhsMC45LTNIMThsMC45LDIuOQoJCQljMC4yLDAuNywwLjQsMS4zLDAuNSwxLjloMGMwLjEtMC42LDAuMy0xLjIsMC40LTEuOWwwLjgtMi45aDFMMTkuOSwxMGgtMWwtMC45LTIuOGMtMC4yLTAuNi0wLjQtMS4yLTAuNS0xLjloMAoJCQljLTAuMSwwLjctMC4zLDEuMy0wLjUsMS45TDE2LjEsMTBoLTFsLTEuOC01LjhIMTQuNHoiLz4KCQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMjMuMyw3LjNjMCwxLjQsMC45LDIsMiwyYzAuOCwwLDEuMi0wLjEsMS42LTAuM2wwLjIsMC44Yy0wLjQsMC4yLTEsMC40LTEuOSwwLjRjLTEuOCwwLTIuOS0xLjItMi45LTIuOQoJCQlzMS0zLjEsMi43LTMuMWMxLjksMCwyLjQsMS43LDIuNCwyLjdjMCwwLjIsMCwwLjQsMCwwLjVIMjMuM3ogTTI2LjQsNi42YzAtMC43LTAuMy0xLjctMS41LTEuN2MtMS4xLDAtMS41LDEtMS42LDEuN0gyNi40eiIvPgoJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0yOC43LDZjMC0wLjcsMC0xLjMsMC0xLjhoMC45bDAsMS4xaDBjMC4zLTAuOCwwLjktMS4zLDEuNi0xLjNjMC4xLDAsMC4yLDAsMC4zLDB2MWMtMC4xLDAtMC4yLDAtMC40LDAKCQkJYy0wLjcsMC0xLjMsMC42LTEuNCwxLjRjMCwwLjEsMCwwLjMsMCwwLjVWMTBoLTFWNnoiLz4KCQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMzMuMSw3LjNjMCwxLjQsMC45LDIsMiwyYzAuOCwwLDEuMi0wLjEsMS42LTAuM2wwLjIsMC44Yy0wLjQsMC4yLTEsMC40LTEuOSwwLjRjLTEuOCwwLTIuOS0xLjItMi45LTIuOQoJCQlzMS0zLjEsMi43LTMuMWMxLjksMCwyLjQsMS43LDIuNCwyLjdjMCwwLjIsMCwwLjQsMCwwLjVIMzMuMXogTTM2LjIsNi42YzAtMC43LTAuMy0xLjctMS41LTEuN2MtMS4xLDAtMS41LDEtMS42LDEuN0gzNi4yeiIvPgoJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik00My42LDEuNXY3YzAsMC41LDAsMS4xLDAsMS41aC0wLjlsMC0xaDBjLTAuMywwLjYtMSwxLjEtMiwxLjFjLTEuNCwwLTIuNS0xLjItMi41LTNjMC0xLjksMS4yLTMuMSwyLjYtMy4xCgkJCWMwLjksMCwxLjUsMC40LDEuOCwwLjloMFYxLjVINDMuNnogTTQyLjUsNi42YzAtMC4xLDAtMC4zLDAtMC40Yy0wLjItMC43LTAuNy0xLjItMS41LTEuMmMtMS4xLDAtMS43LDEtMS43LDIuMgoJCQljMCwxLjIsMC42LDIuMSwxLjcsMi4xYzAuNywwLDEuNC0wLjUsMS41LTEuM2MwLTAuMSwwLTAuMywwLTAuNVY2LjZ6Ii8+CgkJPHBhdGggY2xhc3M9InN0MSIgZD0iTTQ3LjgsMTBjMC0wLjQsMC0xLDAtMS41di03aDF2My42aDBjMC40LTAuNiwxLTEuMSwyLTEuMWMxLjQsMCwyLjUsMS4yLDIuNCwzYzAsMi4xLTEuMywzLjEtMi42LDMuMQoJCQljLTAuOCwwLTEuNS0wLjMtMS45LTEuMWgwbDAsMUg0Ny44eiBNNDguOSw3LjdjMCwwLjEsMCwwLjMsMCwwLjRjMC4yLDAuNywwLjgsMS4yLDEuNiwxLjJjMS4xLDAsMS44LTAuOSwxLjgtMi4yCgkJCWMwLTEuMi0wLjYtMi4yLTEuNy0yLjJjLTAuNywwLTEuNCwwLjUtMS42LDEuM2MwLDAuMS0wLjEsMC4zLTAuMSwwLjRWNy43eiIvPgoJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik01NSw0LjJsMS4zLDMuNGMwLjEsMC40LDAuMywwLjgsMC40LDEuMmgwYzAuMS0wLjMsMC4yLTAuOCwwLjQtMS4ybDEuMi0zLjRoMS4xbC0xLjYsNC4xYy0wLjgsMi0xLjMsMy0yLDMuNgoJCQljLTAuNSwwLjUtMSwwLjYtMS4zLDAuN2wtMC4zLTAuOWMwLjMtMC4xLDAuNi0wLjMsMC45LTAuNWMwLjMtMC4yLDAuNi0wLjYsMC45LTEuMkM1NiwxMCw1Niw5LjksNTYsOS45YzAtMC4xLDAtMC4xLTAuMS0wLjMKCQkJbC0yLjEtNS4zSDU1eiIvPgoJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik02MC4zLDUuMmMwLTAuNCwwLjMtMC44LDAuNy0wLjhjMC40LDAsMC43LDAuMywwLjcsMC44YzAsMC40LTAuMywwLjctMC43LDAuN0M2MC42LDUuOSw2MC4zLDUuNiw2MC4zLDUuMnoKCQkJIE02MC4zLDkuNGMwLTAuNCwwLjMtMC44LDAuNy0wLjhjMC40LDAsMC43LDAuMywwLjcsMC44YzAsMC40LTAuMywwLjctMC43LDAuN0M2MC42LDEwLjIsNjAuMyw5LjksNjAuMyw5LjR6Ii8+Cgk8L2c+CjwvZz4KPC9zdmc+Cg==" class="sf-foot-logo">
|
|
420
|
+
<a href="http://searchstax.com/" target="_blank" class="left" tabindex="-1">
|
|
421
|
+
<img tabindex="-1" alt="Searchstax logo" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI0LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxMzEuNSAzOS44IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxMzEuNSAzOS44OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6I2Q2MzIwMjt9Cgkuc3Qxe2ZpbGw6IzMzNDc1QTt9Cgkuc3Qye2VuYWJsZS1iYWNrZ3JvdW5kOm5ldyAgICA7fQo8L3N0eWxlPgo8Zz4KCTxnIGlkPSJsb2dvX3g1Rl9jb2xvcl8xXyI+CgkJPGc+CgkJCTxnPgoJCQkJPGcgaWQ9IlhNTElEXzhfIj4KCQkJCQk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMC4zLDMxLjhMMS44LDMxYzAuMS0wLjEsMC4zLTAuMSwwLjUsMGw3LjQsNC4yYzAuMSwwLjEsMC4zLDAuMSwwLjUsMGw3LjMtNC4yYzAuMi0wLjEsMC4zLTAuMSwwLjUsMAoJCQkJCQlsMS40LDAuOWMwLjMsMC4yLDAuMywwLjYsMCwwLjhsLTkuMiw1LjRjLTAuMSwwLjEtMC4zLDAuMS0wLjUsMGwtOS40LTUuNEMwLDMyLjUsMCwzMiwwLjMsMzEuOHoiLz4KCQkJCTwvZz4KCQkJCTxnIGlkPSJYTUxJRF83XyI+CgkJCQkJPHBhdGggY2xhc3M9InN0MCIgZD0iTTAuMywyNi41bDEuNi0wLjljMC4xLTAuMSwwLjMtMC4xLDAuNSwwbDcuMiw0LjJjMC4xLDAuMSwwLjMsMC4xLDAuNSwwbDcuMy00LjJjMC4xLTAuMSwwLjItMC4yLDAuMi0wLjQKCQkJCQkJVjI0YzAtMC40LTAuNC0wLjYtMC43LTAuNGwtNi43LDMuOWMtMC4xLDAuMS0wLjMsMC4xLTAuNSwwTDAuMiwyMmMtMC4zLTAuMi0wLjMtMC42LDAtMC44bDkuMy01LjVjMC4xLTAuMSwwLjMtMC4xLDAuNSwwCgkJCQkJCWw1LjMsM2MwLjMsMC4yLDAuMywwLjYsMCwwLjhsLTEuNCwwLjljLTAuMiwwLjEtMC4zLDAuMS0wLjUsMGwtMy40LTJjLTAuMi0wLjEtMC4zLTAuMS0wLjUsMGwtNC40LDIuN2MtMC4zLDAuMi0wLjMsMC42LDAsMC44CgkJCQkJCWw0LjQsMi42YzAuMSwwLjEsMC4zLDAuMSwwLjUsMGw3LjMtNC4yYzAuMS0wLjEsMC4zLTAuMSwwLjUsMGwyLDEuMWMwLjIsMC4xLDAuMiwwLjIsMC4yLDAuNHY0LjdjMCwwLjItMC4xLDAuMy0wLjIsMC40CgkJCQkJCWwtOS42LDUuN2MtMC4xLDAuMS0wLjMsMC4xLTAuNSwwbC05LjQtNS41Qy0wLjEsMjcuMi0wLjEsMjYuNywwLjMsMjYuNXoiLz4KCQkJCTwvZz4KCQkJPC9nPgoJCQk8ZyBpZD0iRElOX3g1Rl9OZXh0X3g1Rl9MVF94NUZfUHJvX3g1Rl9MaWdodF94MEFfXzFfIj4KCQkJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0yNC45LDMxLjNjLTAuMS0wLjEtMC4xLTAuMiwwLTAuMmwwLjQtMC41YzAuMS0wLjEsMC4yLTAuMSwwLjIsMGMwLjcsMC42LDEuOSwxLjEsMy4yLDEuMQoJCQkJCWMxLjgsMCwyLjgtMC45LDIuOC0yLjJjMC0xLjEtMC42LTEuOS0yLjYtMi4xbC0wLjUtMC4xYy0yLjEtMC4zLTMuMi0xLjMtMy4yLTIuOWMwLTEuOSwxLjQtMy4xLDMuNS0zLjFjMS4yLDAsMi40LDAuNCwzLjEsMC45CgkJCQkJYzAuMSwwLDAuMSwwLjEsMCwwLjJsLTAuMywwLjVjLTAuMSwwLjEtMC4xLDAuMS0wLjIsMGMtMC45LTAuNS0xLjctMC44LTIuNy0wLjhjLTEuNiwwLTIuNSwwLjktMi41LDIuMWMwLDEuMSwwLjcsMS44LDIuNiwyLjEKCQkJCQlsMC41LDAuMWMyLjIsMC4zLDMuMiwxLjMsMy4yLDNjMCwxLjktMS4zLDMuMi0zLjksMy4yQzI3LjEsMzIuNiwyNS43LDMyLDI0LjksMzEuM3oiLz4KCQkJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0zNi42LDIxLjZjMC0wLjEsMC4xLTAuMiwwLjItMC4yaDYuM2MwLjEsMCwwLjIsMC4xLDAuMiwwLjJ2MC42YzAsMC4xLTAuMSwwLjItMC4yLDAuMmgtNQoJCQkJCWMtMC4zLDAtMC42LDAuMy0wLjYsMC42djNjMCwwLjMsMC4zLDAuNiwwLjYsMC42aDQuMmMwLjEsMCwwLjIsMC4xLDAuMiwwLjJ2MC42YzAsMC4xLTAuMSwwLjItMC4yLDAuMmgtNC4yCgkJCQkJYy0wLjMsMC0wLjYsMC4zLTAuNiwwLjZWMzFjMCwwLjMsMC4zLDAuNiwwLjYsMC42aDVjMC4xLDAsMC4yLDAuMSwwLjIsMC4ydjAuNmMwLDAuMS0wLjEsMC4yLTAuMiwwLjJoLTYuMwoJCQkJCWMtMC4xLDAtMC4yLTAuMS0wLjItMC4yVjIxLjZ6Ii8+CgkJCQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNNTAuMSwyMS42YzAtMC4xLDAuMS0wLjIsMC4yLTAuMmgwLjZjMC4xLDAsMC4yLDAuMSwwLjIsMC4ybDMuOCwxMC43YzAsMC4xLDAsMC4yLTAuMSwwLjJoLTAuNwoJCQkJCWMtMC4xLDAtMC4yLDAtMC4yLTAuMkw1MywyOS45Yy0wLjEtMC4yLTAuMi0wLjMtMC40LTAuM2gtNC4xYy0wLjIsMC0wLjQsMC4xLTAuNCwwLjNsLTAuOSwyLjRjMCwwLjEtMC4xLDAuMi0wLjIsMC4yaC0wLjYKCQkJCQljLTAuMSwwLTAuMS0wLjEtMC4xLTAuMkw1MC4xLDIxLjZ6IE01MS45LDI4LjdjMC4zLDAsMC42LTAuMywwLjQtMC42TDUwLjUsMjNsMCwwbC0xLjgsNWMtMC4xLDAuMywwLjEsMC42LDAuNCwwLjZoMi44VjI4Ljd6IgoJCQkJCS8+CgkJCQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNNjUsMzIuNGMtMC4xLDAtMC4xLDAtMC4yLTAuMWwtMi4zLTQuOGgtMC4ySDYwYy0wLjMsMC0wLjYsMC4zLTAuNiwwLjZ2NC4yYzAsMC4xLTAuMSwwLjItMC4yLDAuMmgtMC42CgkJCQkJYy0wLjEsMC0wLjItMC4xLTAuMi0wLjJWMjEuNmMwLTAuMSwwLjEtMC4yLDAuMi0wLjJoMy43YzIuMSwwLDMuNCwxLjIsMy40LDNjMCwxLjMtMC42LDIuMy0xLjgsMi44Yy0wLjMsMC4xLTAuNCwwLjQtMC4yLDAuNgoJCQkJCWwyLjEsNC40YzAuMSwwLjEsMCwwLjItMC4xLDAuMkg2NUw2NSwzMi40eiBNNjQuOCwyNC41YzAtMS40LTAuOS0yLjItMi40LTIuMkg2MGMtMC4zLDAtMC42LDAuMy0wLjYsMC42djMuMgoJCQkJCWMwLDAuMywwLjMsMC42LDAuNiwwLjZoMi4zQzYzLjksMjYuNiw2NC44LDI1LjksNjQuOCwyNC41eiIvPgoJCQkJPHBhdGggY2xhc3M9InN0MSIgZD0iTTY5LjYsMjYuOWMwLTAuOCwwLTEuNSwwLjEtMS45YzAuMi0yLjMsMi4zLTQuMSw0LjYtMy42YzEuMSwwLjIsMS45LDAuOSwyLjQsMS45YzAsMC4xLDAsMC4yLDAsMC4yCgkJCQkJbC0wLjUsMC4zYy0wLjEsMC0wLjIsMC0wLjItMC4xYy0wLjUtMC45LTEuMy0xLjYtMi41LTEuNmMtMS4zLDAtMi4yLDAuNi0yLjYsMS44Yy0wLjEsMC40LTAuMiwxLjEtMC4yLDNjMCwxLjgsMC4xLDIuNSwwLjIsMwoJCQkJCWMwLjQsMS4yLDEuMiwxLjgsMi42LDEuOGMxLjIsMCwyLTAuNiwyLjUtMS42YzAtMC4xLDAuMS0wLjEsMC4yLTAuMWwwLjUsMC4zYzAuMSwwLDAuMSwwLjEsMCwwLjJjLTAuNiwxLjMtMS44LDItMy4zLDIKCQkJCQljLTEuNywwLTIuOS0wLjgtMy41LTIuNUM2OS43LDI5LjYsNjkuNiwyOC44LDY5LjYsMjYuOXoiLz4KCQkJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik04MC42LDIxLjZjMC0wLjEsMC4xLTAuMiwwLjItMC4yaDAuNmMwLjEsMCwwLjIsMC4xLDAuMiwwLjJ2NC4yYzAsMC4zLDAuMywwLjYsMC42LDAuNmg0LjUKCQkJCQljMC4zLDAsMC42LTAuMywwLjYtMC42di00LjJjMC0wLjEsMC4xLTAuMiwwLjItMC4yaDAuNmMwLjEsMCwwLjIsMC4xLDAuMiwwLjJ2MTAuN2MwLDAuMS0wLjEsMC4yLTAuMiwwLjJoLTAuNgoJCQkJCWMtMC4xLDAtMC4yLTAuMS0wLjItMC4ydi00LjRjMC0wLjMtMC4zLTAuNi0wLjYtMC42aC00LjVjLTAuMywwLTAuNiwwLjMtMC42LDAuNnY0LjRjMCwwLjEtMC4xLDAuMi0wLjIsMC4yaC0wLjYKCQkJCQljLTAuMSwwLTAuMi0wLjEtMC4yLTAuMlYyMS42TDgwLjYsMjEuNnoiLz4KCQkJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik05Mi4zLDMxLjNjLTAuMS0wLjEtMC4xLTAuMiwwLTAuMmwwLjQtMC41YzAuMS0wLjEsMC4yLTAuMSwwLjIsMGMwLjcsMC42LDEuOSwxLjEsMy4yLDEuMQoJCQkJCWMxLjgsMCwyLjgtMC45LDIuOC0yLjJjMC0xLjEtMC42LTEuOS0yLjYtMi4xbC0wLjUtMC4xYy0yLjEtMC4zLTMuMi0xLjMtMy4yLTIuOWMwLTEuOSwxLjQtMy4xLDMuNS0zLjFjMS4yLDAsMi40LDAuNCwzLjEsMC45CgkJCQkJYzAuMSwwLDAuMSwwLjEsMCwwLjJsLTAuMywwLjVjLTAuMSwwLjEtMC4xLDAuMS0wLjIsMGMtMC45LTAuNS0xLjctMC44LTIuNy0wLjhjLTEuNiwwLTIuNSwwLjktMi41LDIuMWMwLDEuMSwwLjcsMS44LDIuNiwyLjEKCQkJCQlsMC41LDAuMWMyLjIsMC4zLDMuMiwxLjMsMy4yLDNjMCwxLjktMS4zLDMuMi0zLjksMy4yQzk0LjUsMzIuNiw5MywzMiw5Mi4zLDMxLjN6Ii8+CgkJCQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMTA2LjIsMzIuNGMtMC4xLDAtMC4yLTAuMS0wLjItMC4ydi05LjRjMC0wLjMtMC4zLTAuNi0wLjYtMC42aC0yLjdjLTAuMSwwLTAuMi0wLjEtMC4yLTAuMnYtMC42CgkJCQkJYzAtMC4xLDAuMS0wLjIsMC4yLTAuMmg3LjRjMC4xLDAsMC4yLDAuMSwwLjIsMC4yVjIyYzAsMC4xLTAuMSwwLjItMC4yLDAuMmgtMi43Yy0wLjMsMC0wLjYsMC4zLTAuNiwwLjZ2OS40CgkJCQkJYzAsMC4xLTAuMSwwLjItMC4yLDAuMkgxMDYuMkwxMDYuMiwzMi40eiIvPgoJCQkJPHBhdGggY2xhc3M9InN0MSIgZD0iTTExNS41LDIxLjZjMC0wLjEsMC4xLTAuMiwwLjItMC4yaDAuNmMwLjEsMCwwLjIsMC4xLDAuMiwwLjJsMy44LDEwLjdjMCwwLjEsMCwwLjItMC4xLDAuMmgtMC42CgkJCQkJYy0wLjEsMC0wLjIsMC0wLjItMC4ybC0wLjktMi40Yy0wLjEtMC4yLTAuMi0wLjMtMC40LTAuM0gxMTRjLTAuMiwwLTAuNCwwLjEtMC40LDAuM2wtMC45LDIuNGMwLDAuMS0wLjEsMC4yLTAuMiwwLjJoLTAuNgoJCQkJCWMtMC4xLDAtMC4xLTAuMS0wLjEtMC4yTDExNS41LDIxLjZ6IE0xMTcuNCwyOC43YzAuMywwLDAuNi0wLjMsMC40LTAuNkwxMTYsMjNsMCwwbC0xLjgsNS4xYy0wLjEsMC4zLDAuMSwwLjYsMC40LDAuNkgxMTcuNHoiCgkJCQkJLz4KCQkJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0xMjkuOSwzMi40Yy0wLjEsMC0wLjIsMC0wLjItMC4xbC0yLjgtNC43bDAsMGwtMi44LDQuN2MwLDAuMS0wLjEsMC4xLTAuMiwwLjFoLTAuNwoJCQkJCWMtMC4xLDAtMC4xLTAuMS0wLjEtMC4ybDMuMi01LjNjMC4xLTAuMiwwLjEtMC4zLDAtMC41bC0yLjktNC44Yy0wLjEtMC4xLDAtMC4yLDAuMS0wLjJoMC43YzAuMSwwLDAuMiwwLDAuMiwwLjFsMi41LDQuMmwwLDAKCQkJCQlsMi41LTQuMmMwLjEtMC4xLDAuMS0wLjEsMC4yLTAuMWgwLjdjMC4xLDAsMC4xLDAuMSwwLjEsMC4ybC0yLjksNC44Yy0wLjEsMC4yLTAuMSwwLjMsMCwwLjVsMy4yLDUuM2MwLDAuMSwwLDAuMi0wLjEsMC4yCgkJCQkJSDEyOS45TDEyOS45LDMyLjR6Ii8+CgkJCTwvZz4KCQk8L2c+Cgk8L2c+Cgk8ZyBjbGFzcz0ic3QyIj4KCQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMS40LDIuMUMyLDIsMi42LDEuOSwzLjUsMS45YzEsMCwxLjgsMC4yLDIuMywwLjdjMC40LDAuNCwwLjcsMSwwLjcsMS43QzYuNCw1LDYuMiw1LjYsNS44LDYKCQkJQzUuMyw2LjYsNC40LDYuOSwzLjMsNi45Yy0wLjMsMC0wLjYsMC0wLjgtMC4xVjEwaC0xVjIuMXogTTIuNSw2QzIuNyw2LDMsNiwzLjQsNmMxLjMsMCwyLTAuNiwyLTEuN2MwLTEuMS0wLjgtMS42LTEuOS0xLjYKCQkJYy0wLjUsMC0wLjgsMC0xLDAuMVY2eiIvPgoJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0xMi44LDcuMWMwLDIuMS0xLjUsMy4xLTIuOSwzLjFjLTEuNiwwLTIuOC0xLjItMi44LTNjMC0xLjksMS4zLTMuMSwyLjktMy4xQzExLjYsNC4xLDEyLjgsNS4zLDEyLjgsNy4xegoJCQkgTTguMSw3LjJjMCwxLjMsMC43LDIuMiwxLjgsMi4yYzEsMCwxLjgtMC45LDEuOC0yLjNjMC0xLTAuNS0yLjItMS43LTIuMkM4LjcsNC45LDguMSw2LDguMSw3LjJ6Ii8+CgkJPHBhdGggY2xhc3M9InN0MSIgZD0iTTE0LjQsNC4ybDAuOCwzYzAuMiwwLjYsMC4zLDEuMiwwLjQsMS44aDBjMC4xLTAuNiwwLjMtMS4yLDAuNS0xLjhsMC45LTNIMThsMC45LDIuOQoJCQljMC4yLDAuNywwLjQsMS4zLDAuNSwxLjloMGMwLjEtMC42LDAuMy0xLjIsMC40LTEuOWwwLjgtMi45aDFMMTkuOSwxMGgtMWwtMC45LTIuOGMtMC4yLTAuNi0wLjQtMS4yLTAuNS0xLjloMAoJCQljLTAuMSwwLjctMC4zLDEuMy0wLjUsMS45TDE2LjEsMTBoLTFsLTEuOC01LjhIMTQuNHoiLz4KCQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMjMuMyw3LjNjMCwxLjQsMC45LDIsMiwyYzAuOCwwLDEuMi0wLjEsMS42LTAuM2wwLjIsMC44Yy0wLjQsMC4yLTEsMC40LTEuOSwwLjRjLTEuOCwwLTIuOS0xLjItMi45LTIuOQoJCQlzMS0zLjEsMi43LTMuMWMxLjksMCwyLjQsMS43LDIuNCwyLjdjMCwwLjIsMCwwLjQsMCwwLjVIMjMuM3ogTTI2LjQsNi42YzAtMC43LTAuMy0xLjctMS41LTEuN2MtMS4xLDAtMS41LDEtMS42LDEuN0gyNi40eiIvPgoJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0yOC43LDZjMC0wLjcsMC0xLjMsMC0xLjhoMC45bDAsMS4xaDBjMC4zLTAuOCwwLjktMS4zLDEuNi0xLjNjMC4xLDAsMC4yLDAsMC4zLDB2MWMtMC4xLDAtMC4yLDAtMC40LDAKCQkJYy0wLjcsMC0xLjMsMC42LTEuNCwxLjRjMCwwLjEsMCwwLjMsMCwwLjVWMTBoLTFWNnoiLz4KCQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMzMuMSw3LjNjMCwxLjQsMC45LDIsMiwyYzAuOCwwLDEuMi0wLjEsMS42LTAuM2wwLjIsMC44Yy0wLjQsMC4yLTEsMC40LTEuOSwwLjRjLTEuOCwwLTIuOS0xLjItMi45LTIuOQoJCQlzMS0zLjEsMi43LTMuMWMxLjksMCwyLjQsMS43LDIuNCwyLjdjMCwwLjIsMCwwLjQsMCwwLjVIMzMuMXogTTM2LjIsNi42YzAtMC43LTAuMy0xLjctMS41LTEuN2MtMS4xLDAtMS41LDEtMS42LDEuN0gzNi4yeiIvPgoJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik00My42LDEuNXY3YzAsMC41LDAsMS4xLDAsMS41aC0wLjlsMC0xaDBjLTAuMywwLjYtMSwxLjEtMiwxLjFjLTEuNCwwLTIuNS0xLjItMi41LTNjMC0xLjksMS4yLTMuMSwyLjYtMy4xCgkJCWMwLjksMCwxLjUsMC40LDEuOCwwLjloMFYxLjVINDMuNnogTTQyLjUsNi42YzAtMC4xLDAtMC4zLDAtMC40Yy0wLjItMC43LTAuNy0xLjItMS41LTEuMmMtMS4xLDAtMS43LDEtMS43LDIuMgoJCQljMCwxLjIsMC42LDIuMSwxLjcsMi4xYzAuNywwLDEuNC0wLjUsMS41LTEuM2MwLTAuMSwwLTAuMywwLTAuNVY2LjZ6Ii8+CgkJPHBhdGggY2xhc3M9InN0MSIgZD0iTTQ3LjgsMTBjMC0wLjQsMC0xLDAtMS41di03aDF2My42aDBjMC40LTAuNiwxLTEuMSwyLTEuMWMxLjQsMCwyLjUsMS4yLDIuNCwzYzAsMi4xLTEuMywzLjEtMi42LDMuMQoJCQljLTAuOCwwLTEuNS0wLjMtMS45LTEuMWgwbDAsMUg0Ny44eiBNNDguOSw3LjdjMCwwLjEsMCwwLjMsMCwwLjRjMC4yLDAuNywwLjgsMS4yLDEuNiwxLjJjMS4xLDAsMS44LTAuOSwxLjgtMi4yCgkJCWMwLTEuMi0wLjYtMi4yLTEuNy0yLjJjLTAuNywwLTEuNCwwLjUtMS42LDEuM2MwLDAuMS0wLjEsMC4zLTAuMSwwLjRWNy43eiIvPgoJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik01NSw0LjJsMS4zLDMuNGMwLjEsMC40LDAuMywwLjgsMC40LDEuMmgwYzAuMS0wLjMsMC4yLTAuOCwwLjQtMS4ybDEuMi0zLjRoMS4xbC0xLjYsNC4xYy0wLjgsMi0xLjMsMy0yLDMuNgoJCQljLTAuNSwwLjUtMSwwLjYtMS4zLDAuN2wtMC4zLTAuOWMwLjMtMC4xLDAuNi0wLjMsMC45LTAuNWMwLjMtMC4yLDAuNi0wLjYsMC45LTEuMkM1NiwxMCw1Niw5LjksNTYsOS45YzAtMC4xLDAtMC4xLTAuMS0wLjMKCQkJbC0yLjEtNS4zSDU1eiIvPgoJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik02MC4zLDUuMmMwLTAuNCwwLjMtMC44LDAuNy0wLjhjMC40LDAsMC43LDAuMywwLjcsMC44YzAsMC40LTAuMywwLjctMC43LDAuN0M2MC42LDUuOSw2MC4zLDUuNiw2MC4zLDUuMnoKCQkJIE02MC4zLDkuNGMwLTAuNCwwLjMtMC44LDAuNy0wLjhjMC40LDAsMC43LDAuMywwLjcsMC44YzAsMC40LTAuMywwLjctMC43LDAuN0M2MC42LDEwLjIsNjAuMyw5LjksNjAuMyw5LjR6Ii8+Cgk8L2c+CjwvZz4KPC9zdmc+Cg==" class="sf-foot-logo" tabindex="-1">
|
|
432
422
|
</a>
|
|
433
423
|
{{#submitted}}
|
|
434
424
|
<span class="sf-btn sf-btn-sent sf-btn-success">✓ Sent</span>
|
|
@@ -456,4 +446,4 @@ Please report this to https://github.com/markedjs/marked.`,i){const s="<p>An err
|
|
|
456
446
|
|
|
457
447
|
</div>
|
|
458
448
|
</div>
|
|
459
|
-
`,thumbsUpButtonClass:"searchstax-lightweight-widget-thumbs-up",thumbsDownButtonClass:"searchstax-lightweight-widget-thumbs-down"}};class k{}u(k,"answer",Ir),u(k,"externalPromotions",Rr),u(k,"facets",Dr),u(k,"pagination",Nr),u(k,"relatedSearches",Or),u(k,"searchFeedback",Pr),u(k,"searchInput",Fr),u(k,"location",zr),u(k,"searchResults",_r),u(k,"sorting",$r),u(k,"feedback",fe);class Wr{constructor(e){u(this,"dataLayer"),u(this,"config"),u(this,"containerId"),u(this,"externalPromotionsContainerId"),u(this,"searchExternalPromotionsMainContainer",null);var t,s;this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.externalPromotionsContainerId=((s=(t=this.config.templates)==null?void 0:t.mainTemplate)==null?void 0:s.externalPromotionsContainerId)||k.externalPromotions.mainTemplate.externalPromotionsContainerId,typeof document<"u"&&(this.searchExternalPromotionsMainContainer=document==null?void 0:document.getElementById(this.containerId)),this.initializeSubscriptions(),this.renderMainTemplate(this.generateTemplateData())}initializeSubscriptions(){this.dataLayer.$searchExternalPromotions.subscribe(e=>{e&&this.renderMainTemplate(this.generateTemplateData())})}generateTemplateData(){const e={...this.dataLayer.parsedData.data,externalPromotions:this.dataLayer.parsedData.externalPromotions};return this.dataLayer.setExternalPromotionsData(e),e}addExternalSearch(e){var t,s,a,r;const o=typeof document<"u"?document==null?void 0:document.getElementById(this.externalPromotionsContainerId):null;if(o){const n=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.externalPromotion)==null?void 0:a.template)||((r=k.externalPromotions.externalPromotion)==null?void 0:r.template);if(typeof document<"u"){const l=document==null?void 0:document.createElement("div");l.classList.add("searchstax-external-promotion"),l.addEventListener("click",c=>{this.trackClick(e,c)}),l.innerHTML=_.render(n,e),o.appendChild(l)}}}trackClick(e,t){t.stopPropagation(),t.preventDefault(),window==null||window.open(e.url,"_blank")}renderMainTemplate(e){var t,s,a,r;const o=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.mainTemplate)==null?void 0:a.template)||((r=k.externalPromotions.mainTemplate)==null?void 0:r.template);if(this.dataLayer.renderingEngine===Z.mustache){this.searchExternalPromotionsMainContainer.innerHTML=_.render(o,e);const n=typeof document<"u"?document==null?void 0:document.getElementById(this.externalPromotionsContainerId):null;n&&(n.innerHTML="");for(const l of e.externalPromotions)this.addExternalSearch(l)}}}class re{static addAccessibilityNotificationContainerToBody(){if(!document.getElementById("searchAccessibilityContainer")){const e=document.createElement("div");e.setAttribute("aria-live","polite"),e.setAttribute("id","searchAccessibilityContainer"),document.body.appendChild(e)}}static setAccessibilityText(e,t){this.addAccessibilityNotificationContainerToBody();const s=document.getElementById("searchAccessibility");s&&s.remove();const a=document.createElement("span");a.setAttribute("id","searchAccessibility"),a.innerHTML=e;const r=document.getElementById("searchAccessibilityContainer");r&&setTimeout(()=>{r.appendChild(a)},t??100)}}class Vr{constructor(e,t){u(this,"dataLayer"),u(this,"config"),u(this,"containerId"),u(this,"routerHelper"),u(this,"cachedPhrase",""),u(this,"isCached",!1),u(this,"overlayOpened",!1),u(this,"facetPaginationStep"),u(this,"facetPaginationStepMobile"),u(this,"searchFacetsMainContainer",null),u(this,"searchFacetsMobileContainer",null),u(this,"searchFacetsDesktopContainer",null),u(this,"facetLimits",{}),u(this,"facetLimitsMobile",{}),u(this,"deactivatedFacets",{}),u(this,"cachedData",null),u(this,"cacheFacets"),u(this,"onFacetSelect",(s,a,r,o,n)=>{if(s.stopPropagation(),!a.disabled){const l=r.querySelector("input");let c=o?l.checked:!l.checked;n!==void 0&&(c=!n),l.checked=c;const p=this.dataLayer.searchObject;let f=[...p.facets];const m=this.extractFacetValue(a);c?f.find(y=>Ce.deepEqual(y,m)?y:!1)||(this.config.facetingType==="tabs"&&(f=f.filter(y=>y.name!==m.name)),f.push(m)):f=f.filter(y=>!Ce.deepEqual(y,m)),setTimeout(()=>{this.dataLayer.setSearchObject({...p,facets:f,page:1}),this.config.facetingType==="tabs"&&this.renderMainTemplate(this.generateTemplateData(),!0)},0)}}),this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.routerHelper=e.routerHelper,this.cacheFacets=t,this.facetPaginationStep=this.config.itemsPerPageDesktop,this.facetPaginationStepMobile=this.config.itemsPerPageMobile,typeof document<"u"&&(this.searchFacetsMainContainer=document==null?void 0:document.getElementById(this.containerId)),this.needCache&&t(),this.initializeSubscriptions()}get needCache(){return this.config.facetingType==="showUnavailable"||this.config.facetingType==="or"||this.config.facetingType==="tabs"}get needDisabling(){return this.config.facetingType==="showUnavailable"}initializeSubscriptions(){this.needCache&&this.dataLayer.$searchFacetsCached.subscribe(e=>{e&&this.dataLayer.searchFacets&&this.renderMainTemplate(this.generateTemplateData())}),this.dataLayer.$searchResults.subscribe(e=>{e&&(this.needCache&&!this.isCached&&(this.dataLayer.searchFacets&&!this.dataLayer.searchFacetsCached&&this.dataLayer.setSearchFacetsCached(this.dataLayer.searchFacets),this.cacheFacets()),this.renderMainTemplate(this.generateTemplateData()))}),this.dataLayer.$searchObject.subscribe(e=>{this.cachedPhrase!==e.query?(this.cachedPhrase=e.query,this.isCached=!1):this.isCached=!0})}extractFacetValue(e){return{type:this.config.facetingType,name:e.parentName,value:e.value}}applyFacetLimits(e,t){const s=t?this.facetPaginationStepMobile:this.facetPaginationStep,a=t?this.facetLimits:this.facetLimitsMobile;return e.forEach(r=>{a[r.name]||(a[r.name]=s)}),e.map(r=>({...r,values:r.values.slice(0,a[r.name]),showingAllFacets:r.values.length<=a[r.name],hasMoreFacets:r.values.length>s}))}generateTemplateData(e){if(this.generateSelectedFacetsData(),this.dataLayer.searchFacets){let t=this.dataLayer.searchFacets;this.needCache&&this.dataLayer.searchFacetsCached&&(t=this.dataLayer.searchFacetsCached,this.needDisabling&&(t=t.map(a=>{var r;const o=(r=this.dataLayer.searchFacets)==null?void 0:r.find(n=>n.name===a.name);return o?{...a,values:a.values.map(n=>{const l=o.values.find(c=>n.type==="range"?!1:n.type==="checkbox"?c.value===n.value:!1);return{...n,disabled:!l,isMobile:e}})}:{...a,values:a.values.map(n=>({...n,disabled:!0})),isMobile:e}}))),this.config.specificFacets&&(t=t.filter(a=>{var r;return(r=this.config.specificFacets)==null?void 0:r.includes(a.name)}));const s={facets:this.applyFacetLimits(t,e),...this.dataLayer.parsedData.data,isMobile:e};return this.dataLayer.setFacetsTemplateData(s),s}else{const t={facets:[],...this.dataLayer.parsedData.data,isMobile:e};return this.dataLayer.setFacetsTemplateData(t),t}}createFacetItem(e,t,s){var a,r,o,n,l,c,p,f,m,y,x,L;if(typeof document<"u"){const C=document==null?void 0:document.createElement("div");C.classList.add("searchstax-facet-container"),this.deactivatedFacets[e.name]||C.classList.add("active");const j=((o=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.facetItemContainerTemplate)==null?void 0:o.template)||((n=k.facets.facetItemContainerTemplate)==null?void 0:n.template);C.innerHTML=_.render(j,e),t.appendChild(C);const T=C.querySelector("."+(((p=(c=(l=this.config)==null?void 0:l.templates)==null?void 0:c.facetItemContainerTemplate)==null?void 0:p.facetListTitleContainerClass)||((f=k.facets.facetItemContainerTemplate)==null?void 0:f.facetListTitleContainerClass)));T==null||T.addEventListener("click",()=>{C.classList.toggle("active");const N=C.classList.contains("active"),F=T.querySelector(".searchstax-facet-title");F&&F.setAttribute("aria-expanded",String(N))});const W=C.querySelector("."+(((x=(y=(m=this.config)==null?void 0:m.templates)==null?void 0:y.facetItemContainerTemplate)==null?void 0:x.facetListContainerClass)||((L=k.facets.facetItemContainerTemplate)==null?void 0:L.facetListContainerClass)));W&&(e.values.forEach(N=>{this.createFacetListItem(N,W,e.name)}),e.hasMoreFacets&&this.createHasMoreComponent(e,W,s))}}isChecked(e){var t;return!!((t=this.dataLayer.searchObject.facets)!=null&&t.find(s=>Ce.deepEqual(s,this.extractFacetValue(e))))}createFacetListItem(e,t,s){var a,r,o,n,l,c,p,f,m,y,x,L;if(typeof document<"u"){const C=document==null?void 0:document.createElement("div");C.classList.add("searchstax-facet-value-container"),e.disabled&&C.classList.add("searchstax-facet-value-disabled");const j=this.isChecked(e),T=((o=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.facetItemTemplate)==null?void 0:o.template)||((n=k.facets.facetItemTemplate)==null?void 0:n.template);C.innerHTML=_.render(T,{...e,isChecked:j});let W=(l=k.facets.facetItemTemplate)==null?void 0:l.checkTriggerClasses;W=((f=(p=(c=this.config)==null?void 0:c.templates)==null?void 0:p.facetItemTemplate)==null?void 0:f.checkTriggerClasses)||W,W.forEach(F=>{const X=C.querySelector("."+F);X==null||X.addEventListener("click",A=>{this.onFacetSelect(A,e,C)})});const N=C.querySelector("."+(((x=(y=(m=this.config)==null?void 0:m.templates)==null?void 0:y.facetItemTemplate)==null?void 0:x.inputCheckboxClass)||((L=k.facets.facetItemTemplate)==null?void 0:L.inputCheckboxClass)));N==null||N.addEventListener("click",F=>{this.onFacetSelect(F,e,C,!0)}),N&&(N==null||N.setAttribute("data-test-value",`${encodeURIComponent(s)}:"${encodeURIComponent(e.value)}"`)),t.appendChild(C)}}createHasMoreComponent(e,t,s){var a,r,o,n,l,c,p,f;if(typeof document<"u"){const m=document==null?void 0:document.createElement("div");m.classList.add("searchstax-facet-show-more-container");const y=((o=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.showMoreButtonContainerTemplate)==null?void 0:o.template)||((n=k.facets.showMoreButtonContainerTemplate)==null?void 0:n.template);m.innerHTML=_.render(y,e);const x=m.querySelector("."+(((p=(c=(l=this.config)==null?void 0:l.templates)==null?void 0:c.showMoreButtonContainerTemplate)==null?void 0:p.showMoreButtonClass)||((f=k.facets.showMoreButtonContainerTemplate)==null?void 0:f.showMoreButtonClass)));x&&(this.attachOnclickToShowMore(e,x,s),t&&t.appendChild(x))}}attachOnclickToShowMore(e,t,s){t.addEventListener("click",a=>{this.onShowMoreLessClick(a,e,s)}),t.addEventListener("keyup",a=>{(a.code==="Space"||a.code==="Enter")&&this.onShowMoreLessClick(a,e,s)})}onShowMoreLessClick(e,t,s){e.preventDefault();const a=s?this.facetPaginationStepMobile:this.facetPaginationStep,r=s?this.facetLimits:this.facetLimitsMobile;r[t.name]===void 0?r[t.name]=a*2:r[t.name]<=t.values.length?(re.setAccessibilityText(`More Facets shown for ${t.label}`),r[t.name]=r[t.name]+a):(re.setAccessibilityText(`Less Facets shown for ${t.label}`),r[t.name]=a),this.generateTemplateData(s),this.renderMainTemplate(this.generateTemplateData())}renderMainTemplate(e,t){var s,a,r,o,n,l,c,p,f,m,y;if(e&&(!Ce.deepEqual(this.cachedData??{},e)||t)){this.cachedData=e;const x=((r=(a=(s=this.config)==null?void 0:s.templates)==null?void 0:a.mainTemplateDesktop)==null?void 0:r.template)||((o=k.facets.mainTemplateDesktop)==null?void 0:o.template);if(this.dataLayer.renderingEngine===Z.mustache&&this.searchFacetsMainContainer){this.searchFacetsMainContainer.innerHTML=_.render(x,{...e});const L=(p=this.searchFacetsMainContainer)==null?void 0:p.querySelector("."+(((c=(l=(n=this.config)==null?void 0:n.templates)==null?void 0:l.mainTemplateDesktop)==null?void 0:c.facetsContainerClass)||k.facets.mainTemplateDesktop.facetsContainerClass));if(L){L.innerHTML="";for(const C of e.facets)this.createFacetItem(C,L);if(this.searchFacetsMainContainer){const C=this.searchFacetsMainContainer.querySelector("."+(((y=(m=(f=this.config)==null?void 0:f.templates)==null?void 0:m.mainTemplateDesktop)==null?void 0:y.selectedFacetsContainerClass)||k.facets.mainTemplateDesktop.selectedFacetsContainerClass));C&&(this.createSelectedFacetsComponents(C),this.createClearFacetsComponents(C))}}}setTimeout(()=>{document.querySelectorAll(".searchstax-facet-title").forEach(L=>{L.setAttribute("aria-expanded",String(!0)),L.setAttribute("tabindex","0"),L.setAttribute("role","button")})},100),this.renderMobileTemplate(this.generateTemplateData(!0))}else this.generateSelectedFacetsData()}generateSelectedFacetsData(){const e=[],t=this.dataLayer.searchObject.facets;for(const s of t){const a=decodeURIComponent(s.name),r=decodeURIComponent(s.value);if(this.dataLayer.searchFacets){const o=this.needCache?this.dataLayer.searchFacetsCached:this.dataLayer.searchFacets,n=o==null?void 0:o.find(l=>l.name===a);if(n){const l=n.values.find(c=>c.type==="range"?!1:c.type==="checkbox"?`"${c.value}"`==`"${r}"`:!1);l&&e.push(l)}}}this.dataLayer.setSelectedFacetsTemplateData(e)}createSelectedFacetsComponents(e){var t;this.generateSelectedFacetsData(),(t=this.dataLayer.selectedFacetsTemplateData)==null||t.forEach(s=>{this.createSelectedFacetsComponent(e,s)})}createClearFacetsComponents(e){var t,s,a,r,o,n,l,c;if(typeof document<"u"){const p=this.dataLayer.searchObject,f=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.clearFacetsTemplate)==null?void 0:a.template)||((r=k.facets.clearFacetsTemplate)==null?void 0:r.template),m=document==null?void 0:document.createElement("div");m.innerHTML=_.render(f,{shouldShow:p.facets.length>0});const y=m.querySelector("."+(((l=(n=(o=this.config)==null?void 0:o.templates)==null?void 0:n.clearFacetsTemplate)==null?void 0:l.containerClass)||((c=k.facets.clearFacetsTemplate)==null?void 0:c.containerClass)));y&&(y.addEventListener("click",()=>{this.removeSelectedFacets()}),y.addEventListener("keyup",x=>{(x.code==="Space"||x.code==="Enter")&&this.removeSelectedFacets()}),e.appendChild(y))}}createSelectedFacetsComponent(e,t){var s,a,r,o,n,l,c,p;if(typeof document<"u"){const f=((r=(a=(s=this.config)==null?void 0:s.templates)==null?void 0:a.selectedFacetsTemplate)==null?void 0:r.template)||((o=k.facets.selectedFacetsTemplate)==null?void 0:o.template),m=document==null?void 0:document.createElement("div");m.innerHTML=_.render(f,t);const y=m.querySelector("."+(((c=(l=(n=this.config)==null?void 0:n.templates)==null?void 0:l.selectedFacetsTemplate)==null?void 0:c.containerClass)||((p=k.facets.selectedFacetsTemplate)==null?void 0:p.containerClass)));y&&(y.addEventListener("click",()=>{this.unselectFacet(t)}),y.addEventListener("keyup",x=>{(x.code==="Space"||x.code==="Enter")&&this.unselectFacet(t)}),e.appendChild(y))}}unselectFacet(e){const t=this.dataLayer.searchObject;let s=[...t.facets];e.type==="checkbox"&&(s=s.filter(a=>JSON.stringify(a)!==JSON.stringify(this.extractFacetValue(e)))),setTimeout(()=>{this.dataLayer.setSearchObject({...t,facets:s}),this.generateSelectedFacetsData()},0)}removeSelectedFacets(){const e=this.dataLayer.searchObject;this.dataLayer.setSearchObject({...e,facets:[]})}createFilterByComponent(e){var t,s,a,r,o,n,l,c;if(typeof document<"u"){const p=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.filterByTemplate)==null?void 0:a.template)||((r=k.facets.filterByTemplate)==null?void 0:r.template),f=document==null?void 0:document.createElement("div");f.innerHTML=_.render(p,{});const m=f.querySelector("."+(((l=(n=(o=this.config)==null?void 0:o.templates)==null?void 0:n.filterByTemplate)==null?void 0:l.containerClass)||((c=k.facets.filterByTemplate)==null?void 0:c.containerClass)));m&&(e.prepend(m),m.addEventListener("click",this.openOverlay.bind(this)),m.addEventListener("keyup",y=>{(y.code==="Space"||y.code==="Enter")&&this.openOverlay()}))}}openOverlay(){var e;re.setAccessibilityText("Facet overlay opened. Tab to select facets."),this.overlayOpened=!0,this.searchFacetsMainContainer&&(typeof document<"u"&&document.body.classList.toggle("searchstax-no-scroll"),(e=this.searchFacetsMainContainer.querySelector(".searchstax-facets-mobile-overlay"))==null||e.classList.add("searchstax-show"))}closeOverlay(){var e;re.setAccessibilityText("Facet overlay closed"),this.overlayOpened=!1,this.searchFacetsMainContainer&&(typeof document<"u"&&document.body.classList.toggle("searchstax-no-scroll"),(e=this.searchFacetsMainContainer.querySelector(".searchstax-facets-mobile-overlay"))==null||e.classList.remove("searchstax-show"))}renderMobileTemplate(e){var t,s,a,r,o,n,l,c,p,f,m,y,x,L,C,j,T,W,N;if(e&&typeof document<"u"){const F=document==null?void 0:document.createElement("div");F.classList.add("searchstax-facets-container-mobile");const X=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.mainTemplateMobile)==null?void 0:a.template)||((r=k.facets.mainTemplateMobile)==null?void 0:r.template);if(this.dataLayer.renderingEngine===Z.mustache){if(F.innerHTML=_.render(X,{...e,overlayOpened:this.overlayOpened}),(o=this.searchFacetsMainContainer)==null||o.appendChild(F),(l=(n=this.config)==null?void 0:n.templates)!=null&&l.mainTemplateMobile)for(const je of((f=(p=(c=this.config)==null?void 0:c.templates)==null?void 0:p.mainTemplateMobile)==null?void 0:f.closeOverlayTriggerClasses)||[]){const q=F.querySelector("."+je);q&&(q.addEventListener("click",this.closeOverlay.bind(this)),q.addEventListener("keyup",Le=>{(Le.code==="Space"||Le.code==="Enter")&&this.closeOverlay()}))}else for(const je of k.facets.mainTemplateMobile.closeOverlayTriggerClasses){const q=F.querySelector("."+je);q&&(q.addEventListener("click",this.closeOverlay.bind(this)),q.addEventListener("keyup",Le=>{(Le.code==="Space"||Le.code==="Enter")&&this.closeOverlay()}))}const A=F.querySelector("."+(((x=(y=(m=this.config)==null?void 0:m.templates)==null?void 0:y.mainTemplateMobile)==null?void 0:x.filterByContainerClass)||k.facets.mainTemplateMobile.filterByContainerClass));A&&this.createFilterByComponent(A);const U=F.querySelector("."+(((j=(C=(L=this.config)==null?void 0:L.templates)==null?void 0:C.mainTemplateMobile)==null?void 0:j.selectedFacetsContainerClass)||k.facets.mainTemplateMobile.selectedFacetsContainerClass));U&&(this.createSelectedFacetsComponents(U),this.createClearFacetsComponents(U));const ie=F.querySelector("."+(((N=(W=(T=this.config)==null?void 0:T.templates)==null?void 0:W.mainTemplateMobile)==null?void 0:N.facetsContainerClass)||k.facets.mainTemplateMobile.facetsContainerClass));if(ie){ie.innerHTML="";for(const je of e.facets)this.createFacetItem(je,ie,!0)}}}}}class Qr{constructor(e){u(this,"dataLayer"),u(this,"config"),u(this,"containerId"),u(this,"previousButtonClass"),u(this,"nextButtonClass"),u(this,"loadMoreButtonClass"),u(this,"routerHelper"),u(this,"searchPaginationMainContainer",null);var t,s,a,r,o,n,l,c,p;this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.routerHelper=e.routerHelper,this.previousButtonClass=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.mainTemplate)==null?void 0:a.previousButtonClass)??k.pagination.mainTemplate.previousButtonClass,this.nextButtonClass=((n=(o=(r=this.config)==null?void 0:r.templates)==null?void 0:o.mainTemplate)==null?void 0:n.nextButtonClass)??k.pagination.mainTemplate.nextButtonClass,this.loadMoreButtonClass=((p=(c=(l=this.config)==null?void 0:l.templates)==null?void 0:c.infiniteScrollTemplate)==null?void 0:p.loadMoreButtonClass)??k.pagination.infiniteScrollTemplate.loadMoreButtonClass,typeof document<"u"&&(this.searchPaginationMainContainer=document==null?void 0:document.getElementById(this.containerId)),this.initializeSubscriptions(),this.renderMainTemplate(this.generateTemplateData())}get isFirstPage(){var e;return((e=this.dataLayer.searchObject)==null?void 0:e.page)===1}get isLastPage(){return this.dataLayer.parsedData.data.isLastPage}initializeSubscriptions(){this.dataLayer.$searchResults.subscribe(e=>{e&&this.renderMainTemplate(this.generateTemplateData())})}generateTemplateData(){var e,t,s,a;const r={...this.dataLayer.parsedData.data,previousPageLink:(t=this.routerHelper)==null?void 0:t.searchObjectToUrl({...this.dataLayer.searchObject,page:((e=this.dataLayer.searchObject)==null?void 0:e.page)-1}),nextPageLink:(a=this.routerHelper)==null?void 0:a.searchObjectToUrl({...this.dataLayer.searchObject,page:((s=this.dataLayer.searchObject)==null?void 0:s.page)+1})};return this.dataLayer.setPaginationData(r),r}goToPage(e,t){const s=this.dataLayer.searchObject;s&&(s.page=e,this.dataLayer.setSearchObject(s)),t||window==null||window.scrollTo(0,0),document.body.tabIndex=-1,document.body.focus()}nextPage(e){var t;e==null||e.preventDefault(),e==null||e.stopPropagation(),this.isLastPage||this.goToPage(((t=this.dataLayer.searchObject)==null?void 0:t.page)+1,this.dataLayer.isInfiniteScroll)}previousPage(e){var t;e==null||e.preventDefault(),e==null||e.stopPropagation(),this.isFirstPage||this.goToPage(((t=this.dataLayer.searchObject)==null?void 0:t.page)-1)}overridePaginationEvents(){if(this.searchPaginationMainContainer){const e=this.searchPaginationMainContainer.querySelector("."+this.previousButtonClass),t=this.searchPaginationMainContainer.querySelector("."+this.nextButtonClass),s=this.searchPaginationMainContainer.querySelector("."+this.loadMoreButtonClass);e&&(e.addEventListener("click",this.previousPage.bind(this)),e.addEventListener("keydown",a=>{(a.code==="Space"||a.code==="Enter")&&this.previousPage(a)})),t&&(t.addEventListener("click",this.nextPage.bind(this)),t.addEventListener("keydown",a=>{(a.code==="Space"||a.code==="Enter")&&this.nextPage(a)})),s&&(s.addEventListener("click",this.nextPage.bind(this)),s.addEventListener("keydown",a=>{(a.code==="Space"||a.code==="Enter")&&this.nextPage(a)}))}}renderMainTemplate(e){var t,s,a,r,o,n,l,c,p,f;this.searchPaginationMainContainer&&((t=this.searchPaginationMainContainer.querySelector("."+this.previousButtonClass))==null||t.removeEventListener("click",this.previousPage),(s=this.searchPaginationMainContainer.querySelector("."+this.nextButtonClass))==null||s.removeEventListener("click",this.nextPage));let m=((o=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.mainTemplate)==null?void 0:o.template)||((n=k.pagination.mainTemplate)==null?void 0:n.template);this.dataLayer.isInfiniteScroll&&(m=((p=(c=(l=this.config)==null?void 0:l.templates)==null?void 0:c.infiniteScrollTemplate)==null?void 0:p.template)||((f=k.pagination.infiniteScrollTemplate)==null?void 0:f.template)),this.dataLayer.renderingEngine===Z.mustache&&(this.searchPaginationMainContainer.innerHTML=_.render(m,e),setTimeout(()=>{this.overridePaginationEvents()},0))}}class Ur{constructor(e){u(this,"dataLayer"),u(this,"config"),u(this,"containerId"),u(this,"relatedSearchesContainerClass"),u(this,"searchRelatedSearchesMainContainer",null),u(this,"track");var t,s;this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.relatedSearchesContainerClass=((s=(t=this.config.templates)==null?void 0:t.main)==null?void 0:s.relatedSearchesContainerClass)||k.relatedSearches.main.relatedSearchesContainerClass,typeof document<"u"&&(this.searchRelatedSearchesMainContainer=document==null?void 0:document.getElementById(this.containerId)),this.track=e.trackRelatedSearchClick,this.initializeSubscriptions()}initializeSubscriptions(){this.dataLayer.$searchRelatedSearches.subscribe(e=>{e&&this.renderMainTemplate(this.generateTemplateData())})}generateTemplateData(){const e={...this.dataLayer.parsedData.data};return this.dataLayer.setRelatedSearchesData(e),e}addRelatedSearchComponent(e,t){var s,a,r,o,n;if(typeof document<"u"){const l=document==null?void 0:document.createElement("div"),c=((r=(a=(s=this.config)==null?void 0:s.templates)==null?void 0:a.relatedSearch)==null?void 0:r.template)||k.relatedSearches.relatedSearch.template;if(this.dataLayer.renderingEngine===Z.mustache){l.innerHTML=_.render(c,e);const p=l.querySelector("."+(((n=(o=this.config.templates)==null?void 0:o.relatedSearch)==null?void 0:n.relatedSearchContainerClass)||k.relatedSearches.relatedSearch.relatedSearchContainerClass));p&&(t.appendChild(p),p.addEventListener("click",()=>{this.executeSearch(e)}),p.addEventListener("keyup",f=>{(f.code==="Space"||f.code==="Enter")&&this.executeSearch(e)}))}}}executeSearch(e){const t=this.dataLayer.searchObject;t.query=e.related_search,this.dataLayer.setSearchObject(t),this.track(e)}renderMainTemplate(e){var t,s,a,r;const o=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.main)==null?void 0:a.template)||k.relatedSearches.main.template;if(this.dataLayer.renderingEngine===Z.mustache&&this.searchRelatedSearchesMainContainer){this.searchRelatedSearchesMainContainer.innerHTML="",this.searchRelatedSearchesMainContainer.innerHTML=_.render(o,e);const n=(r=this.searchRelatedSearchesMainContainer)==null?void 0:r.querySelector(`.${this.relatedSearchesContainerClass}`);if(n)for(const l of e.relatedSearches)this.addRelatedSearchComponent(l,n)}}}class Br{constructor(e){u(this,"dataLayer"),u(this,"config"),u(this,"containerId"),u(this,"searchFeedbackMainContainer",null),u(this,"searchTrigger"),this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.searchTrigger=e.searchTrigger,typeof document<"u"&&(this.searchFeedbackMainContainer=document==null?void 0:document.getElementById(this.containerId)),this.initializeSubscriptions()}initializeSubscriptions(){this.dataLayer.$searchResults.subscribe(e=>{e&&this.renderMainTemplate(this.generateTemplateData())})}generateTemplateData(){const e={...this.dataLayer.parsedData.data};return this.dataLayer.setSearchFeedbackData(e),e}onOriginalQueryClick(e){var t;e.stopPropagation(),e.preventDefault();const s=(t=e.target)==null?void 0:t.innerHTML;this.searchTrigger(s,!0)}attachClick(){var e,t,s,a,r;const o=(r=this.searchFeedbackMainContainer)==null?void 0:r.querySelector("."+(((s=(t=(e=this.config)==null?void 0:e.templates)==null?void 0:t.main)==null?void 0:s.originalQueryClass)||((a=k.searchFeedback.main)==null?void 0:a.originalQueryClass)));o&&o.addEventListener("click",this.onOriginalQueryClick.bind(this))}renderMainTemplate(e){var t,s,a;const r=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.main)==null?void 0:a.template)||k.searchFeedback.main.template;this.dataLayer.renderingEngine===Z.mustache&&(this.searchFeedbackMainContainer.innerHTML=_.render(r,e),setTimeout(()=>{this.attachClick()},0))}}class Hr{constructor(e){u(this,"searchHelper"),u(this,"dataLayer"),u(this,"config"),u(this,"suggestAfterMinChars"),u(this,"containerId"),u(this,"currentInputValue",""),u(this,"autosuggestResults"),u(this,"searchInput"),u(this,"actionButton"),u(this,"autosuggestContainer"),u(this,"buttonState","search"),u(this,"selectedAutosuggestItem",-1),u(this,"suggestTrigger"),u(this,"searchTrigger"),this.dataLayer=e.dataLayer,this.config=e.config,this.searchTrigger=e.searchTrigger,this.suggestTrigger=e.suggestTrigger,this.containerId=e.containerId,this.suggestAfterMinChars=e.config.suggestAfterMinChars,this.suggestAfterMinChars===void 0&&this.getSuggestAfterValue(),this.dataLayer.$locationEnabled.subscribeUntilHasValue(()=>{this.renderMainTemplate(),this.actionButtonInit(),this.updateActionButtonState("search"),this.searchInput&&(this.createAutosuggestContainer(),this.attachSubscriptions())},200)}renderMainTemplate(){var e,t,s,a;if(typeof document<"u"){const r=document==null?void 0:document.getElementById(this.containerId);if(!r)throw new Error("Search input container not found");const o=((t=(e=this.config.templates)==null?void 0:e.mainTemplate)==null?void 0:t.template)||k.searchInput.mainTemplate.template,n={...this.dataLayer.parsedData.data,locationEnabled:!!this.dataLayer.locationEnabled};if(this.dataLayer.setInputWidgetTemplateData(n),this.dataLayer.renderingEngine===Z.mustache){const p=_.render(o,n);r.innerHTML=p,this.dataLayer.setInputTemplateRendered(!0)}const l=((a=(s=this.config.templates)==null?void 0:s.mainTemplate)==null?void 0:a.searchInputId)||k.searchInput.mainTemplate.searchInputId,c=document==null?void 0:document.querySelector(`#${l}`);if(c)this.searchInput=c,c.addEventListener("keyup",this.inputKeyupEvent.bind(this)),c.addEventListener("blur",this.hideAutosuggest.bind(this)),c.addEventListener("paste",this.inputPasteEvent.bind(this));else throw new Error("Input not found")}}createAutosuggestContainer(){var e;this.dataLayer.renderingEngine===Z.mustache&&typeof document<"u"&&(this.autosuggestContainer=document==null?void 0:document.createElement("div"),this.autosuggestContainer.classList.add("searchstax-autosuggest-container"),this.autosuggestContainer.addEventListener("mouseleave",()=>{this.resetAutosuggestSelection(),this.markActiveAutosuggestItem()}),(e=this.searchInput)==null||e.after(this.autosuggestContainer))}getSuggestAfterValue(){this.dataLayer.searchHelper&&this.dataLayer.searchHelper.suggest("*",e=>{this.suggestAfterMinChars=e.metadata.minPrefixChars},[])}actionButtonInit(){typeof document<"u"&&(this.actionButton=document==null?void 0:document.getElementById("searchstax-search-input-action-button"),this.actionButton&&this.actionButton.addEventListener("click",()=>{var e;this.executeSearch(((e=this.searchInput)==null?void 0:e.value)??"")}))}attachSubscriptions(){this.dataLayer.$searchTermChange.subscribe(()=>{this.handleSearchTermChange()}),this.dataLayer.$loadingChange.subscribe(()=>{this.handleLoadingChange()}),this.dataLayer.$searchAutosuggest.subscribe(e=>{e&&this.appendSuggestions(e)}),this.dataLayer.$searchObject.subscribe(e=>{e.query!=="undefined"&&e.query!==void 0&&e.query!=="*"&&this.searchInput&&(this.searchInput.value=this.cleanSuggestionTerm(e.query??""))})}handleLoadingChange(){this.dataLayer.loading?this.updateActionButtonState("loading"):this.handleSearchTermChange()}handleSearchTermChange(){this.updateActionButtonState("search")}updateActionButtonState(e){if(this.buttonState=e,this.actionButton)switch(this.actionButton.classList.remove("searchstax-spinner-icon"),this.actionButton.classList.remove("searchstax-search-icon"),e){case"loading":this.actionButton.classList.add("searchstax-spinner-icon");break;case"search":this.actionButton.classList.add("searchstax-search-icon"),this.actionButton.setAttribute("aria-label","search");break}}selectPreviousAutosuggestItem(e){this.selectedAutosuggestItem>0?this.selectedAutosuggestItem--:this.selectedAutosuggestItem===0?(this.selectedAutosuggestItem=-1,e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length)),re.setAccessibilityText("No Suggestion selected")):this.selectedAutosuggestItem=this.autosuggestResults.suggestions.length-1,this.markActiveAutosuggestItem()}selectNextAutosuggestItem(){this.selectedAutosuggestItem<this.autosuggestResults.suggestions.length-1?this.selectedAutosuggestItem++:this.selectedAutosuggestItem===this.autosuggestResults.suggestions.length-1?(this.selectedAutosuggestItem=-1,re.setAccessibilityText("No Suggestion selected")):this.selectedAutosuggestItem=0,this.markActiveAutosuggestItem()}resetAutosuggestSelection(){this.selectedAutosuggestItem=-1,this.markActiveAutosuggestItem()}markActiveAutosuggestItem(){if(typeof document<"u"){const e=document==null?void 0:document.getElementsByClassName("searchstax-autosuggest-item");for(let t=0;t<e.length;t++){const s=e[t];t===this.selectedAutosuggestItem?(s.classList.add("active"),re.setAccessibilityText(`Selected suggestion: ${s.innerText}`)):s.classList.remove("active")}}}inputKeyupEvent(e){const t=e.key;this.currentInputValue=e.target.value,t==="Enter"?this.suggestionChosen():t==="Escape"?this.hideAutosuggest(e.target):t==="ArrowUp"?this.selectPreviousAutosuggestItem(e.target):t==="ArrowDown"?this.selectNextAutosuggestItem():this.autosuggestHandling(e),this.handleSearchTermChange()}autosuggestHandling(e){this.suggestAfterMinChars&&e.target&&e.target.value.length>=this.suggestAfterMinChars?this.executeSuggest(e.target.value):this.hideAutosuggest()}inputPasteEvent(e){setTimeout(()=>{this.autosuggestHandling(e),this.handleSearchTermChange()},0)}executeSuggest(e){this.suggestTrigger(e)}executeSearch(e){this.hideAutosuggest(),this.searchTrigger(e===""?"*":e)}suggestionChosen(){this.selectedAutosuggestItem>-1?this.autosuggestItemClicked(this.autosuggestResults.suggestions[this.selectedAutosuggestItem]):this.executeSearch(this.currentInputValue)}hideAutosuggest(e){setTimeout(()=>{this.dataLayer.setAutosuggestResults({numFound:0,suggestions:[]}),this.autosuggestContainer&&(this.autosuggestContainer.innerHTML="",this.autosuggestContainer.classList.add("hidden")),this.resetAutosuggestSelection(),e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length)),re.setAccessibilityText("No Suggestion selected")},200)}cleanSuggestionTerm(e){return oe.removeXSSRiskyTags(e.replace(/(<([^>]+)>)/gi,"")).trim()}autosuggestItemClicked(e){this.searchInput.value=this.cleanSuggestionTerm(e.term??""),this.executeSearch(this.cleanSuggestionTerm(e.term))}createAutosuggestItem(e){var t,s,a;const r=document==null?void 0:document.createElement("div");r.classList.add("searchstax-autosuggest-item"),r.addEventListener("click",()=>{this.autosuggestItemClicked(e)}),r.addEventListener("mouseenter",()=>{this.onSuggestionEnter(e)});const o=((s=(t=this.config.templates)==null?void 0:t.autosuggestItemTemplate)==null?void 0:s.template)||((a=k.searchInput.autosuggestItemTemplate)==null?void 0:a.template);return r.innerHTML=_.render(o,e),r}onSuggestionEnter(e){var t;this.selectedAutosuggestItem=((t=this.autosuggestResults)==null?void 0:t.suggestions.indexOf(e))||0,this.markActiveAutosuggestItem()}appendSuggestions(e){this.autosuggestContainer&&(this.autosuggestContainer.innerHTML="",this.autosuggestContainer.classList.remove("hidden"));for(const t in e.suggest)if(Object.prototype.hasOwnProperty.call(e.suggest,t)){const s=e.suggest[t];for(const a in s)if(Object.prototype.hasOwnProperty.call(s,a)){const r=s[a];r.numFound?re.setAccessibilityText("Suggestions are available. Use up and down arrows to navigate while focusing input. Use Escape key to escape out of the suggestions",2e3):re.setAccessibilityText("",0),this.autosuggestResults=r,this.dataLayer.setAutosuggestResults(r),r.numFound>0?r.suggestions.forEach(o=>{this.autosuggestContainer&&typeof document<"u"&&this.autosuggestContainer.appendChild(this.createAutosuggestItem(o))}):this.autosuggestContainer&&this.autosuggestContainer.classList.add("hidden")}}}}class Yr{constructor(e){u(this,"dataLayer"),u(this,"config"),u(this,"linkClickCallback"),u(this,"searchCallback"),u(this,"containerId"),u(this,"searchResultsMainContainer"),u(this,"searchResultsContainer"),u(this,"searchResultLinks",[]),this.linkClickCallback=e.linkClickCallback,this.searchCallback=e.searchTrigger,this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId;const t=document==null?void 0:document.getElementById(this.containerId);if(t)this.searchResultsMainContainer=t;else throw new Error(`Search Results Main Container with id ${this.containerId} not found`);this.dataLayer.setIsInfiniteScroll(e.config.renderMethod==="infiniteScroll"),this.initializeSubscriptions(),this.renderMainTemplate()}initializeSubscriptions(){this.dataLayer.$searchObject.subscribe(()=>{re.setAccessibilityText("Searching...")}),this.dataLayer.$searchResults.subscribe(e=>{e&&this.searchResultsContainer&&this.renderResults(e)})}changeTemplate(){this.dataLayer.searchResults&&this.renderResults(this.dataLayer.searchResults)}renderNoResultsTemplate(){var e,t,s,a,r;const o=((s=(t=(e=this.config)==null?void 0:e.templates)==null?void 0:t.noSearchResultTemplate)==null?void 0:s.template)||((a=k.searchResults.noSearchResultTemplate)==null?void 0:a.template),n=((r=this.dataLayer.searchResultsMetadata)==null?void 0:r.spellingSuggestion)??"";if(this.dataLayer.renderingEngine===Z.mustache&&this.searchResultsContainer&&(this.searchResultsContainer.innerHTML=_.render(o,{spellingSuggestion:n,...this.dataLayer.parsedData.data,searchCallback:this.searchCallback.bind(this)})),n&&this.searchResultsContainer){const l=this.searchResultsContainer.querySelector("a");l&&l.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),this.searchCallback(n)})}}renderResults(e){var t,s,a,r,o;if(this.dataLayer.renderingEngine===Z.mustache&&this.searchResultsContainer)if(this.removeLinkClickEvents(),e.length===0)re.setAccessibilityText("Search has no results"),this.renderNoResultsTemplate();else{re.setAccessibilityText(`Showing ${this.dataLayer.parsedData.startResultIndex} through ${this.dataLayer.parsedData.endResultIndex} results from ${this.dataLayer.parsedData.totalResults}. Press tab to navigate through results`);const n=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.searchResultTemplate)==null?void 0:a.template)||((r=k.searchResults.searchResultTemplate)==null?void 0:r.template),l=e.map(c=>_.render(n,c));((o=this.config)==null?void 0:o.renderMethod)==="infiniteScroll"&&this.dataLayer.searchObject.page>1?this.searchResultsContainer.innerHTML+=l.join(""):this.searchResultsContainer.innerHTML=l.join(""),this.searchResultLinks=Array.from(this.searchResultsContainer.querySelectorAll(`[${this.uniqueIdAttribute}]`)),this.attachLinkClickEvents()}}removeLinkClickEvents(){this.searchResultLinks.forEach(e=>{e.removeEventListener("click",()=>{}),e.removeEventListener("keydown",()=>{})})}get uniqueIdAttribute(){var e,t,s,a;return((s=(t=(e=this.config)==null?void 0:e.templates)==null?void 0:t.searchResultTemplate)==null?void 0:s.searchResultUniqueIdAttribute)||((a=k.searchResults.searchResultTemplate)==null?void 0:a.searchResultUniqueIdAttribute)}attachLinkClickEvents(){this.searchResultLinks.forEach(e=>{e.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const s=e.getAttribute(this.uniqueIdAttribute)??"";s&&this.linkClickCallback(s)}),e.addEventListener("keydown",t=>{if(t.code==="Space"||t.code==="Enter"){const s=e.getAttribute(this.uniqueIdAttribute)??"";s&&this.linkClickCallback(s)}})})}renderMainTemplate(){var e,t,s,a;const r=((s=(t=(e=this.config)==null?void 0:e.templates)==null?void 0:t.mainTemplate)==null?void 0:s.template)||((a=k.searchResults.mainTemplate)==null?void 0:a.template);this.dataLayer.renderingEngine===Z.mustache&&(this.searchResultsMainContainer.innerHTML=_.render(r,{}),setTimeout(()=>{var o,n,l,c,p,f,m;const y=(l=(n=(o=this.config)==null?void 0:o.templates)==null?void 0:n.mainTemplate)!=null&&l.searchResultsContainerId?(f=(p=(c=this.config)==null?void 0:c.templates)==null?void 0:p.mainTemplate)==null?void 0:f.searchResultsContainerId:(m=k.searchResults.mainTemplate)==null?void 0:m.searchResultsContainerId,x=document==null?void 0:document.getElementById(y);if(x)this.searchResultsContainer=x;else throw new Error(`Search Results Container with id ${y} not found`)},0))}}class qr{constructor(e){u(this,"dataLayer"),u(this,"config"),u(this,"containerId"),u(this,"selectId"),u(this,"searchSortingMainContainer",null);var t,s;this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.selectId=((s=(t=this.config.templates)==null?void 0:t.main)==null?void 0:s.selectId)||k.sorting.main.selectId,this.searchSortingMainContainer=document==null?void 0:document.getElementById(this.containerId),this.initializeSubscriptions(),this.renderMainTemplate(this.generateTemplateData())}initializeSubscriptions(){this.dataLayer.$searchResults.subscribe(e=>{e&&this.renderMainTemplate(this.generateTemplateData())})}generateTemplateData(){const e={...this.dataLayer.parsedData.data};return this.dataLayer.setSearchSortingData(e),e}setOrderQuery(e){const t=this.dataLayer.searchObject;t&&(t.order=e,this.dataLayer.setSearchObject(t))}markOptionSelected(){const e=document==null?void 0:document.getElementById(this.selectId);if(e){const t=e.querySelector(`option[value="${decodeURIComponent(this.dataLayer.searchObject.order)}"]`);t&&(t.selected=!0)}}renderMainTemplate(e){var t,s,a;const r=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.main)==null?void 0:a.template)||k.sorting.main.template;if(this.dataLayer.renderingEngine===Z.mustache){this.searchSortingMainContainer.innerHTML=_.render(r,e),this.markOptionSelected();const o=document==null?void 0:document.getElementById(this.selectId);o&&o.addEventListener("change",n=>{this.setOrderQuery(n.target.value)})}}}class Jr{constructor(e){u(this,"analyticsKey"),u(this,"containerId"),u(this,"mainContainer"),u(this,"isLightweight"),u(this,"emailOverride"),u(this,"feedbackTextAreaOverride"),u(this,"mainTemplateOverride"),u(this,"lightweightTemplateOverride"),u(this,"templateData",{feedbackOpen:!1,ratings:[{index:1,isSelected:!1},{index:2,isSelected:!1},{index:3,isSelected:!1},{index:4,isSelected:!1},{index:5,isSelected:!1},{index:6,isSelected:!1},{index:7,isSelected:!1},{index:8,isSelected:!1},{index:9,isSelected:!1},{index:10,isSelected:!1}],emailInput:"",feedbackTextArea:"",charactersLeft:2e3,maxLength:2e3,errors:{rating:!1,email:!1},submitted:!1,thumbsUpActive:!1,thumbsDownActive:!1}),u(this,"thumbsUpValue",10),u(this,"thumbsDownValue",1),u(this,"ratedQuestion",""),u(this,"language",""),u(this,"model",""),this.analyticsKey=e.analyticsKey,this.containerId=e.containerId??"sf-feedback",this.isLightweight=e.lightweight??!1,this.isLightweight&&this.templateData.ratings.unshift({index:0,isSelected:!1}),this.thumbsUpValue=e.thumbsUpValue??10,this.thumbsDownValue=e.thumbsDownValue??1,this.emailOverride=e.emailOverride,this.feedbackTextAreaOverride=e.feedbackTextAreaOverride,this.mainTemplateOverride=e.mainTemplateOverride,this.lightweightTemplateOverride=e.lightweightTemplateOverride,this.mainContainer=document.getElementById(this.containerId),this.language=e.language??"",this.model=e.model??"",this.init()}init(){Se.attachAnalyticsScript(),this.renderMainTemplate(this.generateTemplateData())}generateTemplateData(){return this.templateData}renderMainTemplate(e){var t,s;this.mainContainer;let a=(t=fe==null?void 0:fe.mainTemplate)==null?void 0:t.template;this.mainTemplateOverride&&(a=this.mainTemplateOverride),this.isLightweight&&(a=(s=fe.lightweightTemplate)==null?void 0:s.template,this.lightweightTemplateOverride&&(a=this.lightweightTemplateOverride)),this.mainContainer.innerHTML=_.render(a,e),this.attachEvents()}attachEvents(){this.isLightweight?this.attachLightweightEvents():(this.attachOpenModalEvent(),this.closeModalEvent(),this.attachRatingEvents(),this.attachTextAreaEvents(),this.attachEmailInputEvents(),this.attachSubmitButtonEvents())}attachLightweightEvents(){var e,t,s,a;const r=(e=fe.lightweightTemplate)==null?void 0:e.thumbsUpButtonClass,o=(t=fe.lightweightTemplate)==null?void 0:t.thumbsDownButtonClass,n=(s=this.mainContainer)==null?void 0:s.querySelector("."+r),l=(a=this.mainContainer)==null?void 0:a.querySelector("."+o);n&&n.addEventListener("click",()=>{const c=this.feedbackTextAreaOverride&&this.isLightweight?this.feedbackTextAreaOverride():this.templateData.feedbackTextArea;this.templateData.ratings[this.templateData.ratings.length-1].isSelected&&this.ratedQuestion===c||(this.templateData.thumbsUpActive=!0,this.templateData.thumbsDownActive=!1,this.templateData.ratings.forEach(p=>{p.isSelected=p.index===this.thumbsUpValue}),this.renderMainTemplate(this.generateTemplateData()),this.ratedQuestion=c,this.submit())}),l&&l.addEventListener("click",()=>{const c=this.feedbackTextAreaOverride&&this.isLightweight?this.feedbackTextAreaOverride():this.templateData.feedbackTextArea;this.templateData.ratings[0].isSelected&&this.ratedQuestion===c||(this.templateData.thumbsUpActive=!1,this.templateData.thumbsDownActive=!0,this.templateData.ratings.forEach(p=>{p.isSelected=p.index===this.thumbsDownValue}),this.renderMainTemplate(this.generateTemplateData()),this.ratedQuestion=c,this.submit())})}attachSubmitButtonEvents(){var e,t;const s=(e=fe.mainTemplate)==null?void 0:e.submitButtonClass,a=(t=this.mainContainer)==null?void 0:t.querySelector("."+s);a&&a.addEventListener("click",()=>{this.checkIfValid()})}checkIfValid(){var e,t;const s=(t=this.mainContainer)==null?void 0:t.querySelector("#"+((e=fe.mainTemplate)==null?void 0:e.emailInputId));this.validateEmail(s.value)?this.templateData.errors.email=!1:(this.templateData.errors.email=!0,re.setAccessibilityText("Please enter a valid email address.")),this.templateData.ratings.some(a=>a.isSelected)?this.templateData.errors.rating=!1:(this.templateData.errors.rating=!0,re.setAccessibilityText("Please Rate your experience.")),this.templateData.errors.rating||this.templateData.errors.email?this.renderMainTemplate(this.generateTemplateData()):this.submit()}submit(){var e;this.templateData.submitted=!0;const t=(e=this.templateData.ratings.find(s=>s.isSelected))==null?void 0:e.index;t!==void 0&&Se.trackFeedback({trackApiKey:this.analyticsKey,email:this.emailOverride&&this.isLightweight?this.emailOverride():this.templateData.emailInput,rating:t,feedback:this.feedbackTextAreaOverride&&this.isLightweight?this.feedbackTextAreaOverride():this.templateData.feedbackTextArea,model:this.model?this.model:void 0,language:this.language?this.language:void 0}),this.renderMainTemplate(this.generateTemplateData())}validateEmail(e){return e===""?!0:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}attachEmailInputEvents(){var e,t;const s=(t=this.mainContainer)==null?void 0:t.querySelector("#"+((e=fe.mainTemplate)==null?void 0:e.emailInputId));s&&(s.addEventListener("input",()=>{this.templateData.emailInput=s.value}),s.addEventListener("blur",()=>{this.validateEmail(s.value)?this.templateData.errors.email=!1:(this.templateData.errors.email=!0,re.setAccessibilityText("Please enter a valid email address.")),this.renderMainTemplate(this.generateTemplateData())}))}attachTextAreaEvents(){var e,t;const s=(t=this.mainContainer)==null?void 0:t.querySelector("#"+((e=fe.mainTemplate)==null?void 0:e.feedbackTextAreaId));s&&s.addEventListener("input",()=>{var a,r;this.templateData.feedbackTextArea=s.value,this.templateData.charactersLeft=this.templateData.maxLength-s.value.length;const o=(r=this.mainContainer)==null?void 0:r.querySelector("."+((a=fe.mainTemplate)==null?void 0:a.charactersRemainingContainerclass));o&&(o.innerText=this.templateData.charactersLeft+"")})}attachRatingEvents(){var e,t;const s=(e=fe.mainTemplate)==null?void 0:e.ratingInputclass,a=(t=this.mainContainer)==null?void 0:t.querySelectorAll("."+s);a&&a.forEach(r=>{r.addEventListener("click",o=>{const n=o.target.value;this.templateData.ratings.forEach(l=>{l.isSelected=l.index+""===n}),this.templateData.errors.rating=!1,this.renderMainTemplate(this.generateTemplateData())})})}attachOpenModalEvent(){var e,t;const s=(e=fe.mainTemplate)==null?void 0:e.openModalButtonClass,a=(t=this.mainContainer)==null?void 0:t.querySelector("."+s);a&&a.addEventListener("click",r=>{r.preventDefault(),this.toggleModal()})}toggleModal(){this.templateData.feedbackOpen?this.closeFeedbackModal():this.openFeedbackModal()}closeModalEvent(){var e,t;const s=(e=fe.mainTemplate)==null?void 0:e.closeModalButtonClass,a=(t=this.mainContainer)==null?void 0:t.querySelector("."+s);a&&a.addEventListener("click",()=>{this.closeFeedbackModal()})}openFeedbackModal(){this.templateData.feedbackOpen=!0,this.renderMainTemplate(this.generateTemplateData()),re.setAccessibilityText("Feedback form opened",1e3)}closeFeedbackModal(){this.templateData.feedbackOpen=!1,this.renderMainTemplate(this.generateTemplateData()),re.setAccessibilityText("Feedback form closed",1e3)}}class Gr{constructor(e){u(this,"dataLayer"),u(this,"config"),u(this,"containerId"),u(this,"answerContainer",null),u(this,"showMoreVisible",!1),u(this,"renderFeedbackWidget",!1),u(this,"clicked",!1),u(this,"renderedWithShowMore",!1);var t;this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.renderFeedbackWidget=((t=this.config.feedbackwidget)==null?void 0:t.renderFeedbackWidget)||!1,this.config.showShowMoreAfterWordCount&&(this.dataLayer.answerWidgetShowMoreLimit=this.config.showShowMoreAfterWordCount),typeof document<"u"&&(this.answerContainer=document==null?void 0:document.getElementById(this.containerId)),this.initializeSubscriptions(),this.dataLayer.setIsAnswerWidgetCreated(!0)}initializeSubscriptions(){this.dataLayer.$answer.subscribe(()=>{this.clicked?this.showMoreVisible=!1:this.showMoreVisible=this.dataLayer.parsedData.shouldShowAnswerLoadMore,this.renderMainTemplate(this.generateTemplateData())}),this.dataLayer.$answerLoading.subscribe(()=>{this.renderMainTemplate(this.generateTemplateData())}),this.dataLayer.$answerError.subscribe(e=>{e&&setTimeout(()=>{this.renderMainTemplate(this.generateTemplateData())},100)}),this.dataLayer.$searchObject.subscribe(()=>{this.clicked=!1,this.renderedWithShowMore=!1,this.showMoreVisible=!1}),this.dataLayer.$paginationData.subscribe(()=>{this.renderMainTemplate(this.generateTemplateData())}),this.dataLayer.$answer.subscribe(e=>{e&&setTimeout(()=>{this.initializeWidget()},600)}),this.dataLayer.$searchResults.subscribe(e=>{e&&this.dataLayer.$answer.getValue()&&setTimeout(()=>{this.initializeWidget()},600)})}searchstaxFeedbackTextAreaOverride(){return"Question: "+(this.dataLayer.searchObject.query==="undefined"?"":this.dataLayer.searchObject.query)+" Answer: "+this.dataLayer.parsedData.getAnswerData}initializeWidget(){var e,t,s,a,r;this.renderFeedbackWidget&&document.getElementById("feedbackWidgetContainer")&&!this.dataLayer.answerLoading&&new Jr({analyticsKey:this.dataLayer.parsedData.trackingData.trackApiKey,containerId:"feedbackWidgetContainer",lightweight:!0,model:this.dataLayer.parsedData.trackingData.model,language:this.dataLayer.parsedData.trackingData.language,emailOverride:(e=this.config.feedbackwidget)==null?void 0:e.emailOverride,feedbackTextAreaOverride:((t=this.config.feedbackwidget)==null?void 0:t.searchstaxFeedbackTextAreaOverride)??this.searchstaxFeedbackTextAreaOverride.bind(this),thumbsUpValue:((s=this.config.feedbackwidget)==null?void 0:s.thumbsUpValue)??10,thumbsDownValue:((a=this.config.feedbackwidget)==null?void 0:a.thumbsDownValue)??0,lightweightTemplateOverride:(r=this.config.feedbackwidget)==null?void 0:r.lightweightTemplateOverride})}showMore(e){e.preventDefault(),this.clicked=!0,this.showMoreVisible=!1,this.renderMainTemplate(this.generateTemplateData()),setTimeout(()=>{this.initializeWidget()},600)}attachClickEventToShowMore(){const e=document.querySelector(".searchstax-answer-load-more-button");e&&e.addEventListener("click",this.showMore.bind(this))}trackLinkClick(e){e.preventDefault(),e.stopPropagation();const t=e.target.getAttribute("href");Se.trackAnswerLinkClick({href:t,answer:this.dataLayer.parsedData.getAnswerData,...this.dataLayer.parsedData.trackingData}).then(()=>{window.open(t,"_blank")}).catch(()=>{window.open(t,"_blank")})}attachLinkTracking(){document.querySelectorAll(".searchstax-answer-link").forEach(e=>{e.getAttribute("listener")!=="true"&&(e.setAttribute("listener","true"),e.addEventListener("click",this.trackLinkClick.bind(this)))})}renderMainTemplate(e){var t,s,a;const r=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.main)==null?void 0:a.template)||k.answer.main.template;this.dataLayer.renderingEngine===Z.mustache?(!this.renderedWithShowMore||!e.answerLoading||this.clicked)&&(e.showMoreButtonVisible&&(this.renderedWithShowMore=!0),this.answerContainer.innerHTML=_.render(r,e),setTimeout(()=>{this.attachClickEventToShowMore(),this.attachLinkTracking()},100)):setTimeout(()=>{this.attachLinkTracking()},500)}generateTemplateData(){const e={...this.dataLayer.parsedData.data,showMoreButtonVisible:this.showMoreVisible};return this.dataLayer.setAnswerFullData(e),e}}class Js{constructor(e){u(this,"dataLayer"),u(this,"config"),u(this,"containerId"),u(this,"currentSelectValue",""),u(this,"locationInput"),u(this,"radiusInput"),u(this,"locationDecode"),u(this,"locationDecodeCoordinatesToAddress");var t,s;this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.locationDecode=(t=e.config.hooks)==null?void 0:t.locationDecode,this.locationDecodeCoordinatesToAddress=(s=e.config.hooks)==null?void 0:s.locationDecodeCoordinatesToAddress,this.dataLayer.locationEnabled&&this.dataLayer.$inputTemplateRendered.subscribeUntil(()=>{this.renderMainTemplate(),this.attachSubscriptions()},!0,500)}renderMainTemplate(){var e,t,s,a,r,o,n,l;if(typeof document<"u"){const c=document==null?void 0:document.getElementById(this.containerId);if(!c)throw new Error("Search input container not found");const p=((t=(e=this.config.templates)==null?void 0:e.mainTemplate)==null?void 0:t.template)||k.location.mainTemplate.template,f={...this.dataLayer.parsedData.data};if(this.dataLayer.setLocationWidgetTemplateData(f),this.dataLayer.renderingEngine===Z.mustache){const m=_.render(p,f);c.innerHTML=m;const y=((a=(s=this.config.templates)==null?void 0:s.mainTemplate)==null?void 0:a.locationInputId)||k.location.mainTemplate.locationInputId,x=document==null?void 0:document.querySelector(`#${y}`);if(x)this.locationInput=x,x.addEventListener("blur",this.blurEvent.bind(this)),x.addEventListener("focus",this.focusEvent.bind(this));else throw new Error("Input not found");const L=((o=(r=this.config.templates)==null?void 0:r.mainTemplate)==null?void 0:o.radiusInputId)||k.location.mainTemplate.radiusInputId,C=document==null?void 0:document.querySelector(`#${L}`);C instanceof HTMLSelectElement&&(this.radiusInput=C,C.addEventListener("change",this.radiusSelectChangeEvent.bind(this)));const j=((l=(n=this.config.templates)==null?void 0:n.mainTemplate)==null?void 0:l.currentLocationActionButtonId)||k.location.mainTemplate.currentLocationActionButtonId,T=document==null?void 0:document.querySelector(`#${j}`);T&&T.addEventListener("click",this.getCurrentLocation.bind(this))}}}setCurrentLocationFields(e){this.dataLayer.setLocationCoordinatesDecoded(e),this.dataLayer.setSearchLocation(this.dataLayer.searchLocationCoordinatesDecoded),this.dataLayer.renderingEngine===Z.mustache&&this.locationInput&&(this.locationInput.value=this.dataLayer.searchLocationCoordinatesDecoded)}getCurrentLocation(){navigator.geolocation?navigator.geolocation.getCurrentPosition(e=>{const t=e.coords.latitude.toString(),s=e.coords.longitude.toString(),a=Math.floor(parseFloat(t)*100)/100,r=Math.floor(parseFloat(s)*100)/100;this.dataLayer.setSearchLat(a+""),this.dataLayer.setSearchLong(r+"");const o=this.locationDecodeCoordinatesToAddress;o?o(a+"",r+"").then(n=>{this.setCurrentLocationFields(n.address||"Current Location")}).catch(()=>{this.setCurrentLocationFields("Current Location")}):this.setCurrentLocationFields("Current Location")},()=>{console.error("Unable to retrieve your location")}):console.error("Geolocation is not supported by this browser.")}setRadiusValue(e){this.dataLayer.setSearchRadius(e)}radiusSelectChangeEvent(e){this.currentSelectValue=e.target.value,this.setRadiusValue(this.currentSelectValue)}attachSubscriptions(){this.dataLayer.$searchObject.subscribe(e=>{this.locationInput&&(this.locationInput.value=this.cleanSuggestionTerm(e.location.address??"")),this.radiusInput&&e.location.radius&&(this.radiusInput.value=e.location.radius||"")})}cleanSuggestionTerm(e){return oe.removeXSSRiskyTags(e.replace(/(<([^>]+)>)/gi,"")).trim()}triggerGeocoder(e){const t=this.locationDecode;this.dataLayer.setLocationDecodingLoading(!0),e&&this.dataLayer.searchLocation!==e&&e!==this.dataLayer.searchLocationCoordinatesDecoded?t(e).then(s=>{this.dataLayer.setSearchLocation(s.address||""),this.dataLayer.setSearchLat(s.lat||""),this.dataLayer.setSearchLong(s.lon||""),this.locationInput&&(this.locationInput.value=this.cleanSuggestionTerm(s.address||"")),this.dataLayer.renderingEngine===Z.mustache&&s.error&&this.locationInput&&this.locationInput.classList.add("searchstax-input-location-error"),s.error?this.dataLayer.setLocationError(!0):this.dataLayer.setLocationError(!1),this.dataLayer.setLocationDecodingLoading(!1)}).catch(()=>{this.dataLayer.setLocationDecodingLoading(!1)}):e===""&&(this.dataLayer.setSearchLocation(void 0),this.dataLayer.setSearchLat(void 0),this.dataLayer.setSearchLong(void 0),this.dataLayer.setLocationDecodingLoading(!1))}focusEvent(e){e.target.classList.remove("searchstax-input-location-error"),this.dataLayer.setLocationError(!1)}blurEvent(e){const t=e.target.value;this.triggerGeocoder(t)}}class Kr{constructor(e=Z.mustache){u(this,"routerEnabled",!1),u(this,"cachedQuery",""),u(this,"routerHelper"),u(this,"searchHelper"),u(this,"searchResultsConfig"),u(this,"searchPaginationConfig"),u(this,"searchFeedbackConfig"),u(this,"searchSortingConfig"),u(this,"searchFacetsConfig"),u(this,"relatedSearchesConfig"),u(this,"externalPromotionsConfig"),u(this,"searchInputWidget"),u(this,"searchLocationWidget"),u(this,"searchResultsWidget"),u(this,"searchFacetsWidget"),u(this,"searchPaginationWidget"),u(this,"searchFeedbackWidget"),u(this,"searchSortingWidget"),u(this,"relatedSearchesWidget"),u(this,"externalPromotionsWidget"),u(this,"answerWidget"),u(this,"locationObserver",null),u(this,"dataLayer"),u(this,"firstRequest",!0),u(this,"previousQuery",""),u(this,"eventSource",null),u(this,"renderEngine",Z.mustache),e&&(this.renderEngine=e)}setRenderingEngine(e=Z.mustache){this.dataLayer.setRenderingEngine(e)}handleHooks(){var e,t;(t=(e=this.dataLayer.searchstaxConfig)==null?void 0:e.hooks)!=null&&t.afterSearch&&this.dataLayer.$searchResults.subscribe(s=>{this.dataLayer.searchstaxConfig.hooks.afterSearch(s)}),setTimeout(()=>{this.dataLayer.$searchObject.subscribe(s=>{var a,r,o,n,l,c;s.query!==this.previousQuery&&this.dataLayer.setAnswerData(""),s.query!==""&&s.query!==void 0&&s.query!=="undefined"?(this.search(s),s.query!==this.previousQuery&&this.startSSE(s.query)):(a=this.dataLayer.searchLocationConfig)!=null&&a.locationSearchEnabled&&!((r=this.dataLayer.searchLocationConfig)!=null&&r.locationValuesOverride)?this.getMetadata(s):(n=(o=this.dataLayer.searchLocationConfig)==null?void 0:o.locationValuesOverride)!=null&&n.locationFilterDefaultValue&&this.dataLayer.setSearchRadius((c=(l=this.dataLayer.searchLocationConfig)==null?void 0:l.locationValuesOverride)==null?void 0:c.locationFilterDefaultValue),this.previousQuery=s.query})},10),this.dataLayer.$searchResults.subscribe(s=>{s&&this.dataLayer.searchResultsMetadata&&!this.dataLayer.cookiesDisabled&&Se.trackSearch({...this.dataLayer.parsedData.trackingData,impressions:this.dataLayer.searchResultsMetadata.impressions})})}startSSE(e){var t,s;this.eventSource&&((t=this.eventSource)==null||t.close(),this.dataLayer.setAnswerData("")),this.dataLayer.turnAIAnswerGenerationOn===!0&&this.dataLayer.questionURL&&(this.eventSource=(s=this.searchHelper)==null?void 0:s.startSSE(e,this.parseAnswerResultsResponse.bind(this)))}attachAnalyticsScript(e){Se.attachAnalyticsScript(e)}initialize(e){var t,s;if(this.dataLayer=new lr("searchstax_session_id",e.sessionId),this.renderEngine&&this.dataLayer.setRenderingEngine(this.renderEngine),this.handleHooks(),e.questionURL&&(this.dataLayer.questionURL=e.questionURL),e.analyticsBaseUrl&&typeof window<"u"&&(window.analyticsBaseUrl=e.analyticsBaseUrl,window._msq=e._msq||[],this.attachAnalyticsScript(e.analyticsSrc)),e.autoCorrect===!1&&(this.dataLayer.autoCorrect=!1),e.language&&this.dataLayer.setLanguage(e.language),e.model&&this.dataLayer.setModel(e.model),this.dataLayer.searchstaxConfig||(this.dataLayer.setSearchstaxConfig(e),this.searchHelper=new pr({...e,sessionId:this.dataLayer.sessionId},this.dataLayer),this.dataLayer.searchHelper=this.searchHelper),((t=e.router)==null?void 0:t.enabled)===void 0||((s=e.router)==null?void 0:s.enabled)===!0){this.routerEnabled=!0,this.routerHelper=new Ws(e.router?e.router:{enabled:!0});const a=this.routerHelper.urlToSearchObject((window==null?void 0:window.location.href)??"");this.dataLayer.searchObject.itemsPerPage&&(a.itemsPerPage=this.dataLayer.searchObject.itemsPerPage),a.model&&this.dataLayer.setModel(a.model),a.location&&(a.location.address&&this.dataLayer.setSearchLocation(a.location.address),a.location.lat&&this.dataLayer.setSearchLat(a.location.lat),a.location.lon&&this.dataLayer.setSearchLong(a.location.lon),a.location.radius&&this.dataLayer.setSearchRadius(a.location.radius)),this.dataLayer.setSearchObject(a),addEventListener("popstate",()=>{this.routerHelper&&this.dataLayer.setSearchObject(this.routerHelper.urlToSearchObject((window==null?void 0:window.location.href)??"",this.dataLayer.searchObject.itemsPerPage))})}else this.routerHelper=new Ws({})}getMetadata(e){this.searchHelper&&(e.query==="undefined"||e.query===void 0)&&this.dataLayer.setSearchObject({...e,query:"*"})}search(e){if(this.searchHelper){const t=this.dataLayer.forceNotCorrect;this.searchHelper.search(e,this.parseSearchResultsResponse.bind(this),this.firstRequest,t),this.firstRequest=!1,this.getRelatedSearches()}}getRelatedSearches(){this.searchHelper&&this.relatedSearchesConfig&&this.searchHelper.getRelatedSearches(this.dataLayer.searchObject,this.relatedSearchesConfig.relatedSearchesURL,this.relatedSearchesConfig.relatedSearchesAPIKey,this.parseRelatedSearchesResponse.bind(this))}parseRelatedSearchesResponse(e){var t,s;const a=(((t=e.response)==null?void 0:t.docs)??[]).map((o,n)=>({...o,position:n+1})),r=[];for(const o of a)r.push({relatedSearch:o.related_search,position:o.position});this.dataLayer.setSearchRelatedSearches(a),this.dataLayer.searchResultsMetadata&&!this.dataLayer.cookiesDisabled&&Se.trackRelatedSearches({...this.dataLayer.parsedData.trackingData,impressions:r,totalRelatredSearches:((s=this.dataLayer.searchRelatedSearches)==null?void 0:s.length)??0})}handleRouter(){if(this.routerEnabled){const e={...this.dataLayer.searchObject};this.dataLayer.isInfiniteScroll&&delete e.page,this.routerHelper.updateUrl(e)}}parseSearchResultsResponseMetadata(e){var t,s,a,r;const o=Dt.extractSearchResultsMetadata(e),n=((s=(t=this.dataLayer.searchLocationConfig)==null?void 0:t.locationValuesOverride)==null?void 0:s.locationFilterDefaultValue)??((r=(a=o.location)==null?void 0:a.filter)==null?void 0:r.defaultValue);!this.dataLayer.searchRadius&&n&&this.dataLayer.setSearchRadius(n),this.dataLayer.setSearchResultsMetadata(o)}parseSearchResultsResponse(e){var t,s;this.handleRouter(),this.dataLayer.setItemsPerPage(parseInt(e.responseHeader.params.rows)),this.dataLayer.setModel(e.responseHeader.params.model);let a=Dt.combineResultsWithMetadata(e),r=Dt.extractFacets(e);this.dataLayer.setSearchFacets(r),(s=(t=this.dataLayer.searchstaxConfig)==null?void 0:t.hooks)!=null&&s.afterSearch&&(a=this.dataLayer.searchstaxConfig.hooks.afterSearch(a)),this.dataLayer.setSearchExternalPromotions(e.externalLinks??[]),this.parseSearchResultsResponseMetadata(e),this.dataLayer.setSearchResults(a)}parseAnswerResultsResponse(e){this.handleRouter(),e!==lt.question&&e!==lt.notQuestion&&(this.dataLayer.setAnswerLoading(!0),this.dataLayer.setAnswerData(this.dataLayer.getAnswerData+e))}cacheFacets(){var e;(e=this.searchHelper)==null||e.cacheFacets()}parseSuggestSuggestResponse(e){var t,s;let a=e;(s=(t=this.dataLayer.searchInputConfig)==null?void 0:t.hooks)!=null&&s.afterAutosuggest&&(a=this.dataLayer.searchInputConfig.hooks.afterAutosuggest(e)),this.dataLayer.setSearchAutosuggest(a)}suggest(e,t){this.searchHelper&&this.searchHelper.suggest(e,this.parseSuggestSuggestResponse.bind(this),t)}changeLanguage(e){this.searchHelper&&this.dataLayer.setLanguage(e)}addSearchInputWidget(e,t){this.dataLayer.searchInputConfig||this.dataLayer.$locationEnabled.subscribeUntilHasValue(()=>{this.dataLayer.setSearchInputConfig(t),this.searchInputWidget=new Hr({containerId:e,config:t,searchTrigger:this.executeSearch.bind(this),suggestTrigger:this.executeSuggest.bind(this),dataLayer:this.dataLayer})},200)}addSearchLocationWidget(e,t){var s,a;this.dataLayer.searchLocationConfig||(t.locationSearchEnabled?(this.dataLayer.setLocationEnabled(!0),this.dataLayer.setSearchLocationConfig(t),t.locationValuesOverride?(this.searchLocationWidget=new Js({containerId:e,config:t,dataLayer:this.dataLayer}),(s=t==null?void 0:t.locationValuesOverride)!=null&&s.locationFilterDefaultValue&&this.dataLayer.setSearchRadius((a=t==null?void 0:t.locationValuesOverride)==null?void 0:a.locationFilterDefaultValue)):this.dataLayer.$searchResultsMetadata.subscribeUntilHasValue(()=>{this.searchLocationWidget=new Js({containerId:e,config:t,dataLayer:this.dataLayer})},0)):this.dataLayer.setLocationEnabled(!1))}addAnswerWidget(e,t){this.dataLayer.turnAIAnswerGenerationOn=!0,this.startSSE(this.dataLayer.searchObject.query),this.dataLayer.setAnswerData(""),this.answerWidget=new Gr({containerId:e,config:t,dataLayer:this.dataLayer})}addSearchResultsWidget(e,t){this.searchResultsConfig||(this.searchResultsConfig=t,this.searchResultsWidget=new Yr({containerId:e,linkClickCallback:this.executeLinkClick.bind(this),searchTrigger:this.executeSearch.bind(this),config:t,dataLayer:this.dataLayer}))}addPaginationWidget(e,t){this.searchPaginationConfig=t,this.searchPaginationWidget=new Qr({containerId:e,config:t,dataLayer:this.dataLayer,routerHelper:this.routerHelper})}addSearchFeedbackWidget(e,t){this.searchFeedbackConfig=t,this.searchFeedbackWidget=new Br({containerId:e,config:t,dataLayer:this.dataLayer,searchTrigger:this.executeSearch.bind(this)})}addSearchSortingWidget(e,t){this.searchSortingConfig=t,this.searchSortingWidget=new qr({containerId:e,config:t,dataLayer:this.dataLayer})}addRelatedSearchesWidget(e,t){this.relatedSearchesConfig=t,this.relatedSearchesWidget=new Ur({containerId:e,config:t,dataLayer:this.dataLayer,trackRelatedSearchClick:this.trackRelatedSearchClick.bind(this)}),setTimeout(()=>{this.getRelatedSearches()},0)}addExternalPromotionsWidget(e,t){this.externalPromotionsConfig=t,this.externalPromotionsWidget=new Wr({containerId:e,config:t,dataLayer:this.dataLayer})}addFacetsWidget(e,t){this.searchFacetsConfig=t,this.searchFacetsWidget=new Vr({containerId:e,config:t,dataLayer:this.dataLayer,routerHelper:this.routerHelper},this.cacheFacets.bind(this))}executeSearch(e,t){const s={...this.dataLayer.searchObject};s.query=oe.removeXSSRiskyTags(e),s.page=1,s.facets=[],s.location={...s.location},this.locationObserver&&this.dataLayer.$locationDecodingLoading.unsubscribe(this.locationObserver),this.locationObserver=this.dataLayer.$locationDecodingLoading.subscribeUntil(()=>{var a,r;s.location.address=this.dataLayer.searchLocation,s.location.radius=this.dataLayer.searchRadius,s.location.lat=this.dataLayer.searchLat,s.location.lon=this.dataLayer.searchLong,this.dataLayer.forceNotCorrect=!!t;let o=(a=this.routerHelper)==null?void 0:a.searchObjectToParams(s);o&&(o=(r=this.routerHelper)==null?void 0:r.extractParamsThatDoNotStartWithRouteName(o)),o&&(s.additionalProps=Object.keys(o).map(n=>o?{key:n,value:o[n]}:{key:"",value:""})),this.dataLayer.setSearchObject(s),this.dataLayer.lastSearchValue=s.query},!1)}executeSuggest(e){var t,s;let a={term:e,queryParams:[]};(s=(t=this.dataLayer.searchInputConfig)==null?void 0:t.hooks)!=null&&s.beforeAutosuggest&&(a=this.dataLayer.searchInputConfig.hooks.beforeAutosuggest(a)),a&&a.term!==void 0&&a.queryParams!==void 0&&this.suggest(a.term,a.queryParams)}trackRelatedSearchClick(e){var t;this.dataLayer.searchResultsMetadata&&this.dataLayer.searchRelatedSearches&&!this.dataLayer.cookiesDisabled&&Se.trackRelatedSearchClick({...this.dataLayer.parsedData.trackingData,relatedSearch:e,totalRelatredSearches:((t=this.dataLayer.searchRelatedSearches)==null?void 0:t.length)??0})}executeLinkClick(e){var t,s;let a=Dt.findResultByUniqueId(e,this.dataLayer.searchResults??[]);a&&((s=(t=this.searchResultsConfig)==null?void 0:t.hooks)!=null&&s.afterLinkClick&&(a=this.searchResultsConfig.hooks.afterLinkClick(a)),a&&this.dataLayer.searchResultsMetadata&&!this.dataLayer.cookiesDisabled&&Se.trackClick({result:a,...this.dataLayer.parsedData.trackingData}).then(()=>{typeof window<"u"&&(window.location.href=(a==null?void 0:a.url)??"")}).catch(()=>{typeof window<"u"&&(window.location.href=(a==null?void 0:a.url)??"")}))}setPage(e){var t;(t=this.searchPaginationWidget)==null||t.goToPage(e)}setCookiesDisabled(e){this.dataLayer.setCookiesDisabled(e)}changeResultTemplate(e){var t,s,a;this.searchResultsConfig&&(this.searchResultsConfig.templates=(t=this.searchResultsConfig)!=null&&t.templates?{...(s=this.searchResultsConfig)==null?void 0:s.templates,...e}:e,(a=this.searchResultsWidget)==null||a.changeTemplate())}}const S={searchstax:new Kr("react")};function Gs(i,e,t,s,a,r,o,n){return d.jsx(d.Fragment,{children:i&&d.jsx("div",{className:"searchstax-location-input-container","data-test-id":"searchstax-location-input-container",children:d.jsxs("div",{className:"searchstax-location-input-wrapper",children:[d.jsx("span",{className:"searchstax-location-input-label",children:"NEAR"}),d.jsxs("div",{className:"searchstax-location-input-wrapper-inner",children:[d.jsx("input",{type:"text",id:"searchstax-location-input",className:"searchstax-location-input"+(n?" searchstax-input-location-error":""),placeholder:"Zip, Postal Code or City...","aria-label":"Search Location Input","data-test-id":"searchstax-location-input",value:r??"",onChange:l=>e(l.target.value),onBlur:l=>t(l.target.value)}),d.jsx("button",{onClick:a,className:"searchstax-get-current-location-button",children:"Use my current location"})]}),i.shouldShowLocationDistanceDropdown&&d.jsx("span",{className:"searchstax-location-input-label",children:"WITHIN"}),i.shouldShowLocationDistanceDropdown&&d.jsx("select",{id:"searchstax-location-radius-select",className:"searchstax-location-radius-select","aria-label":"Search Location Radius Select","data-test-id":"searchstax-location-radius-select",onChange:l=>s(l.target.value),value:o,children:i.locationSearchDistanceValues.map(({value:l,label:c})=>d.jsx("option",{value:l,children:c},l))})]})})})}function Ks(i){let e=!1;const[t,s]=R.useState(null),[a,r]=R.useState(null),[o,n]=R.useState(!1),[l,c]=R.useState(void 0),[p]=R.useState(Math.random());R.useEffect(()=>{if(f(),S.searchstax)S.searchstax.addSearchLocationWidget("search-location-container"+p,{hooks:i.hooks,locationSearchEnabled:i.locationSearchEnabled,locationValuesOverride:i.locationValuesOverride});else throw Error("Searchstax instance needs to be passed via props")},[]);function f(){e||(S.searchstax.dataLayer.$locationWidgetTemplateData.subscribe(L=>{s(L)}),S.searchstax.dataLayer.$searchObject.subscribe(L=>{r(L.location.address??""),c(L.location.radius||"")}),S.searchstax.dataLayer.$searchLocationChange.subscribe(L=>{r(L)}),S.searchstax.dataLayer.$searchRadiusChange.subscribe(L=>{c(L)}),S.searchstax.dataLayer.$locationError.subscribe(L=>{n(L)}),e=!0)}function m(){var L;(L=S.searchstax.searchLocationWidget)==null||L.getCurrentLocation()}function y(L){var C;c(L),(C=S.searchstax.searchLocationWidget)==null||C.setRadiusValue(L+"")}function x(L){var C;r(L),(C=S.searchstax.searchLocationWidget)==null||C.triggerGeocoder(L)}return d.jsx(d.Fragment,{children:d.jsxs("div",{id:"search-location-container"+p,children:[!i.searchLocationTemplate&&t&&d.jsx(d.Fragment,{children:Gs(t,r,x,y,m,a,l,o)}),i.searchLocationTemplate&&d.jsx(d.Fragment,{children:i.searchLocationTemplate(t,r,x,y,m,a,l,o)})]})})}const Zs={appId:"APP_ID",relatedSearchesAPIKey:"KEY"},ua={locationDecode:i=>new Promise(e=>{const t="GEOCODING_API_KEY",s=`https://maps.googleapis.com/maps/api/geocode/json?address=${encodeURIComponent(i)}&key=${t}`;fetch(s).then(a=>a.json()).then(a=>{if(a.status==="OK"&&a.results.length>0){const r=a.results[0],o={lat:r.geometry.location.lat,lon:r.geometry.location.lng,address:r.formatted_address};e(o)}else e({address:void 0,lat:void 0,lon:void 0,error:!0})}).catch(()=>{e({address:void 0,lat:void 0,lon:void 0,error:!0})})}),locationDecodeCoordinatesToAddress:(i,e)=>new Promise(t=>{fetch(`https://geocoding-staging.searchstax.co/reverse?location=${i},${e}&components=country:US&app_id=${Zs.appId}`,{method:"GET",headers:{Authorization:`Token ${Zs.relatedSearchesAPIKey}`}}).then(s=>s.json()).then(s=>{if(s.status==="OK"&&s.results.length>0){const a=s.results[0];t({address:a.formatted_address,lat:i,lon:e,error:!1})}else t({address:void 0,lat:i,lon:e,error:!0})}).catch(()=>{t({address:void 0,lat:i,lon:e,error:!0})})}),locationSearchEnabled:!1,locationValuesOverride:{locationDistanceEnabled:!0,filterValues:["any","1000"],filterUnit:"miles",locationFilterDefaultValue:"any"}};function Zr(i,e,t,s){return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"searchstax-search-input-wrapper",children:[d.jsx("input",{type:"text",id:"searchstax-search-input",className:"searchstax-search-input",placeholder:"SEARCH FOR...","aria-label":"search"}),d.jsx("div",{className:`searchstax-autosuggest-container ${i.length===0?"hidden":""}`,onMouseLeave:e,children:i.map(function(a){return d.jsx("div",{className:"searchstax-autosuggest-item",children:d.jsx("div",{className:"searchstax-autosuggest-item-term-container",tabIndex:0,dangerouslySetInnerHTML:{__html:a.term},onMouseOver:()=>{t(a)},onClick:()=>{s()}})},a.term)})})]}),d.jsx(Ks,{searchLocationTemplate:Gs,hooks:{locationDecode:ua.locationDecode,locationDecodeCoordinatesToAddress:ua.locationDecodeCoordinatesToAddress},locationSearchEnabled:ua.locationSearchEnabled,locationValuesOverride:ua.locationValuesOverride}),d.jsx("button",{className:"searchstax-spinner-icon",id:"searchstax-search-input-action-button","aria-label":"search"})]})}function Xr(i){let e=!1;const[t,s]=R.useState([]),[a,r]=R.useState(null);R.useEffect(()=>{if(o(),S.searchstax){const p={};i.afterAutosuggest&&(p.afterAutosuggest=i.afterAutosuggest),i.beforeAutosuggest&&(p.beforeAutosuggest=i.beforeAutosuggest),S.searchstax.addSearchInputWidget("searchstax-input-container",{suggestAfterMinChars:i.suggestAfterMinChars,hooks:p,templates:{mainTemplate:{template:"",searchInputId:i.searchInputId??"searchstax-search-input"}}})}else throw Error("Searchstax instance needs to be passed via props");S.searchstax.dataLayer.setInputTemplateRendered(!0)},[]);function o(){e||(S.searchstax.dataLayer.$autosuggestResults.subscribe(p=>{s((p==null?void 0:p.suggestions)??[])}),S.searchstax.dataLayer.$inputWidgetTemplateData.subscribe(p=>{r(p)}),e=!0)}function n(){var p,f;(p=S.searchstax.searchInputWidget)==null||p.resetAutosuggestSelection(),(f=S.searchstax.searchInputWidget)==null||f.markActiveAutosuggestItem()}function l(p){var f;(f=S.searchstax.searchInputWidget)==null||f.onSuggestionEnter(p)}function c(){var p;(p=S.searchstax.searchInputWidget)==null||p.suggestionChosen()}return d.jsx(d.Fragment,{children:d.jsx("div",{id:"searchstax-input-container",children:d.jsxs("div",{className:`searchstax-search-input-container searchstax-search-input-container-new ${a!=null&&a.locationEnabled?"searchstax-alternative-render":""}`,children:[!i.inputTemplate&&d.jsx(d.Fragment,{children:Zr(t,n,l,c)}),i.inputTemplate&&d.jsx(d.Fragment,{children:i.inputTemplate(t,n,l,c,a)})]})})})}function en(i){const[e,t]=R.useState(!1);return R.useEffect(()=>{const s={};i.beforeSearch&&(s.beforeSearch=i.beforeSearch),i!=null&&i.afterSearch&&(s.afterSearch=i.afterSearch),S.searchstax.initialize({language:i.language??"en",model:i.model,sessionId:i.sessionId,searchURL:i.searchURL,questionURL:i.questionURL,suggesterURL:i.suggesterURL,trackApiKey:i.trackApiKey,searchAuth:i.searchAuth,authType:i.authType??"basic",autoCorrect:i.autoCorrect,router:i.router,hooks:s,analyticsBaseUrl:i.analyticsBaseUrl,analyticsSrc:i.analyticsSrc}),setTimeout(()=>{t(!0)},100),i.initialized(S.searchstax)},[]),d.jsx(d.Fragment,{children:e&&d.jsxs(d.Fragment,{children:[" ",i.children," "]})})}function tn(i,e,t){return d.jsxs("div",{children:[d.jsxs("div",{className:"searchstax-no-results",children:[" ","Showing ",d.jsx("strong",{children:"no results"})," for ",d.jsxs("strong",{children:['"',i,'"']}),d.jsx("br",{}),(e==null?void 0:e.spellingSuggestion)&&d.jsxs("span",{children:[" Did you mean"," ",d.jsx("a",{href:"#","aria-label":`Did you mean ${e==null?void 0:e.spellingSuggestion}`,className:"searchstax-suggestion-term",onClick:s=>{s.preventDefault(),t(e==null?void 0:e.spellingSuggestion)},children:e==null?void 0:e.spellingSuggestion}),"?"]})]}),d.jsxs("ul",{children:[d.jsxs("li",{children:[" ","Try searching for search related terms or topics. We offer a wide variety of content to help you get the information you need."," "]}),d.jsx("li",{children:"Lost? Click on the ‘X” in the Search Box to reset your search."})]})]})}function an(i,e){return d.jsx(d.Fragment,{children:i&&i.length&&d.jsx("div",{className:"searchstax-search-results","aria-live":"polite",children:i!==null&&i.map(function(t){return d.jsx("a",{href:t.url??"",onClick:s=>{e(t,s)},onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&e(t,s)},"data-searchstax-unique-result-id":t.uniqueId,className:"searchstax-result-item-link searchstax-result-item-link-wrapping",tabIndex:0,children:d.jsxs("div",{className:`searchstax-search-result ${t.thumbnail?"has-thumbnail":""}`,children:[t.promoted&&d.jsx("div",{className:"searchstax-search-result-promoted"}),t.ribbon&&d.jsx("div",{className:"searchstax-search-result-ribbon",dangerouslySetInnerHTML:{__html:t.ribbon}}),t.thumbnail&&d.jsx("img",{alt:"",src:t.thumbnail,className:"searchstax-thumbnail"}),d.jsx("div",{className:"searchstax-search-result-title-container",children:d.jsx("span",{className:"searchstax-search-result-title",dangerouslySetInnerHTML:{__html:t.title??""}})}),t.paths&&d.jsx("p",{className:"searchstax-search-result-common",dangerouslySetInnerHTML:{__html:t.paths}}),t.description&&d.jsx("p",{className:"searchstax-search-result-description searchstax-search-result-common",dangerouslySetInnerHTML:{__html:t.description}}),t.unmappedFields.map(function(s){return d.jsxs("div",{children:[s.isImage&&typeof s.value=="string"&&d.jsx("div",{className:"searchstax-search-result-image-container",children:d.jsx("img",{alt:"",src:s.value,className:"searchstax-result-image"})}),!s.isImage&&d.jsx("div",{children:d.jsx("p",{className:"searchstax-search-result-common",dangerouslySetInnerHTML:{__html:s.value}})})]},s.key)})]},t.uniqueId)},t.uniqueId)})})})}function sn(i){const[e,t]=R.useState(null),s=R.useRef();s.current=e;const[a,r]=R.useState(""),[o,n]=R.useState(null),l=(f,m)=>{m.preventDefault(),m.stopPropagation(),S.searchstax.executeLinkClick(f.uniqueId)};R.useEffect(()=>{p();const f={};i.afterLinkClick&&(f.afterLinkClick=i.afterLinkClick),S.searchstax.addSearchResultsWidget("searchstax-results-container",{templates:{},renderMethod:i.renderMethod??"pagination",hooks:f})},[]);function c(f){S.searchstax.executeSearch(f)}function p(){S.searchstax.dataLayer.$searchResults.subscribe(f=>{var L;const m=s.current??[],y=f??[],x=i.renderMethod==="infiniteScroll"?[...m,...y]:f;((L=S.searchstax.dataLayer.$searchObject.value)==null?void 0:L.page)===1?t(y):t(x)}),S.searchstax.dataLayer.$searchTermChange.subscribe(f=>{r(f)}),S.searchstax.dataLayer.$searchResultsMetadata.subscribe(f=>{n(f)})}return d.jsx(d.Fragment,{children:d.jsx("div",{id:"searchstax-results-container",children:d.jsx("section",{"aria-label":"search results container",tabIndex:0,children:d.jsx("div",{className:"searchstax-search-results-container",id:"searchstax-search-results-container",children:d.jsxs("div",{id:"searchstax-result-container",children:[e&&e.length===0&&a!==""&&a!=="*"&&S.searchstax.dataLayer.parsedData.firstSearchHappened&&!i.noResultTemplate&&d.jsx(d.Fragment,{children:tn(a,o,c)}),e&&e.length===0&&a!==""&&a!=="*"&&S.searchstax.dataLayer.parsedData.firstSearchHappened&&i.noResultTemplate&&d.jsx(d.Fragment,{children:i.noResultTemplate(a,o,c)}),e&&e.length>0&&!i.resultsTemplate&&an(e,l),e&&e.length>0&&i.resultsTemplate&&d.jsx(d.Fragment,{children:i.resultsTemplate(e,l)})]})})})})})}function rn(i,e,t){return d.jsx(d.Fragment,{children:i&&(i==null?void 0:i.totalResults)!==0&&d.jsx("div",{className:"searchstax-pagination-container",children:d.jsxs("div",{className:"searchstax-pagination-content",children:[d.jsxs("a",{className:`searchstax-pagination-previous ${i.isFirstPage?"disabled":""}`,tabIndex:0,style:i!=null&&i.isFirstPage?{pointerEvents:"none"}:{},onClick:s=>{t(s)},onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&t(s)},id:"searchstax-pagination-previous",children:[" ","< Previous"," "]}),d.jsxs("div",{className:"searchstax-pagination-details",children:[" ",i==null?void 0:i.startResultIndex," -"," ",i==null?void 0:i.endResultIndex," of"," ",i==null?void 0:i.totalResults]}),d.jsx("a",{className:`searchstax-pagination-next ${i.isLastPage?"disabled":""}`,tabIndex:0,style:i!=null&&i.isLastPage?{pointerEvents:"none"}:{},onClick:s=>{e(s)},onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&e(s)},id:"searchstax-pagination-next",children:"Next >"})]})})})}function nn(i,e){return d.jsx(d.Fragment,{children:i&&i.isInfiniteScroll&&(i==null?void 0:i.totalResults)!==0&&!(i!=null&&i.isLastPage)&&d.jsx("div",{className:"searchstax-pagination-container",children:d.jsx("a",{className:"searchstax-pagination-load-more",tabIndex:0,onClick:t=>{e(t)},onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&e(t)},children:"Show More >"})})})}function on(i){let e=!1;const[t,s]=R.useState(!1),[a,r]=R.useState(null),[o]=R.useState(Math.random());R.useEffect(()=>{if(n(),S.searchstax)S.searchstax.addPaginationWidget("searchstax-pagination-container"+o,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function n(){e||(S.searchstax.dataLayer.$searchObject.subscribe(()=>{l()}),S.searchstax.dataLayer.$paginationData.subscribe(f=>{r(f)}),e=!0)}function l(){!t&&S.searchstax.routerHelper&&(s(!0),S.searchstax.addPaginationWidget("searchstax-pagination-container"+o,{}))}function c(f){var m;(m=S.searchstax.searchPaginationWidget)==null||m.nextPage(f)}function p(f){var m;(m=S.searchstax.searchPaginationWidget)==null||m.previousPage(f)}return d.jsx(d.Fragment,{children:d.jsxs("div",{id:"searchstax-pagination-container"+o,children:[!i.paginationTemplate&&a&&!a.isInfiniteScroll&&(a==null?void 0:a.totalResults)!==0&&d.jsx(d.Fragment,{children:rn(a,c,p)}),i.paginationTemplate&&a&&!a.isInfiniteScroll&&d.jsx(d.Fragment,{children:i.paginationTemplate(a,c,p)}),!i.infiniteScrollTemplate&&a&&a.isInfiniteScroll&&(a==null?void 0:a.totalResults)!==0&&!(a!=null&&a.isLastPage)&&d.jsx(d.Fragment,{children:nn(a,c)}),i.infiniteScrollTemplate&&a&&a.isInfiniteScroll&&(a==null?void 0:a.totalResults)!==0&&!(a!=null&&a.isLastPage)&&d.jsx(d.Fragment,{children:i.infiniteScrollTemplate(a,c)})]})})}function ln(i,e,t){return d.jsx(d.Fragment,{children:i&&(i==null?void 0:i.searchExecuted)&&(i==null?void 0:i.hasResultsOrExternalPromotions)&&d.jsxs("div",{className:"searchstax-sorting-container",children:[d.jsx("label",{className:"searchstax-sorting-label",htmlFor:"searchstax-search-order-select",children:"Sort By"}),d.jsx("select",{id:"searchstax-search-order-select",className:"searchstax-search-order-select",value:t,onChange:s=>{e(s.target.value)},children:i.sortOptions.map(function(s){return d.jsx("option",{value:s.key,children:s.value},s.key)})})]})})}function cn(i){let e=!1;const[t,s]=R.useState(null),[a,r]=R.useState(""),[o]=R.useState(Math.random());R.useEffect(()=>{if(n(),S.searchstax)S.searchstax.addSearchSortingWidget("search-sorting-container"+o,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function n(){e||(S.searchstax.dataLayer.$searchSortingData.subscribe(c=>{s(c)}),S.searchstax.dataLayer.$searchObject.subscribe(c=>{r(decodeURIComponent((c==null?void 0:c.order)??""))}),e=!0)}function l(c){var p;(p=S.searchstax.searchSortingWidget)==null||p.setOrderQuery(c)}return d.jsx(d.Fragment,{children:d.jsxs("div",{id:"search-sorting-container"+o,children:[!i.searchSortingTemplate&&t&&(t==null?void 0:t.searchExecuted)&&(t==null?void 0:t.hasResultsOrExternalPromotions)&&d.jsx(d.Fragment,{children:ln(t,l,a)}),i.searchSortingTemplate&&d.jsx(d.Fragment,{children:i.searchSortingTemplate(t,l,a)})]})})}function hn(i,e){return d.jsx(d.Fragment,{children:i&&(i==null?void 0:i.searchExecuted)&&(i==null?void 0:i.totalResults)>0&&d.jsxs(d.Fragment,{children:["Showing"," ",d.jsxs("b",{children:[i.startResultIndex," -"," ",i.endResultIndex]})," ","of",d.jsxs("b",{children:[" ",i.totalResults]})," results",i.searchTerm&&d.jsxs("span",{children:[' for "',d.jsx("b",{children:i.searchTerm}),'"'," "]}),d.jsx("div",{className:"searchstax-feedback-container-suggested",children:i.autoCorrectedQuery&&d.jsxs("div",{children:[" ","Search instead for"," ",d.jsx("a",{href:"#",onClick:t=>{e(t)},className:"searchstax-feedback-original-query","aria-label":`Search instead for ${i.originalQuery}`,children:i.originalQuery})]})})]})})}function un(i){let e=!1;const[t,s]=R.useState(null),[a]=R.useState(Math.random());R.useEffect(()=>{if(r(),S.searchstax)S.searchstax.addSearchFeedbackWidget("search-feedback-container"+a,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function r(){e||(S.searchstax.dataLayer.$searchFeedbackData.subscribe(n=>{s(n)}),e=!0)}function o(n){var l;(l=S.searchstax.searchFeedbackWidget)==null||l.onOriginalQueryClick(n)}return d.jsx(d.Fragment,{children:d.jsxs("div",{className:"search-feedback-container",id:"search-feedback-container"+a,children:[!i.searchOverviewTemplate&&t&&(t==null?void 0:t.searchExecuted)&&(t==null?void 0:t.totalResults)>0&&d.jsx(d.Fragment,{children:hn(t,o)}),i.searchOverviewTemplate&&d.jsx(d.Fragment,{children:i.searchOverviewTemplate(t,o)})]})})}function dn(i,e,t,s,a,r,o){return d.jsx("div",{className:"searchstax-facets-container-desktop",children:i==null?void 0:i.facets.map(n=>d.jsx("div",{className:`searchstax-facet-container ${t(n.name)?"active":""}`,children:d.jsxs("div",{children:[d.jsxs("div",{className:"searchstax-facet-title-container",onClick:()=>{s(n.name)},children:[d.jsxs("div",{className:"searchstax-facet-title",children:[" ",n.label]}),d.jsx("div",{className:"searchstax-facet-title-arrow active"})]}),d.jsxs("div",{className:"searchstax-facet-values-container","aria-live":"polite",children:[n.values.map((l,c)=>(e[c+n.name]=R.createRef(),d.jsxs("div",{className:`searchstax-facet-value-container ${l.disabled?"searchstax-facet-value-disabled":""}`,ref:e[c+n.name],children:[d.jsx("div",{className:"searchstax-facet-input desktop-"+c+n.name,children:d.jsx("input",{type:"checkbox",className:"searchstax-facet-input-checkbox",checked:r(l),readOnly:!0,"aria-label":l.value+" "+l.count,disabled:l.disabled,onClick:p=>{a(c+n.name,p,l,!0)}})}),d.jsx("div",{className:"searchstax-facet-value-label",onClick:p=>{a(c+n.name,p,l,!1)},children:l.value}),d.jsxs("div",{className:"searchstax-facet-value-count",onClick:p=>{a(c+n.name,p,l,!1)},children:["(",l.count,")"]})]},l.value+l.parentName))),n.hasMoreFacets&&d.jsx("div",{className:"searchstax-facet-show-more-container",children:d.jsxs("div",{className:"searchstax-facet-show-more-container",onClick:l=>{o(l,n)},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&o(l,n)},tabIndex:0,children:[n.showingAllFacets&&d.jsx("div",{className:"searchstax-facet-show-less-button searchstax-facet-show-button",children:"less"}),!n.showingAllFacets&&d.jsx("div",{className:"searchstax-facet-show-more-button searchstax-facet-show-button",children:"more"})]})})]})]})},n.name+"desktop"))})}function gn(i,e,t,s,a,r,o,n,l,c,p,f){return i?d.jsx("div",{className:"searchstax-facets-container-mobile",children:d.jsxs("div",{className:"searchstax-facets-pills-container",children:[d.jsx("div",{className:"searchstax-facets-pill searchstax-facets-pill-filter-by",onClick:()=>{c()},children:d.jsx("div",{className:"searchstax-facets-pill-label",children:"Filter By"})}),d.jsxs("div",{className:"searchstax-facets-pills-selected",children:[e.map(m=>d.jsxs("div",{className:"searchstax-facets-pill searchstax-facets-pill-facets",onClick:()=>{n(m)},children:[d.jsxs("div",{className:"searchstax-facets-pill-label",children:[m.value," (",m.count,")"]}),d.jsx("div",{className:"searchstax-facets-pill-icon-close"})]},m.value)),e.length!==0&&d.jsx("div",{className:"searchstax-facets-pill searchstax-clear-filters searchstax-facets-pill-clear-all",onClick:()=>{f()},children:d.jsx("div",{className:"searchstax-facets-pill-label",children:"Clear Filters"})})]}),d.jsxs("div",{className:`searchstax-facets-mobile-overlay ${i.overlayOpened?"searchstax-show":""}`,children:[d.jsxs("div",{className:"searchstax-facets-mobile-overlay-header",children:[d.jsx("div",{className:"searchstax-facets-mobile-overlay-header-title",children:"Filter By"}),d.jsx("div",{className:"searchstax-search-close",onClick:()=>{p()}})]}),d.jsx("div",{className:"searchstax-facets-container-mobile",children:i==null?void 0:i.facets.map(m=>d.jsx("div",{className:`searchstax-facet-container ${s(m.name)?"active":""}`,children:d.jsxs("div",{children:[d.jsxs("div",{className:"searchstax-facet-title-container",onClick:()=>{a(m.name)},children:[d.jsxs("div",{className:"searchstax-facet-title",children:[" ",m.label," "]}),d.jsx("div",{className:"searchstax-facet-title-arrow active"})]}),d.jsxs("div",{className:"searchstax-facet-values-container","aria-live":"polite",children:[m.values.map((y,x)=>(t[x+m.name]=R.createRef(),d.jsxs("div",{className:`searchstax-facet-value-container ${y.disabled?"searchstax-facet-value-disabled":""}`,ref:t[x+m.name],children:[d.jsx("div",{className:"searchstax-facet-input mobile-"+x+m.name,children:d.jsx("input",{type:"checkbox",className:"searchstax-facet-input-checkbox",checked:o(y),readOnly:!0,"aria-label":y.value+" "+y.count,disabled:y.disabled,onClick:L=>{r(x+m.name,L,y,!0,!0)}})}),d.jsx("div",{className:"searchstax-facet-value-label",onClick:L=>{r(x+m.name,L,y,!1)},children:y.value}),d.jsxs("div",{className:"searchstax-facet-value-count",onClick:L=>{r(x+m.name,L,y,!1)},children:["(",y.count,")"]})]},y.value+y.parentName))),d.jsx("div",{className:"searchstax-facet-show-more-container","v-if":"facet.hasMoreFacets",children:d.jsxs("div",{className:"searchstax-facet-show-more-container",onClick:y=>{l(y,m)},onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&l(y,m)},tabIndex:0,children:[m.showingAllFacets&&d.jsx("div",{className:"searchstax-facet-show-less-button searchstax-facet-show-button",children:"less"}),!m.showingAllFacets&&d.jsx("div",{className:"searchstax-facet-show-more-button searchstax-facet-show-button",children:"more"})]})})]})]})},m.name+"mobile"))}),d.jsx("button",{className:"searchstax-facets-mobile-overlay-done",onClick:()=>{p()},children:"Done"})]})]})}):d.jsx(d.Fragment,{})}function pn(i){const[e,t]=R.useState(null),[s,a]=R.useState(null),[r,o]=R.useState([]),[n,l]=R.useState({}),c={},p=Math.random();let f=!1;R.useEffect(()=>{if(m(),S.searchstax)S.searchstax.addFacetsWidget("searchstax-facets-container"+p,{facetingType:i.facetingType,specificFacets:i.specificFacets,itemsPerPageDesktop:i.itemsPerPageDesktop,itemsPerPageMobile:i.itemsPerPageMobile});else throw Error("Searchstax instance needs to be passed via props")},[]);function m(){f||(S.searchstax.dataLayer.$facetsTemplateData.subscribe(A=>{A!=null&&A.isMobile?a(A):t(A)}),S.searchstax.dataLayer.$selectedFacetsTemplateData.subscribe(A=>{o((A??[]).filter(ie=>ie.type==="checkbox"))}),f=!0)}function y(A){var U;(U=S.searchstax.searchFacetsWidget)==null||U.unselectFacet(A)}function x(){var A;(A=S.searchstax.searchFacetsWidget)==null||A.removeSelectedFacets()}function L(A){return!n[A]}function C(A){L(A)?l({...n,[A]:!0}):l({...n,[A]:!1})}function j(A){var U;return(U=S.searchstax.searchFacetsWidget)==null?void 0:U.isChecked(A)}function T(A,U,ie,je,q){var ye;const Le=q?"mobile-":"desktop-",le=document.getElementsByClassName(Le+A);le[0]&&((ye=S.searchstax.searchFacetsWidget)==null||ye.onFacetSelect(U,ie,le[0],!1,j(ie)))}function W(A,U){var ie;(ie=S.searchstax.searchFacetsWidget)==null||ie.onShowMoreLessClick(A,U,!1)}function N(A,U){var ie;(ie=S.searchstax.searchFacetsWidget)==null||ie.onShowMoreLessClick(A,U,!0)}function F(){var A;(A=S.searchstax.searchFacetsWidget)==null||A.openOverlay()}function X(){var A;(A=S.searchstax.searchFacetsWidget)==null||A.closeOverlay()}return d.jsx(d.Fragment,{children:d.jsxs("div",{id:"searchstax-facets-container"+p,children:[(e==null?void 0:e.hasResultsOrExternalPromotions)&&!i.facetsTemplateDesktop&&d.jsx(d.Fragment,{children:dn(e,c,L,C,T,j,W)}),i.facetsTemplateDesktop&&d.jsx(d.Fragment,{children:i.facetsTemplateDesktop(e,c,L,C,T,j,W)}),(s==null?void 0:s.hasResultsOrExternalPromotions)&&!i.facetsTemplateMobile&&d.jsx(d.Fragment,{children:gn(s,r,c,L,C,T,j,y,N,F,X,x)}),i.facetsTemplateMobile&&d.jsx(d.Fragment,{children:i.facetsTemplateMobile(s,r,c,L,C,T,j,y,N,F,X,x)})]})})}function mn(i,e){return d.jsx(d.Fragment,{children:i&&(i==null?void 0:i.searchExecuted)&&(i==null?void 0:i.hasRelatedSearches)&&d.jsxs("div",{className:"searchstax-related-searches-container",id:"searchstax-related-searches-container",children:[" ","Related searches: ",d.jsx("span",{id:"searchstax-related-searches"}),i.relatedSearches&&d.jsx("span",{className:"searchstax-related-search",children:i.relatedSearches.map(t=>d.jsxs("span",{onClick:()=>{e(t)},onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&e(t)},tabIndex:0,className:"searchstax-related-search searchstax-related-search-item","aria-label":"Related search: "+t.related_search,children:[" ",t.related_search,!t.last&&d.jsx("span",{children:","})]},t.related_search))})]})})}function fn(i){let e=!1;const[t,s]=R.useState(null),[a]=R.useState(Math.random());R.useEffect(()=>{if(r(),S.searchstax)S.searchstax.addRelatedSearchesWidget("searchstax-related-searches-container"+a,{relatedSearchesURL:i.relatedSearchesURL,relatedSearchesAPIKey:i.relatedSearchesAPIKey});else throw Error("Searchstax instance needs to be passed via props")},[]);function r(){e||(S.searchstax.dataLayer.$searchRelatedSearchesData.subscribe(n=>{s(n)}),e=!0)}function o(n){var l;(l=S.searchstax.relatedSearchesWidget)==null||l.executeSearch(n)}return d.jsxs(d.Fragment,{children:[!i.searchRelatedSearchesTemplate&&t&&(t==null?void 0:t.searchExecuted)&&(t==null?void 0:t.hasRelatedSearches)&&d.jsx(d.Fragment,{children:mn(t,o)}),i.searchRelatedSearchesTemplate&&d.jsx(d.Fragment,{children:i.searchRelatedSearchesTemplate(t,o)})]})}function Ln(i,e){return d.jsx(d.Fragment,{children:i&&(i==null?void 0:i.searchExecuted)&&(i==null?void 0:i.hasExternalPromotions)&&i.externalPromotions.map(t=>d.jsxs("div",{className:"searchstax-external-promotion searchstax-search-result",children:[d.jsx("div",{className:"icon-elevated"}),t.url&&d.jsx("a",{href:t.url,onClick:s=>{e(t,s)},className:"searchstax-result-item-link"}),d.jsx("div",{className:"searchstax-search-result-title-container",children:d.jsx("span",{className:"searchstax-search-result-title",children:t.name})}),t.description&&d.jsxs("p",{className:"searchstax-search-result-description searchstax-search-result-common",children:[" ",t.description," "]}),t.url&&d.jsxs("p",{className:"searchstax-search-result-description searchstax-search-result-common",children:[" ",t.url," "]})]},t.id))})}function yn(i){let e=!1;const[t,s]=R.useState(null),[a]=R.useState(Math.random());R.useEffect(()=>{if(r(),S.searchstax)S.searchstax.addExternalPromotionsWidget("searchstax-external-promotions-layout-container"+a,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function r(){e||(S.searchstax.dataLayer.$searchExternalPromotionsData.subscribe(n=>{s(n)}),e=!0)}function o(n,l){var c;(c=S.searchstax.externalPromotionsWidget)==null||c.trackClick(n,l)}return d.jsx(d.Fragment,{children:d.jsxs("div",{id:"searchstax-external-promotions-layout-container"+a,children:[!i.searchExternalPromotionsTemplate&&t&&(t==null?void 0:t.searchExecuted)&&(t==null?void 0:t.hasExternalPromotions)&&d.jsx(d.Fragment,{children:Ln(t,o)}),i.searchExternalPromotionsTemplate&&d.jsx(d.Fragment,{children:i.searchExternalPromotionsTemplate(t,o)})]})})}function wn(i,e){return d.jsx(d.Fragment,{children:i&&d.jsxs("div",{className:"searchstax-answer-wrap",children:[d.jsx("div",{className:"searchstax-answer-icon"}),d.jsxs("div",{children:[d.jsxs("div",{className:"searchstax-answer-container "+(i.showMoreButtonVisible===!0?"searchstax-answer-show-more":""),children:[d.jsx("div",{className:"searchstax-answer-title",children:"Smart Answers"}),i.shouldShowAnswerError&&d.jsx("div",{className:"searchstax-answer-error",dangerouslySetInnerHTML:{__html:i.answerErrorMessage}}),d.jsx("div",{className:"searchstax-answer-description",dangerouslySetInnerHTML:{__html:i.fullAnswerFormatted}}),i.answerLoading&&d.jsx("div",{className:"searchstax-answer-loading"})]}),i.showMoreButtonVisible===!0&&d.jsx("div",{className:"searchstax-answer-load-more-button-container",children:d.jsx("button",{className:"searchstax-answer-load-more-button",onClick:t=>{e(t)},children:"Read more"})})]}),d.jsxs("div",{className:"searchstax-answer-footer",children:[d.jsx("div",{id:"feedbackWidgetContainer"}),d.jsx("div",{className:"searchstax-lightweight-widget-separator-inline"}),d.jsx("p",{className:"searchstax-disclaimer",children:"Generative AI is Experimental"})]})]})})}function vn(i){let e=!1;const[t,s]=R.useState(null),[a]=R.useState(Math.random());R.useEffect(()=>{if(o(),S.searchstax){const n=i.feedbackwidget??void 0;S.searchstax.addAnswerWidget("searchstax-answer-container"+a,{showShowMoreAfterWordCount:i.showShowMoreAfterWordCount,feedbackwidget:n})}else throw Error("Searchstax instance needs to be passed via props")},[]);function r(n){var l;S.searchstax&&((l=S.searchstax.answerWidget)==null||l.showMore(n))}function o(){e||(S.searchstax.dataLayer.$answerData.subscribe(n=>{s(n)}),e=!0)}return d.jsx(d.Fragment,{children:d.jsxs("div",{id:"search-answer-container"+a,children:[!i.searchAnswerTemplate&&t&&t.shouldShowAnswer&&(t==null?void 0:t.searchExecuted)&&d.jsx(d.Fragment,{children:wn(t,r)}),i.searchAnswerTemplate&&t&&t.shouldShowAnswer&&d.jsx(d.Fragment,{children:i.searchAnswerTemplate(t,r)})]})})}ve.SearchstaxAnswerWidget=vn,ve.SearchstaxExternalPromotionsWidget=yn,ve.SearchstaxFacetsWidget=pn,ve.SearchstaxInputWidget=Xr,ve.SearchstaxLocationWidget=Ks,ve.SearchstaxOverviewWidget=un,ve.SearchstaxPaginationWidget=on,ve.SearchstaxRelatedSearchesWidget=fn,ve.SearchstaxResultWidget=sn,ve.SearchstaxSortingWidget=cn,ve.SearchstaxWrapper=en,Object.defineProperty(ve,Symbol.toStringTag,{value:"Module"})})(this["@searchstaxInc/searchstudioUxReact"]=this["@searchstaxInc/searchstudioUxReact"]||{},React);
|
|
449
|
+
`,thumbsUpButtonClass:"searchstax-lightweight-widget-thumbs-up",thumbsDownButtonClass:"searchstax-lightweight-widget-thumbs-down"}};class C{}h(C,"answer",Mr),h(C,"externalPromotions",Cr),h(C,"facets",Sr),h(C,"pagination",kr),h(C,"relatedSearches",Tr),h(C,"searchFeedback",jr),h(C,"searchInput",Er),h(C,"location",Ar),h(C,"searchResults",Ir),h(C,"sorting",Rr),h(C,"feedback",ce);class Nr{constructor(e){h(this,"dataLayer"),h(this,"config"),h(this,"containerId"),h(this,"externalPromotionsContainerId"),h(this,"searchExternalPromotionsMainContainer",null);var t,s;this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.externalPromotionsContainerId=((s=(t=this.config.templates)==null?void 0:t.mainTemplate)==null?void 0:s.externalPromotionsContainerId)||C.externalPromotions.mainTemplate.externalPromotionsContainerId,typeof document<"u"&&(this.searchExternalPromotionsMainContainer=document==null?void 0:document.getElementById(this.containerId)),this.initializeSubscriptions(),this.renderMainTemplate(this.generateTemplateData())}initializeSubscriptions(){this.dataLayer.$searchExternalPromotions.subscribe(e=>{e&&this.renderMainTemplate(this.generateTemplateData())})}generateTemplateData(){const e={...this.dataLayer.parsedData.data,externalPromotions:this.dataLayer.parsedData.externalPromotions};return this.dataLayer.setExternalPromotionsData(e),e}addExternalSearch(e){var t,s,a,r;const o=typeof document<"u"?document==null?void 0:document.getElementById(this.externalPromotionsContainerId):null;if(o){const n=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.externalPromotion)==null?void 0:a.template)||((r=C.externalPromotions.externalPromotion)==null?void 0:r.template);if(typeof document<"u"){const l=document==null?void 0:document.createElement("div");l.classList.add("searchstax-external-promotion"),l.addEventListener("click",c=>{this.trackClick(e,c)}),l.innerHTML=O.render(n,e),o.appendChild(l)}}}trackClick(e,t){t.stopPropagation(),t.preventDefault(),window==null||window.open(e.url,"_blank")}renderMainTemplate(e){var t,s,a,r;const o=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.mainTemplate)==null?void 0:a.template)||((r=C.externalPromotions.mainTemplate)==null?void 0:r.template);if(this.dataLayer.renderingEngine===B.mustache){this.searchExternalPromotionsMainContainer.innerHTML=O.render(o,e);const n=typeof document<"u"?document==null?void 0:document.getElementById(this.externalPromotionsContainerId):null;n&&(n.innerHTML="");for(const l of e.externalPromotions)this.addExternalSearch(l)}}}class G{static addAccessibilityNotificationContainerToBody(){if(!document.getElementById("searchAccessibilityContainer")){const e=document.createElement("div");e.setAttribute("aria-live","polite"),e.setAttribute("id","searchAccessibilityContainer"),document.body.appendChild(e)}}static setAccessibilityText(e,t){this.addAccessibilityNotificationContainerToBody();const s=document.getElementById("searchAccessibility");s&&s.remove();const a=document.createElement("span");a.setAttribute("id","searchAccessibility"),a.innerHTML=e;const r=document.getElementById("searchAccessibilityContainer");r&&setTimeout(()=>{r.appendChild(a)},t??100)}}class Dr{constructor(e,t){h(this,"dataLayer"),h(this,"config"),h(this,"containerId"),h(this,"routerHelper"),h(this,"cachedPhrase",""),h(this,"isCached",!1),h(this,"overlayOpened",!1),h(this,"facetPaginationStep"),h(this,"facetPaginationStepMobile"),h(this,"searchFacetsMainContainer",null),h(this,"searchFacetsMobileContainer",null),h(this,"searchFacetsDesktopContainer",null),h(this,"facetLimits",{}),h(this,"facetLimitsMobile",{}),h(this,"deactivatedFacets",{}),h(this,"focusedElement",null),h(this,"cachedData",null),h(this,"cacheFacets"),h(this,"onFacetSelect",(s,a,r,o,n)=>{if(s.stopPropagation(),!a.disabled){const l=r.querySelector("input");let c=o?l.checked:!l.checked;n!==void 0&&(c=!n),l.checked=c;const g=this.dataLayer.searchObject;let m=[...g.facets];const p=this.extractFacetValue(a);c?m.find(L=>pe.deepEqual(L,p)?L:!1)||(this.config.facetingType==="tabs"&&(m=m.filter(L=>L.name!==p.name)),m.push(p)):m=m.filter(L=>!pe.deepEqual(L,p)),setTimeout(()=>{this.dataLayer.setSearchObject({...g,facets:m,page:1}),this.config.facetingType==="tabs"&&this.renderMainTemplate(this.generateTemplateData(),!0)},0)}}),this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.routerHelper=e.routerHelper,this.cacheFacets=t,this.facetPaginationStep=this.config.itemsPerPageDesktop,this.facetPaginationStepMobile=this.config.itemsPerPageMobile,typeof document<"u"&&(this.searchFacetsMainContainer=document==null?void 0:document.getElementById(this.containerId)),this.needCache&&t(),this.initializeSubscriptions()}get needCache(){return this.config.facetingType==="showUnavailable"||this.config.facetingType==="or"||this.config.facetingType==="tabs"}get needDisabling(){return this.config.facetingType==="showUnavailable"}initializeSubscriptions(){this.needCache&&this.dataLayer.$searchFacetsCached.subscribe(e=>{e&&this.dataLayer.searchFacets&&this.renderMainTemplate(this.generateTemplateData())}),this.dataLayer.$searchResults.subscribe(e=>{e&&(this.needCache&&!this.isCached&&(this.dataLayer.searchFacets&&!this.dataLayer.searchFacetsCached&&this.dataLayer.setSearchFacetsCached(this.dataLayer.searchFacets),this.cacheFacets()),this.renderMainTemplate(this.generateTemplateData()))}),this.dataLayer.$searchObject.subscribe(e=>{this.cachedPhrase!==e.query?(this.cachedPhrase=e.query,this.isCached=!1):this.isCached=!0})}extractFacetValue(e){return{type:this.config.facetingType,name:e.parentName,value:e.value}}applyFacetLimits(e,t){const s=t?this.facetPaginationStepMobile:this.facetPaginationStep,a=t?this.facetLimits:this.facetLimitsMobile;return e.forEach(r=>{a[r.name]||(a[r.name]=s)}),e.map(r=>({...r,values:r.values.slice(0,a[r.name]),showingAllFacets:r.values.length<=a[r.name],hasMoreFacets:r.values.length>s}))}generateTemplateData(e){if(this.generateSelectedFacetsData(),this.dataLayer.searchFacets){let t=this.dataLayer.searchFacets;this.needCache&&this.dataLayer.searchFacetsCached&&(t=this.dataLayer.searchFacetsCached,this.needDisabling&&(t=t.map(a=>{var r;const o=(r=this.dataLayer.searchFacets)==null?void 0:r.find(n=>n.name===a.name);return o?{...a,values:a.values.map(n=>{const l=o.values.find(c=>n.type==="range"?!1:n.type==="checkbox"?c.value===n.value:!1);return{...n,disabled:!l,isMobile:e}})}:{...a,values:a.values.map(n=>({...n,disabled:!0})),isMobile:e}}))),this.config.specificFacets&&(t=t.filter(a=>{var r;return(r=this.config.specificFacets)==null?void 0:r.includes(a.name)}));const s={facets:this.applyFacetLimits(t,e),...this.dataLayer.parsedData.data,isMobile:e};return this.dataLayer.setFacetsTemplateData(s),s}else{const t={facets:[],...this.dataLayer.parsedData.data,isMobile:e};return this.dataLayer.setFacetsTemplateData(t),t}}createFacetItem(e,t,s){var a,r,o,n,l,c,g,m,p,L,w,f;if(typeof document<"u"){const x=document==null?void 0:document.createElement("div");x.classList.add("searchstax-facet-container"),this.deactivatedFacets[e.name]||x.classList.add("active");const k=((o=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.facetItemContainerTemplate)==null?void 0:o.template)||((n=C.facets.facetItemContainerTemplate)==null?void 0:n.template);x.innerHTML=O.render(k,e),t.appendChild(x);const I=x.querySelector("."+(((g=(c=(l=this.config)==null?void 0:l.templates)==null?void 0:c.facetItemContainerTemplate)==null?void 0:g.facetListTitleContainerClass)||((m=C.facets.facetItemContainerTemplate)==null?void 0:m.facetListTitleContainerClass)));I==null||I.addEventListener("click",()=>{x.classList.toggle("active");const A=x.classList.contains("active"),D=I.querySelector(".searchstax-facet-title");D&&D.setAttribute("aria-expanded",String(A))});const F=x.querySelector("."+(((w=(L=(p=this.config)==null?void 0:p.templates)==null?void 0:L.facetItemContainerTemplate)==null?void 0:w.facetListContainerClass)||((f=C.facets.facetItemContainerTemplate)==null?void 0:f.facetListContainerClass)));F&&(e.values.forEach(A=>{this.createFacetListItem(A,F,e.name)}),e.hasMoreFacets&&this.createHasMoreComponent(e,F,s))}}isChecked(e){var t;return!!((t=this.dataLayer.searchObject.facets)!=null&&t.find(s=>pe.deepEqual(s,this.extractFacetValue(e))))}createFacetListItem(e,t,s){var a,r,o,n,l,c,g,m,p,L,w,f;if(typeof document<"u"){const x=document==null?void 0:document.createElement("div");x.classList.add("searchstax-facet-value-container"),e.disabled&&x.classList.add("searchstax-facet-value-disabled");const k=this.isChecked(e),I=((o=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.facetItemTemplate)==null?void 0:o.template)||((n=C.facets.facetItemTemplate)==null?void 0:n.template);x.innerHTML=O.render(I,{...e,isChecked:k});let F=(l=C.facets.facetItemTemplate)==null?void 0:l.checkTriggerClasses;F=((m=(g=(c=this.config)==null?void 0:c.templates)==null?void 0:g.facetItemTemplate)==null?void 0:m.checkTriggerClasses)||F,F.forEach(D=>{const q=x.querySelector("."+D);q==null||q.addEventListener("click",T=>{this.onFacetSelect(T,e,x)})});const A=x.querySelector("."+(((w=(L=(p=this.config)==null?void 0:p.templates)==null?void 0:L.facetItemTemplate)==null?void 0:w.inputCheckboxClass)||((f=C.facets.facetItemTemplate)==null?void 0:f.inputCheckboxClass)));A==null||A.addEventListener("click",D=>{this.onFacetSelect(D,e,x,!0)}),A&&(A==null||A.setAttribute("data-test-value",`${encodeURIComponent(s)}:"${encodeURIComponent(e.value)}"`)),t.appendChild(x)}}createHasMoreComponent(e,t,s){var a,r,o,n,l,c,g,m;if(typeof document<"u"){const p=document==null?void 0:document.createElement("div");p.classList.add("searchstax-facet-show-more-container");const L=((o=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.showMoreButtonContainerTemplate)==null?void 0:o.template)||((n=C.facets.showMoreButtonContainerTemplate)==null?void 0:n.template);p.innerHTML=O.render(L,e);const w=p.querySelector("."+(((g=(c=(l=this.config)==null?void 0:l.templates)==null?void 0:c.showMoreButtonContainerTemplate)==null?void 0:g.showMoreButtonClass)||((m=C.facets.showMoreButtonContainerTemplate)==null?void 0:m.showMoreButtonClass)));w&&(this.attachOnclickToShowMore(e,w,s),t&&t.appendChild(w))}}attachOnclickToShowMore(e,t,s){t.addEventListener("click",a=>{this.onShowMoreLessClick(a,e,s)}),t.addEventListener("keyup",a=>{(a.code==="Space"||a.code==="Enter")&&this.onShowMoreLessClick(a,e,s)})}onShowMoreLessClick(e,t,s){e.preventDefault();const a=s?this.facetPaginationStepMobile:this.facetPaginationStep,r=s?this.facetLimits:this.facetLimitsMobile;r[t.name]===void 0?r[t.name]=a*2:r[t.name]<=t.values.length?(G.setAccessibilityText(`More Facets shown for ${t.label}`),r[t.name]=r[t.name]+a):(G.setAccessibilityText(`Less Facets shown for ${t.label}`),r[t.name]=a),this.generateTemplateData(s),this.renderMainTemplate(this.generateTemplateData())}renderMainTemplate(e,t){var s,a,r,o,n,l,c,g,m,p,L;if(e&&(!pe.deepEqual(this.cachedData??{},e)||t)){this.cachedData=e;const w=((r=(a=(s=this.config)==null?void 0:s.templates)==null?void 0:a.mainTemplateDesktop)==null?void 0:r.template)||((o=C.facets.mainTemplateDesktop)==null?void 0:o.template);if(this.dataLayer.renderingEngine===B.mustache&&this.searchFacetsMainContainer){const f=document.activeElement;f instanceof HTMLInputElement&&f.type==="checkbox"?this.focusedElement=f:this.focusedElement=null,this.searchFacetsMainContainer.innerHTML=O.render(w,{...e});const x=(g=this.searchFacetsMainContainer)==null?void 0:g.querySelector("."+(((c=(l=(n=this.config)==null?void 0:n.templates)==null?void 0:l.mainTemplateDesktop)==null?void 0:c.facetsContainerClass)||C.facets.mainTemplateDesktop.facetsContainerClass));if(x){x.innerHTML="";for(const k of e.facets)this.createFacetItem(k,x);if(this.searchFacetsMainContainer){const k=this.searchFacetsMainContainer.querySelector("."+(((L=(p=(m=this.config)==null?void 0:m.templates)==null?void 0:p.mainTemplateDesktop)==null?void 0:L.selectedFacetsContainerClass)||C.facets.mainTemplateDesktop.selectedFacetsContainerClass));k&&(this.createSelectedFacetsComponents(k),this.createClearFacetsComponents(k))}}}setTimeout(()=>{document.querySelectorAll(".searchstax-facet-title").forEach(f=>{f.setAttribute("aria-expanded",String(!0)),f.setAttribute("tabindex","0"),f.setAttribute("role","button")})},100),this.renderMobileTemplate(this.generateTemplateData(!0))}else this.generateSelectedFacetsData()}generateSelectedFacetsData(){const e=[],t=this.dataLayer.searchObject.facets;for(const s of t){const a=decodeURIComponent(s.name),r=decodeURIComponent(s.value);if(this.dataLayer.searchFacets){const o=this.needCache?this.dataLayer.searchFacetsCached:this.dataLayer.searchFacets,n=o==null?void 0:o.find(l=>l.name===a);if(n){const l=n.values.find(c=>c.type==="range"?!1:c.type==="checkbox"?`"${c.value}"`==`"${r}"`:!1);l&&e.push(l)}}}this.dataLayer.setSelectedFacetsTemplateData(e)}createSelectedFacetsComponents(e){var t;this.generateSelectedFacetsData(),(t=this.dataLayer.selectedFacetsTemplateData)==null||t.forEach(s=>{this.createSelectedFacetsComponent(e,s)})}createClearFacetsComponents(e){var t,s,a,r,o,n,l,c;if(typeof document<"u"){const g=this.dataLayer.searchObject,m=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.clearFacetsTemplate)==null?void 0:a.template)||((r=C.facets.clearFacetsTemplate)==null?void 0:r.template),p=document==null?void 0:document.createElement("div");p.innerHTML=O.render(m,{shouldShow:g.facets.length>0});const L=p.querySelector("."+(((l=(n=(o=this.config)==null?void 0:o.templates)==null?void 0:n.clearFacetsTemplate)==null?void 0:l.containerClass)||((c=C.facets.clearFacetsTemplate)==null?void 0:c.containerClass)));L&&(L.addEventListener("click",()=>{this.removeSelectedFacets()}),L.addEventListener("keyup",w=>{(w.code==="Space"||w.code==="Enter")&&this.removeSelectedFacets()}),e.appendChild(L))}}createSelectedFacetsComponent(e,t){var s,a,r,o,n,l,c,g;if(typeof document<"u"){const m=((r=(a=(s=this.config)==null?void 0:s.templates)==null?void 0:a.selectedFacetsTemplate)==null?void 0:r.template)||((o=C.facets.selectedFacetsTemplate)==null?void 0:o.template),p=document==null?void 0:document.createElement("div");p.innerHTML=O.render(m,t);const L=p.querySelector("."+(((c=(l=(n=this.config)==null?void 0:n.templates)==null?void 0:l.selectedFacetsTemplate)==null?void 0:c.containerClass)||((g=C.facets.selectedFacetsTemplate)==null?void 0:g.containerClass)));L&&(L.addEventListener("click",()=>{this.unselectFacet(t)}),L.addEventListener("keyup",w=>{(w.code==="Space"||w.code==="Enter")&&this.unselectFacet(t)}),e.appendChild(L))}}unselectFacet(e){const t=this.dataLayer.searchObject;let s=[...t.facets];e.type==="checkbox"&&(s=s.filter(a=>JSON.stringify(a)!==JSON.stringify(this.extractFacetValue(e)))),setTimeout(()=>{this.dataLayer.setSearchObject({...t,facets:s}),this.generateSelectedFacetsData()},0)}removeSelectedFacets(){const e=this.dataLayer.searchObject;this.dataLayer.setSearchObject({...e,facets:[]})}createFilterByComponent(e){var t,s,a,r,o,n,l,c;if(typeof document<"u"){const g=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.filterByTemplate)==null?void 0:a.template)||((r=C.facets.filterByTemplate)==null?void 0:r.template),m=document==null?void 0:document.createElement("div");m.innerHTML=O.render(g,{});const p=m.querySelector("."+(((l=(n=(o=this.config)==null?void 0:o.templates)==null?void 0:n.filterByTemplate)==null?void 0:l.containerClass)||((c=C.facets.filterByTemplate)==null?void 0:c.containerClass)));p&&(e.prepend(p),p.addEventListener("click",this.openOverlay.bind(this)),p.addEventListener("keyup",L=>{(L.code==="Space"||L.code==="Enter")&&this.openOverlay()}))}}openOverlay(){var e;G.setAccessibilityText("Facet overlay opened. Tab to select facets."),this.overlayOpened=!0,this.searchFacetsMainContainer&&(typeof document<"u"&&document.body.classList.toggle("searchstax-no-scroll"),(e=this.searchFacetsMainContainer.querySelector(".searchstax-facets-mobile-overlay"))==null||e.classList.add("searchstax-show"))}closeOverlay(){var e;G.setAccessibilityText("Facet overlay closed"),this.overlayOpened=!1,this.searchFacetsMainContainer&&(typeof document<"u"&&document.body.classList.toggle("searchstax-no-scroll"),(e=this.searchFacetsMainContainer.querySelector(".searchstax-facets-mobile-overlay"))==null||e.classList.remove("searchstax-show"))}renderMobileTemplate(e){var t,s,a,r,o,n,l,c,g,m,p,L,w,f,x,k,I,F,A;if(e&&typeof document<"u"){const D=document==null?void 0:document.createElement("div");D.classList.add("searchstax-facets-container-mobile");const q=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.mainTemplateMobile)==null?void 0:a.template)||((r=C.facets.mainTemplateMobile)==null?void 0:r.template);if(this.dataLayer.renderingEngine===B.mustache){if(D.innerHTML=O.render(q,{...e,overlayOpened:this.overlayOpened}),(o=this.searchFacetsMainContainer)==null||o.appendChild(D),(l=(n=this.config)==null?void 0:n.templates)!=null&&l.mainTemplateMobile)for(const xe of((m=(g=(c=this.config)==null?void 0:c.templates)==null?void 0:g.mainTemplateMobile)==null?void 0:m.closeOverlayTriggerClasses)||[]){const Q=D.querySelector("."+xe);Q&&(Q.addEventListener("click",this.closeOverlay.bind(this)),Q.addEventListener("keyup",he=>{(he.code==="Space"||he.code==="Enter")&&this.closeOverlay()}))}else for(const xe of C.facets.mainTemplateMobile.closeOverlayTriggerClasses){const Q=D.querySelector("."+xe);Q&&(Q.addEventListener("click",this.closeOverlay.bind(this)),Q.addEventListener("keyup",he=>{(he.code==="Space"||he.code==="Enter")&&this.closeOverlay()}))}const T=D.querySelector("."+(((w=(L=(p=this.config)==null?void 0:p.templates)==null?void 0:L.mainTemplateMobile)==null?void 0:w.filterByContainerClass)||C.facets.mainTemplateMobile.filterByContainerClass));T&&this.createFilterByComponent(T);const _=D.querySelector("."+(((k=(x=(f=this.config)==null?void 0:f.templates)==null?void 0:x.mainTemplateMobile)==null?void 0:k.selectedFacetsContainerClass)||C.facets.mainTemplateMobile.selectedFacetsContainerClass));_&&(this.createSelectedFacetsComponents(_),this.createClearFacetsComponents(_));const Z=D.querySelector("."+(((A=(F=(I=this.config)==null?void 0:I.templates)==null?void 0:F.mainTemplateMobile)==null?void 0:A.facetsContainerClass)||C.facets.mainTemplateMobile.facetsContainerClass));if(Z){Z.innerHTML="";for(const xe of e.facets)this.createFacetItem(xe,Z,!0)}}}}}class Or{constructor(e){h(this,"dataLayer"),h(this,"config"),h(this,"containerId"),h(this,"previousButtonClass"),h(this,"nextButtonClass"),h(this,"loadMoreButtonClass"),h(this,"routerHelper"),h(this,"searchPaginationMainContainer",null);var t,s,a,r,o,n,l,c,g;this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.routerHelper=e.routerHelper,this.previousButtonClass=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.mainTemplate)==null?void 0:a.previousButtonClass)??C.pagination.mainTemplate.previousButtonClass,this.nextButtonClass=((n=(o=(r=this.config)==null?void 0:r.templates)==null?void 0:o.mainTemplate)==null?void 0:n.nextButtonClass)??C.pagination.mainTemplate.nextButtonClass,this.loadMoreButtonClass=((g=(c=(l=this.config)==null?void 0:l.templates)==null?void 0:c.infiniteScrollTemplate)==null?void 0:g.loadMoreButtonClass)??C.pagination.infiniteScrollTemplate.loadMoreButtonClass,typeof document<"u"&&(this.searchPaginationMainContainer=document==null?void 0:document.getElementById(this.containerId)),this.initializeSubscriptions(),this.renderMainTemplate(this.generateTemplateData())}get isFirstPage(){var e;return((e=this.dataLayer.searchObject)==null?void 0:e.page)===1}get isLastPage(){return this.dataLayer.parsedData.data.isLastPage}initializeSubscriptions(){this.dataLayer.$searchResults.subscribe(e=>{e&&this.renderMainTemplate(this.generateTemplateData())})}generateTemplateData(){var e,t,s,a;const r={...this.dataLayer.parsedData.data,previousPageLink:(t=this.routerHelper)==null?void 0:t.searchObjectToUrl({...this.dataLayer.searchObject,page:((e=this.dataLayer.searchObject)==null?void 0:e.page)-1}),nextPageLink:(a=this.routerHelper)==null?void 0:a.searchObjectToUrl({...this.dataLayer.searchObject,page:((s=this.dataLayer.searchObject)==null?void 0:s.page)+1})};return this.dataLayer.setPaginationData(r),r}goToPage(e,t){const s=this.dataLayer.searchObject;s&&(s.page=e,this.dataLayer.setSearchObject(s)),t||window==null||window.scrollTo(0,0),document.body.tabIndex=-1,document.body.focus()}nextPage(e){var t;e==null||e.preventDefault(),e==null||e.stopPropagation(),this.isLastPage||this.goToPage(((t=this.dataLayer.searchObject)==null?void 0:t.page)+1,this.dataLayer.isInfiniteScroll)}previousPage(e){var t;e==null||e.preventDefault(),e==null||e.stopPropagation(),this.isFirstPage||this.goToPage(((t=this.dataLayer.searchObject)==null?void 0:t.page)-1)}overridePaginationEvents(){if(this.searchPaginationMainContainer){const e=this.searchPaginationMainContainer.querySelector("."+this.previousButtonClass),t=this.searchPaginationMainContainer.querySelector("."+this.nextButtonClass),s=this.searchPaginationMainContainer.querySelector("."+this.loadMoreButtonClass);e&&(e.addEventListener("click",this.previousPage.bind(this)),e.addEventListener("keydown",a=>{(a.code==="Space"||a.code==="Enter")&&this.previousPage(a)})),t&&(t.addEventListener("click",this.nextPage.bind(this)),t.addEventListener("keydown",a=>{(a.code==="Space"||a.code==="Enter")&&this.nextPage(a)})),s&&(s.addEventListener("click",this.nextPage.bind(this)),s.addEventListener("keydown",a=>{(a.code==="Space"||a.code==="Enter")&&this.nextPage(a)}))}}renderMainTemplate(e){var t,s,a,r,o,n,l,c,g,m;this.searchPaginationMainContainer&&((t=this.searchPaginationMainContainer.querySelector("."+this.previousButtonClass))==null||t.removeEventListener("click",this.previousPage),(s=this.searchPaginationMainContainer.querySelector("."+this.nextButtonClass))==null||s.removeEventListener("click",this.nextPage));let p=((o=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.mainTemplate)==null?void 0:o.template)||((n=C.pagination.mainTemplate)==null?void 0:n.template);this.dataLayer.isInfiniteScroll&&(p=((g=(c=(l=this.config)==null?void 0:l.templates)==null?void 0:c.infiniteScrollTemplate)==null?void 0:g.template)||((m=C.pagination.infiniteScrollTemplate)==null?void 0:m.template)),this.dataLayer.renderingEngine===B.mustache&&(this.searchPaginationMainContainer.innerHTML=O.render(p,e),setTimeout(()=>{this.overridePaginationEvents()},0))}}class Pr{constructor(e){h(this,"dataLayer"),h(this,"config"),h(this,"containerId"),h(this,"relatedSearchesContainerClass"),h(this,"searchRelatedSearchesMainContainer",null),h(this,"track");var t,s;this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.relatedSearchesContainerClass=((s=(t=this.config.templates)==null?void 0:t.main)==null?void 0:s.relatedSearchesContainerClass)||C.relatedSearches.main.relatedSearchesContainerClass,typeof document<"u"&&(this.searchRelatedSearchesMainContainer=document==null?void 0:document.getElementById(this.containerId)),this.track=e.trackRelatedSearchClick,this.initializeSubscriptions()}initializeSubscriptions(){this.dataLayer.$searchRelatedSearches.subscribe(e=>{e&&this.renderMainTemplate(this.generateTemplateData())})}generateTemplateData(){const e={...this.dataLayer.parsedData.data};return this.dataLayer.setRelatedSearchesData(e),e}addRelatedSearchComponent(e,t){var s,a,r,o,n;if(typeof document<"u"){const l=document==null?void 0:document.createElement("div"),c=((r=(a=(s=this.config)==null?void 0:s.templates)==null?void 0:a.relatedSearch)==null?void 0:r.template)||C.relatedSearches.relatedSearch.template;if(this.dataLayer.renderingEngine===B.mustache){l.innerHTML=O.render(c,e);const g=l.querySelector("."+(((n=(o=this.config.templates)==null?void 0:o.relatedSearch)==null?void 0:n.relatedSearchContainerClass)||C.relatedSearches.relatedSearch.relatedSearchContainerClass));g&&(t.appendChild(g),g.addEventListener("click",()=>{this.executeSearch(e)}),g.addEventListener("keyup",m=>{(m.code==="Space"||m.code==="Enter")&&this.executeSearch(e)}))}}}executeSearch(e){const t=this.dataLayer.searchObject;t.query=e.related_search,this.dataLayer.setSearchObject(t),this.track(e)}renderMainTemplate(e){var t,s,a,r;const o=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.main)==null?void 0:a.template)||C.relatedSearches.main.template;if(this.dataLayer.renderingEngine===B.mustache&&this.searchRelatedSearchesMainContainer){this.searchRelatedSearchesMainContainer.innerHTML="",this.searchRelatedSearchesMainContainer.innerHTML=O.render(o,e);const n=(r=this.searchRelatedSearchesMainContainer)==null?void 0:r.querySelector(`.${this.relatedSearchesContainerClass}`);if(n)for(const l of e.relatedSearches)this.addRelatedSearchComponent(l,n)}}}class Fr{constructor(e){h(this,"dataLayer"),h(this,"config"),h(this,"containerId"),h(this,"searchFeedbackMainContainer",null),h(this,"searchTrigger"),this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.searchTrigger=e.searchTrigger,typeof document<"u"&&(this.searchFeedbackMainContainer=document==null?void 0:document.getElementById(this.containerId)),this.initializeSubscriptions()}initializeSubscriptions(){this.dataLayer.$searchResults.subscribe(e=>{e&&this.renderMainTemplate(this.generateTemplateData())})}generateTemplateData(){const e={...this.dataLayer.parsedData.data};return this.dataLayer.setSearchFeedbackData(e),e}onOriginalQueryClick(e){var t;e.stopPropagation(),e.preventDefault();const s=(t=e.target)==null?void 0:t.innerHTML;this.searchTrigger(s,!0)}attachClick(){var e,t,s,a,r;const o=(r=this.searchFeedbackMainContainer)==null?void 0:r.querySelector("."+(((s=(t=(e=this.config)==null?void 0:e.templates)==null?void 0:t.main)==null?void 0:s.originalQueryClass)||((a=C.searchFeedback.main)==null?void 0:a.originalQueryClass)));o&&o.addEventListener("click",this.onOriginalQueryClick.bind(this))}renderMainTemplate(e){var t,s,a;const r=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.main)==null?void 0:a.template)||C.searchFeedback.main.template;this.dataLayer.renderingEngine===B.mustache&&(this.searchFeedbackMainContainer.innerHTML=O.render(r,e),setTimeout(()=>{this.attachClick()},0))}}class zr{constructor(e){h(this,"searchHelper"),h(this,"dataLayer"),h(this,"config"),h(this,"suggestAfterMinChars"),h(this,"containerId"),h(this,"currentInputValue",""),h(this,"autosuggestResults"),h(this,"searchInput"),h(this,"actionButton"),h(this,"autosuggestContainer"),h(this,"buttonState","search"),h(this,"selectedAutosuggestItem",-1),h(this,"suggestTrigger"),h(this,"searchTrigger"),this.dataLayer=e.dataLayer,this.config=e.config,this.searchTrigger=e.searchTrigger,this.suggestTrigger=e.suggestTrigger,this.containerId=e.containerId,this.suggestAfterMinChars=e.config.suggestAfterMinChars,this.suggestAfterMinChars===void 0&&this.getSuggestAfterValue(),this.dataLayer.$locationEnabled.subscribeUntilHasValue(()=>{this.renderMainTemplate(),this.actionButtonInit(),this.updateActionButtonState("search"),this.searchInput&&(this.createAutosuggestContainer(),this.attachSubscriptions())},200)}renderMainTemplate(){var e,t,s,a;if(typeof document<"u"){const r=document==null?void 0:document.getElementById(this.containerId);if(!r)throw new Error("Search input container not found");const o=((t=(e=this.config.templates)==null?void 0:e.mainTemplate)==null?void 0:t.template)||C.searchInput.mainTemplate.template,n={...this.dataLayer.parsedData.data,locationEnabled:!!this.dataLayer.locationEnabled};if(this.dataLayer.setInputWidgetTemplateData(n),this.dataLayer.renderingEngine===B.mustache){const g=O.render(o,n);r.innerHTML=g,this.dataLayer.setInputTemplateRendered(!0)}const l=((a=(s=this.config.templates)==null?void 0:s.mainTemplate)==null?void 0:a.searchInputId)||C.searchInput.mainTemplate.searchInputId,c=document==null?void 0:document.querySelector(`#${l}`);if(c)this.searchInput=c,c.addEventListener("keyup",this.inputKeyupEvent.bind(this)),c.addEventListener("blur",this.hideAutosuggest.bind(this)),c.addEventListener("paste",this.inputPasteEvent.bind(this));else throw new Error("Input not found")}}createAutosuggestContainer(){var e;this.dataLayer.renderingEngine===B.mustache&&typeof document<"u"&&(this.autosuggestContainer=document==null?void 0:document.createElement("div"),this.autosuggestContainer.classList.add("searchstax-autosuggest-container"),this.autosuggestContainer.addEventListener("mouseleave",()=>{this.resetAutosuggestSelection(),this.markActiveAutosuggestItem()}),(e=this.searchInput)==null||e.after(this.autosuggestContainer))}getSuggestAfterValue(){this.dataLayer.searchHelper&&this.dataLayer.searchHelper.suggest("*",e=>{this.suggestAfterMinChars=e.metadata.minPrefixChars},[])}actionButtonInit(){typeof document<"u"&&(this.actionButton=document==null?void 0:document.getElementById("searchstax-search-input-action-button"),this.actionButton&&this.actionButton.addEventListener("click",()=>{var e;this.executeSearch(((e=this.searchInput)==null?void 0:e.value)??"")}))}attachSubscriptions(){this.dataLayer.$searchTermChange.subscribe(()=>{this.handleSearchTermChange()}),this.dataLayer.$loadingChange.subscribe(()=>{this.handleLoadingChange()}),this.dataLayer.$searchAutosuggest.subscribe(e=>{e&&this.appendSuggestions(e)}),this.dataLayer.$searchObject.subscribe(e=>{e.query!=="undefined"&&e.query!==void 0&&e.query!=="*"&&this.searchInput&&(this.searchInput.value=this.cleanSuggestionTerm(e.query??""))})}handleLoadingChange(){this.dataLayer.loading?this.updateActionButtonState("loading"):this.handleSearchTermChange()}handleSearchTermChange(){this.updateActionButtonState("search")}updateActionButtonState(e){if(this.buttonState=e,this.actionButton)switch(this.actionButton.classList.remove("searchstax-spinner-icon"),this.actionButton.classList.remove("searchstax-search-icon"),e){case"loading":this.actionButton.classList.add("searchstax-spinner-icon");break;case"search":this.actionButton.classList.add("searchstax-search-icon"),this.actionButton.setAttribute("aria-label","search");break}}selectPreviousAutosuggestItem(e){this.selectedAutosuggestItem>0?this.selectedAutosuggestItem--:this.selectedAutosuggestItem===0?(this.selectedAutosuggestItem=-1,e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length)),G.setAccessibilityText("No Suggestion selected")):this.selectedAutosuggestItem=this.autosuggestResults.suggestions.length-1,this.markActiveAutosuggestItem()}selectNextAutosuggestItem(){this.selectedAutosuggestItem<this.autosuggestResults.suggestions.length-1?this.selectedAutosuggestItem++:this.selectedAutosuggestItem===this.autosuggestResults.suggestions.length-1?(this.selectedAutosuggestItem=-1,G.setAccessibilityText("No Suggestion selected")):this.selectedAutosuggestItem=0,this.markActiveAutosuggestItem()}resetAutosuggestSelection(){this.selectedAutosuggestItem=-1,this.markActiveAutosuggestItem()}markActiveAutosuggestItem(){if(typeof document<"u"){const e=document==null?void 0:document.getElementsByClassName("searchstax-autosuggest-item");for(let t=0;t<e.length;t++){const s=e[t];t===this.selectedAutosuggestItem?(s.classList.add("active"),G.setAccessibilityText(`Selected suggestion: ${s.innerText}`)):s.classList.remove("active")}}}inputKeyupEvent(e){const t=e.key;this.currentInputValue=e.target.value,t==="Enter"?this.suggestionChosen():t==="Escape"?this.hideAutosuggest(e.target):t==="ArrowUp"?this.selectPreviousAutosuggestItem(e.target):t==="ArrowDown"?this.selectNextAutosuggestItem():this.autosuggestHandling(e),this.handleSearchTermChange()}autosuggestHandling(e){this.suggestAfterMinChars&&e.target&&e.target.value.length>=this.suggestAfterMinChars?this.executeSuggest(e.target.value):this.hideAutosuggest()}inputPasteEvent(e){setTimeout(()=>{this.autosuggestHandling(e),this.handleSearchTermChange()},0)}executeSuggest(e){this.suggestTrigger(e)}executeSearch(e){this.hideAutosuggest(),this.searchTrigger(e===""?"*":e)}suggestionChosen(){this.selectedAutosuggestItem>-1?this.autosuggestItemClicked(this.autosuggestResults.suggestions[this.selectedAutosuggestItem]):this.executeSearch(this.currentInputValue)}hideAutosuggest(e){setTimeout(()=>{this.dataLayer.setAutosuggestResults({numFound:0,suggestions:[]}),this.autosuggestContainer&&(this.autosuggestContainer.innerHTML="",this.autosuggestContainer.classList.add("hidden")),this.resetAutosuggestSelection(),e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length)),G.setAccessibilityText("No Suggestion selected")},200)}cleanSuggestionTerm(e){return ee.removeXSSRiskyTags(e.replace(/(<([^>]+)>)/gi,"")).trim()}autosuggestItemClicked(e){this.searchInput.value=this.cleanSuggestionTerm(e.term??""),this.executeSearch(this.cleanSuggestionTerm(e.term))}createAutosuggestItem(e){var t,s,a;const r=document==null?void 0:document.createElement("div");r.classList.add("searchstax-autosuggest-item"),r.addEventListener("click",()=>{this.autosuggestItemClicked(e)}),r.addEventListener("mouseenter",()=>{this.onSuggestionEnter(e)});const o=((s=(t=this.config.templates)==null?void 0:t.autosuggestItemTemplate)==null?void 0:s.template)||((a=C.searchInput.autosuggestItemTemplate)==null?void 0:a.template);return r.innerHTML=O.render(o,e),r}onSuggestionEnter(e){var t;this.selectedAutosuggestItem=((t=this.autosuggestResults)==null?void 0:t.suggestions.indexOf(e))||0,this.markActiveAutosuggestItem()}appendSuggestions(e){this.autosuggestContainer&&(this.autosuggestContainer.innerHTML="",this.autosuggestContainer.classList.remove("hidden"));for(const t in e.suggest)if(Object.prototype.hasOwnProperty.call(e.suggest,t)){const s=e.suggest[t];for(const a in s)if(Object.prototype.hasOwnProperty.call(s,a)){const r=s[a];r.numFound?G.setAccessibilityText("Suggestions are available. Use up and down arrows to navigate while focusing input. Use Escape key to escape out of the suggestions",2e3):G.setAccessibilityText("",0),this.autosuggestResults=r,this.dataLayer.setAutosuggestResults(r),r.numFound>0?r.suggestions.forEach(o=>{this.autosuggestContainer&&typeof document<"u"&&this.autosuggestContainer.appendChild(this.createAutosuggestItem(o))}):this.autosuggestContainer&&this.autosuggestContainer.classList.add("hidden")}}}}class _r{constructor(e){h(this,"dataLayer"),h(this,"config"),h(this,"linkClickCallback"),h(this,"searchCallback"),h(this,"containerId"),h(this,"searchResultsMainContainer"),h(this,"searchResultsContainer"),h(this,"searchResultLinks",[]),this.linkClickCallback=e.linkClickCallback,this.searchCallback=e.searchTrigger,this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId;const t=document==null?void 0:document.getElementById(this.containerId);if(t)this.searchResultsMainContainer=t;else throw new Error(`Search Results Main Container with id ${this.containerId} not found`);this.dataLayer.setIsInfiniteScroll(e.config.renderMethod==="infiniteScroll"),this.initializeSubscriptions(),this.renderMainTemplate()}initializeSubscriptions(){this.dataLayer.$searchObject.subscribe(()=>{G.setAccessibilityText("Searching...")}),this.dataLayer.$searchResults.subscribe(e=>{e&&this.searchResultsContainer&&this.renderResults(e)})}changeTemplate(){this.dataLayer.searchResults&&this.renderResults(this.dataLayer.searchResults)}renderNoResultsTemplate(){var e,t,s,a,r;const o=((s=(t=(e=this.config)==null?void 0:e.templates)==null?void 0:t.noSearchResultTemplate)==null?void 0:s.template)||((a=C.searchResults.noSearchResultTemplate)==null?void 0:a.template),n=((r=this.dataLayer.searchResultsMetadata)==null?void 0:r.spellingSuggestion)??"";if(this.dataLayer.renderingEngine===B.mustache&&this.searchResultsContainer&&(this.searchResultsContainer.innerHTML=O.render(o,{spellingSuggestion:n,...this.dataLayer.parsedData.data,searchCallback:this.searchCallback.bind(this)})),n&&this.searchResultsContainer){const l=this.searchResultsContainer.querySelector("a");l&&l.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),this.searchCallback(n)})}}renderResults(e){var t,s,a,r,o;if(this.dataLayer.renderingEngine===B.mustache&&this.searchResultsContainer)if(this.removeLinkClickEvents(),e.length===0)G.setAccessibilityText("Search has no results"),this.renderNoResultsTemplate();else{G.setAccessibilityText(`Showing ${this.dataLayer.parsedData.startResultIndex} through ${this.dataLayer.parsedData.endResultIndex} results from ${this.dataLayer.parsedData.totalResults}. Press tab to navigate through results`);const n=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.searchResultTemplate)==null?void 0:a.template)||((r=C.searchResults.searchResultTemplate)==null?void 0:r.template),l=e.map(c=>O.render(n,c));((o=this.config)==null?void 0:o.renderMethod)==="infiniteScroll"&&this.dataLayer.searchObject.page>1?this.searchResultsContainer.innerHTML+=l.join(""):this.searchResultsContainer.innerHTML=l.join(""),this.searchResultLinks=Array.from(this.searchResultsContainer.querySelectorAll(`[${this.uniqueIdAttribute}]`)),this.attachLinkClickEvents()}}removeLinkClickEvents(){this.searchResultLinks.forEach(e=>{e.removeEventListener("click",()=>{}),e.removeEventListener("keydown",()=>{})})}get uniqueIdAttribute(){var e,t,s,a;return((s=(t=(e=this.config)==null?void 0:e.templates)==null?void 0:t.searchResultTemplate)==null?void 0:s.searchResultUniqueIdAttribute)||((a=C.searchResults.searchResultTemplate)==null?void 0:a.searchResultUniqueIdAttribute)}attachLinkClickEvents(){this.searchResultLinks.forEach(e=>{e.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const s=e.getAttribute(this.uniqueIdAttribute)??"";s&&this.linkClickCallback(s)}),e.addEventListener("keydown",t=>{if(t.code==="Space"||t.code==="Enter"){const s=e.getAttribute(this.uniqueIdAttribute)??"";s&&this.linkClickCallback(s)}})})}renderMainTemplate(){var e,t,s,a;const r=((s=(t=(e=this.config)==null?void 0:e.templates)==null?void 0:t.mainTemplate)==null?void 0:s.template)||((a=C.searchResults.mainTemplate)==null?void 0:a.template);this.dataLayer.renderingEngine===B.mustache&&(this.searchResultsMainContainer.innerHTML=O.render(r,{}),setTimeout(()=>{var o,n,l,c,g,m,p;const L=(l=(n=(o=this.config)==null?void 0:o.templates)==null?void 0:n.mainTemplate)!=null&&l.searchResultsContainerId?(m=(g=(c=this.config)==null?void 0:c.templates)==null?void 0:g.mainTemplate)==null?void 0:m.searchResultsContainerId:(p=C.searchResults.mainTemplate)==null?void 0:p.searchResultsContainerId,w=document==null?void 0:document.getElementById(L);if(w)this.searchResultsContainer=w;else throw new Error(`Search Results Container with id ${L} not found`)},0))}}class $r{constructor(e){h(this,"dataLayer"),h(this,"config"),h(this,"containerId"),h(this,"selectId"),h(this,"searchSortingMainContainer",null);var t,s;this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.selectId=((s=(t=this.config.templates)==null?void 0:t.main)==null?void 0:s.selectId)||C.sorting.main.selectId,this.searchSortingMainContainer=document==null?void 0:document.getElementById(this.containerId),this.initializeSubscriptions(),this.renderMainTemplate(this.generateTemplateData())}initializeSubscriptions(){this.dataLayer.$searchResults.subscribe(e=>{e&&this.renderMainTemplate(this.generateTemplateData())})}generateTemplateData(){const e={...this.dataLayer.parsedData.data};return this.dataLayer.setSearchSortingData(e),e}setOrderQuery(e){const t=this.dataLayer.searchObject;t&&(t.order=e,this.dataLayer.setSearchObject(t))}markOptionSelected(){const e=document==null?void 0:document.getElementById(this.selectId);if(e){const t=e.querySelector(`option[value="${decodeURIComponent(this.dataLayer.searchObject.order)}"]`);t&&(t.selected=!0)}}renderMainTemplate(e){var t,s,a;const r=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.main)==null?void 0:a.template)||C.sorting.main.template;if(this.dataLayer.renderingEngine===B.mustache){this.searchSortingMainContainer.innerHTML=O.render(r,e),this.markOptionSelected();const o=document==null?void 0:document.getElementById(this.selectId);o&&o.addEventListener("change",n=>{this.setOrderQuery(n.target.value)})}}}class Wr{constructor(e){h(this,"analyticsKey"),h(this,"containerId"),h(this,"mainContainer"),h(this,"isLightweight"),h(this,"emailOverride"),h(this,"feedbackTextAreaOverride"),h(this,"mainTemplateOverride"),h(this,"lightweightTemplateOverride"),h(this,"focusedElement",null),h(this,"templateData",{feedbackOpen:!1,ratings:[{index:1,isSelected:!1},{index:2,isSelected:!1},{index:3,isSelected:!1},{index:4,isSelected:!1},{index:5,isSelected:!1},{index:6,isSelected:!1},{index:7,isSelected:!1},{index:8,isSelected:!1},{index:9,isSelected:!1},{index:10,isSelected:!1}],emailInput:"",feedbackTextArea:"",charactersLeft:2e3,maxLength:2e3,errors:{rating:!1,email:!1},submitted:!1,thumbsUpActive:!1,thumbsDownActive:!1}),h(this,"thumbsUpValue",10),h(this,"thumbsDownValue",1),h(this,"ratedQuestion",""),h(this,"language",""),h(this,"model",""),this.analyticsKey=e.analyticsKey,this.containerId=e.containerId??"sf-feedback",this.isLightweight=e.lightweight??!1,this.isLightweight&&this.templateData.ratings.unshift({index:0,isSelected:!1}),this.thumbsUpValue=e.thumbsUpValue??10,this.thumbsDownValue=e.thumbsDownValue??1,this.emailOverride=e.emailOverride,this.feedbackTextAreaOverride=e.feedbackTextAreaOverride,this.mainTemplateOverride=e.mainTemplateOverride,this.lightweightTemplateOverride=e.lightweightTemplateOverride,this.mainContainer=document.getElementById(this.containerId),this.language=e.language??"",this.model=e.model??"",this.init()}init(){fe.attachAnalyticsScript(),this.renderMainTemplate(this.generateTemplateData())}generateTemplateData(){return this.templateData}renderMainTemplate(e){var t,s;const a=document.activeElement;console.log("focused",a),console.log("focused.type",a.type),(a instanceof HTMLInputElement||a instanceof HTMLButtonElement)&&(a.type==="radio"||a.type==="button")?(console.log("fdsl;fm,l;dsfl;sdkfl;dskmfl;dsfl"),this.focusedElement=a):this.focusedElement=null,this.mainContainer;let r=(t=ce==null?void 0:ce.mainTemplate)==null?void 0:t.template;if(this.mainTemplateOverride&&(r=this.mainTemplateOverride),this.isLightweight&&(r=(s=ce.lightweightTemplate)==null?void 0:s.template,this.lightweightTemplateOverride&&(r=this.lightweightTemplateOverride)),this.mainContainer.innerHTML=O.render(r,e),this.focusedElement&&this.mainContainer){const o=this.focusedElement.type==="radio"?this.focusedElement.getAttribute("id"):this.focusedElement.getAttribute("class"),n=this.focusedElement.type==="radio"?"id":"class",l=this.mainContainer.querySelector(`[${n}="${o}"]`);(l instanceof HTMLInputElement||l instanceof HTMLButtonElement)&&l.focus(),this.focusedElement=null}this.attachEvents()}attachEvents(){this.isLightweight?this.attachLightweightEvents():(this.attachOpenModalEvent(),this.closeModalEvent(),this.attachRatingEvents(),this.attachTextAreaEvents(),this.attachEmailInputEvents(),this.attachSubmitButtonEvents())}attachLightweightEvents(){var e,t,s,a;const r=(e=ce.lightweightTemplate)==null?void 0:e.thumbsUpButtonClass,o=(t=ce.lightweightTemplate)==null?void 0:t.thumbsDownButtonClass,n=(s=this.mainContainer)==null?void 0:s.querySelector("."+r),l=(a=this.mainContainer)==null?void 0:a.querySelector("."+o);n&&n.addEventListener("click",()=>{const c=this.feedbackTextAreaOverride&&this.isLightweight?this.feedbackTextAreaOverride():this.templateData.feedbackTextArea;this.templateData.ratings[this.templateData.ratings.length-1].isSelected&&this.ratedQuestion===c||(this.templateData.thumbsUpActive=!0,this.templateData.thumbsDownActive=!1,this.templateData.ratings.forEach(g=>{g.isSelected=g.index===this.thumbsUpValue}),this.renderMainTemplate(this.generateTemplateData()),this.ratedQuestion=c,this.submit())}),l&&l.addEventListener("click",()=>{const c=this.feedbackTextAreaOverride&&this.isLightweight?this.feedbackTextAreaOverride():this.templateData.feedbackTextArea;this.templateData.ratings[0].isSelected&&this.ratedQuestion===c||(this.templateData.thumbsUpActive=!1,this.templateData.thumbsDownActive=!0,this.templateData.ratings.forEach(g=>{g.isSelected=g.index===this.thumbsDownValue}),this.renderMainTemplate(this.generateTemplateData()),this.ratedQuestion=c,this.submit())})}attachSubmitButtonEvents(){var e,t;const s=(e=ce.mainTemplate)==null?void 0:e.submitButtonClass,a=(t=this.mainContainer)==null?void 0:t.querySelector("."+s);a&&a.addEventListener("click",()=>{this.checkIfValid()})}checkIfValid(){var e,t;const s=(t=this.mainContainer)==null?void 0:t.querySelector("#"+((e=ce.mainTemplate)==null?void 0:e.emailInputId));this.validateEmail(s.value)?this.templateData.errors.email=!1:(this.templateData.errors.email=!0,G.setAccessibilityText("Please enter a valid email address.")),this.templateData.ratings.some(a=>a.isSelected)?this.templateData.errors.rating=!1:(this.templateData.errors.rating=!0,G.setAccessibilityText("Please Rate your experience.")),this.templateData.errors.rating||this.templateData.errors.email?this.renderMainTemplate(this.generateTemplateData()):this.submit()}submit(){var e;this.templateData.submitted=!0;const t=(e=this.templateData.ratings.find(s=>s.isSelected))==null?void 0:e.index;t!==void 0&&(fe.trackFeedback({trackApiKey:this.analyticsKey,email:this.emailOverride&&this.isLightweight?this.emailOverride():this.templateData.emailInput,rating:t,feedback:this.feedbackTextAreaOverride&&this.isLightweight?this.feedbackTextAreaOverride():this.templateData.feedbackTextArea,model:this.model?this.model:void 0,language:this.language?this.language:void 0}),G.setAccessibilityText("Feedback has been sent.",1e3)),this.renderMainTemplate(this.generateTemplateData())}validateEmail(e){return e===""?!0:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}attachEmailInputEvents(){var e,t;const s=(t=this.mainContainer)==null?void 0:t.querySelector("#"+((e=ce.mainTemplate)==null?void 0:e.emailInputId));s&&(s.addEventListener("input",()=>{this.templateData.emailInput=s.value}),s.addEventListener("blur",()=>{setTimeout(()=>{this.validateEmail(s.value)?this.templateData.errors.email=!1:(this.templateData.errors.email=!0,G.setAccessibilityText("Please enter a valid email address.")),this.renderMainTemplate(this.generateTemplateData())},100)}))}attachTextAreaEvents(){var e,t;const s=(t=this.mainContainer)==null?void 0:t.querySelector("#"+((e=ce.mainTemplate)==null?void 0:e.feedbackTextAreaId));s&&s.addEventListener("input",()=>{var a,r;this.templateData.feedbackTextArea=s.value,this.templateData.charactersLeft=this.templateData.maxLength-s.value.length;const o=(r=this.mainContainer)==null?void 0:r.querySelector("."+((a=ce.mainTemplate)==null?void 0:a.charactersRemainingContainerclass));o&&(o.innerText=this.templateData.charactersLeft+"")})}attachRatingEvents(){var e,t;const s=(e=ce.mainTemplate)==null?void 0:e.ratingInputclass,a=(t=this.mainContainer)==null?void 0:t.querySelectorAll("."+s);a&&a.forEach(r=>{r.addEventListener("click",o=>{const n=o.target.value;this.templateData.ratings.forEach(l=>{l.isSelected=l.index+""===n}),this.templateData.errors.rating=!1,this.renderMainTemplate(this.generateTemplateData())})})}attachOpenModalEvent(){var e,t;const s=(e=ce.mainTemplate)==null?void 0:e.openModalButtonClass,a=(t=this.mainContainer)==null?void 0:t.querySelector("."+s);a&&a.addEventListener("click",r=>{r.preventDefault(),this.toggleModal()})}toggleModal(){this.templateData.feedbackOpen?this.closeFeedbackModal():this.openFeedbackModal()}closeModalEvent(){var e,t;const s=(e=ce.mainTemplate)==null?void 0:e.closeModalButtonClass,a=(t=this.mainContainer)==null?void 0:t.querySelector("."+s);a&&a.addEventListener("click",()=>{this.closeFeedbackModal()})}openFeedbackModal(){this.templateData.feedbackOpen=!0,this.renderMainTemplate(this.generateTemplateData()),G.setAccessibilityText("Feedback form opened",1e3)}closeFeedbackModal(){this.templateData.feedbackOpen=!1,this.renderMainTemplate(this.generateTemplateData()),G.setAccessibilityText("Feedback form closed",1e3)}}class Qr{constructor(e){h(this,"dataLayer"),h(this,"config"),h(this,"containerId"),h(this,"answerContainer",null),h(this,"showMoreVisible",!1),h(this,"renderFeedbackWidget",!1),h(this,"clicked",!1),h(this,"renderedWithShowMore",!1);var t;this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.renderFeedbackWidget=((t=this.config.feedbackwidget)==null?void 0:t.renderFeedbackWidget)||!1,this.config.showMoreAfterWordCount&&(this.dataLayer.answerWidgetShowMoreLimit=this.config.showMoreAfterWordCount),typeof document<"u"&&(this.answerContainer=document==null?void 0:document.getElementById(this.containerId)),this.initializeSubscriptions(),this.dataLayer.setIsAnswerWidgetCreated(!0)}initializeSubscriptions(){this.dataLayer.$answer.subscribe(()=>{this.clicked?this.showMoreVisible=!1:this.showMoreVisible=this.dataLayer.parsedData.shouldShowAnswerLoadMore,this.renderMainTemplate(this.generateTemplateData())}),this.dataLayer.$answerLoading.subscribe(()=>{this.renderMainTemplate(this.generateTemplateData())}),this.dataLayer.$answerError.subscribe(e=>{e&&setTimeout(()=>{this.renderMainTemplate(this.generateTemplateData())},100)}),this.dataLayer.$searchObject.subscribe(()=>{this.clicked=!1,this.renderedWithShowMore=!1,this.showMoreVisible=!1}),this.dataLayer.$paginationData.subscribe(()=>{this.renderMainTemplate(this.generateTemplateData())}),this.dataLayer.$answer.subscribe(e=>{e&&setTimeout(()=>{this.initializeWidget()},600)}),this.dataLayer.$searchResults.subscribe(e=>{e&&this.dataLayer.$answer.getValue()&&setTimeout(()=>{this.initializeWidget()},600)})}searchstaxFeedbackTextAreaOverride(){return"Question: "+(this.dataLayer.searchObject.query==="undefined"?"":this.dataLayer.searchObject.query)+" Answer: "+this.dataLayer.parsedData.getAnswerData}initializeWidget(){var e,t,s,a,r;this.renderFeedbackWidget&&document.getElementById("feedbackWidgetContainer")&&!this.dataLayer.answerLoading&&new Wr({analyticsKey:this.dataLayer.parsedData.trackingData.trackApiKey,containerId:"feedbackWidgetContainer",lightweight:!0,model:this.dataLayer.parsedData.trackingData.model,language:this.dataLayer.parsedData.trackingData.language,emailOverride:(e=this.config.feedbackwidget)==null?void 0:e.emailOverride,feedbackTextAreaOverride:((t=this.config.feedbackwidget)==null?void 0:t.searchstaxFeedbackTextAreaOverride)??this.searchstaxFeedbackTextAreaOverride.bind(this),thumbsUpValue:((s=this.config.feedbackwidget)==null?void 0:s.thumbsUpValue)??10,thumbsDownValue:((a=this.config.feedbackwidget)==null?void 0:a.thumbsDownValue)??0,lightweightTemplateOverride:(r=this.config.feedbackwidget)==null?void 0:r.lightweightTemplateOverride})}showMore(e){e.preventDefault(),this.clicked=!0,this.showMoreVisible=!1,this.renderMainTemplate(this.generateTemplateData()),setTimeout(()=>{this.initializeWidget()},600)}attachClickEventToShowMore(){const e=document.querySelector(".searchstax-answer-load-more-button");e&&e.addEventListener("click",this.showMore.bind(this))}trackLinkClick(e){e.preventDefault(),e.stopPropagation();const t=e.target.getAttribute("href");fe.trackAnswerLinkClick({href:t,answer:this.dataLayer.parsedData.getAnswerData,...this.dataLayer.parsedData.trackingData}).then(()=>{window.open(t,"_blank")}).catch(()=>{window.open(t,"_blank")})}attachLinkTracking(){document.querySelectorAll(".searchstax-answer-link").forEach(e=>{e.getAttribute("listener")!=="true"&&(e.setAttribute("listener","true"),e.addEventListener("click",this.trackLinkClick.bind(this)))})}renderMainTemplate(e){var t,s,a;const r=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.main)==null?void 0:a.template)||C.answer.main.template;this.dataLayer.renderingEngine===B.mustache?(!this.renderedWithShowMore||!e.answerLoading||this.clicked)&&(e.showMoreButtonVisible&&(this.renderedWithShowMore=!0),this.answerContainer.innerHTML=O.render(r,e),setTimeout(()=>{this.attachClickEventToShowMore(),this.attachLinkTracking()},100)):setTimeout(()=>{this.attachLinkTracking()},500)}generateTemplateData(){const e={...this.dataLayer.parsedData.data,showMoreButtonVisible:this.showMoreVisible};return this.dataLayer.setAnswerFullData(e),e}}class Ss{constructor(e){h(this,"dataLayer"),h(this,"config"),h(this,"containerId"),h(this,"currentSelectValue",""),h(this,"locationInput"),h(this,"radiusInput"),h(this,"locationDecode"),h(this,"locationDecodeCoordinatesToAddress");var t,s;this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,this.locationDecode=(t=e.config.hooks)==null?void 0:t.locationDecode,this.locationDecodeCoordinatesToAddress=(s=e.config.hooks)==null?void 0:s.locationDecodeCoordinatesToAddress,this.dataLayer.locationEnabled&&this.dataLayer.$inputTemplateRendered.subscribeUntil(()=>{this.renderMainTemplate(),this.attachSubscriptions()},!0,500)}renderMainTemplate(){var e,t,s,a,r,o,n,l;if(typeof document<"u"){const c=document==null?void 0:document.getElementById(this.containerId);if(!c)throw new Error("Search input container not found");const g=((t=(e=this.config.templates)==null?void 0:e.mainTemplate)==null?void 0:t.template)||C.location.mainTemplate.template,m={...this.dataLayer.parsedData.data};if(this.dataLayer.setLocationWidgetTemplateData(m),this.dataLayer.renderingEngine===B.mustache){const p=O.render(g,m);c.innerHTML=p;const L=((a=(s=this.config.templates)==null?void 0:s.mainTemplate)==null?void 0:a.locationInputId)||C.location.mainTemplate.locationInputId,w=document==null?void 0:document.querySelector(`#${L}`);if(w)this.locationInput=w,w.addEventListener("blur",this.blurEvent.bind(this)),w.addEventListener("focus",this.focusEvent.bind(this));else throw new Error("Input not found");const f=((o=(r=this.config.templates)==null?void 0:r.mainTemplate)==null?void 0:o.radiusInputId)||C.location.mainTemplate.radiusInputId,x=document==null?void 0:document.querySelector(`#${f}`);x instanceof HTMLSelectElement&&(this.radiusInput=x,x.addEventListener("change",this.radiusSelectChangeEvent.bind(this)));const k=((l=(n=this.config.templates)==null?void 0:n.mainTemplate)==null?void 0:l.currentLocationActionButtonId)||C.location.mainTemplate.currentLocationActionButtonId,I=document==null?void 0:document.querySelector(`#${k}`);I&&I.addEventListener("click",this.getCurrentLocation.bind(this))}}}setCurrentLocationFields(e){this.dataLayer.setLocationCoordinatesDecoded(e),this.dataLayer.setSearchLocation(this.dataLayer.searchLocationCoordinatesDecoded),this.dataLayer.renderingEngine===B.mustache&&this.locationInput&&(this.locationInput.value=this.dataLayer.searchLocationCoordinatesDecoded)}getCurrentLocation(){navigator.geolocation?navigator.geolocation.getCurrentPosition(e=>{const t=e.coords.latitude.toString(),s=e.coords.longitude.toString(),a=Math.floor(parseFloat(t)*100)/100,r=Math.floor(parseFloat(s)*100)/100;this.dataLayer.setSearchLat(a+""),this.dataLayer.setSearchLong(r+"");const o=this.locationDecodeCoordinatesToAddress;o?o(a+"",r+"").then(n=>{this.setCurrentLocationFields(n.address||"Current Location")}).catch(()=>{this.setCurrentLocationFields("Current Location")}):this.setCurrentLocationFields("Current Location")},()=>{console.error("Unable to retrieve your location")}):console.error("Geolocation is not supported by this browser.")}setRadiusValue(e){this.dataLayer.setSearchRadius(e)}radiusSelectChangeEvent(e){this.currentSelectValue=e.target.value,this.setRadiusValue(this.currentSelectValue)}attachSubscriptions(){this.dataLayer.$searchObject.subscribe(e=>{this.locationInput&&(this.locationInput.value=this.cleanSuggestionTerm(e.location.address??"")),this.radiusInput&&e.location.radius&&(this.radiusInput.value=e.location.radius||"")})}cleanSuggestionTerm(e){return ee.removeXSSRiskyTags(e.replace(/(<([^>]+)>)/gi,"")).trim()}triggerGeocoder(e){const t=this.locationDecode;this.dataLayer.setLocationDecodingLoading(!0),e&&this.dataLayer.searchLocation!==e&&e!==this.dataLayer.searchLocationCoordinatesDecoded?t(e).then(s=>{this.dataLayer.setSearchLocation(s.address||""),this.dataLayer.setSearchLat(s.lat||""),this.dataLayer.setSearchLong(s.lon||""),this.locationInput&&(this.locationInput.value=this.cleanSuggestionTerm(s.address||"")),this.dataLayer.renderingEngine===B.mustache&&s.error&&this.locationInput&&this.locationInput.classList.add("searchstax-input-location-error"),s.error?this.dataLayer.setLocationError(!0):this.dataLayer.setLocationError(!1),this.dataLayer.setLocationDecodingLoading(!1)}).catch(()=>{this.dataLayer.setLocationDecodingLoading(!1)}):e===""&&(this.dataLayer.setSearchLocation(void 0),this.dataLayer.setSearchLat(void 0),this.dataLayer.setSearchLong(void 0),this.dataLayer.setLocationDecodingLoading(!1))}focusEvent(e){e.target.classList.remove("searchstax-input-location-error"),this.dataLayer.setLocationError(!1)}blurEvent(e){const t=e.target.value;this.triggerGeocoder(t)}}class Vr{constructor(e=B.mustache){h(this,"routerEnabled",!1),h(this,"cachedQuery",""),h(this,"routerHelper"),h(this,"searchHelper"),h(this,"searchResultsConfig"),h(this,"searchPaginationConfig"),h(this,"searchFeedbackConfig"),h(this,"searchSortingConfig"),h(this,"searchFacetsConfig"),h(this,"relatedSearchesConfig"),h(this,"externalPromotionsConfig"),h(this,"searchInputWidget"),h(this,"searchLocationWidget"),h(this,"searchResultsWidget"),h(this,"searchFacetsWidget"),h(this,"searchPaginationWidget"),h(this,"searchFeedbackWidget"),h(this,"searchSortingWidget"),h(this,"relatedSearchesWidget"),h(this,"externalPromotionsWidget"),h(this,"answerWidget"),h(this,"locationObserver",null),h(this,"dataLayer"),h(this,"firstRequest",!0),h(this,"previousQuery",""),h(this,"eventSource",null),h(this,"renderEngine",B.mustache),e&&(this.renderEngine=e)}setRenderingEngine(e=B.mustache){this.dataLayer.setRenderingEngine(e)}handleHooks(){var e,t;(t=(e=this.dataLayer.searchstaxConfig)==null?void 0:e.hooks)!=null&&t.afterSearch&&this.dataLayer.$searchResults.subscribe(s=>{this.dataLayer.searchstaxConfig.hooks.afterSearch(s)}),setTimeout(()=>{this.dataLayer.$searchObject.subscribe(s=>{var a,r,o,n,l,c;s.query!==this.previousQuery&&this.dataLayer.setAnswerData(""),s.query!==""&&s.query!==void 0&&s.query!=="undefined"?(this.search(s),s.query!==this.previousQuery&&this.startSSE(s.query)):(a=this.dataLayer.searchLocationConfig)!=null&&a.locationSearchEnabled&&!((r=this.dataLayer.searchLocationConfig)!=null&&r.locationValuesOverride)?this.getMetadata(s):(n=(o=this.dataLayer.searchLocationConfig)==null?void 0:o.locationValuesOverride)!=null&&n.locationFilterDefaultValue&&this.dataLayer.setSearchRadius((c=(l=this.dataLayer.searchLocationConfig)==null?void 0:l.locationValuesOverride)==null?void 0:c.locationFilterDefaultValue),this.previousQuery=s.query})},10),this.dataLayer.$searchResults.subscribe(s=>{s&&this.dataLayer.searchResultsMetadata&&!this.dataLayer.cookiesDisabled&&fe.trackSearch({...this.dataLayer.parsedData.trackingData,impressions:this.dataLayer.searchResultsMetadata.impressions})})}startSSE(e){var t,s;this.eventSource&&((t=this.eventSource)==null||t.close(),this.dataLayer.setAnswerData("")),this.dataLayer.turnAIAnswerGenerationOn===!0&&this.dataLayer.questionURL&&this.dataLayer.searchObject.query!==void 0&&this.dataLayer.searchObject.query!=="undefined"&&(this.eventSource=(s=this.searchHelper)==null?void 0:s.startSSE(e,this.parseAnswerResultsResponse.bind(this)))}attachAnalyticsScript(e){fe.attachAnalyticsScript(e)}initialize(e){var t,s;if(this.dataLayer=new er("searchstax_session_id",e.sessionId),this.renderEngine&&this.dataLayer.setRenderingEngine(this.renderEngine),this.handleHooks(),e.questionURL&&(this.dataLayer.questionURL=e.questionURL),e.analyticsBaseUrl&&typeof window<"u"&&(window.analyticsBaseUrl=e.analyticsBaseUrl,window._msq=e._msq||[],this.attachAnalyticsScript(e.analyticsSrc)),e.autoCorrect===!1&&(this.dataLayer.autoCorrect=!1),e.language&&this.dataLayer.setLanguage(e.language),e.model&&this.dataLayer.setModel(e.model),this.dataLayer.searchstaxConfig||(this.dataLayer.setSearchstaxConfig(e),this.searchHelper=new nr({...e,sessionId:this.dataLayer.sessionId},this.dataLayer),this.dataLayer.searchHelper=this.searchHelper),((t=e.router)==null?void 0:t.enabled)===void 0||((s=e.router)==null?void 0:s.enabled)===!0){this.routerEnabled=!0,this.routerHelper=new Ls(e.router?e.router:{enabled:!0});const a=this.routerHelper.urlToSearchObject((window==null?void 0:window.location.href)??"");this.dataLayer.searchObject.itemsPerPage&&(a.itemsPerPage=this.dataLayer.searchObject.itemsPerPage),a.model&&this.dataLayer.setModel(a.model),a.location&&(a.location.address&&this.dataLayer.setSearchLocation(a.location.address),a.location.lat&&this.dataLayer.setSearchLat(a.location.lat),a.location.lon&&this.dataLayer.setSearchLong(a.location.lon),a.location.radius&&this.dataLayer.setSearchRadius(a.location.radius)),this.dataLayer.setSearchObject(a),addEventListener("popstate",()=>{this.routerHelper&&this.dataLayer.setSearchObject(this.routerHelper.urlToSearchObject((window==null?void 0:window.location.href)??"",this.dataLayer.searchObject.itemsPerPage))})}else this.routerHelper=new Ls({})}getMetadata(e){this.searchHelper&&(e.query==="undefined"||e.query===void 0)&&this.dataLayer.setSearchObject({...e,query:"*"})}search(e){if(this.searchHelper){const t=this.dataLayer.forceNotCorrect;this.searchHelper.search(e,this.parseSearchResultsResponse.bind(this),this.firstRequest,t),this.firstRequest=!1,this.getRelatedSearches()}}getRelatedSearches(){this.searchHelper&&this.relatedSearchesConfig&&this.dataLayer.searchObject.query!==void 0&&this.dataLayer.searchObject.query!=="undefined"&&this.searchHelper.getRelatedSearches(this.dataLayer.searchObject,this.relatedSearchesConfig.relatedSearchesURL,this.relatedSearchesConfig.relatedSearchesAPIKey,this.parseRelatedSearchesResponse.bind(this))}parseRelatedSearchesResponse(e){var t,s;const a=(((t=e.response)==null?void 0:t.docs)??[]).map((o,n)=>({...o,position:n+1})),r=[];for(const o of a)r.push({relatedSearch:o.related_search,position:o.position});this.dataLayer.setSearchRelatedSearches(a),this.dataLayer.searchResultsMetadata&&!this.dataLayer.cookiesDisabled&&fe.trackRelatedSearches({...this.dataLayer.parsedData.trackingData,impressions:r,totalRelatredSearches:((s=this.dataLayer.searchRelatedSearches)==null?void 0:s.length)??0})}handleRouter(){if(this.routerEnabled){const e={...this.dataLayer.searchObject};this.dataLayer.isInfiniteScroll&&delete e.page,this.routerHelper.updateUrl(e)}}parseSearchResultsResponseMetadata(e){var t,s,a,r;const o=gt.extractSearchResultsMetadata(e),n=((s=(t=this.dataLayer.searchLocationConfig)==null?void 0:t.locationValuesOverride)==null?void 0:s.locationFilterDefaultValue)??((r=(a=o.location)==null?void 0:a.filter)==null?void 0:r.defaultValue);!this.dataLayer.searchRadius&&n&&this.dataLayer.setSearchRadius(n),this.dataLayer.setSearchResultsMetadata(o)}parseSearchResultsResponse(e){var t,s;this.handleRouter(),this.dataLayer.setItemsPerPage(parseInt(e.responseHeader.params.rows)),this.dataLayer.setModel(e.responseHeader.params.model);let a=gt.combineResultsWithMetadata(e),r=gt.extractFacets(e);this.dataLayer.setSearchFacets(r),(s=(t=this.dataLayer.searchstaxConfig)==null?void 0:t.hooks)!=null&&s.afterSearch&&(a=this.dataLayer.searchstaxConfig.hooks.afterSearch(a)),this.dataLayer.setSearchExternalPromotions(e.externalLinks??[]),this.parseSearchResultsResponseMetadata(e),this.dataLayer.setSearchResults(a)}parseAnswerResultsResponse(e){this.handleRouter(),e!==$e.question&&e!==$e.notQuestion&&(this.dataLayer.setAnswerLoading(!0),this.dataLayer.setAnswerData(this.dataLayer.getAnswerData+e))}cacheFacets(){var e;(e=this.searchHelper)==null||e.cacheFacets()}parseSuggestSuggestResponse(e){var t,s;let a=e;(s=(t=this.dataLayer.searchInputConfig)==null?void 0:t.hooks)!=null&&s.afterAutosuggest&&(a=this.dataLayer.searchInputConfig.hooks.afterAutosuggest(e)),this.dataLayer.setSearchAutosuggest(a)}suggest(e,t){this.searchHelper&&this.searchHelper.suggest(e,this.parseSuggestSuggestResponse.bind(this),t)}changeLanguage(e){this.searchHelper&&this.dataLayer.setLanguage(e)}addSearchInputWidget(e,t){this.dataLayer.searchInputConfig||this.dataLayer.$locationEnabled.subscribeUntilHasValue(()=>{this.dataLayer.setSearchInputConfig(t),this.searchInputWidget=new zr({containerId:e,config:t,searchTrigger:this.executeSearch.bind(this),suggestTrigger:this.executeSuggest.bind(this),dataLayer:this.dataLayer})},200)}addSearchLocationWidget(e,t){var s,a;this.dataLayer.searchLocationConfig||(t.locationSearchEnabled?(this.dataLayer.setLocationEnabled(!0),this.dataLayer.setSearchLocationConfig(t),t.locationValuesOverride?(this.searchLocationWidget=new Ss({containerId:e,config:t,dataLayer:this.dataLayer}),(s=t==null?void 0:t.locationValuesOverride)!=null&&s.locationFilterDefaultValue&&this.dataLayer.setSearchRadius((a=t==null?void 0:t.locationValuesOverride)==null?void 0:a.locationFilterDefaultValue)):this.dataLayer.$searchResultsMetadata.subscribeUntilHasValue(()=>{this.searchLocationWidget=new Ss({containerId:e,config:t,dataLayer:this.dataLayer})},0)):this.dataLayer.setLocationEnabled(!1))}addAnswerWidget(e,t){this.dataLayer.turnAIAnswerGenerationOn=!0,this.startSSE(this.dataLayer.searchObject.query),this.dataLayer.setAnswerData(""),this.answerWidget=new Qr({containerId:e,config:t,dataLayer:this.dataLayer})}addSearchResultsWidget(e,t){this.searchResultsConfig||(this.searchResultsConfig=t,this.searchResultsWidget=new _r({containerId:e,linkClickCallback:this.executeLinkClick.bind(this),searchTrigger:this.executeSearch.bind(this),config:t,dataLayer:this.dataLayer}))}addPaginationWidget(e,t){this.searchPaginationConfig=t,this.searchPaginationWidget=new Or({containerId:e,config:t,dataLayer:this.dataLayer,routerHelper:this.routerHelper})}addSearchFeedbackWidget(e,t){this.searchFeedbackConfig=t,this.searchFeedbackWidget=new Fr({containerId:e,config:t,dataLayer:this.dataLayer,searchTrigger:this.executeSearch.bind(this)})}addSearchSortingWidget(e,t){this.searchSortingConfig=t,this.searchSortingWidget=new $r({containerId:e,config:t,dataLayer:this.dataLayer})}addRelatedSearchesWidget(e,t){this.relatedSearchesConfig=t,this.relatedSearchesWidget=new Pr({containerId:e,config:t,dataLayer:this.dataLayer,trackRelatedSearchClick:this.trackRelatedSearchClick.bind(this)}),setTimeout(()=>{this.getRelatedSearches()},0)}addExternalPromotionsWidget(e,t){this.externalPromotionsConfig=t,this.externalPromotionsWidget=new Nr({containerId:e,config:t,dataLayer:this.dataLayer})}addFacetsWidget(e,t){this.searchFacetsConfig=t,this.searchFacetsWidget=new Dr({containerId:e,config:t,dataLayer:this.dataLayer,routerHelper:this.routerHelper},this.cacheFacets.bind(this))}executeSearch(e,t){const s={...this.dataLayer.searchObject};s.query=ee.removeXSSRiskyTags(e),s.page=1,s.facets=[],s.location={...s.location},this.locationObserver&&this.dataLayer.$locationDecodingLoading.unsubscribe(this.locationObserver),this.locationObserver=this.dataLayer.$locationDecodingLoading.subscribeUntil(()=>{var a,r;s.location.address=this.dataLayer.searchLocation,s.location.radius=this.dataLayer.searchRadius,s.location.lat=this.dataLayer.searchLat,s.location.lon=this.dataLayer.searchLong,this.dataLayer.forceNotCorrect=!!t;let o=(a=this.routerHelper)==null?void 0:a.searchObjectToParams(s);o&&(o=(r=this.routerHelper)==null?void 0:r.extractParamsThatDoNotStartWithRouteName(o)),o&&(s.additionalProps=Object.keys(o).map(n=>o?{key:n,value:o[n]}:{key:"",value:""})),this.dataLayer.setSearchObject(s),this.dataLayer.lastSearchValue=s.query},!1)}executeSuggest(e){var t,s;let a={term:e,queryParams:[]};(s=(t=this.dataLayer.searchInputConfig)==null?void 0:t.hooks)!=null&&s.beforeAutosuggest&&(a=this.dataLayer.searchInputConfig.hooks.beforeAutosuggest(a)),a&&a.term!==void 0&&a.queryParams!==void 0&&this.suggest(a.term,a.queryParams)}trackRelatedSearchClick(e){var t;this.dataLayer.searchResultsMetadata&&this.dataLayer.searchRelatedSearches&&!this.dataLayer.cookiesDisabled&&fe.trackRelatedSearchClick({...this.dataLayer.parsedData.trackingData,relatedSearch:e,totalRelatredSearches:((t=this.dataLayer.searchRelatedSearches)==null?void 0:t.length)??0})}executeLinkClick(e){var t,s;let a=gt.findResultByUniqueId(e,this.dataLayer.searchResults??[]);a&&((s=(t=this.searchResultsConfig)==null?void 0:t.hooks)!=null&&s.afterLinkClick&&(a=this.searchResultsConfig.hooks.afterLinkClick(a)),a&&this.dataLayer.searchResultsMetadata&&!this.dataLayer.cookiesDisabled&&fe.trackClick({result:a,...this.dataLayer.parsedData.trackingData}).then(()=>{typeof window<"u"&&(window.location.href=(a==null?void 0:a.url)??"")}).catch(()=>{typeof window<"u"&&(window.location.href=(a==null?void 0:a.url)??"")}))}setPage(e){var t;(t=this.searchPaginationWidget)==null||t.goToPage(e)}setCookiesDisabled(e){this.dataLayer.setCookiesDisabled(e)}changeResultTemplate(e){var t,s,a;this.searchResultsConfig&&(this.searchResultsConfig.templates=(t=this.searchResultsConfig)!=null&&t.templates?{...(s=this.searchResultsConfig)==null?void 0:s.templates,...e}:e,(a=this.searchResultsWidget)==null||a.changeTemplate())}}const b={searchstax:new Vr("react")};function ks(i,e,t,s,a,r,o,n){return u.jsx(u.Fragment,{children:i&&u.jsx("div",{className:"searchstax-location-input-container","data-test-id":"searchstax-location-input-container",children:u.jsxs("div",{className:"searchstax-location-input-wrapper",children:[u.jsx("span",{className:"searchstax-location-input-label",children:"NEAR"}),u.jsxs("div",{className:"searchstax-location-input-wrapper-inner",children:[u.jsx("input",{type:"text",id:"searchstax-location-input",className:"searchstax-location-input"+(n?" searchstax-input-location-error":""),placeholder:"Zip, Postal Code or City...","aria-label":"Search Location Input","data-test-id":"searchstax-location-input",value:r??"",onChange:l=>e(l.target.value),onBlur:l=>t(l.target.value)}),u.jsx("button",{onClick:a,className:"searchstax-get-current-location-button",children:"Use my current location"})]}),i.shouldShowLocationDistanceDropdown&&u.jsx("span",{className:"searchstax-location-input-label",children:"WITHIN"}),i.shouldShowLocationDistanceDropdown&&u.jsx("select",{id:"searchstax-location-radius-select",className:"searchstax-location-radius-select","aria-label":"Search Location Radius Select","data-test-id":"searchstax-location-radius-select",onChange:l=>s(l.target.value),value:o,children:i.locationSearchDistanceValues.map(({value:l,label:c})=>u.jsx("option",{value:l,children:c},l))})]})})})}function Ts(i){let e=!1;const[t,s]=j.useState(null),[a,r]=j.useState(null),[o,n]=j.useState(!1),[l,c]=j.useState(void 0),[g]=j.useState(Math.random());j.useEffect(()=>{if(m(),b.searchstax)b.searchstax.addSearchLocationWidget("search-location-container"+g,{hooks:i.hooks,locationSearchEnabled:i.locationSearchEnabled,locationValuesOverride:i.locationValuesOverride});else throw Error("Searchstax instance needs to be passed via props")},[]);function m(){e||(b.searchstax.dataLayer.$locationWidgetTemplateData.subscribe(f=>{s(f)}),b.searchstax.dataLayer.$searchObject.subscribe(f=>{r(f.location.address??""),c(f.location.radius||"")}),b.searchstax.dataLayer.$searchLocationChange.subscribe(f=>{r(f)}),b.searchstax.dataLayer.$searchRadiusChange.subscribe(f=>{c(f)}),b.searchstax.dataLayer.$locationError.subscribe(f=>{n(f)}),e=!0)}function p(){var f;(f=b.searchstax.searchLocationWidget)==null||f.getCurrentLocation()}function L(f){var x;c(f),(x=b.searchstax.searchLocationWidget)==null||x.setRadiusValue(f+"")}function w(f){var x;r(f),(x=b.searchstax.searchLocationWidget)==null||x.triggerGeocoder(f)}return u.jsx(u.Fragment,{children:u.jsxs("div",{id:"search-location-container"+g,children:[!i.searchLocationTemplate&&t&&u.jsx(u.Fragment,{children:ks(t,r,w,L,p,a,l,o)}),i.searchLocationTemplate&&u.jsx(u.Fragment,{children:i.searchLocationTemplate(t,r,w,L,p,a,l,o)})]})})}const js={appId:"APP_ID",relatedSearchesAPIKey:"KEY"},Pt={locationDecode:i=>new Promise(e=>{const t="GEOCODING_API_KEY",s=`https://maps.googleapis.com/maps/api/geocode/json?address=${encodeURIComponent(i)}&key=${t}`;fetch(s).then(a=>a.json()).then(a=>{if(a.status==="OK"&&a.results.length>0){const r=a.results[0],o={lat:r.geometry.location.lat,lon:r.geometry.location.lng,address:r.formatted_address};e(o)}else e({address:void 0,lat:void 0,lon:void 0,error:!0})}).catch(()=>{e({address:void 0,lat:void 0,lon:void 0,error:!0})})}),locationDecodeCoordinatesToAddress:(i,e)=>new Promise(t=>{fetch(`https://geocoding-staging.searchstax.co/reverse?location=${i},${e}&components=country:US&app_id=${js.appId}`,{method:"GET",headers:{Authorization:`Token ${js.relatedSearchesAPIKey}`}}).then(s=>s.json()).then(s=>{if(s.status==="OK"&&s.results.length>0){const a=s.results[0];t({address:a.formatted_address,lat:i,lon:e,error:!1})}else t({address:void 0,lat:i,lon:e,error:!0})}).catch(()=>{t({address:void 0,lat:i,lon:e,error:!0})})}),locationSearchEnabled:!1,locationValuesOverride:{locationDistanceEnabled:!0,filterValues:["any","1000"],filterUnit:"miles",locationFilterDefaultValue:"any"}};function Hr(i,e,t,s){return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"searchstax-search-input-wrapper",children:[u.jsx("input",{type:"text",id:"searchstax-search-input",className:"searchstax-search-input",placeholder:"SEARCH FOR...","aria-label":"search"}),u.jsx("div",{className:`searchstax-autosuggest-container ${i.length===0?"hidden":""}`,onMouseLeave:e,children:i.map(function(a){return u.jsx("div",{className:"searchstax-autosuggest-item",children:u.jsx("div",{className:"searchstax-autosuggest-item-term-container",tabIndex:0,dangerouslySetInnerHTML:{__html:a.term},onMouseOver:()=>{t(a)},onClick:()=>{s()}})},a.term)})})]}),u.jsx(Ts,{searchLocationTemplate:ks,hooks:{locationDecode:Pt.locationDecode,locationDecodeCoordinatesToAddress:Pt.locationDecodeCoordinatesToAddress},locationSearchEnabled:Pt.locationSearchEnabled,locationValuesOverride:Pt.locationValuesOverride}),u.jsx("button",{className:"searchstax-spinner-icon",id:"searchstax-search-input-action-button","aria-label":"search"})]})}function Ur(i){let e=!1;const[t,s]=j.useState([]),[a,r]=j.useState(null);j.useEffect(()=>{if(o(),b.searchstax){const g={};i.afterAutosuggest&&(g.afterAutosuggest=i.afterAutosuggest),i.beforeAutosuggest&&(g.beforeAutosuggest=i.beforeAutosuggest),b.searchstax.addSearchInputWidget("searchstax-input-container",{suggestAfterMinChars:i.suggestAfterMinChars,hooks:g,templates:{mainTemplate:{template:"",searchInputId:i.searchInputId??"searchstax-search-input"}}})}else throw Error("Searchstax instance needs to be passed via props");b.searchstax.dataLayer.setInputTemplateRendered(!0)},[]);function o(){e||(b.searchstax.dataLayer.$autosuggestResults.subscribe(g=>{s((g==null?void 0:g.suggestions)??[])}),b.searchstax.dataLayer.$inputWidgetTemplateData.subscribe(g=>{r(g)}),e=!0)}function n(){var g,m;(g=b.searchstax.searchInputWidget)==null||g.resetAutosuggestSelection(),(m=b.searchstax.searchInputWidget)==null||m.markActiveAutosuggestItem()}function l(g){var m;(m=b.searchstax.searchInputWidget)==null||m.onSuggestionEnter(g)}function c(){var g;(g=b.searchstax.searchInputWidget)==null||g.suggestionChosen()}return u.jsx(u.Fragment,{children:u.jsx("div",{id:"searchstax-input-container",children:u.jsxs("div",{className:`searchstax-search-input-container searchstax-search-input-container-new ${a!=null&&a.locationEnabled?"searchstax-alternative-render":""}`,children:[!i.inputTemplate&&u.jsx(u.Fragment,{children:Hr(t,n,l,c)}),i.inputTemplate&&u.jsx(u.Fragment,{children:i.inputTemplate(t,n,l,c,a)})]})})})}function Br(i){const[e,t]=j.useState(!1);return j.useEffect(()=>{const s={};i.beforeSearch&&(s.beforeSearch=i.beforeSearch),i!=null&&i.afterSearch&&(s.afterSearch=i.afterSearch),b.searchstax.initialize({language:i.language??"en",model:i.model,sessionId:i.sessionId,searchURL:i.searchURL,questionURL:i.questionURL,suggesterURL:i.suggesterURL,trackApiKey:i.trackApiKey,searchAuth:i.searchAuth,authType:i.authType??"basic",autoCorrect:i.autoCorrect,router:i.router,hooks:s,analyticsBaseUrl:i.analyticsBaseUrl,analyticsSrc:i.analyticsSrc}),setTimeout(()=>{t(!0)},100),i.initialized(b.searchstax)},[]),u.jsx(u.Fragment,{children:e&&u.jsxs(u.Fragment,{children:[" ",i.children," "]})})}function Yr(i,e,t){return u.jsxs("div",{children:[u.jsxs("div",{className:"searchstax-no-results",children:[" ","Showing ",u.jsx("strong",{children:"no results"})," for ",u.jsxs("strong",{children:['"',i,'"']}),u.jsx("br",{}),(e==null?void 0:e.spellingSuggestion)&&u.jsxs("span",{children:[" Did you mean"," ",u.jsx("a",{href:"#","aria-label":`Did you mean ${e==null?void 0:e.spellingSuggestion}`,className:"searchstax-suggestion-term",onClick:s=>{s.preventDefault(),t(e==null?void 0:e.spellingSuggestion)},children:e==null?void 0:e.spellingSuggestion}),"?"]})]}),u.jsxs("ul",{children:[u.jsxs("li",{children:[" ","Try searching for search related terms or topics. We offer a wide variety of content to help you get the information you need."," "]}),u.jsx("li",{children:"Lost? Click on the ‘X” in the Search Box to reset your search."})]})]})}function qr(i,e){return u.jsx(u.Fragment,{children:i&&i.length&&u.jsx("div",{className:"searchstax-search-results","aria-live":"polite",children:i!==null&&i.map(function(t){return u.jsx("a",{href:t.url??"",onClick:s=>{e(t,s)},onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&e(t,s)},"data-searchstax-unique-result-id":t.uniqueId,"aria-labelledby":`title-${t.uniqueId}`,className:"searchstax-result-item-link searchstax-result-item-link-wrapping",tabIndex:0,children:u.jsxs("div",{className:`searchstax-search-result ${t.thumbnail?"has-thumbnail":""}`,children:[t.promoted&&u.jsx("div",{className:"searchstax-search-result-promoted"}),t.ribbon&&u.jsx("div",{className:"searchstax-search-result-ribbon",dangerouslySetInnerHTML:{__html:t.ribbon}}),t.thumbnail&&u.jsx("img",{alt:"",src:t.thumbnail,className:"searchstax-thumbnail"}),u.jsx("div",{className:"searchstax-search-result-title-container",children:u.jsx("span",{className:"searchstax-search-result-title",id:`title-${t.uniqueId}`,dangerouslySetInnerHTML:{__html:t.title??""}})}),t.paths&&u.jsx("p",{className:"searchstax-search-result-common",dangerouslySetInnerHTML:{__html:t.paths}}),t.description&&u.jsx("p",{className:"searchstax-search-result-description searchstax-search-result-common",dangerouslySetInnerHTML:{__html:t.description}}),t.unmappedFields.map(function(s){return u.jsxs("div",{children:[s.isImage&&typeof s.value=="string"&&u.jsx("div",{className:"searchstax-search-result-image-container",children:u.jsx("img",{alt:"",src:s.value,className:"searchstax-result-image"})}),!s.isImage&&u.jsx("div",{children:u.jsx("p",{className:"searchstax-search-result-common",dangerouslySetInnerHTML:{__html:s.value}})})]},s.key)})]},t.uniqueId)},t.uniqueId)})})})}function Jr(i){const[e,t]=j.useState(null),s=j.useRef();s.current=e;const[a,r]=j.useState(""),[o,n]=j.useState(null),l=(m,p)=>{p.preventDefault(),p.stopPropagation(),b.searchstax.executeLinkClick(m.uniqueId)};j.useEffect(()=>{g();const m={};i.afterLinkClick&&(m.afterLinkClick=i.afterLinkClick),b.searchstax.addSearchResultsWidget("searchstax-results-container",{templates:{},renderMethod:i.renderMethod??"pagination",resultsPerPage:i.resultsPerPage,hooks:m})},[]);function c(m){b.searchstax.executeSearch(m)}function g(){b.searchstax.dataLayer.$searchResults.subscribe(m=>{var f;const p=s.current??[],L=m??[],w=i.renderMethod==="infiniteScroll"?[...p,...L]:m;((f=b.searchstax.dataLayer.$searchObject.value)==null?void 0:f.page)===1?t(L):t(w)}),b.searchstax.dataLayer.$searchTermChange.subscribe(m=>{r(m)}),b.searchstax.dataLayer.$searchResultsMetadata.subscribe(m=>{n(m)})}return u.jsx(u.Fragment,{children:u.jsx("div",{id:"searchstax-results-container",children:u.jsx("section",{"aria-label":"search results container",tabIndex:0,children:u.jsx("div",{className:"searchstax-search-results-container",id:"searchstax-search-results-container",children:u.jsxs("div",{id:"searchstax-result-container",children:[e&&e.length===0&&a!==""&&a!=="*"&&b.searchstax.dataLayer.parsedData.firstSearchHappened&&!i.noResultTemplate&&u.jsx(u.Fragment,{children:Yr(a,o,c)}),e&&e.length===0&&a!==""&&a!=="*"&&b.searchstax.dataLayer.parsedData.firstSearchHappened&&i.noResultTemplate&&u.jsx(u.Fragment,{children:i.noResultTemplate(a,o,c)}),e&&e.length>0&&!i.resultsTemplate&&qr(e,l),e&&e.length>0&&i.resultsTemplate&&u.jsx(u.Fragment,{children:i.resultsTemplate(e,l)})]})})})})})}function Gr(i,e,t){return u.jsx(u.Fragment,{children:i&&(i==null?void 0:i.totalResults)!==0&&u.jsx("div",{className:"searchstax-pagination-container",children:u.jsxs("div",{className:"searchstax-pagination-content",children:[u.jsxs("a",{className:`searchstax-pagination-previous ${i.isFirstPage?"disabled":""}`,tabIndex:0,style:i!=null&&i.isFirstPage?{pointerEvents:"none"}:{},onClick:s=>{t(s)},onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&t(s)},id:"searchstax-pagination-previous",children:[" ","< Previous"," "]}),u.jsxs("div",{className:"searchstax-pagination-details",children:[" ",i==null?void 0:i.startResultIndex," -"," ",i==null?void 0:i.endResultIndex," of"," ",i==null?void 0:i.totalResults]}),u.jsx("a",{className:`searchstax-pagination-next ${i.isLastPage?"disabled":""}`,tabIndex:0,style:i!=null&&i.isLastPage?{pointerEvents:"none"}:{},onClick:s=>{e(s)},onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&e(s)},id:"searchstax-pagination-next",children:"Next >"})]})})})}function Kr(i,e){return u.jsx(u.Fragment,{children:i&&i.isInfiniteScroll&&(i==null?void 0:i.totalResults)!==0&&!(i!=null&&i.isLastPage)&&u.jsx("div",{className:"searchstax-pagination-container",children:u.jsx("a",{className:"searchstax-pagination-load-more",tabIndex:0,onClick:t=>{e(t)},onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&e(t)},children:"Show More >"})})})}function Zr(i){let e=!1;const[t,s]=j.useState(!1),[a,r]=j.useState(null),[o]=j.useState(Math.random());j.useEffect(()=>{if(n(),b.searchstax)b.searchstax.addPaginationWidget("searchstax-pagination-container"+o,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function n(){e||(b.searchstax.dataLayer.$searchObject.subscribe(()=>{l()}),b.searchstax.dataLayer.$paginationData.subscribe(m=>{r(m)}),e=!0)}function l(){!t&&b.searchstax.routerHelper&&(s(!0),b.searchstax.addPaginationWidget("searchstax-pagination-container"+o,{}))}function c(m){var p;(p=b.searchstax.searchPaginationWidget)==null||p.nextPage(m)}function g(m){var p;(p=b.searchstax.searchPaginationWidget)==null||p.previousPage(m)}return u.jsx(u.Fragment,{children:u.jsxs("div",{id:"searchstax-pagination-container"+o,children:[!i.paginationTemplate&&a&&!a.isInfiniteScroll&&(a==null?void 0:a.totalResults)!==0&&u.jsx(u.Fragment,{children:Gr(a,c,g)}),i.paginationTemplate&&a&&!a.isInfiniteScroll&&u.jsx(u.Fragment,{children:i.paginationTemplate(a,c,g)}),!i.infiniteScrollTemplate&&a&&a.isInfiniteScroll&&(a==null?void 0:a.totalResults)!==0&&!(a!=null&&a.isLastPage)&&u.jsx(u.Fragment,{children:Kr(a,c)}),i.infiniteScrollTemplate&&a&&a.isInfiniteScroll&&(a==null?void 0:a.totalResults)!==0&&!(a!=null&&a.isLastPage)&&u.jsx(u.Fragment,{children:i.infiniteScrollTemplate(a,c)})]})})}function Xr(i,e,t){return u.jsx(u.Fragment,{children:i&&(i==null?void 0:i.searchExecuted)&&(i==null?void 0:i.hasResultsOrExternalPromotions)&&u.jsxs("div",{className:"searchstax-sorting-container",children:[u.jsx("label",{className:"searchstax-sorting-label",htmlFor:"searchstax-search-order-select",children:"Sort By"}),u.jsx("select",{id:"searchstax-search-order-select",className:"searchstax-search-order-select",value:t,onChange:s=>{e(s.target.value)},children:i.sortOptions.map(function(s){return u.jsx("option",{value:s.key,children:s.value},s.key)})})]})})}function en(i){let e=!1;const[t,s]=j.useState(null),[a,r]=j.useState(""),[o]=j.useState(Math.random());j.useEffect(()=>{if(n(),b.searchstax)b.searchstax.addSearchSortingWidget("search-sorting-container"+o,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function n(){e||(b.searchstax.dataLayer.$searchSortingData.subscribe(c=>{s(c)}),b.searchstax.dataLayer.$searchObject.subscribe(c=>{r(decodeURIComponent((c==null?void 0:c.order)??""))}),e=!0)}function l(c){var g;(g=b.searchstax.searchSortingWidget)==null||g.setOrderQuery(c)}return u.jsx(u.Fragment,{children:u.jsxs("div",{id:"search-sorting-container"+o,children:[!i.searchSortingTemplate&&t&&(t==null?void 0:t.searchExecuted)&&(t==null?void 0:t.hasResultsOrExternalPromotions)&&u.jsx(u.Fragment,{children:Xr(t,l,a)}),i.searchSortingTemplate&&u.jsx(u.Fragment,{children:i.searchSortingTemplate(t,l,a)})]})})}function tn(i,e){return u.jsx(u.Fragment,{children:i&&(i==null?void 0:i.searchExecuted)&&(i==null?void 0:i.totalResults)>0&&u.jsxs(u.Fragment,{children:["Showing"," ",u.jsxs("b",{children:[i.startResultIndex," -"," ",i.endResultIndex]})," ","of",u.jsxs("b",{children:[" ",i.totalResults]})," results",i.searchTerm&&u.jsxs("span",{children:[' for "',u.jsx("b",{children:i.searchTerm}),'"'," "]}),u.jsx("div",{className:"searchstax-feedback-container-suggested",children:i.autoCorrectedQuery&&u.jsxs("div",{children:[" ","Search instead for"," ",u.jsx("a",{href:"#",onClick:t=>{e(t)},className:"searchstax-feedback-original-query","aria-label":`Search instead for ${i.originalQuery}`,children:i.originalQuery})]})})]})})}function an(i){let e=!1;const[t,s]=j.useState(null),[a]=j.useState(Math.random());j.useEffect(()=>{if(r(),b.searchstax)b.searchstax.addSearchFeedbackWidget("search-feedback-container"+a,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function r(){e||(b.searchstax.dataLayer.$searchFeedbackData.subscribe(n=>{s(n)}),e=!0)}function o(n){var l;(l=b.searchstax.searchFeedbackWidget)==null||l.onOriginalQueryClick(n)}return u.jsx(u.Fragment,{children:u.jsxs("div",{className:"search-feedback-container",id:"search-feedback-container"+a,children:[!i.searchOverviewTemplate&&t&&(t==null?void 0:t.searchExecuted)&&(t==null?void 0:t.totalResults)>0&&u.jsx(u.Fragment,{children:tn(t,o)}),i.searchOverviewTemplate&&u.jsx(u.Fragment,{children:i.searchOverviewTemplate(t,o)})]})})}function sn(i,e,t,s,a,r,o){return u.jsx("div",{className:"searchstax-facets-container-desktop",children:i==null?void 0:i.facets.map(n=>u.jsx("div",{className:`searchstax-facet-container ${t(n.name)?"active":""}`,children:u.jsxs("div",{children:[u.jsxs("div",{className:"searchstax-facet-title-container",onClick:()=>{s(n.name)},children:[u.jsxs("div",{className:"searchstax-facet-title",children:[" ",n.label]}),u.jsx("div",{className:"searchstax-facet-title-arrow active"})]}),u.jsxs("div",{className:"searchstax-facet-values-container","aria-live":"polite",children:[n.values.map((l,c)=>(e[c+n.name]=j.createRef(),u.jsxs("div",{className:`searchstax-facet-value-container ${l.disabled?"searchstax-facet-value-disabled":""}`,ref:e[c+n.name],children:[u.jsx("div",{className:"searchstax-facet-input desktop-"+c+n.name,children:u.jsx("input",{type:"checkbox",className:"searchstax-facet-input-checkbox",checked:r(l),readOnly:!0,"aria-label":l.value+" "+l.count,disabled:l.disabled,onClick:g=>{a(c+n.name,g,l,!0)}})}),u.jsx("div",{className:"searchstax-facet-value-label",onClick:g=>{a(c+n.name,g,l,!1)},children:l.value}),u.jsxs("div",{className:"searchstax-facet-value-count",onClick:g=>{a(c+n.name,g,l,!1)},children:["(",l.count,")"]})]},l.value+l.parentName))),n.hasMoreFacets&&u.jsx("div",{className:"searchstax-facet-show-more-container",children:u.jsxs("div",{className:"searchstax-facet-show-more-container",onClick:l=>{o(l,n)},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&o(l,n)},tabIndex:0,children:[n.showingAllFacets&&u.jsx("div",{className:"searchstax-facet-show-less-button searchstax-facet-show-button",children:"less"}),!n.showingAllFacets&&u.jsx("div",{className:"searchstax-facet-show-more-button searchstax-facet-show-button",children:"more"})]})})]})]})},n.name+"desktop"))})}function rn(i,e,t,s,a,r,o,n,l,c,g,m){return i?u.jsx("div",{className:"searchstax-facets-container-mobile",children:u.jsxs("div",{className:"searchstax-facets-pills-container",children:[u.jsx("div",{className:"searchstax-facets-pill searchstax-facets-pill-filter-by",onClick:()=>{c()},children:u.jsx("div",{className:"searchstax-facets-pill-label",children:"Filter By"})}),u.jsxs("div",{className:"searchstax-facets-pills-selected",children:[e.map(p=>u.jsxs("div",{className:"searchstax-facets-pill searchstax-facets-pill-facets",onClick:()=>{n(p)},children:[u.jsxs("div",{className:"searchstax-facets-pill-label",children:[p.value," (",p.count,")"]}),u.jsx("div",{className:"searchstax-facets-pill-icon-close"})]},p.value)),e.length!==0&&u.jsx("div",{className:"searchstax-facets-pill searchstax-clear-filters searchstax-facets-pill-clear-all",onClick:()=>{m()},children:u.jsx("div",{className:"searchstax-facets-pill-label",children:"Clear Filters"})})]}),u.jsxs("div",{className:`searchstax-facets-mobile-overlay ${i.overlayOpened?"searchstax-show":""}`,children:[u.jsxs("div",{className:"searchstax-facets-mobile-overlay-header",children:[u.jsx("div",{className:"searchstax-facets-mobile-overlay-header-title",children:"Filter By"}),u.jsx("div",{className:"searchstax-search-close",onClick:()=>{g()}})]}),u.jsx("div",{className:"searchstax-facets-container-mobile",children:i==null?void 0:i.facets.map(p=>u.jsx("div",{className:`searchstax-facet-container ${s(p.name)?"active":""}`,children:u.jsxs("div",{children:[u.jsxs("div",{className:"searchstax-facet-title-container",onClick:()=>{a(p.name)},children:[u.jsxs("div",{className:"searchstax-facet-title",children:[" ",p.label," "]}),u.jsx("div",{className:"searchstax-facet-title-arrow active"})]}),u.jsxs("div",{className:"searchstax-facet-values-container","aria-live":"polite",children:[p.values.map((L,w)=>(t[w+p.name]=j.createRef(),u.jsxs("div",{className:`searchstax-facet-value-container ${L.disabled?"searchstax-facet-value-disabled":""}`,ref:t[w+p.name],children:[u.jsx("div",{className:"searchstax-facet-input mobile-"+w+p.name,children:u.jsx("input",{type:"checkbox",className:"searchstax-facet-input-checkbox",checked:o(L),readOnly:!0,"aria-label":L.value+" "+L.count,disabled:L.disabled,onClick:f=>{r(w+p.name,f,L,!0,!0)}})}),u.jsx("div",{className:"searchstax-facet-value-label",onClick:f=>{r(w+p.name,f,L,!1)},children:L.value}),u.jsxs("div",{className:"searchstax-facet-value-count",onClick:f=>{r(w+p.name,f,L,!1)},children:["(",L.count,")"]})]},L.value+L.parentName))),u.jsx("div",{className:"searchstax-facet-show-more-container","v-if":"facet.hasMoreFacets",children:u.jsxs("div",{className:"searchstax-facet-show-more-container",onClick:L=>{l(L,p)},onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&l(L,p)},tabIndex:0,children:[p.showingAllFacets&&u.jsx("div",{className:"searchstax-facet-show-less-button searchstax-facet-show-button",children:"less"}),!p.showingAllFacets&&u.jsx("div",{className:"searchstax-facet-show-more-button searchstax-facet-show-button",children:"more"})]})})]})]})},p.name+"mobile"))}),u.jsx("button",{className:"searchstax-facets-mobile-overlay-done",onClick:()=>{g()},children:"Done"})]})]})}):u.jsx(u.Fragment,{})}function nn(i){const[e,t]=j.useState(null),[s,a]=j.useState(null),[r,o]=j.useState([]),[n,l]=j.useState({}),c={},g=Math.random();let m=!1;j.useEffect(()=>{if(p(),b.searchstax)b.searchstax.addFacetsWidget("searchstax-facets-container"+g,{facetingType:i.facetingType,specificFacets:i.specificFacets,itemsPerPageDesktop:i.itemsPerPageDesktop,itemsPerPageMobile:i.itemsPerPageMobile});else throw Error("Searchstax instance needs to be passed via props")},[]);function p(){m||(b.searchstax.dataLayer.$facetsTemplateData.subscribe(T=>{T!=null&&T.isMobile?a(T):t(T)}),b.searchstax.dataLayer.$selectedFacetsTemplateData.subscribe(T=>{o((T??[]).filter(Z=>Z.type==="checkbox"))}),m=!0)}function L(T){var _;(_=b.searchstax.searchFacetsWidget)==null||_.unselectFacet(T)}function w(){var T;(T=b.searchstax.searchFacetsWidget)==null||T.removeSelectedFacets()}function f(T){return!n[T]}function x(T){f(T)?l({...n,[T]:!0}):l({...n,[T]:!1})}function k(T){var _;return(_=b.searchstax.searchFacetsWidget)==null?void 0:_.isChecked(T)}function I(T,_,Z,xe,Q){var ve;const he=Q?"mobile-":"desktop-",Ne=document.getElementsByClassName(he+T);Ne[0]&&((ve=b.searchstax.searchFacetsWidget)==null||ve.onFacetSelect(_,Z,Ne[0],!1,k(Z)))}function F(T,_){var Z;(Z=b.searchstax.searchFacetsWidget)==null||Z.onShowMoreLessClick(T,_,!1)}function A(T,_){var Z;(Z=b.searchstax.searchFacetsWidget)==null||Z.onShowMoreLessClick(T,_,!0)}function D(){var T;(T=b.searchstax.searchFacetsWidget)==null||T.openOverlay()}function q(){var T;(T=b.searchstax.searchFacetsWidget)==null||T.closeOverlay()}return u.jsx(u.Fragment,{children:u.jsxs("div",{id:"searchstax-facets-container"+g,children:[(e==null?void 0:e.hasResultsOrExternalPromotions)&&!i.facetsTemplateDesktop&&u.jsx(u.Fragment,{children:sn(e,c,f,x,I,k,F)}),i.facetsTemplateDesktop&&u.jsx(u.Fragment,{children:i.facetsTemplateDesktop(e,c,f,x,I,k,F)}),(s==null?void 0:s.hasResultsOrExternalPromotions)&&!i.facetsTemplateMobile&&u.jsx(u.Fragment,{children:rn(s,r,c,f,x,I,k,L,A,D,q,w)}),i.facetsTemplateMobile&&u.jsx(u.Fragment,{children:i.facetsTemplateMobile(s,r,c,f,x,I,k,L,A,D,q,w)})]})})}function on(i,e){return u.jsx(u.Fragment,{children:i&&(i==null?void 0:i.searchExecuted)&&(i==null?void 0:i.hasRelatedSearches)&&u.jsxs("div",{className:"searchstax-related-searches-container",id:"searchstax-related-searches-container",children:[" ","Related searches: ",u.jsx("span",{id:"searchstax-related-searches"}),i.relatedSearches&&u.jsx("span",{className:"searchstax-related-search",children:i.relatedSearches.map(t=>u.jsxs("span",{onClick:()=>{e(t)},onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&e(t)},tabIndex:0,className:"searchstax-related-search searchstax-related-search-item","aria-label":"Related search: "+t.related_search,children:[" ",t.related_search,!t.last&&u.jsx("span",{children:","})]},t.related_search))})]})})}function ln(i){let e=!1;const[t,s]=j.useState(null),[a]=j.useState(Math.random());j.useEffect(()=>{if(r(),b.searchstax)b.searchstax.addRelatedSearchesWidget("searchstax-related-searches-container"+a,{relatedSearchesURL:i.relatedSearchesURL,relatedSearchesAPIKey:i.relatedSearchesAPIKey});else throw Error("Searchstax instance needs to be passed via props")},[]);function r(){e||(b.searchstax.dataLayer.$searchRelatedSearchesData.subscribe(n=>{s(n)}),e=!0)}function o(n){var l;(l=b.searchstax.relatedSearchesWidget)==null||l.executeSearch(n)}return u.jsxs(u.Fragment,{children:[!i.searchRelatedSearchesTemplate&&t&&(t==null?void 0:t.searchExecuted)&&(t==null?void 0:t.hasRelatedSearches)&&u.jsx(u.Fragment,{children:on(t,o)}),i.searchRelatedSearchesTemplate&&u.jsx(u.Fragment,{children:i.searchRelatedSearchesTemplate(t,o)})]})}function cn(i,e){return u.jsx(u.Fragment,{children:i&&(i==null?void 0:i.searchExecuted)&&(i==null?void 0:i.hasExternalPromotions)&&i.externalPromotions.map(t=>u.jsxs("div",{className:"searchstax-external-promotion searchstax-search-result",children:[u.jsx("div",{className:"icon-elevated"}),t.url&&u.jsx("a",{href:t.url,onClick:s=>{e(t,s)},className:"searchstax-result-item-link"}),u.jsx("div",{className:"searchstax-search-result-title-container",children:u.jsx("span",{className:"searchstax-search-result-title",children:t.name})}),t.description&&u.jsxs("p",{className:"searchstax-search-result-description searchstax-search-result-common",children:[" ",t.description," "]}),t.url&&u.jsxs("p",{className:"searchstax-search-result-description searchstax-search-result-common",children:[" ",t.url," "]})]},t.id))})}function hn(i){let e=!1;const[t,s]=j.useState(null),[a]=j.useState(Math.random());j.useEffect(()=>{if(r(),b.searchstax)b.searchstax.addExternalPromotionsWidget("searchstax-external-promotions-layout-container"+a,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function r(){e||(b.searchstax.dataLayer.$searchExternalPromotionsData.subscribe(n=>{s(n)}),e=!0)}function o(n,l){var c;(c=b.searchstax.externalPromotionsWidget)==null||c.trackClick(n,l)}return u.jsx(u.Fragment,{children:u.jsxs("div",{id:"searchstax-external-promotions-layout-container"+a,children:[!i.searchExternalPromotionsTemplate&&t&&(t==null?void 0:t.searchExecuted)&&(t==null?void 0:t.hasExternalPromotions)&&u.jsx(u.Fragment,{children:cn(t,o)}),i.searchExternalPromotionsTemplate&&u.jsx(u.Fragment,{children:i.searchExternalPromotionsTemplate(t,o)})]})})}function un(i,e){return u.jsx(u.Fragment,{children:i&&u.jsxs("div",{className:"searchstax-answer-wrap",children:[u.jsx("div",{className:"searchstax-answer-icon"}),u.jsxs("div",{children:[u.jsxs("div",{className:"searchstax-answer-container "+(i.showMoreButtonVisible===!0?"searchstax-answer-show-more":""),children:[u.jsx("div",{className:"searchstax-answer-title",children:"Smart Answers"}),i.shouldShowAnswerError&&u.jsx("div",{className:"searchstax-answer-error",dangerouslySetInnerHTML:{__html:i.answerErrorMessage}}),u.jsx("div",{className:"searchstax-answer-description",dangerouslySetInnerHTML:{__html:i.fullAnswerFormatted}}),i.answerLoading&&u.jsx("div",{className:"searchstax-answer-loading"})]}),i.showMoreButtonVisible===!0&&u.jsx("div",{className:"searchstax-answer-load-more-button-container",children:u.jsx("button",{className:"searchstax-answer-load-more-button",onClick:t=>{e(t)},children:"Read more"})})]}),u.jsxs("div",{className:"searchstax-answer-footer",children:[u.jsx("div",{id:"feedbackWidgetContainer"}),u.jsx("div",{className:"searchstax-lightweight-widget-separator-inline"}),u.jsx("p",{className:"searchstax-disclaimer",children:"Generative AI is Experimental"})]})]})})}function dn(i){let e=!1;const[t,s]=j.useState(null),[a]=j.useState(Math.random());j.useEffect(()=>{if(o(),b.searchstax){const n=i.feedbackwidget??void 0;b.searchstax.addAnswerWidget("searchstax-answer-container"+a,{showMoreAfterWordCount:i.showMoreAfterWordCount,feedbackwidget:n})}else throw Error("Searchstax instance needs to be passed via props")},[]);function r(n){var l;b.searchstax&&((l=b.searchstax.answerWidget)==null||l.showMore(n))}function o(){e||(b.searchstax.dataLayer.$answerData.subscribe(n=>{s(n)}),e=!0)}return u.jsx(u.Fragment,{children:u.jsxs("div",{id:"search-answer-container"+a,children:[!i.searchAnswerTemplate&&t&&t.shouldShowAnswer&&(t==null?void 0:t.searchExecuted)&&u.jsx(u.Fragment,{children:un(t,r)}),i.searchAnswerTemplate&&t&&t.shouldShowAnswer&&u.jsx(u.Fragment,{children:i.searchAnswerTemplate(t,r)})]})})}ue.SearchstaxAnswerWidget=dn,ue.SearchstaxExternalPromotionsWidget=hn,ue.SearchstaxFacetsWidget=nn,ue.SearchstaxInputWidget=Ur,ue.SearchstaxLocationWidget=Ts,ue.SearchstaxOverviewWidget=an,ue.SearchstaxPaginationWidget=Zr,ue.SearchstaxRelatedSearchesWidget=ln,ue.SearchstaxResultWidget=Jr,ue.SearchstaxSortingWidget=en,ue.SearchstaxWrapper=Br,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})})(this["@searchstaxInc/searchstudioUxReact"]=this["@searchstaxInc/searchstudioUxReact"]||{},React);
|