@searchstax-inc/searchstudio-ux-react 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react");var Ze={exports:{}},ke={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react");var Xe={exports:{}},je={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
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 Mt;function ma(){if(Mt)return ke;Mt=1;var i=I,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r={key:!0,ref:!0,__self:!0,__source:!0};function n(c,l,d){var f,g={},p=null,w=null;d!==void 0&&(p=""+d),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(w=l.ref);for(f in l)s.call(l,f)&&!r.hasOwnProperty(f)&&(g[f]=l[f]);if(c&&c.defaultProps)for(f in l=c.defaultProps,l)g[f]===void 0&&(g[f]=l[f]);return{$$typeof:e,type:c,key:p,ref:w,props:g,_owner:a.current}}return ke.Fragment=t,ke.jsx=n,ke.jsxs=n,ke}var Te={};/**
9
+ */var Dt;function pa(){if(Dt)return je;Dt=1;var i=I,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r={key:!0,ref:!0,__self:!0,__source:!0};function n(c,l,d){var L,g={},m=null,S=null;d!==void 0&&(m=""+d),l.key!==void 0&&(m=""+l.key),l.ref!==void 0&&(S=l.ref);for(L in l)s.call(l,L)&&!r.hasOwnProperty(L)&&(g[L]=l[L]);if(c&&c.defaultProps)for(L in l=c.defaultProps,l)g[L]===void 0&&(g[L]=l[L]);return{$$typeof:e,type:c,key:m,ref:S,props:g,_owner:a.current}}return je.Fragment=t,je.jsx=n,je.jsxs=n,je}var be={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,32 +14,32 @@
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 At;function fa(){return At||(At=1,process.env.NODE_ENV!=="production"&&function(){var i=I,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),n=Symbol.for("react.provider"),c=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),E=Symbol.iterator,x="@@iterator";function S(o){if(o===null||typeof o!="object")return null;var m=E&&o[E]||o[x];return typeof m=="function"?m:null}var R=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(o){{for(var m=arguments.length,y=new Array(m>1?m-1:0),T=1;T<m;T++)y[T-1]=arguments[T];N("error",o,y)}}function N(o,m,y){{var T=R.ReactDebugCurrentFrame,O=T.getStackAddendum();O!==""&&(m+="%s",y=y.concat([O]));var D=y.map(function(M){return String(M)});D.unshift("Warning: "+m),Function.prototype.apply.call(console[o],console,D)}}var _=!1,q=!1,J=!1,v=!1,b=!1,F;F=Symbol.for("react.module.reference");function B(o){return!!(typeof o=="string"||typeof o=="function"||o===s||o===r||b||o===a||o===d||o===f||v||o===w||_||q||J||typeof o=="object"&&o!==null&&(o.$$typeof===p||o.$$typeof===g||o.$$typeof===n||o.$$typeof===c||o.$$typeof===l||o.$$typeof===F||o.getModuleId!==void 0))}function ee(o,m,y){var T=o.displayName;if(T)return T;var O=m.displayName||m.name||"";return O!==""?y+"("+O+")":y}function se(o){return o.displayName||"Context"}function X(o){if(o==null)return null;if(typeof o.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case s:return"Fragment";case t:return"Portal";case r:return"Profiler";case a:return"StrictMode";case d:return"Suspense";case f:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case c:var m=o;return se(m)+".Consumer";case n:var y=o;return se(y._context)+".Provider";case l:return ee(o,o.render,"ForwardRef");case g:var T=o.displayName||null;return T!==null?T:X(o.type)||"Memo";case p:{var O=o,D=O._payload,M=O._init;try{return X(M(D))}catch{return null}}}return null}var re=Object.assign,Ce=0,ht,ut,dt,gt,pt,mt,ft;function vt(){}vt.__reactDisabledLog=!0;function Ht(){{if(Ce===0){ht=console.log,ut=console.info,dt=console.warn,gt=console.error,pt=console.group,mt=console.groupCollapsed,ft=console.groupEnd;var o={configurable:!0,enumerable:!0,value:vt,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}Ce++}}function Bt(){{if(Ce--,Ce===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:re({},o,{value:ht}),info:re({},o,{value:ut}),warn:re({},o,{value:dt}),error:re({},o,{value:gt}),group:re({},o,{value:pt}),groupCollapsed:re({},o,{value:mt}),groupEnd:re({},o,{value:ft})})}Ce<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var _e=R.ReactCurrentDispatcher,He;function Fe(o,m,y){{if(He===void 0)try{throw Error()}catch(O){var T=O.stack.trim().match(/\n( *(at )?)/);He=T&&T[1]||""}return`
18
- `+He+o}}var Be=!1,Oe;{var Vt=typeof WeakMap=="function"?WeakMap:Map;Oe=new Vt}function yt(o,m){if(!o||Be)return"";{var y=Oe.get(o);if(y!==void 0)return y}var T;Be=!0;var O=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var D;D=_e.current,_e.current=null,Ht();try{if(m){var M=function(){throw Error()};if(Object.defineProperty(M.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(M,[])}catch(Y){T=Y}Reflect.construct(o,[],M)}else{try{M.call()}catch(Y){T=Y}o.call(M.prototype)}}else{try{throw Error()}catch(Y){T=Y}o()}}catch(Y){if(Y&&T&&typeof Y.stack=="string"){for(var j=Y.stack.split(`
19
- `),K=T.stack.split(`
20
- `),H=j.length-1,V=K.length-1;H>=1&&V>=0&&j[H]!==K[V];)V--;for(;H>=1&&V>=0;H--,V--)if(j[H]!==K[V]){if(H!==1||V!==1)do if(H--,V--,V<0||j[H]!==K[V]){var Z=`
21
- `+j[H].replace(" at new "," at ");return o.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",o.displayName)),typeof o=="function"&&Oe.set(o,Z),Z}while(H>=1&&V>=0);break}}}finally{Be=!1,_e.current=D,Bt(),Error.prepareStackTrace=O}var ge=o?o.displayName||o.name:"",he=ge?Fe(ge):"";return typeof o=="function"&&Oe.set(o,he),he}function Ut(o,m,y){return yt(o,!1)}function Qt(o){var m=o.prototype;return!!(m&&m.isReactComponent)}function De(o,m,y){if(o==null)return"";if(typeof o=="function")return yt(o,Qt(o));if(typeof o=="string")return Fe(o);switch(o){case d:return Fe("Suspense");case f:return Fe("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case l:return Ut(o.render);case g:return De(o.type,m,y);case p:{var T=o,O=T._payload,D=T._init;try{return De(D(O),m,y)}catch{}}}return""}var we=Object.prototype.hasOwnProperty,xt={},bt=R.ReactDebugCurrentFrame;function $e(o){if(o){var m=o._owner,y=De(o.type,o._source,m?m.type:null);bt.setExtraStackFrame(y)}else bt.setExtraStackFrame(null)}function Kt(o,m,y,T,O){{var D=Function.call.bind(we);for(var M in o)if(D(o,M)){var j=void 0;try{if(typeof o[M]!="function"){var K=Error((T||"React class")+": "+y+" type `"+M+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[M]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw K.name="Invariant Violation",K}j=o[M](m,M,T,y,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(H){j=H}j&&!(j instanceof Error)&&($e(O),k("%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).",T||"React class",y,M,typeof j),$e(null)),j instanceof Error&&!(j.message in xt)&&(xt[j.message]=!0,$e(O),k("Failed %s type: %s",y,j.message),$e(null))}}}var zt=Array.isArray;function Ve(o){return zt(o)}function Jt(o){{var m=typeof Symbol=="function"&&Symbol.toStringTag,y=m&&o[Symbol.toStringTag]||o.constructor.name||"Object";return y}}function Yt(o){try{return St(o),!1}catch{return!0}}function St(o){return""+o}function Ct(o){if(Yt(o))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Jt(o)),St(o)}var Le=R.ReactCurrentOwner,Gt={key:!0,ref:!0,__self:!0,__source:!0},wt,Lt,Ue;Ue={};function Xt(o){if(we.call(o,"ref")){var m=Object.getOwnPropertyDescriptor(o,"ref").get;if(m&&m.isReactWarning)return!1}return o.ref!==void 0}function Zt(o){if(we.call(o,"key")){var m=Object.getOwnPropertyDescriptor(o,"key").get;if(m&&m.isReactWarning)return!1}return o.key!==void 0}function ea(o,m){if(typeof o.ref=="string"&&Le.current&&m&&Le.current.stateNode!==m){var y=X(Le.current.type);Ue[y]||(k('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',X(Le.current.type),o.ref),Ue[y]=!0)}}function ta(o,m){{var y=function(){wt||(wt=!0,k("%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)",m))};y.isReactWarning=!0,Object.defineProperty(o,"key",{get:y,configurable:!0})}}function aa(o,m){{var y=function(){Lt||(Lt=!0,k("%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)",m))};y.isReactWarning=!0,Object.defineProperty(o,"ref",{get:y,configurable:!0})}}var sa=function(o,m,y,T,O,D,M){var j={$$typeof:e,type:o,key:m,ref:y,props:M,_owner:D};return j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(j,"_self",{configurable:!1,enumerable:!1,writable:!1,value:T}),Object.defineProperty(j,"_source",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j};function ra(o,m,y,T,O){{var D,M={},j=null,K=null;y!==void 0&&(Ct(y),j=""+y),Zt(m)&&(Ct(m.key),j=""+m.key),Xt(m)&&(K=m.ref,ea(m,O));for(D in m)we.call(m,D)&&!Gt.hasOwnProperty(D)&&(M[D]=m[D]);if(o&&o.defaultProps){var H=o.defaultProps;for(D in H)M[D]===void 0&&(M[D]=H[D])}if(j||K){var V=typeof o=="function"?o.displayName||o.name||"Unknown":o;j&&ta(M,V),K&&aa(M,V)}return sa(o,j,K,O,T,Le.current,M)}}var Qe=R.ReactCurrentOwner,kt=R.ReactDebugCurrentFrame;function de(o){if(o){var m=o._owner,y=De(o.type,o._source,m?m.type:null);kt.setExtraStackFrame(y)}else kt.setExtraStackFrame(null)}var Ke;Ke=!1;function ze(o){return typeof o=="object"&&o!==null&&o.$$typeof===e}function Tt(){{if(Qe.current){var o=X(Qe.current.type);if(o)return`
17
+ */var Nt;function La(){return Nt||(Nt=1,process.env.NODE_ENV!=="production"&&function(){var i=I,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),n=Symbol.for("react.provider"),c=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),k=Symbol.iterator,y="@@iterator";function w(o){if(o===null||typeof o!="object")return null;var p=k&&o[k]||o[y];return typeof p=="function"?p:null}var T=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function j(o){{for(var p=arguments.length,M=new Array(p>1?p-1:0),b=1;b<p;b++)M[b-1]=arguments[b];z("error",o,M)}}function z(o,p,M){{var b=T.ReactDebugCurrentFrame,P=b.getStackAddendum();P!==""&&(p+="%s",M=M.concat([P]));var O=M.map(function(D){return String(D)});O.unshift("Warning: "+p),Function.prototype.apply.call(console[o],console,O)}}var Y=!1,Q=!1,_=!1,f=!1,v=!1,R;R=Symbol.for("react.module.reference");function J(o){return!!(typeof o=="string"||typeof o=="function"||o===s||o===r||v||o===a||o===d||o===L||f||o===S||Y||Q||_||typeof o=="object"&&o!==null&&(o.$$typeof===m||o.$$typeof===g||o.$$typeof===n||o.$$typeof===c||o.$$typeof===l||o.$$typeof===R||o.getModuleId!==void 0))}function ee(o,p,M){var b=o.displayName;if(b)return b;var P=p.displayName||p.name||"";return P!==""?M+"("+P+")":M}function se(o){return o.displayName||"Context"}function Z(o){if(o==null)return null;if(typeof o.tag=="number"&&j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case s:return"Fragment";case t:return"Portal";case r:return"Profiler";case a:return"StrictMode";case d:return"Suspense";case L:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case c:var p=o;return se(p)+".Consumer";case n:var M=o;return se(M._context)+".Provider";case l:return ee(o,o.render,"ForwardRef");case g:var b=o.displayName||null;return b!==null?b:Z(o.type)||"Memo";case m:{var P=o,O=P._payload,D=P._init;try{return Z(D(O))}catch{return null}}}return null}var re=Object.assign,Ce=0,ht,ut,dt,gt,mt,pt,Lt;function ft(){}ft.__reactDisabledLog=!0;function $t(){{if(Ce===0){ht=console.log,ut=console.info,dt=console.warn,gt=console.error,mt=console.group,pt=console.groupCollapsed,Lt=console.groupEnd;var o={configurable:!0,enumerable:!0,value:ft,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}Ce++}}function Jt(){{if(Ce--,Ce===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:re({},o,{value:ht}),info:re({},o,{value:ut}),warn:re({},o,{value:dt}),error:re({},o,{value:gt}),group:re({},o,{value:mt}),groupCollapsed:re({},o,{value:pt}),groupEnd:re({},o,{value:Lt})})}Ce<0&&j("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ye=T.ReactCurrentDispatcher,$e;function Re(o,p,M){{if($e===void 0)try{throw Error()}catch(P){var b=P.stack.trim().match(/\n( *(at )?)/);$e=b&&b[1]||""}return`
18
+ `+$e+o}}var Je=!1,Pe;{var Bt=typeof WeakMap=="function"?WeakMap:Map;Pe=new Bt}function Mt(o,p){if(!o||Je)return"";{var M=Pe.get(o);if(M!==void 0)return M}var b;Je=!0;var P=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var O;O=Ye.current,Ye.current=null,$t();try{if(p){var D=function(){throw Error()};if(Object.defineProperty(D.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(D,[])}catch(G){b=G}Reflect.construct(o,[],D)}else{try{D.call()}catch(G){b=G}o.call(D.prototype)}}else{try{throw Error()}catch(G){b=G}o()}}catch(G){if(G&&b&&typeof G.stack=="string"){for(var E=G.stack.split(`
19
+ `),V=b.stack.split(`
20
+ `),$=E.length-1,B=V.length-1;$>=1&&B>=0&&E[$]!==V[B];)B--;for(;$>=1&&B>=0;$--,B--)if(E[$]!==V[B]){if($!==1||B!==1)do if($--,B--,B<0||E[$]!==V[B]){var X=`
21
+ `+E[$].replace(" at new "," at ");return o.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",o.displayName)),typeof o=="function"&&Pe.set(o,X),X}while($>=1&&B>=0);break}}}finally{Je=!1,Ye.current=O,Jt(),Error.prepareStackTrace=P}var ge=o?o.displayName||o.name:"",he=ge?Re(ge):"";return typeof o=="function"&&Pe.set(o,he),he}function Ht(o,p,M){return Mt(o,!1)}function qt(o){var p=o.prototype;return!!(p&&p.isReactComponent)}function Oe(o,p,M){if(o==null)return"";if(typeof o=="function")return Mt(o,qt(o));if(typeof o=="string")return Re(o);switch(o){case d:return Re("Suspense");case L:return Re("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case l:return Ht(o.render);case g:return Oe(o.type,p,M);case m:{var b=o,P=b._payload,O=b._init;try{return Oe(O(P),p,M)}catch{}}}return""}var xe=Object.prototype.hasOwnProperty,yt={},vt=T.ReactDebugCurrentFrame;function Fe(o){if(o){var p=o._owner,M=Oe(o.type,o._source,p?p.type:null);vt.setExtraStackFrame(M)}else vt.setExtraStackFrame(null)}function Vt(o,p,M,b,P){{var O=Function.call.bind(xe);for(var D in o)if(O(o,D)){var E=void 0;try{if(typeof o[D]!="function"){var V=Error((b||"React class")+": "+M+" type `"+D+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[D]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw V.name="Invariant Violation",V}E=o[D](p,D,b,M,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch($){E=$}E&&!(E instanceof Error)&&(Fe(P),j("%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).",b||"React class",M,D,typeof E),Fe(null)),E instanceof Error&&!(E.message in yt)&&(yt[E.message]=!0,Fe(P),j("Failed %s type: %s",M,E.message),Fe(null))}}}var Ut=Array.isArray;function Be(o){return Ut(o)}function _t(o){{var p=typeof Symbol=="function"&&Symbol.toStringTag,M=p&&o[Symbol.toStringTag]||o.constructor.name||"Object";return M}}function Gt(o){try{return wt(o),!1}catch{return!0}}function wt(o){return""+o}function Ct(o){if(Gt(o))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",_t(o)),wt(o)}var Se=T.ReactCurrentOwner,Kt={key:!0,ref:!0,__self:!0,__source:!0},xt,St,He;He={};function Zt(o){if(xe.call(o,"ref")){var p=Object.getOwnPropertyDescriptor(o,"ref").get;if(p&&p.isReactWarning)return!1}return o.ref!==void 0}function Xt(o){if(xe.call(o,"key")){var p=Object.getOwnPropertyDescriptor(o,"key").get;if(p&&p.isReactWarning)return!1}return o.key!==void 0}function ea(o,p){if(typeof o.ref=="string"&&Se.current&&p&&Se.current.stateNode!==p){var M=Z(Se.current.type);He[M]||(j('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',Z(Se.current.type),o.ref),He[M]=!0)}}function ta(o,p){{var M=function(){xt||(xt=!0,j("%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)",p))};M.isReactWarning=!0,Object.defineProperty(o,"key",{get:M,configurable:!0})}}function aa(o,p){{var M=function(){St||(St=!0,j("%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)",p))};M.isReactWarning=!0,Object.defineProperty(o,"ref",{get:M,configurable:!0})}}var sa=function(o,p,M,b,P,O,D){var E={$$typeof:e,type:o,key:p,ref:M,props:D,_owner:O};return E._store={},Object.defineProperty(E._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(E,"_self",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.defineProperty(E,"_source",{configurable:!1,enumerable:!1,writable:!1,value:P}),Object.freeze&&(Object.freeze(E.props),Object.freeze(E)),E};function ra(o,p,M,b,P){{var O,D={},E=null,V=null;M!==void 0&&(Ct(M),E=""+M),Xt(p)&&(Ct(p.key),E=""+p.key),Zt(p)&&(V=p.ref,ea(p,P));for(O in p)xe.call(p,O)&&!Kt.hasOwnProperty(O)&&(D[O]=p[O]);if(o&&o.defaultProps){var $=o.defaultProps;for(O in $)D[O]===void 0&&(D[O]=$[O])}if(E||V){var B=typeof o=="function"?o.displayName||o.name||"Unknown":o;E&&ta(D,B),V&&aa(D,B)}return sa(o,E,V,P,b,Se.current,D)}}var qe=T.ReactCurrentOwner,jt=T.ReactDebugCurrentFrame;function de(o){if(o){var p=o._owner,M=Oe(o.type,o._source,p?p.type:null);jt.setExtraStackFrame(M)}else jt.setExtraStackFrame(null)}var Ve;Ve=!1;function Ue(o){return typeof o=="object"&&o!==null&&o.$$typeof===e}function bt(){{if(qe.current){var o=Z(qe.current.type);if(o)return`
22
22
 
23
- Check the render method of \``+o+"`."}return""}}function ia(o){{if(o!==void 0){var m=o.fileName.replace(/^.*[\\\/]/,""),y=o.lineNumber;return`
23
+ Check the render method of \``+o+"`."}return""}}function ia(o){{if(o!==void 0){var p=o.fileName.replace(/^.*[\\\/]/,""),M=o.lineNumber;return`
24
24
 
25
- Check your code at `+m+":"+y+"."}return""}}var Rt={};function na(o){{var m=Tt();if(!m){var y=typeof o=="string"?o:o.displayName||o.name;y&&(m=`
25
+ Check your code at `+p+":"+M+"."}return""}}var Tt={};function na(o){{var p=bt();if(!p){var M=typeof o=="string"?o:o.displayName||o.name;M&&(p=`
26
26
 
27
- Check the top-level render call using <`+y+">.")}return m}}function Et(o,m){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var y=na(m);if(Rt[y])return;Rt[y]=!0;var T="";o&&o._owner&&o._owner!==Qe.current&&(T=" It was passed a child from "+X(o._owner.type)+"."),de(o),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',y,T),de(null)}}function It(o,m){{if(typeof o!="object")return;if(Ve(o))for(var y=0;y<o.length;y++){var T=o[y];ze(T)&&Et(T,m)}else if(ze(o))o._store&&(o._store.validated=!0);else if(o){var O=S(o);if(typeof O=="function"&&O!==o.entries)for(var D=O.call(o),M;!(M=D.next()).done;)ze(M.value)&&Et(M.value,m)}}}function ca(o){{var m=o.type;if(m==null||typeof m=="string")return;var y;if(typeof m=="function")y=m.propTypes;else if(typeof m=="object"&&(m.$$typeof===l||m.$$typeof===g))y=m.propTypes;else return;if(y){var T=X(m);Kt(y,o.props,"prop",T,o)}else if(m.PropTypes!==void 0&&!Ke){Ke=!0;var O=X(m);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",O||"Unknown")}typeof m.getDefaultProps=="function"&&!m.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function oa(o){{for(var m=Object.keys(o.props),y=0;y<m.length;y++){var T=m[y];if(T!=="children"&&T!=="key"){de(o),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",T),de(null);break}}o.ref!==null&&(de(o),k("Invalid attribute `ref` supplied to `React.Fragment`."),de(null))}}var Pt={};function jt(o,m,y,T,O,D){{var M=B(o);if(!M){var j="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(j+=" 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 K=ia(O);K?j+=K:j+=Tt();var H;o===null?H="null":Ve(o)?H="array":o!==void 0&&o.$$typeof===e?(H="<"+(X(o.type)||"Unknown")+" />",j=" Did you accidentally export a JSX literal instead of a component?"):H=typeof o,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",H,j)}var V=ra(o,m,y,O,D);if(V==null)return V;if(M){var Z=m.children;if(Z!==void 0)if(T)if(Ve(Z)){for(var ge=0;ge<Z.length;ge++)It(Z[ge],o);Object.freeze&&Object.freeze(Z)}else k("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 It(Z,o)}if(we.call(m,"key")){var he=X(o),Y=Object.keys(m).filter(function(pa){return pa!=="key"}),Je=Y.length>0?"{key: someKey, "+Y.join(": ..., ")+": ...}":"{key: someKey}";if(!Pt[he+Je]){var ga=Y.length>0?"{"+Y.join(": ..., ")+": ...}":"{}";k(`A props object containing a "key" prop is being spread into JSX:
27
+ Check the top-level render call using <`+M+">.")}return p}}function kt(o,p){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var M=na(p);if(Tt[M])return;Tt[M]=!0;var b="";o&&o._owner&&o._owner!==qe.current&&(b=" It was passed a child from "+Z(o._owner.type)+"."),de(o),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',M,b),de(null)}}function It(o,p){{if(typeof o!="object")return;if(Be(o))for(var M=0;M<o.length;M++){var b=o[M];Ue(b)&&kt(b,p)}else if(Ue(o))o._store&&(o._store.validated=!0);else if(o){var P=w(o);if(typeof P=="function"&&P!==o.entries)for(var O=P.call(o),D;!(D=O.next()).done;)Ue(D.value)&&kt(D.value,p)}}}function ca(o){{var p=o.type;if(p==null||typeof p=="string")return;var M;if(typeof p=="function")M=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===l||p.$$typeof===g))M=p.propTypes;else return;if(M){var b=Z(p);Vt(M,o.props,"prop",b,o)}else if(p.PropTypes!==void 0&&!Ve){Ve=!0;var P=Z(p);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",P||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function oa(o){{for(var p=Object.keys(o.props),M=0;M<p.length;M++){var b=p[M];if(b!=="children"&&b!=="key"){de(o),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),de(null);break}}o.ref!==null&&(de(o),j("Invalid attribute `ref` supplied to `React.Fragment`."),de(null))}}var At={};function Et(o,p,M,b,P,O){{var D=J(o);if(!D){var E="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(E+=" 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 V=ia(P);V?E+=V:E+=bt();var $;o===null?$="null":Be(o)?$="array":o!==void 0&&o.$$typeof===e?($="<"+(Z(o.type)||"Unknown")+" />",E=" Did you accidentally export a JSX literal instead of a component?"):$=typeof o,j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",$,E)}var B=ra(o,p,M,P,O);if(B==null)return B;if(D){var X=p.children;if(X!==void 0)if(b)if(Be(X)){for(var ge=0;ge<X.length;ge++)It(X[ge],o);Object.freeze&&Object.freeze(X)}else j("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 It(X,o)}if(xe.call(p,"key")){var he=Z(o),G=Object.keys(p).filter(function(ma){return ma!=="key"}),_e=G.length>0?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}";if(!At[he+_e]){var ga=G.length>0?"{"+G.join(": ..., ")+": ...}":"{}";j(`A props object containing a "key" prop is being spread into JSX:
28
28
  let props = %s;
29
29
  <%s {...props} />
30
30
  React keys must be passed directly to JSX without using spread:
31
31
  let props = %s;
32
- <%s key={someKey} {...props} />`,Je,he,ga,he),Pt[he+Je]=!0}}return o===s?oa(V):ca(V),V}}function la(o,m,y){return jt(o,m,y,!0)}function ha(o,m,y){return jt(o,m,y,!1)}var ua=ha,da=la;Te.Fragment=s,Te.jsx=ua,Te.jsxs=da}()),Te}process.env.NODE_ENV==="production"?Ze.exports=ma():Ze.exports=fa();var u=Ze.exports,va=Object.defineProperty,ya=(i,e,t)=>e in i?va(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,h=(i,e,t)=>(ya(i,typeof e!="symbol"?e+"":e,t),t),Q=(i=>(i[i.mustache=0]="mustache",i[i.vue=1]="vue",i[i.react=2]="react",i[i.angular=3]="angular",i))(Q||{});class xa{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 answerLoading(){return this.dataLayer.answerLoading}get shouldShowAnswer(){return(this.dataLayer.getAnswerData!==""||this.dataLayer.parsedData.answerLoading)&&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 searchingEverything(){return this.searchTerm==="*"}get firstSearchHappened(){return this.dataLayer.firstSearchHappened}get isInfiniteScroll(){return this.dataLayer.isInfiniteScroll??!1}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,n=t.find(c=>c.name===a);if(n){const c=n.values.find(l=>l.type==="range"?!1:l.type==="checkbox"?'"'+l.value+'"'===r:!1);if(c)return c}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,shouldShowAnswerLoadMore:this.shouldShowAnswerLoadMore,answerLoading:this.answerLoading,shouldShowAnswer:this.shouldShowAnswer,isInfiniteScroll:this.isInfiniteScroll,percentageOfResultsLoaded:this.percentageOfResultsLoaded,firstSearchHappened:this.firstSearchHappened,sortOptions:this.sortOptions,selectedSortOption:this.selectedSortOption}}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}}}class ae{static deepEqual(e,t){const s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;for(const r of s){const n=e[r],c=t[r],l=this.isObject(n)&&this.isObject(c);if(l&&!this.deepEqual(n,c)||!l&&n!==c)return!1}return!0}static isObject(e){return e!=null&&typeof e=="object"}}class ${constructor(e){h(this,"value"),h(this,"observers",[]),this.value=e,this.observers=[]}subscribe(e){this.observers.push(e),e(this.value)}unsubscribe(e){const t=this.observers.indexOf(e);t!==-1&&this.observers.splice(t,1)}setValue(e){this.value=e,this.notify()}getValue(){return this.value}notify(){this.observers.forEach(e=>e(this.value))}}class Ye{static getOrSetCookie(e,t){let s=this.getCookie(e);return s==null&&(s=t??this.makeid(25),this.setCookie(e,s,{secure:!0,"max-age":3600})),s}static deleteCookie(e){this.getCookie(e)&&this.setCookie(e,"",{secure:!0,"max-age":-1})}static makeid(e){let t="";const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=s.length;for(let r=0;r<e;r++)t+=s.charAt(Math.floor(Math.random()*a));return t}static getCookie(e){const t=typeof document<"u"?document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")+"=([^;]*)")):null;return t?decodeURIComponent(t[1]):void 0}static setCookie(e,t,s){const a={path:"/",...s};s.expires instanceof Date&&(a.expires=s.expires.toUTCString());let r=encodeURIComponent(e)+"="+encodeURIComponent(t);for(const n in a){r+="; "+n;const c=a[n];c!==!0&&(r+="="+c)}typeof document<"u"&&(document.cookie=r)}}class ce{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 ba{constructor(e,t){h(this,"$searchTermChange",new $("")),h(this,"$loadingChange",new $(!1)),h(this,"$searchResults",new $(null)),h(this,"$searchResultsMetadata",new $(null)),h(this,"$searchAutosuggest",new $(null)),h(this,"$searchFacets",new $(null)),h(this,"$searchFacetsCached",new $(null)),h(this,"$searchstaxConfig",new $(null)),h(this,"$autosuggestResults",new $(null)),h(this,"$itemsPerPage",new $(void 0)),h(this,"$searchObject",new $({query:"",itemsPerPage:null,page:99999999,order:"",facets:[],additionalProps:[]})),h(this,"$searchRelatedSearches",new $(null)),h(this,"$searchInputConfig",new $(null)),h(this,"$searchExternalPromotions",new $(null)),h(this,"$facetsTemplateData",new $(null)),h(this,"$selectedFacetsTemplateData",new $(null)),h(this,"$paginationData",new $(null)),h(this,"$answerData",new $(null)),h(this,"$searchFeedbackData",new $(null)),h(this,"$searchSortingData",new $(null)),h(this,"$searchRelatedSearchesData",new $(null)),h(this,"$searchExternalPromotionsData",new $(null)),h(this,"$cookiesDisabled",new $(null)),h(this,"$answer",new $("")),h(this,"$language",new $("en")),h(this,"$answerLoading",new $(!1)),h(this,"$isQuestion",new $(!1)),h(this,"currentPageValue",1),h(this,"isAnswerWidgetCreatedValue",!1),h(this,"renderingEngineValue",Q.mustache),h(this,"parsedData",new xa(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,Ye.deleteCookie(this.sessionId),Ye.deleteCookie("ms_visitorid")):this.sessionIdValue=Ye.getOrSetCookie(this.sessionId,e)}setIsInfiniteScroll(e){this.isInfiniteScroll=e}setSearchTerm(e){this.$searchTermChange.setValue(ce.removeXSSRiskyTags(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,(!ae.deepEqual(e,this.searchResults??[""])||this.facetsWereSet)&&(this.facetsWereSet=!1,this.$searchResults.setValue(e))}setSearchResultsMetadata(e){ae.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},(s=(t=this.searchstaxConfig)==null?void 0:t.hooks)!=null&&s.beforeSearch&&a&&(a=this.searchstaxConfig.hooks.beforeSearch(a)),a&&(!ae.deepEqual(a,this.searchObject??{})||this.forceNotCorrect)&&this.$searchObject.setValue(a)}setSearchFacets(e){this.facetsWereSet=!0,ae.deepEqual(e,this.searchFacets??[])||this.$searchFacets.setValue(e)}setSearchFacetsCached(e){ae.deepEqual(e,this.searchFacetsCached??[])||this.$searchFacetsCached.setValue(e)}setSearchRelatedSearches(e){ae.deepEqual(e,this.searchRelatedSearches??[])||this.$searchRelatedSearches.setValue(e)}setSearchExternalPromotions(e){ae.deepEqual(e,this.searchExternalPromotions??[])||this.$searchExternalPromotions.setValue(e)}setLanguage(e){this.$language.setValue(e)}setSearchstaxConfig(e){this.$searchstaxConfig.setValue(e)}setSearchInputConfig(e){this.$searchInputConfig.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)}setIsQuestion(e){this.$isQuestion.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 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 searchInputConfig(){return this.$searchInputConfig.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()}}class Re{static combineResultsWithMetadata(e){const t=[],s=parseInt(e.response.start+"");return e.response.docs.forEach((a,r)=>{const n=a[e.responseHeader.params.uniqueId]??"",c={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,unmappedFields:this.getUnmappedFields(a,e,n),allFields:this.getAllFields(a,e)};t.push(c)}),t}static extractFacets(e){const t=[];if(e.metadata.facets)for(const s of e.metadata.facets){let a={values:[]};if(a.name=s.name,a.label=s.label,s.name in e.facet_counts.facet_fields){const r=e.facet_counts.facet_fields[s.name];for(let n=0;n<r.length;n+=2){const c={};c.value=r[n],c.parentName=a.name,c.count=r[n+1],c.type="checkbox",a.values.push(c)}}a.values.length>0&&t.push(a)}return t}static extractSearchResultsMetadata(e){var t,s,a,r,n,c;let l="",d={selectedSortOption:"",options:[]},f=(t=e.metadata.results.find(g=>g.result_card==="date"))==null?void 0:t.name;if(d.options=[{key:"",value:"Relevance"},{key:f+" desc",value:"Most Recent"}],(s=e.metadata.sorts)!=null&&s.length){const g=e.metadata.sorts.map(p=>({value:p.label,key:p.name+" "+p.order}));d.options=[{key:"",value:"Relevance"},...g]}return l=((c=(n=(r=(a=e==null?void 0:e.spellcheck)==null?void 0:a.suggestions)==null?void 0:r[1])==null?void 0:n.suggestion)==null?void 0:c[0])??"",typeof l!="string"&&(l=(l==null?void 0:l.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:l,autoCorrectedQuery:e.responseHeader.params.autoCorrectedQ??"",impressions:this.getImpressions(e),sorting:d}}static getImpressions(e){const t=[],s=this.combineResultsWithMetadata(e);for(const a in s){const r=s[a],n={};n.cDocId=this.getDataForAnalytics(r.uniqueId),r.title&&(n.cDocTitle=this.getDataForAnalytics(r.title)),n.position=r.position,t.push(n)}return t}static getDataForAnalytics(e){return e!==null?typeof e>"u"?"":typeof e=="string"?e:typeof e.join<"u"?e[0]:e:""}static findResultByUniqueId(e,t){return t.find(s=>s.uniqueId===e)??null}static getUnmappedFields(e,t,s){const a=t.metadata.results.filter(n=>n.result_card==="").map(n=>n.name),r=[];for(const n of a)if(Object.keys(e).includes(n)){const c=Array.isArray(e[n])?this.getHighlightedResults(n,e[n].join(", "),s,t):this.getHighlightedResults(n,e[n]+"",s,t);r.push({key:n,value:c,isImage:this.checkIfImage(e[n])})}return r}static checkIfImage(e){return e===void 0?!1:typeof e!="string"?Array.isArray(e)&&e[0]?/\.(gif|jpe?g|tiff?|png|webp|bmp)$/i.test(e[0]):!1:/\.(gif|jpe?g|tiff?|png|webp|bmp)$/i.test(e)}static getAllFields(e,t){const s=t.metadata.results.map(r=>r.name),a=[];for(const r of Object.keys(e))s.indexOf(r)!==-1&&a.push({key:r,value:e[r],isImage:this.checkIfImage(e[r])});return a}static doesMapExist(e,t){return t.metadata.results.find(s=>s.result_card===e)!==void 0}static getValueByKey(e,t,s,a,r=!1){const n=s.metadata.results.find(l=>l.result_card===e);if(n===void 0)return null;const c=t[n.name];return c===void 0?null:typeof c=="string"?r?c:this.getHighlightedResults(n.name,c,a,s):Array.isArray(c)?r?c.join(", "):this.getHighlightedResults(n.name,c.join(", "),a,s):null}static getHighlightedResults(e,t,s,a){if(a.highlighting&&s in a.highlighting){let r=a.highlighting[s];if(r&&e in r){let n=r[e];const c=this.cleanValue(n);if(c!=="")return c}}return t}static cleanValue(e){return e===null?"":typeof e=="string"?e:Array.isArray(e)?e.join(" "):""}}class Ft{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 Sa(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.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(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 n in e)if(n.startsWith(this.routeName+"[facets]")){const c=ce.removeXSSRiskyTags((t=e[n].split(":"))==null?void 0:t[0]),l=ce.removeXSSRiskyTags(decodeURIComponent((s=e[n].split(":"))==null?void 0:s[1])),d=ce.removeXSSRiskyTags(decodeURIComponent((a=e[n].split(":"))==null?void 0:a[2]));r.push({type:c,name:l,value:d})}return r}urlToSearchObject(e,t){const s=this.queryStringHelper.urlToParams(e),a=ce.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[page]"])),r=parseInt(a),n=isNaN(r)?1:r;return{query:ce.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[query]"]))||"",page:n,itemsPerPage:t,order:ce.removeXSSRiskyTags(s[this.routeName+"[order]"])||"",facets:this.extractArrayOfFacetsFromQueryParameters(s)||[]}}}class Sa{constructor(e){h(this,"routeName",""),h(this,"stringify",(t,s)=>{const a=this.filterOutIgnoredKeys(t,s.ignoredKeys);return Object.keys(a).map(r=>{const n=a[r];return Array.isArray(n)?n.map(c=>`${r}=${c}`).join("&"):`${r}=${n}`}).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,n]=a.split("=");t[r]=n}),t}doesParamContainRouteName(e){return e.indexOf(this.routeName)!==-1}urlHasQueryParams(e){return e.indexOf("?")!==-1}}const ve={questionURL:"http://smartsearch-dev.searchstax.co/completion/?q=",question:"I_AM_A_QUESTION",notQuestion:"I_AM_NOT_A_QUESTION",close:"CLOSE"};class Ot 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 Ge(i){}function Ca(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=Ge,onError:t=Ge,onRetry:s=Ge,onComment:a}=i;let r="",n=!0,c,l="",d="";function f(x){const S=n?x.replace(/^\xEF\xBB\xBF/,""):x,[R,k]=wa(`${r}${S}`);for(const N of R)g(N);r=k,n=!1}function g(x){if(x===""){w();return}if(x.startsWith(":")){a&&a(x.slice(x.startsWith(": ")?2:1));return}const S=x.indexOf(":");if(S!==-1){const R=x.slice(0,S),k=x[S+1]===" "?2:1,N=x.slice(S+k);p(R,N,x);return}p(x,"",x)}function p(x,S,R){switch(x){case"event":d=S;break;case"data":l=`${l}${S}
33
- `;break;case"id":c=S.includes("\0")?void 0:S;break;case"retry":/^\d+$/.test(S)?s(parseInt(S,10)):t(new Ot(`Invalid \`retry\` value: "${S}"`,{type:"invalid-retry",value:S,line:R}));break;default:t(new Ot(`Unknown field "${x.length>20?`${x.slice(0,20)}…`:x}"`,{type:"unknown-field",field:x,value:S,line:R}));break}}function w(){l.length>0&&e({id:c,event:d||void 0,data:l.endsWith(`
34
- `)?l.slice(0,-1):l}),c=void 0,l="",d=""}function E(x={}){r&&x.consume&&g(r),n=!0,c=void 0,l="",d="",r=""}return{feed:f,reset:E}}function wa(i){const e=[];let t="",s=0;for(;s<i.length;){const a=i.indexOf("\r",s),r=i.indexOf(`
32
+ <%s key={someKey} {...props} />`,_e,he,ga,he),At[he+_e]=!0}}return o===s?oa(B):ca(B),B}}function la(o,p,M){return Et(o,p,M,!0)}function ha(o,p,M){return Et(o,p,M,!1)}var ua=ha,da=la;be.Fragment=s,be.jsx=ua,be.jsxs=da}()),be}process.env.NODE_ENV==="production"?Xe.exports=pa():Xe.exports=La();var u=Xe.exports,fa=Object.defineProperty,Ma=(i,e,t)=>e in i?fa(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,h=(i,e,t)=>(Ma(i,typeof e!="symbol"?e+"":e,t),t),q=(i=>(i[i.mustache=0]="mustache",i[i.vue=1]="vue",i[i.react=2]="react",i[i.angular=3]="angular",i))(q||{});class ya{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 answerLoading(){return this.dataLayer.answerLoading}get shouldShowAnswer(){return(this.dataLayer.getAnswerData!==""||this.dataLayer.parsedData.answerLoading)&&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 searchingEverything(){return this.searchTerm==="*"}get firstSearchHappened(){return this.dataLayer.firstSearchHappened}get isInfiniteScroll(){return this.dataLayer.isInfiniteScroll??!1}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,n=t.find(c=>c.name===a);if(n){const c=n.values.find(l=>l.type==="range"?!1:l.type==="checkbox"?'"'+l.value+'"'===r:!1);if(c)return c}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,shouldShowAnswerLoadMore:this.shouldShowAnswerLoadMore,answerLoading:this.answerLoading,shouldShowAnswer:this.shouldShowAnswer,isInfiniteScroll:this.isInfiniteScroll,percentageOfResultsLoaded:this.percentageOfResultsLoaded,firstSearchHappened:this.firstSearchHappened,sortOptions:this.sortOptions,selectedSortOption:this.selectedSortOption}}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}}}class ae{static deepEqual(e,t){const s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;for(const r of s){const n=e[r],c=t[r],l=this.isObject(n)&&this.isObject(c);if(l&&!this.deepEqual(n,c)||!l&&n!==c)return!1}return!0}static isObject(e){return e!=null&&typeof e=="object"}}class F{constructor(e){h(this,"value"),h(this,"observers",[]),this.value=e,this.observers=[]}subscribe(e){this.observers.push(e),e(this.value)}unsubscribe(e){const t=this.observers.indexOf(e);t!==-1&&this.observers.splice(t,1)}setValue(e){this.value=e,this.notify()}getValue(){return this.value}notify(){this.observers.forEach(e=>e(this.value))}}class Ge{static getOrSetCookie(e,t){let s=this.getCookie(e);return s==null&&(s=t??this.makeid(25),this.setCookie(e,s,{secure:!0,"max-age":3600})),s}static deleteCookie(e){this.getCookie(e)&&this.setCookie(e,"",{secure:!0,"max-age":-1})}static makeid(e){let t="";const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=s.length;for(let r=0;r<e;r++)t+=s.charAt(Math.floor(Math.random()*a));return t}static getCookie(e){const t=typeof document<"u"?document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")+"=([^;]*)")):null;return t?decodeURIComponent(t[1]):void 0}static setCookie(e,t,s){const a={path:"/",...s};s.expires instanceof Date&&(a.expires=s.expires.toUTCString());let r=encodeURIComponent(e)+"="+encodeURIComponent(t);for(const n in a){r+="; "+n;const c=a[n];c!==!0&&(r+="="+c)}typeof document<"u"&&(document.cookie=r)}}class ce{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 va{constructor(e,t){h(this,"$searchTermChange",new F("")),h(this,"$loadingChange",new F(!1)),h(this,"$searchResults",new F(null)),h(this,"$searchResultsMetadata",new F(null)),h(this,"$searchAutosuggest",new F(null)),h(this,"$searchFacets",new F(null)),h(this,"$searchFacetsCached",new F(null)),h(this,"$searchstaxConfig",new F(null)),h(this,"$autosuggestResults",new F(null)),h(this,"$itemsPerPage",new F(void 0)),h(this,"$searchObject",new F({query:"",itemsPerPage:null,page:99999999,order:"",facets:[],additionalProps:[]})),h(this,"$searchRelatedSearches",new F(null)),h(this,"$searchInputConfig",new F(null)),h(this,"$searchExternalPromotions",new F(null)),h(this,"$facetsTemplateData",new F(null)),h(this,"$selectedFacetsTemplateData",new F(null)),h(this,"$paginationData",new F(null)),h(this,"$answerData",new F(null)),h(this,"$searchFeedbackData",new F(null)),h(this,"$searchSortingData",new F(null)),h(this,"$searchRelatedSearchesData",new F(null)),h(this,"$searchExternalPromotionsData",new F(null)),h(this,"$cookiesDisabled",new F(null)),h(this,"$answer",new F("")),h(this,"$language",new F("en")),h(this,"$answerLoading",new F(!1)),h(this,"$isQuestion",new F(!1)),h(this,"currentPageValue",1),h(this,"isAnswerWidgetCreatedValue",!1),h(this,"renderingEngineValue",q.mustache),h(this,"parsedData",new ya(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,Ge.deleteCookie(this.sessionId),Ge.deleteCookie("ms_visitorid")):this.sessionIdValue=Ge.getOrSetCookie(this.sessionId,e)}setIsInfiniteScroll(e){this.isInfiniteScroll=e}setSearchTerm(e){this.$searchTermChange.setValue(ce.removeXSSRiskyTags(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,(!ae.deepEqual(e,this.searchResults??[""])||this.facetsWereSet)&&(this.facetsWereSet=!1,this.$searchResults.setValue(e))}setSearchResultsMetadata(e){ae.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},(s=(t=this.searchstaxConfig)==null?void 0:t.hooks)!=null&&s.beforeSearch&&a&&(a=this.searchstaxConfig.hooks.beforeSearch(a)),a&&(!ae.deepEqual(a,this.searchObject??{})||this.forceNotCorrect)&&this.$searchObject.setValue(a)}setSearchFacets(e){this.facetsWereSet=!0,ae.deepEqual(e,this.searchFacets??[])||this.$searchFacets.setValue(e)}setSearchFacetsCached(e){ae.deepEqual(e,this.searchFacetsCached??[])||this.$searchFacetsCached.setValue(e)}setSearchRelatedSearches(e){ae.deepEqual(e,this.searchRelatedSearches??[])||this.$searchRelatedSearches.setValue(e)}setSearchExternalPromotions(e){ae.deepEqual(e,this.searchExternalPromotions??[])||this.$searchExternalPromotions.setValue(e)}setLanguage(e){this.$language.setValue(e)}setSearchstaxConfig(e){this.$searchstaxConfig.setValue(e)}setSearchInputConfig(e){this.$searchInputConfig.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)}setIsQuestion(e){this.$isQuestion.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 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 searchInputConfig(){return this.$searchInputConfig.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()}}class Te{static combineResultsWithMetadata(e){const t=[],s=parseInt(e.response.start+"");return e.response.docs.forEach((a,r)=>{const n=a[e.responseHeader.params.uniqueId]??"",c={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,unmappedFields:this.getUnmappedFields(a,e,n),allFields:this.getAllFields(a,e)};t.push(c)}),t}static extractFacets(e){const t=[];if(e.metadata.facets)for(const s of e.metadata.facets){let a={values:[]};if(a.name=s.name,a.label=s.label,s.name in e.facet_counts.facet_fields){const r=e.facet_counts.facet_fields[s.name];for(let n=0;n<r.length;n+=2){const c={};c.value=r[n],c.parentName=a.name,c.count=r[n+1],c.type="checkbox",a.values.push(c)}}a.values.length>0&&t.push(a)}return t}static extractSearchResultsMetadata(e){var t,s,a,r,n,c;let l="",d={selectedSortOption:"",options:[]},L=(t=e.metadata.results.find(g=>g.result_card==="date"))==null?void 0:t.name;if(d.options=[{key:"",value:"Relevance"},{key:L+" desc",value:"Most Recent"}],(s=e.metadata.sorts)!=null&&s.length){const g=e.metadata.sorts.map(m=>({value:m.label,key:m.name+" "+m.order}));d.options=[{key:"",value:"Relevance"},...g]}return l=((c=(n=(r=(a=e==null?void 0:e.spellcheck)==null?void 0:a.suggestions)==null?void 0:r[1])==null?void 0:n.suggestion)==null?void 0:c[0])??"",typeof l!="string"&&(l=(l==null?void 0:l.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:l,autoCorrectedQuery:e.responseHeader.params.autoCorrectedQ??"",impressions:this.getImpressions(e),sorting:d}}static getImpressions(e){const t=[],s=this.combineResultsWithMetadata(e);for(const a in s){const r=s[a],n={};n.cDocId=this.getDataForAnalytics(r.uniqueId),r.title&&(n.cDocTitle=this.getDataForAnalytics(r.title)),n.position=r.position,t.push(n)}return t}static getDataForAnalytics(e){return e!==null?typeof e>"u"?"":typeof e=="string"?e:typeof e.join<"u"?e[0]:e:""}static findResultByUniqueId(e,t){return t.find(s=>s.uniqueId===e)??null}static getUnmappedFields(e,t,s){const a=t.metadata.results.filter(n=>n.result_card==="").map(n=>n.name),r=[];for(const n of a)if(Object.keys(e).includes(n)){const c=Array.isArray(e[n])?this.getHighlightedResults(n,e[n].join(", "),s,t):this.getHighlightedResults(n,e[n]+"",s,t);r.push({key:n,value:c,isImage:this.checkIfImage(e[n])})}return r}static checkIfImage(e){return e===void 0?!1:typeof e!="string"?Array.isArray(e)&&e[0]?/\.(gif|jpe?g|tiff?|png|webp|bmp)$/i.test(e[0]):!1:/\.(gif|jpe?g|tiff?|png|webp|bmp)$/i.test(e)}static getAllFields(e,t){const s=t.metadata.results.map(r=>r.name),a=[];for(const r of Object.keys(e))s.indexOf(r)!==-1&&a.push({key:r,value:e[r],isImage:this.checkIfImage(e[r])});return a}static doesMapExist(e,t){return t.metadata.results.find(s=>s.result_card===e)!==void 0}static getValueByKey(e,t,s,a,r=!1){const n=s.metadata.results.find(l=>l.result_card===e);if(n===void 0)return null;const c=t[n.name];return c===void 0?null:typeof c=="string"?r?c:this.getHighlightedResults(n.name,c,a,s):Array.isArray(c)?r?c.join(", "):this.getHighlightedResults(n.name,c.join(", "),a,s):null}static getHighlightedResults(e,t,s,a){if(a.highlighting&&s in a.highlighting){let r=a.highlighting[s];if(r&&e in r){let n=r[e];const c=this.cleanValue(n);if(c!=="")return c}}return t}static cleanValue(e){return e===null?"":typeof e=="string"?e:Array.isArray(e)?e.join(" "):""}}class Rt{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 wa(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.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(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 n in e)if(n.startsWith(this.routeName+"[facets]")){const c=ce.removeXSSRiskyTags((t=e[n].split(":"))==null?void 0:t[0]),l=ce.removeXSSRiskyTags(decodeURIComponent((s=e[n].split(":"))==null?void 0:s[1])),d=ce.removeXSSRiskyTags(decodeURIComponent((a=e[n].split(":"))==null?void 0:a[2]));r.push({type:c,name:l,value:d})}return r}urlToSearchObject(e,t){const s=this.queryStringHelper.urlToParams(e),a=ce.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[page]"])),r=parseInt(a),n=isNaN(r)?1:r;return{query:ce.removeXSSRiskyTags(decodeURIComponent(s[this.routeName+"[query]"]))||"",page:n,itemsPerPage:t,order:ce.removeXSSRiskyTags(s[this.routeName+"[order]"])||"",facets:this.extractArrayOfFacetsFromQueryParameters(s)||[]}}}class wa{constructor(e){h(this,"routeName",""),h(this,"stringify",(t,s)=>{const a=this.filterOutIgnoredKeys(t,s.ignoredKeys);return Object.keys(a).map(r=>{const n=a[r];return Array.isArray(n)?n.map(c=>`${r}=${c}`).join("&"):`${r}=${n}`}).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,n]=a.split("=");t[r]=n}),t}doesParamContainRouteName(e){return e.indexOf(this.routeName)!==-1}urlHasQueryParams(e){return e.indexOf("?")!==-1}}const fe={questionURL:"http://smartsearch-dev.searchstax.co/completion/?q=",question:"I_AM_A_QUESTION",notQuestion:"I_AM_NOT_A_QUESTION",close:"CLOSE"};class Pt 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 Ke(i){}function Ca(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=Ke,onError:t=Ke,onRetry:s=Ke,onComment:a}=i;let r="",n=!0,c,l="",d="";function L(y){const w=n?y.replace(/^\xEF\xBB\xBF/,""):y,[T,j]=xa(`${r}${w}`);for(const z of T)g(z);r=j,n=!1}function g(y){if(y===""){S();return}if(y.startsWith(":")){a&&a(y.slice(y.startsWith(": ")?2:1));return}const w=y.indexOf(":");if(w!==-1){const T=y.slice(0,w),j=y[w+1]===" "?2:1,z=y.slice(w+j);m(T,z,y);return}m(y,"",y)}function m(y,w,T){switch(y){case"event":d=w;break;case"data":l=`${l}${w}
33
+ `;break;case"id":c=w.includes("\0")?void 0:w;break;case"retry":/^\d+$/.test(w)?s(parseInt(w,10)):t(new Pt(`Invalid \`retry\` value: "${w}"`,{type:"invalid-retry",value:w,line:T}));break;default:t(new Pt(`Unknown field "${y.length>20?`${y.slice(0,20)}…`:y}"`,{type:"unknown-field",field:y,value:w,line:T}));break}}function S(){l.length>0&&e({id:c,event:d||void 0,data:l.endsWith(`
34
+ `)?l.slice(0,-1):l}),c=void 0,l="",d=""}function k(y={}){r&&y.consume&&g(r),n=!0,c=void 0,l="",d="",r=""}return{feed:L,reset:k}}function xa(i){const e=[];let t="",s=0;for(;s<i.length;){const a=i.indexOf("\r",s),r=i.indexOf(`
35
35
  `,s);let n=-1;if(a!==-1&&r!==-1?n=Math.min(a,r):a!==-1?n=a:r!==-1&&(n=r),n===-1){t=i.slice(s);break}else{const c=i.slice(s,n);e.push(c),s=n+1,i[s-1]==="\r"&&i[s]===`
36
- `&&s++}}return[e,t]}class Dt 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($t(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e($t(this),t)}}function La(i){const e=globalThis.DOMException;return typeof e=="function"?new e(i,"SyntaxError"):new SyntaxError(i)}function et(i){return i instanceof Error?"errors"in i&&Array.isArray(i.errors)?i.errors.map(et).join(", "):"cause"in i&&i.cause instanceof Error?`${i}: ${et(i.cause)}`:i.message:`${i}`}function $t(i){return{type:i.type,message:i.message,code:i.code,defaultPrevented:i.defaultPrevented,cancelable:i.cancelable,timeStamp:i.timeStamp}}var _t=i=>{throw TypeError(i)},ot=(i,e,t)=>e.has(i)||_t("Cannot "+t),P=(i,e,t)=>(ot(i,e,"read from private field"),t?t.call(i):e.get(i)),U=(i,e,t)=>e.has(i)?_t("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),W=(i,e,t,s)=>(ot(i,e,"write to private field"),e.set(i,t),t),ne=(i,e,t)=>(ot(i,e,"access private method"),t),G,ue,pe,Ne,We,Pe,ye,je,oe,me,xe,fe,Ee,te,tt,at,st,Nt,rt,it,Ie,nt,ct;class qe extends EventTarget{constructor(e,t){var s,a;super(),U(this,te),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,U(this,G),U(this,ue),U(this,pe),U(this,Ne),U(this,We),U(this,Pe),U(this,ye),U(this,je,null),U(this,oe),U(this,me),U(this,xe,null),U(this,fe,null),U(this,Ee,null),U(this,at,async r=>{var n;P(this,me).reset();const{body:c,redirected:l,status:d,headers:f}=r;if(d===204){ne(this,te,Ie).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?W(this,pe,new URL(r.url)):W(this,pe,void 0),d!==200){ne(this,te,Ie).call(this,`Non-200 status code (${d})`,d);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){ne(this,te,Ie).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(P(this,G)===this.CLOSED)return;W(this,G,this.OPEN);const g=new Event("open");if((n=P(this,Ee))==null||n.call(this,g),this.dispatchEvent(g),typeof c!="object"||!c||!("getReader"in c)){ne(this,te,Ie).call(this,"Invalid response body, expected a web ReadableStream",d),this.close();return}const p=new TextDecoder,w=c.getReader();let E=!0;do{const{done:x,value:S}=await w.read();S&&P(this,me).feed(p.decode(S,{stream:!x})),x&&(E=!1,P(this,me).reset(),ne(this,te,nt).call(this))}while(E)}),U(this,st,r=>{W(this,oe,void 0),!(r.name==="AbortError"||r.type==="aborted")&&ne(this,te,nt).call(this,et(r))}),U(this,rt,r=>{typeof r.id=="string"&&W(this,je,r.id);const n=new MessageEvent(r.event||"message",{data:r.data,origin:P(this,pe)?P(this,pe).origin:P(this,ue).origin,lastEventId:r.id||""});P(this,fe)&&(!r.event||r.event==="message")&&P(this,fe).call(this,n),this.dispatchEvent(n)}),U(this,it,r=>{W(this,Pe,r)}),U(this,ct,()=>{W(this,ye,void 0),P(this,G)===this.CONNECTING&&ne(this,te,tt).call(this)});try{if(e instanceof URL)W(this,ue,e);else if(typeof e=="string")W(this,ue,new URL(e,ka()));else throw new Error("Invalid URL")}catch{throw La("An invalid or illegal string was specified")}W(this,me,Ca({onEvent:P(this,rt),onRetry:P(this,it)})),W(this,G,this.CONNECTING),W(this,Pe,3e3),W(this,We,(s=t==null?void 0:t.fetch)!=null?s:globalThis.fetch),W(this,Ne,(a=t==null?void 0:t.withCredentials)!=null?a:!1),ne(this,te,tt).call(this)}get readyState(){return P(this,G)}get url(){return P(this,ue).href}get withCredentials(){return P(this,Ne)}get onerror(){return P(this,xe)}set onerror(e){W(this,xe,e)}get onmessage(){return P(this,fe)}set onmessage(e){W(this,fe,e)}get onopen(){return P(this,Ee)}set onopen(e){W(this,Ee,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,ye)&&clearTimeout(P(this,ye)),P(this,G)!==this.CLOSED&&(P(this,oe)&&P(this,oe).abort(),W(this,G,this.CLOSED),W(this,oe,void 0))}}G=new WeakMap,ue=new WeakMap,pe=new WeakMap,Ne=new WeakMap,We=new WeakMap,Pe=new WeakMap,ye=new WeakMap,je=new WeakMap,oe=new WeakMap,me=new WeakMap,xe=new WeakMap,fe=new WeakMap,Ee=new WeakMap,te=new WeakSet,tt=function(){W(this,G,this.CONNECTING),W(this,oe,new AbortController),P(this,We)(P(this,ue),ne(this,te,Nt).call(this)).then(P(this,at)).catch(P(this,st))},at=new WeakMap,st=new WeakMap,Nt=function(){var i;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...P(this,je)?{"Last-Event-ID":P(this,je)}:void 0},cache:"no-store",signal:(i=P(this,oe))==null?void 0:i.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},rt=new WeakMap,it=new WeakMap,Ie=function(i,e){var t;P(this,G)!==this.CLOSED&&W(this,G,this.CLOSED);const s=new Dt("error",{code:e,message:i});(t=P(this,xe))==null||t.call(this,s),this.dispatchEvent(s)},nt=function(i,e){var t;if(P(this,G)===this.CLOSED)return;W(this,G,this.CONNECTING);const s=new Dt("error",{code:e,message:i});(t=P(this,xe))==null||t.call(this,s),this.dispatchEvent(s),W(this,ye,setTimeout(P(this,ct),P(this,Pe)))},ct=new WeakMap,qe.CONNECTING=0,qe.OPEN=1,qe.CLOSED=2;function ka(){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 le{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};return new Promise((s,a)=>{const r=["trackClick",t];t.key&&this.msq().push(r,(function(n,c){JSON.stringify(n)===JSON.stringify(t)&&c?s():a()}).bind(this))})}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,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:e.currentPage,shownHits:e.recordsPerPage,totalHits:e.totalResults,language:e.language};setTimeout(()=>{t.key&&this.msq().push(["trackRelatedSearchClick",t])},0)}static trackRelatedSearches(e){const t={session:e.session,key:e.trackApiKey,query:e.searchTerm,shownHits:e.recordsPerPage,latency:e.latencyVal,language:e.language,impressions:e.impressions};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,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}])},0)}}h(le,"subscribedToClickEvent",!1),h(le,"msq",()=>typeof window<"u"&&window!=null&&window._msq?window==null?void 0:window._msq:[]);class Ta{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 n=r.name+":"+r.value,c=decodeURIComponent(n).replace(" "," ").split(":");a[c[0]]?a[c[0]].push(c[1]):a[c[0]]=[c[1]]});for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)){const n=a[r],c=r;let l="";for(const d of n)l+=` ${c}:"${d}"`;s=s.concat("fq="+l.trim())}}return s=s.map(a=>a.replace(/&/g,"%26").replace(/\+/g,"%2B")),s.length?"&"+s.join("&"):""}getRelatedSearches(e,t,s,a){const r=new Headers;r.append("Accept","application/json"),r.append("Authorization",s),fetch(t+"?search="+encodeURIComponent(e.query)+"&language="+this.dataLayer.language,{method:"GET",headers:r,credentials:"same-origin"}).then(n=>n.json()).then(n=>{a(n)})}cacheFacets(){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},this.cacheFacetsCallback.bind(this),!0))}cacheFacetsCallback(e){let t=Re.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:(p,w)=>p.get(w)??""}),n=r.languageVariant?"&fq=_language:"+r.languageVariant:"";let c=e.itemsPerPage,l=(e.itemsPerPage?e.itemsPerPage:0)*(e.page-1),d=e.order?`&sort=${e.order}`:"";const f=this.url+"?q="+encodeURIComponent(e.query.trim())+"&start="+l+this.toQueryString(e.additionalProps??[])+this.generateFacetQuery(e.facets.filter(p=>p.type==="or"||p.type==="showUnavailable"),!0)+this.generateFacetQuery(e.facets.filter(p=>p.type==="and"||p.type==="tabs"),!1)+d+`&spellcheck.correct=${this.dataLayer.autoCorrect&&!a}`+(c?`&rows=${c}`:"")+"&language="+this.dataLayer.language+n,g={method:"GET",headers:this.authHeader,credentials:"same-origin",signal:this.signalSearch};s&&delete g.signal,fetch(f,g).then(p=>p.json()).then(p=>{this.dataLayer.setLoading(!1),t(p)}).catch(()=>{this.dataLayer.setLoading(!1)})}}startSSE(e,t){if(!this.dataLayer.turnAIAnswerGenerationOn||e==="*"||this.dataLayer.searchObject.page!==1)return;const s=new qe(this.dataLayer.questionURL+"?q="+e+"&language="+this.dataLayer.language+`&spellcheck.correct=${this.dataLayer.autoCorrect}`,{fetch:(r,n)=>fetch(r,{...n,headers:{...n==null?void 0:n.headers,Authorization:this._authToken}})}),a=this.dataLayer;s.onmessage=r=>{if(r.data===ve.question||r.data===ve.notQuestion){r.data===ve.question?(this.dataLayer.setAnswerLoading(!0),this.dataLayer.setIsQuestion(!0)):(a.setAnswerLoading(!1),this.dataLayer.setIsQuestion(!1)),a.setAnswerData("");return}if(r.data===ve.close){le.trackAnswerData({...a.parsedData.trackingData,answer:a.$answer.getValue(),isQuestion:this.dataLayer.isQuestion}),a.setAnswerLoading(!1),s.close();return}t(r.data)},s.onerror=()=>{a.setAnswerLoading(!1),s.close()}}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("&")}}/*!
36
+ `&&s++}}return[e,t]}class Ot 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(Ft(this),t)}[Symbol.for("Deno.customInspect")](e,t){return e(Ft(this),t)}}function Sa(i){const e=globalThis.DOMException;return typeof e=="function"?new e(i,"SyntaxError"):new SyntaxError(i)}function et(i){return i instanceof Error?"errors"in i&&Array.isArray(i.errors)?i.errors.map(et).join(", "):"cause"in i&&i.cause instanceof Error?`${i}: ${et(i.cause)}`:i.message:`${i}`}function Ft(i){return{type:i.type,message:i.message,code:i.code,defaultPrevented:i.defaultPrevented,cancelable:i.cancelable,timeStamp:i.timeStamp}}var Yt=i=>{throw TypeError(i)},ot=(i,e,t)=>e.has(i)||Yt("Cannot "+t),A=(i,e,t)=>(ot(i,e,"read from private field"),t?t.call(i):e.get(i)),H=(i,e,t)=>e.has(i)?Yt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),W=(i,e,t,s)=>(ot(i,e,"write to private field"),e.set(i,t),t),ne=(i,e,t)=>(ot(i,e,"access private method"),t),K,ue,me,ze,We,Ae,Me,Ee,oe,pe,ye,Le,ke,te,tt,at,st,zt,rt,it,Ie,nt,ct;class Qe extends EventTarget{constructor(e,t){var s,a;super(),H(this,te),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,H(this,K),H(this,ue),H(this,me),H(this,ze),H(this,We),H(this,Ae),H(this,Me),H(this,Ee,null),H(this,oe),H(this,pe),H(this,ye,null),H(this,Le,null),H(this,ke,null),H(this,at,async r=>{var n;A(this,pe).reset();const{body:c,redirected:l,status:d,headers:L}=r;if(d===204){ne(this,te,Ie).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?W(this,me,new URL(r.url)):W(this,me,void 0),d!==200){ne(this,te,Ie).call(this,`Non-200 status code (${d})`,d);return}if(!(L.get("content-type")||"").startsWith("text/event-stream")){ne(this,te,Ie).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(A(this,K)===this.CLOSED)return;W(this,K,this.OPEN);const g=new Event("open");if((n=A(this,ke))==null||n.call(this,g),this.dispatchEvent(g),typeof c!="object"||!c||!("getReader"in c)){ne(this,te,Ie).call(this,"Invalid response body, expected a web ReadableStream",d),this.close();return}const m=new TextDecoder,S=c.getReader();let k=!0;do{const{done:y,value:w}=await S.read();w&&A(this,pe).feed(m.decode(w,{stream:!y})),y&&(k=!1,A(this,pe).reset(),ne(this,te,nt).call(this))}while(k)}),H(this,st,r=>{W(this,oe,void 0),!(r.name==="AbortError"||r.type==="aborted")&&ne(this,te,nt).call(this,et(r))}),H(this,rt,r=>{typeof r.id=="string"&&W(this,Ee,r.id);const n=new MessageEvent(r.event||"message",{data:r.data,origin:A(this,me)?A(this,me).origin:A(this,ue).origin,lastEventId:r.id||""});A(this,Le)&&(!r.event||r.event==="message")&&A(this,Le).call(this,n),this.dispatchEvent(n)}),H(this,it,r=>{W(this,Ae,r)}),H(this,ct,()=>{W(this,Me,void 0),A(this,K)===this.CONNECTING&&ne(this,te,tt).call(this)});try{if(e instanceof URL)W(this,ue,e);else if(typeof e=="string")W(this,ue,new URL(e,ja()));else throw new Error("Invalid URL")}catch{throw Sa("An invalid or illegal string was specified")}W(this,pe,Ca({onEvent:A(this,rt),onRetry:A(this,it)})),W(this,K,this.CONNECTING),W(this,Ae,3e3),W(this,We,(s=t==null?void 0:t.fetch)!=null?s:globalThis.fetch),W(this,ze,(a=t==null?void 0:t.withCredentials)!=null?a:!1),ne(this,te,tt).call(this)}get readyState(){return A(this,K)}get url(){return A(this,ue).href}get withCredentials(){return A(this,ze)}get onerror(){return A(this,ye)}set onerror(e){W(this,ye,e)}get onmessage(){return A(this,Le)}set onmessage(e){W(this,Le,e)}get onopen(){return A(this,ke)}set onopen(e){W(this,ke,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(){A(this,Me)&&clearTimeout(A(this,Me)),A(this,K)!==this.CLOSED&&(A(this,oe)&&A(this,oe).abort(),W(this,K,this.CLOSED),W(this,oe,void 0))}}K=new WeakMap,ue=new WeakMap,me=new WeakMap,ze=new WeakMap,We=new WeakMap,Ae=new WeakMap,Me=new WeakMap,Ee=new WeakMap,oe=new WeakMap,pe=new WeakMap,ye=new WeakMap,Le=new WeakMap,ke=new WeakMap,te=new WeakSet,tt=function(){W(this,K,this.CONNECTING),W(this,oe,new AbortController),A(this,We)(A(this,ue),ne(this,te,zt).call(this)).then(A(this,at)).catch(A(this,st))},at=new WeakMap,st=new WeakMap,zt=function(){var i;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...A(this,Ee)?{"Last-Event-ID":A(this,Ee)}:void 0},cache:"no-store",signal:(i=A(this,oe))==null?void 0:i.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},rt=new WeakMap,it=new WeakMap,Ie=function(i,e){var t;A(this,K)!==this.CLOSED&&W(this,K,this.CLOSED);const s=new Ot("error",{code:e,message:i});(t=A(this,ye))==null||t.call(this,s),this.dispatchEvent(s)},nt=function(i,e){var t;if(A(this,K)===this.CLOSED)return;W(this,K,this.CONNECTING);const s=new Ot("error",{code:e,message:i});(t=A(this,ye))==null||t.call(this,s),this.dispatchEvent(s),W(this,Me,setTimeout(A(this,ct),A(this,Ae)))},ct=new WeakMap,Qe.CONNECTING=0,Qe.OPEN=1,Qe.CLOSED=2;function ja(){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 le{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};return new Promise((s,a)=>{const r=["trackClick",t];t.key?this.msq().push(r,(function(n,c){JSON.stringify(n)===JSON.stringify(t)&&c?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,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:e.currentPage,shownHits:e.recordsPerPage,totalHits:e.totalResults,language:e.language};setTimeout(()=>{t.key&&this.msq().push(["trackRelatedSearchClick",t])},0)}static trackRelatedSearches(e){const t={session:e.session,key:e.trackApiKey,query:e.searchTerm,shownHits:e.recordsPerPage,latency:e.latencyVal,language:e.language,impressions:e.impressions};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,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}])},0)}}h(le,"subscribedToClickEvent",!1),h(le,"msq",()=>typeof window<"u"&&window!=null&&window._msq?window==null?void 0:window._msq:[]);class ba{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 n=r.name+":"+r.value,c=decodeURIComponent(n).replace(" "," ").split(":");a[c[0]]?a[c[0]].push(c[1]):a[c[0]]=[c[1]]});for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)){const n=a[r],c=r;let l="";for(const d of n)l+=` ${c}:"${d}"`;s=s.concat("fq="+l.trim())}}return s=s.map(a=>a.replace(/&/g,"%26").replace(/\+/g,"%2B")),s.length?"&"+s.join("&"):""}getRelatedSearches(e,t,s,a){const r=new Headers;r.append("Accept","application/json"),r.append("Authorization",s),fetch(t+"?search="+encodeURIComponent(e.query)+"&language="+this.dataLayer.language,{method:"GET",headers:r,credentials:"same-origin"}).then(n=>n.json()).then(n=>{a(n)})}cacheFacets(){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},this.cacheFacetsCallback.bind(this),!0))}cacheFacetsCallback(e){let t=Te.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,S)=>m.get(S)??""}),n=r.languageVariant?"&fq=_language:"+r.languageVariant:"";let c=e.itemsPerPage,l=(e.itemsPerPage?e.itemsPerPage:0)*(e.page-1),d=e.order?`&sort=${e.order}`:"";const L=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.generateFacetQuery(e.facets.filter(m=>m.type==="and"||m.type==="tabs"),!1)+d+`&spellcheck.correct=${this.dataLayer.autoCorrect&&!a}`+(c?`&rows=${c}`:"")+"&language="+this.dataLayer.language+n,g={method:"GET",headers:this.authHeader,credentials:"same-origin",signal:this.signalSearch};s&&delete g.signal,fetch(L,g).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=new Qe(this.dataLayer.questionURL+"?q="+e+"&language="+this.dataLayer.language+`&spellcheck.correct=${this.dataLayer.autoCorrect}`,{fetch:(r,n)=>fetch(r,{...n,headers:{...n==null?void 0:n.headers,Authorization:this._authToken}})}),a=this.dataLayer;s.onmessage=r=>{if(r.data===fe.question||r.data===fe.notQuestion){r.data===fe.question?(this.dataLayer.setAnswerLoading(!0),this.dataLayer.setIsQuestion(!0)):(a.setAnswerLoading(!1),this.dataLayer.setIsQuestion(!1)),a.setAnswerData("");return}if(r.data===fe.close){le.trackAnswerData({...a.parsedData.trackingData,answer:a.$answer.getValue(),isQuestion:this.dataLayer.isQuestion}),a.setAnswerLoading(!1),s.close();return}t(r.data)},s.onerror=()=>{a.setAnswerLoading(!1),s.close()}}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("&")}}/*!
37
37
  * mustache.js - Logic-less {{mustache}} templates with JavaScript
38
38
  * http://github.com/janl/mustache.js
39
- */var Ra=Object.prototype.toString,Se=Array.isArray||function(i){return Ra.call(i)==="[object Array]"};function lt(i){return typeof i=="function"}function Ea(i){return Se(i)?"array":typeof i}function Xe(i){return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function qt(i,e){return i!=null&&typeof i=="object"&&e in i}function Ia(i,e){return i!=null&&typeof i!="object"&&i.hasOwnProperty&&i.hasOwnProperty(e)}var Pa=RegExp.prototype.test;function ja(i,e){return Pa.call(i,e)}var Ma=/\S/;function Aa(i){return!ja(Ma,i)}var Fa={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function Oa(i){return String(i).replace(/[&<>"'`=\/]/g,function(e){return Fa[e]})}var Da=/\s*/,$a=/\s+/,Wt=/\s*=/,Na=/\s*\}/,qa=/#|\^|\/|>|\{|&|=|!/;function Wa(i,e){if(!i)return[];var t=!1,s=[],a=[],r=[],n=!1,c=!1,l="",d=0;function f(){if(n&&!c)for(;r.length;)delete a[r.pop()];else r=[];n=!1,c=!1}var g,p,w;function E(b){if(typeof b=="string"&&(b=b.split($a,2)),!Se(b)||b.length!==2)throw new Error("Invalid tags: "+b);g=new RegExp(Xe(b[0])+"\\s*"),p=new RegExp("\\s*"+Xe(b[1])),w=new RegExp("\\s*"+Xe("}"+b[1]))}E(e||A.tags);for(var x=new Ae(i),S,R,k,N,_,q;!x.eos();){if(S=x.pos,k=x.scanUntil(g),k)for(var J=0,v=k.length;J<v;++J)N=k.charAt(J),Aa(N)?(r.push(a.length),l+=N):(c=!0,t=!0,l+=" "),a.push(["text",N,S,S+1]),S+=1,N===`
40
- `&&(f(),l="",d=0,t=!1);if(!x.scan(g))break;if(n=!0,R=x.scan(qa)||"name",x.scan(Da),R==="="?(k=x.scanUntil(Wt),x.scan(Wt),x.scanUntil(p)):R==="{"?(k=x.scanUntil(w),x.scan(Na),x.scanUntil(p),R="&"):k=x.scanUntil(p),!x.scan(p))throw new Error("Unclosed tag at "+x.pos);if(R==">"?_=[R,k,S,x.pos,l,d,t]:_=[R,k,S,x.pos],d++,a.push(_),R==="#"||R==="^")s.push(_);else if(R==="/"){if(q=s.pop(),!q)throw new Error('Unopened section "'+k+'" at '+S);if(q[1]!==k)throw new Error('Unclosed section "'+q[1]+'" at '+S)}else R==="name"||R==="{"||R==="&"?c=!0:R==="="&&E(k)}if(f(),q=s.pop(),q)throw new Error('Unclosed section "'+q[1]+'" at '+x.pos);return Ha(_a(a))}function _a(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 Ha(i){for(var e=[],t=e,s=[],a,r,n=0,c=i.length;n<c;++n)switch(a=i[n],a[0]){case"#":case"^":t.push(a),s.push(a),t=a[4]=[];break;case"/":r=s.pop(),r[5]=a[2],t=s.length>0?s[s.length-1][4]:e;break;default:t.push(a)}return e}function Ae(i){this.string=i,this.tail=i,this.pos=0}Ae.prototype.eos=function(){return this.tail===""};Ae.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};Ae.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 be(i,e){this.view=i,this.cache={".":this.view},this.parent=e}be.prototype.push=function(i){return new be(i,this)};be.prototype.lookup=function(i){var e=this.cache,t;if(e.hasOwnProperty(i))t=e[i];else{for(var s=this,a,r,n,c=!1;s;){if(i.indexOf(".")>0)for(a=s.view,r=i.split("."),n=0;a!=null&&n<r.length;)n===r.length-1&&(c=qt(a,r[n])||Ia(a,r[n])),a=a[r[n++]];else a=s.view[i],c=qt(s.view,i);if(c){t=a;break}s=s.parent}e[i]=t}return lt(t)&&(t=t.call(this.view)),t};function z(){this.templateCache={_cache:{},set:function(i,e){this._cache[i]=e},get:function(i){return this._cache[i]},clear:function(){this._cache={}}}}z.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};z.prototype.parse=function(i,e){var t=this.templateCache,s=i+":"+(e||A.tags).join(":"),a=typeof t<"u",r=a?t.get(s):void 0;return r==null&&(r=Wa(i,e),a&&t.set(s,r)),r};z.prototype.render=function(i,e,t,s){var a=this.getConfigTags(s),r=this.parse(i,a),n=e instanceof be?e:new be(e,void 0);return this.renderTokens(r,n,t,i,s)};z.prototype.renderTokens=function(i,e,t,s,a){for(var r="",n,c,l,d=0,f=i.length;d<f;++d)l=void 0,n=i[d],c=n[0],c==="#"?l=this.renderSection(n,e,t,s,a):c==="^"?l=this.renderInverted(n,e,t,s,a):c===">"?l=this.renderPartial(n,e,t,a):c==="&"?l=this.unescapedValue(n,e):c==="name"?l=this.escapedValue(n,e,a):c==="text"&&(l=this.rawValue(n)),l!==void 0&&(r+=l);return r};z.prototype.renderSection=function(i,e,t,s,a){var r=this,n="",c=e.lookup(i[1]);function l(g){return r.render(g,e,t,a)}if(c){if(Se(c))for(var d=0,f=c.length;d<f;++d)n+=this.renderTokens(i[4],e.push(c[d]),t,s,a);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")n+=this.renderTokens(i[4],e.push(c),t,s,a);else if(lt(c)){if(typeof s!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(e.view,s.slice(i[3],i[5]),l),c!=null&&(n+=c)}else n+=this.renderTokens(i[4],e,t,s,a);return n}};z.prototype.renderInverted=function(i,e,t,s,a){var r=e.lookup(i[1]);if(!r||Se(r)&&r.length===0)return this.renderTokens(i[4],e,t,s,a)};z.prototype.indentPartial=function(i,e,t){for(var s=e.replace(/[^ \t]/g,""),a=i.split(`
39
+ */var Ta=Object.prototype.toString,we=Array.isArray||function(i){return Ta.call(i)==="[object Array]"};function lt(i){return typeof i=="function"}function ka(i){return we(i)?"array":typeof i}function Ze(i){return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Qt(i,e){return i!=null&&typeof i=="object"&&e in i}function Ia(i,e){return i!=null&&typeof i!="object"&&i.hasOwnProperty&&i.hasOwnProperty(e)}var Aa=RegExp.prototype.test;function Ea(i,e){return Aa.call(i,e)}var Da=/\S/;function Na(i){return!Ea(Da,i)}var Ra={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function Pa(i){return String(i).replace(/[&<>"'`=\/]/g,function(e){return Ra[e]})}var Oa=/\s*/,Fa=/\s+/,Wt=/\s*=/,za=/\s*\}/,Qa=/#|\^|\/|>|\{|&|=|!/;function Wa(i,e){if(!i)return[];var t=!1,s=[],a=[],r=[],n=!1,c=!1,l="",d=0;function L(){if(n&&!c)for(;r.length;)delete a[r.pop()];else r=[];n=!1,c=!1}var g,m,S;function k(v){if(typeof v=="string"&&(v=v.split(Fa,2)),!we(v)||v.length!==2)throw new Error("Invalid tags: "+v);g=new RegExp(Ze(v[0])+"\\s*"),m=new RegExp("\\s*"+Ze(v[1])),S=new RegExp("\\s*"+Ze("}"+v[1]))}k(e||N.tags);for(var y=new Ne(i),w,T,j,z,Y,Q;!y.eos();){if(w=y.pos,j=y.scanUntil(g),j)for(var _=0,f=j.length;_<f;++_)z=j.charAt(_),Na(z)?(r.push(a.length),l+=z):(c=!0,t=!0,l+=" "),a.push(["text",z,w,w+1]),w+=1,z===`
40
+ `&&(L(),l="",d=0,t=!1);if(!y.scan(g))break;if(n=!0,T=y.scan(Qa)||"name",y.scan(Oa),T==="="?(j=y.scanUntil(Wt),y.scan(Wt),y.scanUntil(m)):T==="{"?(j=y.scanUntil(S),y.scan(za),y.scanUntil(m),T="&"):j=y.scanUntil(m),!y.scan(m))throw new Error("Unclosed tag at "+y.pos);if(T==">"?Y=[T,j,w,y.pos,l,d,t]:Y=[T,j,w,y.pos],d++,a.push(Y),T==="#"||T==="^")s.push(Y);else if(T==="/"){if(Q=s.pop(),!Q)throw new Error('Unopened section "'+j+'" at '+w);if(Q[1]!==j)throw new Error('Unclosed section "'+Q[1]+'" at '+w)}else T==="name"||T==="{"||T==="&"?c=!0:T==="="&&k(j)}if(L(),Q=s.pop(),Q)throw new Error('Unclosed section "'+Q[1]+'" at '+y.pos);return $a(Ya(a))}function Ya(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 $a(i){for(var e=[],t=e,s=[],a,r,n=0,c=i.length;n<c;++n)switch(a=i[n],a[0]){case"#":case"^":t.push(a),s.push(a),t=a[4]=[];break;case"/":r=s.pop(),r[5]=a[2],t=s.length>0?s[s.length-1][4]:e;break;default:t.push(a)}return e}function Ne(i){this.string=i,this.tail=i,this.pos=0}Ne.prototype.eos=function(){return this.tail===""};Ne.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};Ne.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 ve(i,e){this.view=i,this.cache={".":this.view},this.parent=e}ve.prototype.push=function(i){return new ve(i,this)};ve.prototype.lookup=function(i){var e=this.cache,t;if(e.hasOwnProperty(i))t=e[i];else{for(var s=this,a,r,n,c=!1;s;){if(i.indexOf(".")>0)for(a=s.view,r=i.split("."),n=0;a!=null&&n<r.length;)n===r.length-1&&(c=Qt(a,r[n])||Ia(a,r[n])),a=a[r[n++]];else a=s.view[i],c=Qt(s.view,i);if(c){t=a;break}s=s.parent}e[i]=t}return lt(t)&&(t=t.call(this.view)),t};function U(){this.templateCache={_cache:{},set:function(i,e){this._cache[i]=e},get:function(i){return this._cache[i]},clear:function(){this._cache={}}}}U.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};U.prototype.parse=function(i,e){var t=this.templateCache,s=i+":"+(e||N.tags).join(":"),a=typeof t<"u",r=a?t.get(s):void 0;return r==null&&(r=Wa(i,e),a&&t.set(s,r)),r};U.prototype.render=function(i,e,t,s){var a=this.getConfigTags(s),r=this.parse(i,a),n=e instanceof ve?e:new ve(e,void 0);return this.renderTokens(r,n,t,i,s)};U.prototype.renderTokens=function(i,e,t,s,a){for(var r="",n,c,l,d=0,L=i.length;d<L;++d)l=void 0,n=i[d],c=n[0],c==="#"?l=this.renderSection(n,e,t,s,a):c==="^"?l=this.renderInverted(n,e,t,s,a):c===">"?l=this.renderPartial(n,e,t,a):c==="&"?l=this.unescapedValue(n,e):c==="name"?l=this.escapedValue(n,e,a):c==="text"&&(l=this.rawValue(n)),l!==void 0&&(r+=l);return r};U.prototype.renderSection=function(i,e,t,s,a){var r=this,n="",c=e.lookup(i[1]);function l(g){return r.render(g,e,t,a)}if(c){if(we(c))for(var d=0,L=c.length;d<L;++d)n+=this.renderTokens(i[4],e.push(c[d]),t,s,a);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")n+=this.renderTokens(i[4],e.push(c),t,s,a);else if(lt(c)){if(typeof s!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(e.view,s.slice(i[3],i[5]),l),c!=null&&(n+=c)}else n+=this.renderTokens(i[4],e,t,s,a);return n}};U.prototype.renderInverted=function(i,e,t,s,a){var r=e.lookup(i[1]);if(!r||we(r)&&r.length===0)return this.renderTokens(i[4],e,t,s,a)};U.prototype.indentPartial=function(i,e,t){for(var s=e.replace(/[^ \t]/g,""),a=i.split(`
41
41
  `),r=0;r<a.length;r++)a[r].length&&(r>0||!t)&&(a[r]=s+a[r]);return a.join(`
42
- `)};z.prototype.renderPartial=function(i,e,t,s){if(t){var a=this.getConfigTags(s),r=lt(t)?t(i[1]):t[i[1]];if(r!=null){var n=i[6],c=i[5],l=i[4],d=r;c==0&&l&&(d=this.indentPartial(r,l,n));var f=this.parse(d,a);return this.renderTokens(f,e,t,d,s)}}};z.prototype.unescapedValue=function(i,e){var t=e.lookup(i[1]);if(t!=null)return t};z.prototype.escapedValue=function(i,e,t){var s=this.getConfigEscape(t)||A.escape,a=e.lookup(i[1]);if(a!=null)return typeof a=="number"&&s===A.escape?String(a):s(a)};z.prototype.rawValue=function(i){return i[1]};z.prototype.getConfigTags=function(i){return Se(i)?i:i&&typeof i=="object"?i.tags:void 0};z.prototype.getConfigEscape=function(i){if(i&&typeof i=="object"&&!Se(i))return i.escape};var A={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(i){Me.templateCache=i},get templateCache(){return Me.templateCache}},Me=new z;A.clearCache=function(){return Me.clearCache()};A.parse=function(i,e){return Me.parse(i,e)};A.render=function(i,e,t,s){if(typeof i!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Ea(i)+'" was given as the first argument for mustache#render(template, view, partials)');return Me.render(i,e,t,s)};A.escape=Oa;A.Scanner=Ae;A.Context=be;A.Writer=z;const Ba={main:{template:`
42
+ `)};U.prototype.renderPartial=function(i,e,t,s){if(t){var a=this.getConfigTags(s),r=lt(t)?t(i[1]):t[i[1]];if(r!=null){var n=i[6],c=i[5],l=i[4],d=r;c==0&&l&&(d=this.indentPartial(r,l,n));var L=this.parse(d,a);return this.renderTokens(L,e,t,d,s)}}};U.prototype.unescapedValue=function(i,e){var t=e.lookup(i[1]);if(t!=null)return t};U.prototype.escapedValue=function(i,e,t){var s=this.getConfigEscape(t)||N.escape,a=e.lookup(i[1]);if(a!=null)return typeof a=="number"&&s===N.escape?String(a):s(a)};U.prototype.rawValue=function(i){return i[1]};U.prototype.getConfigTags=function(i){return we(i)?i:i&&typeof i=="object"?i.tags:void 0};U.prototype.getConfigEscape=function(i){if(i&&typeof i=="object"&&!we(i))return i.escape};var N={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){De.templateCache=i},get templateCache(){return De.templateCache}},De=new U;N.clearCache=function(){return De.clearCache()};N.parse=function(i,e){return De.parse(i,e)};N.render=function(i,e,t,s){if(typeof i!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+ka(i)+'" was given as the first argument for mustache#render(template, view, partials)');return De.render(i,e,t,s)};N.escape=Pa;N.Scanner=Ne;N.Context=ve;N.Writer=U;const Ja={main:{template:`
43
43
  {{#shouldShowAnswer}}
44
44
  <div>
45
45
  <div class="searchstax-answer-container {{#showMoreButtonVisible}}searchstax-answer-show-more{{/showMoreButtonVisible}}">
@@ -56,6 +56,7 @@ React keys must be passed directly to JSX without using spread:
56
56
  <div class="searchstax-answer-loading"></div>
57
57
  {{/answerLoading}}
58
58
  </div>
59
+ <div id="feedbackWidgetContainer"></div>
59
60
  </div>
60
61
 
61
62
 
@@ -66,7 +67,7 @@ React keys must be passed directly to JSX without using spread:
66
67
  {{/showMoreButtonVisible}}
67
68
  </div>
68
69
  {{/shouldShowAnswer}}
69
- `}},Va={mainTemplate:{template:`
70
+ `}},Ba={mainTemplate:{template:`
70
71
  {{#hasExternalPromotions}}
71
72
  <div class="searchstax-external-promotions-container" id="searchstax-external-promotions-container" data-test-id="searchstax-external-promotions-container">
72
73
  External promotions go here
@@ -92,7 +93,7 @@ React keys must be passed directly to JSX without using spread:
92
93
  </p>
93
94
  {{/url}}
94
95
  </div>
95
- `}},Ua={mainTemplateDesktop:{template:`
96
+ `}},Ha={mainTemplateDesktop:{template:`
96
97
  {{#hasResultsOrExternalPromotions}}
97
98
  <div class="searchstax-facets-container-desktop"></div>
98
99
  {{/hasResultsOrExternalPromotions}}
@@ -150,7 +151,7 @@ React keys must be passed directly to JSX without using spread:
150
151
  <div class="searchstax-facets-pill-label">{{value}} ({{count}})</div>
151
152
  <div class="searchstax-facets-pill-icon-close"></div>
152
153
  </div>
153
- `,containerClass:"searchstax-facets-pill-facets"}},Qa={mainTemplate:{template:`
154
+ `,containerClass:"searchstax-facets-pill-facets"}},qa={mainTemplate:{template:`
154
155
  {{#results.length}}
155
156
  <div class="searchstax-pagination-container" data-test-id="searchstax-pagination-container">
156
157
  <div class="searchstax-pagination-content">
@@ -168,7 +169,7 @@ React keys must be passed directly to JSX without using spread:
168
169
  <a class="searchstax-pagination-load-more" data-test-id="searchstax-pagination-load-more" tabindex="0">Show More</a>
169
170
  {{/isLastPage}}
170
171
  {{/results.length}}
171
- `,loadMoreButtonClass:"searchstax-pagination-load-more"}},Ka={main:{template:`
172
+ `,loadMoreButtonClass:"searchstax-pagination-load-more"}},Va={main:{template:`
172
173
  {{#hasRelatedSearches}}
173
174
  <div class="searchstax-related-searches-container" data-test-id="searchstax-related-searches-container" id="searchstax-related-searches-container">
174
175
  Related searches: <span id="searchstax-related-searches"></span>
@@ -183,7 +184,7 @@ React keys must be passed directly to JSX without using spread:
183
184
  <span class="searchstax-related-search searchstax-related-search-item" data-test-id="searchstax-related-search-item" aria-label="Related search: {{related_search}}" tabindex="0">
184
185
  {{ related_search }}{{^last}}<span>,</span>{{/last}}
185
186
  </span>
186
- `,relatedSearchContainerClass:"searchstax-related-search-item"}},za={main:{template:`
187
+ `,relatedSearchContainerClass:"searchstax-related-search-item"}},Ua={main:{template:`
187
188
  {{#searchExecuted}}
188
189
  <a href="#searchstax-search-results" data-test-id="searchstax-skip" class="searchstax-skip">Skip to results section</a>
189
190
  <h4 class="searchstax-feedback-container" data-test-id="searchstax-feedback-container">
@@ -197,7 +198,7 @@ React keys must be passed directly to JSX without using spread:
197
198
  {{/hasResults}}
198
199
  </h4>
199
200
  {{/searchExecuted}}
200
- `,originalQueryClass:"searchstax-feedback-original-query"}},Ja={mainTemplate:{template:`
201
+ `,originalQueryClass:"searchstax-feedback-original-query"}},_a={mainTemplate:{template:`
201
202
  <div class="searchstax-search-input-container" data-test-id="searchstax-search-input-container">
202
203
  <div class="searchstax-search-input-wrapper">
203
204
  <input type="text" id="searchstax-search-input" class="searchstax-search-input" placeholder="SEARCH FOR..." aria-label="Search" data-test-id="searchstax-search-input" />
@@ -206,7 +207,7 @@ React keys must be passed directly to JSX without using spread:
206
207
  </div>
207
208
  `,searchInputId:"searchstax-search-input"},autosuggestItemTemplate:{template:`
208
209
  <div class="searchstax-autosuggest-item-term-container">{{{term}}}</div>
209
- `}},Ya={mainTemplate:{template:`
210
+ `}},Ga={mainTemplate:{template:`
210
211
  <div class="searchstax-search-results-container" id="searchstax-search-results-container" data-test-id="searchstax-search-results-container">
211
212
  <div class="searchstax-search-results" id="searchstax-search-results"></div>
212
213
  </div>
@@ -272,7 +273,7 @@ React keys must be passed directly to JSX without using spread:
272
273
  </ul>
273
274
  </div>
274
275
  {{/searchExecuted}}
275
- `}},Ga={main:{template:`
276
+ `}},Ka={main:{template:`
276
277
  {{#searchExecuted}}
277
278
  {{#hasResultsOrExternalPromotions}}
278
279
  <div class="searchstax-sorting-container" data-test-id="searchstax-sorting-container">
@@ -287,4 +288,81 @@ React keys must be passed directly to JSX without using spread:
287
288
  </div>
288
289
  {{/hasResultsOrExternalPromotions}}
289
290
  {{/searchExecuted}}
290
- `,selectId:"searchstax-search-order-select"}};class L{}h(L,"answer",Ba),h(L,"externalPromotions",Va),h(L,"facets",Ua),h(L,"pagination",Qa),h(L,"relatedSearches",Ka),h(L,"searchFeedback",za),h(L,"searchInput",Ja),h(L,"searchResults",Ya),h(L,"sorting",Ga);class Xa{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)||L.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 n=typeof document<"u"?document==null?void 0:document.getElementById(this.externalPromotionsContainerId):null;if(n){const c=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.externalPromotion)==null?void 0:a.template)||((r=L.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",d=>{this.trackClick(e,d)}),l.innerHTML=A.render(c,e),n.appendChild(l)}}}trackClick(e,t){t.stopPropagation(),t.preventDefault(),window==null||window.open(e.url,"_blank")}renderMainTemplate(e){var t,s,a,r;const n=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.mainTemplate)==null?void 0:a.template)||((r=L.externalPromotions.mainTemplate)==null?void 0:r.template);if(this.dataLayer.renderingEngine===Q.mustache){this.searchExternalPromotionsMainContainer.innerHTML=A.render(n,e);const c=typeof document<"u"?document==null?void 0:document.getElementById(this.externalPromotionsContainerId):null;c&&(c.innerHTML="");for(const l of e.externalPromotions)this.addExternalSearch(l)}}}class ie{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 Za{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,"cachedData",null),h(this,"cacheFacets"),h(this,"onFacetSelect",(s,a,r,n,c)=>{if(s.stopPropagation(),!a.disabled){const l=r.querySelector("input");let d=n?l.checked:!l.checked;c!==void 0&&(d=!c),l.checked=d;const f=this.dataLayer.searchObject;let g=[...f.facets];const p=this.extractFacetValue(a);d?g.find(w=>ae.deepEqual(w,p)?w:!1)||(this.config.facetingType==="tabs"&&(g=g.filter(w=>w.name!==p.name)),g.push(p)):g=g.filter(w=>!ae.deepEqual(w,p)),setTimeout(()=>{this.dataLayer.setSearchObject({...f,facets:g,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 n=(r=this.dataLayer.searchFacets)==null?void 0:r.find(c=>c.name===a.name);return n?{...a,values:a.values.map(c=>{const l=n.values.find(d=>c.type==="range"?!1:c.type==="checkbox"?d.value===c.value:!1);return{...c,disabled:!l,isMobile:e}})}:{...a,values:a.values.map(c=>({...c,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,n,c,l,d,f,g,p,w,E,x;if(typeof document<"u"){const S=document==null?void 0:document.createElement("div");S.classList.add("searchstax-facet-container"),this.deactivatedFacets[e.name]||S.classList.add("active");const R=((n=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.facetItemContainerTemplate)==null?void 0:n.template)||((c=L.facets.facetItemContainerTemplate)==null?void 0:c.template);S.innerHTML=A.render(R,e),t.appendChild(S);const k=S.querySelector("."+(((f=(d=(l=this.config)==null?void 0:l.templates)==null?void 0:d.facetItemContainerTemplate)==null?void 0:f.facetListTitleContainerClass)||((g=L.facets.facetItemContainerTemplate)==null?void 0:g.facetListTitleContainerClass)));k==null||k.addEventListener("click",()=>{S.classList.toggle("active")});const N=S.querySelector("."+(((E=(w=(p=this.config)==null?void 0:p.templates)==null?void 0:w.facetItemContainerTemplate)==null?void 0:E.facetListContainerClass)||((x=L.facets.facetItemContainerTemplate)==null?void 0:x.facetListContainerClass)));N&&(e.values.forEach(_=>{this.createFacetListItem(_,N,e.name)}),e.hasMoreFacets&&this.createHasMoreComponent(e,N,s))}}isChecked(e){var t;return!!((t=this.dataLayer.searchObject.facets)!=null&&t.find(s=>ae.deepEqual(s,this.extractFacetValue(e))))}createFacetListItem(e,t,s){var a,r,n,c,l,d,f,g,p,w,E,x;if(typeof document<"u"){const S=document==null?void 0:document.createElement("div");S.classList.add("searchstax-facet-value-container"),e.disabled&&S.classList.add("searchstax-facet-value-disabled");const R=this.isChecked(e),k=((n=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.facetItemTemplate)==null?void 0:n.template)||((c=L.facets.facetItemTemplate)==null?void 0:c.template);S.innerHTML=A.render(k,{...e,isChecked:R});let N=(l=L.facets.facetItemTemplate)==null?void 0:l.checkTriggerClasses;N=((g=(f=(d=this.config)==null?void 0:d.templates)==null?void 0:f.facetItemTemplate)==null?void 0:g.checkTriggerClasses)||N,N.forEach(q=>{const J=S.querySelector("."+q);J==null||J.addEventListener("click",v=>{this.onFacetSelect(v,e,S)})});const _=S.querySelector("."+(((E=(w=(p=this.config)==null?void 0:p.templates)==null?void 0:w.facetItemTemplate)==null?void 0:E.inputCheckboxClass)||((x=L.facets.facetItemTemplate)==null?void 0:x.inputCheckboxClass)));_==null||_.addEventListener("click",q=>{this.onFacetSelect(q,e,S,!0)}),_&&(_==null||_.setAttribute("data-test-value",`${encodeURIComponent(s)}:&quot;${encodeURIComponent(e.value)}&quot;`)),t.appendChild(S)}}createHasMoreComponent(e,t,s){var a,r,n,c,l,d,f,g;if(typeof document<"u"){const p=document==null?void 0:document.createElement("div");p.classList.add("searchstax-facet-show-more-container");const w=((n=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.showMoreButtonContainerTemplate)==null?void 0:n.template)||((c=L.facets.showMoreButtonContainerTemplate)==null?void 0:c.template);p.innerHTML=A.render(w,e);const E=p.querySelector("."+(((f=(d=(l=this.config)==null?void 0:l.templates)==null?void 0:d.showMoreButtonContainerTemplate)==null?void 0:f.showMoreButtonClass)||((g=L.facets.showMoreButtonContainerTemplate)==null?void 0:g.showMoreButtonClass)));E&&(this.attachOnclickToShowMore(e,E,s),t&&t.appendChild(E))}}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?(ie.setAccessibilityText(`More Facets shown for ${t.label}`),r[t.name]=r[t.name]+a):(ie.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,n,c,l,d,f,g,p,w;if(e&&(!ae.deepEqual(this.cachedData??{},e)||t)){this.cachedData=e;const E=((r=(a=(s=this.config)==null?void 0:s.templates)==null?void 0:a.mainTemplateDesktop)==null?void 0:r.template)||((n=L.facets.mainTemplateDesktop)==null?void 0:n.template);if(this.dataLayer.renderingEngine===Q.mustache&&this.searchFacetsMainContainer){this.searchFacetsMainContainer.innerHTML=A.render(E,{...e});const x=(f=this.searchFacetsMainContainer)==null?void 0:f.querySelector("."+(((d=(l=(c=this.config)==null?void 0:c.templates)==null?void 0:l.mainTemplateDesktop)==null?void 0:d.facetsContainerClass)||L.facets.mainTemplateDesktop.facetsContainerClass));if(x){x.innerHTML="";for(const S of e.facets)this.createFacetItem(S,x);if(this.searchFacetsMainContainer){const S=this.searchFacetsMainContainer.querySelector("."+(((w=(p=(g=this.config)==null?void 0:g.templates)==null?void 0:p.mainTemplateDesktop)==null?void 0:w.selectedFacetsContainerClass)||L.facets.mainTemplateDesktop.selectedFacetsContainerClass));S&&(this.createSelectedFacetsComponents(S),this.createClearFacetsComponents(S))}}}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 n=this.needCache?this.dataLayer.searchFacetsCached:this.dataLayer.searchFacets,c=n==null?void 0:n.find(l=>l.name===a);if(c){const l=c.values.find(d=>d.type==="range"?!1:d.type==="checkbox"?`"${d.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,n,c,l,d;if(typeof document<"u"){const f=this.dataLayer.searchObject,g=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.clearFacetsTemplate)==null?void 0:a.template)||((r=L.facets.clearFacetsTemplate)==null?void 0:r.template),p=document==null?void 0:document.createElement("div");p.innerHTML=A.render(g,{shouldShow:f.facets.length>0});const w=p.querySelector("."+(((l=(c=(n=this.config)==null?void 0:n.templates)==null?void 0:c.clearFacetsTemplate)==null?void 0:l.containerClass)||((d=L.facets.clearFacetsTemplate)==null?void 0:d.containerClass)));w&&(w.addEventListener("click",()=>{this.removeSelectedFacets()}),w.addEventListener("keyup",E=>{(E.code==="Space"||E.code==="Enter")&&this.removeSelectedFacets()}),e.appendChild(w))}}createSelectedFacetsComponent(e,t){var s,a,r,n,c,l,d,f;if(typeof document<"u"){const g=((r=(a=(s=this.config)==null?void 0:s.templates)==null?void 0:a.selectedFacetsTemplate)==null?void 0:r.template)||((n=L.facets.selectedFacetsTemplate)==null?void 0:n.template),p=document==null?void 0:document.createElement("div");p.innerHTML=A.render(g,t);const w=p.querySelector("."+(((d=(l=(c=this.config)==null?void 0:c.templates)==null?void 0:l.selectedFacetsTemplate)==null?void 0:d.containerClass)||((f=L.facets.selectedFacetsTemplate)==null?void 0:f.containerClass)));w&&(w.addEventListener("click",()=>{this.unselectFacet(t)}),w.addEventListener("keyup",E=>{(E.code==="Space"||E.code==="Enter")&&this.unselectFacet(t)}),e.appendChild(w))}}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,n,c,l,d;if(typeof document<"u"){const f=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.filterByTemplate)==null?void 0:a.template)||((r=L.facets.filterByTemplate)==null?void 0:r.template),g=document==null?void 0:document.createElement("div");g.innerHTML=A.render(f,{});const p=g.querySelector("."+(((l=(c=(n=this.config)==null?void 0:n.templates)==null?void 0:c.filterByTemplate)==null?void 0:l.containerClass)||((d=L.facets.filterByTemplate)==null?void 0:d.containerClass)));p&&(e.prepend(p),p.addEventListener("click",this.openOverlay.bind(this)),p.addEventListener("keyup",w=>{(w.code==="Space"||w.code==="Enter")&&this.openOverlay()}))}}openOverlay(){var e;ie.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;ie.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,n,c,l,d,f,g,p,w,E,x,S,R,k,N,_;if(e&&typeof document<"u"){const q=document==null?void 0:document.createElement("div");q.classList.add("searchstax-facets-container-mobile");const J=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.mainTemplateMobile)==null?void 0:a.template)||((r=L.facets.mainTemplateMobile)==null?void 0:r.template);if(this.dataLayer.renderingEngine===Q.mustache){if(q.innerHTML=A.render(J,{...e,overlayOpened:this.overlayOpened}),(n=this.searchFacetsMainContainer)==null||n.appendChild(q),(l=(c=this.config)==null?void 0:c.templates)!=null&&l.mainTemplateMobile)for(const B of((g=(f=(d=this.config)==null?void 0:d.templates)==null?void 0:f.mainTemplateMobile)==null?void 0:g.closeOverlayTriggerClasses)||[]){const ee=q.querySelector("."+B);ee&&(ee.addEventListener("click",this.closeOverlay.bind(this)),ee.addEventListener("keyup",se=>{(se.code==="Space"||se.code==="Enter")&&this.closeOverlay()}))}else for(const B of L.facets.mainTemplateMobile.closeOverlayTriggerClasses){const ee=q.querySelector("."+B);ee&&(ee.addEventListener("click",this.closeOverlay.bind(this)),ee.addEventListener("keyup",se=>{(se.code==="Space"||se.code==="Enter")&&this.closeOverlay()}))}const v=q.querySelector("."+(((E=(w=(p=this.config)==null?void 0:p.templates)==null?void 0:w.mainTemplateMobile)==null?void 0:E.filterByContainerClass)||L.facets.mainTemplateMobile.filterByContainerClass));v&&this.createFilterByComponent(v);const b=q.querySelector("."+(((R=(S=(x=this.config)==null?void 0:x.templates)==null?void 0:S.mainTemplateMobile)==null?void 0:R.selectedFacetsContainerClass)||L.facets.mainTemplateMobile.selectedFacetsContainerClass));b&&(this.createSelectedFacetsComponents(b),this.createClearFacetsComponents(b));const F=q.querySelector("."+(((_=(N=(k=this.config)==null?void 0:k.templates)==null?void 0:N.mainTemplateMobile)==null?void 0:_.facetsContainerClass)||L.facets.mainTemplateMobile.facetsContainerClass));if(F){F.innerHTML="";for(const B of e.facets)this.createFacetItem(B,F,!0)}}}}}class es{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,n,c,l,d,f;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)??L.pagination.mainTemplate.previousButtonClass,this.nextButtonClass=((c=(n=(r=this.config)==null?void 0:r.templates)==null?void 0:n.mainTemplate)==null?void 0:c.nextButtonClass)??L.pagination.mainTemplate.nextButtonClass,this.loadMoreButtonClass=((f=(d=(l=this.config)==null?void 0:l.templates)==null?void 0:d.infiniteScrollTemplate)==null?void 0:f.loadMoreButtonClass)??L.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)}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,n,c,l,d,f,g;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=((n=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.mainTemplate)==null?void 0:n.template)||((c=L.pagination.mainTemplate)==null?void 0:c.template);this.dataLayer.isInfiniteScroll&&(p=((f=(d=(l=this.config)==null?void 0:l.templates)==null?void 0:d.infiniteScrollTemplate)==null?void 0:f.template)||((g=L.pagination.infiniteScrollTemplate)==null?void 0:g.template)),this.dataLayer.renderingEngine===Q.mustache&&(this.searchPaginationMainContainer.innerHTML=A.render(p,e),setTimeout(()=>{this.overridePaginationEvents()},0))}}class ts{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)||L.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,n,c;if(typeof document<"u"){const l=document==null?void 0:document.createElement("div"),d=((r=(a=(s=this.config)==null?void 0:s.templates)==null?void 0:a.relatedSearch)==null?void 0:r.template)||L.relatedSearches.relatedSearch.template;if(this.dataLayer.renderingEngine===Q.mustache){l.innerHTML=A.render(d,e);const f=l.querySelector("."+(((c=(n=this.config.templates)==null?void 0:n.relatedSearch)==null?void 0:c.relatedSearchContainerClass)||L.relatedSearches.relatedSearch.relatedSearchContainerClass));f&&(t.appendChild(f),f.addEventListener("click",()=>{this.executeSearch(e)}),f.addEventListener("keyup",g=>{(g.code==="Space"||g.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 n=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.main)==null?void 0:a.template)||L.relatedSearches.main.template;if(this.dataLayer.renderingEngine===Q.mustache&&this.searchRelatedSearchesMainContainer){this.searchRelatedSearchesMainContainer.innerHTML="",this.searchRelatedSearchesMainContainer.innerHTML=A.render(n,e);const c=(r=this.searchRelatedSearchesMainContainer)==null?void 0:r.querySelector(`.${this.relatedSearchesContainerClass}`);if(c)for(const l of e.relatedSearches)this.addRelatedSearchComponent(l,c)}}}class as{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 n=(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=L.searchFeedback.main)==null?void 0:a.originalQueryClass)));n&&n.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)||L.searchFeedback.main.template;this.dataLayer.renderingEngine===Q.mustache&&(this.searchFeedbackMainContainer.innerHTML=A.render(r,e),setTimeout(()=>{this.attachClick()},0))}}class ss{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.renderMainTemplate(),this.actionButtonInit(),this.updateActionButtonState("search"),this.searchInput&&(this.createAutosuggestContainer(),this.attachSubscriptions())}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 n=((t=(e=this.config.templates)==null?void 0:e.mainTemplate)==null?void 0:t.template)||L.searchInput.mainTemplate.template;if(this.dataLayer.renderingEngine===Q.mustache){const d=A.render(n,{});r.innerHTML=d}const c=((a=(s=this.config.templates)==null?void 0:s.mainTemplate)==null?void 0:a.searchInputId)||L.searchInput.mainTemplate.searchInputId,l=document==null?void 0:document.querySelector(`#${c}`);if(l)this.searchInput=l,l.addEventListener("keyup",this.inputKeyupEvent.bind(this)),l.addEventListener("blur",this.hideAutosuggest.bind(this)),l.addEventListener("paste",this.inputPasteEvent.bind(this));else throw new Error("Input not found")}}createAutosuggestContainer(){var e;this.dataLayer.renderingEngine===Q.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.buttonState==="search"?this.executeSearch(((e=this.searchInput)==null?void 0:e.value)??""):this.buttonState==="close"&&this.searchInput&&(this.searchInput.value="",this.executeSearch(""))}))}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(){var e;this.dataLayer.searchTerm===((e=this.searchInput)==null?void 0:e.value)&&this.searchInput.value!==""?this.updateActionButtonState("close"):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-close"),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;case"close":this.actionButton.classList.add("searchstax-search-close"),this.actionButton.setAttribute("aria-label","clear search");break}}selectPreviousAutosuggestItem(){this.selectedAutosuggestItem>0?this.selectedAutosuggestItem--:this.selectedAutosuggestItem=this.autosuggestResults.suggestions.length-1,this.markActiveAutosuggestItem()}selectNextAutosuggestItem(){this.selectedAutosuggestItem<this.autosuggestResults.suggestions.length-1?this.selectedAutosuggestItem++: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"),ie.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():t==="ArrowUp"?this.selectPreviousAutosuggestItem():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(){setTimeout(()=>{this.dataLayer.setAutosuggestResults({numFound:0,suggestions:[]}),this.autosuggestContainer&&(this.autosuggestContainer.innerHTML="",this.autosuggestContainer.classList.add("hidden")),this.resetAutosuggestSelection()},200)}cleanSuggestionTerm(e){return ce.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 n=((s=(t=this.config.templates)==null?void 0:t.autosuggestItemTemplate)==null?void 0:s.template)||((a=L.searchInput.autosuggestItemTemplate)==null?void 0:a.template);return r.innerHTML=A.render(n,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?ie.setAccessibilityText("Suggestions are available. Use up and down arrows to navigate while focusing input.",2e3):ie.setAccessibilityText("",0),this.autosuggestResults=r,this.dataLayer.setAutosuggestResults(r),r.numFound>0?r.suggestions.forEach(n=>{this.autosuggestContainer&&typeof document<"u"&&this.autosuggestContainer.appendChild(this.createAutosuggestItem(n))}):this.autosuggestContainer&&this.autosuggestContainer.classList.add("hidden")}}}}class rs{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(()=>{ie.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 n=((s=(t=(e=this.config)==null?void 0:e.templates)==null?void 0:t.noSearchResultTemplate)==null?void 0:s.template)||((a=L.searchResults.noSearchResultTemplate)==null?void 0:a.template),c=((r=this.dataLayer.searchResultsMetadata)==null?void 0:r.spellingSuggestion)??"";if(this.dataLayer.renderingEngine===Q.mustache&&this.searchResultsContainer&&(this.searchResultsContainer.innerHTML=A.render(n,{spellingSuggestion:c,...this.dataLayer.parsedData.data,searchCallback:this.searchCallback.bind(this)})),c&&this.searchResultsContainer){const l=this.searchResultsContainer.querySelector("a");l&&l.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation(),this.searchCallback(c)})}}renderResults(e){var t,s,a,r,n;if(this.dataLayer.renderingEngine===Q.mustache&&this.searchResultsContainer)if(this.removeLinkClickEvents(),e.length===0)ie.setAccessibilityText("Search has no results"),this.renderNoResultsTemplate();else{ie.setAccessibilityText(`Showing ${this.dataLayer.parsedData.startResultIndex} through ${this.dataLayer.parsedData.endResultIndex} results from ${this.dataLayer.parsedData.totalResults}. Press tab to navigate through results`);const c=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.searchResultTemplate)==null?void 0:a.template)||((r=L.searchResults.searchResultTemplate)==null?void 0:r.template),l=e.map(d=>A.render(c,d));((n=this.config)==null?void 0:n.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=L.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=L.searchResults.mainTemplate)==null?void 0:a.template);this.dataLayer.renderingEngine===Q.mustache&&(this.searchResultsMainContainer.innerHTML=A.render(r,{}),setTimeout(()=>{var n,c,l,d,f,g,p;const w=(l=(c=(n=this.config)==null?void 0:n.templates)==null?void 0:c.mainTemplate)!=null&&l.searchResultsContainerId?(g=(f=(d=this.config)==null?void 0:d.templates)==null?void 0:f.mainTemplate)==null?void 0:g.searchResultsContainerId:(p=L.searchResults.mainTemplate)==null?void 0:p.searchResultsContainerId,E=document==null?void 0:document.getElementById(w);if(E)this.searchResultsContainer=E;else throw new Error(`Search Results Container with id ${w} not found`)},0))}}class is{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)||L.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)||L.sorting.main.template;if(this.dataLayer.renderingEngine===Q.mustache){this.searchSortingMainContainer.innerHTML=A.render(r,e),this.markOptionSelected();const n=document==null?void 0:document.getElementById(this.selectId);n&&n.addEventListener("change",c=>{this.setOrderQuery(c.target.value)})}}}class ns{constructor(e){h(this,"dataLayer"),h(this,"config"),h(this,"containerId"),h(this,"answerContainer",null),h(this,"showMoreVisible",!1),h(this,"clicked",!1),this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,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.$searchObject.subscribe(()=>{this.clicked=!1}),this.dataLayer.$paginationData.subscribe(()=>{this.renderMainTemplate(this.generateTemplateData())})}showMore(e){e.preventDefault(),this.clicked=!0,this.showMoreVisible=!1,this.renderMainTemplate(this.generateTemplateData())}attachClickEventToShowMore(){const e=document.querySelector(".searchstax-answer-load-more-button");e&&e.addEventListener("click",this.showMore.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)||L.answer.main.template;this.dataLayer.renderingEngine===Q.mustache&&(this.answerContainer.innerHTML=A.render(r,e),this.attachClickEventToShowMore())}generateTemplateData(){const e={...this.dataLayer.parsedData.data,showMoreButtonVisible:this.showMoreVisible};return this.dataLayer.setAnswerFullData(e),e}}class cs{constructor(e=Q.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,"searchResultsWidget"),h(this,"searchFacetsWidget"),h(this,"searchPaginationWidget"),h(this,"searchFeedbackWidget"),h(this,"searchSortingWidget"),h(this,"relatedSearchesWidget"),h(this,"externalPromotionsWidget"),h(this,"answerWidget"),h(this,"dataLayer"),h(this,"firstRequest",!0),h(this,"previousQuery",""),h(this,"renderEngine",Q.mustache),e&&(this.renderEngine=e)}setRenderingEngine(e=Q.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)}),this.dataLayer.$searchObject.subscribe(s=>{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)),this.previousQuery=s.query}),this.dataLayer.$searchResults.subscribe(s=>{s&&this.dataLayer.searchResultsMetadata&&!this.dataLayer.cookiesDisabled&&le.trackSearch({...this.dataLayer.parsedData.trackingData,impressions:this.dataLayer.searchResultsMetadata.impressions})})}startSSE(e){var t;this.dataLayer.turnAIAnswerGenerationOn===!0&&this.dataLayer.questionURL&&((t=this.searchHelper)==null||t.startSSE(e,this.parseAnswerResultsResponse.bind(this)))}attachAnalyticsScript(e){le.attachAnalyticsScript(e)}initialize(e){var t,s;if(this.dataLayer=new ba("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),this.dataLayer.searchstaxConfig||(this.dataLayer.setSearchstaxConfig(e),this.searchHelper=new Ta({...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 Ft(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),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 Ft({})}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;const s=(((t=e.response)==null?void 0:t.docs)??[]).map((r,n)=>({...r,position:n+1})),a=[];for(const r of s)a.push({relatedSearch:r.related_search,position:r.position});this.dataLayer.searchResultsMetadata&&!this.dataLayer.cookiesDisabled&&le.trackRelatedSearches({...this.dataLayer.parsedData.trackingData,impressions:a}),this.dataLayer.setSearchRelatedSearches(s)}handleRouter(){if(this.routerEnabled){const e={...this.dataLayer.searchObject};this.dataLayer.isInfiniteScroll&&delete e.page,this.routerHelper.updateUrl(e)}}parseSearchResultsResponse(e){var t,s;this.handleRouter(),this.dataLayer.setItemsPerPage(parseInt(e.responseHeader.params.rows));let a=Re.combineResultsWithMetadata(e),r=Re.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??[]);const n=Re.extractSearchResultsMetadata(e);this.dataLayer.setSearchResultsMetadata(n),this.dataLayer.setSearchResults(a)}parseAnswerResultsResponse(e){this.handleRouter(),e!==ve.question&&e!==ve.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.setSearchInputConfig(t),this.searchInputWidget=new ss({containerId:e,config:t,searchTrigger:this.executeSearch.bind(this),suggestTrigger:this.executeSuggest.bind(this),dataLayer:this.dataLayer}))}addAnswerWidget(e,t){this.dataLayer.turnAIAnswerGenerationOn=!0,this.startSSE(this.dataLayer.searchObject.query),this.dataLayer.setAnswerData(""),this.answerWidget=new ns({containerId:e,config:t,dataLayer:this.dataLayer})}addSearchResultsWidget(e,t){this.searchResultsConfig||(this.searchResultsConfig=t,this.searchResultsWidget=new rs({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 es({containerId:e,config:t,dataLayer:this.dataLayer,routerHelper:this.routerHelper})}addSearchFeedbackWidget(e,t){this.searchFeedbackConfig=t,this.searchFeedbackWidget=new as({containerId:e,config:t,dataLayer:this.dataLayer,searchTrigger:this.executeSearch.bind(this)})}addSearchSortingWidget(e,t){this.searchSortingConfig=t,this.searchSortingWidget=new is({containerId:e,config:t,dataLayer:this.dataLayer})}addRelatedSearchesWidget(e,t){this.relatedSearchesConfig=t,this.relatedSearchesWidget=new ts({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 Xa({containerId:e,config:t,dataLayer:this.dataLayer})}addFacetsWidget(e,t){this.searchFacetsConfig=t,this.searchFacetsWidget=new Za({containerId:e,config:t,dataLayer:this.dataLayer,routerHelper:this.routerHelper},this.cacheFacets.bind(this))}executeSearch(e,t){var s,a;const r={...this.dataLayer.searchObject};r.query=ce.removeXSSRiskyTags(e),r.page=1,r.facets=[],this.dataLayer.forceNotCorrect=!!t;let n=(s=this.routerHelper)==null?void 0:s.searchObjectToParams(r);n&&(n=(a=this.routerHelper)==null?void 0:a.extractParamsThatDoNotStartWithRouteName(n)),n&&(r.additionalProps=Object.keys(n).map(c=>n?{key:c,value:n[c]}:{key:"",value:""})),this.dataLayer.setSearchObject(r),this.dataLayer.lastSearchValue=r.query}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){this.dataLayer.searchResultsMetadata&&this.dataLayer.searchRelatedSearches&&!this.dataLayer.cookiesDisabled&&le.trackRelatedSearchClick({...this.dataLayer.parsedData.trackingData,relatedSearch:e})}executeLinkClick(e){var t,s;let a=Re.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&&le.trackClick({result:a,...this.dataLayer.parsedData.trackingData}).then(()=>{typeof window<"u"&&(window.location.href=(a==null?void 0:a.url)??"")}).catch(()=>{}))}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 C={searchstax:new cs("react")};function os(i){let e=!1;const[t,s]=I.useState([]);I.useEffect(()=>{if(a(),C.searchstax){const l={};i.afterAutosuggest&&(l.afterAutosuggest=i.afterAutosuggest),i.beforeAutosuggest&&(l.beforeAutosuggest=i.beforeAutosuggest),C.searchstax.addSearchInputWidget("searchstax-input-container",{suggestAfterMinChars:i.suggestAfterMinChars,hooks:l,templates:{mainTemplate:{template:"",searchInputId:i.searchInputId??"searchstax-search-input"}}})}else throw Error("Searchstax instance needs to be passed via props")},[]);function a(){e||(C.searchstax.dataLayer.$autosuggestResults.subscribe(l=>{s((l==null?void 0:l.suggestions)??[])}),e=!0)}function r(){var l,d;(l=C.searchstax.searchInputWidget)==null||l.resetAutosuggestSelection(),(d=C.searchstax.searchInputWidget)==null||d.markActiveAutosuggestItem()}function n(l){var d;(d=C.searchstax.searchInputWidget)==null||d.onSuggestionEnter(l)}function c(){var l;(l=C.searchstax.searchInputWidget)==null||l.suggestionChosen()}return u.jsx(u.Fragment,{children:u.jsx("div",{id:"searchstax-input-container",children:u.jsxs("div",{className:"searchstax-search-input-container",children:[!i.inputTemplate&&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 ${t.length===0?"hidden":""}`,onMouseLeave:r,children:t.map(function(l){return u.jsx("div",{className:"searchstax-autosuggest-item",children:u.jsx("div",{className:"searchstax-autosuggest-item-term-container",tabIndex:0,dangerouslySetInnerHTML:{__html:l.term},onMouseOver:()=>{n(l)},onClick:()=>{c()}})},l.term)})}),u.jsx("button",{className:"searchstax-spinner-icon",id:"searchstax-search-input-action-button","aria-label":"search"})]}),i.inputTemplate&&u.jsx(u.Fragment,{children:i.inputTemplate(t,r,n,c)})]})})})}function ls(i){const[e,t]=I.useState(!1);return I.useEffect(()=>{const s={};i.beforeSearch&&(s.beforeSearch=i.beforeSearch),i!=null&&i.afterSearch&&(s.afterSearch=i.afterSearch),C.searchstax.initialize({language:i.language??"en",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(C.searchstax)},[i.initialized]),u.jsx(u.Fragment,{children:e&&u.jsxs(u.Fragment,{children:[" ",i.children," "]})})}function hs(i){const[e,t]=I.useState(null),s=I.useRef();s.current=e;const[a,r]=I.useState(""),[n,c]=I.useState(null),l=(g,p)=>{p.preventDefault(),p.stopPropagation(),C.searchstax.executeLinkClick(g.uniqueId)};I.useEffect(()=>{f();const g={};i.afterLinkClick&&(g.afterLinkClick=i.afterLinkClick),C.searchstax.addSearchResultsWidget("searchstax-results-container",{templates:{},renderMethod:i.renderMethod??"pagination",hooks:g})},[]);function d(g){C.searchstax.executeSearch(g)}function f(){C.searchstax.dataLayer.$searchResults.subscribe(g=>{var x;const p=s.current??[],w=g??[],E=i.renderMethod==="infiniteScroll"?[...p,...w]:g;((x=C.searchstax.dataLayer.$searchObject.value)==null?void 0:x.page)===1?t(w):t(E)}),C.searchstax.dataLayer.$searchTermChange.subscribe(g=>{r(g)}),C.searchstax.dataLayer.$searchResultsMetadata.subscribe(g=>{c(g)})}return u.jsx(u.Fragment,{children:u.jsx("div",{id:"searchstax-results-container",children:u.jsx("div",{className:"searchstax-search-results-container",children:u.jsxs("div",{id:"searchstax-result-container",children:[e&&e.length===0&&a!==""&&a!=="*"&&C.searchstax.dataLayer.parsedData.firstSearchHappened&&!i.noResultTemplate&&u.jsxs("div",{children:[u.jsxs("div",{className:"searchstax-no-results",children:[" ","Showing ",u.jsx("strong",{children:"no results"})," for"," ",u.jsxs("strong",{children:['"',a,'"']}),u.jsx("br",{}),(n==null?void 0:n.spellingSuggestion)&&u.jsxs("span",{children:[" Did you mean"," ",u.jsx("a",{href:"#",className:"searchstax-suggestion-term",onClick:()=>{d(n==null?void 0:n.spellingSuggestion)},children:n==null?void 0:n.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."})]})]}),e&&e.length===0&&a!==""&&a!=="*"&&C.searchstax.dataLayer.parsedData.firstSearchHappened&&i.noResultTemplate&&u.jsx(u.Fragment,{children:i.noResultTemplate(a,n,d)}),e&&e.length>0&&!i.resultsTemplate&&u.jsx("div",{className:"searchstax-search-results",children:e!==null&&e.map(function(g){return u.jsx("a",{href:g.url??"",onClick:p=>{l(g,p)},onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&l(g,p)},tabIndex:0,"data-searchstax-unique-result-id":g.uniqueId,className:"searchstax-result-item-link searchstax-result-item-link-wrapping",children:u.jsxs("div",{className:`searchstax-search-result ${g.thumbnail?"has-thumbnail":""}`,children:[g.promoted&&u.jsx("div",{className:"searchstax-search-result-promoted"}),g.ribbon&&u.jsx("div",{className:"searchstax-search-result-ribbon",dangerouslySetInnerHTML:{__html:g.ribbon}}),g.thumbnail&&u.jsx("img",{src:g.thumbnail,className:"searchstax-thumbnail"}),u.jsx("div",{className:"searchstax-search-result-title-container",children:u.jsx("span",{className:"searchstax-search-result-title",dangerouslySetInnerHTML:{__html:g.title??""}})}),g.paths&&u.jsx("p",{className:"searchstax-search-result-common",dangerouslySetInnerHTML:{__html:g.paths}}),g.description&&u.jsx("p",{className:"searchstax-search-result-description searchstax-search-result-common",dangerouslySetInnerHTML:{__html:g.description}}),g.unmappedFields.map(function(p){return u.jsxs("div",{children:[p.isImage&&typeof p.value=="string"&&u.jsx("div",{className:"searchstax-search-result-image-container",children:u.jsx("img",{src:p.value,className:"searchstax-result-image"})}),!p.isImage&&u.jsx("div",{children:u.jsx("p",{className:"searchstax-search-result-common",dangerouslySetInnerHTML:{__html:p.value}})})]},p.key)})]},g.uniqueId)},g.uniqueId)})}),e&&e.length>0&&i.resultsTemplate&&u.jsx(u.Fragment,{children:i.resultsTemplate(e,l)})]})})})})}function us(i){let e=!1;const[t,s]=I.useState(!1),[a,r]=I.useState(null),[n]=I.useState(Math.random());I.useEffect(()=>{if(c(),C.searchstax)C.searchstax.addPaginationWidget("searchstax-pagination-container"+n,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function c(){e||(C.searchstax.dataLayer.$searchObject.subscribe(()=>{l()}),C.searchstax.dataLayer.$paginationData.subscribe(g=>{r(g)}),e=!0)}function l(){!t&&C.searchstax.routerHelper&&(s(!0),C.searchstax.addPaginationWidget("searchstax-pagination-container"+n,{}))}function d(g){var p;(p=C.searchstax.searchPaginationWidget)==null||p.nextPage(g)}function f(g){var p;(p=C.searchstax.searchPaginationWidget)==null||p.previousPage(g)}return u.jsx(u.Fragment,{children:u.jsxs("div",{id:"searchstax-pagination-container"+n,children:[!i.paginationTemplate&&a&&!a.isInfiniteScroll&&(a==null?void 0:a.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 ${a.isFirstPage?"disabled":""}`,style:a!=null&&a.isFirstPage?{pointerEvents:"none"}:{},onClick:g=>{f(g)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&f(g)},tabIndex:0,id:"searchstax-pagination-previous",children:[" ","< Previous"," "]}),u.jsxs("div",{className:"searchstax-pagination-details",children:[" ",a==null?void 0:a.startResultIndex," -"," ",a==null?void 0:a.endResultIndex," of"," ",a==null?void 0:a.totalResults]}),u.jsx("a",{className:`searchstax-pagination-next ${a.isLastPage?"disabled":""}`,tabIndex:0,style:a!=null&&a.isLastPage?{pointerEvents:"none"}:{},onClick:g=>{d(g)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&d(g)},id:"searchstax-pagination-next",children:"Next >"})]})}),i.paginationTemplate&&a&&!a.isInfiniteScroll&&u.jsx(u.Fragment,{children:i.paginationTemplate(a,d,f)}),!i.infiniteScrollTemplate&&a&&a.isInfiniteScroll&&(a==null?void 0:a.totalResults)!==0&&!(a!=null&&a.isLastPage)&&u.jsx("div",{className:"searchstax-pagination-container",children:u.jsx("a",{className:"searchstax-pagination-load-more",tabIndex:0,onClick:g=>{d(g)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&d(g)},children:"Show More"})}),i.infiniteScrollTemplate&&a&&a.isInfiniteScroll&&(a==null?void 0:a.totalResults)!==0&&!(a!=null&&a.isLastPage)&&u.jsx(u.Fragment,{children:i.infiniteScrollTemplate(a,d)})]})})}function ds(i){let e=!1;const[t,s]=I.useState(null),[a,r]=I.useState(""),[n]=I.useState(Math.random());I.useEffect(()=>{if(c(),C.searchstax)C.searchstax.addSearchSortingWidget("search-sorting-container"+n,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function c(){e||(C.searchstax.dataLayer.$searchSortingData.subscribe(d=>{s(d)}),C.searchstax.dataLayer.$searchObject.subscribe(d=>{r(decodeURIComponent((d==null?void 0:d.order)??""))}),e=!0)}function l(d){var f;(f=C.searchstax.searchSortingWidget)==null||f.setOrderQuery(d)}return u.jsx(u.Fragment,{children:u.jsxs("div",{id:"search-sorting-container"+n,children:[!i.searchSortingTemplate&&t&&(t==null?void 0:t.searchExecuted)&&(t==null?void 0:t.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:a,onChange:d=>{l(d.target.value)},children:t.sortOptions.map(function(d){return u.jsx("option",{value:d.key,children:d.value},d.key)})})]}),i.searchSortingTemplate&&u.jsx(u.Fragment,{children:i.searchSortingTemplate(t,l,a)})]})})}function gs(i){let e=!1;const[t,s]=I.useState(null),[a]=I.useState(Math.random());I.useEffect(()=>{if(r(),C.searchstax)C.searchstax.addSearchFeedbackWidget("search-feedback-container"+a,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function r(){e||(C.searchstax.dataLayer.$searchFeedbackData.subscribe(c=>{s(c)}),e=!0)}function n(c){var l;(l=C.searchstax.searchFeedbackWidget)==null||l.onOriginalQueryClick(c)}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.jsxs(u.Fragment,{children:["Showing"," ",u.jsxs("b",{children:[t.startResultIndex," - ",t.endResultIndex]})," ","of",u.jsxs("b",{children:[" ",t.totalResults]})," results",t.searchTerm&&u.jsxs("span",{children:[' for "',u.jsx("b",{children:t.searchTerm}),'"'," "]}),u.jsx("div",{className:"searchstax-feedback-container-suggested",children:t.autoCorrectedQuery&&u.jsxs("div",{children:[" ","Search instead for"," ",u.jsx("a",{href:"#",onClick:c=>{n(c)},className:"searchstax-feedback-original-query",children:t.originalQuery})]})})]}),i.searchOverviewTemplate&&u.jsx(u.Fragment,{children:i.searchOverviewTemplate(t,n)})]})})}function ps(i){const[e,t]=I.useState(null),[s,a]=I.useState(null),[r,n]=I.useState([]),[c,l]=I.useState({}),d={},f=Math.random();let g=!1;I.useEffect(()=>{if(p(),C.searchstax)C.searchstax.addFacetsWidget("searchstax-facets-container"+f,{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(){g||(C.searchstax.dataLayer.$facetsTemplateData.subscribe(v=>{v!=null&&v.isMobile?a(v):t(v)}),C.searchstax.dataLayer.$selectedFacetsTemplateData.subscribe(v=>{n((v??[]).filter(F=>F.type==="checkbox"))}),g=!0)}function w(v){var b;(b=C.searchstax.searchFacetsWidget)==null||b.unselectFacet(v)}function E(){var v;(v=C.searchstax.searchFacetsWidget)==null||v.removeSelectedFacets()}function x(v){return!c[v]}function S(v){x(v)?l({...c,[v]:!0}):l({...c,[v]:!1})}function R(v){var b;return(b=C.searchstax.searchFacetsWidget)==null?void 0:b.isChecked(v)}function k(v,b,F,B,ee){var re;const se=ee?"mobile-":"desktop-",X=document.getElementsByClassName(se+v);X[0]&&((re=C.searchstax.searchFacetsWidget)==null||re.onFacetSelect(b,F,X[0],!1,R(F)))}function N(v,b){var F;(F=C.searchstax.searchFacetsWidget)==null||F.onShowMoreLessClick(v,b,!1)}function _(v,b){var F;(F=C.searchstax.searchFacetsWidget)==null||F.onShowMoreLessClick(v,b,!0)}function q(){var v;(v=C.searchstax.searchFacetsWidget)==null||v.openOverlay()}function J(){var v;(v=C.searchstax.searchFacetsWidget)==null||v.closeOverlay()}return u.jsx(u.Fragment,{children:u.jsxs("div",{id:"searchstax-facets-container"+f,children:[(e==null?void 0:e.hasResultsOrExternalPromotions)&&!i.facetsTemplateDesktop&&u.jsx("div",{className:"searchstax-facets-container-desktop",children:e==null?void 0:e.facets.map(v=>u.jsx("div",{className:`searchstax-facet-container ${x(v.name)?"active":""}`,children:u.jsxs("div",{children:[u.jsxs("div",{className:"searchstax-facet-title-container",onClick:()=>{S(v.name)},children:[u.jsxs("div",{className:"searchstax-facet-title",children:[" ",v.label," "]}),u.jsx("div",{className:"searchstax-facet-title-arrow active"})]}),u.jsxs("div",{className:"searchstax-facet-values-container",children:[v.values.map((b,F)=>(d[F+v.name]=I.createRef(),u.jsxs("div",{className:`searchstax-facet-value-container ${b.disabled?"searchstax-facet-value-disabled":""}`,ref:d[F+v.name],children:[u.jsx("div",{className:"searchstax-facet-input desktop-"+F+v.name,children:u.jsx("input",{type:"checkbox",className:"searchstax-facet-input-checkbox",checked:R(b),"aria-label":b.value+" "+b.count,readOnly:!0,disabled:b.disabled,onClick:B=>{k(F+v.name,B,b)}})}),u.jsx("div",{className:"searchstax-facet-value-label",onClick:B=>{k(F+v.name,B,b)},children:b.value}),u.jsxs("div",{className:"searchstax-facet-value-count",onClick:B=>{k(F+v.name,B,b)},children:["(",b.count,")"]})]},b.value+b.parentName))),v.hasMoreFacets&&u.jsx("div",{className:"searchstax-facet-show-more-container",children:u.jsxs("div",{className:"searchstax-facet-show-more-container",onClick:b=>{N(b,v)},onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&N(b,v)},children:[v.showingAllFacets&&u.jsx("div",{className:"searchstax-facet-show-less-button searchstax-facet-show-button",children:"less"}),!v.showingAllFacets&&u.jsx("div",{className:"searchstax-facet-show-more-button searchstax-facet-show-button",children:"more"})]})})]})]})},v.name+"desktop"))}),i.facetsTemplateDesktop&&u.jsx(u.Fragment,{children:i.facetsTemplateDesktop(e,d,x,S,k,R,N)}),(s==null?void 0:s.hasResultsOrExternalPromotions)&&!i.facetsTemplateMobile&&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:()=>{q()},children:u.jsx("div",{className:"searchstax-facets-pill-label",children:"Filter By"})}),u.jsxs("div",{className:"searchstax-facets-pills-selected",children:[r.map(v=>u.jsxs("div",{className:"searchstax-facets-pill searchstax-facets-pill-facets",onClick:()=>{w(v)},children:[u.jsxs("div",{className:"searchstax-facets-pill-label",children:[v.value," (",v.count,")"]}),u.jsx("div",{className:"searchstax-facets-pill-icon-close"})]},v.value)),r.length!==0&&u.jsx("div",{className:"searchstax-facets-pill searchstax-clear-filters searchstax-facets-pill-clear-all",onClick:()=>{E()},children:u.jsx("div",{className:"searchstax-facets-pill-label",children:"Clear Filters"})})]}),u.jsxs("div",{className:`searchstax-facets-mobile-overlay ${s.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:()=>{J()}})]}),u.jsx("div",{className:"searchstax-facets-container-mobile",children:s==null?void 0:s.facets.map(v=>u.jsx("div",{className:`searchstax-facet-container ${x(v.name)?"active":""}`,children:u.jsxs("div",{children:[u.jsxs("div",{className:"searchstax-facet-title-container",onClick:()=>{S(v.name)},children:[u.jsxs("div",{className:"searchstax-facet-title",children:[" ",v.label," "]}),u.jsx("div",{className:"searchstax-facet-title-arrow active"})]}),u.jsxs("div",{className:"searchstax-facet-values-container",children:[v.values.map((b,F)=>(d[F+v.name]=I.createRef(),u.jsxs("div",{className:`searchstax-facet-value-container ${b.disabled?"searchstax-facet-value-disabled":""}`,ref:d[F+v.name],children:[u.jsx("div",{className:"searchstax-facet-input mobile-"+F+v.name,children:u.jsx("input",{type:"checkbox",className:"searchstax-facet-input-checkbox",checked:R(b),"aria-label":b.value+" "+b.count,readOnly:!0,disabled:b.disabled,onClick:B=>{k(F+v.name,B,b,!0,!0)}})}),u.jsx("div",{className:"searchstax-facet-value-label",onClick:B=>{k(F+v.name,B,b)},children:b.value}),u.jsxs("div",{className:"searchstax-facet-value-count",onClick:B=>{k(F+v.name,B,b)},children:["(",b.count,")"]})]},b.value+b.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:b=>{_(b,v)},onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&_(b,v)},tabIndex:0,children:[v.showingAllFacets&&u.jsx("div",{className:"searchstax-facet-show-less-button searchstax-facet-show-button",children:"less"}),!v.showingAllFacets&&u.jsx("div",{className:"searchstax-facet-show-more-button searchstax-facet-show-button",children:"more"})]})})]})]})},v.name+"mobile"))}),u.jsx("button",{className:"searchstax-facets-mobile-overlay-done",onClick:()=>{J()},children:"Done"})]})]})}),i.facetsTemplateMobile&&u.jsx(u.Fragment,{children:i.facetsTemplateMobile(s,r,d,x,S,k,R,w,_,q,J,E)})]})})}function ms(i){let e=!1;const[t,s]=I.useState(null),[a]=I.useState(Math.random());I.useEffect(()=>{if(r(),C.searchstax)C.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||(C.searchstax.dataLayer.$searchRelatedSearchesData.subscribe(c=>{s(c)}),e=!0)}function n(c){var l;(l=C.searchstax.relatedSearchesWidget)==null||l.executeSearch(c)}return u.jsxs(u.Fragment,{children:[!i.searchRelatedSearchesTemplate&&t&&(t==null?void 0:t.searchExecuted)&&(t==null?void 0:t.hasRelatedSearches)&&u.jsxs("div",{className:"searchstax-related-searches-container",id:"searchstax-related-searches-container",children:[" ","Related searches: ",u.jsx("span",{id:"searchstax-related-searches"}),t.relatedSearches&&u.jsx("span",{className:"searchstax-related-search",children:t.relatedSearches.map(c=>u.jsxs("span",{onClick:()=>{n(c)},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&n(c)},tabIndex:0,className:"searchstax-related-search searchstax-related-search-item",children:[" ",c.related_search,!c.last&&u.jsx("span",{children:","})]},c.related_search))})]}),i.searchRelatedSearchesTemplate&&u.jsx(u.Fragment,{children:i.searchRelatedSearchesTemplate(t,n)})]})}function fs(i){let e=!1;const[t,s]=I.useState(null),[a]=I.useState(Math.random());I.useEffect(()=>{if(r(),C.searchstax)C.searchstax.addExternalPromotionsWidget("searchstax-external-promotions-layout-container"+a,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function r(){e||(C.searchstax.dataLayer.$searchExternalPromotionsData.subscribe(c=>{s(c)}),e=!0)}function n(c,l){var d;(d=C.searchstax.externalPromotionsWidget)==null||d.trackClick(c,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:t.externalPromotions.map(c=>u.jsxs("div",{className:"searchstax-external-promotion searchstax-search-result",children:[u.jsx("div",{className:"icon-elevated"}),c.url&&u.jsx("a",{href:c.url,onClick:l=>{n(c,l)},className:"searchstax-result-item-link"}),u.jsx("div",{className:"searchstax-search-result-title-container",children:u.jsx("span",{className:"searchstax-search-result-title",children:c.name})}),c.description&&u.jsxs("p",{className:"searchstax-search-result-description searchstax-search-result-common",children:[" ",c.description," "]}),c.url&&u.jsxs("p",{className:"searchstax-search-result-description searchstax-search-result-common",children:[" ",c.url," "]})]},c.id))}),i.searchExternalPromotionsTemplate&&u.jsx(u.Fragment,{children:i.searchExternalPromotionsTemplate(t,n)})]})})}function vs(i){let e=!1;const[t,s]=I.useState(null),[a]=I.useState(Math.random());I.useEffect(()=>{if(n(),C.searchstax)C.searchstax.addAnswerWidget("searchstax-answer-container"+a,{showShowMoreAfterWordCount:i.showShowMoreAfterWordCount});else throw Error("Searchstax instance needs to be passed via props")},[]);function r(c){var l;C.searchstax&&((l=C.searchstax.answerWidget)==null||l.showMore(c))}function n(){e||(C.searchstax.dataLayer.$answerData.subscribe(c=>{s(c)}),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.jsxs("div",{children:[u.jsxs("div",{className:"searchstax-answer-container"+(t.showMoreButtonVisible===!0?"searchstax-answer-show-more":""),children:[u.jsx("div",{className:"searchstax-answer-title",children:"Answer"}),u.jsxs("div",{className:"searchstax-answer-description",children:[t.showMoreButtonVisible===!0?t.answerTruncated:t.answer,t.answerLoading&&u.jsx("div",{className:"searchstax-answer-loading"})]})]}),t.showMoreButtonVisible===!0&&u.jsx("div",{className:"searchstax-answer-load-more-button-container",children:u.jsx("button",{className:"searchstax-answer-load-more-button",onClick:c=>{r(c)},children:"Show More..."})})]}),i.searchAnswerTemplate&&t&&t.shouldShowAnswer&&u.jsx(u.Fragment,{children:i.searchAnswerTemplate(t,r)})]})})}exports.SearchstaxAnswerWidget=vs;exports.SearchstaxExternalPromotionsWidget=fs;exports.SearchstaxFacetsWidget=ps;exports.SearchstaxInputWidget=os;exports.SearchstaxOverviewWidget=gs;exports.SearchstaxPaginationWidget=us;exports.SearchstaxRelatedSearchesWidget=ms;exports.SearchstaxResultWidget=hs;exports.SearchstaxSortingWidget=ds;exports.SearchstaxWrapper=ls;
291
+ `,selectId:"searchstax-search-order-select"}},Za={mainTemplate:{template:`
292
+ <div class="sf-widget-container">
293
+ <div id="sf-widget" class="sf-main">
294
+ <a href="#" id="searchstax-open-feedback" class="sf-open-feedback" tabindex="0" aria-label="Open Search Feedback">[ - ] Search Feedback</a>
295
+ <div class="sf-modal-content {{#feedbackOpen}}sf-open{{/feedbackOpen}}{{^feedbackOpen}}sf-close{{/feedbackOpen}}">
296
+ <div class="sf-modal-header">
297
+ <h2 class="sf-title">Search Feedback</h2>
298
+ <button class="sf-modal-close" aria-label="Close Search Feedback">
299
+ <span>
300
+ <img alt="" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGlkPSJDYXBhXzEiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDM4Ni42NjcgMzg2LjY2NyIgaGVpZ2h0PSI1MTIiIHZpZXdCb3g9IjAgMCAzODYuNjY3IDM4Ni42NjciIHdpZHRoPSI1MTIiIGNsYXNzPSIiPjxnPjxwYXRoIGQ9Im0zODYuNjY3IDQ1LjU2NC00NS41NjQtNDUuNTY0LTE0Ny43NyAxNDcuNzY5LTE0Ny43NjktMTQ3Ljc2OS00NS41NjQgNDUuNTY0IDE0Ny43NjkgMTQ3Ljc2OS0xNDcuNzY5IDE0Ny43NyA0NS41NjQgNDUuNTY0IDE0Ny43NjktMTQ3Ljc2OSAxNDcuNzY5IDE0Ny43NjkgNDUuNTY0LTQ1LjU2NC0xNDcuNzY4LTE0Ny43N3oiIGRhdGEtb3JpZ2luYWw9IiMwMDAwMDAiIGNsYXNzPSJhY3RpdmUtcGF0aCIgc3R5bGU9ImZpbGw6I2Q2MzIwMiIgZGF0YS1vbGRfY29sb3I9IiMwMDAwMDAiPjwvcGF0aD48L2c+IDwvc3ZnPg==" />
301
+ </span>
302
+ </button>
303
+ </div>
304
+ <form id="sf-rating-form">
305
+ <div class="sf-modal-body">
306
+ <div class="form-group">
307
+ <fieldset class="form-group">
308
+ <legend>How would you rate your search experience?</legend>
309
+ <div class="sf-rate-experience">
310
+ {{#ratings}}
311
+ <div class="sf-custom-control">
312
+ <input type="radio" id="sf-rate-{{index}}" tabindex="0" name="sf-rating" class="sf-custom-control-input" value="{{index}}" {{#isSelected}}checked{{/isSelected}}>
313
+ <label for="sf-rate-{{index}}" class="sf-custom-control-label">{{index}}</label>
314
+ </div>
315
+ {{/ratings}}
316
+ </div>
317
+ </fieldset>
318
+ <div class="sf-rate">
319
+ <p><small>0 = Very Dissatisfied</small></p>
320
+ <p><small>10 = Very Satisfied</small></p>
321
+ </div>
322
+ <div class="sf-error-rating alert alert-danger {{#errors.rating}}sf-show{{/errors.rating}}{{^errors.rating}}sf-hide{{/errors.rating}}">
323
+ Please Rate your experience.
324
+ </div>
325
+ </div>
326
+ <div class="sf-comments sf-form-group">
327
+ <label for="sf-comments">Comments <small> (<span class="searchstax-characters-remaining-container">2000</span> characters remaining)</small></label>
328
+ <textarea maxlength="{{maxLength}}" class="sf-form-control" id="sf-comments" placeholder="Enter any comments relating to your search experience">{{feedbackTextArea}}</textarea>
329
+ </div>
330
+ <div class="sf-email sf-form-group">
331
+ <label for="sf-email">Email</label>
332
+ <input class="sf-form-control" type="email" id="sf-email" placeholder="Enter an email address if you want a response" value="{{emailInput}}">
333
+ <div class="sf-error-email alert alert-danger {{#errors.email}}sf-show{{/errors.email}}{{^errors.email}}sf-hide{{/errors.email}}">
334
+ Please enter a valid email id
335
+ </div>
336
+ </div>
337
+ </div>
338
+ <div class="sf-modal-footer">
339
+ <a href="http://searchstax.com/" target="_blank" class="left">
340
+ <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">
341
+ </a>
342
+ {{#submitted}}
343
+ <span class="sf-btn sf-btn-sent sf-btn-success">&check; Sent</span>
344
+ {{/submitted}}
345
+ {{^submitted}}
346
+ <button class="sf-btn sf-btn-primary js-send-feedback" type="button" tabindex="0">Send</button>
347
+ {{/submitted}}
348
+ </div>
349
+ </form>
350
+ </div>
351
+ </div>
352
+ <div class="sf-widget-container">
353
+ `,openModalButtonClass:"sf-open-feedback",closeModalButtonClass:"sf-modal-close",submitButtonClass:"js-send-feedback",emailInputId:"sf-email",feedbackTextAreaId:"sf-comments",ratingInputclass:"sf-custom-control-input",charactersRemainingContainerclass:"searchstax-characters-remaining-container"},lightweightTemplate:{template:`
354
+ <div class="searchstax-lightweight-widget-container">
355
+ <div class="searchstax-lightweight-widget-thumbs-up {{#thumbsUpActive}}active{{/thumbsUpActive}}">
356
+ <svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
357
+ <path d="M4.85079 7.59996L7.83141 1C8.4243 1 8.9929 1.23178 9.41213 1.64436C9.83136 2.05694 10.0669 2.61651 10.0669 3.19999V6.1333H14.2845C14.5005 6.13089 14.7145 6.17474 14.9116 6.26179C15.1087 6.34885 15.2842 6.47704 15.426 6.63747C15.5677 6.79791 15.6723 6.98676 15.7326 7.19094C15.7928 7.39513 15.8072 7.60975 15.7748 7.81996L14.7465 14.4199C14.6926 14.7696 14.5121 15.0884 14.2382 15.3175C13.9643 15.5466 13.6156 15.6706 13.2562 15.6666H4.85079M4.85079 7.59996V15.6666M4.85079 7.59996H2.61531C2.22006 7.59996 1.84099 7.75448 1.5615 8.02953C1.28201 8.30458 1.125 8.67763 1.125 9.06661V14.1999C1.125 14.5889 1.28201 14.9619 1.5615 15.237C1.84099 15.512 2.22006 15.6666 2.61531 15.6666H4.85079" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
358
+ </svg>
359
+ </div>
360
+ <div class="searchstax-lightweight-widget-separator"></div>
361
+ <div class="searchstax-lightweight-widget-thumbs-down {{#thumbsDownActive}}active{{/thumbsDownActive}}">
362
+ <svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
363
+ <path d="M12.1492 9.06801L9.16859 15.668C8.5757 15.668 8.0071 15.4362 7.58787 15.0236C7.16864 14.611 6.93311 14.0515 6.93311 13.468V10.5347H2.71552C2.4995 10.5371 2.28552 10.4932 2.08842 10.4062C1.89132 10.3191 1.71581 10.1909 1.57405 10.0305C1.43229 9.87006 1.32766 9.6812 1.26743 9.47702C1.2072 9.27284 1.19279 9.05822 1.22521 8.84801L2.25353 2.24806C2.30742 1.89833 2.48793 1.57955 2.76179 1.35046C3.03566 1.12136 3.38443 0.997398 3.74384 1.0014H12.1492M12.1492 9.06801V1.0014M12.1492 9.06801H14.3847C14.7799 9.06801 15.159 8.91349 15.4385 8.63844C15.718 8.36339 15.875 7.99034 15.875 7.60135V2.46805C15.875 2.07907 15.718 1.70602 15.4385 1.43097C15.159 1.15592 14.7799 1.0014 14.3847 1.0014H12.1492" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
364
+ </svg>
365
+
366
+ </div>
367
+ </div>
368
+ `,thumbsUpButtonClass:"searchstax-lightweight-widget-thumbs-up",thumbsDownButtonClass:"searchstax-lightweight-widget-thumbs-down"}};class x{}h(x,"answer",Ja),h(x,"externalPromotions",Ba),h(x,"facets",Ha),h(x,"pagination",qa),h(x,"relatedSearches",Va),h(x,"searchFeedback",Ua),h(x,"searchInput",_a),h(x,"searchResults",Ga),h(x,"sorting",Ka),h(x,"feedback",Za);class Xa{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)||x.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 n=typeof document<"u"?document==null?void 0:document.getElementById(this.externalPromotionsContainerId):null;if(n){const c=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.externalPromotion)==null?void 0:a.template)||((r=x.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",d=>{this.trackClick(e,d)}),l.innerHTML=N.render(c,e),n.appendChild(l)}}}trackClick(e,t){t.stopPropagation(),t.preventDefault(),window==null||window.open(e.url,"_blank")}renderMainTemplate(e){var t,s,a,r;const n=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.mainTemplate)==null?void 0:a.template)||((r=x.externalPromotions.mainTemplate)==null?void 0:r.template);if(this.dataLayer.renderingEngine===q.mustache){this.searchExternalPromotionsMainContainer.innerHTML=N.render(n,e);const c=typeof document<"u"?document==null?void 0:document.getElementById(this.externalPromotionsContainerId):null;c&&(c.innerHTML="");for(const l of e.externalPromotions)this.addExternalSearch(l)}}}class ie{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 es{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,"cachedData",null),h(this,"cacheFacets"),h(this,"onFacetSelect",(s,a,r,n,c)=>{if(s.stopPropagation(),!a.disabled){const l=r.querySelector("input");let d=n?l.checked:!l.checked;c!==void 0&&(d=!c),l.checked=d;const L=this.dataLayer.searchObject;let g=[...L.facets];const m=this.extractFacetValue(a);d?g.find(S=>ae.deepEqual(S,m)?S:!1)||(this.config.facetingType==="tabs"&&(g=g.filter(S=>S.name!==m.name)),g.push(m)):g=g.filter(S=>!ae.deepEqual(S,m)),setTimeout(()=>{this.dataLayer.setSearchObject({...L,facets:g,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 n=(r=this.dataLayer.searchFacets)==null?void 0:r.find(c=>c.name===a.name);return n?{...a,values:a.values.map(c=>{const l=n.values.find(d=>c.type==="range"?!1:c.type==="checkbox"?d.value===c.value:!1);return{...c,disabled:!l,isMobile:e}})}:{...a,values:a.values.map(c=>({...c,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,n,c,l,d,L,g,m,S,k,y;if(typeof document<"u"){const w=document==null?void 0:document.createElement("div");w.classList.add("searchstax-facet-container"),this.deactivatedFacets[e.name]||w.classList.add("active");const T=((n=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.facetItemContainerTemplate)==null?void 0:n.template)||((c=x.facets.facetItemContainerTemplate)==null?void 0:c.template);w.innerHTML=N.render(T,e),t.appendChild(w);const j=w.querySelector("."+(((L=(d=(l=this.config)==null?void 0:l.templates)==null?void 0:d.facetItemContainerTemplate)==null?void 0:L.facetListTitleContainerClass)||((g=x.facets.facetItemContainerTemplate)==null?void 0:g.facetListTitleContainerClass)));j==null||j.addEventListener("click",()=>{w.classList.toggle("active")});const z=w.querySelector("."+(((k=(S=(m=this.config)==null?void 0:m.templates)==null?void 0:S.facetItemContainerTemplate)==null?void 0:k.facetListContainerClass)||((y=x.facets.facetItemContainerTemplate)==null?void 0:y.facetListContainerClass)));z&&(e.values.forEach(Y=>{this.createFacetListItem(Y,z,e.name)}),e.hasMoreFacets&&this.createHasMoreComponent(e,z,s))}}isChecked(e){var t;return!!((t=this.dataLayer.searchObject.facets)!=null&&t.find(s=>ae.deepEqual(s,this.extractFacetValue(e))))}createFacetListItem(e,t,s){var a,r,n,c,l,d,L,g,m,S,k,y;if(typeof document<"u"){const w=document==null?void 0:document.createElement("div");w.classList.add("searchstax-facet-value-container"),e.disabled&&w.classList.add("searchstax-facet-value-disabled");const T=this.isChecked(e),j=((n=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.facetItemTemplate)==null?void 0:n.template)||((c=x.facets.facetItemTemplate)==null?void 0:c.template);w.innerHTML=N.render(j,{...e,isChecked:T});let z=(l=x.facets.facetItemTemplate)==null?void 0:l.checkTriggerClasses;z=((g=(L=(d=this.config)==null?void 0:d.templates)==null?void 0:L.facetItemTemplate)==null?void 0:g.checkTriggerClasses)||z,z.forEach(Q=>{const _=w.querySelector("."+Q);_==null||_.addEventListener("click",f=>{this.onFacetSelect(f,e,w)})});const Y=w.querySelector("."+(((k=(S=(m=this.config)==null?void 0:m.templates)==null?void 0:S.facetItemTemplate)==null?void 0:k.inputCheckboxClass)||((y=x.facets.facetItemTemplate)==null?void 0:y.inputCheckboxClass)));Y==null||Y.addEventListener("click",Q=>{this.onFacetSelect(Q,e,w,!0)}),Y&&(Y==null||Y.setAttribute("data-test-value",`${encodeURIComponent(s)}:&quot;${encodeURIComponent(e.value)}&quot;`)),t.appendChild(w)}}createHasMoreComponent(e,t,s){var a,r,n,c,l,d,L,g;if(typeof document<"u"){const m=document==null?void 0:document.createElement("div");m.classList.add("searchstax-facet-show-more-container");const S=((n=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.showMoreButtonContainerTemplate)==null?void 0:n.template)||((c=x.facets.showMoreButtonContainerTemplate)==null?void 0:c.template);m.innerHTML=N.render(S,e);const k=m.querySelector("."+(((L=(d=(l=this.config)==null?void 0:l.templates)==null?void 0:d.showMoreButtonContainerTemplate)==null?void 0:L.showMoreButtonClass)||((g=x.facets.showMoreButtonContainerTemplate)==null?void 0:g.showMoreButtonClass)));k&&(this.attachOnclickToShowMore(e,k,s),t&&t.appendChild(k))}}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?(ie.setAccessibilityText(`More Facets shown for ${t.label}`),r[t.name]=r[t.name]+a):(ie.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,n,c,l,d,L,g,m,S;if(e&&(!ae.deepEqual(this.cachedData??{},e)||t)){this.cachedData=e;const k=((r=(a=(s=this.config)==null?void 0:s.templates)==null?void 0:a.mainTemplateDesktop)==null?void 0:r.template)||((n=x.facets.mainTemplateDesktop)==null?void 0:n.template);if(this.dataLayer.renderingEngine===q.mustache&&this.searchFacetsMainContainer){this.searchFacetsMainContainer.innerHTML=N.render(k,{...e});const y=(L=this.searchFacetsMainContainer)==null?void 0:L.querySelector("."+(((d=(l=(c=this.config)==null?void 0:c.templates)==null?void 0:l.mainTemplateDesktop)==null?void 0:d.facetsContainerClass)||x.facets.mainTemplateDesktop.facetsContainerClass));if(y){y.innerHTML="";for(const w of e.facets)this.createFacetItem(w,y);if(this.searchFacetsMainContainer){const w=this.searchFacetsMainContainer.querySelector("."+(((S=(m=(g=this.config)==null?void 0:g.templates)==null?void 0:m.mainTemplateDesktop)==null?void 0:S.selectedFacetsContainerClass)||x.facets.mainTemplateDesktop.selectedFacetsContainerClass));w&&(this.createSelectedFacetsComponents(w),this.createClearFacetsComponents(w))}}}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 n=this.needCache?this.dataLayer.searchFacetsCached:this.dataLayer.searchFacets,c=n==null?void 0:n.find(l=>l.name===a);if(c){const l=c.values.find(d=>d.type==="range"?!1:d.type==="checkbox"?`"${d.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,n,c,l,d;if(typeof document<"u"){const L=this.dataLayer.searchObject,g=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.clearFacetsTemplate)==null?void 0:a.template)||((r=x.facets.clearFacetsTemplate)==null?void 0:r.template),m=document==null?void 0:document.createElement("div");m.innerHTML=N.render(g,{shouldShow:L.facets.length>0});const S=m.querySelector("."+(((l=(c=(n=this.config)==null?void 0:n.templates)==null?void 0:c.clearFacetsTemplate)==null?void 0:l.containerClass)||((d=x.facets.clearFacetsTemplate)==null?void 0:d.containerClass)));S&&(S.addEventListener("click",()=>{this.removeSelectedFacets()}),S.addEventListener("keyup",k=>{(k.code==="Space"||k.code==="Enter")&&this.removeSelectedFacets()}),e.appendChild(S))}}createSelectedFacetsComponent(e,t){var s,a,r,n,c,l,d,L;if(typeof document<"u"){const g=((r=(a=(s=this.config)==null?void 0:s.templates)==null?void 0:a.selectedFacetsTemplate)==null?void 0:r.template)||((n=x.facets.selectedFacetsTemplate)==null?void 0:n.template),m=document==null?void 0:document.createElement("div");m.innerHTML=N.render(g,t);const S=m.querySelector("."+(((d=(l=(c=this.config)==null?void 0:c.templates)==null?void 0:l.selectedFacetsTemplate)==null?void 0:d.containerClass)||((L=x.facets.selectedFacetsTemplate)==null?void 0:L.containerClass)));S&&(S.addEventListener("click",()=>{this.unselectFacet(t)}),S.addEventListener("keyup",k=>{(k.code==="Space"||k.code==="Enter")&&this.unselectFacet(t)}),e.appendChild(S))}}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,n,c,l,d;if(typeof document<"u"){const L=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.filterByTemplate)==null?void 0:a.template)||((r=x.facets.filterByTemplate)==null?void 0:r.template),g=document==null?void 0:document.createElement("div");g.innerHTML=N.render(L,{});const m=g.querySelector("."+(((l=(c=(n=this.config)==null?void 0:n.templates)==null?void 0:c.filterByTemplate)==null?void 0:l.containerClass)||((d=x.facets.filterByTemplate)==null?void 0:d.containerClass)));m&&(e.prepend(m),m.addEventListener("click",this.openOverlay.bind(this)),m.addEventListener("keyup",S=>{(S.code==="Space"||S.code==="Enter")&&this.openOverlay()}))}}openOverlay(){var e;ie.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;ie.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,n,c,l,d,L,g,m,S,k,y,w,T,j,z,Y;if(e&&typeof document<"u"){const Q=document==null?void 0:document.createElement("div");Q.classList.add("searchstax-facets-container-mobile");const _=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.mainTemplateMobile)==null?void 0:a.template)||((r=x.facets.mainTemplateMobile)==null?void 0:r.template);if(this.dataLayer.renderingEngine===q.mustache){if(Q.innerHTML=N.render(_,{...e,overlayOpened:this.overlayOpened}),(n=this.searchFacetsMainContainer)==null||n.appendChild(Q),(l=(c=this.config)==null?void 0:c.templates)!=null&&l.mainTemplateMobile)for(const J of((g=(L=(d=this.config)==null?void 0:d.templates)==null?void 0:L.mainTemplateMobile)==null?void 0:g.closeOverlayTriggerClasses)||[]){const ee=Q.querySelector("."+J);ee&&(ee.addEventListener("click",this.closeOverlay.bind(this)),ee.addEventListener("keyup",se=>{(se.code==="Space"||se.code==="Enter")&&this.closeOverlay()}))}else for(const J of x.facets.mainTemplateMobile.closeOverlayTriggerClasses){const ee=Q.querySelector("."+J);ee&&(ee.addEventListener("click",this.closeOverlay.bind(this)),ee.addEventListener("keyup",se=>{(se.code==="Space"||se.code==="Enter")&&this.closeOverlay()}))}const f=Q.querySelector("."+(((k=(S=(m=this.config)==null?void 0:m.templates)==null?void 0:S.mainTemplateMobile)==null?void 0:k.filterByContainerClass)||x.facets.mainTemplateMobile.filterByContainerClass));f&&this.createFilterByComponent(f);const v=Q.querySelector("."+(((T=(w=(y=this.config)==null?void 0:y.templates)==null?void 0:w.mainTemplateMobile)==null?void 0:T.selectedFacetsContainerClass)||x.facets.mainTemplateMobile.selectedFacetsContainerClass));v&&(this.createSelectedFacetsComponents(v),this.createClearFacetsComponents(v));const R=Q.querySelector("."+(((Y=(z=(j=this.config)==null?void 0:j.templates)==null?void 0:z.mainTemplateMobile)==null?void 0:Y.facetsContainerClass)||x.facets.mainTemplateMobile.facetsContainerClass));if(R){R.innerHTML="";for(const J of e.facets)this.createFacetItem(J,R,!0)}}}}}class ts{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,n,c,l,d,L;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)??x.pagination.mainTemplate.previousButtonClass,this.nextButtonClass=((c=(n=(r=this.config)==null?void 0:r.templates)==null?void 0:n.mainTemplate)==null?void 0:c.nextButtonClass)??x.pagination.mainTemplate.nextButtonClass,this.loadMoreButtonClass=((L=(d=(l=this.config)==null?void 0:l.templates)==null?void 0:d.infiniteScrollTemplate)==null?void 0:L.loadMoreButtonClass)??x.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)}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,n,c,l,d,L,g;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=((n=(r=(a=this.config)==null?void 0:a.templates)==null?void 0:r.mainTemplate)==null?void 0:n.template)||((c=x.pagination.mainTemplate)==null?void 0:c.template);this.dataLayer.isInfiniteScroll&&(m=((L=(d=(l=this.config)==null?void 0:l.templates)==null?void 0:d.infiniteScrollTemplate)==null?void 0:L.template)||((g=x.pagination.infiniteScrollTemplate)==null?void 0:g.template)),this.dataLayer.renderingEngine===q.mustache&&(this.searchPaginationMainContainer.innerHTML=N.render(m,e),setTimeout(()=>{this.overridePaginationEvents()},0))}}class as{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)||x.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,n,c;if(typeof document<"u"){const l=document==null?void 0:document.createElement("div"),d=((r=(a=(s=this.config)==null?void 0:s.templates)==null?void 0:a.relatedSearch)==null?void 0:r.template)||x.relatedSearches.relatedSearch.template;if(this.dataLayer.renderingEngine===q.mustache){l.innerHTML=N.render(d,e);const L=l.querySelector("."+(((c=(n=this.config.templates)==null?void 0:n.relatedSearch)==null?void 0:c.relatedSearchContainerClass)||x.relatedSearches.relatedSearch.relatedSearchContainerClass));L&&(t.appendChild(L),L.addEventListener("click",()=>{this.executeSearch(e)}),L.addEventListener("keyup",g=>{(g.code==="Space"||g.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 n=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.main)==null?void 0:a.template)||x.relatedSearches.main.template;if(this.dataLayer.renderingEngine===q.mustache&&this.searchRelatedSearchesMainContainer){this.searchRelatedSearchesMainContainer.innerHTML="",this.searchRelatedSearchesMainContainer.innerHTML=N.render(n,e);const c=(r=this.searchRelatedSearchesMainContainer)==null?void 0:r.querySelector(`.${this.relatedSearchesContainerClass}`);if(c)for(const l of e.relatedSearches)this.addRelatedSearchComponent(l,c)}}}class ss{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 n=(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=x.searchFeedback.main)==null?void 0:a.originalQueryClass)));n&&n.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)||x.searchFeedback.main.template;this.dataLayer.renderingEngine===q.mustache&&(this.searchFeedbackMainContainer.innerHTML=N.render(r,e),setTimeout(()=>{this.attachClick()},0))}}class rs{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.renderMainTemplate(),this.actionButtonInit(),this.updateActionButtonState("search"),this.searchInput&&(this.createAutosuggestContainer(),this.attachSubscriptions())}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 n=((t=(e=this.config.templates)==null?void 0:e.mainTemplate)==null?void 0:t.template)||x.searchInput.mainTemplate.template;if(this.dataLayer.renderingEngine===q.mustache){const d=N.render(n,{});r.innerHTML=d}const c=((a=(s=this.config.templates)==null?void 0:s.mainTemplate)==null?void 0:a.searchInputId)||x.searchInput.mainTemplate.searchInputId,l=document==null?void 0:document.querySelector(`#${c}`);if(l)this.searchInput=l,l.addEventListener("keyup",this.inputKeyupEvent.bind(this)),l.addEventListener("blur",this.hideAutosuggest.bind(this)),l.addEventListener("paste",this.inputPasteEvent.bind(this));else throw new Error("Input not found")}}createAutosuggestContainer(){var e;this.dataLayer.renderingEngine===q.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.buttonState==="search"?this.executeSearch(((e=this.searchInput)==null?void 0:e.value)??""):this.buttonState==="close"&&this.searchInput&&(this.searchInput.value="",this.executeSearch(""))}))}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(){var e;this.dataLayer.searchTerm===((e=this.searchInput)==null?void 0:e.value)&&this.searchInput.value!==""?this.updateActionButtonState("close"):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-close"),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;case"close":this.actionButton.classList.add("searchstax-search-close"),this.actionButton.setAttribute("aria-label","clear search");break}}selectPreviousAutosuggestItem(){this.selectedAutosuggestItem>0?this.selectedAutosuggestItem--:this.selectedAutosuggestItem=this.autosuggestResults.suggestions.length-1,this.markActiveAutosuggestItem()}selectNextAutosuggestItem(){this.selectedAutosuggestItem<this.autosuggestResults.suggestions.length-1?this.selectedAutosuggestItem++: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"),ie.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():t==="ArrowUp"?this.selectPreviousAutosuggestItem():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(){setTimeout(()=>{this.dataLayer.setAutosuggestResults({numFound:0,suggestions:[]}),this.autosuggestContainer&&(this.autosuggestContainer.innerHTML="",this.autosuggestContainer.classList.add("hidden")),this.resetAutosuggestSelection()},200)}cleanSuggestionTerm(e){return ce.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 n=((s=(t=this.config.templates)==null?void 0:t.autosuggestItemTemplate)==null?void 0:s.template)||((a=x.searchInput.autosuggestItemTemplate)==null?void 0:a.template);return r.innerHTML=N.render(n,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?ie.setAccessibilityText("Suggestions are available. Use up and down arrows to navigate while focusing input.",2e3):ie.setAccessibilityText("",0),this.autosuggestResults=r,this.dataLayer.setAutosuggestResults(r),r.numFound>0?r.suggestions.forEach(n=>{this.autosuggestContainer&&typeof document<"u"&&this.autosuggestContainer.appendChild(this.createAutosuggestItem(n))}):this.autosuggestContainer&&this.autosuggestContainer.classList.add("hidden")}}}}class is{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(()=>{ie.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 n=((s=(t=(e=this.config)==null?void 0:e.templates)==null?void 0:t.noSearchResultTemplate)==null?void 0:s.template)||((a=x.searchResults.noSearchResultTemplate)==null?void 0:a.template),c=((r=this.dataLayer.searchResultsMetadata)==null?void 0:r.spellingSuggestion)??"";if(this.dataLayer.renderingEngine===q.mustache&&this.searchResultsContainer&&(this.searchResultsContainer.innerHTML=N.render(n,{spellingSuggestion:c,...this.dataLayer.parsedData.data,searchCallback:this.searchCallback.bind(this)})),c&&this.searchResultsContainer){const l=this.searchResultsContainer.querySelector("a");l&&l.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation(),this.searchCallback(c)})}}renderResults(e){var t,s,a,r,n;if(this.dataLayer.renderingEngine===q.mustache&&this.searchResultsContainer)if(this.removeLinkClickEvents(),e.length===0)ie.setAccessibilityText("Search has no results"),this.renderNoResultsTemplate();else{ie.setAccessibilityText(`Showing ${this.dataLayer.parsedData.startResultIndex} through ${this.dataLayer.parsedData.endResultIndex} results from ${this.dataLayer.parsedData.totalResults}. Press tab to navigate through results`);const c=((a=(s=(t=this.config)==null?void 0:t.templates)==null?void 0:s.searchResultTemplate)==null?void 0:a.template)||((r=x.searchResults.searchResultTemplate)==null?void 0:r.template),l=e.map(d=>N.render(c,d));((n=this.config)==null?void 0:n.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=x.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=x.searchResults.mainTemplate)==null?void 0:a.template);this.dataLayer.renderingEngine===q.mustache&&(this.searchResultsMainContainer.innerHTML=N.render(r,{}),setTimeout(()=>{var n,c,l,d,L,g,m;const S=(l=(c=(n=this.config)==null?void 0:n.templates)==null?void 0:c.mainTemplate)!=null&&l.searchResultsContainerId?(g=(L=(d=this.config)==null?void 0:d.templates)==null?void 0:L.mainTemplate)==null?void 0:g.searchResultsContainerId:(m=x.searchResults.mainTemplate)==null?void 0:m.searchResultsContainerId,k=document==null?void 0:document.getElementById(S);if(k)this.searchResultsContainer=k;else throw new Error(`Search Results Container with id ${S} not found`)},0))}}class ns{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)||x.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)||x.sorting.main.template;if(this.dataLayer.renderingEngine===q.mustache){this.searchSortingMainContainer.innerHTML=N.render(r,e),this.markOptionSelected();const n=document==null?void 0:document.getElementById(this.selectId);n&&n.addEventListener("change",c=>{this.setOrderQuery(c.target.value)})}}}class cs{constructor(e){h(this,"dataLayer"),h(this,"config"),h(this,"containerId"),h(this,"answerContainer",null),h(this,"showMoreVisible",!1),h(this,"clicked",!1),this.dataLayer=e.dataLayer,this.config=e.config,this.containerId=e.containerId,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.$searchObject.subscribe(()=>{this.clicked=!1}),this.dataLayer.$paginationData.subscribe(()=>{this.renderMainTemplate(this.generateTemplateData())})}showMore(e){e.preventDefault(),this.clicked=!0,this.showMoreVisible=!1,this.renderMainTemplate(this.generateTemplateData())}attachClickEventToShowMore(){const e=document.querySelector(".searchstax-answer-load-more-button");e&&e.addEventListener("click",this.showMore.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)||x.answer.main.template;this.dataLayer.renderingEngine===q.mustache&&(this.answerContainer.innerHTML=N.render(r,e),this.attachClickEventToShowMore())}generateTemplateData(){const e={...this.dataLayer.parsedData.data,showMoreButtonVisible:this.showMoreVisible};return this.dataLayer.setAnswerFullData(e),e}}class os{constructor(e=q.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,"searchResultsWidget"),h(this,"searchFacetsWidget"),h(this,"searchPaginationWidget"),h(this,"searchFeedbackWidget"),h(this,"searchSortingWidget"),h(this,"relatedSearchesWidget"),h(this,"externalPromotionsWidget"),h(this,"answerWidget"),h(this,"dataLayer"),h(this,"firstRequest",!0),h(this,"previousQuery",""),h(this,"renderEngine",q.mustache),e&&(this.renderEngine=e)}setRenderingEngine(e=q.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)}),this.dataLayer.$searchObject.subscribe(s=>{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)),this.previousQuery=s.query}),this.dataLayer.$searchResults.subscribe(s=>{s&&this.dataLayer.searchResultsMetadata&&!this.dataLayer.cookiesDisabled&&le.trackSearch({...this.dataLayer.parsedData.trackingData,impressions:this.dataLayer.searchResultsMetadata.impressions})})}startSSE(e){var t;this.dataLayer.turnAIAnswerGenerationOn===!0&&this.dataLayer.questionURL&&((t=this.searchHelper)==null||t.startSSE(e,this.parseAnswerResultsResponse.bind(this)))}attachAnalyticsScript(e){le.attachAnalyticsScript(e)}initialize(e){var t,s;if(this.dataLayer=new va("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),this.dataLayer.searchstaxConfig||(this.dataLayer.setSearchstaxConfig(e),this.searchHelper=new ba({...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 Rt(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),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 Rt({})}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;const s=(((t=e.response)==null?void 0:t.docs)??[]).map((r,n)=>({...r,position:n+1})),a=[];for(const r of s)a.push({relatedSearch:r.related_search,position:r.position});this.dataLayer.searchResultsMetadata&&!this.dataLayer.cookiesDisabled&&le.trackRelatedSearches({...this.dataLayer.parsedData.trackingData,impressions:a}),this.dataLayer.setSearchRelatedSearches(s)}handleRouter(){if(this.routerEnabled){const e={...this.dataLayer.searchObject};this.dataLayer.isInfiniteScroll&&delete e.page,this.routerHelper.updateUrl(e)}}parseSearchResultsResponse(e){var t,s;this.handleRouter(),this.dataLayer.setItemsPerPage(parseInt(e.responseHeader.params.rows));let a=Te.combineResultsWithMetadata(e),r=Te.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??[]);const n=Te.extractSearchResultsMetadata(e);this.dataLayer.setSearchResultsMetadata(n),this.dataLayer.setSearchResults(a)}parseAnswerResultsResponse(e){this.handleRouter(),e!==fe.question&&e!==fe.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.setSearchInputConfig(t),this.searchInputWidget=new rs({containerId:e,config:t,searchTrigger:this.executeSearch.bind(this),suggestTrigger:this.executeSuggest.bind(this),dataLayer:this.dataLayer}))}addAnswerWidget(e,t){this.dataLayer.turnAIAnswerGenerationOn=!0,this.startSSE(this.dataLayer.searchObject.query),this.dataLayer.setAnswerData(""),this.answerWidget=new cs({containerId:e,config:t,dataLayer:this.dataLayer})}addSearchResultsWidget(e,t){this.searchResultsConfig||(this.searchResultsConfig=t,this.searchResultsWidget=new is({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 ts({containerId:e,config:t,dataLayer:this.dataLayer,routerHelper:this.routerHelper})}addSearchFeedbackWidget(e,t){this.searchFeedbackConfig=t,this.searchFeedbackWidget=new ss({containerId:e,config:t,dataLayer:this.dataLayer,searchTrigger:this.executeSearch.bind(this)})}addSearchSortingWidget(e,t){this.searchSortingConfig=t,this.searchSortingWidget=new ns({containerId:e,config:t,dataLayer:this.dataLayer})}addRelatedSearchesWidget(e,t){this.relatedSearchesConfig=t,this.relatedSearchesWidget=new as({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 Xa({containerId:e,config:t,dataLayer:this.dataLayer})}addFacetsWidget(e,t){this.searchFacetsConfig=t,this.searchFacetsWidget=new es({containerId:e,config:t,dataLayer:this.dataLayer,routerHelper:this.routerHelper},this.cacheFacets.bind(this))}executeSearch(e,t){var s,a;const r={...this.dataLayer.searchObject};r.query=ce.removeXSSRiskyTags(e),r.page=1,r.facets=[],this.dataLayer.forceNotCorrect=!!t;let n=(s=this.routerHelper)==null?void 0:s.searchObjectToParams(r);n&&(n=(a=this.routerHelper)==null?void 0:a.extractParamsThatDoNotStartWithRouteName(n)),n&&(r.additionalProps=Object.keys(n).map(c=>n?{key:c,value:n[c]}:{key:"",value:""})),this.dataLayer.setSearchObject(r),this.dataLayer.lastSearchValue=r.query}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){this.dataLayer.searchResultsMetadata&&this.dataLayer.searchRelatedSearches&&!this.dataLayer.cookiesDisabled&&le.trackRelatedSearchClick({...this.dataLayer.parsedData.trackingData,relatedSearch:e})}executeLinkClick(e){var t,s;let a=Te.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&&le.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 C={searchstax:new os("react")};function ls(i){let e=!1;const[t,s]=I.useState([]);I.useEffect(()=>{if(a(),C.searchstax){const l={};i.afterAutosuggest&&(l.afterAutosuggest=i.afterAutosuggest),i.beforeAutosuggest&&(l.beforeAutosuggest=i.beforeAutosuggest),C.searchstax.addSearchInputWidget("searchstax-input-container",{suggestAfterMinChars:i.suggestAfterMinChars,hooks:l,templates:{mainTemplate:{template:"",searchInputId:i.searchInputId??"searchstax-search-input"}}})}else throw Error("Searchstax instance needs to be passed via props")},[]);function a(){e||(C.searchstax.dataLayer.$autosuggestResults.subscribe(l=>{s((l==null?void 0:l.suggestions)??[])}),e=!0)}function r(){var l,d;(l=C.searchstax.searchInputWidget)==null||l.resetAutosuggestSelection(),(d=C.searchstax.searchInputWidget)==null||d.markActiveAutosuggestItem()}function n(l){var d;(d=C.searchstax.searchInputWidget)==null||d.onSuggestionEnter(l)}function c(){var l;(l=C.searchstax.searchInputWidget)==null||l.suggestionChosen()}return u.jsx(u.Fragment,{children:u.jsx("div",{id:"searchstax-input-container",children:u.jsxs("div",{className:"searchstax-search-input-container",children:[!i.inputTemplate&&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 ${t.length===0?"hidden":""}`,onMouseLeave:r,children:t.map(function(l){return u.jsx("div",{className:"searchstax-autosuggest-item",children:u.jsx("div",{className:"searchstax-autosuggest-item-term-container",tabIndex:0,dangerouslySetInnerHTML:{__html:l.term},onMouseOver:()=>{n(l)},onClick:()=>{c()}})},l.term)})}),u.jsx("button",{className:"searchstax-spinner-icon",id:"searchstax-search-input-action-button","aria-label":"search"})]}),i.inputTemplate&&u.jsx(u.Fragment,{children:i.inputTemplate(t,r,n,c)})]})})})}function hs(i){const[e,t]=I.useState(!1);return I.useEffect(()=>{const s={};i.beforeSearch&&(s.beforeSearch=i.beforeSearch),i!=null&&i.afterSearch&&(s.afterSearch=i.afterSearch),C.searchstax.initialize({language:i.language??"en",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(C.searchstax)},[i.initialized]),u.jsx(u.Fragment,{children:e&&u.jsxs(u.Fragment,{children:[" ",i.children," "]})})}function us(i){const[e,t]=I.useState(null),s=I.useRef();s.current=e;const[a,r]=I.useState(""),[n,c]=I.useState(null),l=(g,m)=>{m.preventDefault(),m.stopPropagation(),C.searchstax.executeLinkClick(g.uniqueId)};I.useEffect(()=>{L();const g={};i.afterLinkClick&&(g.afterLinkClick=i.afterLinkClick),C.searchstax.addSearchResultsWidget("searchstax-results-container",{templates:{},renderMethod:i.renderMethod??"pagination",hooks:g})},[]);function d(g){C.searchstax.executeSearch(g)}function L(){C.searchstax.dataLayer.$searchResults.subscribe(g=>{var y;const m=s.current??[],S=g??[],k=i.renderMethod==="infiniteScroll"?[...m,...S]:g;((y=C.searchstax.dataLayer.$searchObject.value)==null?void 0:y.page)===1?t(S):t(k)}),C.searchstax.dataLayer.$searchTermChange.subscribe(g=>{r(g)}),C.searchstax.dataLayer.$searchResultsMetadata.subscribe(g=>{c(g)})}return u.jsx(u.Fragment,{children:u.jsx("div",{id:"searchstax-results-container",children:u.jsx("div",{className:"searchstax-search-results-container",children:u.jsxs("div",{id:"searchstax-result-container",children:[e&&e.length===0&&a!==""&&a!=="*"&&C.searchstax.dataLayer.parsedData.firstSearchHappened&&!i.noResultTemplate&&u.jsxs("div",{children:[u.jsxs("div",{className:"searchstax-no-results",children:[" ","Showing ",u.jsx("strong",{children:"no results"})," for"," ",u.jsxs("strong",{children:['"',a,'"']}),u.jsx("br",{}),(n==null?void 0:n.spellingSuggestion)&&u.jsxs("span",{children:[" Did you mean"," ",u.jsx("a",{href:"#",className:"searchstax-suggestion-term",onClick:()=>{d(n==null?void 0:n.spellingSuggestion)},children:n==null?void 0:n.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."})]})]}),e&&e.length===0&&a!==""&&a!=="*"&&C.searchstax.dataLayer.parsedData.firstSearchHappened&&i.noResultTemplate&&u.jsx(u.Fragment,{children:i.noResultTemplate(a,n,d)}),e&&e.length>0&&!i.resultsTemplate&&u.jsx("div",{className:"searchstax-search-results",children:e!==null&&e.map(function(g){return u.jsx("a",{href:g.url??"",onClick:m=>{l(g,m)},onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&l(g,m)},tabIndex:0,"data-searchstax-unique-result-id":g.uniqueId,className:"searchstax-result-item-link searchstax-result-item-link-wrapping",children:u.jsxs("div",{className:`searchstax-search-result ${g.thumbnail?"has-thumbnail":""}`,children:[g.promoted&&u.jsx("div",{className:"searchstax-search-result-promoted"}),g.ribbon&&u.jsx("div",{className:"searchstax-search-result-ribbon",dangerouslySetInnerHTML:{__html:g.ribbon}}),g.thumbnail&&u.jsx("img",{src:g.thumbnail,className:"searchstax-thumbnail"}),u.jsx("div",{className:"searchstax-search-result-title-container",children:u.jsx("span",{className:"searchstax-search-result-title",dangerouslySetInnerHTML:{__html:g.title??""}})}),g.paths&&u.jsx("p",{className:"searchstax-search-result-common",dangerouslySetInnerHTML:{__html:g.paths}}),g.description&&u.jsx("p",{className:"searchstax-search-result-description searchstax-search-result-common",dangerouslySetInnerHTML:{__html:g.description}}),g.unmappedFields.map(function(m){return u.jsxs("div",{children:[m.isImage&&typeof m.value=="string"&&u.jsx("div",{className:"searchstax-search-result-image-container",children:u.jsx("img",{src:m.value,className:"searchstax-result-image"})}),!m.isImage&&u.jsx("div",{children:u.jsx("p",{className:"searchstax-search-result-common",dangerouslySetInnerHTML:{__html:m.value}})})]},m.key)})]},g.uniqueId)},g.uniqueId)})}),e&&e.length>0&&i.resultsTemplate&&u.jsx(u.Fragment,{children:i.resultsTemplate(e,l)})]})})})})}function ds(i){let e=!1;const[t,s]=I.useState(!1),[a,r]=I.useState(null),[n]=I.useState(Math.random());I.useEffect(()=>{if(c(),C.searchstax)C.searchstax.addPaginationWidget("searchstax-pagination-container"+n,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function c(){e||(C.searchstax.dataLayer.$searchObject.subscribe(()=>{l()}),C.searchstax.dataLayer.$paginationData.subscribe(g=>{r(g)}),e=!0)}function l(){!t&&C.searchstax.routerHelper&&(s(!0),C.searchstax.addPaginationWidget("searchstax-pagination-container"+n,{}))}function d(g){var m;(m=C.searchstax.searchPaginationWidget)==null||m.nextPage(g)}function L(g){var m;(m=C.searchstax.searchPaginationWidget)==null||m.previousPage(g)}return u.jsx(u.Fragment,{children:u.jsxs("div",{id:"searchstax-pagination-container"+n,children:[!i.paginationTemplate&&a&&!a.isInfiniteScroll&&(a==null?void 0:a.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 ${a.isFirstPage?"disabled":""}`,style:a!=null&&a.isFirstPage?{pointerEvents:"none"}:{},onClick:g=>{L(g)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&L(g)},tabIndex:0,id:"searchstax-pagination-previous",children:[" ","< Previous"," "]}),u.jsxs("div",{className:"searchstax-pagination-details",children:[" ",a==null?void 0:a.startResultIndex," -"," ",a==null?void 0:a.endResultIndex," of"," ",a==null?void 0:a.totalResults]}),u.jsx("a",{className:`searchstax-pagination-next ${a.isLastPage?"disabled":""}`,tabIndex:0,style:a!=null&&a.isLastPage?{pointerEvents:"none"}:{},onClick:g=>{d(g)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&d(g)},id:"searchstax-pagination-next",children:"Next >"})]})}),i.paginationTemplate&&a&&!a.isInfiniteScroll&&u.jsx(u.Fragment,{children:i.paginationTemplate(a,d,L)}),!i.infiniteScrollTemplate&&a&&a.isInfiniteScroll&&(a==null?void 0:a.totalResults)!==0&&!(a!=null&&a.isLastPage)&&u.jsx("div",{className:"searchstax-pagination-container",children:u.jsx("a",{className:"searchstax-pagination-load-more",tabIndex:0,onClick:g=>{d(g)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&d(g)},children:"Show More"})}),i.infiniteScrollTemplate&&a&&a.isInfiniteScroll&&(a==null?void 0:a.totalResults)!==0&&!(a!=null&&a.isLastPage)&&u.jsx(u.Fragment,{children:i.infiniteScrollTemplate(a,d)})]})})}function gs(i){let e=!1;const[t,s]=I.useState(null),[a,r]=I.useState(""),[n]=I.useState(Math.random());I.useEffect(()=>{if(c(),C.searchstax)C.searchstax.addSearchSortingWidget("search-sorting-container"+n,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function c(){e||(C.searchstax.dataLayer.$searchSortingData.subscribe(d=>{s(d)}),C.searchstax.dataLayer.$searchObject.subscribe(d=>{r(decodeURIComponent((d==null?void 0:d.order)??""))}),e=!0)}function l(d){var L;(L=C.searchstax.searchSortingWidget)==null||L.setOrderQuery(d)}return u.jsx(u.Fragment,{children:u.jsxs("div",{id:"search-sorting-container"+n,children:[!i.searchSortingTemplate&&t&&(t==null?void 0:t.searchExecuted)&&(t==null?void 0:t.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:a,onChange:d=>{l(d.target.value)},children:t.sortOptions.map(function(d){return u.jsx("option",{value:d.key,children:d.value},d.key)})})]}),i.searchSortingTemplate&&u.jsx(u.Fragment,{children:i.searchSortingTemplate(t,l,a)})]})})}function ms(i){let e=!1;const[t,s]=I.useState(null),[a]=I.useState(Math.random());I.useEffect(()=>{if(r(),C.searchstax)C.searchstax.addSearchFeedbackWidget("search-feedback-container"+a,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function r(){e||(C.searchstax.dataLayer.$searchFeedbackData.subscribe(c=>{s(c)}),e=!0)}function n(c){var l;(l=C.searchstax.searchFeedbackWidget)==null||l.onOriginalQueryClick(c)}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.jsxs(u.Fragment,{children:["Showing"," ",u.jsxs("b",{children:[t.startResultIndex," - ",t.endResultIndex]})," ","of",u.jsxs("b",{children:[" ",t.totalResults]})," results",t.searchTerm&&u.jsxs("span",{children:[' for "',u.jsx("b",{children:t.searchTerm}),'"'," "]}),u.jsx("div",{className:"searchstax-feedback-container-suggested",children:t.autoCorrectedQuery&&u.jsxs("div",{children:[" ","Search instead for"," ",u.jsx("a",{href:"#",onClick:c=>{n(c)},className:"searchstax-feedback-original-query",children:t.originalQuery})]})})]}),i.searchOverviewTemplate&&u.jsx(u.Fragment,{children:i.searchOverviewTemplate(t,n)})]})})}function ps(i){const[e,t]=I.useState(null),[s,a]=I.useState(null),[r,n]=I.useState([]),[c,l]=I.useState({}),d={},L=Math.random();let g=!1;I.useEffect(()=>{if(m(),C.searchstax)C.searchstax.addFacetsWidget("searchstax-facets-container"+L,{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(){g||(C.searchstax.dataLayer.$facetsTemplateData.subscribe(f=>{f!=null&&f.isMobile?a(f):t(f)}),C.searchstax.dataLayer.$selectedFacetsTemplateData.subscribe(f=>{n((f??[]).filter(R=>R.type==="checkbox"))}),g=!0)}function S(f){var v;(v=C.searchstax.searchFacetsWidget)==null||v.unselectFacet(f)}function k(){var f;(f=C.searchstax.searchFacetsWidget)==null||f.removeSelectedFacets()}function y(f){return!c[f]}function w(f){y(f)?l({...c,[f]:!0}):l({...c,[f]:!1})}function T(f){var v;return(v=C.searchstax.searchFacetsWidget)==null?void 0:v.isChecked(f)}function j(f,v,R,J,ee){var re;const se=ee?"mobile-":"desktop-",Z=document.getElementsByClassName(se+f);Z[0]&&((re=C.searchstax.searchFacetsWidget)==null||re.onFacetSelect(v,R,Z[0],!1,T(R)))}function z(f,v){var R;(R=C.searchstax.searchFacetsWidget)==null||R.onShowMoreLessClick(f,v,!1)}function Y(f,v){var R;(R=C.searchstax.searchFacetsWidget)==null||R.onShowMoreLessClick(f,v,!0)}function Q(){var f;(f=C.searchstax.searchFacetsWidget)==null||f.openOverlay()}function _(){var f;(f=C.searchstax.searchFacetsWidget)==null||f.closeOverlay()}return u.jsx(u.Fragment,{children:u.jsxs("div",{id:"searchstax-facets-container"+L,children:[(e==null?void 0:e.hasResultsOrExternalPromotions)&&!i.facetsTemplateDesktop&&u.jsx("div",{className:"searchstax-facets-container-desktop",children:e==null?void 0:e.facets.map(f=>u.jsx("div",{className:`searchstax-facet-container ${y(f.name)?"active":""}`,children:u.jsxs("div",{children:[u.jsxs("div",{className:"searchstax-facet-title-container",onClick:()=>{w(f.name)},children:[u.jsxs("div",{className:"searchstax-facet-title",children:[" ",f.label," "]}),u.jsx("div",{className:"searchstax-facet-title-arrow active"})]}),u.jsxs("div",{className:"searchstax-facet-values-container",children:[f.values.map((v,R)=>(d[R+f.name]=I.createRef(),u.jsxs("div",{className:`searchstax-facet-value-container ${v.disabled?"searchstax-facet-value-disabled":""}`,ref:d[R+f.name],children:[u.jsx("div",{className:"searchstax-facet-input desktop-"+R+f.name,children:u.jsx("input",{type:"checkbox",className:"searchstax-facet-input-checkbox",checked:T(v),"aria-label":v.value+" "+v.count,readOnly:!0,disabled:v.disabled,onClick:J=>{j(R+f.name,J,v)}})}),u.jsx("div",{className:"searchstax-facet-value-label",onClick:J=>{j(R+f.name,J,v)},children:v.value}),u.jsxs("div",{className:"searchstax-facet-value-count",onClick:J=>{j(R+f.name,J,v)},children:["(",v.count,")"]})]},v.value+v.parentName))),f.hasMoreFacets&&u.jsx("div",{className:"searchstax-facet-show-more-container",children:u.jsxs("div",{className:"searchstax-facet-show-more-container",onClick:v=>{z(v,f)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&z(v,f)},children:[f.showingAllFacets&&u.jsx("div",{className:"searchstax-facet-show-less-button searchstax-facet-show-button",children:"less"}),!f.showingAllFacets&&u.jsx("div",{className:"searchstax-facet-show-more-button searchstax-facet-show-button",children:"more"})]})})]})]})},f.name+"desktop"))}),i.facetsTemplateDesktop&&u.jsx(u.Fragment,{children:i.facetsTemplateDesktop(e,d,y,w,j,T,z)}),(s==null?void 0:s.hasResultsOrExternalPromotions)&&!i.facetsTemplateMobile&&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:()=>{Q()},children:u.jsx("div",{className:"searchstax-facets-pill-label",children:"Filter By"})}),u.jsxs("div",{className:"searchstax-facets-pills-selected",children:[r.map(f=>u.jsxs("div",{className:"searchstax-facets-pill searchstax-facets-pill-facets",onClick:()=>{S(f)},children:[u.jsxs("div",{className:"searchstax-facets-pill-label",children:[f.value," (",f.count,")"]}),u.jsx("div",{className:"searchstax-facets-pill-icon-close"})]},f.value)),r.length!==0&&u.jsx("div",{className:"searchstax-facets-pill searchstax-clear-filters searchstax-facets-pill-clear-all",onClick:()=>{k()},children:u.jsx("div",{className:"searchstax-facets-pill-label",children:"Clear Filters"})})]}),u.jsxs("div",{className:`searchstax-facets-mobile-overlay ${s.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:()=>{_()}})]}),u.jsx("div",{className:"searchstax-facets-container-mobile",children:s==null?void 0:s.facets.map(f=>u.jsx("div",{className:`searchstax-facet-container ${y(f.name)?"active":""}`,children:u.jsxs("div",{children:[u.jsxs("div",{className:"searchstax-facet-title-container",onClick:()=>{w(f.name)},children:[u.jsxs("div",{className:"searchstax-facet-title",children:[" ",f.label," "]}),u.jsx("div",{className:"searchstax-facet-title-arrow active"})]}),u.jsxs("div",{className:"searchstax-facet-values-container",children:[f.values.map((v,R)=>(d[R+f.name]=I.createRef(),u.jsxs("div",{className:`searchstax-facet-value-container ${v.disabled?"searchstax-facet-value-disabled":""}`,ref:d[R+f.name],children:[u.jsx("div",{className:"searchstax-facet-input mobile-"+R+f.name,children:u.jsx("input",{type:"checkbox",className:"searchstax-facet-input-checkbox",checked:T(v),"aria-label":v.value+" "+v.count,readOnly:!0,disabled:v.disabled,onClick:J=>{j(R+f.name,J,v,!0,!0)}})}),u.jsx("div",{className:"searchstax-facet-value-label",onClick:J=>{j(R+f.name,J,v)},children:v.value}),u.jsxs("div",{className:"searchstax-facet-value-count",onClick:J=>{j(R+f.name,J,v)},children:["(",v.count,")"]})]},v.value+v.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:v=>{Y(v,f)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&Y(v,f)},tabIndex:0,children:[f.showingAllFacets&&u.jsx("div",{className:"searchstax-facet-show-less-button searchstax-facet-show-button",children:"less"}),!f.showingAllFacets&&u.jsx("div",{className:"searchstax-facet-show-more-button searchstax-facet-show-button",children:"more"})]})})]})]})},f.name+"mobile"))}),u.jsx("button",{className:"searchstax-facets-mobile-overlay-done",onClick:()=>{_()},children:"Done"})]})]})}),i.facetsTemplateMobile&&u.jsx(u.Fragment,{children:i.facetsTemplateMobile(s,r,d,y,w,j,T,S,Y,Q,_,k)})]})})}function Ls(i){let e=!1;const[t,s]=I.useState(null),[a]=I.useState(Math.random());I.useEffect(()=>{if(r(),C.searchstax)C.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||(C.searchstax.dataLayer.$searchRelatedSearchesData.subscribe(c=>{s(c)}),e=!0)}function n(c){var l;(l=C.searchstax.relatedSearchesWidget)==null||l.executeSearch(c)}return u.jsxs(u.Fragment,{children:[!i.searchRelatedSearchesTemplate&&t&&(t==null?void 0:t.searchExecuted)&&(t==null?void 0:t.hasRelatedSearches)&&u.jsxs("div",{className:"searchstax-related-searches-container",id:"searchstax-related-searches-container",children:[" ","Related searches: ",u.jsx("span",{id:"searchstax-related-searches"}),t.relatedSearches&&u.jsx("span",{className:"searchstax-related-search",children:t.relatedSearches.map(c=>u.jsxs("span",{onClick:()=>{n(c)},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&n(c)},tabIndex:0,className:"searchstax-related-search searchstax-related-search-item",children:[" ",c.related_search,!c.last&&u.jsx("span",{children:","})]},c.related_search))})]}),i.searchRelatedSearchesTemplate&&u.jsx(u.Fragment,{children:i.searchRelatedSearchesTemplate(t,n)})]})}function fs(i){let e=!1;const[t,s]=I.useState(null),[a]=I.useState(Math.random());I.useEffect(()=>{if(r(),C.searchstax)C.searchstax.addExternalPromotionsWidget("searchstax-external-promotions-layout-container"+a,{});else throw Error("Searchstax instance needs to be passed via props")},[]);function r(){e||(C.searchstax.dataLayer.$searchExternalPromotionsData.subscribe(c=>{s(c)}),e=!0)}function n(c,l){var d;(d=C.searchstax.externalPromotionsWidget)==null||d.trackClick(c,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:t.externalPromotions.map(c=>u.jsxs("div",{className:"searchstax-external-promotion searchstax-search-result",children:[u.jsx("div",{className:"icon-elevated"}),c.url&&u.jsx("a",{href:c.url,onClick:l=>{n(c,l)},className:"searchstax-result-item-link"}),u.jsx("div",{className:"searchstax-search-result-title-container",children:u.jsx("span",{className:"searchstax-search-result-title",children:c.name})}),c.description&&u.jsxs("p",{className:"searchstax-search-result-description searchstax-search-result-common",children:[" ",c.description," "]}),c.url&&u.jsxs("p",{className:"searchstax-search-result-description searchstax-search-result-common",children:[" ",c.url," "]})]},c.id))}),i.searchExternalPromotionsTemplate&&u.jsx(u.Fragment,{children:i.searchExternalPromotionsTemplate(t,n)})]})})}function Ms(i){let e=!1;const[t,s]=I.useState(null),[a]=I.useState(Math.random());I.useEffect(()=>{if(n(),C.searchstax)C.searchstax.addAnswerWidget("searchstax-answer-container"+a,{showShowMoreAfterWordCount:i.showShowMoreAfterWordCount});else throw Error("Searchstax instance needs to be passed via props")},[]);function r(c){var l;C.searchstax&&((l=C.searchstax.answerWidget)==null||l.showMore(c))}function n(){e||(C.searchstax.dataLayer.$answerData.subscribe(c=>{s(c)}),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.jsxs("div",{children:[u.jsxs("div",{className:"searchstax-answer-container"+(t.showMoreButtonVisible===!0?"searchstax-answer-show-more":""),children:[u.jsx("div",{className:"searchstax-answer-title",children:"Answer"}),u.jsxs("div",{className:"searchstax-answer-description",children:[t.showMoreButtonVisible===!0?t.answerTruncated:t.answer,t.answerLoading&&u.jsx("div",{className:"searchstax-answer-loading"})]})]}),t.showMoreButtonVisible===!0&&u.jsx("div",{className:"searchstax-answer-load-more-button-container",children:u.jsx("button",{className:"searchstax-answer-load-more-button",onClick:c=>{r(c)},children:"Show More..."})})]}),i.searchAnswerTemplate&&t&&t.shouldShowAnswer&&u.jsx(u.Fragment,{children:i.searchAnswerTemplate(t,r)})]})})}exports.SearchstaxAnswerWidget=Ms;exports.SearchstaxExternalPromotionsWidget=fs;exports.SearchstaxFacetsWidget=ps;exports.SearchstaxInputWidget=ls;exports.SearchstaxOverviewWidget=ms;exports.SearchstaxPaginationWidget=ds;exports.SearchstaxRelatedSearchesWidget=Ls;exports.SearchstaxResultWidget=us;exports.SearchstaxSortingWidget=gs;exports.SearchstaxWrapper=hs;