@magicpages/ghost-typesense-search-ui 1.3.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/search.min.js +1 -1
- package/package.json +5 -5
package/dist/search.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const BUNDLED_CSS="/* Base document styles for iframe */\n:root {\n /* Color system */\n --color-base-50: 255 255 255;\n --color-base-100: 250 250 250;\n --color-base-200: 229 231 235;\n --color-base-300: 209 213 219;\n --color-base-700: 55 65 81;\n --color-base-800: 31 41 55;\n --color-base-900: 17 24 39;\n --color-base-950: 3 7 18;\n\n /* Animation configs */\n --transition-base: 80ms cubic-bezier(0.4, 0, 0.2, 1);\n --transition-smooth: 120ms cubic-bezier(0.4, 0, 0.2, 1);\n --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n}\n\n/* System/Default theme (light) */\n#mp-search-wrapper {\n --color-surface: rgb(252, 252, 252);\n --color-surface-elevated: rgb(255, 255, 255);\n --color-surface-hover: rgba(0, 0, 0, 0.04);\n --color-text: rgb(23, 23, 23);\n --color-text-secondary: rgb(82, 82, 82);\n --color-border: rgba(0, 0, 0, 0.08);\n --color-backdrop: rgba(0, 0, 0, 0.15);\n --accent-color: var(--ghost-accent-color, #6366f1);\n --accent-color-hover: color-mix(in srgb, black 15%, var(--accent-color));\n --color-result-bg: rgb(252, 252, 252);\n --color-result-hover: color-mix(in srgb, var(--accent-color) 8%, transparent);\n}\n\n/* Dark theme based on system preference */\n@media (prefers-color-scheme: dark) {\n #mp-search-wrapper {\n --color-surface: rgb(32, 32, 32);\n --color-surface-elevated: rgb(45, 45, 45);\n --color-surface-hover: rgba(255, 255, 255, 0.04);\n --color-text: rgb(250, 250, 250);\n --color-text-secondary: rgb(161, 161, 161);\n --color-border: rgba(255, 255, 255, 0.08);\n --color-backdrop: rgba(0, 0, 0, 0.4);\n --accent-color: var(--ghost-accent-color, #818cf8);\n --accent-color-hover: color-mix(in srgb, white 15%, var(--accent-color));\n --color-result-bg: rgb(38, 38, 38);\n --color-result-hover: color-mix(in srgb, var(--accent-color) 8%, transparent);\n }\n}\n\n/* Base resets for iframe document */\nhtml,\nbody {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n line-height: 1.5;\n}\n\n/* Utility classes */\n.hidden {\n display: none !important;\n}\n\n/* List reset */\n.list-none {\n list-style: none !important;\n padding-left: 0;\n}\n\n/* Reset InstantSearch cancel button */\n.ais-SearchBox-input[type=\"search\"]::-webkit-search-cancel-button {\n display: none;\n}\n\n/* Modal structure */\n#mp-search-wrapper {\n position: fixed;\n inset: 0;\n width: 100%;\n height: 100%;\n display: flex;\n background-color: var(--color-backdrop);\n backdrop-filter: blur(4px);\n align-items: flex-start;\n justify-content: center;\n -webkit-tap-highlight-color: transparent;\n padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);\n /* Above subscribe button on mobile */\n z-index: 3999999;\n}\n\n@media (min-width: 640px) {\n #mp-search-wrapper {\n /* Below subscribe button on desktop */\n z-index: 3999997;\n }\n}\n\n#mp-search-modal {\n position: fixed;\n inset: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n padding: 0;\n}\n\n@media (min-width: 640px) {\n #mp-search-modal {\n padding-top: 10vh;\n padding-left: 1rem;\n padding-right: 1rem;\n }\n}\n\n#mp-search-modal.hidden {\n display: none;\n}\n\n/* Backdrop with glass effect */\n.mp-backdrop {\n position: fixed;\n inset: 0;\n width: 100%;\n height: 100%;\n backdrop-filter: blur(8px);\n background: var(--color-backdrop);\n transition: opacity var(--transition-smooth);\n}\n\n/* Modal container and content */\n.mp-modal-container {\n position: relative;\n z-index: 1;\n width: 100%;\n max-width: 42rem;\n margin: 0 auto;\n padding: 0;\n height: 100vh;\n display: flex;\n flex-direction: column;\n transition: transform 0.1s ease-out;\n}\n\n@media (min-width: 640px) {\n .mp-modal-container {\n padding: 1.25rem;\n height: auto;\n max-height: 60vh;\n min-height: 20vh;\n }\n}\n\n@media (min-width: 640px) {\n .mp-modal-container {\n padding: 1.25rem;\n }\n}\n\n.mp-modal-content {\n background: var(--color-surface);\n border: none;\n border-radius: 0;\n box-shadow: none;\n overflow: hidden;\n width: 100%;\n position: relative;\n height: 100%;\n display: flex;\n flex-direction: column;\n /* Ensure content doesn't overflow viewport */\n max-height: 100%;\n}\n\n@media (min-width: 640px) {\n .mp-modal-content {\n border: 1px solid var(--color-border);\n border-radius: 0.75rem;\n box-shadow: var(--shadow-lg);\n }\n}\n\n\n\n.mp-results-container {\n overflow-y: auto;\n overscroll-behavior: contain;\n position: relative;\n scroll-behavior: smooth;\n padding: 0.5rem 0;\n -webkit-overflow-scrolling: touch;\n flex: 1;\n min-height: 0;\n background: var(--color-surface);\n}\n\n@media (min-width: 640px) {\n .mp-results-container {\n height: auto;\n max-height: calc(60vh - 4rem);\n padding-bottom: 1rem;\n }\n}\n\n/* Loading state */\n.mp-loading-state {\n display: none;\n padding: 2rem 1.25rem;\n text-align: center;\n color: var(--color-text-secondary);\n}\n\n.mp-loading-state.active {\n display: block;\n}\n\n.mp-loading-spinner {\n display: inline-block;\n width: 2rem;\n height: 2rem;\n margin-bottom: 1rem;\n border: 2px solid var(--color-border);\n border-top-color: var(--accent-color);\n border-radius: 50%;\n animation: mp-spin 0.8s linear infinite;\n}\n\n@keyframes mp-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Search header */\n.mp-search-header {\n align-items: center;\n border-bottom: 1px solid var(--color-border);\n padding: 0.75rem 1.25rem;\n position: relative;\n background: var(--color-surface-elevated);\n display: grid;\n grid-template-columns: 1fr auto;\n align-items: center;\n gap: 1rem;\n}\n\n@media (min-width: 640px) {\n .mp-search-header {\n padding: 0.875rem 1.5rem;\n }\n}\n\n.mp-search-input {\n -webkit-appearance: none;\n background: transparent;\n border-radius: 0.75rem;\n border: none;\n box-shadow: none;\n color: var(--color-text);\n font-size: 1rem;\n height: 2.75rem;\n outline: none;\n padding: 0.75rem 0.75rem 0.75rem 2.75rem;\n width: 100%;\n transition: all var(--transition-smooth);\n background: var(--color-surface);\n letter-spacing: -0.011em;\n}\n\n@media (min-width: 640px) {\n .mp-search-input {\n font-size: 1.125rem;\n height: 3rem;\n padding: 0.875rem 0.875rem 0.875rem 3rem;\n }\n}\n\n.mp-search-input:focus,\n.mp-search-input:focus-visible {\n background: var(--color-surface-hover);\n outline: none;\n box-shadow: none;\n}\n\n.mp-search-input::placeholder {\n color: var(--color-text-secondary);\n opacity: 0.7;\n}\n\n.mp-search-header {\n position: relative;\n padding-right: 4.25rem;\n}\n\n.mp-search-header:before {\n content: \"\";\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='rgb(55, 65, 81)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z' /%3E%3C/svg%3E\");\n height: 1.125rem;\n width: 1.125rem;\n position: absolute;\n left: 2rem;\n top: 50%;\n transform: translateY(-50%);\n opacity: 0.7;\n color: var(--color-text);\n pointer-events: none;\n z-index: 1;\n transition: opacity var(--transition-base);\n}\n\n@media (min-width: 640px) {\n .mp-search-header {\n padding-right: 0;\n }\n\n .mp-search-header:before {\n left: 2.4rem;\n top: 50%;\n }\n}\n\n.dark .mp-search-header:before {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='rgb(209, 213, 219)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z' /%3E%3C/svg%3E\");\n}\n\n/* Results container */\n.mp-results-container {\n flex: 1;\n overflow-y: auto;\n padding: 0.75rem calc(1.5rem - 6px) 0.75rem 1.5rem;\n scroll-behavior: smooth;\n min-height: 0;\n}\n\n.mp-results-container::-webkit-scrollbar {\n width: 6px;\n}\n\n.mp-results-container::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.mp-results-container::-webkit-scrollbar-thumb {\n background: var(--color-border);\n border-radius: 3px;\n}\n\n.mp-results-container> :last-child {\n margin-bottom: 0.75rem;\n}\n\n/* Common searches */\n.mp-common-searches {\n padding: 0.75rem 0;\n padding-right: 6px;\n margin: 0;\n}\n\n.mp-common-searches.hidden {\n display: none;\n}\n\n.mp-common-searches-title {\n color: var(--color-text-secondary);\n font-size: 0.75rem;\n font-weight: 600;\n letter-spacing: 0.05em;\n margin: 0 0 0.75rem;\n text-transform: uppercase;\n}\n\n.mp-common-search-btn {\n background: transparent;\n border: none;\n color: var(--color-text);\n border-radius: 0.5rem;\n cursor: pointer;\n display: flex;\n align-items: center;\n width: 100%;\n padding: 0.75rem 1rem;\n text-decoration: none;\n transition: all var(--transition-base);\n font-size: 0.875rem;\n text-align: left;\n border: 1px solid transparent;\n}\n\n.mp-common-search-btn:hover,\n.mp-common-search-btn.mp-selected {\n background: var(--color-result-hover);\n border-color: var(--accent-color);\n}\n\n.mp-hits-list {\n margin-block-start: 0.5rem;\n margin-block-end: 0.5rem;\n}\n\n/* Search result link wrapper */\n.mp-result-link {\n text-decoration: none;\n color: inherit;\n display: block;\n}\n\n/* Search results */\n.mp-result-item {\n border-radius: 0.75rem;\n display: block;\n margin: 0.5rem 0;\n padding: 1.25rem;\n text-decoration: none;\n transition: background-color var(--transition-base), transform var(--transition-base);\n border: 1px solid transparent;\n word-break: break-word;\n background: var(--color-result-bg);\n}\n\n.mp-result-link:hover .mp-result-item,\n.mp-result-link.mp-selected .mp-result-item,\n.mp-result-link:focus .mp-result-item {\n background: var(--color-result-hover);\n border-color: var(--accent-color);\n transform: translateX(2px);\n}\n\n.mp-result-title {\n color: var(--accent-color);\n font-size: 1.125rem;\n font-weight: 600;\n line-height: 1.4;\n margin-top: 0;\n margin-bottom: 0.5rem;\n word-break: break-word;\n transition: color var(--transition-base);\n}\n\n.mp-result-excerpt {\n color: var(--color-text-secondary);\n font-size: 0.9375rem;\n line-height: 1.6;\n margin: 0;\n word-break: break-word;\n}\n\n/* Keyboard hints */\n.mp-keyboard-hints {\n display: flex;\n align-items: center;\n font-size: 0.75rem;\n gap: 1rem;\n color: var(--color-text-secondary);\n white-space: nowrap;\n user-select: none;\n margin-right: 0.5rem;\n}\n\n.mp-kbd {\n background: var(--color-surface-elevated);\n border: 1px solid var(--color-border);\n border-radius: 0.375rem;\n color: var(--color-text-secondary);\n font-size: 0.75rem;\n padding: 0.25rem 0.375rem;\n box-shadow: var(--shadow-sm);\n font-size: 0.75rem;\n font-weight: 500;\n padding: 0.25rem 0.5rem;\n box-shadow: var(--shadow-sm);\n margin: 0 0.25rem;\n}\n\n/* Empty state */\n.mp-empty-message {\n color: var(--color-text-secondary);\n font-size: 1rem;\n padding: 2.5rem 1.5rem;\n text-align: center;\n}\n\n/* Close button */\n.mp-close-button {\n position: fixed;\n top: 1.25rem;\n right: 1.5rem;\n width: 2rem;\n height: 2rem;\n border-radius: 9999px;\n border: 1px solid var(--color-border);\n background: var(--color-surface-elevated);\n color: var(--color-text-secondary);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all var(--transition-base);\n font-size: 1.25rem;\n line-height: 1;\n z-index: 50;\n padding: 0;\n}\n\n.mp-close-button:hover {\n background: var(--color-surface-hover);\n color: var(--color-text);\n border-color: var(--accent-color);\n}\n\n.mp-close-button:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--accent-color);\n border-color: var(--accent-color);\n}\n\n/* Highlight styles */\n.ais-Highlight-highlighted,\n.ais-Snippet-highlighted {\n background: none;\n background: color-mix(in srgb, var(--accent-color) 15%, transparent);\n color: color-mix(in srgb, var(--accent-color) 85%, var(--color-text));\n font-weight: 600;\n}\n\n/* Mobile optimizations */\n@media (max-width: 640px) {\n .mp-keyboard-hints {\n display: none;\n }\n\n .mp-modal-content {\n margin-top: 0;\n border-radius: 0;\n height: 100vh;\n }\n\n .mp-modal-container {\n padding: 0;\n margin: 0;\n }\n\n .mp-results-container {\n padding-bottom: 1.5rem;\n max-height: calc(100vh - 4rem);\n }\n}";!function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var r,i={},a={exports:{}};(r=a).exports=function(e){return e&&e.__esModule?e:{default:e}},r.exports.__esModule=!0,r.exports.default=r.exports;var o,s,c,u,l=a.exports,f={exports:{}},d={exports:{}};function h(){return o||(o=1,function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(d)),d.exports}function p(){if(u)return c;u=1;var e=(s||(s=1,function(e){var t=h().default;function n(){e.exports=n=function(){return i},e.exports.__esModule=!0,e.exports.default=e.exports;var r,i={},a=Object.prototype,o=a.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(r){d=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var i=t&&t.prototype instanceof _?t:_,a=Object.create(i.prototype),o=new I(r||[]);return s(a,"_invoke",{value:N(e,n,o)}),a}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=h;var m="suspendedStart",g="suspendedYield",v="executing",y="completed",b={};function _(){}function w(){}function S(){}var R={};d(R,u,(function(){return this}));var P=Object.getPrototypeOf,x=P&&P(P(F([])));x&&x!==a&&o.call(x,u)&&(R=x);var O=S.prototype=_.prototype=Object.create(R);function E(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,n){function r(i,a,s,c){var u=p(e[i],e,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==t(f)&&o.call(f,"__await")?n.resolve(f.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var i;s(this,"_invoke",{value:function(e,t){function a(){return new n((function(n,i){r(e,t,n,i)}))}return i=i?i.then(a,a):a()}})}function N(e,t,n){var i=m;return function(a,o){if(i===v)throw Error("Generator is already running");if(i===y){if("throw"===a)throw o;return{value:r,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var c=j(s,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===m)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=v;var u=p(e,t,n);if("normal"===u.type){if(i=n.done?y:g,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=y,n.method="throw",n.arg=u.arg)}}}function j(e,t){var n=t.method,i=e.iterator[n];if(i===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,j(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=p(i,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,b;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,b):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,b)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function F(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function t(){for(;++i<e.length;)if(o.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=r,t.done=!0,t};return a.next=a}}throw new TypeError(t(e)+" is not iterable")}return w.prototype=S,s(O,"constructor",{value:S,configurable:!0}),s(S,"constructor",{value:w,configurable:!0}),w.displayName=d(S,f,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,d(e,f,"GeneratorFunction")),e.prototype=Object.create(O),e},i.awrap=function(e){return{__await:e}},E(C.prototype),d(C.prototype,l,(function(){return this})),i.AsyncIterator=C,i.async=function(e,t,n,r,a){void 0===a&&(a=Promise);var o=new C(h(e,t,n,r),a);return i.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},E(O),d(O,f,"Generator"),d(O,u,(function(){return this})),d(O,"toString",(function(){return"[object Generator]"})),i.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},i.values=F,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,i){return s.type="throw",s.arg=e,t.next=n,i&&(t.method="next",t.arg=r),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:F(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),b}},i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(f)),f.exports)();c=e;try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return c}var m,g={exports:{}};function v(){return m||(m=1,function(e){function t(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(i,a){var o=e.apply(n,r);function s(e){t(o,i,a,s,c,"next",e)}function c(e){t(o,i,a,s,c,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports}(g)),g.exports}var y,b={exports:{}};function _(){return y||(y=1,function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}(b)),b.exports}var w,S,R,P={exports:{}},x={exports:{}},O={exports:{}};function E(){return w||(w=1,function(e){var t=h().default;e.exports=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,n||"default");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(O)),O.exports}function C(){return S||(S=1,function(e){var t=h().default,n=E();e.exports=function(e){var r=n(e,"string");return"symbol"==t(r)?r:r+""},e.exports.__esModule=!0,e.exports.default=e.exports}(x)),x.exports}function N(){return R||(R=1,function(e){var t=C();function n(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,t(i.key),i)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports}(P)),P.exports}var j,T,k={},I={},F={},A={},M={exports:{}};function L(){return T||(T=1,function(t){var n,r;n=e,r=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],i={},a=null;function o(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply||Function.prototype.apply.apply(console.log,[console,arguments])),console.trace}function c(){for(var n=this.getLevel(),i=0;i<r.length;i++){var a=r[i];this[a]=i<n?e:this.methodFactory(a,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return"No console available for logging"}function u(e){return function(){typeof console!==t&&(c.call(this),this[e].apply(this,arguments))}}function l(r,i,a){return function(r){return"debug"===r&&(r="log"),typeof console!==t&&("trace"===r&&n?s:void 0!==console[r]?o(console,r):void 0!==console.log?o(console,"log"):e)}(r)||u.apply(this,arguments)}function f(e,n){var o,s,u,f=this,d="loglevel";function h(){var e;if(typeof window!==t&&d){try{e=window.localStorage[d]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(d),i=n.indexOf(r+"=");-1!==i&&(e=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch(e){}return void 0===f.levels[e]&&(e=void 0),e}}function p(e){var t=e;if("string"==typeof t&&void 0!==f.levels[t.toUpperCase()]&&(t=f.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=f.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?d+=":"+e:"symbol"==typeof e&&(d=void 0),f.name=e,f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},f.methodFactory=n||l,f.getLevel=function(){return null!=u?u:null!=s?s:o},f.setLevel=function(e,n){return u=p(e),!1!==n&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t&&d){try{return void(window.localStorage[d]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(d)+"="+n+";"}catch(e){}}}(u),c.call(f)},f.setDefaultLevel=function(e){s=p(e),h()||f.setLevel(e,!1)},f.resetLevel=function(){u=null,function(){if(typeof window!==t&&d){try{window.localStorage.removeItem(d)}catch(e){}try{window.document.cookie=encodeURIComponent(d)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),c.call(f)},f.enableAll=function(e){f.setLevel(f.levels.TRACE,e)},f.disableAll=function(e){f.setLevel(f.levels.SILENT,e)},f.rebuild=function(){if(a!==f&&(o=p(a.getLevel())),c.call(f),a===f)for(var e in i)i[e].rebuild()},o=p(a?a.getLevel():"WARN");var m=h();null!=m&&(u=p(m)),c.call(f)}(a=new f).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=i[e];return t||(t=i[e]=new f(e,a.methodFactory)),t};var d=typeof window!==t?window.log:void 0;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=d),a},a.getLoggers=function(){return i},a.default=a,a},t.exports?t.exports=r():n.log=r()}(M)),M.exports}var H,D,q={},U={},W={};function B(){if(H)return W;H=1;var t,n=e&&e.__extends||(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)});Object.defineProperty(W,"__esModule",{value:!0});var r=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this;return r.name=n.name,Object.setPrototypeOf(r,n.prototype),r}return n(t,e),t}(Error);return W.default=r,W}var $,V,Q,K,z,G,J,Y,X,Z,ee={},te={},ne={},re={},ie={},ae={},oe={},se={};function ce(){if(X)return q;X=1;var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(q,"__esModule",{value:!0}),q.ImportError=q.TypesenseError=q.ServerError=q.RequestUnauthorized=q.RequestMalformed=q.ObjectUnprocessable=q.ObjectNotFound=q.ObjectAlreadyExists=q.MissingConfigurationError=q.HTTPError=void 0;var n=t(function(){if(D)return U;D=1;var t,n=e&&e.__extends||(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(U,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(r(B()).default);return U.default=i,U}());q.HTTPError=n.default;var r=t(function(){if($)return ee;$=1;var t,n=e&&e.__extends||(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ee,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(r(B()).default);return ee.default=i,ee}());q.MissingConfigurationError=r.default;var i=t(function(){if(V)return te;V=1;var t,n=e&&e.__extends||(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(te,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(r(B()).default);return te.default=i,te}());q.ObjectAlreadyExists=i.default;var a=t(function(){if(Q)return ne;Q=1;var t,n=e&&e.__extends||(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ne,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(r(B()).default);return ne.default=i,ne}());q.ObjectNotFound=a.default;var o=t(function(){if(K)return re;K=1;var t,n=e&&e.__extends||(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(re,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(r(B()).default);return re.default=i,re}());q.ObjectUnprocessable=o.default;var s=t(function(){if(z)return ie;z=1;var t,n=e&&e.__extends||(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ie,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(r(B()).default);return ie.default=i,ie}());q.RequestMalformed=s.default;var c=t(function(){if(G)return ae;G=1;var t,n=e&&e.__extends||(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ae,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(r(B()).default);return ae.default=i,ae}());q.RequestUnauthorized=c.default;var u=t(function(){if(J)return oe;J=1;var t,n=e&&e.__extends||(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(oe,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(r(B()).default);return oe.default=i,oe}());q.ServerError=u.default;var l=t(function(){if(Y)return se;Y=1;var t,n=e&&e.__extends||(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(se,"__esModule",{value:!0});var i=function(e){function t(t,n){var r=e.call(this,t)||this;return r.importResults=n,r}return n(t,e),t}(r(B()).default);return se.default=i,se}());q.ImportError=l.default;var f=t(B());return q.TypesenseError=f.default,q}function ue(){if(Z)return A;Z=1;var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)},n=e&&e.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t};Object.defineProperty(A,"__esModule",{value:!0});var a=i(L()),o=ce(),s=function(){function e(e){var n=this;this.nodes=e.nodes||[],this.nodes=this.nodes.map((function(e){return n.setDefaultPathInNode(e)})).map((function(e){return n.setDefaultPortInNode(e)})).map((function(e){return t({},e)})),null==e.randomizeNodes&&(e.randomizeNodes=!0),!0===e.randomizeNodes&&this.shuffleArray(this.nodes),this.nearestNode=e.nearestNode,this.nearestNode=this.setDefaultPathInNode(this.nearestNode),this.nearestNode=this.setDefaultPortInNode(this.nearestNode),this.connectionTimeoutSeconds=e.connectionTimeoutSeconds||e.timeoutSeconds||5,this.healthcheckIntervalSeconds=e.healthcheckIntervalSeconds||60,this.numRetries=e.numRetries||this.nodes.length+(null==this.nearestNode?0:1)||3,this.retryIntervalSeconds=e.retryIntervalSeconds||.1,this.apiKey=e.apiKey,this.sendApiKeyAsQueryParam=e.sendApiKeyAsQueryParam,this.cacheSearchResultsForSeconds=e.cacheSearchResultsForSeconds||0,this.useServerSideSearchCache=e.useServerSideSearchCache||!1,this.logger=e.logger||a,this.logLevel=e.logLevel||"warn",this.logger.setLevel(this.logLevel),this.additionalHeaders=e.additionalHeaders,this.httpAgent=e.httpAgent,this.httpsAgent=e.httpsAgent,this.showDeprecationWarnings(e),this.validate()}return e.prototype.validate=function(){if(null==this.nodes||0===this.nodes.length||this.validateNodes())throw new o.MissingConfigurationError("Ensure that nodes[].protocol, nodes[].host and nodes[].port are set");if(null!=this.nearestNode&&this.isNodeMissingAnyParameters(this.nearestNode))throw new o.MissingConfigurationError("Ensure that nearestNodes.protocol, nearestNodes.host and nearestNodes.port are set");if(null==this.apiKey)throw new o.MissingConfigurationError("Ensure that apiKey is set");return!0},e.prototype.validateNodes=function(){var e=this;return this.nodes.some((function(t){return e.isNodeMissingAnyParameters(t)}))},e.prototype.isNodeMissingAnyParameters=function(e){return!["protocol","host","port","path"].every((function(t){return e.hasOwnProperty(t)}))&&null==e.url},e.prototype.setDefaultPathInNode=function(e){return null==e||e.hasOwnProperty("path")||(e.path=""),e},e.prototype.setDefaultPortInNode=function(e){if(null!=e&&!e.hasOwnProperty("port")&&e.hasOwnProperty("protocol"))switch(e.protocol){case"https":e.port=443;break;case"http":e.port=80}return e},e.prototype.showDeprecationWarnings=function(e){e.timeoutSeconds&&this.logger.warn("Deprecation warning: timeoutSeconds is now renamed to connectionTimeoutSeconds"),e.masterNode&&this.logger.warn("Deprecation warning: masterNode is now consolidated to nodes, starting with Typesense Server v0.12"),e.readReplicaNodes&&this.logger.warn("Deprecation warning: readReplicaNodes is now consolidated to nodes, starting with Typesense Server v0.12")},e.prototype.shuffleArray=function(e){for(var t,n=e.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1));t=[e[r],e[n]],e[n]=t[0],e[r]=t[1]}},e}();return A.default=s,A}var le,fe,de,he={};function pe(){if(fe)return le;function t(e,t){return function(){return e.apply(t,arguments)}}fe=1;const{toString:n}=Object.prototype,{getPrototypeOf:r}=Object,i=(a=Object.create(null),e=>{const t=n.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const o=e=>(e=e.toLowerCase(),t=>i(t)===e),s=e=>t=>typeof t===e,{isArray:c}=Array,u=s("undefined"),l=o("ArrayBuffer"),f=s("string"),d=s("function"),h=s("number"),p=e=>null!==e&&"object"==typeof e,m=e=>{if("object"!==i(e))return!1;const t=r(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},g=o("Date"),v=o("File"),y=o("Blob"),b=o("FileList"),_=o("URLSearchParams"),[w,S,R,P]=["ReadableStream","Request","Response","Headers"].map(o);function x(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),c(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function O(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:e,C=e=>!u(e)&&e!==E,N=(j="undefined"!=typeof Uint8Array&&r(Uint8Array),e=>j&&e instanceof j);var j;const T=o("HTMLFormElement"),k=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),I=o("RegExp"),F=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};x(n,((n,i)=>{let a;!1!==(a=t(n,i,e))&&(r[i]=a||n)})),Object.defineProperties(e,r)},A="abcdefghijklmnopqrstuvwxyz",M="0123456789",L={DIGIT:M,ALPHA:A,ALPHA_DIGIT:A+A.toUpperCase()+M},H=o("AsyncFunction"),D=(q="function"==typeof setImmediate,U=d(E.postMessage),q?setImmediate:U?(W=`axios@${Math.random()}`,B=[],E.addEventListener("message",(({source:e,data:t})=>{e===E&&t===W&&B.length&&B.shift()()}),!1),e=>{B.push(e),E.postMessage(W,"*")}):e=>setTimeout(e));var q,U,W,B;const $="undefined"!=typeof queueMicrotask?queueMicrotask.bind(E):"undefined"!=typeof process&&process.nextTick||D;var V={isArray:c,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&d(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||d(e.append)&&("formdata"===(t=i(e))||"object"===t&&d(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer),t},isString:f,isNumber:h,isBoolean:e=>!0===e||!1===e,isObject:p,isPlainObject:m,isReadableStream:w,isRequest:S,isResponse:R,isHeaders:P,isUndefined:u,isDate:g,isFile:v,isBlob:y,isRegExp:I,isFunction:d,isStream:e=>p(e)&&d(e.pipe),isURLSearchParams:_,isTypedArray:N,isFileList:b,forEach:x,merge:function e(){const{caseless:t}=C(this)&&this||{},n={},r=(r,i)=>{const a=t&&O(n,i)||i;m(n[a])&&m(r)?n[a]=e(n[a],r):m(r)?n[a]=e({},r):c(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&x(arguments[e],r);return n},extend:(e,n,r,{allOwnKeys:i}={})=>(x(n,((n,i)=>{r&&d(n)?e[i]=t(n,r):e[i]=n}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,i)=>{let a,o,s;const c={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],i&&!i(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==n&&r(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:o,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(c(e))return e;let t=e.length;if(!h(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:T,hasOwnProperty:k,hasOwnProp:k,reduceDescriptors:F,freezeMethods:e=>{F(e,((t,n)=>{if(d(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];d(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return c(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:O,global:E,isContextDefined:C,ALPHABET:L,generateString:(e=16,t=L.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&d(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(p(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=c(e)?[]:{};return x(e,((e,t)=>{const a=n(e,r+1);!u(a)&&(i[t]=a)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:H,isThenable:e=>e&&(p(e)||d(e))&&d(e.then)&&d(e.catch),setImmediate:D,asap:$};function Q(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}V.inherits(Q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:V.toJSONObject(this.config),code:this.code,status:this.status}}});const K=Q.prototype,z={};function G(e){return V.isPlainObject(e)||V.isArray(e)}function J(e){return V.endsWith(e,"[]")?e.slice(0,-2):e}function Y(e,t,n){return e?e.concat(t).map((function(e,t){return e=J(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{z[e]={value:e}})),Object.defineProperties(Q,z),Object.defineProperty(K,"isAxiosError",{value:!0}),Q.from=(e,t,n,r,i,a)=>{const o=Object.create(K);return V.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Q.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const X=V.toFlatObject(V,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Z(e,t,n){if(!V.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=V.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!V.isUndefined(t[e])}))).metaTokens,i=n.visitor||u,a=n.dots,o=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&V.isSpecCompliantForm(t);if(!V.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(V.isDate(e))return e.toISOString();if(!s&&V.isBlob(e))throw new Q("Blob is not supported. Use a Buffer instead.");return V.isArrayBuffer(e)||V.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(V.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(V.isArray(e)&&function(e){return V.isArray(e)&&!e.some(G)}(e)||(V.isFileList(e)||V.endsWith(n,"[]"))&&(s=V.toArray(e)))return n=J(n),s.forEach((function(e,r){!V.isUndefined(e)&&null!==e&&t.append(!0===o?Y([n],r,a):null===o?n:n+"[]",c(e))})),!1;return!!G(e)||(t.append(Y(i,n,a),c(e)),!1)}const l=[],f=Object.assign(X,{defaultVisitor:u,convertValue:c,isVisitable:G});if(!V.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!V.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),V.forEach(n,(function(n,a){!0===(!(V.isUndefined(n)||null===n)&&i.call(t,n,V.isString(a)?a.trim():a,r,f))&&e(n,r?r.concat(a):[a])})),l.pop()}}(e),t}function ee(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function te(e,t){this._pairs=[],e&&Z(e,this,t)}const ne=te.prototype;function re(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ie(e,t,n){if(!t)return e;const r=n&&n.encode||re;V.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let a;if(a=i?i(t,n):V.isURLSearchParams(t)?t.toString():new te(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}ne.append=function(e,t){this._pairs.push([e,t])},ne.toString=function(e){const t=e?function(t){return e.call(this,t,ee)}:ee;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var ae=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){V.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},oe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},se={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:te,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ce="undefined"!=typeof window&&"undefined"!=typeof document,ue="object"==typeof navigator&&navigator||void 0,de=ce&&(!ue||["ReactNative","NativeScript","NS"].indexOf(ue.product)<0),he="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,pe=ce&&window.location.href||"http://localhost";var me={...Object.freeze({__proto__:null,hasBrowserEnv:ce,hasStandardBrowserWebWorkerEnv:he,hasStandardBrowserEnv:de,navigator:ue,origin:pe}),...se};function ge(e){function t(e,n,r,i){let a=e[i++];if("__proto__"===a)return!0;const o=Number.isFinite(+a),s=i>=e.length;return a=!a&&V.isArray(r)?r.length:a,s?(V.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o):(r[a]&&V.isObject(r[a])||(r[a]=[]),t(e,n,r[a],i)&&V.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}(r[a])),!o)}if(V.isFormData(e)&&V.isFunction(e.entries)){const n={};return V.forEachEntry(e,((e,r)=>{t(function(e){return V.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ve={transitional:oe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=V.isObject(e);if(i&&V.isHTMLForm(e)&&(e=new FormData(e)),V.isFormData(e))return r?JSON.stringify(ge(e)):e;if(V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)||V.isReadableStream(e))return e;if(V.isArrayBufferView(e))return e.buffer;if(V.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Z(e,new me.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return me.isNode&&V.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=V.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Z(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e){if(V.isString(e))try{return(0,JSON.parse)(e),V.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ve.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(V.isResponse(e)||V.isReadableStream(e))return e;if(e&&V.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Q.from(e,Q.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:me.classes.FormData,Blob:me.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch"],(e=>{ve.headers[e]={}}));var ye=ve;const be=V.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_e=Symbol("internals");function we(e){return e&&String(e).trim().toLowerCase()}function Se(e){return!1===e||null==e?e:V.isArray(e)?e.map(Se):String(e)}function Re(e,t,n,r,i){return V.isFunction(r)?r.call(this,t,n):(i&&(t=n),V.isString(t)?V.isString(r)?-1!==t.indexOf(r):V.isRegExp(r)?r.test(t):void 0:void 0)}class Pe{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=we(t);if(!i)throw new Error("header name must be a non-empty string");const a=V.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=Se(e))}const a=(e,t)=>V.forEach(e,((e,n)=>i(e,n,t)));if(V.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(V.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&be[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(V.isHeaders(e))for(const[t,r]of e.entries())i(r,t,n);else null!=e&&i(t,e,n);return this}get(e,t){if(e=we(e)){const n=V.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(V.isFunction(t))return t.call(this,e,n);if(V.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=we(e)){const n=V.findKey(this,e);return!(!n||void 0===this[n]||t&&!Re(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=we(e)){const i=V.findKey(n,e);!i||t&&!Re(0,n[i],i,t)||(delete n[i],r=!0)}}return V.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!Re(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return V.forEach(this,((r,i)=>{const a=V.findKey(n,i);if(a)return t[a]=Se(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();o!==i&&delete t[i],t[o]=Se(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return V.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&V.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[_e]=this[_e]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=we(e);t[r]||(function(e,t){const n=V.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return V.isArray(e)?e.forEach(r):r(e),this}}Pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),V.reduceDescriptors(Pe.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),V.freezeMethods(Pe);var xe=Pe;function Oe(e,t){const n=this||ye,r=t||n,i=xe.from(r.headers);let a=r.data;return V.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function Ee(e){return!(!e||!e.__CANCEL__)}function Ce(e,t,n){Q.call(this,null==e?"canceled":e,Q.ERR_CANCELED,t,n),this.name="CanceledError"}function Ne(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Q("Request failed with status code "+n.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}V.inherits(Ce,Q,{__CANCEL__:!0});const je=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=r[o];i||(i=c),n[a]=s,r[a]=c;let l=o,f=0;for(;l!==a;)f+=n[l++],l%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),c-i<t)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,i=0,a=1e3/t;const o=(t,a=Date.now())=>{i=a,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),s=t-i;s>=a?o(e,t):(n=e,r||(r=setTimeout((()=>{r=null,o(n)}),a-s)))},()=>n&&o(n)]}((n=>{const a=n.loaded,o=n.lengthComputable?n.total:void 0,s=a-r,c=i(s);r=a,e({loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&a<=o?(o-a)/c:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},Te=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ke=e=>(...t)=>V.asap((()=>e(...t)));var Ie=me.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,me.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(me.origin),me.navigator&&/(msie|trident)/i.test(me.navigator.userAgent)):()=>!0,Fe=me.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const o=[e+"="+encodeURIComponent(t)];V.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),V.isString(r)&&o.push("path="+r),V.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Ae(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Me=e=>e instanceof xe?{...e}:e;function Le(e,t){t=t||{};const n={};function r(e,t,n,r){return V.isPlainObject(e)&&V.isPlainObject(t)?V.merge.call({caseless:r},e,t):V.isPlainObject(t)?V.merge({},t):V.isArray(t)?t.slice():t}function i(e,t,n,i){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function a(e,t){if(!V.isUndefined(t))return r(void 0,t)}function o(e,t){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,a){return a in t?r(n,i):a in e?r(void 0,n):void 0}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(Me(e),Me(t),0,!0)};return V.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=c[r]||i,o=a(e[r],t[r],r);V.isUndefined(o)&&a!==s||(n[r]=o)})),n}var He=e=>{const t=Le({},e);let n,{data:r,withXSRFToken:i,xsrfHeaderName:a,xsrfCookieName:o,headers:s,auth:c}=t;if(t.headers=s=xe.from(s),t.url=ie(Ae(t.baseURL,t.url),e.params,e.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),V.isFormData(r))if(me.hasStandardBrowserEnv||me.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(n=s.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(me.hasStandardBrowserEnv&&(i&&V.isFunction(i)&&(i=i(t)),i||!1!==i&&Ie(t.url))){const e=a&&o&&Fe.read(o);e&&s.set(a,e)}return t},De="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=He(e);let i=r.data;const a=xe.from(r.headers).normalize();let o,s,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:h}=r;function p(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=xe.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ne((function(e){t(e),p()}),(function(e){n(e),p()}),{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Q("Request aborted",Q.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Q("Network Error",Q.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||oe;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Q(t,i.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,e,m)),m=null},void 0===i&&a.setContentType(null),"setRequestHeader"in m&&V.forEach(a.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),V.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),h&&([c,l]=je(h,!0),m.addEventListener("progress",c)),d&&m.upload&&([s,u]=je(d),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(o=t=>{m&&(n(!t||t.type?new Ce(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const v=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);v&&-1===me.protocols.indexOf(v)?n(new Q("Unsupported protocol "+v+":",Q.ERR_BAD_REQUEST,e)):m.send(i||null)}))},qe=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Q?t:new Ce(t instanceof Error?t.message:t))}};let a=t&&setTimeout((()=>{a=null,i(new Q(`timeout ${t} of ms exceeded`,Q.ETIMEDOUT))}),t);const o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)})),e=null)};e.forEach((e=>e.addEventListener("abort",i)));const{signal:s}=r;return s.unsubscribe=()=>V.asap(o),s}};const Ue=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},We=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*Ue(n,t)}(e,t);let a,o=0,s=e=>{a||(a=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return s(),void e.close();let a=r.byteLength;if(n){let e=o+=a;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),i.return())},{highWaterMark:2})},Be="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,$e=Be&&"function"==typeof ReadableStream,Ve=Be&&("function"==typeof TextEncoder?(Qe=new TextEncoder,e=>Qe.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Qe;const Ke=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ze=$e&&Ke((()=>{let e=!1;const t=new Request(me.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Ge=$e&&Ke((()=>V.isReadableStream(new Response("").body))),Je={stream:Ge&&(e=>e.body)};var Ye;Be&&(Ye=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Je[e]&&(Je[e]=V.isFunction(Ye[e])?t=>t[e]():(t,n)=>{throw new Q(`Response type '${e}' is not supported`,Q.ERR_NOT_SUPPORT,n)})})));const Xe={http:null,xhr:De,fetch:Be&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:a,timeout:o,onDownloadProgress:s,onUploadProgress:c,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:d}=He(e);u=u?(u+"").toLowerCase():"text";let h,p=qe([i,a&&a.toAbortSignal()],o);const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let g;try{if(c&&ze&&"get"!==n&&"head"!==n&&0!==(g=await(async(e,t)=>{const n=V.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(V.isBlob(e))return e.size;if(V.isSpecCompliantForm(e)){const t=new Request(me.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return V.isArrayBufferView(e)||V.isArrayBuffer(e)?e.byteLength:(V.isURLSearchParams(e)&&(e+=""),V.isString(e)?(await Ve(e)).byteLength:void 0)})(t):n})(l,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(V.isFormData(r)&&(e=n.headers.get("content-type"))&&l.setContentType(e),n.body){const[e,t]=Te(g,je(ke(c)));r=We(n.body,65536,e,t)}}V.isString(f)||(f=f?"include":"omit");const i="credentials"in Request.prototype;h=new Request(t,{...d,signal:p,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:i?f:void 0});let a=await fetch(h);const o=Ge&&("stream"===u||"response"===u);if(Ge&&(s||o&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=a[t]}));const t=V.toFiniteNumber(a.headers.get("content-length")),[n,r]=s&&Te(t,je(ke(s),!0))||[];a=new Response(We(a.body,65536,n,(()=>{r&&r(),m&&m()})),e)}u=u||"text";let v=await Je[V.findKey(Je,u)||"text"](a,e);return!o&&m&&m(),await new Promise(((t,n)=>{Ne(t,n,{data:v,headers:xe.from(a.headers),status:a.status,statusText:a.statusText,config:e,request:h})}))}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Q("Network Error",Q.ERR_NETWORK,e,h),{cause:t.cause||t});throw Q.from(t,t&&t.code,e,h)}})};V.forEach(Xe,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ze=e=>`- ${e}`,et=e=>V.isFunction(e)||null===e||!1===e;var tt=e=>{e=V.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let a=0;a<t;a++){let t;if(n=e[a],r=n,!et(n)&&(r=Xe[(t=String(n)).toLowerCase()],void 0===r))throw new Q(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+a]=r}if(!r){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new Q("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Ze).join("\n"):" "+Ze(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ce(null,e)}function rt(e){return nt(e),e.headers=xe.from(e.headers),e.data=Oe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tt(e.adapter||ye.adapter)(e).then((function(t){return nt(e),t.data=Oe.call(e,e.transformResponse,t),t.headers=xe.from(t.headers),t}),(function(t){return Ee(t)||(nt(e),t&&t.response&&(t.response.data=Oe.call(e,e.transformResponse,t.response),t.response.headers=xe.from(t.response.headers))),Promise.reject(t)}))}const it={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{it[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const at={};it.transitional=function(e,t,n){return(r,i,a)=>{if(!1===e)throw new Q(function(e,t){return"[Axios v1.7.9] Transitional option '"+e+"'"+t+(n?". "+n:"")}(i," has been removed"+(t?" in "+t:"")),Q.ERR_DEPRECATED);return t&&!at[i]&&(at[i]=!0),!e||e(r,i,a)}},it.spelling=function(e){return(e,t)=>!0};var ot={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new Q("option "+a+" must be "+n,Q.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Q("Unknown option "+a,Q.ERR_BAD_OPTION)}},validators:it};const st=ot.validators;class ct{constructor(e){this.defaults=e,this.interceptors={request:new ae,response:new ae}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Le(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&ot.assertOptions(n,{silentJSONParsing:st.transitional(st.boolean),forcedJSONParsing:st.transitional(st.boolean),clarifyTimeoutError:st.transitional(st.boolean)},!1),null!=r&&(V.isFunction(r)?t.paramsSerializer={serialize:r}:ot.assertOptions(r,{encode:st.function,serialize:st.function},!0)),ot.assertOptions(t,{baseUrl:st.spelling("baseURL"),withXsrfToken:st.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&V.merge(i.common,i[t.method]);i&&V.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=xe.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,f=0;if(!s){const e=[rt.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=o.length;let d=t;for(f=0;f<l;){const e=o[f++],t=o[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=rt.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return ie(Ae((e=Le(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}V.forEach(["delete","get","head","options"],(function(e){ct.prototype[e]=function(t,n){return this.request(Le(n||{},{method:e,url:t,data:(n||{}).data}))}})),V.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(Le(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ct.prototype[e]=t(),ct.prototype[e+"Form"]=t(!0)}));var ut=ct;class lt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new Ce(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;const t=new lt((function(t){e=t}));return{token:t,cancel:e}}}var ft=lt;const dt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(dt).forEach((([e,t])=>{dt[t]=e}));var ht=dt;const pt=function e(n){const r=new ut(n),i=t(ut.prototype.request,r);return V.extend(i,ut.prototype,r,{allOwnKeys:!0}),V.extend(i,r,null,{allOwnKeys:!0}),i.create=function(t){return e(Le(n,t))},i}(ye);return pt.Axios=ut,pt.CanceledError=Ce,pt.CancelToken=ft,pt.isCancel=Ee,pt.VERSION="1.7.9",pt.toFormData=Z,pt.AxiosError=Q,pt.Cancel=pt.CanceledError,pt.all=function(e){return Promise.all(e)},pt.spread=function(e){return function(t){return e.apply(null,t)}},pt.isAxiosError=function(e){return V.isObject(e)&&!0===e.isAxiosError},pt.mergeConfig=Le,pt.AxiosHeaders=xe,pt.formToJSON=e=>ge(V.isHTMLForm(e)?new FormData(e):e),pt.getAdapter=tt,pt.HttpStatusCode=ht,pt.default=pt,le=pt}function me(){if(de)return he;de=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(he,"__esModule",{value:!0});var i=r(pe()),a=ce(),o=r(B()),s=!0,c=function(){function e(e){this.configuration=e,this.apiKey=this.configuration.apiKey,this.nodes=null==this.configuration.nodes?this.configuration.nodes:JSON.parse(JSON.stringify(this.configuration.nodes)),this.nearestNode=null==this.configuration.nearestNode?this.configuration.nearestNode:JSON.parse(JSON.stringify(this.configuration.nearestNode)),this.connectionTimeoutSeconds=this.configuration.connectionTimeoutSeconds,this.healthcheckIntervalSeconds=this.configuration.healthcheckIntervalSeconds,this.numRetriesPerRequest=this.configuration.numRetries,this.retryIntervalSeconds=this.configuration.retryIntervalSeconds,this.sendApiKeyAsQueryParam=this.configuration.sendApiKeyAsQueryParam,this.additionalUserHeaders=this.configuration.additionalHeaders,this.logger=this.configuration.logger,this.initializeMetadataForNodes(),this.currentNodeIndex=-1}return e.prototype.get=function(e,r,i){void 0===r&&(r={});var a=void 0===i?{}:i,o=a.abortSignal,s=void 0===o?null:o,c=a.responseType,u=void 0===c?void 0:c;return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.performRequest("get",e,{queryParameters:r,abortSignal:s,responseType:u})]}))}))},e.prototype.delete=function(e,r){return void 0===r&&(r={}),t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.performRequest("delete",e,{queryParameters:r})]}))}))},e.prototype.post=function(e,r,i,a){return void 0===r&&(r={}),void 0===i&&(i={}),void 0===a&&(a={}),t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.performRequest("post",e,{queryParameters:i,bodyParameters:r,additionalHeaders:a})]}))}))},e.prototype.put=function(e,r,i){return void 0===r&&(r={}),void 0===i&&(i={}),t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.performRequest("put",e,{queryParameters:i,bodyParameters:r})]}))}))},e.prototype.patch=function(e,r,i){return void 0===r&&(r={}),void 0===i&&(i={}),t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.performRequest("patch",e,{queryParameters:i,bodyParameters:r})]}))}))},e.prototype.performRequest=function(e,r,a){var o,c,u,l=a.queryParameters,f=void 0===l?null:l,d=a.bodyParameters,h=void 0===d?null:d,p=a.additionalHeaders,m=void 0===p?{}:p,g=a.abortSignal,v=void 0===g?null:g,y=a.responseType,b=void 0===y?void 0:y,_=a.skipConnectionTimeout,w=void 0!==_&&_;return t(this,void 0,void 0,(function(){var t,a,l,d,p,g;return n(this,(function(y){switch(y.label){case 0:this.configuration.validate(),t=Date.now(),this.logger.debug("Request #".concat(t,": Performing ").concat(e.toUpperCase()," request: ").concat(r)),l=function(l){var p,g,y,_,S,R,P;return n(this,(function(n){switch(n.label){case 0:if(p=d.getNextNode(t),d.logger.debug("Request #".concat(t,": Attempting ").concat(e.toUpperCase()," request Try #").concat(l," to Node ").concat(p.index)),v&&v.aborted)return[2,{value:Promise.reject(new Error("Request aborted by caller."))}];g=void 0,n.label=1;case 1:return n.trys.push([1,3,5,6]),y={method:e,url:d.uriFor(r,p),headers:Object.assign({},d.defaultHeaders(),m,d.additionalUserHeaders),maxContentLength:1/0,maxBodyLength:1/0,responseType:b,validateStatus:function(e){return e>0},transformResponse:[function(e,t){var n=e;return void 0!==t&&"string"==typeof e&&t["content-type"]&&t["content-type"].startsWith("application/json")&&(n=JSON.parse(e)),n}]},!0!==w&&(y.timeout=1e3*d.connectionTimeoutSeconds),f&&0!==Object.keys(f).length&&(y.params=f),d.sendApiKeyAsQueryParam&&(y.params=y.params||{},y.params["x-typesense-api-key"]=d.apiKey),d.configuration.httpAgent&&(d.logger.debug("Request #".concat(t,": Using custom httpAgent")),y.httpAgent=d.configuration.httpAgent),d.configuration.httpsAgent&&(d.logger.debug("Request #".concat(t,": Using custom httpsAgent")),y.httpsAgent=d.configuration.httpsAgent),h&&("string"==typeof h&&0!==h.length||"object"==typeof h&&0!==Object.keys(h).length)&&(y.data=h),v&&(_=i.default.CancelToken,S=_.source(),g=function(){return S.cancel()},v.addEventListener("abort",g),y.cancelToken=S.token),[4,(0,i.default)(y)];case 2:if((R=n.sent()).status>=1&&R.status<=499&&d.setNodeHealthcheck(p,s),d.logger.debug("Request #".concat(t,": Request to Node ").concat(p.index," was made. Response Code was ").concat(R.status,".")),R.status>=200&&R.status<300)return[2,{value:Promise.resolve(R.data)}];if(R.status<500)return[2,{value:Promise.reject(d.customErrorForResponse(R,null===(o=R.data)||void 0===o?void 0:o.message))}];throw d.customErrorForResponse(R,null===(c=R.data)||void 0===c?void 0:c.message);case 3:return P=n.sent(),d.setNodeHealthcheck(p,!1),a=P,d.logger.warn("Request #".concat(t,": Request to Node ").concat(p.index,' failed due to "').concat(P.code," ").concat(P.message).concat(null==P.response?"":" - "+JSON.stringify(null===(u=P.response)||void 0===u?void 0:u.data),'"')),d.logger.warn("Request #".concat(t,": Sleeping for ").concat(d.retryIntervalSeconds,"s and then retrying request...")),[4,d.timer(d.retryIntervalSeconds)];case 4:return n.sent(),[3,6];case 5:return v&&g&&v.removeEventListener("abort",g),[7];case 6:return[2]}}))},d=this,p=1,y.label=1;case 1:return p<=this.numRetriesPerRequest+1?[5,l(p)]:[3,4];case 2:if("object"==typeof(g=y.sent()))return[2,g.value];y.label=3;case 3:return p++,[3,1];case 4:return this.logger.debug("Request #".concat(t,": No retries left. Raising last error")),[2,Promise.reject(a)]}}))}))},e.prototype.getNextNode=function(e){if(void 0===e&&(e=0),null!=this.nearestNode){if(this.logger.debug("Request #".concat(e,": Nodes Health: Node ").concat(this.nearestNode.index," is ").concat(!0===this.nearestNode.isHealthy?"Healthy":"Unhealthy")),!0===this.nearestNode.isHealthy||this.nodeDueForHealthcheck(this.nearestNode,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(this.nearestNode.index)),this.nearestNode;this.logger.debug("Request #".concat(e,": Falling back to individual nodes"))}this.logger.debug("Request #".concat(e,": Nodes Health: ").concat(this.nodes.map((function(e){return"Node ".concat(e.index," is ").concat(!0===e.isHealthy?"Healthy":"Unhealthy")})).join(" || ")));for(var t=this.nodes[0],n=0;n<=this.nodes.length;n++)if(this.currentNodeIndex=(this.currentNodeIndex+1)%this.nodes.length,!0===(t=this.nodes[this.currentNodeIndex]).isHealthy||this.nodeDueForHealthcheck(t,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(t.index)),t;return this.logger.debug("Request #".concat(e,": No healthy nodes were found. Returning the next node, Node ").concat(t.index)),t},e.prototype.nodeDueForHealthcheck=function(e,t){void 0===t&&(t=0);var n=Date.now()-e.lastAccessTimestamp>1e3*this.healthcheckIntervalSeconds;return n&&this.logger.debug("Request #".concat(t,": Node ").concat(e.index," has exceeded healtcheckIntervalSeconds of ").concat(this.healthcheckIntervalSeconds,". Adding it back into rotation.")),n},e.prototype.initializeMetadataForNodes=function(){var e=this;null!=this.nearestNode&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,s)),this.nodes.forEach((function(t,n){t.index=n,e.setNodeHealthcheck(t,s)}))},e.prototype.setNodeHealthcheck=function(e,t){e.isHealthy=t,e.lastAccessTimestamp=Date.now()},e.prototype.uriFor=function(e,t){return null!=t.url?"".concat(t.url).concat(e):"".concat(t.protocol,"://").concat(t.host,":").concat(t.port).concat(t.path).concat(e)},e.prototype.defaultHeaders=function(){var e={};return this.sendApiKeyAsQueryParam||(e["X-TYPESENSE-API-KEY"]=this.apiKey),e["Content-Type"]="application/json",e},e.prototype.timer=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,new Promise((function(t){return setTimeout(t,1e3*e)}))]}))}))},e.prototype.customErrorForResponse=function(e,t){var n="Request failed with HTTP code ".concat(e.status);"string"==typeof t&&""!==t.trim()&&(n+=" | Server said: ".concat(t));var r=new o.default(n);return(r=400===e.status?new a.RequestMalformed(n):401===e.status?new a.RequestUnauthorized(n):404===e.status?new a.ObjectNotFound(n):409===e.status?new a.ObjectAlreadyExists(n):422===e.status?new a.ObjectUnprocessable(n):e.status>=500&&e.status<=599?new a.ServerError(n):new a.HTTPError(n)).httpStatus=e.status,r},e}();return he.default=c,he}var ge,ve={};function ye(){if(ge)return ve;ge=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(ve,"__esModule",{value:!0});var r="/collections",i=function(){function e(e){this.apiCall=e}return e.prototype.create=function(e,i){return void 0===i&&(i={}),t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.apiCall.post(r,e,i)]}))}))},e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(r)]}))}))},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return r},enumerable:!1,configurable:!0}),e}();return ve.default=i,ve}var be,_e,we,Se={},Re={},Pe={},xe={};function Oe(){if(be)return xe;be=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(xe,"__esModule",{value:!0});var i=function(){function e(){this.responseCache=new Map,this.responsePromiseCache=new Map}return e.prototype.clearCache=function(){this.responseCache=new Map,this.responsePromiseCache=new Map},e.prototype.perform=function(e,i,a,o){return t(this,void 0,void 0,(function(){var t,s,c,u,l,f,d,h,p,m,g;return n(this,(function(n){switch(n.label){case 0:if(t=o.cacheResponseForSeconds,s=void 0===t?120:t,c=o.maxSize,u=void 0===c?100:c,s<=0||u<=0)return[2,i.call.apply(i,r([e],a,!1))];if(l=JSON.stringify(a),f=this.responseCache.get(l),d=Date.now(),f){if(d-f.requestTimestamp<1e3*s)return this.responseCache.delete(l),this.responseCache.set(l,f),[2,Promise.resolve(f.response)];this.responseCache.delete(l)}if(h=this.responsePromiseCache.get(l)){if(d-h.requestTimestamp<1e3*s)return this.responsePromiseCache.delete(l),this.responsePromiseCache.set(l,h),[2,h.responsePromise];this.responsePromiseCache.delete(l)}return p=i.call.apply(i,r([e],a,!1)),this.responsePromiseCache.set(l,{requestTimestamp:d,responsePromise:p}),[4,p];case 1:return m=n.sent(),this.responseCache.set(l,{requestTimestamp:d,response:m}),this.responseCache.size>u&&(g=this.responseCache.keys().next().value,this.responseCache.delete(g)),this.responsePromiseCache.size>u&&(g=this.responsePromiseCache.keys().next().value,this.responsePromiseCache.delete(g)),[2,m]}}))}))},e}();return xe.default=i,xe}function Ee(){if(_e)return Pe;_e=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.SearchOnlyDocuments=void 0;var i=r(Oe()),a=r(ye()),o="/documents",s=function(){function e(e,t,n){this.collectionName=e,this.apiCall=t,this.configuration=n,this.requestWithCache=new i.default}return e.prototype.clearCache=function(){this.requestWithCache.clearCache()},e.prototype.search=function(e,r){var i=void 0===r?{}:r,a=i.cacheSearchResultsForSeconds,o=void 0===a?this.configuration.cacheSearchResultsForSeconds:a,s=i.abortSignal,c=void 0===s?null:s;return t(this,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){for(r in t={},!0===this.configuration.useServerSideSearchCache&&(t.use_cache=!0),e)Array.isArray(e[r])&&(t[r]=e[r].join(","));return i=Object.assign({},e,t),[2,this.requestWithCache.perform(this.apiCall,this.apiCall.get,[this.endpointPath("search"),i,{abortSignal:c}],{cacheResponseForSeconds:o})]}))}))},e.prototype.endpointPath=function(e){return"".concat(a.default.RESOURCEPATH,"/").concat(this.collectionName).concat(o).concat(void 0===e?"":"/"+e)},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return o},enumerable:!1,configurable:!0}),e}();return Pe.SearchOnlyDocuments=s,Pe}function Ce(){if(we)return Re;we=1;var t,n=e&&e.__extends||(t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)},function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),r=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},i=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(Re,"__esModule",{value:!0});var a=ce(),o=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return n(t,e),t.prototype.create=function(e,t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){return i(this,(function(n){if(!e)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),e,t)]}))}))},t.prototype.upsert=function(e,t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){return i(this,(function(n){if(!e)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),e,Object.assign({},t,{action:"upsert"}))]}))}))},t.prototype.update=function(e,t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){return i(this,(function(n){if(!e)throw new Error("No document provided");return null!=t.filter_by?[2,this.apiCall.patch(this.endpointPath(),e,Object.assign({},t))]:[2,this.apiCall.post(this.endpointPath(),e,Object.assign({},t,{action:"update"}))]}))}))},t.prototype.delete=function(e){return void 0===e&&(e={}),r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),e)]}))}))},t.prototype.createMany=function(e,t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){return i(this,(function(n){return this.configuration.logger.warn("createMany is deprecated and will be removed in a future version. Use import instead, which now takes both an array of documents or a JSONL string of documents"),[2,this.import(e,t)]}))}))},t.prototype.import=function(e,t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var n,r,o,s;return i(this,(function(i){switch(i.label){case 0:if(Array.isArray(e))try{n=e.map((function(e){return JSON.stringify(e)})).join("\n")}catch(e){if(RangeError instanceof e&&(null==e?void 0:e.includes("Too many properties to enumerate")))throw new Error("".concat(e,"\n It looks like you have reached a Node.js limit that restricts the number of keys in an Object: https://stackoverflow.com/questions/9282869/are-there-limits-to-the-number-of-properties-in-a-javascript-object\n\n Please try reducing the number of keys in your document, or using CURL to import your data.\n "));throw new Error(e)}else n=e;return[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:t,bodyParameters:n,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0})];case 1:if(r=i.sent(),Array.isArray(e)){if(o=r.split("\n").map((function(e){return JSON.parse(e)})),s=o.filter((function(e){return!1===e.success})),s.length>0)throw new a.ImportError("".concat(o.length-s.length," documents imported successfully, ").concat(s.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),o);return[2,o]}return[2,r]}}))}))},t.prototype.export=function(e){return void 0===e&&(e={}),r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),e)]}))}))},t.prototype.exportStream=function(e){return void 0===e&&(e={}),r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),e,{responseType:"stream"})]}))}))},t}(Ee().SearchOnlyDocuments);return Re.default=o,Re}var Ne,je={};function Te(){if(Ne)return je;Ne=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(je,"__esModule",{value:!0});var i=r(ye()),a=function(){function e(e,t){this.collectionName=e,this.apiCall=t}return e.prototype.upsert=function(e,r){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.apiCall.put(this.endpointPath(e),r)]}))}))},e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(i.default.RESOURCEPATH,"/").concat(this.collectionName).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/overrides"},enumerable:!1,configurable:!0}),e}();return je.default=a,je}var ke,Ie={};var Fe,Ae={};function Me(){if(Fe)return Ae;Fe=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ae,"__esModule",{value:!0});var i=r(ye()),a=function(){function e(e,t){this.collectionName=e,this.apiCall=t}return e.prototype.upsert=function(e,r){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.apiCall.put(this.endpointPath(e),r)]}))}))},e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(i.default.RESOURCEPATH,"/").concat(this.collectionName).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/synonyms"},enumerable:!1,configurable:!0}),e}();return Ae.default=a,Ae}var Le,He={};var De,qe,Ue={};function We(){if(qe)return Se;qe=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Se,"__esModule",{value:!0});var i=r(ye()),a=r(Ce()),o=ce(),s=r(Te()),c=r(function(){if(ke)return Ie;ke=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ie,"__esModule",{value:!0});var i=r(ye()),a=r(Te()),o=function(){function e(e,t,n){this.collectionName=e,this.overrideId=t,this.apiCall=n}return e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(this.collectionName).concat(a.default.RESOURCEPATH,"/").concat(this.overrideId)},e}();return Ie.default=o,Ie}()),u=r(Me()),l=r(function(){if(Le)return He;Le=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(He,"__esModule",{value:!0});var i=r(ye()),a=r(Me()),o=function(){function e(e,t,n){this.collectionName=e,this.synonymId=t,this.apiCall=n}return e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(this.collectionName).concat(a.default.RESOURCEPATH,"/").concat(this.synonymId)},e}();return He.default=o,He}()),f=function(){if(De)return Ue;De=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.Document=void 0;var i=r(ye()),a=r(Ce()),o=function(){function e(e,t,n){this.collectionName=e,this.documentId=t,this.apiCall=n}return e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.update=function(e,r){return void 0===r&&(r={}),t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.apiCall.patch(this.endpointPath(),e,r)]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(this.collectionName).concat(a.default.RESOURCEPATH,"/").concat(this.documentId)},e}();return Ue.Document=o,Ue}(),d=function(){function e(e,t,n){this.name=e,this.apiCall=t,this.configuration=n,this.individualDocuments={},this.individualOverrides={},this.individualSynonyms={},this.name=e,this.apiCall=t,this.configuration=n,this._documents=new a.default(this.name,this.apiCall,this.configuration),this._overrides=new s.default(this.name,this.apiCall),this._synonyms=new u.default(this.name,this.apiCall)}return e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.update=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.apiCall.patch(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.exists=function(){return t(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.retrieve()];case 1:return t.sent(),[2,!0];case 2:if((e=t.sent())instanceof o.ObjectNotFound)return[2,!1];throw e;case 3:return[2]}}))}))},e.prototype.documents=function(e){return e?(void 0===this.individualDocuments[e]&&(this.individualDocuments[e]=new f.Document(this.name,e,this.apiCall)),this.individualDocuments[e]):this._documents},e.prototype.overrides=function(e){return void 0===e?this._overrides:(void 0===this.individualOverrides[e]&&(this.individualOverrides[e]=new c.default(this.name,e,this.apiCall)),this.individualOverrides[e])},e.prototype.synonyms=function(e){return void 0===e?this._synonyms:(void 0===this.individualSynonyms[e]&&(this.individualSynonyms[e]=new l.default(this.name,e,this.apiCall)),this.individualSynonyms[e])},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(this.name)},e}();return Se.default=d,Se}var Be,$e={};function Ve(){if(Be)return $e;Be=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty($e,"__esModule",{value:!0});var r="/aliases",i=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,r){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.apiCall.put(this.endpointPath(e),r)]}))}))},e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(r)]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH,"/").concat(t)},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return r},enumerable:!1,configurable:!0}),e}();return $e.default=i,$e}var Qe,Ke={};var ze,Ge={},Je=n(Object.freeze({__proto__:null,default:{}}));function Ye(){if(ze)return Ge;ze=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(Ge,"__esModule",{value:!0});var r=Je,i="/keys",a=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(r){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.apiCall.post(e.RESOURCEPATH,r)]}))}))},e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(i)]}))}))},e.prototype.generateScopedSearchKey=function(e,t){var n=JSON.stringify(t),i=Buffer.from((0,r.createHmac)("sha256",e).update(n).digest("base64")),a=e.substr(0,4),o="".concat(i).concat(a).concat(n);return Buffer.from(o).toString("base64")},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return i},enumerable:!1,configurable:!0}),e}();return Ge.default=a,Ge}var Xe,Ze={};var et,tt={};var nt,rt={};var it,at={};var ot,st={};var ct,ut={};function lt(){if(ct)return ut;ct=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ut,"__esModule",{value:!0});var i=r(Oe()),a=function(){function e(e,t,n){void 0===n&&(n=!1),this.apiCall=e,this.configuration=t,this.useTextContentType=n,this.requestWithCache=new i.default}return e.prototype.clearCache=function(){this.requestWithCache.clearCache()},e.prototype.perform=function(e,r,i){void 0===r&&(r={});var a=(void 0===i?{}:i).cacheSearchResultsForSeconds,o=void 0===a?this.configuration.cacheSearchResultsForSeconds:a;return t(this,void 0,void 0,(function(){var t,i,a;return n(this,(function(n){return t={},this.useTextContentType&&(t["content-type"]="text/plain"),i={},!0===this.configuration.useServerSideSearchCache&&(i.use_cache=!0),a=Object.assign({},r,i),[2,this.requestWithCache.perform(this.apiCall,this.apiCall.post,["/multi_search",e,a,t],{cacheResponseForSeconds:o})]}))}))},e}();return ut.default=a,ut}var ft,dt={};function ht(){if(ft)return dt;ft=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(dt,"__esModule",{value:!0});var r=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,r){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.apiCall.put(this.endpointPath(e),r)]}))}))},e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/presets"},enumerable:!1,configurable:!0}),e}();return dt.default=r,dt}var pt,mt={};var gt,vt={},yt={};function bt(){if(gt)return yt;gt=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(yt,"__esModule",{value:!0});var r=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.upsert=function(e,r){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.apiCall.put(this.endpointPath(e),r)]}))}))},e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics/rules"},enumerable:!1,configurable:!0}),e}();return yt.default=r,yt}var _t,wt,St={};var Rt,Pt={};function xt(){if(Rt)return Pt;Rt=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(Pt,"__esModule",{value:!0});var r=function(){function e(e){this.apiCall=e}return e.prototype.upsert=function(e,r){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.apiCall.put(this.endpointPath(e),r)]}))}))},e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/stopwords"},enumerable:!1,configurable:!0}),e}();return Pt.default=r,Pt}var Ot,Et={};var Ct,Nt={},jt={};function Tt(){if(Ct)return jt;Ct=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(jt,"__esModule",{value:!0});var r=function(){function e(e){this.apiCall=e,this.apiCall=e}return e.prototype.create=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.endpointPath=function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/conversations/models"},enumerable:!1,configurable:!0}),e}();return jt.default=r,jt}var kt,It,Ft={};function At(){if(It)return Nt;It=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nt,"__esModule",{value:!0});var i=r(Tt()),a=r(function(){if(kt)return Ft;kt=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ft,"__esModule",{value:!0});var i=r(Tt()),a=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.update=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(this.id)},e}();return Ft.default=a,Ft}()),o="/conversations",s=function(){function e(e){this.apiCall=e,this.individualConversationModels={},this.apiCall=e,this._conversationsModels=new i.default(this.apiCall)}return e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(o)]}))}))},e.prototype.models=function(e){return void 0===e?this._conversationsModels:(void 0===this.individualConversationModels[e]&&(this.individualConversationModels[e]=new a.default(e,this.apiCall)),this.individualConversationModels[e])},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return o},enumerable:!1,configurable:!0}),e}();return Nt.default=s,Nt}var Mt,Lt,Ht={};function Dt(){if(Lt)return F;Lt=1;var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(F,"__esModule",{value:!0});var n=t(ue()),r=t(me()),i=t(ye()),a=t(We()),o=t(Ve()),s=t(function(){if(Qe)return Ke;Qe=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ke,"__esModule",{value:!0});var i=r(Ve()),a=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(this.name)},e}();return Ke.default=a,Ke}()),c=t(Ye()),u=t(function(){if(Xe)return Ze;Xe=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ze,"__esModule",{value:!0});var i=r(Ye()),a=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(this.id)},e}();return Ze.default=a,Ze}()),l=t(function(){if(et)return tt;et=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(tt,"__esModule",{value:!0});var r=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get("/debug")]}))}))},e}();return tt.default=r,tt}()),f=t(function(){if(nt)return rt;nt=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(rt,"__esModule",{value:!0});var r=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get("/metrics.json")]}))}))},e}();return rt.default=r,rt}()),d=t(function(){if(it)return at;it=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(at,"__esModule",{value:!0});var r=function(){function e(e){this.apiCall=e}return e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get("/health")]}))}))},e}();return at.default=r,at}()),h=t(function(){if(ot)return st;ot=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(st,"__esModule",{value:!0});var r=function(){function e(e){this.apiCall=e}return e.prototype.perform=function(e,r){return void 0===r&&(r={}),t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.apiCall.post("".concat("/operations","/").concat(e),{},r)]}))}))},e}();return st.default=r,st}()),p=t(lt()),m=t(ht()),g=t(function(){if(pt)return mt;pt=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mt,"__esModule",{value:!0});var i=r(ht()),a=function(){function e(e,t){this.presetId=e,this.apiCall=t}return e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(this.presetId)},e}();return mt.default=a,mt}()),v=t(function(){if(wt)return vt;wt=1;var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vt,"__esModule",{value:!0});var n=t(bt()),r=t(function(){if(_t)return St;_t=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(St,"__esModule",{value:!0});var i=r(bt()),a=function(){function e(e,t){this.name=e,this.apiCall=t}return e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(this.name)},e}();return St.default=a,St}()),i=function(){function e(e){this.apiCall=e,this.individualAnalyticsRules={},this.apiCall=e,this._analyticsRules=new n.default(this.apiCall)}return e.prototype.rules=function(e){return void 0===e?this._analyticsRules:(void 0===this.individualAnalyticsRules[e]&&(this.individualAnalyticsRules[e]=new r.default(e,this.apiCall)),this.individualAnalyticsRules[e])},Object.defineProperty(e,"RESOURCEPATH",{get:function(){return"/analytics"},enumerable:!1,configurable:!0}),e}();return vt.default=i,vt}()),y=t(xt()),b=t(function(){if(Ot)return Et;Ot=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Et,"__esModule",{value:!0});var i=r(xt()),a=function(){function e(e,t){this.stopwordId=e,this.apiCall=t}return e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.delete=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(this.stopwordId)},e}();return Et.default=a,Et}()),_=t(At()),w=t(function(){if(Mt)return Ht;Mt=1;var t=e&&e.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},n=e&&e.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ht,"__esModule",{value:!0});var i=r(At()),a=function(){function e(e,t){this.id=e,this.apiCall=t}return e.prototype.retrieve=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.get(this.endpointPath())]}))}))},e.prototype.update=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),e)]}))}))},e.prototype.delete=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.apiCall.delete(this.endpointPath())]}))}))},e.prototype.endpointPath=function(){return"".concat(i.default.RESOURCEPATH,"/").concat(this.id)},e}();return Ht.default=a,Ht}()),S=function(){function e(e){var t;e.sendApiKeyAsQueryParam=null!==(t=e.sendApiKeyAsQueryParam)&&void 0!==t&&t,this.configuration=new n.default(e),this.apiCall=new r.default(this.configuration),this.debug=new l.default(this.apiCall),this.metrics=new f.default(this.apiCall),this.health=new d.default(this.apiCall),this.operations=new h.default(this.apiCall),this.multiSearch=new p.default(this.apiCall,this.configuration),this._collections=new i.default(this.apiCall),this.individualCollections={},this._aliases=new o.default(this.apiCall),this.individualAliases={},this._keys=new c.default(this.apiCall),this.individualKeys={},this._presets=new m.default(this.apiCall),this.individualPresets={},this._stopwords=new y.default(this.apiCall),this.individualStopwords={},this.analytics=new v.default(this.apiCall),this._conversations=new _.default(this.apiCall),this.individualConversations={}}return e.prototype.collections=function(e){return void 0===e?this._collections:(void 0===this.individualCollections[e]&&(this.individualCollections[e]=new a.default(e,this.apiCall,this.configuration)),this.individualCollections[e])},e.prototype.aliases=function(e){return void 0===e?this._aliases:(void 0===this.individualAliases[e]&&(this.individualAliases[e]=new s.default(e,this.apiCall)),this.individualAliases[e])},e.prototype.keys=function(e){return void 0===e?this._keys:(void 0===this.individualKeys[e]&&(this.individualKeys[e]=new u.default(e,this.apiCall)),this.individualKeys[e])},e.prototype.presets=function(e){return void 0===e?this._presets:(void 0===this.individualPresets[e]&&(this.individualPresets[e]=new g.default(e,this.apiCall)),this.individualPresets[e])},e.prototype.stopwords=function(e){return void 0===e?this._stopwords:(void 0===this.individualStopwords[e]&&(this.individualStopwords[e]=new b.default(e,this.apiCall)),this.individualStopwords[e])},e.prototype.conversations=function(e){return void 0===e?this._conversations:(void 0===this.individualConversations[e]&&(this.individualConversations[e]=new w.default(e,this.apiCall)),this.individualConversations[e])},e}();return F.default=S,F}var qt,Ut,Wt,Bt={},$t={};var Vt,Qt={},Kt={exports:{}},zt={exports:{}};function Gt(){return Vt||(Vt=1,function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports}(zt)),zt.exports}var Jt,Yt={exports:{}};function Xt(){return Jt||(Jt=1,function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports}(Yt)),Yt.exports}var Zt,en,tn={exports:{}},nn={exports:{}};function rn(){return Zt||(Zt=1,function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports}(nn)),nn.exports}function an(){return en||(en=1,function(e){var t=rn();e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(tn)),tn.exports}var on,sn,cn,un={exports:{}};function ln(){return on||(on=1,function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(un)),un.exports}function fn(){return sn||(sn=1,function(e){var t=Gt(),n=Xt(),r=an(),i=ln();e.exports=function(e,a){return t(e)||n(e,a)||r(e,a)||i()},e.exports.__esModule=!0,e.exports.default=e.exports}(Kt)),Kt.exports}var dn,hn={},pn={exports:{}},mn={exports:{}};function gn(){return dn||(dn=1,function(e){var t=rn();e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(mn)),mn.exports}var vn,yn={exports:{}};function bn(){return vn||(vn=1,function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(yn)),yn.exports}var _n,wn,Sn={exports:{}};function Rn(){return _n||(_n=1,function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(Sn)),Sn.exports}var Pn,xn,On,En={exports:{}},Cn={};function Nn(){if(xn)return Cn;xn=1,Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.utils=void 0;var e={_adaptHighlightTag:function(e,t,n){return e.replace(new RegExp("<mark>","g"),t||"<mark>").replace(new RegExp("</mark>","g"),n||"</mark>")},_adaptNumberOfPages:function(){var e=this.typesenseResponse.found/this.typesenseResponse.request_params.per_page;return Number.isFinite(e)?Math.ceil(e):1}};return Cn.utils=e,Cn}var jn,Tn={};!function(t){var n=l;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(p()),i=n(v()),a=n(_()),o=n(N()),s=function(){if(j)return k;j=1;var e=l;Object.defineProperty(k,"__esModule",{value:!0}),k.Configuration=void 0;var t=e(_()),n=e(N()),r=function(){function e(){var n,r,i,a,o,s,c,u,l,f,d,h,p,m,g,v,y,b,_=this,w=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,t.default)(this,e),this.server=w.server||{nodes:[{host:"localhost",port:"8108",path:"",protocol:"http"}]},this.server.cacheSearchResultsForSeconds=null!==(n=this.server.cacheSearchResultsForSeconds)&&void 0!==n?n:120,this.additionalSearchParameters=null!==(r=w.additionalSearchParameters)&&void 0!==r?r:{},this.additionalSearchParameters.query_by=null!==(i=null!==(a=this.additionalSearchParameters.queryBy)&&void 0!==a?a:this.additionalSearchParameters.query_by)&&void 0!==i?i:"",this.additionalSearchParameters.preset=null!==(o=null!==(s=this.additionalSearchParameters.preset)&&void 0!==s?s:this.additionalSearchParameters.preset)&&void 0!==o?o:"",this.additionalSearchParameters.sort_by=null!==(c=null!==(u=this.additionalSearchParameters.sortBy)&&void 0!==u?u:this.additionalSearchParameters.sort_by)&&void 0!==c?c:"",this.additionalSearchParameters.highlight_full_fields=null!==(l=null!==(f=this.additionalSearchParameters.highlightFullFields)&&void 0!==f?f:this.additionalSearchParameters.highlight_full_fields)&&void 0!==l?l:this.additionalSearchParameters.query_by,this.geoLocationField=null!==(d=w.geoLocationField)&&void 0!==d?d:"_geoloc",this.facetableFieldsWithSpecialCharacters=null!==(h=w.facetableFieldsWithSpecialCharacters)&&void 0!==h?h:[],this.collectionSpecificSearchParameters=null!==(p=w.collectionSpecificSearchParameters)&&void 0!==p?p:{},Object.keys(this.collectionSpecificSearchParameters).forEach((function(e){var t,n,r,i,a,o,s=_.collectionSpecificSearchParameters[e];s.query_by=null!==(t=s.queryBy)&&void 0!==t?t:s.query_by,s.preset=null!==(n=s.preset)&&void 0!==n?n:s.preset,s.sort_by=null!==(r=s.sortBy)&&void 0!==r?r:s.sort_by,s.highlight_full_fields=null!==(i=null!==(a=null!==(o=s.highlightFullFields)&&void 0!==o?o:s.highlight_full_fields)&&void 0!==a?a:_.additionalSearchParameters.highlight_full_fields)&&void 0!==i?i:s.query_by,Object.keys(s).forEach((function(e){return void 0===s[e]?delete s[e]:{}}))})),this.renderingContent=w.renderingContent,this.flattenGroupedHits=null===(m=w.flattenGroupedHits)||void 0===m||m,this.facetByOptions=null!==(g=w.facetByOptions)&&void 0!==g?g:{},this.filterByOptions=null!==(v=w.filterByOptions)&&void 0!==v?v:{},this.collectionSpecificFacetByOptions=null!==(y=w.collectionSpecificFacetByOptions)&&void 0!==y?y:{},this.collectionSpecificFilterByOptions=null!==(b=w.collectionSpecificFilterByOptions)&&void 0!==b?b:{}}return(0,n.default)(e,[{key:"validate",value:function(){if(this.additionalSearchParameters.queryBy||Object.values(this.collectionSpecificSearchParameters).some((function(e){return e.queryBy})),0===this.additionalSearchParameters.query_by.length&&0===this.additionalSearchParameters.preset.length&&(0===Object.keys(this.collectionSpecificSearchParameters).length||Object.values(this.collectionSpecificSearchParameters).some((function(e){return 0===(e.query_by||"").length&&0===(e.preset||"").length}))))throw new Error("[typesense-instantsearch-adapter] Missing parameter: One of additionalSearchParameters.query_by or additionalSearchParameters.preset needs to be set, or all collectionSpecificSearchParameters need to have either .query_by or .preset set.")}}]),e}();return k.Configuration=r,k}(),c=function(){if(Wt)return I;Wt=1;var t=e&&e.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(I,"__esModule",{value:!0}),I.Errors=I.SearchClient=I.Client=void 0;var a=i(Dt());I.Client=a.default;var o=i(function(){if(Ut)return Bt;Ut=1;var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bt,"__esModule",{value:!0});var n=t(ue()),r=t(me()),i=t(lt()),a=function(){if(qt)return $t;qt=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.SearchOnlyCollection=void 0;var e=Ee(),t=function(){function t(t,n,r){this.name=t,this.apiCall=n,this.configuration=r,this._documents=new e.SearchOnlyDocuments(this.name,this.apiCall,this.configuration)}return t.prototype.documents=function(){return this._documents},t}();return $t.SearchOnlyCollection=t,$t}(),o=function(){function e(e){var t;e.sendApiKeyAsQueryParam=null===(t=e.sendApiKeyAsQueryParam)||void 0===t||t,!0===e.sendApiKeyAsQueryParam&&(e.apiKey||"").length>2e3&&(e.sendApiKeyAsQueryParam=!1),this.configuration=new n.default(e),this.apiCall=new r.default(this.configuration),this.multiSearch=new i.default(this.apiCall,this.configuration,!0),this.individualCollections={}}return e.prototype.clearCache=function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEach((function(e){e[0],e[1].documents().clearCache()}))},e.prototype.collections=function(e){if(e)return void 0===this.individualCollections[e]&&(this.individualCollections[e]=new a.SearchOnlyCollection(e,this.apiCall,this.configuration)),this.individualCollections[e];throw new Error("Typesense.SearchClient only supports search operations, so the collectionName that needs to be searched must be specified. Use Typesense.Client if you need to access the collection object.")},e}();return Bt.default=o,Bt}());I.SearchClient=o.default;var s=r(ce());return I.Errors=s,I.default={Client:a.default,SearchClient:o.default,Errors:s},I}(),u=function(){if(cn)return Qt;cn=1;var e=l;Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.SearchRequestAdapter=void 0;var t=e(p()),n=e(v()),r=e(fn()),i=e(_()),a=e(N()),o=function(){function e(t,n,r){(0,i.default)(this,e),this.instantsearchRequests=t,this.typesenseClient=n,this.configuration=r,this.additionalSearchParameters=r.additionalSearchParameters,this.collectionSpecificSearchParameters=r.collectionSpecificSearchParameters}var o;return(0,a.default)(e,[{key:"_shouldUseExactMatchForField",value:function(e,t){var n,r;return!1!==(null===(n=this.configuration.collectionSpecificFilterByOptions)||void 0===n||null===(n=n[t])||void 0===n||null===(n=n[e])||void 0===n?void 0:n.exactMatch)&&!1!==(null===(r=this.configuration.filterByOptions)||void 0===r||null===(r=r[e])||void 0===r?void 0:r.exactMatch)}},{key:"_adaptFacetFilters",value:function(e,t){var n=this;if(!e)return"";var i=e.map((function(e){if(Array.isArray(e)){var i={};e.forEach((function(e){var t=n._parseFacetFilter(e),r=t.fieldName,a=t.fieldValue;i[r]=i[r]||[],i[r].push(a)})),Object.keys(i).length;var a=Object.keys(i)[0],o=i[a].reduce((function(e,t){return t.startsWith("-")&&!n._isNumber(t)?e[0].push(t.substring(1)):e[1].push(t),e}),[[],[]]),s=(0,r.default)(o,2),c=s[0],u=s[1],l=[];if(u.length>0){var f=n._shouldUseExactMatchForField(a,t)?":=":":";l.push("".concat(a).concat(f,"[").concat(u.map((function(e){return n._escapeFacetValue(e)})).join(","),"]"))}if(c.length>0){var d=n._shouldUseExactMatchForField(a,t)?":!=":":!";l.push("".concat(a).concat(d,"[").concat(c.map((function(e){return n._escapeFacetValue(e)})).join(","),"]"))}var h=l.filter((function(e){return e})).join(" && ");return h}var p,m=n._parseFacetFilter(e),g=m.fieldName,v=m.fieldValue;if(v.startsWith("-")&&!n._isNumber(v)){var y=n._shouldUseExactMatchForField(g,t)?":!=":":!";p="".concat(g).concat(y,"[").concat(n._escapeFacetValue(v.substring(1)),"]")}else{var b=n._shouldUseExactMatchForField(g,t)?":=":":";p="".concat(g).concat(b,"[").concat(n._escapeFacetValue(v),"]")}return p}));return i.join(" && ")}},{key:"_parseFacetFilter",value:function(e){var t,n,r,i,a;if((null===(t=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===t?void 0:t.length)>0){var o=this.configuration.facetableFieldsWithSpecialCharacters.flat().map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));if(n=new RegExp("^(".concat(o.join("|"),"):(.*)$")),null!=(r=e.match(n)))return{fieldName:i="".concat(r[1]),fieldValue:a="".concat(r[2])}}return n=this.constructor.DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX,null==(r=e.match(n))||(i="".concat(r[1]).concat(r[2]),a="".concat(r[3])),{fieldName:i,fieldValue:a}}},{key:"_escapeFacetValue",value:function(e){return"boolean"==typeof e||"true"===e||"false"===e||this._isNumber(e)?e:"`".concat(e,"`")}},{key:"_isNumber",value:function(e){return Number.isInteger(e%1)||!!(e%1)}},{key:"_adaptNumericFilters",value:function(e){var t=this;if(!e)return"";var n={};e.forEach((function(e){var r=t._parseNumericFilter(e),i=r.fieldName,a=r.operator,o=r.fieldValue;n[i]=n[i]||{},n[i][a]=o}));var r=[];return Object.keys(n).forEach((function(e){null!=n[e]["<="]&&null!=n[e][">="]?r.push("".concat(e,":=[").concat(n[e][">="],"..").concat(n[e]["<="],"]")):null!=n[e]["<="]?r.push("".concat(e,":<=").concat(n[e]["<="])):null!=n[e][">="]?r.push("".concat(e,":>=").concat(n[e][">="])):null!=n[e]["="]&&r.push("".concat(e,":=").concat(n[e]["="]))})),r.join(" && ")}},{key:"_parseNumericFilter",value:function(e){var t,n,i,a,o,s;if((null===(t=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===t?void 0:t.length)>0){var c=this.configuration.facetableFieldsWithSpecialCharacters.map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));if(n=new RegExp("^(".concat(c.join("|"),")(<=|>=|>|<|=)(.*)$")),null!=(i=e.match(n))){var u=i,l=(0,r.default)(u,4);return{fieldName:a=l[1],operator:o=l[2],fieldValue:s=l[3]}}}if(n=this.constructor.DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX,null==(i=e.match(n)));else{var f=i,d=(0,r.default)(f,4);a=d[1],o=d[2],s=d[3]}return{fieldName:a,operator:o,fieldValue:s}}},{key:"_adaptGeoFilter",value:function(e){var t=e.insideBoundingBox,n=e.aroundRadius,i=e.aroundLatLng,a=e.insidePolygon;if(t){var o,s,c,u;if(Array.isArray(t)){var l=t.flat(),f=(0,r.default)(l,4);o=f[0],s=f[1],c=f[2],u=f[3]}else{var d=t.split(","),h=(0,r.default)(d,4);o=h[0],s=h[1],c=h[2],u=h[3]}return"".concat(this.configuration.geoLocationField,":(").concat(o,", ").concat(s,", ").concat(o,", ").concat(u,", ").concat(c,", ").concat(u,", ").concat(c,", ").concat(s,")")}if(i||n){if(!n||"all"===n)throw new Error("[Typesense-Instantsearch-Adapter] In Typesense, geo-filtering around a lat/lng also requires a numerical radius. So the `aroundRadius` parameter is required when `aroundLatLng` is used. If you intend to just geo-sort around a lat/long, you want to use the sortBy InstantSearch widget (or a virtual sortBy custom widget).");var p="".concat(parseFloat(n)/1e3," km");return"".concat(this.configuration.geoLocationField,":(").concat(i,", ").concat(p,")")}if(a){var m=a;return Array.isArray(a)&&(m=a.flat().join(",")),"".concat(this.configuration.geoLocationField,":(").concat(m,")")}}},{key:"_adaptFilters",value:function(e,t){var n=[];return e.filters&&n.push(e.filters),n.push(this._adaptFacetFilters(e.facetFilters,t)),n.push(this._adaptNumericFilters(e.numericFilters)),n.push(this._adaptGeoFilter(e)),n.filter((function(e){return e&&""!==e})).join(" && ")}},{key:"_adaptIndexName",value:function(e){return e.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[1]}},{key:"_adaptSortBy",value:function(e){return e.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[3]}},{key:"_adaptFacetBy",value:function(e,t){var n=this;return[e].flat().map((function(e){var r;return null!==(r=n.configuration.collectionSpecificFacetByOptions)&&void 0!==r&&null!==(r=r[t])&&void 0!==r&&r[e]?"".concat(e).concat(n.configuration.collectionSpecificFacetByOptions[t][e]):n.configuration.facetByOptions[e]?"".concat(e).concat(n.configuration.facetByOptions[e]):e})).join(",")}},{key:"_buildSearchParameters",value:function(e){for(var t=e.params,n=e.indexName,i=this._adaptIndexName(n),a={},o=0,s=Object.entries(this.additionalSearchParameters);o<s.length;o++){var c=(0,r.default)(s[o],2),u=c[0],l=c[1];a[this._camelToSnakeCase(u)]=l}if(this.collectionSpecificSearchParameters[i])for(var f=0,d=Object.entries(this.collectionSpecificSearchParameters[i]);f<d.length;f++){var h=(0,r.default)(d[f],2),p=h[0],m=h[1];a[this._camelToSnakeCase(p)]=m}var g=Object.assign({},a),v=this._adaptSortBy(n);return Object.assign(g,{collection:i,q:""===t.query||void 0===t.query?"*":t.query,facet_by:a.facet_by||this._adaptFacetBy(t.facets,i),filter_by:this._adaptFilters(t,i)||a.filter_by,sort_by:v||a.sort_by,max_facet_values:t.maxValuesPerFacet,page:(t.page||0)+1}),t.hitsPerPage&&(g.per_page=t.hitsPerPage),t.facetQuery&&(g.facet_query="".concat(t.facetName,":").concat(t.facetQuery),g.per_page=0),t.typesenseVectorQuery&&(g.vector_query=t.typesenseVectorQuery),Object.fromEntries(Object.entries(g).filter((function(e){var t=(0,r.default)(e,2);t[0];var n=t[1];return null!=n&&""!==n})))}},{key:"_camelToSnakeCase",value:function(e){return e.split(/(?=[A-Z])/).join("_").toLowerCase()}},{key:"request",value:(o=(0,n.default)(t.default.mark((function e(){var n,r=this;return t.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.instantsearchRequests.map((function(e){return r._buildSearchParameters(e)})),e.abrupt("return",this.typesenseClient.multiSearch.perform({searches:n}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})}],[{key:"INDEX_NAME_MATCHING_REGEX",get:function(){return new RegExp("^(.+?)(?=(/sort/(.*))|$)")}},{key:"DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*)((?!:).):(?!:)(.*)")}},{key:"DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*?)(<=|>=|>|<|=)(.*)")}}]),e}();return Qt.SearchRequestAdapter=o,Qt}(),f=function(){if(On)return hn;On=1;var e=l;Object.defineProperty(hn,"__esModule",{value:!0}),hn.SearchResponseAdapter=void 0;var t=e(h()),n=e(fn()),r=e((wn||(wn=1,function(e){var t=gn(),n=bn(),r=an(),i=Rn();e.exports=function(e){return t(e)||n(e)||r(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports}(pn)),pn.exports)),i=e((Pn||(Pn=1,function(e){var t=C();e.exports=function(e,n,r){return(n=t(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports}(En)),En.exports)),a=e(_()),o=e(N()),s=Nn();function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];(0,a.default)(this,e),this.typesenseResponse=t,this.instantsearchRequest=n,this.configuration=r,this.allTypesenseResponses=i}return(0,o.default)(e,[{key:"_adaptGroupedHits",value:function(e){var t=this,n=[];return n=e.map((function(e){var n=t._adaptHits(e.hits);return n.forEach((function(t){t.group_key=t._group_key=e.group_key,e.found&&(t._group_found=e.found)})),n})),this.configuration.flattenGroupedHits?n.flat():n.map((function(e){return u(u({},e[0]),{},{_grouped_hits:e})}))}},{key:"_adaptHits",value:function(e){var t=this;return e.map((function(e){var n=u({},e.document);n.objectID=e.document.id,n._snippetResult=t._adaptHighlightResult(e,"snippet"),n._highlightResult=t._adaptHighlightResult(e,"value"),n._rawTypesenseHit=e,["text_match","geo_distance_meters","curated","text_match_info","hybrid_search_info","vector_distance"].forEach((function(t){Object.keys(e).includes(t)&&!Object.keys(n).includes(t)&&(n[t]=e[t])}));var r=n[t.configuration.geoLocationField];return r&&(n._geoloc={lat:r[0],lng:r[1]}),n}))}},{key:"_adaptHighlightResult",value:function(e,t){var n={};return null!=e.highlight&&this.isHighlightPost0240RCN32Format(e.highlight)?this.adaptHighlightObject(e,n,t):this.adaptHighlightsArray(e,n,t),n}},{key:"isHighlightPost0240RCN32Format",value:function(e){return null==e.full&&null==e.snippet}},{key:"adaptHighlightsArray",value:function(e,a,o){var s=this;Object.assign.apply(Object,[a].concat((0,r.default)(Object.entries(e.document).map((function(e){var t=(0,n.default)(e,2),r=t[0],a=t[1];return(0,i.default)({},r,{value:a,matchLevel:"none",matchedWords:[]})}))))),e.highlights.forEach((function(e){a[e.field]={value:e[o]||e["".concat(o,"s")],matchLevel:"full",matchedWords:e.matched_tokens},e.indices&&(a[e.field].matchedIndices=e.indices)})),Object.entries(a).forEach((function(r){var i=(0,n.default)(r,2),c=i[0],u=i[1],l=c,f=u.value,d=u.matchLevel,h=u.matchedWords,p=u.matchedIndices;null==f?a[l]=s._adaptHighlightNullValue():Array.isArray(f)?(a[l]=[],e.document[l].forEach((function(e,n){p&&p.includes(n)?a[l].push({value:s._adaptHighlightTag("".concat(f[p.indexOf(n)]),s.instantsearchRequest.params.highlightPreTag,s.instantsearchRequest.params.highlightPostTag),matchLevel:d,matchedWords:h[n]}):"object"===(0,t.default)(e)?a[l].push(s._adaptHighlightInObjectValue(e,{},o)):a[l].push({value:"".concat(e),matchLevel:"none",matchedWords:[]})}))):"object"===(0,t.default)(f)?a[l]=s._adaptHighlightInObjectValue(f,{},o):a[l].value=s._adaptHighlightTag("".concat(f),s.instantsearchRequest.params.highlightPreTag,s.instantsearchRequest.params.highlightPostTag)}))}},{key:"adaptHighlightObject",value:function(e,t,n){Object.assign(t,this._adaptHighlightInObjectValue(e.document,e.highlight,n))}},{key:"_adaptHighlightInObjectValue",value:function(e,a,o){var s=this;return Object.assign.apply(Object,[{}].concat((0,r.default)(Object.entries(e).map((function(e){var r,c=(0,n.default)(e,2),u=c[0],l=c[1];if(null==l)r=s._adaptHighlightNullValue();else if(Array.isArray(l)){var f;r=s._adaptHighlightInArrayValue(l,null!==(f=null==a?void 0:a[u])&&void 0!==f?f:[],o)}else if("object"===(0,t.default)(l)){var d;r=s._adaptHighlightInObjectValue(l,null!==(d=null==a?void 0:a[u])&&void 0!==d?d:{},o)}else r=s._adaptHighlightInPrimitiveValue(l,null==a?void 0:a[u],o);return(0,i.default)({},u,r)})))))}},{key:"_adaptHighlightInArrayValue",value:function(e,n,r){var i=this;return e.map((function(e,a){var o;if(null==e)o=i._adaptHighlightNullValue();else if(Array.isArray(e)){var s;o=i._adaptHighlightInArrayValue(e,null!==(s=null==n?void 0:n[a])&&void 0!==s?s:[],r)}else if("object"===(0,t.default)(e)){var c;o=i._adaptHighlightInObjectValue(e,null!==(c=null==n?void 0:n[a])&&void 0!==c?c:{},r)}else o=i._adaptHighlightInPrimitiveValue(e,null==n?void 0:n[a],r);return o}))}},{key:"_adaptHighlightInPrimitiveValue",value:function(e,t,n){var r,i;return null!=t?{value:this._adaptHighlightTag("".concat(null!==(r=null!==(i=t[n])&&void 0!==i?i:t.highlight)&&void 0!==r?r:t.snippet),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:(t.matched_tokens||[]).length>0?"full":"none",matchedWords:t.matched_tokens||[]}:{value:this._adaptHighlightTag("".concat(e),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:"none",matchedWords:[]}}},{key:"_adaptHighlightNullValue",value:function(){return{value:"",matchLevel:"none",matchedWords:[]}}},{key:"_adaptFacets",value:function(e){var t={};return e.forEach((function(e){Object.assign(t,(0,i.default)({},e.field_name,Object.assign.apply(Object,[{}].concat((0,r.default)(e.counts.map((function(e){return(0,i.default)({},e.value,e.count)})))))))})),t}},{key:"_adaptFacetStats",value:function(e){var t={};return e.forEach((function(e){Object.keys(e.stats).length>0&&Object.assign(t,(0,i.default)({},e.field_name,e.stats))})),t}},{key:"_adaptRenderingContent",value:function(e){var t,n=Object.assign({},this.configuration.renderingContent);return null==(null===(t=n.facetOrdering)||void 0===t||null===(t=t.facets)||void 0===t?void 0:t.order)&&(n.facetOrdering=n.facetOrdering||{},n.facetOrdering.facets=n.facetOrdering.facets||{},n.facetOrdering.facets.order=(0,r.default)(new Set(e.map((function(e){return e.field_name})).concat(this.allTypesenseResponses.map((function(e){return e.facet_counts||[]})).flat().map((function(e){return e.field_name})).filter((function(e){return e})))))),n}},{key:"adapt",value:function(){var e=this._adaptRenderingContent(this.typesenseResponse.facet_counts||[]);return u({hits:this.typesenseResponse.grouped_hits?this._adaptGroupedHits(this.typesenseResponse.grouped_hits):this._adaptHits(this.typesenseResponse.hits),nbHits:this.typesenseResponse.found,page:this.typesenseResponse.page-1,nbPages:this._adaptNumberOfPages(),hitsPerPage:this.typesenseResponse.request_params.per_page,facets:this._adaptFacets(this.typesenseResponse.facet_counts||[]),facets_stats:this._adaptFacetStats(this.typesenseResponse.facet_counts||{}),query:this.typesenseResponse.request_params.q,processingTimeMS:this.typesenseResponse.search_time_ms},Object.keys(e).length>0?{renderingContent:e}:null)}}]),e}();return hn.SearchResponseAdapter=f,Object.assign(f.prototype,s.utils),hn}(),d=function(){if(jn)return Tn;jn=1;var e=l;Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.FacetSearchResponseAdapter=void 0;var t=e(_()),n=e(N()),r=Nn(),i=function(){function e(n,r){(0,t.default)(this,e),this.typesenseResponse=n,this.instantsearchRequest=r}return(0,n.default)(e,[{key:"_adaptFacetHits",value:function(e){var t=this;return e.find((function(e){return e.field_name===t.instantsearchRequest.params.facetName})).counts.map((function(e){return{value:e.value,highlighted:t._adaptHighlightTag(e.highlighted,t.instantsearchRequest.params.highlightPreTag,t.instantsearchRequest.params.highlightPostTag),count:e.count}}))}},{key:"adapt",value:function(){return{facetHits:this._adaptFacetHits(this.typesenseResponse.facet_counts),exhaustiveFacetsCount:!0,processingTimeMS:this.typesenseResponse.search_time_ms}}}]),e}();return Tn.FacetSearchResponseAdapter=i,Object.assign(i.prototype,r.utils),Tn}(),m=function(){function e(t){var n=this;(0,a.default)(this,e),this.updateConfiguration(t),this.searchClient={clearCache:function(){return n.clearCache()},search:function(e){return n.searchTypesenseAndAdapt(e)},searchForFacetValues:function(e){return n.searchTypesenseForFacetValuesAndAdapt(e)}}}var t,n,l;return(0,o.default)(e,[{key:"searchTypesenseAndAdapt",value:(l=(0,i.default)(r.default.mark((function e(t){var n,i,a=this;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._adaptAndPerformTypesenseRequest(t);case 3:return n=e.sent,i=n.results.map((function(e,r){return a._validateTypesenseResult(e),new f.SearchResponseAdapter(e,t[r],a.configuration,n.results).adapt()})),e.abrupt("return",{results:i});case 8:throw e.prev=8,e.t0=e.catch(0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e){return l.apply(this,arguments)})},{key:"searchTypesenseForFacetValuesAndAdapt",value:(n=(0,i.default)(r.default.mark((function e(t){var n,i,a=this;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._adaptAndPerformTypesenseRequest(t);case 3:return n=e.sent,i=n.results.map((function(e,n){return a._validateTypesenseResult(e),new d.FacetSearchResponseAdapter(e,t[n],a.configuration).adapt()})),e.abrupt("return",i);case 8:throw e.prev=8,e.t0=e.catch(0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e){return n.apply(this,arguments)})},{key:"_adaptAndPerformTypesenseRequest",value:(t=(0,i.default)(r.default.mark((function e(t){var n,i;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new u.SearchRequestAdapter(t,this.typesenseClient,this.configuration),e.next=3,n.request();case 3:return i=e.sent,e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"clearCache",value:function(){return this.typesenseClient=new c.SearchClient(this.configuration.server),this.searchClient}},{key:"updateConfiguration",value:function(e){return this.configuration=new s.Configuration(e),this.configuration.validate(),this.typesenseClient=new c.SearchClient(this.configuration.server),!0}},{key:"_validateTypesenseResult",value:function(e){if(e.error)throw new Error("".concat(e.code," - ").concat(e.error));if(!e.hits&&!e.grouped_hits)throw new Error("Did not find any hits. ".concat(e.code," - ").concat(e.error))}}]),e}();t.default=m}(i);var kn=t(i),In={exports:{}};!function(e){e.exports=function(){var e=0;function t(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function n(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function r(e){return e=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return String(e);if("object"!=typeof(n=n.call(e,t)))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"==typeof e?e:String(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e){if(null==e)throw new TypeError("Cannot destructure "+e)}function h(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};for(var n,r={},i=Object.keys(e),a=0;a<i.length;a++)n=i[a],0<=t.indexOf(n)||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(e),a=0;a<i.length;a++)n=i[a],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=l(e);if(n=t?(n=l(this).constructor,Reflect.construct(r,arguments,n)):r.apply(this,arguments),r=this,n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return p(r)}}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}(e,t)||y(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||y(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){var n;if(e)return"string"==typeof e?b(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(){}function w(e,t){return e}function S(e){return Object.prototype.toString.call(e).slice(8,-1)}function R(e,t){if(void 0===e||"function"!=typeof e)throw new Error("The render function is not valid (received type ".concat(S(e),").\n\n").concat(t))}function P(e){var t=e.helper,n=(e=void 0===(e=e.attributesToClear)?[]:e,t.state.setPage(0));return n=e.reduce((function(e,t){return n.isNumericRefined(t)?e.removeNumericRefinement(t):n.isHierarchicalFacet(t)?e.removeHierarchicalFacetRefinement(t):n.isDisjunctiveFacet(t)?e.removeDisjunctiveFacetRefinement(t):n.isConjunctiveFacet(t)?e.removeFacetRefinement(t):e}),n),n=-1!==e.indexOf("query")?n.setQuery(""):n}var x={"&":"&","<":"<",">":">",'"':""","'":"'"},O=/[&<>"']/g,E=RegExp(O.source),C={"&":"&","<":"<",">":">",""":'"',"'":"'"},N=/&(amp|quot|lt|gt|#39);/g,j=RegExp(N.source);function T(e){return e&&j.test(e)?e.replace(N,(function(e){return C[e]})):e}function k(e){if("object"===i(t=e)&&null!==t&&"[object Object]"===(null===(t=e)?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t))){var t;if(null===Object.getPrototypeOf(e))return 1;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}}var I={highlightPreTag:"__ais-highlight__",highlightPostTag:"__/ais-highlight__"},F={highlightPreTag:"<mark>",highlightPostTag:"</mark>"};function A(e){return(e&&E.test(e)?e.replace(O,(function(e){return x[e]})):e).replace(new RegExp(I.highlightPreTag,"g"),F.highlightPreTag).replace(new RegExp(I.highlightPostTag,"g"),F.highlightPostTag)}function M(e){return k(e)&&"string"!=typeof e.value?Object.keys(e).reduce((function(t,r){return n(n({},t),{},s({},r,M(e[r])))}),{}):Array.isArray(e)?e.map(M):n(n({},e),{},{value:A(e.value)})}function L(e){return void 0===e.__escaped&&((e=e.map((function(e){return(e=c({},(d(e),e)))._highlightResult&&(e._highlightResult=M(e._highlightResult)),e._snippetResult&&(e._snippetResult=M(e._snippetResult)),e}))).__escaped=!0),e}function H(e){var t=F.highlightPreTag,n=F.highlightPostTag;return e.map((function(e){return e.isHighlighted?t+e.value+n:e.value})).join("")}function D(e){var t=e.instantSearchInstance,r=e.helper,a=e.attribute,o=e.widgetType;return function(){for(var e=arguments.length,s=new Array(e),c=0;c<e;c++)s[c]=arguments[c];var u,l,f,d=s[1],h=void 0===(h=s[2])?"Filter Applied":h,p=void 0===(p=s[3])?{}:p,m=(v=g(s[0].split(":"),2))[0],v=v[1],y="string"==typeof a?a:a(d);1===s.length&&"object"===i(s[0])?t.sendEventToInsights(s[0]):"click"===m&&2<=s.length&&s.length<=4&&(l=y,f=d,((u=r).state.isHierarchicalFacet(l)?u.state.isHierarchicalFacetRefined(l,f):u.state.isConjunctiveFacet(l)?u.state.isFacetRefined(l,f):u.state.isDisjunctiveFacetRefined(l,f))||t.sendEventToInsights({insightsMethod:"clickedFilters",widgetType:o,eventType:m,eventModifier:v,payload:n({eventName:h,index:r.getIndex(),filters:["".concat(y,":").concat(d)]},p),attribute:y}))}}function q(e){return btoa(encodeURIComponent(JSON.stringify(e)))}function U(e){return JSON.parse(decodeURIComponent(atob(e)))}function W(e){var t,r,a,o,s,c,u,l,f=e.getIndex,d=e.widgetType,h=(e.methodName,e.args);return e=e.instantSearchInstance,1===h.length&&"object"===i(h[0])?[h[0]]:(c=g(h[0].split(":"),2),t=c[0],r=c[1],c=h[1],a=h[2],o=h[3]||{},c&&("click"!==t&&"conversion"!==t||a)&&0!==(h=Array.isArray(c)?c:[c]).length?(s=h[0].__queryID,c=function(e){for(var t=[],n=0;n<Math.ceil(e.length/20);n++)t.push(e.slice(20*n,20*(n+1)));return t}(h),u=c.map((function(e){return e.map((function(e){return e.objectID}))})),l=c.map((function(e){return e.map((function(e){return e.__position}))})),"view"===t?"idle"!==e.status?[]:c.map((function(e,i){return{insightsMethod:"viewedObjectIDs",widgetType:d,eventType:t,payload:n({eventName:a||"Hits Viewed",index:f(),objectIDs:u[i]},o),hits:e,eventModifier:r}})):"click"===t?c.map((function(e,i){return{insightsMethod:"clickedObjectIDsAfterSearch",widgetType:d,eventType:t,payload:n({eventName:a||"Hit Clicked",index:f(),queryID:s,objectIDs:u[i],positions:l[i]},o),hits:e,eventModifier:r}})):"conversion"===t?c.map((function(e,i){return{insightsMethod:"convertedObjectIDsAfterSearch",widgetType:d,eventType:t,payload:n({eventName:a||"Hit Converted",index:f(),queryID:s,objectIDs:u[i]},o),hits:e,eventModifier:r}})):[]):[])}function B(e){var t=e.instantSearchInstance,n=e.getIndex,r=e.widgetType,i={},a=void 0;return function(){for(var e=arguments.length,o=new Array(e),s=0;s<e;s++)o[s]=arguments[s];W({widgetType:r,getIndex:n,methodName:"sendEvent",args:o,instantSearchInstance:t}).forEach((function(e){"click"===e.eventType&&"internal"===e.eventModifier&&i[e.eventType]||(i[e.eventType]=!0,t.sendEventToInsights(e))})),clearTimeout(a),a=setTimeout((function(){i={}}),0)}}function $(e){var t=e.getIndex,n=e.widgetType,r=e.instantSearchInstance;return function(){for(var e=arguments.length,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];var o=W({widgetType:n,getIndex:t,methodName:"bindEvent",args:i,instantSearchInstance:r});return o.length?"data-insights-event=".concat(q(o)):""}}function V(e){return"ais.index"===e.$$type}function Q(e,t){var n=e[t.getIndexId()]||{};t.getHelper().setState(t.getWidgetSearchParameters(t.getHelper().state,{uiState:n})),t.getWidgets().filter(V).forEach((function(t){return Q(e,t)}))}function K(e,t){var n=null;return function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return new Promise((function(r,a){n&&clearTimeout(n),n=setTimeout((function(){n=null,Promise.resolve(e.apply(void 0,i)).then(r).catch(a)}),t)}))}}var z=Promise.resolve();function G(e){function t(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];null===n&&(n=z.then((function(){n=null,r?r=!1:e.apply(void 0,i)})))}var n=null,r=!1;return t.wait=function(){if(null===n)throw new Error("The deferred function should be called before calling `wait()`");return n},t.cancel=function(){null!==n&&(r=!0)},t}function J(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return["https://www.algolia.com/doc/api-reference/widgets/",e.name,"/js/",void 0!==(e=e.connector)&&e?"#connector":""].join("")})).join(", ");return function(e){return[e,"See documentation: ".concat(r)].filter(Boolean).join("\n\n")}}function Y(e){return"number"==typeof e&&e<0||"string"==typeof e?String(e).replace(/^-/,"\\-"):e}function X(e,t){for(var n,r=0;r<e.length;r++)if(t(n=e[r],r,e))return n}var Z=/^(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)$/;function ee(e){if(Array.isArray(e)){var t=e,n=g(t,1)[0],r=(n=g(void 0===n?[void 0,void 0,void 0,void 0]:n,4))[0],i=n[1],a=n[2];if(n=n[3],r&&i&&a&&n)return{northEast:{lat:r,lng:i},southWest:{lat:a,lng:n}};throw new Error('Invalid value for "insideBoundingBox" parameter: ['.concat(t,"]"))}if(a=(i=g((r=e).split(",").map(parseFloat),4))[0],n=i[1],t=i[2],i=i[3],a&&n&&t&&i)return{northEast:{lat:a,lng:n},southWest:{lat:t,lng:i}};throw new Error('Invalid value for "insideBoundingBox" parameter: "'.concat(r,'"'))}function te(e){var t,n="string"==typeof e,r=n?document.querySelector(e):e;if((t=r)instanceof HTMLElement||Boolean(t)&&0<t.nodeType)return r;throw t="Container must be `string` or `HTMLElement`.",n&&(t+=" Unable to find ".concat(e)),new Error(t)}function ne(e){var t=F.highlightPostTag,n=F.highlightPreTag,r=(n=(e=e.split(n)).shift())?[{value:n,isHighlighted:!1}]:[];return e.forEach((function(e){e=e.split(t),r.push({value:e[0],isHighlighted:!0}),""!==e[1]&&r.push({value:e[1],isHighlighted:!1})})),r}var re=new RegExp(/\w/i);function ie(e,t){return(Array.isArray(t)?t:t.split(".")).reduce((function(e,t){return e&&e[t]}),e)}function ae(e,t,n,r,i){i=4<arguments.length&&void 0!==i?i:[];var a,o={type:t,attribute:n,name:r,escapedValue:Y(r)},s=X(i,(function(e){return e.name===n}));if("hierarchical"===t){i=e.getHierarchicalFacetByName(n);for(var c=r.split(i.separator),u=0;void 0!==s&&u<c.length;++u)!function(e){var t;s=s&&s.data&&X(Object.keys(s.data).map((t=s.data,function(e){return t[e]})),(function(t){return t.name===c[e]}))}(u);a=s&&s.count}else a=s&&s.data&&s.data[o.name];return void 0!==a&&(o.count=a),s&&void 0!==s.exhaustive&&(o.exhaustive=s.exhaustive),o}function oe(e,t,n){n=2<arguments.length&&void 0!==n&&n;var r=e||{},i=[],a=void 0===(e=t.facetsRefinements)?{}:e,o=void 0===(e=t.facetsExcludes)?{}:e,s=void 0===(e=t.disjunctiveFacetsRefinements)?{}:e,c=void 0===(e=t.hierarchicalFacetsRefinements)?{}:e,u=void 0===(e=t.numericRefinements)?{}:e;return e=void 0===(e=t.tagRefinements)?[]:e,Object.keys(a).forEach((function(e){a[e].forEach((function(n){i.push(ae(t,"facet",e,n,r.facets))}))})),Object.keys(o).forEach((function(e){o[e].forEach((function(t){i.push({type:"exclude",attribute:e,name:t,exclude:!0})}))})),Object.keys(s).forEach((function(e){s[e].forEach((function(n){i.push(ae(t,"disjunctive",e,"string"==typeof n?n.replace(/^\\-/,"-"):n,r.disjunctiveFacets))}))})),Object.keys(c).forEach((function(e){c[e].forEach((function(n){i.push(ae(t,"hierarchical",e,n,r.hierarchicalFacets))}))})),Object.keys(u).forEach((function(e){var t=u[e];Object.keys(t).forEach((function(n){var r=n;n=t[r],(Array.isArray(n)?n:[n]).forEach((function(t){i.push({type:"numeric",attribute:e,name:"".concat(t),numericValue:t,operator:r})}))}))})),e.forEach((function(e){i.push({type:"tag",attribute:"_tags",name:e})})),n&&t.query&&t.query.trim()&&i.push({attribute:"query",type:"query",name:t.query,query:t.query}),i}function se(e,t){var n=null==(n=e.getWidgetRenderState)?void 0:n.call(e,t);if(t=null,n&&n.widgetParams&&((n=n.widgetParams).attribute?t=n.attribute:Array.isArray(n.attributes)&&(t=n.attributes[0])),"string"!=typeof t)throw new Error("Could not find the attribute of the widget:\n\n".concat(JSON.stringify(e),"\n\nPlease check whether the widget's getWidgetRenderState returns widgetParams.attribute correctly."));return t}function ce(e,t,r){return e.map((function(e,i){return n(n({},e),{},{__position:r*t+i+1})}))}function ue(e,t){return t?e.map((function(e){return n(n({},e),{},{__queryID:t})})):e}function le(e){return Object.keys(e).map((function(t){return function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=0;return e.replace(/%s/g,(function(){return encodeURIComponent(n[i++])}))}("%s=%s",t,(n=e[t],"[object Object]"===Object.prototype.toString.call(n)||"[object Array]"===Object.prototype.toString.call(n)?JSON.stringify(e[t]):e[t]));var n})).join("&")}function fe(e){return e!==Object(e)}function de(e,t){if(e===t)return 1;if(fe(e)||fe(t)||"function"==typeof e||"function"==typeof t)return e===t;if(Object.keys(e).length===Object.keys(t).length){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(!(i in t))return;if(!de(e[i],t[i]))return}return 1}}function he(e){return"number"==typeof e&&isFinite(e)}function pe(e){return 1===e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function me(e){return e.filter((function(e,t,n){return n.indexOf(e)===t}))}var ge=["facets","disjunctiveFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacets","hierarchicalFacetsRefinements","ruleContexts"],ve=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce((function(e,t){return e=function(e,t){return e.setQueryParameters({hierarchicalFacetsRefinements:n(n({},e.hierarchicalFacetsRefinements),t.hierarchicalFacetsRefinements)})}(e,t),e=function(e,t){return e.setQueryParameters({hierarchicalFacets:t.hierarchicalFacets.reduce((function(e,t){var n=function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}(e,(function(e){return e.name===t.name}));return-1===n?e.concat(t):((e=e.slice()).splice(n,1,t),e)}),e.hierarchicalFacets)})}(e,t),e=function(e,t){return t.tagRefinements.reduce((function(e,t){return e.addTagRefinement(t)}),e)}(e,t),e=function(e,t){return e.setQueryParameters({numericRefinements:n(n({},e.numericRefinements),t.numericRefinements)})}(e,t),e=function(e,t){return e.setQueryParameters({disjunctiveFacetsRefinements:n(n({},e.disjunctiveFacetsRefinements),t.disjunctiveFacetsRefinements)})}(e,t),e=function(e,t){return e.setQueryParameters({facetsExcludes:n(n({},e.facetsExcludes),t.facetsExcludes)})}(e,t),e=function(e,t){return e.setQueryParameters({facetsRefinements:n(n({},e.facetsRefinements),t.facetsRefinements)})}(e,t),e=function(e,t){return t.disjunctiveFacets.reduce((function(e,t){return e.addDisjunctiveFacet(t)}),e)}(e,t),e=function(e,t){return 0<(t=me([].concat(e.ruleContexts).concat(t.ruleContexts).filter(Boolean))).length?e.setQueryParameters({ruleContexts:t}):e}(e,t),e=function(e,t){return t.facets.reduce((function(e,t){return e.addFacet(t)}),e)}(e,t),function(e,t){return t.facets,t.disjunctiveFacets,t.facetsRefinements,t.facetsExcludes,t.disjunctiveFacetsRefinements,t.numericRefinements,t.tagRefinements,t.hierarchicalFacets,t.hierarchicalFacetsRefinements,t.ruleContexts,t=h(t,ge),e.setQueryParameters(t)}(e,t)}))};function ye(e,t){return null==e?e:Object.keys(e).reduce((function(n,r){return 0<=t.indexOf(r)||(n[r]=e[r]),n}),{})}function be(e){var t=void 0===(n=e.start)?0:n,n=e.end,r=0===(e=void 0===(e=e.step)?1:e)?1:e;return e=Math.round((n-t)/r),v(Array(e)).map((function(e,n){return t+n*r}))}function _e(e,t,n){var r=t.getHelper();return{uiState:n,helper:r,parent:t,instantSearchInstance:e,state:r.state,renderState:e.renderState,templatesConfig:e.templatesConfig,createURL:t.createURL,scopedResults:[],searchMetadata:{isSearchStalled:"stalled"===e.status},status:e.status,error:e.error}}function we(e,t,n){n=t.getResultsForWidget(n);var r=t.getHelper();return{helper:r,parent:t,instantSearchInstance:e,results:n,scopedResults:t.getScopedResults(),state:n&&"_state"in n?n._state:r.state,renderState:e.renderState,templatesConfig:e.templatesConfig,createURL:t.createURL,searchMetadata:{isSearchStalled:"stalled"===e.status},status:e.status,error:e.error}}function Se(e){return e.some((function(e){return e.isHighlighted}))?e.map((function(t,r){return n(n({},t),{},{isHighlighted:(i=(t=e)[r],a=(null==(a=e[r+1])?void 0:a.isHighlighted)||!0,r=(null==(t=e[r-1])?void 0:t.isHighlighted)||!0,!(re.test(T(i.value))||r!==a?i.isHighlighted:r))});var i,a})):e.map((function(e){return n(n({},e),{},{isHighlighted:!1})}))}function Re(e,t){return t=(1<arguments.length&&void 0!==t?t:{fallback:function(){}}).fallback,"undefined"==typeof window?t():e({window:window})}function Pe(e){return Array.isArray(e)?e:[e]}function xe(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,Oe()),function(r){var i,a,o,s,c,u,l,f,d,h=r||{},p=h.queryLanguages,m=h.attributesForPrediction,g=void 0===(v=h.nbHits)?1:v,v=h.renderDebounceTime,y=void 0===(d=h.searchDebounceTime)?100:d,b=void 0===(d=h.escapeHTML)||d,_=void 0===(d=h.extraParameters)?{}:d;if(p&&0!==p.length)return i=function(e){var t=++a;return Promise.resolve(e).then((function(e){return s&&t<o?s:(o=t,s=e)}))},c=[],u=!(o=a=-1),l=K(e,(s=void 0)===v?100:v),{$$type:"ais.answers",init:function(t){var r=t.state,i=t.instantSearchInstance;if("function"!=typeof i.client.initIndex)throw new Error(Oe("`algoliasearch` <5 required."));if("function"!=typeof(i=i.client.initIndex(r.index)).findAnswers)throw new Error(Oe("`algoliasearch` >= 4.8.0 required."));f=K(i.findAnswers,y),e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!0)},render:function(t){var r=this,a=t.state.query;a?(c=[],u=!0,e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!1),i(f(a,p,n(n({},_),{},{nbHits:g,attributesForPrediction:m}))).then((function(e){e&&(b&&0<e.hits.length&&(e.hits=L(e.hits)),e=ue(ce(e.hits,0,g),e.queryID),c=e,u=!1,l(n(n({},r.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!1))}))):(u=!(c=[]),e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!1))},getRenderState:function(e,t){return n(n({},e),{},{answers:this.getWidgetRenderState(t)})},getWidgetRenderState:function(){return{hits:c,isLoading:u,widgetParams:r}},dispose:function(e){return e=e.state,t(),e},getWidgetSearchParameters:function(e){return e}};throw new Error(Oe("The `queryLanguages` expects an array of strings."))}}var Oe=J({name:"answers",connector:!0});function Ee(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}var Ce=Ee;function Ne(e){return"function"==typeof e}function je(e){return"object"==typeof e&&null!==e}function Te(e){return void 0===e}Ee.prototype._events=void 0,Ee.prototype._maxListeners=void 0,Ee.defaultMaxListeners=10,Ee.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},Ee.prototype.emit=function(e){var t,n,r,i,a,o,s;if(this._events||(this._events={}),"error"===e&&(!this._events.error||je(this._events.error)&&!this._events.error.length))throw(s=arguments[1])instanceof Error?s:((o=new Error('Uncaught, unspecified "error" event. ('+s+")")).context=s,o);if(Te(t=this._events[e]))return!1;if(Ne(t))switch(arguments.length){case 1:t.call(this);break;case 2:t.call(this,arguments[1]);break;case 3:t.call(this,arguments[1],arguments[2]);break;default:r=Array.prototype.slice.call(arguments,1),t.apply(this,r)}else if(je(t))for(r=Array.prototype.slice.call(arguments,1),n=(a=t.slice()).length,i=0;i<n;i++)a[i].apply(this,r);return!0},Ee.prototype.on=Ee.prototype.addListener=function(e,t){if(Ne(t))return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,Ne(t.listener)?t.listener:t),this._events[e]?je(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,je(this._events[e])&&!this._events[e].warned&&(t=Te(this._maxListeners)?Ee.defaultMaxListeners:this._maxListeners)&&0<t&&this._events[e].length>t&&(this._events[e].warned=!0,console.trace),this;throw TypeError("listener must be a function")},Ee.prototype.once=function(e,t){var n;if(Ne(t))return n=!1,r.listener=t,this.on(e,r),this;throw TypeError("listener must be a function");function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}},Ee.prototype.removeListener=function(e,t){var n,r,i,a;if(!Ne(t))throw TypeError("listener must be a function");if(this._events&&this._events[e])if(i=(n=this._events[e]).length,r=-1,n===t||Ne(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(je(n)){for(a=i;0<a--;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},Ee.prototype.removeAllListeners=function(e){var t,n;if(this._events)if(this._events.removeListener)if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);this.removeAllListeners("removeListener"),this._events={}}else{if(Ne(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);delete this._events[e]}else 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e];return this},Ee.prototype.listeners=function(e){return this._events&&this._events[e]?Ne(this._events[e])?[this._events[e]]:this._events[e].slice():[]},Ee.prototype.listenerCount=function(e){if(this._events){if(Ne(e=this._events[e]))return 1;if(e)return e.length}return 0},Ee.listenerCount=function(e,t){return e.listenerCount(t)};var ke=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})};function Ie(e,t,n){this.main=e,this.fn=t,this.recommendFn=n,this.lastResults=null,this.lastRecommendResults=null}ke(Ie,Ce),Ie.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},Ie.prototype.getModifiedState=function(e){return this.fn(e)},Ie.prototype.getModifiedRecommendState=function(e){return this.recommendFn(e)};var Fe=Ie,Ae=function(e){return"string"!=typeof e?e:String(e).replace(/^-/,"\\-")},Me=function(e){return"string"!=typeof e?e:e.replace(/^\\-/,"-")};function Le(e){return"function"==typeof e||Array.isArray(e)||"[object Object]"===Object.prototype.toString.call(e)}function He(e,t){var n,r;if(e!==t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&"__proto__"!==i&&"constructor"!==i&&(n=t[i],void 0!==(r=e[i])&&void 0===n||(Le(r)&&Le(n)?e[i]=He(r,n):e[i]="object"==typeof(r=n)&&null!==r?He(Array.isArray(r)?[]:{},r):r));return e}var De=function(e){Le(e)||(e={});for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];Le(r)&&He(e,r)}return e},qe=function(e){return e&&0<Object.keys(e).length},Ue=function(e,t){if(null===e)return{};for(var n,r={},i=Object.keys(e),a=0;a<i.length;a++)n=i[a],0<=t.indexOf(n)||(r[n]=e[n]);return r};function We(e){this.params=(e=e||{}).params||[]}We.prototype={constructor:We,addParams:function(e){var t=this.params.slice();return t.push(e),new We({params:t})},removeParams:function(e){return new We({params:this.params.filter((function(t){return t.$$id!==e}))})},addFrequentlyBoughtTogether:function(e){return this.addParams(Object.assign({},e,{model:"bought-together"}))},addRelatedProducts:function(e){return this.addParams(Object.assign({},e,{model:"related-products"}))},addTrendingItems:function(e){return this.addParams(Object.assign({},e,{model:"trending-items"}))},addTrendingFacets:function(e){return this.addParams(Object.assign({},e,{model:"trending-facets"}))},addLookingSimilar:function(e){return this.addParams(Object.assign({},e,{model:"looking-similar"}))},_buildQueries:function(e,t){return this.params.filter((function(e){return void 0===t[e.$$id]})).map((function(t){return delete(t=Object.assign({},t,{indexName:e,threshold:t.threshold||0})).$$id,t}))}};var Be=We;function $e(e,t){this._state=e,this._rawResults={};var n=this;e.params.forEach((function(e){e=e.$$id,n[e]=t[e],n._rawResults[e]=t[e]}))}$e.prototype={constructor:$e};var Ve=$e;function Qe(e){return Object.keys(e).sort().reduce((function(t,n){return t[n]=e[n],t}),{})}function Ke(){return Array.prototype.slice.call(arguments).reduceRight((function(e,t){return Object.keys(Object(t)).forEach((function(n){void 0!==t[n]&&(void 0!==e[n]&&delete e[n],e[n]=t[n])})),e}),{})}var ze={_getQueries:function(e,t){var n=[];return n.push({indexName:e,params:ze._getHitsSearchParams(t)}),t.getRefinedDisjunctiveFacets().forEach((function(r){n.push({indexName:e,params:ze._getDisjunctiveFacetSearchParams(t,r)})})),t.getRefinedHierarchicalFacets().forEach((function(r){var i,a=t.getHierarchicalFacetByName(r),o=(r=t.getHierarchicalRefinement(r),t._getHierarchicalFacetSeparator(a));0<r.length&&1<r[0].split(o).length&&(i=r[0].split(o).slice(0,-1).reduce((function(e,t,n){return e.concat({attribute:a.attributes[n],value:0===n?t:[e[e.length-1].value,t].join(o)})}),[])).forEach((function(r,o){function s(e){return a.attributes.some((function(t){return t===e.split(":")[0]}))}var c=((r=ze._getDisjunctiveFacetSearchParams(t,r.attribute,0===o)).facetFilters||[]).reduce((function(e,t){var n;return Array.isArray(t)&&0<(n=t.filter((function(e){return!s(e)}))).length&&e.push(n),"string"!=typeof t||s(t)||e.push(t),e}),[]),u=i[o-1];0<o?r.facetFilters=c.concat(u.attribute+":"+u.value):0<c.length?r.facetFilters=c:delete r.facetFilters,n.push({indexName:e,params:r})}))})),n},_getCompositionQueries:function(e){return[{compositionID:e.index,requestBody:{params:ze._getCompositionHitsSearchParams(e)}}]},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(ze._getHitsHierarchicalFacetsAttributes(e)).sort(),n=ze._getFacetFilters(e),r=ze._getNumericFilters(e),i=ze._getTagFilters(e),a={};return 0<t.length&&(a.facets=-1<t.indexOf("*")?["*"]:t),0<i.length&&(a.tagFilters=i),0<n.length&&(a.facetFilters=n),0<r.length&&(a.numericFilters=r),Qe(De({},e.getQueryParams(),a))},_getCompositionHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets.map((function(e){return"disjunctive("+e+")"}))).concat(ze._getHitsHierarchicalFacetsAttributes(e)).sort(),n=ze._getFacetFilters(e),r=ze._getNumericFilters(e),i=ze._getTagFilters(e),a={};return delete(0<t.length&&(a.facets=-1<t.indexOf("*")?["*"]:t),0<i.length&&(a.tagFilters=i),0<n.length&&(a.facetFilters=n),0<r.length&&(a.numericFilters=r),t=e.getQueryParams()).highlightPreTag,delete t.highlightPostTag,delete t.index,Qe(De({},t,a))},_getDisjunctiveFacetSearchParams:function(e,t,n){var r=ze._getFacetFilters(e,t,n),i=ze._getNumericFilters(e,t),a={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1},o=(0<(o=ze._getTagFilters(e)).length&&(a.tagFilters=o),e.getHierarchicalFacetByName(t));return a.facets=o?ze._getDisjunctiveHierarchicalFacetAttribute(e,o,n):t,0<i.length&&(a.numericFilters=i),0<r.length&&(a.facetFilters=r),Qe(De({},e.getQueryParams(),a))},_getNumericFilters:function(e,t){var n;return e.numericFilters||(n=[],Object.keys(e.numericRefinements).forEach((function(r){var i=e.numericRefinements[r]||{};Object.keys(i).forEach((function(e){var a=i[e]||[];t!==r&&a.forEach((function(t){var i;Array.isArray(t)?(i=t.map((function(t){return r+e+t})),n.push(i)):n.push(r+e+t)}))}))})),n)},_getTagFilters:function(e){return e.tagFilters||e.tagRefinements.join(",")},_getFacetFilters:function(e,t,n){var r=[],i=e.facetsRefinements||{},a=(Object.keys(i).sort().forEach((function(e){(i[e]||[]).slice().sort().forEach((function(t){r.push(e+":"+t)}))})),e.facetsExcludes||{}),o=(Object.keys(a).sort().forEach((function(e){(a[e]||[]).sort().forEach((function(t){r.push(e+":-"+t)}))})),e.disjunctiveFacetsRefinements||{}),s=(Object.keys(o).sort().forEach((function(e){var n,i=o[e]||[];e!==t&&i&&0!==i.length&&(n=[],i.slice().sort().forEach((function(t){n.push(e+":"+t)})),r.push(n))})),e.hierarchicalFacetsRefinements||{});return Object.keys(s).sort().forEach((function(i){var a=(s[i]||[])[0];if(void 0!==a){var o,c=e.getHierarchicalFacetByName(i),u=e._getHierarchicalFacetSeparator(c),l=e._getHierarchicalRootPath(c);if(t===i){if(-1===a.indexOf(u)||!l&&!0===n||l&&l.split(u).length===a.split(u).length)return;a=l?(o=l.split(u).length-1,l):(o=a.split(u).length-2,a.slice(0,a.lastIndexOf(u)))}else o=a.split(u).length-1;(i=c.attributes[o])&&r.push([i+":"+a])}})),r},_getHitsHierarchicalFacetsAttributes:function(e){return e.hierarchicalFacets.reduce((function(t,n){var r,i=e.getHierarchicalRefinement(n.name)[0];return i?(r=e._getHierarchicalFacetSeparator(n),i=i.split(r).length,r=n.attributes.slice(0,i+1),t.concat(r)):(t.push(n.attributes[0]),t)}),[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,n){var r,i=e._getHierarchicalFacetSeparator(t);return!0===n?(n=0,(r=e._getHierarchicalRootPath(t))&&(n=r.split(i).length),[t.attributes[n]]):(r=(e.getHierarchicalRefinement(t.name)[0]||"").split(i).length-1,t.attributes.slice(0,1+r))},getSearchForFacetQuery:function(e,t,n,r){return r=r.isDisjunctiveFacet(e)?r.clearRefinements(e):r,t={facetQuery:t,facetName:e},"number"==typeof n&&(t.maxFacetHits=n),Qe(De({},ze._getHitsSearchParams(r),t))}},Ge=ze,Je=function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]},Ye=function(e,t){return e.filter((function(n,r){return-1<t.indexOf(n)&&e.indexOf(n)===r}))},Xe=function e(t){if("number"==typeof t)return t;if("string"==typeof t)return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")},Ze={addRefinement:function(e,t,n){var r;return Ze.isRefined(e,t,n)?e:(n=""+n,n=e[t]?e[t].concat(n):[n],(r={})[t]=n,Ke(r,e))},removeRefinement:function(e,t,n){var r;return void 0===n?Ze.clearRefinement(e,(function(e,n){return t===n})):(r=""+n,Ze.clearRefinement(e,(function(e,n){return t===n&&r===e})))},toggleRefinement:function(e,t,n){if(void 0===n)throw new Error("toggleRefinement should be used with a value");return Ze.isRefined(e,t,n)?Ze.removeRefinement(e,t,n):Ze.addRefinement(e,t,n)},clearRefinement:function(e,t,n){var r,i;return void 0===t?qe(e)?{}:e:"string"==typeof t?Ue(e,[t]):"function"==typeof t?(r=!1,i=Object.keys(e).reduce((function(i,a){var o=e[a]||[],s=o.filter((function(e){return!t(e,a,n)}));return s.length!==o.length&&(r=!0),i[a]=s,i}),{}),r?i:e):void 0},isRefined:function(e,t,n){var r=Boolean(e[t])&&0<e[t].length;return void 0!==n&&r?-1!==e[t].indexOf(""+n):r}},et=Ze;function tt(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((function(e,n){return tt(t[n],e)})):e===t}function nt(e){var t=e?nt._parseNumbers(e):{},n=(void 0===t.userToken||null!==(e=t.userToken)&&/^[a-zA-Z0-9_-]{1,64}$/.test(e),this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{},this);Object.keys(t).forEach((function(e){var r=-1!==nt.PARAMETERS.indexOf(e),i=void 0!==t[e];!r&&i&&(n[e]=t[e])}))}function rt(e){return Array.isArray(e)?e.filter(Boolean):[]}function it(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}function at(e,t){var n=(t||[]).map((function(e){return e.split(":")}));return e.reduce((function(e,t){var r=t.split(":");return t=Je(n,(function(e){return e[0]===r[0]})),1<r.length||!t?(e[0].push(r[0]),e[1].push(r[1])):(e[0].push(t[0]),e[1].push(t[1])),e}),[[],[]])}nt.PARAMETERS=Object.keys(new nt),nt._parseNumbers=function(e){var t,n;return e instanceof nt?e:(t={},["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach((function(n){var r,i=e[n];"string"==typeof i&&(r=parseFloat(i),t[n]=isNaN(r)?i:r)})),Array.isArray(e.insideBoundingBox)&&(t.insideBoundingBox=e.insideBoundingBox.map((function(e){return Array.isArray(e)?e.map((function(e){return parseFloat(e)})):e}))),e.numericRefinements&&(n={},Object.keys(e.numericRefinements).forEach((function(t){var r=e.numericRefinements[t]||{};n[t]={},Object.keys(r).forEach((function(e){var i=r[e].map((function(e){return Array.isArray(e)?e.map((function(e){return"string"==typeof e?parseFloat(e):e})):"string"==typeof e?parseFloat(e):e}));n[t][e]=i}))})),t.numericRefinements=n),De(e,t))},nt.make=function(e){var t=new nt(e);return(e.hierarchicalFacets||[]).forEach((function(e){var n;e.rootPath&&0===(n=(t=0<(n=t.getHierarchicalRefinement(e.name)).length&&0!==n[0].indexOf(e.rootPath)?t.clearRefinements(e.name):t).getHierarchicalRefinement(e.name)).length&&(t=t.toggleHierarchicalFacetRefinement(e.name,e.rootPath))})),t},nt.validate=function(e,t){return t=t||{},e.tagFilters&&t.tagRefinements&&0<t.tagRefinements.length?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):0<e.tagRefinements.length&&t.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&t.numericRefinements&&qe(t.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):qe(e.numericRefinements)&&t.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},nt.prototype={constructor:nt,clearRefinements:function(e){return(e={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:et.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:et.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:et.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:et.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")}).numericRefinements===this.numericRefinements&&e.facetsRefinements===this.facetsRefinements&&e.facetsExcludes===this.facetsExcludes&&e.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&e.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(e)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,n){var r;return n=Xe(n),this.isNumericRefined(e,t,n)?this:((r=De({},this.numericRefinements))[e]=De({},r[e]),r[e][t]?(r[e][t]=r[e][t].slice(),r[e][t].push(n)):r[e][t]=[n],this.setQueryParameters({numericRefinements:r}))},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)&&this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsExcludes[e]||[]},removeNumericRefinement:function(e,t,n){var r=n;return void 0!==r?this.isNumericRefined(e,t,r)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(n,i){return i===e&&n.op===t&&tt(n.val,Xe(r))}))}):this:void 0!==t?this.isNumericRefined(e,t)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(n,r){return r===e&&n.op===t}))}):this:this.isNumericRefined(e)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(t,n){return n===e}))}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(e){var t,n,r;return void 0===e?qe(this.numericRefinements)?{}:this.numericRefinements:"string"==typeof e?Ue(this.numericRefinements,[e]):"function"==typeof e?(t=!1,n=this.numericRefinements,r=Object.keys(n).reduce((function(r,i){var a=n[i],o={};return a=a||{},Object.keys(a).forEach((function(n){var r=a[n]||[],s=[];r.forEach((function(t){e({val:t,op:n},i,"numeric")||s.push(t)})),s.length!==r.length&&(t=!0),o[n]=s})),r[i]=o,r}),{}),t?r:this.numericRefinements):void 0},addFacet:function(e){return this.isConjunctiveFacet(e)?this:this.setQueryParameters({facets:this.facets.concat([e])})},addDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([e])})},addHierarchicalFacet:function(e){if(this.isHierarchicalFacet(e.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+e.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([e])})},addFacetRefinement:function(e,t){if(this.isConjunctiveFacet(e))return et.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:et.addRefinement(this.facetsRefinements,e,t)});throw new Error(e+" is not defined in the facets attribute of the helper configuration")},addExcludeRefinement:function(e,t){if(this.isConjunctiveFacet(e))return et.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:et.addRefinement(this.facetsExcludes,e,t)});throw new Error(e+" is not defined in the facets attribute of the helper configuration")},addDisjunctiveFacetRefinement:function(e,t){if(this.isDisjunctiveFacet(e))return et.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:et.addRefinement(this.disjunctiveFacetsRefinements,e,t)});throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration")},addTagRefinement:function(e){return this.isTagRefined(e)?this:(e={tagRefinements:this.tagRefinements.concat(e)},this.setQueryParameters(e))},removeFacet:function(e){return this.isConjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({facets:this.facets.filter((function(t){return t!==e}))}):this},removeDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter((function(t){return t!==e}))}):this},removeHierarchicalFacet:function(e){return this.isHierarchicalFacet(e)?this.clearRefinements(e).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter((function(t){return t.name!==e}))}):this},removeFacetRefinement:function(e,t){if(this.isConjunctiveFacet(e))return et.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:et.removeRefinement(this.facetsRefinements,e,t)}):this;throw new Error(e+" is not defined in the facets attribute of the helper configuration")},removeExcludeRefinement:function(e,t){if(this.isConjunctiveFacet(e))return et.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:et.removeRefinement(this.facetsExcludes,e,t)}):this;throw new Error(e+" is not defined in the facets attribute of the helper configuration")},removeDisjunctiveFacetRefinement:function(e,t){if(this.isDisjunctiveFacet(e))return et.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:et.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this;throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration")},removeTagRefinement:function(e){var t;return this.isTagRefined(e)?(t={tagRefinements:this.tagRefinements.filter((function(t){return t!==e}))},this.setQueryParameters(t)):this},toggleRefinement:function(e,t){return this.toggleFacetRefinement(e,t)},toggleFacetRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleConjunctiveFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(e,t){if(this.isConjunctiveFacet(e))return this.setQueryParameters({facetsRefinements:et.toggleRefinement(this.facetsRefinements,e,t)});throw new Error(e+" is not defined in the facets attribute of the helper configuration")},toggleExcludeFacetRefinement:function(e,t){if(this.isConjunctiveFacet(e))return this.setQueryParameters({facetsExcludes:et.toggleRefinement(this.facetsExcludes,e,t)});throw new Error(e+" is not defined in the facets attribute of the helper configuration")},toggleDisjunctiveFacetRefinement:function(e,t){if(this.isDisjunctiveFacet(e))return this.setQueryParameters({disjunctiveFacetsRefinements:et.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)});throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration")},toggleHierarchicalFacetRefinement:function(e,t){var n,r;if(this.isHierarchicalFacet(e))return n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),r={},void 0!==this.hierarchicalFacetsRefinements[e]&&0<this.hierarchicalFacetsRefinements[e].length&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+n))?-1===t.indexOf(n)?r[e]=[]:r[e]=[t.slice(0,t.lastIndexOf(n))]:r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:Ke(r,this.hierarchicalFacetsRefinements)});throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration")},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");var n;if(this.isHierarchicalFacet(e))return(n={})[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:Ke(n,this.hierarchicalFacetsRefinements)});throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.")},removeHierarchicalFacetRefinement:function(e){var t;return this.isHierarchicalFacetRefined(e)?((t={})[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:Ke(t,this.hierarchicalFacetsRefinements)})):this},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return-1<this.disjunctiveFacets.indexOf(e)},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return-1<this.facets.indexOf(e)},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&et.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&et.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&et.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){return!!this.isHierarchicalFacet(e)&&(e=this.getHierarchicalRefinement(e),t?-1!==e.indexOf(t):0<e.length)},isNumericRefined:function(e,t,n){var r,i;return void 0===n&&void 0===t?Boolean(this.numericRefinements[e]):(r=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t],void 0!==n&&r?(n=Xe(n),t=void 0!==(e=this.numericRefinements[e][t],i=n,Je(e,(function(e){return tt(e,i)}))),r&&t):r)},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var e=this,t=Ye(Object.keys(this.numericRefinements).filter((function(t){return 0<Object.keys(e.numericRefinements[t]).length})),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter((function(t){return 0<e.disjunctiveFacetsRefinements[t].length})).concat(t).concat(this.getRefinedHierarchicalFacets()).sort()},getRefinedHierarchicalFacets:function(){var e=this;return Ye(this.hierarchicalFacets.map((function(e){return e.name})),Object.keys(this.hierarchicalFacetsRefinements).filter((function(t){return 0<e.hierarchicalFacetsRefinements[t].length}))).sort()},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter((function(t){return-1===e.indexOf(t)}))},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var e=this.managedParameters,t={},n=this;return Object.keys(this).forEach((function(r){var i=n[r];-1===e.indexOf(r)&&void 0!==i&&(t[r]=i)})),t},setQueryParameter:function(e,t){var n;return this[e]===t?this:((n={})[e]=t,this.setQueryParameters(n))},setQueryParameters:function(e){if(!e)return this;if(r=nt.validate(this,e))throw r;var t=this,n=nt._parseNumbers(e),r=Object.keys(this).reduce((function(e,n){return e[n]=t[n],e}),{});return e=Object.keys(n).reduce((function(e,t){var r=void 0!==e[t],i=void 0!==n[t];return r&&!i?Ue(e,[t]):(i&&(e[t]=n[t]),e)}),r),new this.constructor(e)},resetPage:function(){return void 0===this.page?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"!=typeof e.showParentLevel||e.showParentLevel},getHierarchicalFacetByName:function(e){return Je(this.hierarchicalFacets,(function(t){return t.name===e}))},getHierarchicalFacetBreadcrumb:function(e){var t;return this.isHierarchicalFacet(e)&&(t=this.getHierarchicalRefinement(e)[0])?(e=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),t.split(e).map((function(e){return e.trim()}))):[]},toString:function(){return JSON.stringify(this,null,2)}};var ot=nt,st=function(){return Array.prototype.slice.call(arguments).reduceRight((function(e,t){return Object.keys(Object(t)).forEach((function(n){var r="number"==typeof e[n]?e[n]:0,i=t[n];void 0!==i&&r<=i&&(void 0!==e[n]&&delete e[n],e[n]=i)})),e}),{})},ct=function(e,t,n){return Array.isArray(e)?(Array.isArray(n)||(n=[]),(e=e.map((function(e,n){return{criteria:t.map((function(t){return e[t]})),index:n,value:e}}))).sort((function(e,t){for(var r=-1;++r<e.criteria.length;){var i=function(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=void 0!==t,a=null===t;if(!a&&t<e||r&&i||!n)return 1;if(!r&&e<t||a&&n||!i)return-1}return 0}(e.criteria[r],t.criteria[r]);if(i)return r>=n.length||"desc"!==n[r]?i:-i}return e.index-t.index})),e.map((function(e){return e.value}))):[]},ut=Ae,lt=Me,ft=Ae,dt=Me;function ht(e){var t={};return e.forEach((function(e,n){t[e]=n})),t}function pt(e,t,n){t&&t[n]&&(e.stats=t[n])}function mt(e,t,n){var r=t[0]||{},i=(this._rawResults=t,this),a=(Object.keys(r).forEach((function(e){i[e]=r[e]})),Ke(n,{persistHierarchicalRootCount:!1})),o=(Object.keys(a).forEach((function(e){i[e]=a[e]})),this.processingTimeMS=t.reduce((function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS}),0),this.disjunctiveFacets=[],this.hierarchicalFacets=e.hierarchicalFacets.map((function(){return[]})),this.facets=[],n=e.getRefinedDisjunctiveFacets(),ht(e.facets)),s=ht(e.disjunctiveFacets),c=1,u=r.facets||{};Object.keys(u).forEach((function(t){var n,a,c,l,f=u[t],d=(c=e.hierarchicalFacets,n=t,Je(c,(function(e){return-1<(e.attributes||[]).indexOf(n)})));d?(c=d.attributes.indexOf(t),a=it(e.hierarchicalFacets,(function(e){return e.name===d.name})),i.hierarchicalFacets[a][c]={attribute:t,data:f,exhaustive:r.exhaustiveFacetsCount}):(a=-1!==e.disjunctiveFacets.indexOf(t),c=-1!==e.facets.indexOf(t),a&&(l=s[t],i.disjunctiveFacets[l]={name:t,data:f,exhaustive:r.exhaustiveFacetsCount},pt(i.disjunctiveFacets[l],r.facets_stats,t)),c&&(l=o[t],i.facets[l]={name:t,data:f,exhaustive:r.exhaustiveFacetsCount},pt(i.facets[l],r.facets_stats,t)))})),this.hierarchicalFacets=rt(this.hierarchicalFacets),n.forEach((function(n){var a=t[c],o=a&&a.facets?a.facets:{},u=e.getHierarchicalFacetByName(n);Object.keys(o).forEach((function(t){var n,c,l=o[t];u?(n=it(e.hierarchicalFacets,(function(e){return e.name===u.name})),-1!==(c=it(i.hierarchicalFacets[n],(function(e){return e.attribute===t})))&&(i.hierarchicalFacets[n][c].data=i.persistHierarchicalRootCount?st(i.hierarchicalFacets[n][c].data,l):Ke(l,i.hierarchicalFacets[n][c].data))):(n=s[t],c=r.facets&&r.facets[t]||{},i.disjunctiveFacets[n]={name:t,data:st(c,l),exhaustive:a.exhaustiveFacetsCount},pt(i.disjunctiveFacets[n],a.facets_stats,t),e.disjunctiveFacetsRefinements[t]&&e.disjunctiveFacetsRefinements[t].forEach((function(r){!i.disjunctiveFacets[n].data[r]&&-1<e.disjunctiveFacetsRefinements[t].indexOf(dt(r))&&(i.disjunctiveFacets[n].data[r]=0)})))})),c++})),e.getRefinedHierarchicalFacets().forEach((function(n){var r=e.getHierarchicalFacetByName(n),a=e._getHierarchicalFacetSeparator(r),o=e.getHierarchicalRefinement(n);0===o.length||o[0].split(a).length<2||t.slice(c).forEach((function(t){var n=t&&t.facets?t.facets:{};Object.keys(n).forEach((function(t){var s,c,u=n[t],l=it(e.hierarchicalFacets,(function(e){return e.name===r.name})),f=it(i.hierarchicalFacets[l],(function(e){return e.attribute===t}));-1!==f&&(s={},0<o.length&&!i.persistHierarchicalRootCount&&(s[c=o[0].split(a)[0]]=i.hierarchicalFacets[l][f].data[c]),i.hierarchicalFacets[l][f].data=Ke(s,u,i.hierarchicalFacets[l][f].data))})),c++}))})),Object.keys(e.facetsExcludes).forEach((function(t){var n=e.facetsExcludes[t],a=o[t];i.facets[a]={name:t,data:u[t],exhaustive:r.exhaustiveFacetsCount},n.forEach((function(e){i.facets[a]=i.facets[a]||{name:t},i.facets[a].data=i.facets[a].data||{},i.facets[a].data[e]=0}))})),this.hierarchicalFacets=this.hierarchicalFacets.map(function(e){return function(t,n){var r,i,a,o,s,c=e.hierarchicalFacets[n],u=e.hierarchicalFacetsRefinements[c.name]&&e.hierarchicalFacetsRefinements[c.name][0]||"",l=e._getHierarchicalFacetSeparator(c),f=e._getHierarchicalRootPath(c),d=e._getHierarchicalShowParentLevel(c),h=(c=at(e._getHierarchicalFacetSortBy(c)),t.every((function(e){return e.exhaustive})));return r=c,i=l,o=d,s=u,c=t,(c=(a=f)?t.slice(f.split(l).length):c).reduce((function(e,t,n){var c,u=e;if(0<n){var l=0;for(u=e;l<n;){var f=u&&Array.isArray(u.data)?u.data:[];u=Je(f,(function(e){return e.isRefined})),l++}}return u&&(c=Object.keys(t.data).map((function(e){return[e,t.data[e]]})).filter((function(e){var t,n,r,c,l;return e=e[0],t=u.path||a,n=s,r=i,l=o,(!(c=a)||0===e.indexOf(c)&&c!==e)&&(!c&&-1===e.indexOf(r)||c&&e.split(r).length-c.split(r).length==1||-1===e.indexOf(r)&&-1===n.indexOf(r)||0===n.indexOf(e)||0===e.indexOf(t+r)&&(l||0===e.indexOf(n)))})),u.data=ct(c.map((function(e){var n,r,a,o,c=e[0];return e=e[1],n=i,r=lt(s),a=t.exhaustive,{name:(o=c.split(n))[o.length-1].trim(),path:c,escapedValue:ut(c),count:e,isRefined:r===c||0===r.indexOf(c+n),exhaustive:a,data:null}})),r[0],r[1])),e}),{name:e.hierarchicalFacets[n].name,count:null,isRefined:!0,path:null,escapedValue:null,exhaustive:h,data:null})}}(e)),this.facets=rt(this.facets),this.disjunctiveFacets=rt(this.disjunctiveFacets),this._state=e}function gt(e,t){return(e=Je(e,(function(e){return e.name===t})))&&e.stats}function vt(e,t,n,r,i){i=Je(i,(function(e){return e.name===n}));var a=i&&i.data&&i.data[r]?i.data[r]:0;return i=i&&i.exhaustive||!1,{type:t,attributeName:n,name:r,count:a,exhaustive:i}}mt.prototype.getFacetByName=function(e){function t(t){return t.name===e}return Je(this.facets,t)||Je(this.disjunctiveFacets,t)||Je(this.hierarchicalFacets,t)},mt.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],mt.prototype.getFacetValues=function(e,t){var n,r,i=function(e,t){function n(e){return e.name===t}var r,i,a,o,s,c;return e._state.isConjunctiveFacet(t)?(r=Je(e.facets,n))?Object.keys(r.data).map((function(n){var i=ft(n);return{name:n,escapedValue:i,count:r.data[n],isRefined:e._state.isFacetRefined(t,i),isExcluded:e._state.isExcludeRefined(t,n)}})):[]:e._state.isDisjunctiveFacet(t)?(i=Je(e.disjunctiveFacets,n))?Object.keys(i.data).map((function(n){var r=ft(n);return{name:n,escapedValue:r,count:i.data[n],isRefined:e._state.isDisjunctiveFacetRefined(t,r)}})):[]:e._state.isHierarchicalFacet(t)?((a=Je(e.hierarchicalFacets,n))&&(c=e._state.getHierarchicalFacetByName(t),o=e._state._getHierarchicalFacetSeparator(c),(c=(s=0===(s=dt(e._state.getHierarchicalRefinement(t)[0]||"")).indexOf(c.rootPath)?s.replace(c.rootPath+o,""):s).split(o)).unshift(t),function e(t,n,r){t.isRefined=t.name===(n[r]&&n[r].trim()),t.data&&t.data.forEach((function(t){e(t,n,r+1)}))}(a,c,0)),a):void 0}(this,e);if(i)return n=Ke(t,{sortBy:mt.DEFAULT_SORT,facetOrdering:!(t&&t.sortBy)}),r=this,function e(t,n,r,i){var a;return i=i||0,Array.isArray(n)?t(n,r[i]):n.data&&0!==n.data.length?(a=n.data.map((function(n){return e(t,n,r,i+1)})),Ke({data:a=t(a,r[i])},n)):n}((function(e,t){if(n.facetOrdering&&(c=(c=r).renderingContent&&c.renderingContent.facetOrdering&&c.renderingContent.facetOrdering.values&&c.renderingContent.facetOrdering.values[t]))return t=e,i=[],a=[],o=c.hide||[],s=(c.order||[]).reduce((function(e,t,n){return e[t]=n,e}),{}),t.forEach((function(e){var t=e.path||e.name,n=-1<o.indexOf(t);n||void 0===s[t]?n||a.push(e):i[s[t]]=e})),i=i.filter((function(e){return e})),"hidden"===(t=c.sortRemainingBy)?i:i.concat(ct(a,(c="alpha"===t?[["path","name"],["asc","asc"]]:[["count"],["desc"]])[0],c[1]));var i,a,o,s,c;if(Array.isArray(n.sortBy))return t=at(n.sortBy,mt.DEFAULT_SORT),ct(e,t[0],t[1]);if("function"==typeof n.sortBy)return c=n.sortBy,e.sort(c);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")}),i,Array.isArray(i)?[e]:r._state.getHierarchicalFacetByName(i.name).attributes)},mt.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?gt(this.facets,e):this._state.isDisjunctiveFacet(e)?gt(this.disjunctiveFacets,e):void 0},mt.prototype.getRefinements=function(){var e=this._state,t=this,n=[];return Object.keys(e.facetsRefinements).forEach((function(r){e.facetsRefinements[r].forEach((function(e){n.push(vt(0,"facet",r,e,t.facets))}))})),Object.keys(e.facetsExcludes).forEach((function(r){e.facetsExcludes[r].forEach((function(e){n.push(vt(0,"exclude",r,e,t.facets))}))})),Object.keys(e.disjunctiveFacetsRefinements).forEach((function(r){e.disjunctiveFacetsRefinements[r].forEach((function(e){n.push(vt(0,"disjunctive",r,e,t.disjunctiveFacets))}))})),Object.keys(e.hierarchicalFacetsRefinements).forEach((function(r){e.hierarchicalFacetsRefinements[r].forEach((function(i){var a,o,s,c;n.push((a=e,o=r,s=t.hierarchicalFacets,c=a.getHierarchicalFacetByName(o),a=a._getHierarchicalFacetSeparator(c),c=i.split(a),i=Je(s,(function(e){return e.name===o})),a=c.reduce((function(e,t){var n=e&&Je(e.data,(function(e){return e.name===t}));return void 0!==n?n:e}),i),s=a&&a.count||0,c=a&&a.exhaustive||!1,i=a&&a.path||"",{type:"hierarchical",attributeName:o,name:i,count:s,exhaustive:c}))}))})),Object.keys(e.numericRefinements).forEach((function(t){var r=e.numericRefinements[t];Object.keys(r).forEach((function(e){r[e].forEach((function(r){n.push({type:"numeric",attributeName:t,name:r,numericValue:r,operator:e})}))}))})),e.tagRefinements.forEach((function(e){n.push({type:"tag",attributeName:"_tags",name:e})})),n};var yt=mt,bt=function(e){var t,n,r,i={};return e.forEach((function(e){e.forEach((function(e,t){i[e.objectID]?i[e.objectID]={indexSum:i[e.objectID].indexSum+t,count:i[e.objectID].count+1}:i[e.objectID]={indexSum:t,count:1}}))})),t=i,n=e.length,r=[],Object.keys(t).forEach((function(e){t[e].count<2&&(t[e].indexSum+=100),r.push({objectID:e,avgOfIndices:t[e].indexSum/n})})),r.sort((function(e,t){return e.avgOfIndices>t.avgOfIndices?1:-1})).reduce((function(t,n){var r=Je(e.reduce((function(e,t){return e.concat(t)}),[]),(function(e){return e.objectID===n.objectID}));return r?t.concat(r):t}),[])},_t=(Me="3.24.1",Ae);function wt(e,t,n,r){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper (3.24.1)"),this.setClient(e),(e=n||{}).index=t,this.state=ot.make(e),this.recommendState=new Be({params:e.recommendState}),this.lastResults=null,this.lastRecommendResults=null,this._queryId=0,this._recommendQueryId=0,this._lastQueryIdReceived=-1,this._lastRecommendQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0,this._currentNbRecommendQueries=0,this._searchResultsOptions=r,this._recommendCache={}}function St(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function Rt(){return this.state.page}ke(wt,Ce),wt.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},wt.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},wt.prototype.searchWithComposition=function(){return this._runComposition({onlyWithDerivedHelpers:!0}),this},wt.prototype.recommend=function(){return this._recommend(),this},wt.prototype.getQuery=function(){var e=this.state;return Ge._getHitsSearchParams(e)},wt.prototype.searchOnce=function(e,t){var n=e?this.state.setQueryParameters(e):this.state,r=(e=Ge._getQueries(n.index,n),this);if(this._currentNbQueries++,this.emit("searchOnce",{state:n}),!t)return this.client.search(e).then((function(e){return r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),{content:new yt(n,e.results),state:n,_originalResponse:e}}),(function(e){throw r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),e}));this.client.search(e).then((function(e){r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),t(null,new yt(n,e.results),n)})).catch((function(e){r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),t(e,null,n)}))},wt.prototype.findAnswers=function(e){var t=this.state;if(!(n=this.derivedHelpers[0]))return Promise.resolve([]);var n=n.getModifiedState(t),r=(t=De({attributesForPrediction:e.attributesForPrediction,nbHits:e.nbHits},{params:Ue(Ge._getHitsSearchParams(n),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),"search for answers was called, but this client does not have a function client.initIndex(index).findAnswers");if("function"!=typeof this.client.initIndex)throw new Error(r);var i=this.client.initIndex(n.index);if("function"!=typeof i.findAnswers)throw new Error(r);return i.findAnswers(n.query,e.queryLanguages,t)},wt.prototype.searchForFacetValues=function(e,t,n,r){var i,a,o,s="function"==typeof this.client.searchForFacetValues&&"function"!=typeof this.client.searchForFacets,c="function"==typeof this.client.initIndex;if(s||c||"function"==typeof this.client.search)return i=this.state.setQueryParameters(r||{}),a=i.isDisjunctiveFacet(e),r=Ge.getSearchForFacetQuery(e,t,n,i),this._currentNbQueries++,o=this,n=s?this.client.searchForFacetValues([{indexName:i.index,params:r}]):c?this.client.initIndex(i.index).searchForFacetValues(r):(delete r.facetName,this.client.search([{type:"facet",facet:e,indexName:i.index,params:r}]).then((function(e){return e.results[0]}))),this.emit("searchForFacetValues",{state:i,facet:e,query:t}),n.then((function(t){return o._currentNbQueries--,0===o._currentNbQueries&&o.emit("searchQueueEmpty"),(t=Array.isArray(t)?t[0]:t).facetHits.forEach((function(t){t.escapedValue=_t(t.value),t.isRefined=a?i.isDisjunctiveFacetRefined(e,t.escapedValue):i.isFacetRefined(e,t.escapedValue)})),t}),(function(e){throw o._currentNbQueries--,0===o._currentNbQueries&&o.emit("searchQueueEmpty"),e}));throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues")},wt.prototype.searchForCompositionFacetValues=function(e,t,n,r){if("function"!=typeof this.client.searchForFacetValues)throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues");var i=this.state.setQueryParameters(r||{}),a=i.isDisjunctiveFacet(e),o=(this._currentNbQueries++,this);return r=this.client.searchForFacetValues({compositionID:i.index,facetName:e,searchForFacetValuesRequest:{params:{query:t,maxFacetHits:n,searchQuery:Ge._getCompositionHitsSearchParams(i)}}}),this.emit("searchForFacetValues",{state:i,facet:e,query:t}),r.then((function(t){return o._currentNbQueries--,0===o._currentNbQueries&&o.emit("searchQueueEmpty"),(t=t.results[0]).facetHits.forEach((function(t){t.escapedValue=_t(t.value),t.isRefined=a?i.isDisjunctiveFacetRefined(e,t.escapedValue):i.isFacetRefined(e,t.escapedValue)})),t}),(function(e){throw o._currentNbQueries--,0===o._currentNbQueries&&o.emit("searchQueueEmpty"),e}))},wt.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},wt.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},wt.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},wt.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},wt.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},wt.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},wt.prototype.addNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,n),isPageReset:!0}),this},wt.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},wt.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},wt.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},wt.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},wt.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},wt.prototype.addFrequentlyBoughtTogether=function(e){return this._recommendChange({state:this.recommendState.addFrequentlyBoughtTogether(e)}),this},wt.prototype.addRelatedProducts=function(e){return this._recommendChange({state:this.recommendState.addRelatedProducts(e)}),this},wt.prototype.addTrendingItems=function(e){return this._recommendChange({state:this.recommendState.addTrendingItems(e)}),this},wt.prototype.addTrendingFacets=function(e){return this._recommendChange({state:this.recommendState.addTrendingFacets(e)}),this},wt.prototype.addLookingSimilar=function(e){return this._recommendChange({state:this.recommendState.addLookingSimilar(e)}),this},wt.prototype.removeNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,n),isPageReset:!0}),this},wt.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},wt.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},wt.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},wt.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},wt.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},wt.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},wt.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},wt.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},wt.prototype.removeFrequentlyBoughtTogether=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this},wt.prototype.removeRelatedProducts=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this},wt.prototype.removeTrendingItems=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this},wt.prototype.removeTrendingFacets=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this},wt.prototype.removeLookingSimilar=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this},wt.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},wt.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},wt.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},wt.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},wt.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},wt.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},wt.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},wt.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},wt.prototype.setCurrentPage=St,wt.prototype.setPage=St,wt.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},wt.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},wt.prototype.setState=function(e){return this._change({state:ot.make(e),isPageReset:!1}),this},wt.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new ot(e),this},wt.prototype.hasRefinements=function(e){return!!qe(this.state.getNumericRefinements(e))||(this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):!!this.state.isHierarchicalFacet(e)&&this.state.isHierarchicalFacetRefined(e))},wt.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},wt.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},wt.prototype.hasTag=function(e){return this.state.isTagRefined(e)},wt.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},wt.prototype.getIndex=function(){return this.state.index},wt.prototype.getCurrentPage=Rt,wt.prototype.getPage=Rt,wt.prototype.getTags=function(){return this.state.tagRefinements},wt.prototype.getRefinements=function(e){var t=[],n=(this.state.isConjunctiveFacet(e)?(this.state.getConjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"conjunctive"})})),this.state.getExcludeRefinements(e).forEach((function(e){t.push({value:e,type:"exclude"})}))):this.state.isDisjunctiveFacet(e)&&this.state.getDisjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"disjunctive"})})),this.state.getNumericRefinements(e));return Object.keys(n).forEach((function(e){var r=n[e];t.push({value:r,operator:e,type:"numeric"})})),t},wt.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},wt.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},wt.prototype._search=function(e){var t=this.state,n=[],r=[];if(e.onlyWithDerivedHelpers||(r=Ge._getQueries(t.index,t),n.push({state:t,queriesCount:r.length,helper:this}),this.emit("search",{state:t,results:this.lastResults})),e=this.derivedHelpers.map((function(e){var r=e.getModifiedState(t),i=r.index?Ge._getQueries(r.index,r):[];return n.push({state:r,queriesCount:i.length,helper:e}),e.emit("search",{state:r,results:e.lastResults}),i})),r=Array.prototype.concat.apply(r,e),e=this._queryId++,this._currentNbQueries++,!r.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,n,e));try{this.client.search(r).then(this._dispatchAlgoliaResponse.bind(this,n,e)).catch(this._dispatchAlgoliaError.bind(this,e))}catch(e){this.emit("error",{error:e})}},wt.prototype._runComposition=function(){var e=this.state,t=[],n=this.derivedHelpers.map((function(n){var r=n.getModifiedState(e),i=Ge._getCompositionQueries(r);return t.push({state:r,queriesCount:i.length,helper:n}),n.emit("search",{state:r,results:n.lastResults}),i})),r=(n=Array.prototype.concat.apply([],n),this._queryId++);if(this._currentNbQueries++,!n.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,t,r));if(1<n.length)throw new Error("Only one query is allowed when using a composition.");n=n[0];try{this.client.search(n).then(this._dispatchAlgoliaResponse.bind(this,t,r)).catch(this._dispatchAlgoliaError.bind(this,r))}catch(n){this.emit("error",{error:n})}},wt.prototype._recommend=function(){var e,t=this.state,n=[{state:a=this.recommendState,index:e=this.getIndex(),helper:this}],r=a.params.map((function(e){return e.$$id})),i=(this.emit("fetch",{recommend:{state:a,results:this.lastRecommendResults}}),this._recommendCache),a=this.derivedHelpers.map((function(e){var a,o=e.getModifiedState(t).index;return o?(a=e.getModifiedRecommendState(new Be),n.push({state:a,index:o,helper:e}),r=Array.prototype.concat.apply(r,a.params.map((function(e){return e.$$id}))),e.emit("fetch",{recommend:{state:a,results:e.lastRecommendResults}}),a._buildQueries(o,i)):[]}));if(0!==(e=Array.prototype.concat.apply(this.recommendState._buildQueries(e,i),a)).length)if(0<e.length&&void 0===this.client.getRecommendations);else{a=this._recommendQueryId++,this._currentNbRecommendQueries++;try{this.client.getRecommendations(e).then(this._dispatchRecommendResponse.bind(this,a,n,r)).catch(this._dispatchRecommendError.bind(this,a))}catch(a){this.emit("error",{error:a})}}},wt.prototype._dispatchAlgoliaResponse=function(e,t,n){var r,i,a=this;t<this._lastQueryIdReceived||(this._currentNbQueries-=t-this._lastQueryIdReceived,this._lastQueryIdReceived=t,0===this._currentNbQueries&&this.emit("searchQueueEmpty"),r=n.results.slice(),i=Object.keys(n).reduce((function(e,t){return"results"!==t&&(e[t]=n[t]),e}),{}),Object.keys(i).length<=0&&(i=void 0),e.forEach((function(e){var t=e.state,n=e.queriesCount;e=e.helper,n=r.splice(0,n),t.index?(e.lastResults=new yt(t,n,a._searchResultsOptions),void 0!==i&&(e.lastResults._rawContent=i),e.emit("result",{results:e.lastResults,state:t})):e.emit("result",{results:null,state:t})})))},wt.prototype._dispatchRecommendResponse=function(e,t,n,r){var i,a,o;e<this._lastRecommendQueryIdReceived||(this._currentNbRecommendQueries-=e-this._lastRecommendQueryIdReceived,this._lastRecommendQueryIdReceived=e,0===this._currentNbRecommendQueries&&this.emit("recommendQueueEmpty"),i=this._recommendCache,a={},n.filter((function(e){return void 0===i[e]})).forEach((function(e,t){a[e]||(a[e]=[]),a[e].push(t)})),Object.keys(a).forEach((function(e){var t=a[e],n=r.results[t[0]];1===t.length?i[e]=n:i[e]=Object.assign({},n,{hits:bt(t.map((function(e){return r.results[e].hits})))})})),o={},n.forEach((function(e){o[e]=i[e]})),t.forEach((function(e){var t=e.state,n=e.helper;e.index?(n.lastRecommendResults=new Ve(t,o),n.emit("recommend:result",{recommend:{results:n.lastRecommendResults,state:t}})):n.emit("recommend:result",{results:null,state:t})})))},wt.prototype._dispatchAlgoliaError=function(e,t){e<this._lastQueryIdReceived||(this._currentNbQueries-=e-this._lastQueryIdReceived,this._lastQueryIdReceived=e,this.emit("error",{error:t}),0===this._currentNbQueries&&this.emit("searchQueueEmpty"))},wt.prototype._dispatchRecommendError=function(e,t){e<this._lastRecommendQueryIdReceived||(this._currentNbRecommendQueries-=e-this._lastRecommendQueryIdReceived,this._lastRecommendQueryIdReceived=e,this.emit("error",{error:t}),0===this._currentNbRecommendQueries&&this.emit("recommendQueueEmpty"))},wt.prototype.containsRefinement=function(e,t,n,r){return e||0!==t.length||0!==n.length||0!==r.length},wt.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&0<this.state.disjunctiveRefinements[e].length},wt.prototype._change=function(e){var t=e.state;e=e.isPageReset,t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:e}))},wt.prototype._recommendChange=function(e){(e=e.state)!==this.recommendState&&(this.recommendState=e,this.emit("recommend:change",{search:{results:this.lastResults,state:this.state},recommend:{results:this.lastRecommendResults,state:this.recommendState}}))},wt.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},wt.prototype.setClient=function(e){return this.client!==e&&("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper (3.24.1)"),this.client=e),this},wt.prototype.getClient=function(){return this.client},wt.prototype.derive=function(e,t){return e=new Fe(this,e,t),this.derivedHelpers.push(e),e},wt.prototype.detachDerivedHelper=function(e){if(-1===(e=this.derivedHelpers.indexOf(e)))throw new Error("Derived helper already detached");this.derivedHelpers.splice(e,1)},wt.prototype.hasPendingRequests=function(){return 0<this._currentNbQueries};var Pt=wt;function xt(e,t,n,r){return new Pt(e,t,n,r)}xt.version=Me,xt.AlgoliaSearchHelper=Pt,xt.SearchParameters=ot,xt.RecommendParameters=Be,xt.SearchResults=yt,xt.RecommendResults=Ve;var Ot=xt,Et=J({name:"configure",connector:!0});function Ct(e,t){return e.setQueryParameters(Object.keys(t.searchParameters).reduce((function(e,t){return n(n({},e),{},s({},t,void 0))}),{}))}function Nt(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:_,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return function(r){var i;if(r&&k(r.searchParameters))return i={},{$$type:"ais.configure",init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},dispose:function(e){return e=e.state,t(),Ct(e,r)},getRenderState:function(e,t){return t=this.getWidgetRenderState(t),n(n({},e),{},{configure:n(n({},t),{},{widgetParams:n(n({},t.widgetParams),{},{searchParameters:ve(new Ot.SearchParameters(null==(e=e.configure)?void 0:e.widgetParams.searchParameters),new Ot.SearchParameters(t.widgetParams.searchParameters)).getQueryParams()})})})},getWidgetRenderState:function(e){var t;return e=e.helper,i.refine||(i.refine=(t=e,function(e){var n=Ct(t.state,r);n=ve(n,new Ot.SearchParameters(e)),r.searchParameters=e,t.setState(n).search()})),{refine:i.refine,widgetParams:r}},getWidgetSearchParameters:function(e,t){return t=t.uiState,ve(e,new Ot.SearchParameters(n(n({},t.configure),r.searchParameters)))},getWidgetUiState:function(e){return n(n({},e),{},{configure:n(n({},e.configure),r.searchParameters)})}};throw new Error(Et("The `searchParameters` option expects an object."))}}var jt=J({name:"configure-related-items",connector:!0});function Tt(e){var t=e.attributeName,n=e.attributeValue;return e=e.attributeScore,"".concat(t,":").concat(n,"<score=").concat(e||1,">")}function kt(e,t){return function(r){var i,a=(r=r||{}).hit,o=r.matchingPatterns;if(r=void 0===(r=r.transformSearchParameters)?function(e){return e}:r,!a)throw new Error(jt("The `hit` option is required."));if(o)return i=Object.keys(o).reduce((function(e,t){var n=o[t],r=ie(a,t),i=n.score;return Array.isArray(r)?[].concat(v(e),[r.map((function(e){return Tt({attributeName:t,attributeValue:e,attributeScore:i})}))]):"string"==typeof r?[].concat(v(e),[Tt({attributeName:t,attributeValue:r,attributeScore:i})]):e}),[]),r=n({},r(new Ot.SearchParameters({sumOrFiltersScores:!0,facetFilters:["objectID:-".concat(a.objectID)],optionalFilters:i}))),n(n({},Nt(e,t)({searchParameters:r})),{},{$$type:"ais.configureRelatedItems"});throw new Error(jt("The `matchingPatterns` option is required."))}}function It(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,At()),function(r){var a,o,s=r.widgets,c=void 0===(o=r.maxValuesPerFacet)?20:o,u=void 0===(o=r.facets)?["*"]:o,l=void 0===(o=r.transformItems)?function(e){return e}:o,f=r.fallbackWidget;if(!(s&&Array.isArray(s)&&s.every((function(e){return"object"===i(e)}))))throw new Error(At("The `widgets` option expects an array of widgets."));if(Array.isArray(u))return a=new Map,{$$type:"ais.dynamicWidgets",init:function(t){s.forEach((function(e){var n=se(e,t);a.set(n,{widget:e,isMounted:!1})})),e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!0)},render:function(t){var r=t.parent,i=this.getWidgetRenderState(t),o=[],s=[];f&&i.attributesToRender.forEach((function(e){var t;a.has(e)||(t=f({attribute:e}),a.set(e,{widget:t,isMounted:!1}))})),a.forEach((function(e,t){var n=e.widget,r=(e=e.isMounted,-1<i.attributesToRender.indexOf(t));!e&&r?(s.push(n),a.set(t,{widget:n,isMounted:!0})):e&&!r&&(o.push(n),a.set(t,{widget:n,isMounted:!1}))})),r.addWidgets(s),setTimeout((function(){return r.removeWidgets(o)}),0),e(n(n({},i),{},{instantSearchInstance:t.instantSearchInstance}),!1)},dispose:function(e){e=e.parent;var n=[];a.forEach((function(e){var t=e.widget;e.isMounted&&n.push(t)})),e.removeWidgets(n),t()},getWidgetSearchParameters:function(e){return u.reduce((function(e,t){return e.addFacet(t)}),e.setQueryParameters({maxValuesPerFacet:Math.max(c||0,e.maxValuesPerFacet||0)}))},getRenderState:function(e,t){return n(n({},e),{},{dynamicWidgets:this.getWidgetRenderState(t)})},getWidgetRenderState:function(e){var t=e.results;if(e.state,!t)return{attributesToRender:[],widgetParams:r};if(e=l(null!=(e=null==(e=t.renderingContent)||null==(e=e.facetOrdering)||null==(e=e.facets)?void 0:e.order)?e:[],{results:t}),Array.isArray(e))return{attributesToRender:e,widgetParams:r};throw new Error(At("The `transformItems` option expects a function that returns an Array."))}};throw new Error(At("The `facets` option only accepts an array of facets, you passed ".concat(JSON.stringify(u))))}}function Ft(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,Mt()),function(r){var i,a=r||{},o=void 0===(i=a.includedAttributes)?[]:i,s=void 0===(i=a.excludedAttributes)?["query"]:i,c=void 0===(i=a.transformItems)?function(e){return e}:i;if(r&&r.includedAttributes&&r.excludedAttributes)throw new Error(Mt("The options `includedAttributes` and `excludedAttributes` cannot be used together."));function u(){return f.refine()}function l(){return f.createURL()}var f={refine:_,createURL:function(){return""},attributesToClear:[]};return{$$type:"ais.clearRefinements",init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},dispose:function(){t()},getRenderState:function(e,t){return n(n({},e),{},{clearRefinements:this.getWidgetRenderState(t)})},getWidgetRenderState:function(e){var t=e.createURL,n=e.scopedResults,i=e.results;return f.attributesToClear=n.reduce((function(e,t){return e.concat((t=(e={scopedResult:t,includedAttributes:o,excludedAttributes:s,transformItems:c,results:i}).scopedResult,n=e.includedAttributes,r=e.excludedAttributes,a=e.transformItems,e=e.results,u=-1!==n.indexOf("query")||-1===r.indexOf("query"),{helper:t.helper,items:a(me(oe(t.results,t.helper.state,u).map((function(e){return e.attribute})).filter((function(e){return 0===n.length||-1!==n.indexOf(e)})).filter((function(e){return"query"===e&&u||-1===r.indexOf(e)}))),{results:e})}));var n,r,a,u}),[]),f.refine=function(){f.attributesToClear.forEach((function(e){var t=e.helper;e=e.items,t.setState(P({helper:t,attributesToClear:e})).search()}))},f.createURL=function(){return t(ve.apply(void 0,v(f.attributesToClear.map((function(e){return P({helper:e.helper,attributesToClear:e.items})})))))},{canRefine:e=f.attributesToClear.some((function(e){return 0<e.items.length})),hasRefinements:e,refine:u,createURL:l,widgetParams:r}}}}}var At=J({name:"dynamic-widgets",connector:!0}),Mt=J({name:"clear-refinements",connector:!0});function Lt(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,Ht()),function(r){if((r||{}).includedAttributes&&(r||{}).excludedAttributes)throw new Error(Ht("The options `includedAttributes` and `excludedAttributes` cannot be used together."));var i,a=r||{},o=a.includedAttributes,s=void 0===(i=a.excludedAttributes)?["query"]:i,c=void 0===(i=a.transformItems)?function(e){return e}:i;return{$$type:"ais.currentRefinements",init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},dispose:function(){t()},getRenderState:function(e,t){return n(n({},e),{},{currentRefinements:this.getWidgetRenderState(t)})},getWidgetRenderState:function(e){var t=e.results,n=e.scopedResults,i=e.createURL,a=e.helper;return{items:e=t?n.reduce((function(e,n){return e.concat(c(Dt({results:n.results,helper:n.helper,indexId:n.indexId,includedAttributes:o,excludedAttributes:s}),{results:t}))}),[]):c(Dt({results:null,helper:a,indexId:a.state.index,includedAttributes:o,excludedAttributes:s}),{results:t}),canRefine:0<e.length,refine:function(e){return Ut(a,e)},createURL:function(e){return i(qt(a.state,e))},widgetParams:r}}}}}var Ht=J({name:"current-refinements",connector:!0});function Dt(e){var t=e.results,n=e.helper,r=e.indexId,i=e.includedAttributes,a=e.excludedAttributes,o=(e=-1!==(i||[]).indexOf("query")||-1===(a||[]).indexOf("query"),i?function(e){return-1!==i.indexOf(e.attribute)}:function(e){return-1===a.indexOf(e.attribute)}),s=oe(t,n.state,e).map(Wt).filter(o);return s.reduce((function(e,t){return[].concat(v(e.filter((function(e){return e.attribute!==t.attribute}))),[{indexName:n.state.index,indexId:r,attribute:t.attribute,label:t.attribute,refinements:s.filter((function(e){return e.attribute===t.attribute})).sort((function(e,t){return"numeric"===e.type?e.value-t.value:0})),refine:function(e){return Ut(n,e)}}])}),[])}function qt(e,t){switch(e=e.resetPage(),t.type){case"facet":return e.removeFacetRefinement(t.attribute,String(t.value));case"disjunctive":return e.removeDisjunctiveFacetRefinement(t.attribute,String(t.value));case"hierarchical":return e.removeHierarchicalFacetRefinement(t.attribute);case"exclude":return e.removeExcludeRefinement(t.attribute,String(t.value));case"numeric":return e.removeNumericRefinement(t.attribute,t.operator,String(t.value));case"tag":return e.removeTagRefinement(String(t.value));case"query":return e.setQueryParameter("query","");default:return e}}function Ut(e,t){e.setState(qt(e.state,t)).search()}function Wt(e){var t=function(e){return"numeric"===e.type?Number(e.name):"escapedValue"in e?e.escapedValue:e.name}(e),n=e.operator?"".concat(function(e){switch(e){case">=":return"≥";case"<=":return"≤";default:return e}}(e.operator)," ").concat(e.name):e.name;return t={attribute:e.attribute,type:e.type,value:t,label:n},void 0!==e.operator&&(t.operator=e.operator),void 0!==e.count&&(t.count=e.count),void 0!==e.exhaustive&&(t.exhaustive=e.exhaustive),t}function Bt(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,Vt()),function(r){var i,a=r||{},o=a.attributes,c=void 0===(i=a.separator)?" > ":i,u=void 0===(i=a.rootPath)?null:i,l=void 0===(i=a.showParentLevel)||i,f=void 0===(i=a.limit)?10:i,d=void 0!==(i=a.showMore)&&i,p=void 0===(i=a.showMoreLimit)?20:i,m=void 0===(i=a.sortBy)?Qt:i,v=void 0===(i=a.transformItems)?function(e){return e}:i;if(!o||!Array.isArray(o)||0===o.length)throw new Error(Vt("The `attributes` option expects an array of strings."));if(!0===d&&p<=f)throw new Error(Vt("The `showMoreLimit` option must be greater than `limit`."));var y,b,_=g(o,1)[0],w=function(){};function S(){w()}var R=!1;function P(){return R?p:f}return{$$type:"ais.hierarchicalMenu",init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r,i,a=t.instantSearchInstance;r=t,w=function(){R=!R,i.render(r)},e(n(n({},(i=this).getWidgetRenderState(t)),{},{instantSearchInstance:a}),!1)},dispose:function(e){return e=e.state,t(),e.removeHierarchicalFacet(_).setQueryParameter("maxValuesPerFacet",void 0)},getRenderState:function(e,t){return n(n({},e),{},{hierarchicalMenu:n(n({},e.hierarchicalMenu),{},s({},_,this.getWidgetRenderState(t)))})},getWidgetRenderState:function(e){var t,i=this,a=e.results,s=e.state,u=e.createURL,l=e.instantSearchInstance,f=e.helper,p=(e=[],!1);return y=y||D({instantSearchInstance:l,helper:f,attribute:function(e){return e=e.split(c).length-1,o[e]},widgetType:this.$$type}),b=b||function(e){y("click:internal",e),f.toggleFacetRefinement(_,e).search()},a&&(l=(l=a.getFacetValues(_,{sortBy:m,facetOrdering:m===Qt}))&&!Array.isArray(l)&&l.data?l.data:[],t=(s.maxValuesPerFacet||0)>P()?l.length<=P():l.length<P(),p=d&&(R||!t),e=v(function e(t){return t.slice(0,P()).map((function(t){var r=t.name,i=t.escapedValue,a=t.data;return t.path,t=n(n({},h(t,$t)),{},{value:i,label:r,data:null}),Array.isArray(a)&&(t.data=e(a)),t}))}(l),{results:a})),{items:e,refine:b,canRefine:0<e.length,createURL:function(e){return u((function(t){return i.getWidgetUiState(t,{searchParameters:s.resetPage().toggleFacetRefinement(_,e),helper:f})}))},sendEvent:y,widgetParams:r,isShowingMore:R,toggleShowMore:S,canToggleShowMore:p}},getWidgetUiState:function(e,t){return t=t.searchParameters.getHierarchicalFacetBreadcrumb(_),e=n(n({},e),{},{hierarchicalMenu:n(n({},e.hierarchicalMenu),{},s({},_,t))}),t=_,e.hierarchicalMenu&&(e.hierarchicalMenu[t]&&0!==e.hierarchicalMenu[t].length||delete e.hierarchicalMenu[t],0===Object.keys(e.hierarchicalMenu).length)&&delete e.hierarchicalMenu,e},getWidgetSearchParameters:function(e,t){if(t=(t=t.uiState).hierarchicalMenu&&t.hierarchicalMenu[_],e.isConjunctiveFacet(_)||e.isDisjunctiveFacet(_))return e;e.isHierarchicalFacet(_)&&e.getHierarchicalFacetByName(_);var r=(e=e.removeHierarchicalFacet(_).addHierarchicalFacet({name:_,attributes:o,separator:c,rootPath:u,showParentLevel:l})).maxValuesPerFacet||0;return r=Math.max(r,d?p:f),e=e.setQueryParameter("maxValuesPerFacet",r),t?e.addHierarchicalFacetRefinement(_,t.join(c)):e.setQueryParameters({hierarchicalFacetsRefinements:n(n({},e.hierarchicalFacetsRefinements),{},s({},_,[]))})}}}}var $t=["name","escapedValue","data","path"],Vt=J({name:"hierarchical-menu",connector:!0}),Qt=["name:asc"];function Kt(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,zt()),function(r){var i,a,o,c=r||{},u=void 0===(o=c.escapeHTML)||o,l=void 0===(o=c.transformItems)?function(e){return e}:o;return{$$type:"ais.hits",init:function(t){e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!0)},render:function(t){var r=this.getWidgetRenderState(t);e(n(n({},r),{},{instantSearchInstance:t.instantSearchInstance}),!1),r.sendEvent("view:internal",r.items)},getRenderState:function(e,t){return n(n({},e),{},{hits:this.getWidgetRenderState(t)})},getWidgetRenderState:function(e){var t=e.results,n=e.helper;return e=e.instantSearchInstance,i=i||B({instantSearchInstance:e,getIndex:function(){return n.getIndex()},widgetType:this.$$type}),a=a||$({getIndex:function(){return n.getIndex()},widgetType:this.$$type,instantSearchInstance:e}),t?(u&&0<t.hits.length&&(t.hits=L(t.hits)),e=ue(ce(t.hits,t.page,t.hitsPerPage),t.queryID),{hits:e=l(e,{results:t}),items:e,results:t,banner:null==(e=t.renderingContent)||null==(t=e.widgets)||null==(e=t.banners)?void 0:e[0],sendEvent:i,bindEvent:a,widgetParams:r}):{hits:[],items:[],results:void 0,banner:void 0,sendEvent:i,bindEvent:a,widgetParams:r}},dispose:function(e){return e=e.state,t(),u?e.setQueryParameters(Object.keys(I).reduce((function(e,t){return n(n({},e),{},s({},t,void 0))}),{})):e},getWidgetSearchParameters:function(e,t){return u?e.setQueryParameters(I):e}}}}var zt=J({name:"hits",connector:!0});function Gt(e){return function(t,r){return e((function(e,r){var i,a,o,s=e.results,c=e.hits,u=e.instantSearchInstance;return s&&c&&u?(i=u.insightsClient,a=s,o=c,u=function(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];var c=r[0];if(!i)throw u=J({name:"instantsearch"}),new Error(u("The `insightsClient` option has not been provided to `instantsearch`."));if(!Array.isArray(c.objectIDs))throw new TypeError("Expected `objectIDs` to be an array.");var u=function(e){var t,n=e.method,r=e.results,i=e.hits,a=e.objectIDs,o=r.index,s=(t=i,a.map((function(e){var n=X(t,(function(t){return t.objectID===e}));if(void 0===n)throw new Error('Could not find objectID "'.concat(e,'" passed to `clickedObjectIDsAfterSearch` in the returned hits. This is necessary to infer the absolute position and the query ID.'));return n}))),c=function(e){if(1<(e=me(e.map((function(e){return e.__queryID})))).length)throw new Error("Insights currently allows a single `queryID`. The `objectIDs` provided map to multiple `queryID`s.");if("string"!=typeof(e=e[0]))throw new Error("Could not infer `queryID`. Ensure InstantSearch `clickAnalytics: true` was added with the Configure widget.\n\nSee: https://alg.li/lNiZZ7");return e}(s);switch(n){case"clickedObjectIDsAfterSearch":return{index:o,queryID:c,objectIDs:a,positions:s.map((function(e){return e.__position}))};case"convertedObjectIDsAfterSearch":return{index:o,queryID:c,objectIDs:a};default:throw new Error('Unsupported method passed to insights: "'.concat(n,'".'))}}({method:e,results:a,hits:o,objectIDs:c.objectIDs});i(e,n(n({},u),c))},t(n(n({},e),{},{insights:u}),r)):t(e,r)}),r)}}var Jt,Yt,Xt,Zt,en,tn={},nn=[],rn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function an(e,t){for(var n in t)e[n]=t[n];return e}function on(e){var t=e.parentNode;t&&t.removeChild(e)}function sn(e,t,n){var r,i,a,o={};for(a in t)"key"==a?r=t[a]:"ref"==a?i=t[a]:o[a]=t[a];if(2<arguments.length&&(o.children=3<arguments.length?Jt.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return cn(e,o,r,i,null)}function cn(e,t,n,r,i){return e={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Xt:i},null==i&&null!=Yt.vnode&&Yt.vnode(e),e}function un(e){return e.children}function ln(e,t){this.props=e,this.context=t}function fn(e,t){if(null==t)return e.__?fn(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?fn(e):null}function dn(e){(e.__d||(e.__d=!0,!Zt.push(e))||hn.__r++)&&en===Yt.debounceRendering||((en=Yt.debounceRendering)||setTimeout)(hn)}function hn(){for(var e;hn.__r=Zt.length;)e=Zt.sort((function(e,t){return e.__v.__b-t.__v.__b})),Zt=[],e.some((function(e){var t,n,r,i,a;e.__d&&(i=(r=e.__v).__e,a=e.__P)&&(t=[],(n=an({},r)).__v=r.__v+1,_n(a,r,n,e.__n,void 0!==a.ownerSVGElement,null!=r.__h?[i]:null,t,null==i?fn(r):i,r.__h),wn(t,r),r.__e!=i)&&function e(t){var n,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,n=0;n<t.__k.length;n++)if(null!=(r=t.__k[n])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return e(t)}}(r)}))}function pn(e,t,n,r,i,a,o,s,c,u){var l,f,d,h,p,m,g,v=r&&r.__k||nn,y=v.length;for(n.__k=[],l=0;l<t.length;l++)if(null!=(h=n.__k[l]=null==(h=t[l])||"boolean"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?cn(null,h,null,null,h):Array.isArray(h)?cn(un,{children:h},null,null,null):0<h.__b?cn(h.type,h.props,h.key,h.ref||null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(d=v[l])||d&&h.key==d.key&&h.type===d.type)v[l]=void 0;else for(f=0;f<y;f++){if((d=v[f])&&h.key==d.key&&h.type===d.type){v[f]=void 0;break}d=null}_n(e,h,d=d||tn,i,a,o,s,c,u),p=h.__e,(f=h.ref)&&d.ref!=f&&(g=g||[],d.ref&&g.push(d.ref,null,h),g.push(f,h.__c||p,h)),null!=p?(null==m&&(m=p),"function"==typeof h.type&&h.__k===d.__k?h.__d=c=function e(t,n,r){for(var i,a=t.__k,o=0;a&&o<a.length;o++)(i=a[o])&&(i.__=t,n="function"==typeof i.type?e(i,n,r):mn(r,i,i,a,i.__e,n));return n}(h,c,e):c=mn(e,h,d,v,p,c),"function"==typeof n.type&&(n.__d=c)):c&&d.__e==c&&c.parentNode!=e&&(c=fn(d))}for(n.__e=m,l=y;l--;)null!=v[l]&&("function"==typeof n.type&&null!=v[l].__e&&v[l].__e==n.__d&&(n.__d=fn(r,l+1)),function e(t,n,r){var i,a;if(Yt.unmount&&Yt.unmount(t),!(i=t.ref)||i.current&&i.current!==t.__e||Sn(i,null,n),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){Yt.__e(t,n)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(a=0;a<i.length;a++)i[a]&&e(i[a],n,"function"!=typeof t.type);r||null==t.__e||on(t.__e),t.__=t.__e=t.__d=void 0}(v[l],v[l]));if(g)for(l=0;l<g.length;l++)Sn(g[l],g[++l],g[++l])}function mn(e,t,n,r,i,a){var o,s,c;if(void 0!==t.__d)o=t.__d,t.__d=void 0;else if(null==n||i!=a||null==i.parentNode)e:if(null==a||a.parentNode!==e)e.appendChild(i),o=null;else{for(s=a,c=0;(s=s.nextSibling)&&c<r.length;c+=2)if(s==i)break e;e.insertBefore(i,a),o=a}return void 0!==o?o:i.nextSibling}function gn(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||rn.test(t)?n:n+"px"}function vn(e,t,n,r,i){var a;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||gn(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||gn(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])a=t!==(t=t.replace(/Capture$/,"")),t=(t.toLowerCase()in e?t.toLowerCase():t).slice(2),e.l||(e.l={}),(e.l[t+a]=n)?r||e.addEventListener(t,a?bn:yn,a):e.removeEventListener(t,a?bn:yn,a);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"!=typeof n&&(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function yn(e){this.l[e.type+!1](Yt.event?Yt.event(e):e)}function bn(e){this.l[e.type+!0](Yt.event?Yt.event(e):e)}function _n(e,t,n,r,i,a,o,s,c){var u,l,f,d,h,p,m,g,v,y,b,_,w,S=t.type;if(void 0===t.constructor){null!=n.__h&&(c=n.__h,s=t.__e=n.__e,t.__h=null,a=[s]),(u=Yt.__b)&&u(t);try{e:if("function"==typeof S){if(g=t.props,v=(u=S.contextType)&&r[u.__c],y=u?v?v.props.value:u.__:r,n.__c?m=(l=t.__c=n.__c).__=l.__E:("prototype"in S&&S.prototype.render?t.__c=l=new S(g,y):(t.__c=l=new ln(g,y),l.constructor=S,l.render=Rn),v&&v.sub(l),l.props=g,l.state||(l.state={}),l.context=y,l.__n=r,f=l.__d=!0,l.__h=[]),null==l.__s&&(l.__s=l.state),null!=S.getDerivedStateFromProps&&(l.__s==l.state&&(l.__s=an({},l.__s)),an(l.__s,S.getDerivedStateFromProps(g,l.__s))),d=l.props,h=l.state,f)null==S.getDerivedStateFromProps&&null!=l.componentWillMount&&l.componentWillMount(),null!=l.componentDidMount&&l.__h.push(l.componentDidMount);else{if(null==S.getDerivedStateFromProps&&g!==d&&null!=l.componentWillReceiveProps&&l.componentWillReceiveProps(g,y),!l.__e&&null!=l.shouldComponentUpdate&&!1===l.shouldComponentUpdate(g,l.__s,y)||t.__v===n.__v){l.props=g,l.state=l.__s,t.__v!==n.__v&&(l.__d=!1),(l.__v=t).__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),l.__h.length&&o.push(l);break e}null!=l.componentWillUpdate&&l.componentWillUpdate(g,l.__s,y),null!=l.componentDidUpdate&&l.__h.push((function(){l.componentDidUpdate(d,h,p)}))}if(l.context=y,l.props=g,l.__v=t,l.__P=e,b=Yt.__r,_=0,"prototype"in S&&S.prototype.render)l.state=l.__s,l.__d=!1,b&&b(t),u=l.render(l.props,l.state,l.context);else for(;l.__d=!1,b&&b(t),u=l.render(l.props,l.state,l.context),l.state=l.__s,l.__d&&++_<25;);l.state=l.__s,null!=l.getChildContext&&(r=an(an({},r),l.getChildContext())),f||null==l.getSnapshotBeforeUpdate||(p=l.getSnapshotBeforeUpdate(d,h)),w=null!=u&&u.type===un&&null==u.key?u.props.children:u,pn(e,Array.isArray(w)?w:[w],t,n,r,i,a,o,s,c),l.base=t.__e,t.__h=null,l.__h.length&&o.push(l),m&&(l.__E=l.__=null),l.__e=!1}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,a,o,s){var c,u,l,f=n.props,d=t.props,h=t.type,p=0;if("svg"===h&&(i=!0),null!=a)for(;p<a.length;p++)if((c=a[p])&&"setAttribute"in c==!!h&&(h?c.localName===h:3===c.nodeType)){e=c,a[p]=null;break}if(null==e){if(null===h)return document.createTextNode(d);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,d.is&&d),a=null,s=!1}if(null===h)f===d||s&&e.data===d||(e.data=d);else{if(a=a&&Jt.call(e.childNodes),u=(f=n.props||tn).dangerouslySetInnerHTML,l=d.dangerouslySetInnerHTML,!s){if(null!=a)for(f={},p=0;p<e.attributes.length;p++)f[e.attributes[p].name]=e.attributes[p].value;!l&&!u||l&&(u&&l.__html==u.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||"")}if(function(e,t,n,r,i){for(var a in n)"children"===a||"key"===a||a in t||vn(e,a,null,n[a],r);for(a in t)i&&"function"!=typeof t[a]||"children"===a||"key"===a||"value"===a||"checked"===a||n[a]===t[a]||vn(e,a,t[a],n[a],r)}(e,d,f,i,s),l)t.__k=[];else if(p=t.props.children,pn(e,Array.isArray(p)?p:[p],t,n,r,i&&"foreignObject"!==h,a,o,a?a[0]:n.__k&&fn(n,0),s),null!=a)for(p=a.length;p--;)null!=a[p]&&on(a[p]);s||("value"in d&&void 0!==(p=d.value)&&(p!==e.value||"progress"===h&&!p||"option"===h&&p!==f.value)&&vn(e,"value",p,f.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==e.checked&&vn(e,"checked",p,f.checked,!1))}return e}(n.__e,t,n,r,i,a,o,c);(u=Yt.diffed)&&u(t)}catch(e){t.__v=null,!c&&null==a||(t.__e=s,t.__h=!!c,a[a.indexOf(s)]=null),Yt.__e(e,t,n)}}}function wn(e,t){Yt.__c&&Yt.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Yt.__e(e,t.__v)}}))}function Sn(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Yt.__e(e,n)}}function Rn(e,t,n){return this.constructor(e,n)}function Pn(e,t,n){var r,i;Yt.__&&Yt.__(e,t),r=!1?null:t.__k,i=[],_n(t,e=t.__k=sn(un,null,[e]),r||tn,tn,void 0!==t.ownerSVGElement,!r&&t.firstChild?Jt.call(t.childNodes):null,i,r?r.__e:t.firstChild,false),wn(i,e)}function xn(e,t){var n;if(t=(e={method:e,payload:t}).method,"object"!==i(e=e.payload))throw new Error("The insights helper expects the payload to be an object.");try{n=q(e)}catch(e){throw new Error("Could not JSON serialize the payload object.")}return'data-insights-method="'.concat(t,'" data-insights-payload="').concat(n,'"')}Jt=nn.slice,Yt={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&null!=a.getDerivedStateFromError&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},Xt=0,ln.prototype.setState=function(e,t){var n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=an({},this.state);(e="function"==typeof e?e(an({},n),this.props):e)&&an(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),dn(this))},ln.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),dn(this))},ln.prototype.render=un,Zt=[],hn.__r=0;var On=function(e){var t=e.insights,n=e.sendEvent;return function(e){var r=En(e.target,e.currentTarget,(function(e){return e.hasAttribute("data-insights-event")}));r&&function(e){if("string"!=typeof(e=e.getAttribute("data-insights-event")))throw new Error("The insights middleware expects `data-insights-event` to be a base64-encoded JSON string.");try{return U(e)}catch(e){throw new Error("The insights middleware was unable to parse `data-insights-event`.")}}(r).forEach((function(e){return n(e)})),r=En(e.target,e.currentTarget,(function(e){return e.hasAttribute("data-insights-method")&&e.hasAttribute("data-insights-payload")})),r&&(r=(e=function(e){var t=e.getAttribute("data-insights-method");if("string"!=typeof(e=e.getAttribute("data-insights-payload")))throw new Error("The insights helper expects `data-insights-payload` to be a base64-encoded JSON string.");try{return{method:t,payload:U(e)}}catch(e){throw new Error("The insights helper was unable to parse `data-insights-payload`.")}}(r)).method,e=e.payload,t(r,e))}};function En(e,t,n){for(var r=e;r&&!n(r);){if(r===t)return null;r=r.parentElement}return r}function Cn(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,Nn()),function(r){var i=(o=r||{}).items,a=void 0===(o=o.transformItems)?function(e){return e}:o;if(!Array.isArray(i))throw new Error(Nn("The `items` option expects an array of objects."));var o,s=i;if(0===(o=s.filter((function(e){return!0===e.default}))).length)throw new Error(Nn("A default value must be specified in `items`."));if(1<o.length)throw new Error(Nn("More than one default value is specified in `items`."));var c=o[0],u=function(e){return function(t){return(t||0===t?e.setQueryParameter("hitsPerPage",t):e.setQueryParameter("hitsPerPage",void 0)).search()}},l=function(e){var t=e.state,n=e.createURL,r=e.getWidgetUiState,i=e.helper;return function(e){return n((function(n){return r(n,{searchParameters:t.resetPage().setQueryParameter("hitsPerPage",e||0===e?e:void 0),helper:i})}))}};return{$$type:"ais.hitsPerPage",init:function(t){var r=t.state,i=t.instantSearchInstance;s.some((function(e){return Number(r.hitsPerPage)===Number(e.value)}))||(s=[{value:"",label:""}].concat(v(s))),e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:i}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},dispose:function(e){return e=e.state,t(),e.setQueryParameter("hitsPerPage",void 0)},getRenderState:function(e,t){return n(n({},e),{},{hitsPerPage:this.getWidgetRenderState(t)})},getWidgetRenderState:function(e){var t,i=e.state,o=e.results,c=e.createURL,f=(e=e.helper,!!o&&0<o.nbHits);return{items:a((t=i.hitsPerPage,s.map((function(e){return n(n({},e),{},{isRefined:Number(e.value)===Number(t)})}))),{results:o}),refine:u(e),createURL:l({state:i,createURL:c,getWidgetUiState:this.getWidgetUiState,helper:e}),hasNoResults:!f,canRefine:f,widgetParams:r}},getWidgetUiState:function(e,t){return void 0===(t=t.searchParameters.hitsPerPage)||t===c.value?e:n(n({},e),{},{hitsPerPage:t})},getWidgetSearchParameters:function(e,t){return t=t.uiState,e.setQueryParameters({hitsPerPage:t.hitsPerPage||c.value})}}}}Ae=Gt(Kt);var Nn=J({name:"hits-per-page",connector:!0}),jn=["page"],Tn=["clickAnalytics","userToken"],kn=J({name:"infinite-hits",connector:!0});function In(e){return(e=e||{}).page,h(e,jn)}function Fn(e){return(e=e||{}).clickAnalytics,e.userToken,h(e,Tn)}function An(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,kn()),function(r){var i,a,o,c,u,l,f,d=r||{},h=void 0===(f=d.escapeHTML)||f,p=void 0===(f=d.transformItems)?function(e){return e}:f,m=void 0===(f=d.cache)?(a=i=null,{read:function(e){return e=e.state,de(a,In(e))?i:null},write:function(e){var t=e.state;e=e.hits,a=In(t),i=e}}):f,g=function(e,t){return e=void 0===(e=e.page)?0:e,0===(t=Object.keys(t).map(Number)).length?e:Math.min.apply(Math,[e].concat(v(t)))},y=function(e,t){return e=void 0===(e=e.page)?0:e,0===(t=Object.keys(t).map(Number)).length?e:Math.max.apply(Math,[e].concat(v(t)))};return{$$type:"ais.infiniteHits",init:function(t){e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!0)},render:function(t){var r=t.instantSearchInstance;t=this.getWidgetRenderState(t),e(n(n({},t),{},{instantSearchInstance:r}),!1),u("view:internal",t.currentPageHits)},getRenderState:function(e,t){return n(n({},e),{},{infiniteHits:this.getWidgetRenderState(t)})},getWidgetRenderState:function(e){var t,i,a,s,f=e.results,d=e.helper,v=e.parent,b=e.state,_=(e=e.instantSearchInstance,[]),w=(v=v.getPreviousState()||b,b=m.read({state:Fn(v)})||{},null==f||null==(w=f.renderingContent)||null==(w=w.widgets)||null==(w=w.banners)?void 0:w[0]),S=f?(R=void 0===(R=v.page)?0:R,h&&0<f.hits.length&&(f.hits=L(f.hits)),P=ue(ce(f.hits,f.page,f.hitsPerPage),f.queryID),P=p(P,{results:f}),t=!1,function e(t,n){n(t),t.getWidgets().forEach((function(t){V(t)&&e(t,n)}))}(e.mainIndex,(function(e){!t&&e.getWidgets().some((function(e){return"ais.dynamicWidgets"===e.$$type}))&&(t=!0)})),S=!(null!=(S=v.disjunctiveFacets)&&S.length||(v.facets||[]).filter((function(e){return"*"!==e})).length||null!=(S=v.hierarchicalFacets)&&S.length),void 0!==b[R]||f.__isArtificial||"idle"!==e.status||t&&S||(b[R]=P,m.write({state:Fn(v),hits:b})),_=P,0===g(v,b)):(o=function(){a.overrideStateWithoutTriggeringChangeEvent(n(n({},a.state),{},{page:g(a.state,m.read({state:Fn(a.state)})||{})-1})).searchWithoutTriggeringOnStateChange()},i=a=d,c=function(){i.setPage(y(i.state,m.read({state:Fn(i.state)})||{})+1).search()},u=B({instantSearchInstance:e,getIndex:function(){return d.getIndex()},widgetType:this.$$type}),l=$({getIndex:function(){return d.getIndex()},widgetType:this.$$type,instantSearchInstance:e}),void 0===v.page||0===g(v,b)),R=(s=b,Object.keys(s).map(Number).sort((function(e,t){return e-t})).reduce((function(e,t){return e.concat(s[t])}),[])),P=!f||f.nbPages<=y(v,b)+1;return{hits:R,items:R,currentPageHits:_,sendEvent:u,bindEvent:l,banner:w,results:f||void 0,showPrevious:o,showMore:c,isFirstPage:S,isLastPage:P,widgetParams:r}},dispose:function(e){return e=e.state,t(),e=e.setQueryParameter("page",void 0),h?e.setQueryParameters(Object.keys(I).reduce((function(e,t){return n(n({},e),{},s({},t,void 0))}),{})):e},getWidgetUiState:function(e,t){return(t=t.searchParameters.page||0)?n(n({},e),{},{page:t+1}):e},getWidgetSearchParameters:function(e,t){t=t.uiState;var n=e;return h&&(n=e.setQueryParameters(I)),e=t.page?t.page-1:0,n.setQueryParameter("page",e)}}}}function Mn(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,Hn()),function(r){var i,a,o,c,u=r||{},l=u.attribute,f=void 0===(c=u.limit)?10:c,d=void 0!==(c=u.showMore)&&c,p=void 0===(c=u.showMoreLimit)?20:c,m=void 0===(c=u.sortBy)?Dn:c,v=void 0===(c=u.transformItems)?function(e){return e}:c;if(!l)throw new Error(Hn("The `attribute` option is required."));if(!0===d&&p<=f)throw new Error(Hn("The `showMoreLimit` option must be greater than `limit`."));var y=!1,b=function(){};function _(){b()}function w(){return y?p:f}return{$$type:"ais.menu",init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},dispose:function(e){return e=e.state,t(),e.removeHierarchicalFacet(l).setQueryParameter("maxValuesPerFacet",void 0)},getRenderState:function(e,t){return n(n({},e),{},{menu:n(n({},e.menu),{},s({},l,this.getWidgetRenderState(t)))})},getWidgetRenderState:function(e){var t,s,c=this,u=e.results,f=e.createURL,p=e.instantSearchInstance,S=e.helper,R=[],P=!1;return i=i||D({instantSearchInstance:p,helper:S,attribute:l,widgetType:this.$$type}),a=a||function(e){return f((function(t){return c.getWidgetUiState(t,{searchParameters:S.state.resetPage().toggleFacetRefinement(l,e),helper:S})}))},o=o||function(e){var t=g(S.getHierarchicalFacetBreadcrumb(l),1)[0];i("click:internal",e||t),S.toggleFacetRefinement(l,e||t).search()},e.results&&(t=e,s=this,b=function(){y=!y,s.render(t)}),u&&(e=(p=u.getFacetValues(l,{sortBy:m,facetOrdering:m===Dn}))&&!Array.isArray(p)&&p.data?p.data:[],P=d&&(y||e.length>w()),R=v(e.slice(0,w()).map((function(e){var t=e.name,r=e.escapedValue;return e.path,n(n({},h(e,Ln)),{},{label:t,value:r})})),{results:u})),{items:R,createURL:a,refine:o,sendEvent:i,canRefine:0<R.length,widgetParams:r,isShowingMore:y,toggleShowMore:_,canToggleShowMore:P}},getWidgetUiState:function(e,t){return t=g(t.searchParameters.getHierarchicalFacetBreadcrumb(l),1)[0],e=n(n({},e),{},{menu:n(n({},e.menu),{},s({},l,t))}),t=l,e.menu&&(void 0===e.menu[t]&&delete e.menu[t],0===Object.keys(e.menu).length)&&delete e.menu,e},getWidgetSearchParameters:function(e,t){var r;return t=(t=t.uiState).menu&&t.menu[l],e.isConjunctiveFacet(l)||e.isDisjunctiveFacet(l)?e:(r=(e=e.removeHierarchicalFacet(l).addHierarchicalFacet({name:l,attributes:[l]})).maxValuesPerFacet||0,r=Math.max(r,d?p:f),e=e.setQueryParameter("maxValuesPerFacet",r),t?e.addHierarchicalFacetRefinement(l,t):e.setQueryParameters({hierarchicalFacetsRefinements:n(n({},e.hierarchicalFacetsRefinements),{},s({},l,[]))}))}}}}ke=Gt(An);var Ln=["name","escapedValue","path"],Hn=J({name:"menu",connector:!0}),Dn=["isRefined","name:asc"];function qn(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,Un()),function(r){var i,a,o=r||{},c=void 0===(a=o.attribute)?"":a,u=void 0===(a=o.items)?[]:a,l=void 0===(a=o.transformItems)?function(e){return e}:a;if(""===c)throw new Error(Un("The `attribute` option is required."));if(u&&0!==u.length)return i={},{$$type:"ais.numericMenu",init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},dispose:function(e){return e=e.state,t(),e.removeNumericRefinement(c)},getWidgetUiState:function(e,t){var r=(t=t.searchParameters.getNumericRefinements(c))["="]&&t["="][0];return r||0===r?n(n({},e),{},{numericMenu:n(n({},e.numericMenu),{},s({},c,"".concat(t["="])))}):(r=t[">="]&&t[">="][0]||"",t=t["<="]&&t["<="][0]||"",e=n(n({},e),{},{numericMenu:n(n({},e.numericMenu),{},s({},c,"".concat(r,":").concat(t)))}),r=c,e.numericMenu&&(":"===e.numericMenu[r]&&delete e.numericMenu[r],0===Object.keys(e.numericMenu).length)&&delete e.numericMenu,e)},getWidgetSearchParameters:function(e,t){var r;return t=(t=t.uiState).numericMenu&&t.numericMenu[c],e=e.setQueryParameters({numericRefinements:n(n({},e.numericRefinements),{},s({},c,{}))}),t?-1===t.indexOf(":")?e.addNumericRefinement(c,"=",Number(t)):(r=(t=g(t.split(":").map(parseFloat),2))[0],t=t[1],r=he(r)?e.addNumericRefinement(c,">=",r):e,he(t)?r.addNumericRefinement(c,"<=",t):r):e},getRenderState:function(e,t){return n(n({},e),{},{numericMenu:n(n({},e.numericMenu),{},s({},c,this.getWidgetRenderState(t)))})},getWidgetRenderState:function(e){var t,n,a,o=this,s=e.results,f=e.state,d=e.instantSearchInstance,h=e.helper,p=e.createURL,m=(i.refine||(i.refine=function(e){var t=Bn(h.state,c,e);i.sendEvent("click:internal",e),h.setState(t).search()}),i.createURL||(i.createURL=function(e){return function(t){return p((function(n){return o.getWidgetUiState(n,{searchParameters:Bn(e,c,t),helper:h})}))}}),i.sendEvent||(i.sendEvent=(t={instantSearchInstance:d}.instantSearchInstance,function(){1===arguments.length&&t.sendEventToInsights(arguments.length<=0?void 0:arguments[0])})),e=!s||0===s.nbHits,n=f,d=u.map((function(e){var t=e.start,r=e.end;return{label:e=e.label,value:encodeURI(JSON.stringify({start:t,end:r})),isRefined:Wn(n,c,{start:t,end:r})}})),!0),g=function(e,t){var n,r,i,a,o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(o)return r=!(n=!0),{s:function(){o=o.call(e)},n:function(){var e=o.next();return n=e.done,e},e:function(e){r=!0,i=e},f:function(){try{n||null==o.return||o.return()}finally{if(r)throw i}}};if(Array.isArray(e)||(o=y(e))||t&&e&&"number"==typeof e.length)return o&&(e=o),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(d);try{for(g.s();!(a=g.n()).done;){var v=a.value;if(v.isRefined&&"{}"!==decodeURI(v.value)){m=!1;break}}}catch(e){g.e(e)}finally{g.f()}return{createURL:i.createURL(f),items:l(d,{results:s}),hasNoResults:e,canRefine:!(e&&m),refine:i.refine,sendEvent:i.sendEvent,widgetParams:r}}};throw new Error(Un("The `items` option expects an array of objects."))}}var Un=J({name:"numeric-menu",connector:!0});function Wn(e,t,n){var r=e.getNumericRefinements(t);return void 0!==n.start&&void 0!==n.end?n.start===n.end?$n(r,"=",n.start):$n(r,">=",n.start)&&$n(r,"<=",n.end):void 0!==n.start?$n(r,">=",n.start):void 0!==n.end?$n(r,"<=",n.end):void 0===n.start&&void 0===n.end&&Object.keys(r).every((function(e){return 0===(r[e]||[]).length}))}function Bn(e,t,n){n=JSON.parse(decodeURI(n));var r=e.getNumericRefinements(t);if(void 0===n.start&&void 0===n.end)return e.removeNumericRefinement(t);if(Wn(e,t,n)||(e=e.removeNumericRefinement(t)),void 0!==n.start&&void 0!==n.end){if(n.start>n.end)throw new Error("option.start should be > to option.end");if(n.start===n.end)return $n(r,"=",n.start)?e.removeNumericRefinement(t,"=",n.start):e.addNumericRefinement(t,"=",n.start)}return void 0!==n.start&&(e=(e=$n(r,">=",n.start)?e.removeNumericRefinement(t,">=",n.start):e).addNumericRefinement(t,">=",n.start)),"number"==typeof(e=void 0!==n.end?(e=$n(r,"<=",n.end)?e.removeNumericRefinement(t,"<=",n.end):e).addNumericRefinement(t,"<=",n.end):e).page&&(e.page=0),e}function $n(e,t,n){return void 0!==e[t]&&e[t].includes(n)}function Vn(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,Kn()),function(r){var i=(a=r||{}).totalPages,a=a.padding,o=new Qn({currentPage:0,total:0,padding:void 0===a?3:a}),s={};return{$$type:"ais.pagination",init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},dispose:function(e){return e=e.state,t(),e.setQueryParameter("page",void 0)},getWidgetUiState:function(e,t){return(t=t.searchParameters.page||0)?n(n({},e),{},{page:t+1}):e},getWidgetSearchParameters:function(e,t){return t=(t=t.uiState).page?t.page-1:0,e.setQueryParameter("page",t)},getWidgetRenderState:function(e){var t=e.results,a=e.helper,c=e.state,u=e.createURL;return s.refine||(s.refine=function(e){a.setPage(e),a.search()}),s.createURL||(s.createURL=function(e){return u((function(t){return n(n({},t),{},{page:e+1})}))}),e=c.page||0,c=(c=t||{nbPages:0}).nbPages,c=void 0!==i?Math.min(i,c):c,o.currentPage=e,o.total=c,{createURL:s.createURL,refine:s.refine,canRefine:1<c,currentRefinement:e,nbHits:(null==t?void 0:t.nbHits)||0,nbPages:c,pages:t?o.pages():[],isFirstPage:o.isFirstPage(),isLastPage:o.isLastPage(),widgetParams:r}},getRenderState:function(e,t){return n(n({},e),{},{pagination:this.getWidgetRenderState(t)})}}}}var Qn=function(){function e(t){a(this,e),s(this,"currentPage",void 0),s(this,"total",void 0),s(this,"padding",void 0),this.currentPage=t.currentPage,this.total=t.total,this.padding=t.padding}return o(e,[{key:"pages",value:function(){var e,t=this.total,n=this.currentPage,r=this.padding;return 0===t?[0]:be((e=this.nbPagesDisplayed(r,t))===t?{end:t}:{start:n-(r=this.calculatePaddingLeft(n,r,t,e)),end:n+(e-r)})}},{key:"nbPagesDisplayed",value:function(e,t){return Math.min(2*e+1,t)}},{key:"calculatePaddingLeft",value:function(e,t,n,r){return e<=t?e:n-t<=e?r-(n-e):t}},{key:"isLastPage",value:function(){return this.currentPage>=this.total-1}},{key:"isFirstPage",value:function(){return this.currentPage<=0}}]),e}(),Kn=J({name:"pagination",connector:!0}),zn=J({name:"range-input",connector:!0},{name:"range-slider",connector:!0});function Gn(e){var t=e.min,n=e.max;return e=e.precision,e=Math.pow(10,e),{min:t&&Math.floor(t*e)/e,max:n&&Math.ceil(n*e)/e}}function Jn(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,zn()),function(r){var i,a=r||{},o=void 0===(i=a.attribute)?"":i,c=a.min,u=a.max,l=void 0===(i=a.precision)?0:i;if(!o)throw new Error(zn("The `attribute` option is required."));if(he(c)&&he(u)&&u<c)throw new Error(zn("The `max` option can't be lower than `min`."));var f={from:function(e){return e.toLocaleString()},to:function(e){return Number(Number(e).toFixed(l)).toLocaleString()}};function d(e,t){return function(){var n=(r=g(0<arguments.length&&void 0!==arguments[0]?arguments[0]:[void 0,void 0],2))[0],r=r[1];(n=function(e,t,n,r){e=e.state;var i=t.min,a=(t=t.max,g(e.getNumericRefinement(o,">=")||[],1)[0]),s=g(e.getNumericRefinement(o,"<=")||[],1)[0],f=void 0===r||""===r,d=(r=(n=Gn({min:(d=void 0===n||""===n)?void 0:parseFloat(n),max:f?void 0:parseFloat(r),precision:l})).min,n=n.max,he(c)||i!==r?he(c)&&d?c:r:void 0);return r=he(u)||t!==n?he(u)&&f?u:n:void 0,f=void 0===d,n=he(i)&&i<=d,f=f||he(d)&&(!he(i)||n),i=void 0===r,n=he(r)&&r<=t,i=i||he(r)&&(!he(t)||n),(a!==d||s!==r)&&f&&i?(e=e.removeNumericRefinement(o),he(d)&&(e=e.addNumericRefinement(o,">=",d)),(e=he(r)?e.addNumericRefinement(o,"<=",r):e).resetPage()):null}(e,t,n,r))&&e.setState(n).search()}}return{$$type:"ais.range",init:function(t){e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!0)},render:function(t){e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!1)},getRenderState:function(e,t){return n(n({},e),{},{range:n(n({},e.range),{},s({},o,this.getWidgetRenderState(t)))})},getWidgetRenderState:function(e){var t,i=e.results,a=e.helper,s=(e=e.instantSearchInstance,X(i&&i.disjunctiveFacets||[],(function(e){return e.name===o}))),h=(s=s&&s.stats||{min:void 0,max:void 0},Gn({min:h=he(c)?c:he(s.min)?s.min:0,max:s=he(u)?u:he(s.max)?s.max:0,precision:l})),p=(p=g((s=a).getNumericRefinement(o,">=")||[],1)[0],s=g(s.getNumericRefinement(o,"<=")||[],1)[0],[he(p)?p:-1/0,he(s)?s:1/0]);return{refine:s=d(a,i?h:{min:void 0,max:void 0}),canRefine:h.min!==h.max,format:f,range:h,sendEvent:(t=e,function(){1===arguments.length&&t.sendEventToInsights(arguments.length<=0?void 0:arguments[0])}),widgetParams:n(n({},r),{},{precision:l}),start:p}},dispose:function(e){return e=e.state,t(),e.removeDisjunctiveFacet(o).removeNumericRefinement(o)},getWidgetUiState:function(e,t){var r=void 0===(r=(t=t.searchParameters.getNumericRefinements(o))[">="])?[]:r;return t=void 0===(t=t["<="])?[]:t,0===r.length&&0===t.length?e:n(n({},e),{},{range:n(n({},e.range),{},s({},o,"".concat(r,":").concat(t)))})},getWidgetSearchParameters:function(e,t){var r;return t=t.uiState,e=e.addDisjunctiveFacet(o).setQueryParameters({numericRefinements:n(n({},e.numericRefinements),{},s({},o,{}))}),he(c)&&(e=e.addNumericRefinement(o,">=",c)),he(u)&&(e=e.addNumericRefinement(o,"<=",u)),(t=t.range&&t.range[o])&&-1!==t.indexOf(":")&&(r=(t=g(t.split(":").map(parseFloat),2))[0],t=t[1],he(r)&&(!he(c)||c<r)&&(e=(e=e.removeNumericRefinement(o,">=")).addNumericRefinement(o,">=",r)),he(t))&&(!he(u)||t<u)?(e=e.removeNumericRefinement(o,"<=")).addNumericRefinement(o,"<=",t):e}}}}function Yn(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,er()),function(r){var i,a=r||{},o=a.attribute,c=void 0===(i=a.operator)?"or":i,u=void 0===(i=a.limit)?10:i,l=void 0!==(i=a.showMore)&&i,f=void 0===(i=a.showMoreLimit)?20:i,d=void 0===(i=a.sortBy)?tr:i,p=void 0===(i=a.escapeFacetValues)||i,m=void 0===(i=a.transformItems)?function(e){return e}:i;if(!o)throw new Error(er("The `attribute` option is required."));if(!/^(and|or)$/.test(c))throw new Error(er('The `operator` must one of: `"and"`, `"or"` (got "'.concat(c,'").')));if(!0===l&&f<=u)throw new Error(er("`showMoreLimit` should be greater than `limit`."));function g(e){var t=e.name,r=e.escapedValue;return n(n({},h(e,Xn)),{},{value:r,label:t,highlighted:t})}var v,y,b,_=[],w=!0,S=!1,R=function(){};function P(){R()}function x(){return S?f:u}function O(t,r){return function(i){return function(a){var s,c=i.instantSearchInstance,u=i.results;""===a&&_?e(n(n({},r.getWidgetRenderState(n(n({},i),{},{results:v}))),{},{instantSearchInstance:c}),!1):(s={highlightPreTag:(p?I:F).highlightPreTag,highlightPostTag:(p?I:F).highlightPostTag},t.searchForFacetValues(o,a,Math.min(x(),100),s).then((function(t){t=p?t.facetHits.map((function(e){return n(n({},e),{},{highlighted:A(e.highlighted)})})):t.facetHits,t=m(t.map((function(e){var t=e.escapedValue,r=e.value;return n(n({},h(e,Zn)),{},{value:t,label:r})})),{results:u}),e(n(n({},r.getWidgetRenderState(n(n({},i),{},{results:v}))),{},{items:t,canToggleShowMore:!1,canRefine:!0,isFromSearch:!0,instantSearchInstance:c}),!1)})))}}}var E=function(){return function(){}};return{$$type:"ais.refinementList",init:function(t){e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!0)},render:function(t){e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!1)},getRenderState:function(e,t){return n(n({},e),{},{refinementList:n(n({},e.refinementList),{},s({},o,this.getWidgetRenderState(t)))})},getWidgetRenderState:function(e){var t,n,i=this,a=e.results,s=e.state,c=e.createURL,f=e.instantSearchInstance,h=e.helper,p=[],C=[],N=(b&&y&&E||(b=D({instantSearchInstance:f,helper:h,attribute:o,widgetType:this.$$type}),y=function(e){b("click:internal",e),h.toggleFacetRefinement(o,e).search()},E=O(h,this)),a&&(C=(f=a.getFacetValues(o,{sortBy:d,facetOrdering:d===tr}))&&Array.isArray(f)?f:[],p=m(C.slice(0,x()).map(g),{results:a}),f=s.maxValuesPerFacet,N=x(),w=N<f?C.length<=N:C.length<N,v=a,_=p,e.results)&&(t=e,n=this,R=function(){S=!S,n.render(t)}),f=E&&E(e),C=S&&_.length>u,l&&!w);return{createURL:function(e){return c((function(t){return i.getWidgetUiState(t,{searchParameters:s.resetPage().toggleFacetRefinement(o,e),helper:h})}))},items:p,refine:y,searchForItems:f,isFromSearch:!1,canRefine:0<p.length,widgetParams:r,isShowingMore:S,canToggleShowMore:C||N,toggleShowMore:P,sendEvent:b,hasExhaustiveItems:w}},dispose:function(e){return e=e.state,t(),e=e.setQueryParameter("maxValuesPerFacet",void 0),"and"===c?e.removeFacet(o):e.removeDisjunctiveFacet(o)},getWidgetUiState:function(e,t){return t=t.searchParameters,t="or"===c?t.getDisjunctiveRefinements(o):t.getConjunctiveRefinements(o),e=n(n({},e),{},{refinementList:n(n({},e.refinementList),{},s({},o,t))}),t=o,e.refinementList&&(e.refinementList[t]&&0!==e.refinementList[t].length||delete e.refinementList[t],0===Object.keys(e.refinementList).length)&&delete e.refinementList,e},getWidgetSearchParameters:function(e,t){t=t.uiState;var r,i="or"===c;return e.isHierarchicalFacet(o)||i&&e.isConjunctiveFacet(o)||!i&&e.isDisjunctiveFacet(o)?e:(t=t.refinementList&&t.refinementList[o],r=(e=i?e.addDisjunctiveFacet(o).removeDisjunctiveFacetRefinement(o):e.addFacet(o).removeFacetRefinement(o)).maxValuesPerFacet||0,r=Math.max(r,l?f:u),e=e.setQueryParameter("maxValuesPerFacet",r),t?t.reduce((function(e,t){return i?e.addDisjunctiveFacetRefinement(o,t):e.addFacetRefinement(o,t)}),e):e.setQueryParameters(s({},r=i?"disjunctiveFacetsRefinements":"facetsRefinements",n(n({},e[r]),{},s({},o,[])))))}}}}var Xn=["name","escapedValue"],Zn=["escapedValue","value"],er=J({name:"refinement-list",connector:!0}),tr=["isRefined","count:desc","name:asc"];function nr(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,sr()),function(r){var i,a,o=r||{},s=void 0===(a=o.escapeHTML)||a,c=o.objectIDs,u=o.limit,l=o.threshold,f=o.fallbackParameters,d=o.queryParameters,h=void 0===(a=o.transformItems)?function(e){return e}:a;if(c&&0!==c.length)return{dependsOn:"recommend",$$type:"ais.relatedProducts",init:function(t){e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!0)},render:function(t){var r=this.getWidgetRenderState(t);e(n(n({},r),{},{instantSearchInstance:t.instantSearchInstance}),!1)},getRenderState:function(e){return e},getWidgetRenderState:function(e){var t=e.results,n=e.helper;return e=e.instantSearchInstance,i=i||B({instantSearchInstance:e,getIndex:function(){return n.getIndex()},widgetType:this.$$type}),null==t?{items:[],widgetParams:r,sendEvent:i}:(s&&0<t.hits.length&&(t.hits=L(t.hits)),e=ue(ce(t.hits,0,1),t.queryID),{items:h(e,{results:t}),widgetParams:r,sendEvent:i})},dispose:function(e){return e=e.recommendState,t(),e.removeParams(this.$$id)},getWidgetParameters:function(e){var t=this;return c.reduce((function(e,r){return e.addRelatedProducts({objectID:r,maxRecommendations:u,threshold:l,fallbackParameters:n(n({},f),s?I:{}),queryParameters:n(n({},d),s?I:{}),$$id:t.$$id})}),e.removeParams(this.$$id))}};throw new Error(sr("The `objectIDs` option is required."))}}function rr(e,t){return t(e)}function ir(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,cr()),function(r){var i,a,o=(r||{}).queryHook,s=void 0===o?rr:o;return{$$type:"ais.searchBox",init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},dispose:function(e){return e=e.state,t(),e.setQueryParameter("query",void 0)},getRenderState:function(e,t){return n(n({},e),{},{searchBox:this.getWidgetRenderState(t)})},getWidgetRenderState:function(e){var t=e.helper,n=e.instantSearchInstance;return e=e.state,i||(i=function(e){s(e,(function(e){return t.setQuery(e).search()}))},a=function(){t.setQuery("").search()}),{query:e.query||"",refine:i,clear:a,widgetParams:r,isSearchStalled:"stalled"===n.status}},getWidgetUiState:function(e,t){return""===(t=t.searchParameters.query||"")||e&&e.query===t?e:n(n({},e),{},{query:t})},getWidgetSearchParameters:function(e,t){return t=t.uiState,e.setQueryParameter("query",t.query||"")}}}}function ar(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_,r=(R(e,ur()),{});return function(i){var a,o=(a=i||{}).items,s=void 0===(a=a.transformItems)?function(e){return e}:a;if(Array.isArray(o))return{$$type:"ais.sortBy",init:function(t){var r=t.instantSearchInstance,i=(t=this.getWidgetRenderState(t)).currentRefinement;X(o,(function(e){return e.value===i})),e(n(n({},t),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},dispose:function(e){return e=e.state,t(),r.initialIndex?e.setIndex(r.initialIndex):e},getRenderState:function(e,t){return n(n({},e),{},{sortBy:this.getWidgetRenderState(t)})},getWidgetRenderState:function(e){var t=e.results,n=e.helper,a=e.state;return e=e.parent,!r.initialIndex&&e&&(r.initialIndex=e.getIndexName()),r.setIndex||(r.setIndex=function(e){n.setIndex(e).search()}),e=!t||0===t.nbHits,{currentRefinement:a.index,options:s(o,{results:t}),refine:r.setIndex,hasNoResults:e,canRefine:!e&&0<o.length,widgetParams:i}},getWidgetUiState:function(e,t){return t=t.searchParameters.index,n(n({},e),{},{sortBy:t!==r.initialIndex?t:void 0})},getWidgetSearchParameters:function(e,t){return t=t.uiState,e.setQueryParameter("index",t.sortBy||r.initialIndex||e.index)}};throw new Error(ur("The `items` option expects an array of objects."))}}function or(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,lr()),function(r){var i,a,o,c,u,l=(u=r||{}).attribute,f=void 0===(u=u.max)?5:u;if(l)return a=function(e){var t;if(null!=(t=(e=e.getNumericRefinements(l))[">="])&&t.length)return e[">="][0]},o=function(e){return function(e,t){i("click:internal",t),e.setState(d(e.state,t)).search()}.bind(null,e)},c=function(e){var t=e.state,n=e.createURL,r=e.getWidgetUiState,i=e.helper;return function(e){return n((function(n){return r(n,{searchParameters:d(t,e),helper:i})}))}},{$$type:fr,init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},getRenderState:function(e,t){return n(n({},e),{},{ratingMenu:n(n({},e.ratingMenu),{},s({},l,this.getWidgetRenderState(t)))})},getWidgetRenderState:function(e){var t,n,s,u,d,h=e.helper,p=e.results,m=e.state,y=e.instantSearchInstance,b=(e=e.createURL,[]),_=(i||(t=(y={instantSearchInstance:y,helper:h,getRefinedStar:function(){return a(h.state)},attribute:l}).instantSearchInstance,n=y.helper,s=y.getRefinedStar,u=y.attribute,i=function(){for(var e,r,i,a,o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];1===c.length?t.sendEventToInsights(c[0]):(e=c[1],r=void 0===(r=c[2])?"Filter Applied":r,i=(a=g(c[0].split(":"),2))[0],a=a[1],"click"===i&&s()!==Number(e)&&t.sendEventToInsights({insightsMethod:"clickedFilters",widgetType:fr,eventType:i,eventModifier:a,payload:{eventName:r,index:n.getIndex(),filters:["".concat(u,">=").concat(e)]},attribute:u}))}),!1),w=0,S=null==p?void 0:p.getFacetValues(l,{});if(p&&S){S.length,d=0,S.forEach((function(e){e=g(e.name.split("."),2)[1],d=Math.max(d,(void 0===e?"":e).length)}));for(var R=a(m),P=1;P<f;P+=1)!function(e){var t=R===e,n=(_=_||t,S.filter((function(t){return Number(t.name)>=e&&Number(t.name)<=f})).map((function(e){return e.count})).reduce((function(e,t){return e+t}),0));if(w+=n,!R||t||0!==n){var r=v(new Array(Math.floor(+f))).map((function(t,n){return+n<e}));b.push({stars:r,name:String(e),label:String(e),value:String(e),count:n,isRefined:t})}}(P)}return b=b.reverse(),y=!p||0===p.nbHits,{items:b,hasNoResults:y,canRefine:(!y||_)&&0<w,refine:o(h),sendEvent:i,createURL:c({state:m,createURL:e,helper:h,getWidgetUiState:this.getWidgetUiState}),widgetParams:r}},dispose:function(e){return e=e.state,t(),e.removeNumericRefinement(l)},getWidgetUiState:function(e,t){return t=t.searchParameters,t=a(t),e=n(n({},e),{},{ratingMenu:n(n({},e.ratingMenu),{},s({},l,"number"==typeof t?t:void 0))}),t=l,e.ratingMenu&&("number"!=typeof e.ratingMenu[t]&&delete e.ratingMenu[t],0===Object.keys(e.ratingMenu).length)&&delete e.ratingMenu,e},getWidgetSearchParameters:function(e,t){return t=(t=t.uiState).ratingMenu&&t.ratingMenu[l],e=e.addDisjunctiveFacet(l).removeNumericRefinement(l).removeDisjunctiveFacetRefinement(l),t?e.addNumericRefinement(l,"<=",f).addNumericRefinement(l,">=",t):e.setQueryParameters({numericRefinements:n(n({},e.numericRefinements),{},s({},l,{}))})}};throw new Error(lr("The `attribute` option is required."));function d(e,t){var n=a(e)===Number(t);return e=e.resetPage().removeNumericRefinement(l),n?e:e.addNumericRefinement(l,"<=",f).addNumericRefinement(l,">=",Number(t))}}}var sr=J({name:"related-products",connector:!0}),cr=J({name:"search-box",connector:!0}),ur=J({name:"sort-by",connector:!0}),lr=J({name:"rating-menu",connector:!0}),fr="ais.ratingMenu";function dr(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,gr()),function(r){return{$$type:"ais.stats",init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},dispose:function(){t()},getRenderState:function(e,t){return n(n({},e),{},{stats:this.getWidgetRenderState(t)})},getWidgetRenderState:function(e){var t=e.results;return e=e.state,t?{hitsPerPage:t.hitsPerPage,nbHits:t.nbHits,nbSortedHits:t.nbSortedHits,areHitsSorted:void 0!==t.appliedRelevancyStrictness&&0<t.appliedRelevancyStrictness&&t.nbSortedHits!==t.nbHits,nbPages:t.nbPages,page:t.page,processingTimeMS:t.processingTimeMS,query:t.query,widgetParams:r}:{hitsPerPage:e.hitsPerPage,nbHits:0,nbSortedHits:void 0,areHitsSorted:!1,nbPages:0,page:e.page||0,processingTimeMS:-1,query:e.query||"",widgetParams:r}}}}}function hr(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,vr()),function(r){var i,a,o,c,u,l=(d=r||{}).attribute,f=d.on,d=d.off;if(l)return i=void 0!==d,a=Pe(void 0===f||f).map(Y),o=i?Pe(d).map(Y):void 0,u=function(e,t){var n=t.state,r=t.createURL,i=t.getWidgetUiState,s=t.helper;return function(){var t;return n=n.resetPage(),(t=e?a:o)&&t.forEach((function(e){n=n.removeDisjunctiveFacetRefinement(l,e)})),(t=e?o:a)&&t.forEach((function(e){n=n.addDisjunctiveFacetRefinement(l,e)})),r((function(e){return i(e,{searchParameters:n,helper:s})}))}},{$$type:yr,init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},dispose:function(e){return e=e.state,t(),e.removeDisjunctiveFacet(l)},getRenderState:function(e,t){return n(n({},e),{},{toggleRefinement:n(n({},e.toggleRefinement),{},s({},l,this.getWidgetRenderState(t)))})},getWidgetRenderState:function(e){var t,n,s,f,d,h,p,m=e.state,v=e.helper,y=e.results,b=e.createURL,_=(e=e.instantSearchInstance,a.every((function(e){return m.isDisjunctiveFacetRefined(l,e)}))),w={isRefined:_,count:0},S={isRefined:i&&!_,count:0},R=(y&&(R=Pe(o||!1),t=y.getFacetValues(l,{})||[],n=a.map((function(e){return X(t,(function(t){return t.escapedValue===Y(String(e))}))})).filter((function(e){return void 0!==e})),R=i?R.map((function(e){return X(t,(function(t){return t.escapedValue===Y(String(e))}))})).filter((function(e){return void 0!==e})):[],w={isRefined:!!n.length&&n.every((function(e){return e.isRefined})),count:n.reduce((function(e,t){return e+t.count}),0)||null},S={isRefined:!!R.length&&R.every((function(e){return e.isRefined})),count:R.reduce((function(e,t){return e+t.count}),0)||t.reduce((function(e,t){return e+t.count}),0)}),c||(s=(n={instantSearchInstance:e,attribute:l,on:a,helper:v}).instantSearchInstance,f=n.helper,d=n.attribute,h=n.on,c=function(){for(var e,t,n,r,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];1===a.length?s.sendEventToInsights(a[0]):(e=a[1],t=void 0===(t=a[2])?"Filter Applied":t,n=(r=g(a[0].split(":"),2))[0],r=r[1],"click"!==n||void 0===h||e||s.sendEventToInsights({insightsMethod:"clickedFilters",widgetType:yr,eventType:n,eventModifier:r,payload:{eventName:t,index:f.getIndex(),filters:h.map((function(e){return"".concat(d,":").concat(e)}))},attribute:d}))}),_?S:w);return{value:{name:l,isRefined:_,count:y?R.count:null,onFacetValue:w,offFacetValue:S},createURL:u(_,{state:m,createURL:b,helper:v,getWidgetUiState:this.getWidgetUiState}),sendEvent:c,canRefine:Boolean(y?R.count:null),refine:(p=v,function(){var e=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{isRefined:!1}).isRefined;e?(a.forEach((function(e){return p.removeDisjunctiveFacetRefinement(l,e)})),i&&o.forEach((function(e){return p.addDisjunctiveFacetRefinement(l,e)}))):(c("click:internal",e),i&&o.forEach((function(e){return p.removeDisjunctiveFacetRefinement(l,e)})),a.forEach((function(e){return p.addDisjunctiveFacetRefinement(l,e)}))),p.search()}),widgetParams:r}},getWidgetUiState:function(e,t){var r=t.searchParameters;return t=a&&a.every((function(e){return r.isDisjunctiveFacetRefined(l,e)})),t?n(n({},e),{},{toggle:n(n({},e.toggle),{},s({},l,t))}):(null!=(t=e.toggle)&&delete t[l],e)},getWidgetSearchParameters:function(e,t){var r;return t=t.uiState,e.isHierarchicalFacet(l)||e.isConjunctiveFacet(l)?e:(r=e.addDisjunctiveFacet(l).removeDisjunctiveFacetRefinement(l),Boolean(t.toggle&&t.toggle[l])?(a&&a.forEach((function(e){r=r.addDisjunctiveFacetRefinement(l,e)})),r):i?(o&&o.forEach((function(e){r=r.addDisjunctiveFacetRefinement(l,e)})),r):r.setQueryParameters({disjunctiveFacetsRefinements:n(n({},e.disjunctiveFacetsRefinements),{},s({},l,[]))}))}};throw new Error(vr("The `attribute` option is required."))}}function pr(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,br()),function(r){var i,a,o=r||{},s=o.facetName,c=o.facetValue,u=o.limit,l=o.threshold,f=o.fallbackParameters,d=o.queryParameters,h=void 0===(a=o.escapeHTML)||a,p=void 0===(a=o.transformItems)?function(e){return e}:a;if(s&&!c||!s&&c)throw new Error(br("When you provide facetName (received type ".concat(S(s),"), you must also provide facetValue (received type ").concat(S(c),").")));return{dependsOn:"recommend",$$type:"ais.trendingItems",init:function(t){e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!0)},render:function(t){var r=this.getWidgetRenderState(t);e(n(n({},r),{},{instantSearchInstance:t.instantSearchInstance}),!1)},getRenderState:function(e){return e},getWidgetRenderState:function(e){var t=e.results,n=e.helper;return e=e.instantSearchInstance,i=i||B({instantSearchInstance:e,getIndex:function(){return n.getIndex()},widgetType:this.$$type}),null==t?{items:[],widgetParams:r,sendEvent:i}:(h&&0<t.hits.length&&(t.hits=L(t.hits)),e=ue(ce(t.hits,0,1),t.queryID),{items:p(e,{results:t}),widgetParams:r,sendEvent:i})},dispose:function(e){return e=e.recommendState,t(),e.removeParams(this.$$id)},getWidgetParameters:function(e){return e.removeParams(this.$$id).addTrendingItems({facetName:s,facetValue:c,maxRecommendations:u,threshold:l,fallbackParameters:n(n({},f),h?I:{}),queryParameters:n(n({},d),h?I:{}),$$id:this.$$id})}}}}function mr(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_,r=(R(e,_r()),{});return function(i){var a,o,c=i||{},u=c.attributes,l=void 0===(o=c.separator)?" > ":o,f=void 0===(o=c.rootPath)?null:o,d=void 0===(o=c.transformItems)?function(e){return e}:o;if(u&&Array.isArray(u)&&0!==u.length)return a=g(u,1)[0],{$$type:"ais.breadcrumb",init:function(t){e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!0)},render:function(t){e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!1)},dispose:function(){t()},getRenderState:function(e,t){return n(n({},e),{},{breadcrumb:n(n({},e.breadcrumb),{},s({},a,this.getWidgetRenderState(t)))})},getWidgetRenderState:function(e){var t,n=this,a=e.helper,o=e.createURL,s=e.results;return e=e.state,e=s&&0!==e.hierarchicalFacets.length?(e=g(e.hierarchicalFacets,1)[0].name,e=(e=s.getFacetValues(e,{}))&&!Array.isArray(e)&&e.data?e.data:[],d((t=function e(t){return t.reduce((function(t,n){return n.isRefined&&(t.push({label:n.name,value:n.escapedValue}),Array.isArray(n.data))?t.concat(e(n.data)):t}),[])}(e)).map((function(e,n){return{label:e.label,value:n+1===t.length?null:t[n+1].value}})),{results:s})):[],r.createURL||(r.createURL=function(e){return o((function(t){return n.getWidgetUiState(t,{searchParameters:h(a.state,e),helper:a})}))}),r.refine||(r.refine=function(e){a.setState(h(a.state,e)).search()}),{canRefine:0<e.length,createURL:r.createURL,items:e,refine:r.refine,widgetParams:i}},getWidgetUiState:function(e,t){return t=t.searchParameters.getHierarchicalFacetBreadcrumb(a),e=n(n({},e),{},{hierarchicalMenu:n(n({},e.hierarchicalMenu),{},s({},a,t))}),t=a,e.hierarchicalMenu&&(e.hierarchicalMenu[t]&&e.hierarchicalMenu[t].length||delete e.hierarchicalMenu[t],0===Object.keys(e.hierarchicalMenu).length)&&delete e.hierarchicalMenu,e},getWidgetSearchParameters:function(e,t){return t=(t=t.uiState).hierarchicalMenu&&t.hierarchicalMenu[a],e.isConjunctiveFacet(a)||e.isDisjunctiveFacet(a)?e:(e.isHierarchicalFacet(a)&&e.getHierarchicalFacetByName(a),e=e.removeHierarchicalFacet(a).addHierarchicalFacet({name:a,attributes:u,separator:l,rootPath:f}),t?e.addHierarchicalFacetRefinement(a,t.join(l)):e.setQueryParameters({hierarchicalFacetsRefinements:n(n({},e.hierarchicalFacetsRefinements),{},s({},a,[]))}))}};throw new Error(_r("The `attributes` option expects an array of strings."));function h(e,t){return t?e.resetPage().toggleFacetRefinement(a,t):0===(t=e.getHierarchicalFacetBreadcrumb(a)).length?e:e.resetPage().toggleFacetRefinement(a,t[0])}}}var gr=J({name:"stats",connector:!0}),vr=J({name:"toggle-refinement",connector:!0}),yr="ais.toggleRefinement",br=J({name:"trending-items",connector:!0}),_r=J({name:"breadcrumb",connector:!0}),wr=J({name:"geo-search",connector:!0});function Sr(e){return e.insideBoundingBox||""}function Rr(e,t){return e.setQueryParameter("insideBoundingBox",t)}function Pr(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,wr()),function(r){function i(e){if(e.aroundLatLng){var t=(e=e.aroundLatLng).match(Z);if(t)return{lat:parseFloat(t[1]),lng:parseFloat(t[2])};throw new Error('Invalid value for "aroundLatLng" parameter: "'.concat(e,'"'))}}function a(){return m.internalToggleRefineOnMapMove()}function o(e,t){return function(){m.isRefineOnMapMove=!m.isRefineOnMapMove,t(e)}}function s(){return m.isRefineOnMapMove}function c(){return m.internalSetMapMoveSinceLastRefine()}function u(e,t){return function(){var n=!0!==m.hasMapMoveSinceLastRefine;m.hasMapMoveSinceLastRefine=!0,n&&t(e)}}function l(){return m.hasMapMoveSinceLastRefine}var f,d,h=(d=r||{}).enableRefineOnMapMove,p=void 0===(d=d.transformItems)?function(e){return e}:d,m={isRefineOnMapMove:void 0===h||h,hasMapMoveSinceLastRefine:!1,lastRefinePosition:"",lastRefineBoundingBox:"",internalToggleRefineOnMapMove:_,internalSetMapMoveSinceLastRefine:_};return{$$type:Or,init:function(t){var r=t.instantSearchInstance;m.internalToggleRefineOnMapMove=o(t,_),m.internalSetMapMoveSinceLastRefine=u(t,_),e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.helper,i=t.instantSearchInstance,a=(r=r.state,Boolean(r.aroundLatLng)&&Boolean(m.lastRefinePosition)&&r.aroundLatLng!==m.lastRefinePosition),s=!r.insideBoundingBox&&Boolean(m.lastRefineBoundingBox)&&r.insideBoundingBox!==m.lastRefineBoundingBox;(a||s)&&(m.hasMapMoveSinceLastRefine=!1),m.lastRefinePosition=r.aroundLatLng||"",m.lastRefineBoundingBox=Sr(r),m.internalToggleRefineOnMapMove=o(t,this.render.bind(this)),m.internalSetMapMoveSinceLastRefine=u(t,this.render.bind(this)),a=this.getWidgetRenderState(t),f("view:internal",a.items),e(n(n({},a),{},{instantSearchInstance:i}),!1)},getWidgetRenderState:function(e){var t,n,o,u=e.helper,d=e.results,h=(e=e.instantSearchInstance,u.state);return d=d?p(d.hits.filter((function(e){return e._geoloc})),{results:d}):[],f=f||B({instantSearchInstance:e,getIndex:function(){return u.getIndex()},widgetType:Or}),{items:d,position:i(h),currentRefinement:(e=h).insideBoundingBox&&ee(e.insideBoundingBox),refine:function(e){var t=e.northEast;e=e.southWest,t=[t.lat,t.lng,e.lat,e.lng].join(),o.setState(Rr(o.state,t).resetPage()).search(),m.hasMapMoveSinceLastRefine=!1,m.lastRefineBoundingBox=t},sendEvent:f,clearMapRefinement:(n=o=u,function(){n.setQueryParameter("insideBoundingBox",void 0).search()}),isRefinedWithMap:(t=h,function(){return Boolean(t.insideBoundingBox)}),toggleRefineOnMapMove:a,isRefineOnMapMove:s,setMapMoveSinceLastRefine:c,hasMapMoveSinceLastRefine:l,widgetParams:r}},getRenderState:function(e,t){return n(n({},e),{},{geoSearch:this.getWidgetRenderState(t)})},dispose:function(e){return e=e.state,t(),e.setQueryParameter("insideBoundingBox",void 0)},getWidgetUiState:function(e,t){return!(t=Sr(t.searchParameters))||e&&e.geoSearch&&e.geoSearch.boundingBox===t?e:n(n({},e),{},{geoSearch:{boundingBox:t}})},getWidgetSearchParameters:function(e,t){return(t=t.uiState)&&t.geoSearch?Rr(e,t.geoSearch.boundingBox):e.setQueryParameter("insideBoundingBox",void 0)}}}}function xr(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_,r=(R(e,Er()),"https://www.algolia.com/?utm_source=instantsearch.js&utm_medium=website&"+"utm_content=".concat(Re((function(e){return(null==(e=e.window.location)?void 0:e.hostname)||""}),{fallback:function(){return""}}),"&")+"utm_campaign=poweredby");return function(i){var a=(i||{}).url,o=void 0===a?r:a;return{$$type:"ais.poweredBy",init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},getRenderState:function(e,t){return n(n({},e),{},{poweredBy:this.getWidgetRenderState(t)})},getWidgetRenderState:function(){return{url:o,widgetParams:i}},dispose:function(){t()}}}}var Or="ais.geoSearch",Er=J({name:"powered-by",connector:!0}),Cr=J({name:"autocomplete",connector:!0}),Nr=J({name:"query-rules",connector:!0});function jr(e){var t,r,i,a=this.helper,o=this.initialRuleContexts,s=this.trackedFilters,c=this.transformRuleContexts,u=(e=e.state).ruleContexts||[];t=(s={helper:a,sharedHelperState:e,trackedFilters:s}).helper,r=s.sharedHelperState,i=s.trackedFilters,s=Object.keys(i).reduce((function(e,n){var a=oe(t.lastResults||{},r,!0).filter((function(e){return e.attribute===n})).map((function(e){return e.numericValue||e.name})),o=(0,i[n])(a);return[].concat(v(e),v(a.filter((function(e){return o.includes(e)})).map((function(e){return"ais-".concat(n,"-").concat(e).replace(/[^a-z0-9-_]+/gi,"_")}))))}),[]),de(u,c=c([].concat(v(o),v(s))).slice(0,10))||a.overrideStateWithoutTriggeringChangeEvent(n(n({},e),{},{ruleContexts:c}))}function Tr(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,Nr()),function(r){var i,a,o=r||{},s=void 0===(a=o.trackedFilters)?{}:a,c=void 0===(a=o.transformRuleContexts)?function(e){return e}:a,u=void 0===(a=o.transformItems)?function(e){return e}:a,l=(Object.keys(s).forEach((function(e){if("function"!=typeof s[e])throw new Error(Nr("'The \"".concat(e,'" filter value in the `trackedFilters` option expects a function.')))})),0<Object.keys(s).length),f=[];return{$$type:"ais.queryRules",init:function(t){var a=t.helper,o=t.state,u=t.instantSearchInstance;f=o.ruleContexts||[],i=jr.bind({helper:a,initialRuleContexts:f,trackedFilters:s,transformRuleContexts:c}),l&&(([o.disjunctiveFacetsRefinements,o.facetsRefinements,o.hierarchicalFacetsRefinements,o.numericRefinements].some((function(e){return Boolean(e&&0<Object.keys(e).length)}))||Boolean(r.transformRuleContexts))&&i({state:o}),a.on("change",i)),e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:u}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},getWidgetRenderState:function(e){var t=((e=e.results)||{}).userData;return{items:u(void 0===t?[]:t,{results:e}),widgetParams:r}},getRenderState:function(e,t){return n(n({},e),{},{queryRules:this.getWidgetRenderState(t)})},dispose:function(e){var n=e.helper;return e=e.state,t(),l?(n.removeListener("change",i),e.setQueryParameter("ruleContexts",f)):e}}}}function kr(e){function t(){d(l(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"initial"))}function r(){i&&(i.stop(),i.removeEventListener("start",h),i.removeEventListener("error",p),i.removeEventListener("result",m),i.removeEventListener("end",g),i=void 0)}var i,a=e.searchAsYouSpeak,o=e.language,s=e.onQueryChange,c=e.onStateChange,u=window.webkitSpeechRecognition||window.SpeechRecognition,l=function(e){return{status:e,transcript:"",isSpeechFinal:!1,errorCode:void 0}},f=l("initial"),d=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};f=n(n({},f),e),c()},h=function(){d({status:"waiting"})},p=function(e){d({status:"error",errorCode:e.error})},m=function(e){d({status:"recognizing",transcript:e.results[0]&&e.results[0][0]&&e.results[0][0].transcript||"",isSpeechFinal:e.results[0]&&e.results[0].isFinal}),a&&f.transcript&&s(f.transcript)},g=function(){f.errorCode||!f.transcript||a||s(f.transcript),"error"!==f.status&&d({status:"finished"})};return{getState:function(){return f},isBrowserSupported:function(){return Boolean(u)},isListening:function(){return"askingPermission"===f.status||"waiting"===f.status||"recognizing"===f.status},startListening:function(){(i=new u)&&(t("askingPermission"),i.interimResults=!0,o&&(i.lang=o),i.addEventListener("start",h),i.addEventListener("error",p),i.addEventListener("result",m),i.addEventListener("end",g),i.start())},stopListening:function(){r(),t("finished")},dispose:r}}function Ir(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,Hr()),function(r){var i,a=void 0!==(i=r.searchAsYouSpeak)&&i,o=r.language,s=r.additionalQueryParameters,c=void 0===(i=r.createVoiceSearchHelper)?kr:i;return{$$type:"ais.voiceSearch",init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},getRenderState:function(e,t){return n(n({},e),{},{voiceSearch:this.getWidgetRenderState(t)})},getWidgetRenderState:function(t){var i=this,u=t.helper,l=t.instantSearchInstance,f=(this._refine||(this._refine=function(e){var t;e!==u.state.query&&(t=o?[o.split("-")[0]]:void 0,u.setQueryParameter("queryLanguages",t),"function"==typeof s&&u.setState(u.state.setQueryParameters(n({ignorePlurals:!0,removeStopWords:!0,optionalWords:e},s({query:e})))),u.setQuery(e).search())}),this._voiceSearchHelper||(this._voiceSearchHelper=c({searchAsYouSpeak:a,language:o,onQueryChange:function(e){return i._refine(e)},onStateChange:function(){e(n(n({},i.getWidgetRenderState(t)),{},{instantSearchInstance:l}),!1)}})),this._voiceSearchHelper),d=f.isBrowserSupported,h=f.isListening,p=f.startListening,m=f.stopListening;return f=f.getState,{isBrowserSupported:d(),isListening:h(),toggleListening:function(){d()&&(h()?m:p)()},voiceListeningState:f(),widgetParams:r}},dispose:function(e){e=e.state;var r,i=(this._voiceSearchHelper.dispose(),t(),e);return"function"==typeof s&&(r=(r=s({query:""}))?Object.keys(r).reduce((function(e,t){return e[t]=void 0,e}),{}):{},i=e.setQueryParameters(n({queryLanguages:void 0,ignorePlurals:void 0,removeStopWords:void 0,optionalWords:void 0},r))),i.setQueryParameter("query",void 0)},getWidgetUiState:function(e,t){return(t=t.searchParameters.query||"")?n(n({},e),{},{query:t}):e},getWidgetSearchParameters:function(e,t){return t=t.uiState,e.setQueryParameter("query",t.query||"")}}}}function Fr(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:_,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return function(r){var i={};return{$$type:"ais.relevantSort",init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!1)},dispose:function(e){return e=e.state,t(),e.setQueryParameter("relevancyStrictness",void 0)},getRenderState:function(e,t){return n(n({},e),{},{relevantSort:this.getWidgetRenderState(t)})},getWidgetRenderState:function(e){var t=e.results,n=e.helper;return i.refine||(i.refine=function(e){n.setQueryParameter("relevancyStrictness",e).search()}),{isRelevantSorted:void 0!==(e=(t||{}).appliedRelevancyStrictness)&&0<e,isVirtualReplica:t=void 0!==e,canRefine:t,refine:i.refine,widgetParams:r}},getWidgetSearchParameters:function(e,t){return t=t.uiState,e.setQueryParameter("relevancyStrictness",null!=(t=t.relevantSort)?t:e.relevancyStrictness)},getWidgetUiState:function(e,t){return t=t.searchParameters,n(n({},e),{},{relevantSort:t.relevancyStrictness||e.relevantSort})}}}}function Ar(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,Dr()),function(r){var i,a,o=r||{},s=void 0===(a=o.escapeHTML)||a,c=void 0===(a=o.transformItems)?function(e){return e}:a,u=o.objectIDs,l=o.limit,f=o.threshold,d=o.queryParameters;if(u&&0!==u.length)return{dependsOn:"recommend",$$type:"ais.frequentlyBoughtTogether",init:function(t){e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!0)},render:function(t){var r=this.getWidgetRenderState(t);e(n(n({},r),{},{instantSearchInstance:t.instantSearchInstance}),!1)},getRenderState:function(e){return e},getWidgetRenderState:function(e){var t=e.results,n=e.helper;return e=e.instantSearchInstance,i=i||B({instantSearchInstance:e,getIndex:function(){return n.getIndex()},widgetType:this.$$type}),null==t?{items:[],widgetParams:r,sendEvent:i}:(s&&0<t.hits.length&&(t.hits=L(t.hits)),e=ue(ce(t.hits,0,1),t.queryID),{items:c(e,{results:t}),widgetParams:r,sendEvent:i})},dispose:function(e){return e=e.recommendState,t(),e.removeParams(this.$$id)},getWidgetParameters:function(e){var t=this;return u.reduce((function(e,r){return e.addFrequentlyBoughtTogether({objectID:r,threshold:f,maxRecommendations:l,queryParameters:n(n({},d),s?I:{}),$$id:t.$$id})}),e.removeParams(this.$$id))}};throw new Error(Dr("The `objectIDs` option is required."))}}function Mr(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,qr()),function(r){var i,a,o=r||{},s=void 0===(a=o.escapeHTML)||a,c=o.objectIDs,u=o.limit,l=o.threshold,f=o.fallbackParameters,d=o.queryParameters,h=void 0===(a=o.transformItems)?function(e){return e}:a;if(c&&0!==c.length)return{dependsOn:"recommend",$$type:"ais.lookingSimilar",init:function(t){e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!0)},render:function(t){var r=this.getWidgetRenderState(t);e(n(n({},r),{},{instantSearchInstance:t.instantSearchInstance}),!1)},getRenderState:function(e){return e},getWidgetRenderState:function(e){var t=e.results,n=e.helper;return e=e.instantSearchInstance,i=i||B({instantSearchInstance:e,getIndex:function(){return n.getIndex()},widgetType:this.$$type}),null==t?{items:[],widgetParams:r,sendEvent:i}:(s&&0<t.hits.length&&(t.hits=L(t.hits)),e=ue(ce(t.hits,0,1),t.queryID),{items:h(e,{results:t}),widgetParams:r,sendEvent:i})},dispose:function(e){return e=e.recommendState,t(),e.removeParams(this.$$id)},getWidgetParameters:function(e){var t=this;return c.reduce((function(e,r){return e.addLookingSimilar({objectID:r,maxRecommendations:u,threshold:l,fallbackParameters:n(n({},f),s?I:{}),queryParameters:n(n({},d),s?I:{}),$$id:t.$$id})}),e.removeParams(this.$$id))}};throw new Error(qr("The `objectIDs` option is required."))}}function Lr(e){return function(){var t=(n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).descendantName,n=n.modifierName;return t=t?"-".concat(t):"",n=n?"--".concat(n):"","".concat("ais","-").concat(e).concat(t).concat(n)}}var Hr=J({name:"voice-search",connector:!0}),Dr=J({name:"frequently-bought-together",connector:!0}),qr=J({name:"looking-similar",connector:!0}),Ur=(Me=w(xe),w(kt)),Wr=w(It),Br=(Me=Object.freeze({__proto__:null,EXPERIMENTAL_connectAnswers:Me,EXPERIMENTAL_connectConfigureRelatedItems:Ur,EXPERIMENTAL_connectDynamicWidgets:Wr,connectDynamicWidgets:It,connectClearRefinements:Ft,connectCurrentRefinements:Lt,connectHierarchicalMenu:Bt,connectHits:Kt,connectHitsWithInsights:Ae,connectHitsPerPage:Cn,connectInfiniteHits:An,connectInfiniteHitsWithInsights:ke,connectMenu:Mn,connectNumericMenu:qn,connectPagination:Vn,connectRange:Jn,connectRefinementList:Yn,connectRelatedProducts:nr,connectSearchBox:ir,connectSortBy:ar,connectRatingMenu:or,connectStats:dr,connectToggleRefinement:hr,connectTrendingItems:pr,connectBreadcrumb:mr,connectGeoSearch:Pr,connectPoweredBy:xr,connectConfigure:Nt,connectAutocomplete:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_;return R(e,Cr()),function(r){var i=(r||{}).escapeHTML,a=void 0===i||i,o={};return{$$type:"ais.autocomplete",init:function(t){var r=t.instantSearchInstance;e(n(n({},this.getWidgetRenderState(t)),{},{instantSearchInstance:r}),!0)},render:function(t){var r=t.instantSearchInstance;(t=this.getWidgetRenderState(t)).indices.forEach((function(e){(0,e.sendEvent)("view:internal",e.hits)})),e(n(n({},t),{},{instantSearchInstance:r}),!1)},getRenderState:function(e,t){return n(n({},e),{},{autocomplete:this.getWidgetRenderState(t)})},getWidgetRenderState:function(e){var t=this,n=e.helper,i=e.state,s=e.scopedResults,c=e.instantSearchInstance;return o.refine||(o.refine=function(e){n.setQuery(e).search()}),e=s.map((function(e){e.results&&(e.results.hits=a?L(e.results.hits):e.results.hits);var n,r=B({instantSearchInstance:c,getIndex:function(){var t;return(null==(t=e.results)?void 0:t.index)||""},widgetType:t.$$type});return{indexId:e.indexId,indexName:(null==(n=e.results)?void 0:n.index)||"",hits:(null==(n=e.results)?void 0:n.hits)||[],results:e.results||{},sendEvent:r}})),{currentRefinement:i.query||"",indices:e,refine:o.refine,widgetParams:r}},getWidgetUiState:function(e,t){return""===(t=t.searchParameters.query||"")||e&&e.query===t?e:n(n({},e),{},{query:t})},getWidgetSearchParameters:function(e,t){return t={query:t.uiState.query||""},a?e.setQueryParameters(n(n({},t),I)):e.setQueryParameters(t)},dispose:function(e){return e=e.state,t(),e=e.setQueryParameter("query",void 0),a?e.setQueryParameters(Object.keys(I).reduce((function(e,t){return n(n({},e),{},s({},t,void 0))}),{})):e}}}},connectQueryRules:Tr,connectVoiceSearch:Ir,connectRelevantSort:Fr,connectFrequentlyBoughtTogether:Ar,connectLookingSimilar:Mr}),Lr("Highlight"));function $r(e){var t=e.attribute,n=void 0===(n=e.highlightedTagName)?"mark":n,r=e.hit;return e=void 0===(e=e.cssClasses)?{}:e,t=void 0===(r=(ie(r._highlightResult,t)||{}).value)?"":r,r=Br({descendantName:"highlighted"})+(e.highlighted?" ".concat(e.highlighted):""),t.replace(new RegExp(F.highlightPreTag,"g"),"<".concat(n,' class="').concat(r,'">')).replace(new RegExp(F.highlightPostTag,"g"),"</".concat(n,">"))}var Vr=Lr("ReverseHighlight");function Qr(e){var t=e.attribute,n=void 0===(n=e.highlightedTagName)?"mark":n,r=e.hit;return e=void 0===(e=e.cssClasses)?{}:e,t=void 0===(r=(ie(r._highlightResult,t)||{}).value)?"":r,r=Vr({descendantName:"highlighted"})+(e.highlighted?" ".concat(e.highlighted):""),H(Se(ne(t))).replace(new RegExp(F.highlightPreTag,"g"),"<".concat(n,' class="').concat(r,'">')).replace(new RegExp(F.highlightPostTag,"g"),"</".concat(n,">"))}var Kr=Lr("Snippet");function zr(e){var t=e.attribute,n=void 0===(n=e.highlightedTagName)?"mark":n,r=e.hit;return e=void 0===(e=e.cssClasses)?{}:e,t=void 0===(r=(ie(r._snippetResult,t)||{}).value)?"":r,r=Kr({descendantName:"highlighted"})+(e.highlighted?" ".concat(e.highlighted):""),t.replace(new RegExp(F.highlightPreTag,"g"),"<".concat(n,' class="').concat(r,'">')).replace(new RegExp(F.highlightPostTag,"g"),"</".concat(n,">"))}var Gr=Lr("ReverseSnippet");function Jr(e){var t=e.attribute,n=void 0===(n=e.highlightedTagName)?"mark":n,r=e.hit;return e=void 0===(e=e.cssClasses)?{}:e,t=void 0===(r=(ie(r._snippetResult,t)||{}).value)?"":r,r=Gr({descendantName:"highlighted"})+(e.highlighted?" ".concat(e.highlighted):""),H(Se(ne(t))).replace(new RegExp(F.highlightPreTag,"g"),"<".concat(n,' class="').concat(r,'">')).replace(new RegExp(F.highlightPostTag,"g"),"</".concat(n,">"))}var Yr=["page"];function Xr(e){return(e=e||{}).page,h(e,Yr)}var Zr="2.17.2",ei="https://cdn.jsdelivr.net/npm/search-insights@".concat(Zr,"/dist/search-insights.min.js");function ti(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=t.insightsClient,a=t.insightsInitParams,o=t.onEvent,s=void 0!==(e=t.$$internal)&&e,c=void 0!==(e=t.$$automatic)&&e,u=r,l=(r||null===r||Re((function(e){var t=e.window,n=t.AlgoliaAnalyticsObject||"aa";(u="string"==typeof n?t[n]:u)||(t.AlgoliaAnalyticsObject=n,t[n]||(t[n]=function(){t[n].queue||(t[n].queue=[]);for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];t[n].queue.push(r)},t[n].version=Zr,t[n].shouldAddScript=!0),u=t[n])})),u||_);return function(e){var t=e.instantSearchInstance;e=t.middleware.filter((function(e){return"ais.insights"===e.instance.$$type&&e.instance.$$internal})).map((function(e){return e.creator})),t.unuse.apply(t,v(e));var r,u,f,d,h=g((e=t.client).appId&&e.apiKey?[e.appId,e.apiKey]:e.transporter?(h=(r=e.transporter).headers||r.baseHeaders,r=r.queryParameters||r.baseQueryParameters,[h[u="x-algolia-application-id"]||r[u],h[u="x-algolia-api-key"]||r[u]]):[e.applicationID,e.apiKey],2),p=h[0],m=h[1],y=void 0,b=void 0,w=void 0,S=l.queue;return Array.isArray(S)&&(r=["setUserToken","init"].map((function(e){var t=X(S.slice().reverse(),(function(t){return g(t,1)[0]===e}))||[];return g(t,2)[1]})),u=g(r,2),b=u[0],y=u[1]),l("getUserToken",null,(function(e,t){w=ri(t)})),!a&&ni(l)||l("init",n({appId:p,apiKey:m,partial:!0},a)),{$$type:"ais.insights",$$internal:s,$$automatic:c,onStateChange:function(){},subscribe:function(){if(l.shouldAddScript){var e="[insights middleware]: could not load search-insights.js. Please load it manually following https://alg.li/insights-init";try{var n=document.createElement("script");n.async=!0,n.src=ei,n.onerror=function(){t.emit("error",new Error(e))},document.body.appendChild(n),l.shouldAddScript=!1}catch(n){l.shouldAddScript=!1,t.emit("error",new Error(e))}}},started:function(){l("addAlgoliaAgent","insights-middleware"),d=t.mainHelper;var e,r=l.queue,u=(Array.isArray(r)&&(e=["setUserToken","init"].map((function(e){var t=X(r.slice().reverse(),(function(t){return g(t,1)[0]===e}))||[];return g(t,2)[1]})),e=g(e,2),b=e[0],y=e[1]),S=(null==(S=(e=t)._initialResults)||null==(S=S[e.indexName])?void 0:S.state)||{},e=e.mainHelper.state,f={userToken:S.userToken||e.userToken,clickAnalytics:S.clickAnalytics||e.clickAnalytics},c||d.overrideStateWithoutTriggeringChangeEvent(n(n({},d.state),{},{clickAnalytics:!0})),s||t.scheduleSearch(),function(e){var r,i=1<arguments.length&&void 0!==arguments[1]&&arguments[1],a=ri(e);function o(){d.overrideStateWithoutTriggeringChangeEvent(n(n({},d.state),{},{userToken:a})),r&&r!==e&&t.scheduleSearch()}a&&(r=d.state.userToken,i?o():setTimeout(o,0))});function h(e){u(e,!0),l("setUserToken",e)}var v,_,S=void 0,R=(S=(R=function(){if("object"===("undefined"==typeof document?"undefined":i(document))&&"string"==typeof document.cookie)for(var e="".concat("_ALGOLIA","="),t=document.cookie.split(";"),n=0;n<t.length;n++){for(var r=t[n];" "===r.charAt(0);)r=r.substring(1);if(0===r.indexOf(e))return r.substring(e.length,r.length)}}())||"anonymous-".concat("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))),f.userToken),P=((v=null!=a&&a.userToken?a.userToken:v)?h(v):R?h(R):w?h(w):b?h(b):S&&(h(S),null!=a&&a.useCookie||null!=(v=y)&&v.useCookie)&&(R=S,S=(null==a?void 0:a.cookieDuration)||(null==(v=y)?void 0:v.cookieDuration),(v=new Date).setTime(v.getTime()+(S||15552e6)),S="expires=".concat(v.toUTCString()),document.cookie="_ALGOLIA=".concat(R,";").concat(S,";path=/")),l("onUserTokenChange",(function(e){return u(e,!0)}),{immediate:!0}),l),x=(ni(l)&&(P=function(e,t){return l(e,t,{headers:{"X-Algolia-Application-Id":p,"X-Algolia-API-Key":m}})}),new Set);t.mainHelper.derivedHelpers[0].on("result",(function(e){!(e=e.results)||e.queryID&&e.queryID===_||(_=e.queryID,x.clear())})),t.sendEventToInsights=function(e){if(o)o(e,P);else if(e.insightsMethod){if("viewedObjectIDs"===e.insightsMethod){var t=e.payload,n=t.objectIDs.filter((function(e){return!x.has(e)}));if(0===n.length)return;n.forEach((function(e){return x.add(e)})),t.objectIDs=n}e.payload.algoliaSource=["instantsearch"],c&&e.payload.algoliaSource.push("instantsearch-automatic"),"internal"===e.eventModifier&&e.payload.algoliaSource.push("instantsearch-internal"),P(e.insightsMethod,e.payload)}}},unsubscribe:function(){l("onUserTokenChange",void 0),t.sendEventToInsights=_,d&&f&&(d.overrideStateWithoutTriggeringChangeEvent(n(n({},d.state),f)),t.scheduleSearch())}}}}function ni(e){var t=(e=g((e.version||"").split(".").map(Number),2))[0];return e=e[1],3<=t||2===t&&6<=e||1===t&&10<=e}function ri(e){if(e)return"number"==typeof e?e.toString():e}function ii(){return Re((function(e){return-1<(null==(e=e.window.navigator)||null==(e=e.userAgent)?void 0:e.indexOf("Algolia Crawler"))}),{fallback:function(){return!1}})}function ai(){var e=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).$$internal,t=void 0!==e&&e;return function(e){var n=e.instantSearchInstance,r={widgets:[]},i=document.createElement("meta"),a=document.querySelector("head");return i.name="instantsearch:widgets",{$$type:"ais.metadata",$$internal:t,onStateChange:function(){},subscribe:function(){setTimeout((function(){var e=n.client;r.ua=e.transporter&&e.transporter.userAgent?e.transporter.userAgent.value:e._ua,function e(t,n,r){var i=_e(n,n.mainIndex,n._initialUiState);t.forEach((function(t){var a={},o=(t.getWidgetRenderState&&(o=t.getWidgetRenderState(i))&&o.widgetParams&&(a=o.widgetParams),Object.keys(a).filter((function(e){return void 0!==a[e]})));r.widgets.push({type:t.$$type,widgetType:t.$$widgetType,params:o}),"ais.index"===t.$$type&&e(t.getWidgets(),n,r)}))}(n.mainIndex.getWidgets(),n,r),n.middleware.forEach((function(e){return r.widgets.push({middleware:!0,type:e.instance.$$type,internal:e.instance.$$internal})})),i.content=JSON.stringify(r),a.appendChild(i)}),0)},started:function(){},unsubscribe:function(){i.remove()}}}}function oi(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n}function si(e,t,n,r,i,a,o,s,c,u,l,f,d,h){var p=e;if("function"==typeof o?p=o(t,p):p instanceof Date?p=u(p):"comma"===n&&yi(p)&&(p=mi.maybeMap(p,(function(e){return e instanceof Date?u(e):e}))),null===p){if(r)return a&&!d?a(t,Ri.encoder,h,"key",l):t;p=""}if(Pi(p)||mi.isBuffer(p)){if(a){if(e=d?t:a(t,Ri.encoder,h,"key",l),"comma"===n&&d){for(var m=bi.call(String(p),","),g="",v=0;v<m.length;++v)g+=(0===v?"":",")+f(a(m[v],Ri.encoder,h,"value",l));return[f(e)+"="+g]}return[f(e)+"="+f(a(p,Ri.encoder,h,"value",l))]}return[f(t)+"="+f(String(p))]}var y,b=[];if(void 0!==p){y="comma"===n&&yi(p)?[{value:0<p.length?p.join(",")||null:void 0}]:yi(o)?o:(e=Object.keys(p),s?e.sort(s):e);for(var _=0;_<y.length;++_){var w=y[_],S="object"==typeof w&&void 0!==w.value?w.value:p[w];i&&null===S||(w=yi(p)?"function"==typeof n?n(t,w):t:t+(c?"."+w:"["+w+"]"),wi(b,si(S,w,n,r,i,a,o,s,c,u,l,f,d,h)))}}return b}function ci(e){e&&(window.document.title=e)}var ui=String.prototype.replace,li=/%20/g,fi={default:Ur="RFC3986",formatters:{RFC1738:function(e){return ui.call(e,li,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:Ur},di=Object.prototype.hasOwnProperty,hi=Array.isArray,pi=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),mi={arrayToObject:oi,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],a=i.obj[i.prop],o=Object.keys(a),s=0;s<o.length;++s){var c=o[s],u=a[c];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:a,prop:c}),n.push(u))}for(var l=t;1<l.length;){var f=l.pop(),d=f.obj[f.prop];if(hi(d)){for(var h=[],p=0;p<d.length;++p)void 0!==d[p]&&h.push(d[p]);f.obj[f.prop]=h}}return e},decode:function(e,t,n){if(e=e.replace(/\+/g," "),"iso-8859-1"===n)return e.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(e)}catch(t){return e}},encode:function(e,t,n,r,i){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===n)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var o="",s=0;s<a.length;++s){var c=a.charCodeAt(s);45===c||46===c||95===c||126===c||48<=c&&c<=57||65<=c&&c<=90||97<=c&&c<=122||i===fi.RFC1738&&(40===c||41===c)?o+=a.charAt(s):c<128?o+=pi[c]:c<2048?o+=pi[192|c>>6]+pi[128|63&c]:c<55296||57344<=c?o+=pi[224|c>>12]+pi[128|c>>6&63]+pi[128|63&c]:(s+=1,c=65536+((1023&c)<<10|1023&a.charCodeAt(s)),o+=pi[240|c>>18]+pi[128|c>>12&63]+pi[128|c>>6&63]+pi[128|63&c])}return o},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(hi(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(hi(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!di.call(Object.prototype,n))&&(t[n]=!0)}return t}var i;return t&&"object"==typeof t?(hi(i=t)&&!hi(n)&&(i=oi(t,r)),hi(t)&&hi(n)?(n.forEach((function(n,i){var a;di.call(t,i)?(a=t[i])&&"object"==typeof a&&n&&"object"==typeof n?t[i]=e(a,n,r):t.push(n):t[i]=n})),t):Object.keys(n).reduce((function(t,i){var a=n[i];return di.call(t,i)?t[i]=e(t[i],a,r):t[i]=a,t}),i)):[t].concat(n)}},gi=Object.prototype.hasOwnProperty,vi={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},yi=Array.isArray,bi=String.prototype.split,_i=Array.prototype.push,wi=function(e,t){_i.apply(e,yi(t)?t:[t])},Si=Date.prototype.toISOString,Ri=(Wr=fi.default,{addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:mi.encode,encodeValuesOnly:!1,format:Wr,formatter:fi.formatters[Wr],indices:!1,serializeDate:function(e){return Si.call(e)},skipNulls:!1,strictNullHandling:!1}),Pi=function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"symbol"==typeof e||"bigint"==typeof e},xi=Object.prototype.hasOwnProperty,Oi=Array.isArray,Ei={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:mi.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Ci=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},Ni=function(e,t){return e&&"string"==typeof e&&t.comma&&-1<e.indexOf(",")?e.split(","):e},ji=function(e,t,n,r){for(var i=r?t:Ni(t,n),a=e.length-1;0<=a;--a){var o,s,c,u=e[a];"[]"===u&&n.parseArrays?o=[].concat(i):(o=n.plainObjects?Object.create(null):{},s="["===u.charAt(0)&&"]"===u.charAt(u.length-1)?u.slice(1,-1):u,c=parseInt(s,10),n.parseArrays||""!==s?!isNaN(c)&&u!==s&&String(c)===s&&0<=c&&n.parseArrays&&c<=n.arrayLimit?(o=[])[c]=i:"__proto__"!==s&&(o[s]=i):o={0:i}),i=o}return i},Ti={formats:fi,parse:function(e,t){var n=function(e){if(!e)return Ei;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=(void 0===e.charset?Ei:e).charset;return{allowDots:void 0===e.allowDots?Ei.allowDots:!!e.allowDots,allowPrototypes:("boolean"==typeof e.allowPrototypes?e:Ei).allowPrototypes,arrayLimit:("number"==typeof e.arrayLimit?e:Ei).arrayLimit,charset:t,charsetSentinel:("boolean"==typeof e.charsetSentinel?e:Ei).charsetSentinel,comma:("boolean"==typeof e.comma?e:Ei).comma,decoder:("function"==typeof e.decoder?e:Ei).decoder,delimiter:("string"==typeof e.delimiter||mi.isRegExp(e.delimiter)?e:Ei).delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:Ei.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:("boolean"==typeof e.interpretNumericEntities?e:Ei).interpretNumericEntities,parameterLimit:("number"==typeof e.parameterLimit?e:Ei).parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:("boolean"==typeof e.plainObjects?e:Ei).plainObjects,strictNullHandling:("boolean"==typeof e.strictNullHandling?e:Ei).strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var r="string"==typeof e?function(e,t){var n,r,i,a,o={},s=(e=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,t.parameterLimit===1/0?void 0:t.parameterLimit),c=e.split(t.delimiter,s),u=-1,l=t.charset;if(t.charsetSentinel)for(n=0;n<c.length;++n)0===c[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===c[n]?l="utf-8":"utf8=%26%2310003%3B"===c[n]&&(l="iso-8859-1"),u=n,n=c.length);for(n=0;n<c.length;++n)n!==u&&((a=-1===(a=-1===(a=(r=c[n]).indexOf("]="))?r.indexOf("="):a+1)?(i=t.decoder(r,Ei.decoder,l,"key"),t.strictNullHandling?null:""):(i=t.decoder(r.slice(0,a),Ei.decoder,l,"key"),mi.maybeMap(Ni(r.slice(a+1),t),(function(e){return t.decoder(e,Ei.decoder,l,"value")}))))&&t.interpretNumericEntities&&"iso-8859-1"===l&&(a=Ci(a)),-1<r.indexOf("[]=")&&(a=Oi(a)?[a]:a),xi.call(o,i)?o[i]=mi.combine(o[i],a):o[i]=a);return o}(e,n):e,i=n.plainObjects?Object.create(null):{},a=Object.keys(r),o=0;o<a.length;++o){var s=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,o=0<n.depth&&/(\[[^[\]]*])/.exec(i),s=[];if(e=o?i.slice(0,o.index):i){if(!n.plainObjects&&xi.call(Object.prototype,e)&&!n.allowPrototypes)return;s.push(e)}for(var c=0;0<n.depth&&null!==(o=a.exec(i))&&c<n.depth;){if(c+=1,!n.plainObjects&&xi.call(Object.prototype,o[1].slice(1,-1))&&!n.allowPrototypes)return;s.push(o[1])}return o&&s.push("["+i.slice(o.index)+"]"),ji(s,t,n,r)}}(s=a[o],r[s],n,"string"==typeof e);i=mi.merge(i,s,n)}return mi.compact(i)},stringify:function(e,t){var n=e,r=function(e){if(!e)return Ri;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||Ri.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=fi.default;if(void 0!==e.format){if(!gi.call(fi.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=fi.formatters[n],i=Ri.filter;return"function"!=typeof e.filter&&!yi(e.filter)||(i=e.filter),{addQueryPrefix:("boolean"==typeof e.addQueryPrefix?e:Ri).addQueryPrefix,allowDots:void 0===e.allowDots?Ri.allowDots:!!e.allowDots,charset:t,charsetSentinel:("boolean"==typeof e.charsetSentinel?e:Ri).charsetSentinel,delimiter:(void 0===e.delimiter?Ri:e).delimiter,encode:("boolean"==typeof e.encode?e:Ri).encode,encoder:("function"==typeof e.encoder?e:Ri).encoder,encodeValuesOnly:("boolean"==typeof e.encodeValuesOnly?e:Ri).encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:("function"==typeof e.serializeDate?e:Ri).serializeDate,skipNulls:("boolean"==typeof e.skipNulls?e:Ri).skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:("boolean"==typeof e.strictNullHandling?e:Ri).strictNullHandling}}(t),i=("function"==typeof r.filter?n=(0,r.filter)("",n):yi(r.filter)&&(o=r.filter),[]);if("object"!=typeof n||null===n)return"";e=t&&t.arrayFormat in vi?t.arrayFormat:t&&"indices"in t&&!t.indices?"repeat":"indices";var a=vi[e],o=o||Object.keys(n);r.sort&&o.sort(r.sort);for(var s=0;s<o.length;++s){var c=o[s];r.skipNulls&&null===n[c]||wi(i,si(n[c],c,a,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset))}return t=i.join(r.delimiter),e=!0===r.addQueryPrefix?"?":"",r.charsetSentinel&&("iso-8859-1"===r.charset?e+="utf8=%26%2310003%3B&":e+="utf8=%E2%9C%93&"),0<t.length?e+t:""}},ki=function(){function e(t){var n=this,r=t.windowTitle,i=void 0===(i=t.writeDelay)?400:i,o=t.createURL,c=t.parseURL,u=t.getLocation,l=t.start,f=t.dispose,d=t.push;t=t.cleanUrlOnDispose,a(this,e),s(this,"$$type","ais.browser"),s(this,"windowTitle",void 0),s(this,"writeDelay",void 0),s(this,"_createURL",void 0),s(this,"parseURL",void 0),s(this,"getLocation",void 0),s(this,"writeTimer",void 0),s(this,"_onPopState",void 0),s(this,"inPopState",!1),s(this,"isDisposed",!1),s(this,"latestAcknowledgedHistory",0),s(this,"_start",void 0),s(this,"_dispose",void 0),s(this,"_push",void 0),s(this,"_cleanUrlOnDispose",void 0),this.windowTitle=r,this.writeTimer=void 0,this.writeDelay=i,this._createURL=o,this.parseURL=c,this.getLocation=u,this._start=l,this._dispose=f,this._push=d,this._cleanUrlOnDispose=void 0===t||t,Re((function(e){e=e.window,ci(n.windowTitle&&n.windowTitle(n.read())),n.latestAcknowledgedHistory=e.history.length}))}return o(e,[{key:"read",value:function(){return this.parseURL({qsModule:Ti,location:this.getLocation()})}},{key:"write",value:function(e){var t=this;Re((function(n){var r=n.window,i=t.createURL(e),a=t.windowTitle&&t.windowTitle(e);t.writeTimer&&clearTimeout(t.writeTimer),t.writeTimer=setTimeout((function(){ci(a),t.shouldWrite(i)&&(t._push?t._push(i):r.history.pushState(e,a||"",i),t.latestAcknowledgedHistory=r.history.length),t.inPopState=!1,t.writeTimer=void 0}),t.writeDelay)}))}},{key:"onUpdate",value:function(e){var t=this;this._start&&this._start((function(){e(t.read())})),this._onPopState=function(){t.writeTimer&&(clearTimeout(t.writeTimer),t.writeTimer=void 0),t.inPopState=!0,e(t.read())},Re((function(e){e.window.addEventListener("popstate",t._onPopState)}))}},{key:"createURL",value:function(e){return this._createURL({qsModule:Ti,routeState:e,location:this.getLocation()})}},{key:"dispose",value:function(){var e=this;this._dispose&&this._dispose(),this.isDisposed=!0,Re((function(t){t=t.window,e._onPopState&&t.removeEventListener("popstate",e._onPopState)})),this.writeTimer&&clearTimeout(this.writeTimer),this._cleanUrlOnDispose&&this.write({})}},{key:"start",value:function(){this.isDisposed=!1}},{key:"shouldWrite",value:function(e){var t=this;return Re((function(n){var r;return n=n.window,!(t.isDisposed&&!t._cleanUrlOnDispose)&&(r=!(t.isDisposed&&t.latestAcknowledgedHistory!==n.history.length),!t.inPopState)&&r&&e!==n.location.href}))}}]),e}();function Ii(){var e=(c=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).createURL,t=c.parseURL,n=c.writeDelay,r=c.windowTitle,i=c.getLocation,a=c.start,o=c.dispose,s=c.push,c=c.cleanUrlOnDispose;return new ki({createURL:void 0===e?function(e){var t=e.qsModule,n=e.routeState,r=(e=e.location).protocol,i=e.hostname,a=void 0===(a=e.port)?"":a,o=e.pathname;return e=e.hash,t=t.stringify(n),n=""===a?"":":".concat(a),(t?"".concat(r,"//").concat(i).concat(n).concat(o,"?").concat(t):"".concat(r,"//").concat(i).concat(n).concat(o)).concat(e)}:e,parseURL:void 0===t?function(e){var t=e.qsModule;return e=e.location,t.parse(e.search.slice(1),{arrayLimit:99})}:t,writeDelay:void 0===n?400:n,windowTitle:r,getLocation:void 0===i?function(){return Re((function(e){return e.window.location}),{fallback:function(){throw new Error("You need to provide `getLocation` to the `history` router in environments where `window` does not exist.")}})}:i,start:a,dispose:o,push:s,cleanUrlOnDispose:c})}var Fi=["configure"];function Ai(e){return e.configure,h(e,Fi)}function Mi(){return{$$type:"ais.simple",stateToRoute:function(e){return Object.keys(e).reduce((function(t,r){return n(n({},t),{},s({},r,Ai(e[r])))}),{})},routeToState:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce((function(t,r){return n(n({},t),{},s({},r,Ai(e[r])))}),{})}}}function Li(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.router,r=void 0===t?Ii():t,i=void 0===(t=e.stateMapping)?Mi():t,a=void 0!==(t=e.$$internal)&&t;return function(e){var t=e.instantSearchInstance;t._createURL=function(e){var a=0===t.mainIndex.getWidgets().length?t._initialUiState:t.mainIndex.getWidgetUiState({});return a=Object.keys(e).reduce((function(t,r){return n(n({},t),{},s({},r,e[r]))}),a),a=i.stateToRoute(a),r.createURL(a)};var o=void 0,c=t._initialUiState;return{$$type:"ais.router({router:".concat(r.$$type||"__unknown__",", stateMapping:").concat(i.$$type||"__unknown__","})"),$$internal:a,onStateChange:function(e){e=e.uiState,e=i.stateToRoute(e),void 0!==o&&de(o,e)||(r.write(e),o=e)},subscribe:function(){t._initialUiState=n(n({},c),i.routeToState(r.read())),r.onUpdate((function(e){0<t.mainIndex.getWidgets().length&&t.setUiState(i.routeToState(e))}))},started:function(){var e;null!=(e=r.start)&&e.call(r)},unsubscribe:function(){r.dispose()}}}}var Hi=["initialSearchParameters"],Di=["initialRecommendParameters"],qi=J({name:"index-widget"});function Ui(e,t){var n=t.state,r=t.recommendState,i=t.isPageReset;t=t._uiState,n!==e.state&&(e.state=n,e.emit("change",{state:e.state,results:e.lastResults,isPageReset:i,_uiState:t})),r!==e.recommendState&&(e.recommendState=r)}function Wi(e,t,n){return e.reduce((function(e,n){return V(n)||!n.getWidgetUiState&&!n.getWidgetState?e:n.getWidgetUiState?n.getWidgetUiState(e,t):n.getWidgetState(e,t)}),2<arguments.length&&void 0!==n?n:{})}function Bi(e,t){var n=t.initialSearchParameters,r=h(t,Hi);return e.reduce((function(e,t){return!t.getWidgetSearchParameters||V(t)?e:"search"===t.dependsOn&&t.getWidgetParameters?t.getWidgetParameters(e,r):t.getWidgetSearchParameters(e,r)}),n)}function $i(e,t){var n=t.initialRecommendParameters,r=h(t,Di);return e.reduce((function(e,t){return!V(t)&&"recommend"===t.dependsOn&&t.getWidgetParameters?t.getWidgetParameters(e,r):e}),n)}function Vi(t){if(void 0===t||void 0===t.indexName)throw new Error(qi("The `indexName` option is required."));var r=t.indexName,i=void 0===(t=t.indexId)?r:t,a=[],o={},c=null,u=null,l=null,f=null,d=null,h=!1,p=!1;return{$$type:"ais.index",$$widgetType:"ais.index",getIndexName:function(){return r},getIndexId:function(){return i},getHelper:function(){return l},getResults:function(){var e;return null!=(e=f)&&e.lastResults?(f.lastResults._state=l.state,f.lastResults):null},getResultsForWidget:function(e){var t;return"recommend"!==e.dependsOn||V(e)||void 0===e.$$id?this.getResults():null!=(t=l)&&t.lastRecommendResults?l.lastRecommendResults[e.$$id]:null},getPreviousState:function(){return d},getScopedResults:function(){var e;return function e(t){return t.filter(V).reduce((function(t,n){return t.concat.apply(t,[{indexId:n.getIndexId(),results:n.getResults(),helper:n.getHelper()}].concat(v(e(n.getWidgets()))))}),[])}(e=(e=this.getParent())?e.getWidgets():0===r.length?this.getWidgets():[this])},getParent:function(){return u},createURL:function(e){return"function"==typeof e?c._createURL(s({},i,e(o))):c._createURL(s({},i,Wi(a,{searchParameters:e,helper:l})))},getWidgets:function(){return a},addWidgets:function(t){var n=this;if(!Array.isArray(t))throw new Error(qi("The `addWidgets` method expects an array of widgets."));if(t.some((function(e){return"function"!=typeof e.init&&"function"!=typeof e.render})))throw new Error(qi("The widget definition expects a `render` and/or an `init` method."));return t.forEach((function(t){V(t)||(c&&"recommend"===t.dependsOn?c._hasRecommendWidget=!0:c?c._hasSearchWidget=!0:"recommend"===t.dependsOn?h=!0:p=!0,"recommend"===t.dependsOn&&(t.$$id=e++))})),a=a.concat(t),c&&Boolean(t.length)&&(Ui(l,{state:Bi(a,{uiState:o,initialSearchParameters:l.state}),recommendState:$i(a,{uiState:o,initialRecommendParameters:l.recommendState}),_uiState:o}),t.forEach((function(e){e.getRenderState&&Qi({renderState:e.getRenderState(c.renderState[n.getIndexId()]||{},_e(c,n,c._initialUiState)),instantSearchInstance:c,parent:n})})),t.forEach((function(e){e.init&&e.init(_e(c,n,c._initialUiState))})),c.scheduleSearch()),this},removeWidgets:function(e){var t,n,r=this;if(!Array.isArray(e))throw new Error(qi("The `removeWidgets` method expects an array of widgets."));if(e.some((function(e){return"function"!=typeof e.dispose})))throw new Error(qi("The widget definition expects a `dispose` method."));return(a=a.filter((function(t){return-1===e.indexOf(t)}))).forEach((function(e){V(e)||(c&&"recommend"===e.dependsOn?c._hasRecommendWidget=!0:c?c._hasSearchWidget=!0:"recommend"===e.dependsOn?h=!0:p=!0)})),c&&Boolean(e.length)&&(n=(t=e.reduce((function(e,t){return(t=t.dispose({helper:l,state:e.cleanedSearchState,recommendState:e.cleanedRecommendState,parent:r}))instanceof Ot.RecommendParameters?e.cleanedRecommendState=t:t&&(e.cleanedSearchState=t),e}),{cleanedSearchState:l.state,cleanedRecommendState:l.recommendState})).cleanedSearchState,t=t.cleanedRecommendState,n=c.future.preserveSharedStateOnUnmount?Bi(a,{uiState:o,initialSearchParameters:new Ot.SearchParameters({index:this.getIndexName()})}):Bi(a,{uiState:Wi(a,{searchParameters:n,helper:l}),initialSearchParameters:n}),o=Wi(a,{searchParameters:n,helper:l}),l.setState(n),l.recommendState=t,a.length)&&c.scheduleSearch(),this},init:function(e){var t,n=this,s=e.instantSearchInstance,m=e.parent,g=e.uiState;null===l&&(c=s,u=m,o=g[i]||{},t=s.mainHelper,e=Bi(a,{uiState:o,initialSearchParameters:new Ot.SearchParameters({index:r})}),m=$i(a,{uiState:o,initialRecommendParameters:new Ot.RecommendParameters}),(l=Ot({},e.index,e)).recommendState=m,l.search=function(){return s.onStateChange?(s.onStateChange({uiState:s.mainIndex.getWidgetUiState({}),setUiState:function(e){return s.setUiState(e,!1)}}),t):t.search()},l.searchWithoutTriggeringOnStateChange=function(){return t.search()},l.searchForFacetValues=function(e,n,r,i){return i=l.state.setQueryParameters(i),t.searchForFacetValues(e,n,r,i)},f=t.derive((function(){return ve.apply(void 0,[t.state].concat(v(function(e){for(var t=e.getParent(),n=[e.getHelper().state];null!==t;)n=[t.getHelper().state].concat(n),t=t.getParent();return n}(n))))}),(function(){return n.getHelper().recommendState})),null!=(m=null==(e=s._initialResults)?void 0:e[this.getIndexId()])&&m.results&&(e=new Ot.SearchResults(new Ot.SearchParameters(m.state),m.results),f.lastResults=e,l.lastResults=e),null!=m&&m.recommendResults&&(e=new Ot.RecommendResults(new Ot.RecommendParameters({params:m.recommendResults.params}),m.recommendResults.results),f.lastRecommendResults=e,l.lastRecommendResults=e),l.on("change",(function(e){e.isPageReset&&function e(t){0!==(t=t.filter(V)).length&&t.forEach((function(t){var n=t.getHelper();Ui(n,{state:n.state.resetPage(),recommendState:n.recommendState,isPageReset:!0}),e(t.getWidgets())}))}(a)})),f.on("search",(function(){s.scheduleStalledRender()})),f.on("result",(function(e){e=e.results,s.scheduleRender(),l.lastResults=e,d=null==e?void 0:e._state})),f.on("recommend:result",(function(e){e=e.recommend,s.scheduleRender(),l.lastRecommendResults=e.results})),a.forEach((function(e){e.getRenderState&&Qi({renderState:e.getRenderState(s.renderState[n.getIndexId()]||{},_e(s,n,g)),instantSearchInstance:s,parent:n})})),a.forEach((function(e){e.init&&e.init(_e(s,n,g))})),l.on("change",(function(e){var t=e.state;e=e._uiState,o=Wi(a,{searchParameters:t,helper:l},e||{}),s.onStateChange||s.onInternalStateChange()})),m&&s.scheduleRender(),h&&(s._hasRecommendWidget=!0),p)&&(s._hasSearchWidget=!0)},render:function(e){var t=this,n=e.instantSearchInstance;(e=("error"===n.status&&!n.mainHelper.hasPendingRequests()&&d&&l.setState(d),e=this.getResults()||null!=(e=f)&&e.lastRecommendResults?a:a.filter(V)).filter((function(e){return!e.shouldRender||e.shouldRender({instantSearchInstance:n})}))).forEach((function(e){e.getRenderState&&Qi({renderState:e.getRenderState(n.renderState[t.getIndexId()]||{},we(n,t,e)),instantSearchInstance:n,parent:t})})),e.forEach((function(e){e.render&&e.render(we(n,t,e))}))},dispose:function(){var e,t=this;a.forEach((function(e){e.dispose&&l&&e.dispose({helper:l,state:l.state,recommendState:l.recommendState,parent:t})})),(u=c=null)!=(e=l)&&e.removeAllListeners(),(l=null)!=(e=f)&&e.detach(),f=null},getWidgetUiState:function(e){return a.filter(V).reduce((function(e,t){return t.getWidgetUiState(e)}),n(n({},e),{},s({},i,n(n({},e[i]),o))))},getWidgetState:function(e){return this.getWidgetUiState(e)},getWidgetSearchParameters:function(e,t){return t=t.uiState,Bi(a,{uiState:t,initialSearchParameters:e})},refreshUiState:function(){o=Wi(a,{searchParameters:this.getHelper().state,helper:this.getHelper()},o)},setIndexUiState:function(e){var t="function"==typeof e?e(o):e;c.setUiState((function(e){return n(n({},e),{},s({},i,t))}))}}}function Qi(e){var t=e.renderState,r=e.instantSearchInstance;e=((e=e.parent)||r.mainIndex).getIndexId(),r.renderState=n(n({},r.renderState),{},s({},e,n(n({},r.renderState[e]),t)))}function Ki(e,t){return e.toLocaleString(t)}var zi=J({name:"instantsearch"});function Gi(){return"#"}var Ji={preserveSharedStateOnUnmount:!1,persistHierarchicalRootCount:!1},Yi=function(){u(t,Ce);var e=m(t);function t(r){a(this,t),s(p(i=e.call(this)),"client",void 0),s(p(i),"indexName",void 0),s(p(i),"compositionID",void 0),s(p(i),"insightsClient",void 0),s(p(i),"onStateChange",null),s(p(i),"future",void 0),s(p(i),"helper",void 0),s(p(i),"mainHelper",void 0),s(p(i),"mainIndex",void 0),s(p(i),"started",void 0),s(p(i),"templatesConfig",void 0),s(p(i),"renderState",{}),s(p(i),"_stalledSearchDelay",void 0),s(p(i),"_searchStalledTimer",void 0),s(p(i),"_initialUiState",void 0),s(p(i),"_initialResults",void 0),s(p(i),"_createURL",void 0),s(p(i),"_searchFunction",void 0),s(p(i),"_mainHelperSearch",void 0),s(p(i),"_hasSearchWidget",!1),s(p(i),"_hasRecommendWidget",!1),s(p(i),"_insights",void 0),s(p(i),"middleware",[]),s(p(i),"sendEventToInsights",void 0),s(p(i),"status","idle"),s(p(i),"error",void 0),s(p(i),"scheduleSearch",G((function(){i.started&&i.mainHelper.search()}))),s(p(i),"scheduleRender",G((function(){var e,t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];null!=(e=i.mainHelper)&&e.hasPendingRequests()||(clearTimeout(i._searchStalledTimer),i._searchStalledTimer=null,t&&(i.status="idle",i.error=void 0)),i.mainIndex.render({instantSearchInstance:p(i)}),i.emit("render")}))),s(p(i),"onInternalStateChange",G((function(){var e=i.mainIndex.getWidgetUiState({});i.middleware.forEach((function(t){t.instance.onStateChange({uiState:e})}))}))),i.setMaxListeners(100);var i,o,c=void 0===(c=r.indexName)?"":c,u=r.compositionID,l=r.numberLocale,f=void 0===(f=r.initialUiState)?{}:f,d=void 0===(d=r.routing)?null:d,h=void 0===(h=r.insights)?void 0:h,m=r.searchFunction,g=void 0===(g=r.stalledSearchDelay)?200:g,v=void 0===(v=r.searchClient)?null:v,y=void 0===(y=r.insightsClient)?null:y,b=void 0===(b=r.onStateChange)?null:b,w=r.future;if(r=void 0===w?n(n({},Ji),r.future||{}):w,null===v)throw new Error(zi("The `searchClient` option is required."));if("function"!=typeof v.search)throw new Error("The `searchClient` must implement a `search` method.\n\nSee: https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-instantsearch/js/");if("function"==typeof v.addAlgoliaAgent&&v.addAlgoliaAgent("instantsearch.js (".concat("4.77.3",")")),y&&"function"!=typeof y)throw new Error(zi("The `insightsClient` option should be a function."));return i.client=v,i.future=r,i.insightsClient=y,i.indexName=c,i.compositionID=u,i.helper=null,i.mainHelper=null,i.mainIndex=Vi({indexName:i.compositionID||i.indexName}),i.onStateChange=b,i.started=!1,i.templatesConfig={helpers:(o=l,{formatNumber:function(e,t){return Ki(Number(t(e)),o)},highlight:function(e,t){try{return t($r(n(n({},JSON.parse(e)),{},{hit:this})))}catch(e){throw new Error('\nThe highlight helper expects a JSON object of the format:\n{ "attribute": "name", "highlightedTagName": "mark" }')}},reverseHighlight:function(e,t){try{return t(Qr(n(n({},JSON.parse(e)),{},{hit:this})))}catch(e){throw new Error('\n The reverseHighlight helper expects a JSON object of the format:\n { "attribute": "name", "highlightedTagName": "mark" }')}},snippet:function(e,t){try{return t(zr(n(n({},JSON.parse(e)),{},{hit:this})))}catch(e){throw new Error('\nThe snippet helper expects a JSON object of the format:\n{ "attribute": "name", "highlightedTagName": "mark" }')}},reverseSnippet:function(e,t){try{return t(Jr(n(n({},JSON.parse(e)),{},{hit:this})))}catch(e){throw new Error('\n The reverseSnippet helper expects a JSON object of the format:\n { "attribute": "name", "highlightedTagName": "mark" }')}},insights:function(e,t){try{var r=JSON.parse(e),i=r.method,a=r.payload;return t(xn(i,n({objectIDs:[this.objectID]},a)))}catch(e){throw new Error('\nThe insights helper expects a JSON object of the format:\n{ "method": "method-name", "payload": { "eventName": "name of the event" } }')}}}),compileOptions:{}},i._stalledSearchDelay=g,i._searchStalledTimer=null,i._createURL=Gi,i._initialUiState=f,i._initialResults=null,i._insights=h,m&&(i._searchFunction=m),i.sendEventToInsights=_,d&&((w="boolean"==typeof d?{}:d).$$internal=!0,i.use(Li(w))),h&&((v="boolean"==typeof h?{}:h).$$internal=!0,i.use(ti(v))),ii()&&i.use(ai({$$internal:!0})),i}return o(t,[{key:"_isSearchStalled",get:function(){return"stalled"===this.status}},{key:"use",value:function(){for(var e=this,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var a=r.map((function(t){var r=n({$$type:"__unknown__",$$internal:!1,subscribe:_,started:_,unsubscribe:_,onStateChange:_},t({instantSearchInstance:e}));return e.middleware.push({creator:t,instance:r}),r}));return this.started&&a.forEach((function(e){e.subscribe(),e.started()})),this}},{key:"unuse",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.middleware.filter((function(e){return t.includes(e.creator)})).forEach((function(e){return e.instance.unsubscribe()})),this.middleware=this.middleware.filter((function(e){return!t.includes(e.creator)})),this}},{key:"EXPERIMENTAL_use",value:function(){return this.use.apply(this,arguments)}},{key:"addWidget",value:function(e){return this.addWidgets([e])}},{key:"addWidgets",value:function(e){if(!Array.isArray(e))throw new Error(zi("The `addWidgets` method expects an array of widgets. Please use `addWidget`."));if(e.some((function(e){return"function"!=typeof e.init&&"function"!=typeof e.render})))throw new Error(zi("The widget definition expects a `render` and/or an `init` method."));if(this.compositionID&&e.some(V))throw new Error(zi("The `index` widget cannot be used with a composition-based InstantSearch implementation."));return this.mainIndex.addWidgets(e),this}},{key:"removeWidget",value:function(e){return this.removeWidgets([e])}},{key:"removeWidgets",value:function(e){if(!Array.isArray(e))throw new Error(zi("The `removeWidgets` method expects an array of widgets. Please use `removeWidget`."));if(e.some((function(e){return"function"!=typeof e.dispose})))throw new Error(zi("The widget definition expects a `dispose` method."));return this.mainIndex.removeWidgets(e),this}},{key:"start",value:function(){var e=this;if(this.started)throw new Error(zi("The `start` method has already been called once."));var t,r,i,a,o,c=this.mainHelper||Ot(this.client,this.indexName,void 0,{persistHierarchicalRootCount:this.future.persistHierarchicalRootCount});this.compositionID&&(c.searchForFacetValues=c.searchForCompositionFacetValues.bind(c)),c.search=function(){return e.status="loading",e.scheduleRender(!1),e._hasSearchWidget&&(e.compositionID?c.searchWithComposition():c.searchOnlyWithDerivedHelpers()),e._hasRecommendWidget&&c.recommend(),c},this._searchFunction&&(t={search:function(){return new Promise(_)}},this._mainHelperSearch=c.search.bind(c),c.search=function(){var n=e.mainIndex.getHelper(),r=Ot(t,n.state.index,n.state);return r.once("search",(function(t){t=t.state,n.overrideStateWithoutTriggeringChangeEvent(t),e._mainHelperSearch()})),r.on("change",(function(e){e=e.state,n.setState(e)})),e._searchFunction(r),c}),c.on("error",(function(t){var n;(t=t.error)instanceof Error||(n=t,t=Object.keys(n).reduce((function(e,t){return e[t]=n[t],e}),new Error(n.message))),t.error=t,e.error=t,e.status="error",e.scheduleRender(!1),e.emit("error",t)})),this.mainHelper=c,this.middleware.forEach((function(e){e.instance.subscribe()})),this.mainIndex.init({instantSearchInstance:this,parent:null,uiState:this._initialUiState}),this._initialResults?(function(e,t){var r,i,a;t&&("transporter"in e&&!e._cacheHydrated||e._useCache&&"function"==typeof e.addAlgoliaAgent)&&(r=[Object.keys(t).reduce((function(e,r){var i=(r=t[r]).state,a=r.requestParams;return r=(r=r.results)&&i?r.map((function(e,t){return n({indexName:i.index||e.index},null!=a&&a[t]||e.params?{params:le((null==a?void 0:a[t])||e.params.split("&").reduce((function(e,t){var n=(t=g(t.split("="),2))[0];return t=t[1],e[n]=t?decodeURIComponent(t):"",e}),{}))}:{})})):[],e.concat(r)}),[])],a=Object.keys(t).reduce((function(e,n){return(n=t[n].results)?e.concat(n):e}),[]),"transporter"in e&&!e._cacheHydrated&&(e._cacheHydrated=!0,i=e.search.bind(e),e.search=function(t){for(var r=arguments.length,a=new Array(1<r?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];var s=Array.isArray(t)?t.map((function(e){return n(n({},e),{},{params:le(e.params)})})):le(t.requestBody.params);return e.transporter.responsesCache.get({method:"search",args:[s].concat(a)},(function(){return i.apply(void 0,[t].concat(a))}))},e.transporter.responsesCache.set({method:"search",args:r},{results:a})),"transporter"in e||(a="/1/indexes/*/queries_body_".concat(JSON.stringify({requests:r})),e.cache=n(n({},e.cache),{},s({},a,JSON.stringify({results:Object.keys(t).map((function(e){return t[e].results}))})))))}(this.client,this._initialResults),i=this.mainHelper,a=this._initialResults,o=Object.keys(a).reduce((function(e,t){return(t=a[t]).recommendResults?n(n({},e),t.recommendResults.results):e}),{}),i._recommendCache=o,r=this.scheduleSearch,this.scheduleSearch=G(_),G((function(){e.scheduleSearch=r}))()):0<this.mainIndex.getWidgets().length&&this.scheduleSearch(),this.helper=this.mainIndex.getHelper(),this.started=!0,this.middleware.forEach((function(e){e.instance.started()})),void 0===this._insights&&c.derivedHelpers[0].once("result",(function(){e.mainIndex.getScopedResults().some((function(e){return null==(e=e.results)?void 0:e._automaticInsights}))&&e.use(ti({$$internal:!0,$$automatic:!0}))}))}},{key:"dispose",value:function(){var e;this.scheduleSearch.cancel(),this.scheduleRender.cancel(),clearTimeout(this._searchStalledTimer),this.removeWidgets(this.mainIndex.getWidgets()),this.mainIndex.dispose(),this.started=!1,this.removeAllListeners(),null!=(e=this.mainHelper)&&e.removeAllListeners(),this.mainHelper=null,this.helper=null,this.middleware.forEach((function(e){e.instance.unsubscribe()}))}},{key:"scheduleStalledRender",value:function(){var e=this;this._searchStalledTimer||(this._searchStalledTimer=setTimeout((function(){e.status="stalled",e.scheduleRender()}),this._stalledSearchDelay))}},{key:"setUiState",value:function(e){var t=this,n=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];if(!this.mainHelper)throw new Error(zi("The `start` method needs to be called before `setUiState`."));this.mainIndex.refreshUiState();var r="function"==typeof e?e(this.mainIndex.getWidgetUiState({})):e;this.onStateChange&&n?this.onStateChange({uiState:r,setUiState:function(e){Q("function"==typeof e?e(r):e,t.mainIndex),t.scheduleSearch(),t.onInternalStateChange()}}):(Q(r,this.mainIndex),this.scheduleSearch(),this.onInternalStateChange())}},{key:"getUiState",value:function(){return this.started&&this.mainIndex.refreshUiState(),this.mainIndex.getWidgetUiState({})}},{key:"createURL",value:function(){if(this.started)return this._createURL(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});throw new Error(zi("The `start` method needs to be called before `createURL`."))}},{key:"refresh",value:function(){if(!this.mainHelper)throw new Error(zi("The `start` method needs to be called before `refresh`."));this.mainHelper.clearCache().search()}}]),t}(),Xi=(Ae=Object.freeze({__proto__:null,history:Ii}),["configure"]);function Zi(e){return e.configure,h(e,Xi)}ke=Object.freeze({__proto__:null,simple:Mi,singleIndex:function(e){return{$$type:"ais.singleIndex",stateToRoute:function(t){return Zi(t[e]||{})},routeToState:function(){return s({},e,Zi(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}))}}}}),Ur=Object.freeze({__proto__:null,createInsightsMiddleware:ti,createRouterMiddleware:Li,isMetadataEnabled:ii,createMetadataMiddleware:ai});var ea=function(e,t,n,r){t[0]=0;for(var i=1;i<t.length;i++){var a=t[i++],o=t[i]?(t[0]|=a?1:2,n[t[i++]]):t[++i];3===a?r[0]=o:4===a?r[1]=Object.assign(r[1]||{},o):5===a?(r[1]=r[1]||{})[t[++i]]=o:6===a?r[1][t[++i]]+=o+"":a?(a=e.apply(o,ea(e,o,n,["",null])),r.push(a),o[0]?t[0]|=2:(t[i-2]=0,t[i]=a)):r.push(o)}return r},ta=new Map,na=function(e){var t=ta.get(this);return t||(t=new Map,ta.set(this,t)),1<(t=ea(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,i="",a="",o=[0],s=function(e){1===r&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?o.push(0,e,i):3===r&&(e||i)?(o.push(3,e,i),r=2):2===r&&"..."===i&&e?o.push(4,e,0):2===r&&i&&!e?o.push(5,0,!0,i):5<=r&&((i||!e&&5===r)&&(o.push(r,0,i,n),r=6),e)&&(o.push(r,e,0,n),r=6),i=""},c=0;c<e.length;c++){c&&(1===r&&s(),s(c));for(var u=0;u<e[c].length;u++)t=e[c][u],1===r?"<"===t?(s(),o=[o],r=3):i+=t:4===r?i="--"===i&&">"===t?(r=1,""):t+i[0]:a?t===a?a="":i+=t:'"'===t||"'"===t?a=t:">"===t?(s(),r=1):r&&("="===t?(r=5,n=i,i=""):"/"===t&&(r<5||">"===e[c][u+1])?(s(),3===r&&(o=o[0]),(o=(r=o)[0]).push(2,0,r),r=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(s(),r=2):i+=t),3===r&&"!--"===i&&(r=4,o=o[0])}return s(),o}(e)),t),arguments,[])).length?t:t[0]}.bind(sn);function ra(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ia(e,t){return e(t={exports:{}},t.exports),t.exports}var aa=ra(ia((function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}))),oa=ia((function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})),sa=(ra(oa),ia((function(e){var t=oa.default;e.exports=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===n?String:Number)(e);if(r=r.call(e,n||"default"),"object"!==t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")},e.exports.__esModule=!0,e.exports.default=e.exports}))),ca=(ra(sa),ia((function(e){var t=oa.default;e.exports=function(e){return e=sa(e,"string"),"symbol"===t(e)?e:String(e)},e.exports.__esModule=!0,e.exports.default=e.exports}))),ua=(ra(ca),Wr=ia((function(e){e.exports=function(e,t,n){return(t=ca(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports})),ra(Wr)),la=ia((function(e){e.exports=function(e,t){if(null==e)return{};for(var n,r={},i=Object.keys(e),a=0;a<i.length;a++)n=i[a],0<=t.indexOf(n)||(r[n]=e[n]);return r},e.exports.__esModule=!0,e.exports.default=e.exports})),fa=(ra(la),Wr=ia((function(e){e.exports=function(e,t){if(null==e)return{};var n,r=la(e,t);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(e),a=0;a<i.length;a++)n=i[a],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r},e.exports.__esModule=!0,e.exports.default=e.exports})),ra(Wr));function da(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((function(e,t){return Array.isArray(t)?e.concat(t):e.concat([t])}),[]).filter(Boolean).join(" ")}function ha(e){var t=e.createElement,n=e.Fragment;return function(){return t(n,null,"No results")}}function pa(e){var t=e.createElement;return function(e){var n=e.classNames,r=e.items;return e=e.translations,!r||r.length<1||!e.title?null:t("h3",{className:(void 0===n?{}:n).title},e.title)}}function ma(e){var t=e.createElement,n=e.Fragment;return function(e){return t(n,null,JSON.stringify(e.item,null,2))}}function ga(e){var t=e.createElement;return function(e){var n=void 0===(i=e.classNames)?{}:i,r=e.itemComponent,i=e.items,a=e.sendEvent;return t("div",{className:n.container},t("ol",{className:n.list},i.map((function(e){return t("li",{key:e.objectID,className:n.item,onClick:function(){a("click:internal",e,"Item Clicked")},onAuxClick:function(){a("click:internal",e,"Item Clicked")}},t(r,{item:e,sendEvent:a}))}))))}}var va=["listRef","nextButtonRef","previousButtonRef","carouselIdRef","classNames","itemComponent","previousIconComponent","nextIconComponent","items","translations","sendEvent"];function ya(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}var ba=0;function _a(e){return(e=e.createElement)("svg",{width:"8",height:"16",viewBox:"0 0 8 16",fill:"none"},e("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor",d:"M7.13809 0.744078C7.39844 1.06951 7.39844 1.59715 7.13809 1.92259L2.27616 8L7.13809 14.0774C7.39844 14.4028 7.39844 14.9305 7.13809 15.2559C6.87774 15.5814 6.45563 15.5814 6.19528 15.2559L0.861949 8.58926C0.6016 8.26382 0.6016 7.73618 0.861949 7.41074L6.19528 0.744078C6.45563 0.418641 6.87774 0.418641 7.13809 0.744078Z"}))}function wa(e){return(e=e.createElement)("svg",{width:"8",height:"16",viewBox:"0 0 8 16",fill:"none"},e("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor",d:"M0.861908 15.2559C0.601559 14.9305 0.601559 14.4028 0.861908 14.0774L5.72384 8L0.861908 1.92259C0.601559 1.59715 0.601559 1.06952 0.861908 0.744079C1.12226 0.418642 1.54437 0.418642 1.80472 0.744079L7.13805 7.41074C7.3984 7.73618 7.3984 8.26382 7.13805 8.58926L1.80472 15.2559C1.54437 15.5814 1.12226 15.5814 0.861908 15.2559Z"}))}var Sa=["classNames","emptyComponent","headerComponent","itemComponent","layout","items","status","translations","sendEvent"];function Ra(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}var Pa=["parts","highlightedTagName","nonHighlightedTagName","separator","className","classNames"],xa=["classNames","hits","itemComponent","sendEvent","emptyComponent","banner","bannerComponent"],Oa=["classNames","emptyComponent","headerComponent","itemComponent","layout","items","status","translations","sendEvent"];function Ea(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}var Ca=["classNames","emptyComponent","headerComponent","itemComponent","layout","items","status","translations","sendEvent"];function Na(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}var ja=["classNames","emptyComponent","headerComponent","itemComponent","layout","items","status","translations","sendEvent"];function Ta(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}var ka,Ia,Fa,Aa,Ma=0,La=[],Ha=[],Da=Yt.__b,qa=Yt.__r,Ua=Yt.diffed,Wa=Yt.__c,Ba=Yt.unmount;function $a(e,t){return Yt.__h&&Yt.__h(Ia,e,Ma||t),Ma=0,e>=(t=Ia.__H||(Ia.__H={__:[],__h:[]})).__.length&&t.__.push({__V:Ha}),t.__[e]}function Va(e){Ma=1;var t,n=Xa,r=$a(ka++,2);return r.t=n,r.__c||(r.__=[Xa(void 0,e),function(e){var t=(r.__N||r.__)[0];t!==(e=r.t(t,e))&&(r.__N=[e,r.__[1]],r.__c.setState({}))}],(r.__c=Ia).u)||(Ia.u=!0,t=Ia.shouldComponentUpdate,Ia.shouldComponentUpdate=function(e,n,i){var a,o;return!r.__c.__H||((a=r.__c.__H.__.filter((function(e){return e.__c}))).every((function(e){return!e.__N}))||(o=!1,a.forEach((function(e){var t;e.__N&&(t=e.__[0],e.__=e.__N,e.__N=void 0,t!==e.__[0])&&(o=!0)})),!!o))&&(!t||t.call(this,e,n,i))}),r.__N||r.__}function Qa(e){return Ma=5,t=function(){return{current:e}},n=[],Ya((r=$a(ka++,7)).__H,n)?(r.__V=t(),r.i=n,r.__h=t,r.__V):r.__;var t,n,r}function Ka(){for(var e;e=La.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ga),e.__H.__h.forEach(Ja),e.__H.__h=[]}catch(t){e.__H.__h=[],Yt.__e(t,e.__v)}}Yt.__b=function(e){"function"!=typeof e.type||e.o||e.type===un?e.o||(e.o=e.__&&e.__.o?e.__.o:""):e.o=(e.__&&e.__.o?e.__.o:"")+(e.__&&e.__.__k?e.__.__k.indexOf(e):0),Ia=null,Da&&Da(e)},Yt.__r=function(e){qa&&qa(e),ka=0,(e=(Ia=e.__c).__H)&&(Fa===Ia?(e.__h=[],Ia.__h=[],e.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Ha,e.__N=e.i=void 0}))):(e.__h.forEach(Ga),e.__h.forEach(Ja),e.__h=[])),Fa=Ia},Yt.diffed=function(e){Ua&&Ua(e),(e=e.__c)&&e.__H&&(!e.__H.__h.length||1!==La.push(e)&&Aa===Yt.requestAnimationFrame||((Aa=Yt.requestAnimationFrame)||function(e){function t(){clearTimeout(r),za&&cancelAnimationFrame(n),setTimeout(e)}var n,r=setTimeout(t,100);za&&(n=requestAnimationFrame(t))})(Ka),e.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Ha&&(e.__=e.__V),e.i=void 0,e.__V=Ha}))),Fa=Ia=null},Yt.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Ga),e.__h=e.__h.filter((function(e){return!e.__||Ja(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Yt.__e(n,e.__v)}})),Wa&&Wa(e,t)},Yt.unmount=function(e){var t;Ba&&Ba(e),(e=e.__c)&&e.__H&&(e.__H.__.forEach((function(e){try{Ga(e)}catch(e){t=e}})),e.__H=void 0,t)&&Yt.__e(t,e.__v)};var za="function"==typeof requestAnimationFrame;function Ga(e){var t=Ia,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Ia=t}function Ja(e){var t=Ia;e.__c=e.__(),Ia=t}function Ya(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Xa(e,t){return"function"==typeof t?t(e):t}Za=(Wr={createElement:sn,Fragment:un}).createElement,eo=Wr.Fragment;var Za,eo,to=function(e){var t=e.listRef,n=e.nextButtonRef,r=e.previousButtonRef,i=e.carouselIdRef,a=void 0===(a=e.classNames)?{}:a,o=void 0===(s=e.itemComponent)?ma({createElement:Za,Fragment:eo}):s,s=void 0===(s=e.previousIconComponent)?_a:s,c=void 0===(c=e.nextIconComponent)?wa:c,u=e.items,l=e.translations,f=e.sendEvent,d=(e=fa(e,va),l=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ya(Object(n),!0).forEach((function(t){ua(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ya(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({listLabel:"Items",nextButtonLabel:"Next",nextButtonTitle:"Next",previousButtonLabel:"Previous",previousButtonTitle:"Previous"},l),{root:da("ais-Carousel",a.root),list:da("ais-Carousel-list",a.list),item:da("ais-Carousel-item",a.item),navigation:da("ais-Carousel-navigation",a.navigation),navigationNext:da("ais-Carousel-navigation--next",a.navigationNext),navigationPrevious:da("ais-Carousel-navigation--previous",a.navigationPrevious)});function h(){t.current&&(t.current.scrollLeft-=.75*t.current.offsetWidth)}function p(){t.current&&(t.current.scrollLeft+=.75*t.current.offsetWidth)}return 0===u.length?null:Za("div",aa({},e,{className:da(d.root)}),Za("button",{ref:r,title:l.previousButtonTitle,"aria-label":l.previousButtonLabel,hidden:!0,"aria-controls":i.current,className:da(d.navigation,d.navigationPrevious),onClick:function(e){e.preventDefault(),h()}},Za(s,{createElement:Za})),Za("ol",{className:da(d.list),ref:t,tabIndex:0,id:i.current,"aria-roledescription":"carousel","aria-label":l.listLabel,"aria-live":"polite",onScroll:function(){t.current&&r.current&&n.current&&(r.current.hidden=t.current.scrollLeft<=0,n.current.hidden=t.current.scrollLeft+t.current.clientWidth>=t.current.scrollWidth)},onKeyDown:function(e){"ArrowLeft"===e.key?(e.preventDefault(),h()):"ArrowRight"===e.key&&(e.preventDefault(),p())}},u.map((function(e,t){return Za("li",{key:e.objectID,className:da(d.item),"aria-roledescription":"slide","aria-label":"".concat(t+1," of ").concat(u.length),onClick:function(){f("click:internal",e,"Item Clicked")},onAuxClick:function(){f("click:internal",e,"Item Clicked")}},Za(o,{item:e,sendEvent:f}))}))),Za("button",{ref:n,title:l.nextButtonTitle,"aria-label":l.nextButtonLabel,"aria-controls":i.current,className:da(d.navigation,d.navigationNext),onClick:function(e){e.preventDefault(),p()}},Za(c,{createElement:Za})))};function no(e){var t={listRef:Qa(null),nextButtonRef:Qa(null),previousButtonRef:Qa(null),carouselIdRef:Qa("ais-Carousel-".concat(ba++))};return sn(to,c({},t,e))}function ro(e){var t=e.defaultTemplates,r=e.templates;return n({templatesConfig:e.templatesConfig},function(e,t){var n=1<arguments.length&&void 0!==t?t:{};return me([].concat(v(Object.keys(e||{})),v(Object.keys(n)))).reduce((function(t,r){var i=e?e[r]:void 0,a=n[r],o=void 0!==a&&a!==i;return t.templates[r]=o?a:i,t.useCustomCompileOptions[r]=o,t}),{templates:{},useCustomCompileOptions:{}})}(t,r))}Wr=Object.freeze({__proto__:null,carousel:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.cssClasses,r=void 0===(e=e.templates)?{}:e;return function(e){var i=e.items,a=e.templates,o=void 0===(o=e.cssClasses)?{}:o,s=(e=e.sendEvent,r.previous),c=r.next;return sn(no,{items:i,sendEvent:void 0===e?function(){}:e,itemComponent:a.item,previousIconComponent:s?function(){return s({html:na})}:void 0,nextIconComponent:c?function(){return c({html:na})}:void 0,classNames:n(n({},t),{list:da(null==t?void 0:t.list,null==o?void 0:o.list),item:da(null==t?void 0:t.item,null==o?void 0:o.item)})})}}});var io,ao,oo,so=ia((function(e,t){function n(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function r(e,t,n){if(t.charAt(n)==e.charAt(0)){for(var r=1,i=e.length;r<i;r++)if(t.charAt(n+r)!=e.charAt(r))return;return 1}}function i(e,t,n,r){for(var a=[],o=null,s=null,c=n[n.length-1];0<e.length;){if(s=e.shift(),c&&"<"==c.tag&&!(s.tag in b))throw new Error("Illegal content in < super tag.");if(f.tags[s.tag]<=f.tags.$||function(e,t){for(var n=0,r=t.length;n<r;n++)if(t[n].o==e.n)return e.tag="#"}(s,r))n.push(s),s.nodes=i(e,s.tag,n,r);else{if("/"==s.tag){if(0===n.length)throw new Error("Closing tag without opener: /"+s.n);if(o=n.pop(),s.n==o.n||function(e,t,n){for(var r=0,i=n.length;r<i;r++)if(n[r].c==e&&n[r].o==t)return 1}(s.n,o.n,r))return o.end=s.i,a;throw new Error("Nesting error: "+o.n+" vs. "+s.n)}"\n"==s.tag&&(s.last=0==e.length||"\n"==e[0].tag)}a.push(s)}if(0<n.length)throw new Error("missing closing tag: "+n.pop().n);return a}function a(e){var t,n=[];for(t in e.partials)n.push('"'+o(t)+'":{name:"'+o(e.partials[t].name)+'", '+a(e.partials[t])+"}");return"partials: {"+n.join(",")+"}, subs: "+function(e){var t,n=[];for(t in e)n.push('"'+o(t)+'": function(c,p,t,i) {'+e[t]+"}");return"{ "+n.join(",")+" }"}(e.subs)}function o(e){return e.replace(g,"\\\\").replace(h,'\\"').replace(p,"\\n").replace(m,"\\r").replace(v,"\\u2028").replace(y,"\\u2029")}function s(e){return~e.indexOf(".")?"d":"f"}function c(e,t){var n="<"+(t.prefix||"")+e.n+_++;return t.partials[n]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+o(n)+'",c,p,"'+(e.indent||"")+'"));',n}function u(e,t){t.code+="t.b(t.t(t."+s(e.n)+'("'+o(e.n)+'",c,p,0)));'}function l(e){return"t.b("+e+");"}var f,d,h,p,m,g,v,y,b,_;d=/\S/,h=/\"/g,p=/\n/g,m=/\r/g,g=/\\/g,v=/\u2028/,y=/\u2029/,(f=t).tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},f.scan=function(e,t){var i,a,o,s,c,u=e.length,l=0,h=null,p="",m=[],g=!1,v=0,y=0,b="{{",_="}}";function w(){0<p.length&&(m.push({tag:"_t",text:new String(p)}),p="")}function S(e,t){if(w(),e&&function(){for(var e=!0,t=y;t<m.length;t++)if(!(e=f.tags[m[t].tag]<f.tags._v||"_t"==m[t].tag&&null===m[t].text.match(d)))return;return e}())for(var n,r=y;r<m.length;r++)m[r].text&&((n=m[r+1])&&">"==n.tag&&(n.indent=m[r].text.toString()),m.splice(r,1));else t||m.push({tag:"\n"});g=!1,y=m.length}for(t&&(b=(t=t.split(" "))[0],_=t[1]),v=0;v<u;v++)0==l?r(b,e,v)?(--v,w(),l=1):"\n"==e.charAt(v)?S(g):p+=e.charAt(v):1==l?(v+=b.length-1,l="="==(h=(i=f.tags[e.charAt(v+1)])?e.charAt(v+1):"_v")?(o=v,void 0,s="="+_,c=(a=e).indexOf(s,o),b=(a=n(a.substring(a.indexOf("=",o)+1,c)).split(" "))[0],_=a[a.length-1],v=c+s.length-1,0):(i&&v++,2),g=v):r(_,e,v)?(m.push({tag:h,n:n(p),otag:b,ctag:_,i:"/"==h?g-b.length:v+_.length}),p="",v+=_.length-1,l=0,"{"==h&&("}}"==_?v++:"}"===(o=m[m.length-1]).n.substr(o.n.length-1)&&(o.n=o.n.substring(0,o.n.length-1)))):p+=e.charAt(v);return S(g,!0),m},b={_t:!0,"\n":!0,$:!0,"/":!0},f.stringify=function(e,t,n){return"{code: function (c,p,i) { "+f.wrapMain(e.code)+" },"+a(e)+"}"},_=0,f.generate=function(e,t,n){_=0;var r={code:"",subs:{},partials:{}};return f.walk(e,r),n.asString?this.stringify(r,t,n):this.makeTemplate(r,t,n)},f.wrapMain=function(e){return'var t=this;t.b(i=i||"");'+e+"return t.fl();"},f.template=f.Template,f.makeTemplate=function(e,t,n){var r=this.makePartials(e);return r.code=new Function("c","p","i",this.wrapMain(e.code)),new this.template(r,t,this,n)},f.makePartials=function(e){var t,n={subs:{},partials:e.partials,name:e.name};for(t in n.partials)n.partials[t]=this.makePartials(n.partials[t]);for(t in e.subs)n.subs[t]=new Function("c","p","t","i",e.subs[t]);return n},f.codegen={"#":function(e,t){t.code+="if(t.s(t."+s(e.n)+'("'+o(e.n)+'",c,p,1),c,p,0,'+e.i+","+e.end+',"'+e.otag+" "+e.ctag+'")){t.rs(c,p,function(c,p,t){',f.walk(e.nodes,t),t.code+="});c.pop();}"},"^":function(e,t){t.code+="if(!t.s(t."+s(e.n)+'("'+o(e.n)+'",c,p,1),c,p,1,0,0,"")){',f.walk(e.nodes,t),t.code+="};"},">":c,"<":function(e,t){var n={partials:{},code:"",subs:{},inPartial:!0};(f.walk(e.nodes,n),e=t.partials[c(e,t)]).subs=n.subs,e.partials=n.partials},$:function(e,t){var n={subs:{},code:"",partials:t.partials,prefix:e.n};f.walk(e.nodes,n),t.subs[e.n]=n.code,t.inPartial||(t.code+='t.sub("'+o(e.n)+'",c,p,i);')},"\n":function(e,t){t.code+=l('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+s(e.n)+'("'+o(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=l('"'+o(e.text)+'"')},"{":u,"&":u},f.walk=function(e,t){for(var n,r=0,i=e.length;r<i;r++)(n=f.codegen[e[r].tag])&&n(e[r],t);return t},f.parse=function(e,t,n){return i(e,0,[],(n=n||{}).sectionTags||[])},f.cache={},f.cacheKey=function(e,t){return[e,!!t.asString,!!t.disableLambda,t.delimiters,!!t.modelGet].join("||")},f.compile=function(e,t){var n=f.cacheKey(e,t=t||{}),r=this.cache[n];if(r){var i,a=r.partials;for(i in a)delete a[i].instance;return r}return r=this.generate(this.parse(this.scan(e,t.delimiters),e,t),e,t),this.cache[n]=r}})),co=ia((function(e,t){function n(e,t,n){var r;return t&&"object"==typeof t&&(void 0!==t[e]?r=t[e]:n&&t.get&&"function"==typeof t.get&&(r=t.get(e))),r}function r(e){return String(null==e?"":e)}var i,a,o,s,c,u,l;t.Template=function(e,t,n,r){this.r=(e=e||{}).code||this.r,this.c=n,this.options=r||{},this.text=t||"",this.partials=e.partials||{},this.subs=e.subs||{},this.buf=""},t.Template.prototype={r:function(e,t,n){return""},v:function(e){return e=r(e),u.test(e)?e.replace(i,"&").replace(a,"<").replace(o,">").replace(s,"'").replace(c,"""):e},t:r,render:function(e,t,n){return this.ri([e],t||{},n)},ri:function(e,t,n){return this.r(e,t,n)},ep:function(e,t){var n=this.partials[e],r=t[n.name];if(n.instance&&n.base==r)return n.instance;if("string"==typeof r){if(!this.c)throw new Error("No compiler available.");r=this.c.compile(r,this.options)}if(!r)return null;if(this.partials[e].base=r,n.subs){for(key in t.stackText||(t.stackText={}),n.subs)t.stackText[key]||(t.stackText[key]=void 0!==this.activeSub&&t.stackText[this.activeSub]?t.stackText[this.activeSub]:this.text);r=function(e,t,n,r,i,a){function o(){}function s(){}s.prototype=(o.prototype=e).subs;var c,u=new o;for(c in u.subs=new s,u.subsText={},u.buf="",r=r||{},u.stackSubs=r,u.subsText=a,t)r[c]||(r[c]=t[c]);for(c in r)u.subs[c]=r[c];for(c in i=i||{},u.stackPartials=i,n)i[c]||(i[c]=n[c]);for(c in i)u.partials[c]=i[c];return u}(r,n.subs,n.partials,this.stackSubs,this.stackPartials,t.stackText)}return this.partials[e].instance=r},rp:function(e,t,n,r){return(e=this.ep(e,n))?e.ri(t,n,r):""},rs:function(e,t,n){var r=e[e.length-1];if(l(r))for(var i=0;i<r.length;i++)e.push(r[i]),n(e,t,this),e.pop();else n(e,t,this)},s:function(e,t,n,r,i,a,o){return(!l(e)||0!==e.length)&&(n=!!(e="function"==typeof e?this.ms(e,t,n,r,i,a,o):e),!r&&n&&t&&t.push("object"==typeof e?e:t[t.length-1]),n)},d:function(e,t,r,i){var a,o=e.split("."),s=this.f(o[0],t,r,i),c=this.options.modelGet,u=null;if("."===e&&l(t[t.length-2]))s=t[t.length-1];else for(var f=1;f<o.length;f++)s=void 0!==(a=n(o[f],s,c))?(u=s,a):"";return!(i&&!s)&&(i||"function"!=typeof s||(t.push(u),s=this.mv(s,t,r),t.pop()),s)},f:function(e,t,r,i){for(var a=!1,o=!1,s=this.options.modelGet,c=t.length-1;0<=c;c--)if(void 0!==(a=n(e,t[c],s))){o=!0;break}return o?i||"function"!=typeof a?a:this.mv(a,t,r):!i&&""},ls:function(e,t,n,i,a){var o=this.options.delimiters;return this.options.delimiters=a,this.b(this.ct(r(e.call(t,i)),t,n)),this.options.delimiters=o,!1},ct:function(e,t,n){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(e,this.options).render(t,n)},b:function(e){this.buf+=e},fl:function(){var e=this.buf;return this.buf="",e},ms:function(e,t,n,r,i,a,o){return t=t[t.length-1],"function"==typeof(e=e.call(t))?!!r||(r=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(e,t,n,r.substring(i,a),o)):e},mv:function(e,t,n){return t=t[t.length-1],"function"==typeof(e=e.call(t))?this.ct(r(e.call(t)),t,n):e},sub:function(e,t,n,r){var i=this.subs[e];i&&(this.activeSub=e,i(t,n,this,r),this.activeSub=!1)}},i=/&/g,a=/</g,o=/>/g,s=/\'/g,c=/\"/g,u=/[&<>\"\']/,l=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}})),uo=(so.Template=co.Template,so.template=so.Template,so),lo=(ao=(co={createElement:sn,Fragment:un}).createElement,oo=co.Fragment,io={createElement:ao}.createElement,function(e){var t=e.parts,n=void 0===(a=e.highlightedTagName)?"mark":a,r=void 0===(a=e.nonHighlightedTagName)?"span":a,i=void 0===(a=e.separator)?", ":a,a=e.className,o=void 0===(s=e.classNames)?{}:s,s=fa(e,Pa);return ao("span",aa({},s,{className:da(o.root,a)}),t.map((function(e,a){var s=a===t.length-1;return ao(oo,{key:a},e.map((function(e,t){return ao(fo,{key:t,classNames:o,highlightedTagName:n,nonHighlightedTagName:r,isHighlighted:e.isHighlighted},e.value)})),!s&&ao("span",{className:o.separator},i))})))});function fo(e){var t=e.classNames,n=e.children,r=e.highlightedTagName,i=e.isHighlighted;return e=e.nonHighlightedTagName,io(i?r:e,{className:i?t.highlighted:t.nonHighlighted},n)}var ho=["classNames"];function po(e){var t=void 0===(t=e.classNames)?{}:t;return e=h(e,ho),sn(lo,c({classNames:{root:da("ais-Highlight",t.root),highlighted:da("ais-Highlight-highlighted",t.highlighted),nonHighlighted:da("ais-Highlight-nonHighlighted",t.nonHighlighted),separator:da("ais-Highlight-separator",t.separator)}},e))}var mo=["hit","attribute","cssClasses"];function go(e){var t=e.hit,n=e.attribute,r=e.cssClasses;return sn(po,c({},h(e,mo),{parts:Pe(ie(t._highlightResult,n)||[]).map((function(e){return ne(T(e.value||""))})),classNames:r}))}var vo=["classNames"];function yo(e){var t=void 0===(t=e.classNames)?{}:t;return e=h(e,vo),sn(lo,c({classNames:{root:da("ais-ReverseHighlight",t.root),highlighted:da("ais-ReverseHighlight-highlighted",t.highlighted),nonHighlighted:da("ais-ReverseHighlight-nonHighlighted",t.nonHighlighted),separator:da("ais-ReverseHighlight-separator",t.separator)}},e))}var bo=["hit","attribute","cssClasses"],_o=["isHighlighted"];function wo(e){var t=e.hit,r=e.attribute,i=e.cssClasses;return sn(yo,c({},h(e,bo),{parts:Pe(ie(t._highlightResult,r)||[]).map((function(e){return ne(T(e.value||"")).map((function(e){var t=e.isHighlighted;return n(n({},h(e,_o)),{},{isHighlighted:!t})}))})),classNames:i}))}var So=["classNames"];function Ro(e){var t=void 0===(t=e.classNames)?{}:t;return e=h(e,So),sn(lo,c({classNames:{root:da("ais-ReverseSnippet",t.root),highlighted:da("ais-ReverseSnippet-highlighted",t.highlighted),nonHighlighted:da("ais-ReverseSnippet-nonHighlighted",t.nonHighlighted),separator:da("ais-ReverseSnippet-separator",t.separator)}},e))}var Po=["hit","attribute","cssClasses"],xo=["isHighlighted"];function Oo(e){var t=e.hit,r=e.attribute,i=e.cssClasses;return sn(Ro,c({},h(e,Po),{parts:Pe(ie(t._snippetResult,r)||[]).map((function(e){return ne(T(e.value||"")).map((function(e){var t=e.isHighlighted;return n(n({},h(e,xo)),{},{isHighlighted:!t})}))})),classNames:i}))}var Eo=["classNames"];function Co(e){var t=void 0===(t=e.classNames)?{}:t;return e=h(e,Eo),sn(lo,c({classNames:{root:da("ais-Snippet",t.root),highlighted:da("ais-Snippet-highlighted",t.highlighted),nonHighlighted:da("ais-Snippet-nonHighlighted",t.nonHighlighted),separator:da("ais-Snippet-separator",t.separator)}},e))}var No=["hit","attribute","cssClasses"];function jo(e){var t=e.hit,n=e.attribute,r=e.cssClasses;return sn(Co,c({},h(e,No),{parts:Pe(ie(t._snippetResult,n)||[]).map((function(e){return ne(T(e.value||""))})),classNames:r}))}function To(e){var t=e.templates,r=e.templateKey,a=e.compileOptions,o=e.helpers,c=e.data,u=e.bindEvent;if(e=e.sendEvent,"string"!=typeof(t=t[r])&&"function"!=typeof t)throw new Error("Template must be 'string' or 'function', was '".concat(i(t),"' (key: ").concat(r,")"));return"function"==typeof t?((r=u||{}).html=na,r.sendEvent=e,r.components={Highlight:go,ReverseHighlight:wo,Snippet:jo,ReverseSnippet:Oo},t(c,r)):(u=function(e,t,r){var i=0<arguments.length&&void 0!==e?e:{},a=1<arguments.length?t:void 0,o=2<arguments.length?r:void 0;return Object.keys(i).reduce((function(e,t){return n(n({},e),{},s({},t,(function(){var e=this;return function(n){return i[t].call(o,n,(function(t){return uo.compile(t,a).render(e)}))}})))}),{})}(o,a,c),uo.compile(t,a).render(n(n({},c),{},{helpers:u})).replace(/[ \n\r\t\f\xA0]+/g,(function(e){return e.replace(/(^|\xA0+)[^\xA0]+/g,"$1 ")})).trim())}var ko=function(){u(t,ln);var e=m(t);function t(){var n;a(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return s(p(n=e.call.apply(e,[this].concat(i))),"ref",{current:null}),s(p(n),"nodes",[]),n}return o(t,[{key:"componentDidMount",value:function(){var e=new DocumentFragment,t=document.createElement("div");t.innerHTML=this.props.content,this.nodes=v(t.childNodes),this.nodes.forEach((function(t){return e.appendChild(t)})),this.ref.current.replaceWith(e)}},{key:"componentWillUnmount",value:function(){this.nodes.forEach((function(e){e instanceof Element?e.outerHTML="":e.nodeValue=""})),this.nodes[0].nodeValue&&(this.nodes[0].nodeValue="")}},{key:"render",value:function(){return sn("div",{ref:this.ref})}}]),t}(),Io=function(){u(t,ln);var e=m(t);function t(){return a(this,t),e.apply(this,arguments)}return o(t,[{key:"shouldComponentUpdate",value:function(e){return!de(this.props.data,e.data)||this.props.templateKey!==e.templateKey||!de(this.props.rootProps,e.rootProps)}},{key:"render",value:function(){var e="fragment"===this.props.rootTagName?un:this.props.rootTagName,t=this.props.useCustomCompileOptions[this.props.templateKey]?this.props.templatesConfig.compileOptions:{};return null===(t=To({templates:this.props.templates,templateKey:this.props.templateKey,compileOptions:t,helpers:this.props.templatesConfig.helpers,data:this.props.data,bindEvent:this.props.bindEvent,sendEvent:this.props.sendEvent}))?null:"object"===i(t)?sn(e,this.props.rootProps,t):e===un?sn(ko,{content:t,key:Math.random()}):sn(e,c({},this.props.rootProps,{dangerouslySetInnerHTML:{__html:t}}))}}]),t}(),Fo=(s(Io,"defaultProps",{data:{},rootTagName:"div",useCustomCompileOptions:{},templates:{},templatesConfig:{}}),function(e){var t=e.hits,r=e.isLoading,i=e.cssClasses,a=e.templateProps;return sn("div",{className:da(i.root,0===t.length&&i.emptyRoot)},sn(Io,c({},a,{templateKey:"header",rootProps:{className:i.header},data:{hits:t,isLoading:r}})),r?sn(Io,c({},a,{templateKey:"loader",rootProps:{className:i.loader}})):sn("ul",{className:i.list},t.map((function(e,t){return sn(Io,c({},a,{templateKey:"item",rootTagName:"li",rootProps:{className:i.item},key:e.objectID,data:n(n({},e),{},{get __hitIndex(){return t}})}))}))))}),Ao={header:function(){return""},loader:function(){return""},item:function(e){return JSON.stringify(e)}},Mo=J({name:"answers"}),Lo=Lr("Answers"),Ho=(so=w((function(e){var t,r,i,a,o,s=(e=e||{}).container,c=e.attributesForPrediction,u=e.queryLanguages,l=e.nbHits,f=e.searchDebounceTime,d=e.renderDebounceTime,h=e.escapeHTML,p=e.extraParameters,m=void 0===(m=e.templates)?{}:m;if(e=void 0===(e=e.cssClasses)?{}:e,s)return t=te(s),s={root:da(Lo(),e.root),emptyRoot:da(Lo({modifierName:"empty"}),e.emptyRoot),header:da(Lo({descendantName:"header"}),e.header),loader:da(Lo({descendantName:"loader"}),e.loader),list:da(Lo({descendantName:"list"}),e.list),item:da(Lo({descendantName:"item"}),e.item)},r=(e={containerNode:t,cssClasses:s,templates:m,renderState:{}}).containerNode,i=e.cssClasses,a=e.renderState,o=e.templates,n(n({},xe((function(e,t){var n=e.hits,s=e.isLoading;e=e.instantSearchInstance,t?a.templateProps=ro({defaultTemplates:Ao,templatesConfig:e.templatesConfig,templates:o}):Pn(sn(Fo,{cssClasses:i,hits:n,isLoading:s,templateProps:a.templateProps}),r)}),(function(){return Pn(null,t)}))({attributesForPrediction:c,queryLanguages:u,nbHits:l,searchDebounceTime:f,renderDebounceTime:d,escapeHTML:h,extraParameters:p})),{},{$$widgetType:"ais.answers"});throw new Error(Mo("The `container` option is required."))})),["container","widgets","fallbackWidget"]),Do=J({name:"dynamic-widgets"}),qo=Lr("DynamicWidgets");function Uo(e){var t=document.createElement("div");return t.className=qo({descendantName:"widget"}),e.appendChild(t),t}function Wo(e){var t,r,i,a,o,s=(e=e||{}).container,c=e.widgets,u=e.fallbackWidget;if(e=h(e,Ho),!s)throw new Error(Do("The `container` option is required."));if(c&&Array.isArray(c)&&c.every((function(e){return"function"==typeof e})))return t=te(s),(r=document.createElement("div")).className=qo(),i=new Map,a=[],o=It((function(e,n){e=e.attributesToRender,n&&t.appendChild(r),e.forEach((function(e){i.has(e)&&(e=i.get(e),r.appendChild(e))}))}),(function(){t.removeChild(r)}))(n(n({},e),{},{widgets:a,fallbackWidget:"function"==typeof u?function(e){e=e.attribute;var t=Uo(r);return i.set(e,t),u({attribute:e,container:t})}:void 0})),n(n({},o),{},{init:function(e){c.forEach((function(t){var n=Uo(r),o=se(t=t(n),e);i.set(o,n),a.push(t)})),o.init(e)},$$widgetType:"ais.dynamicWidgets"});throw new Error(Do("The `widgets` option expects an array of callbacks."))}function Bo(e,t){var n=e.items,r=e.widgetParams;e=e.canRefine,t||(t=r.container,r=r.cssClasses,Pn(sn(ns,{cssClasses:r,items:n,canRefine:e}),t))}function $o(e){var t=e.className,n=e.disabled;return sn("button",{className:t,onClick:e.onClick,disabled:void 0!==n&&n},e.children)}function Vo(e){var t=e.classNameLabel,n=e.classNameInput,r=e.checked,i=e.onToggle;return e=e.children,sn("label",{className:t},sn("input",{className:n,type:"checkbox",checked:r,onChange:i}),e)}function Qo(e,t){var r,i,a,o,s=e.items,c=e.position,u=e.currentRefinement,l=e.refine,f=e.clearMapRefinement,d=e.toggleRefineOnMapMove,h=e.isRefineOnMapMove,p=e.setMapMoveSinceLastRefine,m=e.hasMapMoveSinceLastRefine,v=e.isRefinedWithMap,y=e.widgetParams,b=(e=e.instantSearchInstance,y.container),_=y.googleReference,w=y.cssClasses,S=y.templates,R=y.initialZoom,P=y.initialPosition,x=y.enableRefine,O=y.enableClearMapRefinement,E=y.enableRefineControl,C=y.mapOptions,N=y.createMarker,j=y.markerOptions,T=y.renderState;t?(T.isUserInteraction=!0,T.isPendingRefine=!1,T.markers=[],(y=document.createElement("div")).className=w.root,b.appendChild(y),(t=document.createElement("div")).className=w.map,y.appendChild(t),(r=document.createElement("div")).className=w.tree,y.appendChild(r),T.mapInstance=new _.maps.Map(t,n({mapTypeControl:!1,fullscreenControl:!1,streetViewControl:!1,clickableIcons:!1,zoomControlOptions:{position:_.maps.ControlPosition.LEFT_TOP}},C)),_.maps.event.addListenerOnce(T.mapInstance,"idle",(function(){function e(){T.isUserInteraction&&x&&(p(),h())&&(T.isPendingRefine=!0)}T.mapInstance.addListener("center_changed",e),T.mapInstance.addListener("zoom_changed",e),T.mapInstance.addListener("dragstart",e),T.mapInstance.addListener("idle",(function(){T.isUserInteraction&&T.isPendingRefine&&(T.isPendingRefine=!1,cs({mapInstance:T.mapInstance,refine:l}))}))})),T.templateProps=ro({templatesConfig:e.templatesConfig,templates:S})):(y=s.map((function(e){return e.objectID})),t=(r=g(us(T.markers,y),2))[0],C=r[1],i=t.map((function(e){return e.__id})),e=s.filter((function(e){return!i.includes(e.objectID)})),C.forEach((function(e){return e.setMap(null)})),T.markers=t.concat(e.map((function(e){var t=N({map:T.mapInstance,item:e});return Object.keys(j.events).forEach((function(n){t.addListener(n,(function(r){j.events[n]({map:T.mapInstance,event:r,item:e,marker:t})}))})),t}))),S=!m(),a=u?0:null,(o=!u&&Boolean(T.markers.length)?ls(_,T.markers):u)&&S?fs(T,(function(){T.mapInstance.fitBounds(new _.maps.LatLngBounds(o.southWest,o.northEast),a)})):S&&fs(T,(function(){T.mapInstance.setCenter(c||P),T.mapInstance.setZoom(R)})),Pn(sn(ss,{cssClasses:w,enableRefine:x,enableRefineControl:E,enableClearMapRefinement:O,isRefineOnMapMove:h(),isRefinedWithMap:v(),hasMapMoveSinceLastRefine:m(),onRefineToggle:d,onRefineClick:function(){return cs({mapInstance:T.mapInstance,refine:l})},onClearClick:f,templateProps:T.templateProps}),b.querySelector(".".concat(w.tree))))}var Ko=J({name:"analytics"}),zo=function(e){var t=e.items,n=e.cssClasses,r=e.templateProps,i=e.createURL,a=e.refine;return sn("div",{className:da(n.root,0===t.length&&n.noRefinementRoot)},sn("ul",{className:n.list},sn("li",{className:da(n.item,0===t.length&&n.selectedItem)},sn(Io,c({},r,{templateKey:"home",rootTagName:"a",rootProps:{className:n.link,href:i(null),onClick:function(e){pe(e)||(e.preventDefault(),a(null))}}}))),t.map((function(e,o){var s=o===t.length-1;return sn("li",{key:e.label+o,className:da(n.item,s&&n.selectedItem)},sn(Io,c({},r,{templateKey:"separator",rootTagName:"span",rootProps:{className:n.separator,"aria-hidden":!0}})),s?e.label:sn("a",{className:n.link,href:i(e.value),onClick:function(t){pe(t)||(t.preventDefault(),a(e.value))}},e.label))}))))},Go={home:function(){return"Home"},separator:function(){return">"}},Jo=J({name:"breadcrumb"}),Yo=Lr("Breadcrumb"),Xo=function(e){var t=e.hasRefinements,n=e.refine,r=e.cssClasses;return e=e.templateProps,sn("div",{className:r.root},sn(Io,c({},e,{templateKey:"resetLabel",rootTagName:"button",rootProps:{className:da(r.button,!t&&r.disabledButton),onClick:n,disabled:!t},data:{hasRefinements:t}})))},Zo={resetLabel:function(){return"Clear refinements"}},es=J({name:"clear-refinements"}),ts=Lr("ClearRefinements"),ns=function(e){var t=e.items,n=e.cssClasses;return e=e.canRefine,sn("div",{className:da(n.root,!e&&n.noRefinementRoot)},sn("ul",{className:n.list},t.map((function(e,t){return sn("li",{key:"".concat(e.indexName,"-").concat(e.attribute,"-").concat(t),className:n.item},sn("span",{className:n.label},(t=e.label).toString().charAt(0).toUpperCase()+t.toString().slice(1),": "),e.refinements.map((function(t){return sn("span",{key:(i=t.attribute,a=t.value,[i,t.type,a,t.operator].map((function(e){return e})).filter(Boolean).join(":")),className:n.category},sn("span",{className:n.categoryLabel},"query"===t.attribute?sn("q",null,t.label):t.label),sn("button",{className:n.delete,type:"button",onClick:(r=e.refine.bind(null,t),function(e){pe(e)||(e.preventDefault(),r())})},"✕"));var r,i,a})))}))))},rs=J({name:"current-refinements"}),is=Lr("CurrentRefinements"),as=sn("p",null,"Your custom HTML Marker"),os={HTMLMarker:function(){return as},reset:function(){return"Clear the map refinement"},toggle:function(){return"Search as I move the map"},redo:function(){return"Redo search here"}},ss=function(e){var t=e.cssClasses,n=e.enableRefine,r=e.enableRefineControl,i=e.enableClearMapRefinement,a=e.isRefineOnMapMove,o=e.isRefinedWithMap,s=e.hasMapMoveSinceLastRefine,u=e.onRefineToggle,l=e.onRefineClick,f=e.onClearClick;return e=e.templateProps,sn(un,null,n&&sn("div",null,r&&sn("div",{className:t.control},a||!s?sn(Vo,{classNameLabel:da(t.label,a&&t.selectedLabel),classNameInput:t.input,checked:a,onToggle:u},sn(Io,c({},e,{templateKey:"toggle",rootTagName:"span"}))):sn($o,{className:t.redo,disabled:!s,onClick:l},sn(Io,c({},e,{templateKey:"redo",rootTagName:"span"})))),!r&&!a&&sn("div",{className:t.control},sn($o,{className:da(t.redo,!s&&t.disabledRedo),disabled:!s,onClick:l},sn(Io,c({},e,{templateKey:"redo",rootTagName:"span"})))),i&&o&&sn($o,{className:t.reset,onClick:f},sn(Io,c({},e,{templateKey:"reset",rootTagName:"span"})))))},cs=function(e){return(0,e.refine)({northEast:(e=e.mapInstance).getBounds().getNorthEast().toJSON(),southWest:e.getBounds().getSouthWest().toJSON()})},us=function(e,t){return e.reduce((function(e,n){var r=(e=g(e,2))[0];return e=e[1],t.includes(n.__id)?[r.concat(n),e]:[r,e.concat(n)]}),[[],[]])},ls=function(e,t){return t=t.reduce((function(e,t){return e.extend(t.getPosition())}),new e.maps.LatLngBounds),{northEast:t.getNorthEast().toJSON(),southWest:t.getSouthWest().toJSON()}},fs=function(e,t){e.isUserInteraction=!1,t(),e.isUserInteraction=!0},ds=["initialZoom","initialPosition","templates","cssClasses","builtInMarker","customHTMLMarker","enableRefine","enableClearMapRefinement","enableRefineControl","container","googleReference"],hs=["item"],ps=["item"],ms=J({name:"geo-search"}),gs=Lr("GeoSearch"),vs=(co={query:"",showSubmit:!0,showReset:!0,showLoadingIndicator:!0,autofocus:!1,searchAsYouType:!0,ignoreCompositionEvents:!1,isSearchStalled:!1,disabled:!1,ariaLabel:"Search",onChange:_,onSubmit:_,onReset:_,refine:_},function(){u(t,ln);var e=m(t);function t(){var n;a(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return s(p(n=e.call.apply(e,[this].concat(i))),"state",{query:n.props.query,focused:!1}),s(p(n),"input",{current:null}),s(p(n),"onInput",(function(e){var t=(i=n.props).searchAsYouType,r=i.refine,i=i.onChange,a=e.target.value;n.props.ignoreCompositionEvents&&e.isComposing||(t&&r(a),n.setState({query:a}),i(e))})),s(p(n),"onSubmit",(function(e){var t=(i=n.props).searchAsYouType,r=i.refine,i=i.onSubmit;return e.preventDefault(),e.stopPropagation(),n.input.current&&n.input.current.blur(),t||r(n.state.query),i(e),!1})),s(p(n),"onReset",(function(e){var t=(r=n.props).refine,r=r.onReset;n.input.current&&n.input.current.focus(),t(""),n.setState({query:""}),r(e)})),s(p(n),"onBlur",(function(){n.setState({focused:!1})})),s(p(n),"onFocus",(function(){n.setState({focused:!0})})),n}return o(t,[{key:"resetInput",value:function(){this.setState({query:""})}},{key:"componentWillReceiveProps",value:function(e){this.state.focused||e.query===this.state.query||this.setState({query:e.query})}},{key:"render",value:function(){var e=(c=this.props).cssClasses,t=c.placeholder,n=c.autofocus,r=c.showSubmit,i=c.showReset,a=c.showLoadingIndicator,o=c.templates,s=c.isSearchStalled,c=c.ariaLabel;return sn("div",{className:e.root},sn("form",{action:"",role:"search",className:e.form,noValidate:!0,onSubmit:this.onSubmit,onReset:this.onReset},sn("input",{ref:this.input,value:this.state.query,disabled:this.props.disabled,className:e.input,type:"search",placeholder:t,autoFocus:n,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",maxLength:512,onInput:this.onInput,oncompositionend:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,"aria-label":c}),sn(Io,{templateKey:"submit",rootTagName:"button",rootProps:{className:e.submit,type:"submit",title:"Submit the search query",hidden:!r},templates:o,data:{cssClasses:e}}),sn(Io,{templateKey:"reset",rootTagName:"button",rootProps:{className:e.reset,type:"reset",title:"Clear the search query",hidden:!(i&&this.state.query.trim()&&!s)},templates:o,data:{cssClasses:e}}),a&&sn(Io,{templateKey:"loadingIndicator",rootTagName:"span",rootProps:{className:e.loadingIndicator,hidden:!s},templates:o,data:{cssClasses:e}})))}}]),t}());function ys(e){var t=e.className,n=e.handleClick,r=e.facetValueToRefine,i=e.isRefined,a=e.templateProps,o=e.templateKey,s=e.templateData;return e=e.subItems,sn("li",{className:t,onClick:function(e){n({facetValueToRefine:r,isRefined:i,originalEvent:e})}},sn(Io,c({},a,{templateKey:o,data:s})),e)}s(vs,"defaultProps",co);var bs=["root"];function _s(e){return void 0!==e.data}var ws,Ss,Rs=function(){u(t,ln);var e=m(t);function t(){var r;a(this,t);for(var i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];return s(p(r=e.call.apply(e,[this].concat(o))),"listRef",{current:null}),s(p(r),"searchBox",{current:null}),s(p(r),"lastRefinedValue",void 0),s(p(r),"_generateFacetItem",(function(e){_s(e)&&Array.isArray(e.data)&&0<e.data.length&&((i=r.props.cssClasses).root,i=h(i,bs),i=sn(t,c({},r.props,{cssClasses:i,depth:r.props.depth+1,facetValues:e.data,showMore:!1,className:r.props.cssClasses.childList})));var i,a=r.props.createURL(e.value),o=(a=n(n({},e),{},{url:a,attribute:r.props.attribute,cssClasses:r.props.cssClasses,isFromSearch:r.props.isFromSearch}),e.value),s=(void 0!==e.isRefined&&(o+="/".concat(e.isRefined)),void 0!==e.count&&(o+="/".concat(e.count)),da(r.props.cssClasses.item,e.isRefined&&r.props.cssClasses.selectedItem,!e.count&&r.props.cssClasses.disabledItem,Boolean(_s(e)&&Array.isArray(e.data)&&0<e.data.length)&&r.props.cssClasses.parentItem));return sn(ys,{templateKey:"item",key:o,facetValueToRefine:e.value,handleClick:r.handleItemClick,isRefined:e.isRefined,className:s,subItems:i,templateData:a,templateProps:r.props.templateProps})})),s(p(r),"handleItemClick",(function(e){var t=e.facetValueToRefine,n=e.isRefined,i=e.originalEvent;if(!pe(i)){var a=i.target;if(!(null===a||null===a.parentNode||n&&a.parentNode.querySelector('input[type="radio"]:checked'))){if("INPUT"!==a.tagName){for(;a!==i.currentTarget;){if("LABEL"===a.tagName&&(a.querySelector('input[type="checkbox"]')||a.querySelector('input[type="radio"]')))return;"A"===a.tagName&&a.href&&i.preventDefault(),a=a.parentNode}i.stopPropagation()}r.refine(t)}}})),r}return o(t,[{key:"shouldComponentUpdate",value:function(e){return!de(this.props.facetValues,e.facetValues)}},{key:"refine",value:function(e){this.lastRefinedValue=e,this.props.toggleRefinement(e)}},{key:"componentWillReceiveProps",value:function(e){this.searchBox.current&&!e.isFromSearch&&this.searchBox.current.resetInput()}},{key:"componentDidUpdate",value:function(){var e;null!=(e=this.listRef.current)&&null!=(e=e.querySelector('input[value="'.concat(null==(e=this.lastRefinedValue)?void 0:e.replace('"','\\"'),'"]')))&&e.focus(),this.lastRefinedValue=void 0}},{key:"refineFirstValue",value:function(){var e=this.props.facetValues&&this.props.facetValues[0];e&&(e=e.value,this.props.toggleRefinement(e))}},{key:"render",value:function(){var e=this,t=da(this.props.cssClasses.showMore,!(!0===this.props.showMore&&this.props.canToggleShowMore)&&this.props.cssClasses.disabledShowMore),n=(t=!0===this.props.showMore&&sn(Io,c({},this.props.templateProps,{templateKey:"showMoreText",rootTagName:"button",rootProps:{className:t,disabled:!this.props.canToggleShowMore,onClick:this.props.toggleShowMore},data:{isShowingMore:this.props.isShowingMore}})),!0!==this.props.searchIsAlwaysActive&&!(this.props.isFromSearch||!this.props.hasExhaustiveItems)),r=(n=this.props.searchFacetValues&&sn("div",{className:this.props.cssClasses.searchBox},sn(vs,{ref:this.searchBox,placeholder:this.props.searchPlaceholder,disabled:n,cssClasses:this.props.cssClasses.searchable,templates:this.props.searchBoxTemplateProps.templates,onChange:function(t){return e.props.searchFacetValues(t.target.value)},onReset:function(){return e.props.searchFacetValues("")},onSubmit:function(){return e.refineFirstValue()},searchAsYouType:!1,ariaLabel:"Search for filters"})),this.props.facetValues&&0<this.props.facetValues.length&&sn("ul",{ref:this.listRef,className:this.props.cssClasses.list},this.props.facetValues.map(this._generateFacetItem,this))),i=this.props.searchFacetValues&&this.props.isFromSearch&&(!this.props.facetValues||0===this.props.facetValues.length)&&sn(Io,c({},this.props.templateProps,{templateKey:"searchableNoResults",rootProps:{className:this.props.cssClasses.noResults}}));return sn("div",{className:da(this.props.cssClasses.root,(!this.props.facetValues||0===this.props.facetValues.length)&&this.props.cssClasses.noRefinementRoot,this.props.className)},this.props.children,n,r,i,t)}}]),t}(),Ps=(s(Rs,"defaultProps",{cssClasses:{},depth:0}),{item:function(e){var t=e.url,n=e.label,r=e.count,i=e.cssClasses;return e=e.isRefined,sn("a",{className:da(da(i.link),da(e?i.selectedItemLink:void 0)),href:t},sn("span",{className:da(i.label)},n),sn("span",{className:da(i.count)},Ki(r)))},showMoreText:function(e){return e.isShowingMore?"Show less":"Show more"}}),xs=J({name:"hierarchical-menu"}),Os=Lr("HierarchicalMenu"),Es={empty:function(){return"No results"},item:function(e){return JSON.stringify(ye(e,["__hitIndex"]),null,2)}},Cs=["hit","index"],Ns=J({name:"hits"}),js=(Ss=(co={createElement:sn,Fragment:un}).createElement,co=co.Fragment,ws={createElement:Ss}.createElement,function(e){var t=void 0===(n=e.classNames)?{}:n,n=e.hits,r=e.itemComponent,i=e.sendEvent,a=e.emptyComponent,o=e.banner,s=e.bannerComponent;return e=fa(e,xa),Ss("div",aa({},e,{className:da("ais-Hits",t.root,0===n.length&&da("ais-Hits--empty",t.emptyRoot),e.className)}),o&&(s?Ss(s,{className:da("ais-Hits-banner",t.bannerRoot),banner:o}):Ss(Ts,{classNames:t,banner:o})),0===n.length&&a?Ss(a,null):Ss("ol",{className:da("ais-Hits-list",t.list)},n.map((function(e,n){return Ss(r,{key:e.objectID,hit:e,index:n,className:da("ais-Hits-item",t.item),onClick:function(){i("click:internal",e,"Hit Clicked")},onAuxClick:function(){i("click:internal",e,"Hit Clicked")}})}))))});function Ts(e){var t=e.classNames;return(e=e.banner).image.urls[0].url?ws("aside",{className:da("ais-Hits-banner",t.bannerRoot)},e.link?ws("a",{className:da("ais-Hits-banner-link",t.bannerLink),href:e.link.url,target:e.link.target},ws("img",{className:da("ais-Hits-banner-image",t.bannerImage),src:e.image.urls[0].url,alt:e.image.title})):ws("img",{className:da("ais-Hits-banner-image",t.bannerImage),src:e.image.urls[0].url,alt:e.image.title})):null}function ks(e){var t=e.currentValue,n=e.options,r=e.cssClasses,i=e.setValue;return e=e.ariaLabel,sn("select",{className:da(r.select),onChange:function(e){return i(e.target.value)},value:"".concat(t),"aria-label":e},n.map((function(e){return sn("option",{className:da(r.option),key:e.label+e.value,value:"".concat(e.value)},e.label)})))}function Is(e){var t=e.banner;return e=e.classNames,t.image.urls[0].url?sn("aside",{className:da(e.bannerRoot)},t.link?sn("a",{className:da(e.bannerLink),href:t.link.url,target:t.link.target},sn("img",{className:da(e.bannerImage),src:t.image.urls[0].url,alt:t.image.title})):sn("img",{className:da(e.bannerImage),src:t.image.urls[0].url,alt:t.image.title})):null}var Fs=J({name:"hits-per-page"}),As=Lr("HitsPerPage"),Ms=function(e){var t=e.results,r=e.hits,i=e.insights,a=e.bindEvent,o=e.sendEvent,s=e.hasShowPrevious,u=e.showPrevious,l=e.showMore,f=e.isFirstPage,d=e.isLastPage,h=e.cssClasses,p=e.templateProps,m=(e=e.banner,On({insights:i,sendEvent:o}));return 0===t.hits.length?sn("div",{className:da(h.root,h.emptyRoot),onClick:m},e&&(p.templates.banner?sn(Io,c({},p,{templateKey:"banner",rootTagName:"fragment",data:{banner:e,className:h.bannerRoot}})):sn(Is,{banner:e,classNames:h})),sn(Io,c({},p,{templateKey:"empty",rootTagName:"fragment",data:t}))):sn("div",{className:h.root},s&&sn(Io,c({},p,{templateKey:"showPreviousText",rootTagName:"button",rootProps:{className:da(h.loadPrevious,f&&h.disabledLoadPrevious),disabled:f,onClick:u}})),e&&(p.templates.banner?sn(Io,c({},p,{templateKey:"banner",rootTagName:"fragment",data:{banner:e,className:h.bannerRoot}})):sn(Is,{banner:e,classNames:h})),sn("ol",{className:h.list},r.map((function(e,t){return sn(Io,c({},p,{templateKey:"item",rootTagName:"li",rootProps:{className:h.item,onClick:function(t){m(t),o("click:internal",e,"Hit Clicked")},onAuxClick:function(t){m(t),o("click:internal",e,"Hit Clicked")}},key:e.objectID,data:n(n({},e),{},{get __hitIndex(){return t}}),bindEvent:a,sendEvent:o}))}))),sn(Io,c({},p,{templateKey:"showMoreText",rootTagName:"button",rootProps:{className:da(h.loadMore,d&&h.disabledLoadMore),disabled:d,onClick:l}})))},Ls={empty:function(){return"No results"},showPreviousText:function(){return"Show previous results"},showMoreText:function(){return"Show more results"},item:function(e){return JSON.stringify(ye(e,["__hitIndex"]),null,2)}},Hs=J({name:"infinite-hits"}),Ds=Lr("InfiniteHits"),qs={item:function(e){var t=e.cssClasses,n=e.url,r=e.label;return e=e.count,sn("a",{className:da(t.link),href:n},sn("span",{className:da(t.label)},r),sn("span",{className:da(t.count)},Ki(e)))},showMoreText:function(e){return e.isShowingMore?"Show less":"Show more"}},Us=J({name:"menu"}),Ws=Lr("Menu");function Bs(e){var t=e.cssClasses,n=e.templateProps,r=e.items,i=e.refine;return e=(X(r,(function(e){return e.isRefined}))||{value:""}).value,sn("div",{className:da(t.root,0===r.length&&t.noRefinementRoot)},sn("select",{className:t.select,value:e,onChange:function(e){i(e.target.value)}},sn(Io,c({},n,{templateKey:"defaultOption",rootTagName:"option",rootProps:{value:"",className:t.option}})),r.map((function(e){return sn(Io,c({},n,{templateKey:"item",rootTagName:"option",rootProps:{value:e.value,className:t.option},key:e.value,data:e}))}))))}var $s={item:function(e){var t=e.label;return e=e.count,"".concat(t," (").concat(Ki(e),")")},defaultOption:function(){return"See all"}},Vs=J({name:"menu-select"}),Qs=Lr("MenuSelect"),Ks={item:function(e){var t=e.cssClasses,n=e.attribute,r=e.label;return e=e.isRefined,sn("label",{className:t.label},sn("input",{type:"radio",className:t.radio,name:n,defaultChecked:e}),sn("span",{className:t.labelText},r))}},zs=J({name:"numeric-menu"}),Gs=Lr("NumericMenu");function Js(e){function t(t){return function(n){pe(n)||(n.preventDefault(),e.setCurrentPage(t))}}return sn("div",{className:da(e.cssClasses.root,e.nbPages<=1&&e.cssClasses.noRefinementRoot)},sn("ul",{className:e.cssClasses.list},e.showFirst&&sn(Ys,{ariaLabel:"First Page",className:e.cssClasses.firstPageItem,isDisabled:e.isFirstPage,templates:e.templates,templateKey:"first",pageNumber:0,createURL:e.createURL,cssClasses:e.cssClasses,createClickHandler:t}),e.showPrevious&&sn(Ys,{ariaLabel:"Previous Page",className:e.cssClasses.previousPageItem,isDisabled:e.isFirstPage,templates:e.templates,templateKey:"previous",pageNumber:e.currentPage-1,createURL:e.createURL,cssClasses:e.cssClasses,createClickHandler:t}),e.pages.map((function(n){return sn(Ys,{key:n,ariaLabel:"Page ".concat(n+1),className:e.cssClasses.pageItem,isSelected:n===e.currentPage,templates:e.templates,templateKey:"page",pageNumber:n,createURL:e.createURL,cssClasses:e.cssClasses,createClickHandler:t})})),e.showNext&&sn(Ys,{ariaLabel:"Next Page",className:e.cssClasses.nextPageItem,isDisabled:e.isLastPage,templates:e.templates,templateKey:"next",pageNumber:e.currentPage+1,createURL:e.createURL,cssClasses:e.cssClasses,createClickHandler:t}),e.showLast&&sn(Ys,{ariaLabel:"Last Page, Page ".concat(e.nbPages),className:e.cssClasses.lastPageItem,isDisabled:e.isLastPage,templates:e.templates,templateKey:"last",pageNumber:e.nbPages-1,createURL:e.createURL,cssClasses:e.cssClasses,createClickHandler:t})))}function Ys(e){var t=e.templates,n=e.templateKey,r=e.ariaLabel,i=e.pageNumber,a=e.className,o=void 0!==(o=e.isDisabled)&&o,s=e.isSelected,c=e.cssClasses,u=e.createURL;return e=e.createClickHandler,sn("li",{className:da(c.item,o&&c.disabledItem,a,void 0!==s&&s&&c.selectedItem)},sn(Io,o?{rootTagName:"span",rootProps:{className:c.link,"aria-label":r},templateKey:n,templates:t,data:{page:i+1}}:{rootTagName:"a",rootProps:{className:c.link,"aria-label":r,href:u(i),onClick:e(i)},templateKey:n,templates:t,data:{page:i+1}}))}var Xs=Lr("Pagination"),Zs=J({name:"pagination"}),ec={previous:function(){return"‹"},next:function(){return"›"},page:function(e){return e=e.page,"".concat(e)},first:function(){return"«"},last:function(){return"»"}};function tc(e){var t,n,r,i=(r=g(Va(e.isCollapsed),2))[0],a=r[1],o=(r=g(Va(!1),2))[0],s=r[1],c=Qa(null);return r=function(){var t=c.current;if(t)return t.appendChild(e.bodyElement),function(){t.removeChild(e.bodyElement)}},t=[c,e.bodyElement],n=$a(ka++,3),!Yt.__s&&Ya(n.__H,t)&&(n.__=r,n.i=t,Ia.__H.__h.push(n)),o||e.isCollapsed===i||a(e.isCollapsed),sn("div",{className:da(e.cssClasses.root,e.hidden&&e.cssClasses.noRefinementRoot,e.collapsible&&e.cssClasses.collapsibleRoot,i&&e.cssClasses.collapsedRoot),hidden:e.hidden},e.templates.header&&sn("div",{className:e.cssClasses.header},sn(Io,{templates:e.templates,templateKey:"header",rootTagName:"span",data:e.data}),e.collapsible&&sn("button",{className:e.cssClasses.collapseButton,"aria-expanded":!i,onClick:function(e){e.preventDefault(),s(!0),a((function(e){return!e}))}},sn(Io,{templates:e.templates,templateKey:"collapseButtonText",rootTagName:"span",data:{collapsed:i}}))),sn("div",{className:e.cssClasses.body,ref:c}),e.templates.footer&&sn(Io,{templates:e.templates,templateKey:"footer",rootProps:{className:e.cssClasses.footer},data:e.data}))}var nc,rc,ic=J({name:"panel"}),ac=Lr("Panel"),oc=["placesReference","defaultPosition"],sc=["places"],cc=(co=w((function(e){var t=e||{},r=t.placesReference,i=void 0===(a=t.defaultPosition)?[]:a,a=h(t,oc);if("function"!=typeof r)throw new Error("The `placesReference` option requires a valid Places.js reference.");var o=r(a),s={query:"",initialLatLngViaIP:void 0,isInitialLatLngViaIPSet:!1};return{$$type:"ais.places",$$widgetType:"ais.places",init:function(e){var t=e.helper;o.on("change",(function(e){var n=(e=e.suggestion).value,r=(e=e.latlng).lat;e=e.lng,s.query=n,t.setQueryParameter("insideBoundingBox",void 0).setQueryParameter("aroundLatLngViaIP",!1).setQueryParameter("aroundLatLng","".concat(r,",").concat(e)).search()})),o.on("clear",(function(){s.query="",t.setQueryParameter("insideBoundingBox",void 0),1<i.length?t.setQueryParameter("aroundLatLngViaIP",!1).setQueryParameter("aroundLatLng",i.join(",")):t.setQueryParameter("aroundLatLngViaIP",s.initialLatLngViaIP).setQueryParameter("aroundLatLng",void 0),t.search()}))},getWidgetUiState:function(e,t){return(t=t.searchParameters.aroundLatLng||i.join(","))!==i.join(",")||s.query?n(n({},e),{},{places:{query:s.query,position:t}}):(e.places,h(e,sc))},getWidgetSearchParameters:function(e,t){var n=void 0===(n=(t=t.uiState.places||{}).query)?"":n;return t=void 0===(t=t.position)?i.join(","):t,s.query=n,s.isInitialLatLngViaIPSet||(s.isInitialLatLngViaIPSet=!0,s.initialLatLngViaIP=e.aroundLatLngViaIP),o.setVal(n),o.close(),e.setQueryParameter("insideBoundingBox",void 0).setQueryParameter("aroundLatLngViaIP",!1).setQueryParameter("aroundLatLng",t||void 0)},getRenderState:function(e,t){return n(n({},e),{},{places:this.getWidgetRenderState(t)})},getWidgetRenderState:function(){return{widgetParams:e}}}})),function(e){var t=e.url,n=e.theme;return sn("div",{className:(e=e.cssClasses).root},sn("a",{href:t,target:"_blank",className:e.link,"aria-label":"Search by Algolia",rel:"noopener noreferrer"},sn("svg",{height:"1.2em",className:e.logo,viewBox:"0 0 572 64",style:{width:"auto"}},sn("path",{fill:"dark"===n?"#FFF":"#36395A",d:"M16 48.3c-3.4 0-6.3-.6-8.7-1.7A12.4 12.4 0 0 1 1.9 42C.6 40 0 38 0 35.4h6.5a6.7 6.7 0 0 0 3.9 6c1.4.7 3.3 1.1 5.6 1.1 2.2 0 4-.3 5.4-1a7 7 0 0 0 3-2.4 6 6 0 0 0 1-3.4c0-1.5-.6-2.8-1.9-3.7-1.3-1-3.3-1.6-5.9-1.8l-4-.4c-3.7-.3-6.6-1.4-8.8-3.4a10 10 0 0 1-3.3-7.9c0-2.4.6-4.6 1.8-6.4a12 12 0 0 1 5-4.3c2.2-1 4.7-1.6 7.5-1.6s5.5.5 7.6 1.6a12 12 0 0 1 5 4.4c1.2 1.8 1.8 4 1.8 6.7h-6.5a6.4 6.4 0 0 0-3.5-5.9c-1-.6-2.6-1-4.4-1s-3.2.3-4.4 1c-1.1.6-2 1.4-2.6 2.4-.5 1-.8 2-.8 3.1a5 5 0 0 0 1.5 3.6c1 1 2.6 1.7 4.7 1.9l4 .3c2.8.2 5.2.8 7.2 1.8 2.1 1 3.7 2.2 4.9 3.8a9.7 9.7 0 0 1 1.7 5.8c0 2.5-.7 4.7-2 6.6a13 13 0 0 1-5.6 4.4c-2.4 1-5.2 1.6-8.4 1.6Zm35.6 0c-2.6 0-4.8-.4-6.7-1.3a13 13 0 0 1-4.7-3.5 17.1 17.1 0 0 1-3.6-10.4v-1c0-2 .3-3.8 1-5.6a13 13 0 0 1 7.3-8.3 15 15 0 0 1 6.3-1.4A13.2 13.2 0 0 1 64 24.3c1 2.2 1.6 4.6 1.6 7.2V34H39.4v-4.3h21.8l-1.8 2.2c0-2-.3-3.7-.9-5.1a7.3 7.3 0 0 0-2.7-3.4c-1.2-.7-2.7-1.1-4.6-1.1s-3.4.4-4.7 1.3a8 8 0 0 0-2.9 3.6c-.6 1.5-.9 3.3-.9 5.4 0 2 .3 3.7 1 5.3a7.9 7.9 0 0 0 2.8 3.7c1.3.8 3 1.3 5 1.3s3.8-.5 5.1-1.3c1.3-1 2.1-2 2.4-3.2h6a11.8 11.8 0 0 1-7 8.7 16 16 0 0 1-6.4 1.2ZM80 48c-2.2 0-4-.3-5.7-1a8.4 8.4 0 0 1-3.7-3.3 9.7 9.7 0 0 1-1.3-5.2c0-2 .5-3.8 1.5-5.2a9 9 0 0 1 4.3-3.1c1.8-.7 4-1 6.7-1H89v4.1h-7.5c-2 0-3.4.5-4.4 1.4-1 1-1.6 2.1-1.6 3.6s.5 2.7 1.6 3.6c1 1 2.5 1.4 4.4 1.4 1.1 0 2.2-.2 3.2-.7 1-.4 1.9-1 2.6-2 .6-1 1-2.4 1-4.2l1.7 2.1c-.2 2-.7 3.8-1.5 5.2a9 9 0 0 1-3.4 3.3 12 12 0 0 1-5.3 1Zm9.5-.7v-8.8h-1v-10c0-1.8-.5-3.2-1.4-4.1-1-1-2.4-1.4-4.2-1.4a142.9 142.9 0 0 0-10.2.4v-5.6a74.8 74.8 0 0 1 8.6-.4c3 0 5.5.4 7.5 1.2s3.4 2 4.4 3.6c1 1.7 1.4 4 1.4 6.7v18.4h-5Zm12.9 0V17.8h5v12.3h-.2c0-4.2 1-7.4 2.8-9.5a11 11 0 0 1 8.3-3.1h1v5.6h-2a9 9 0 0 0-6.3 2.2c-1.5 1.5-2.2 3.6-2.2 6.4v15.6h-6.4Zm34.4 1a15 15 0 0 1-6.6-1.3c-1.9-.9-3.4-2-4.7-3.5a15.5 15.5 0 0 1-2.7-5c-.6-1.7-1-3.6-1-5.4v-1c0-2 .4-3.8 1-5.6a15 15 0 0 1 2.8-4.9c1.3-1.5 2.8-2.6 4.6-3.5a16.4 16.4 0 0 1 13.3.2c2 1 3.5 2.3 4.8 4a12 12 0 0 1 2 6H144c-.2-1.6-1-3-2.2-4.1a7.5 7.5 0 0 0-5.2-1.7 8 8 0 0 0-4.7 1.3 8 8 0 0 0-2.8 3.6 13.8 13.8 0 0 0 0 10.3c.6 1.5 1.5 2.7 2.8 3.6s2.8 1.3 4.8 1.3c1.5 0 2.7-.2 3.8-.8a7 7 0 0 0 2.6-2c.7-1 1-2 1.2-3.2h6.2a11 11 0 0 1-2 6.2 15.1 15.1 0 0 1-11.8 5.5Zm19.7-1v-40h6.4V31h-1.3c0-3 .4-5.5 1.1-7.6a9.7 9.7 0 0 1 3.5-4.8A9.9 9.9 0 0 1 172 17h.3c3.5 0 6 1.1 7.9 3.5 1.7 2.3 2.6 5.7 2.6 10v16.8h-6.4V29.6c0-2.1-.6-3.8-1.8-5a6.4 6.4 0 0 0-4.8-1.8c-2 0-3.7.7-5 2a7.8 7.8 0 0 0-1.9 5.5v17h-6.4Zm63.8 1a12.2 12.2 0 0 1-10.9-6.2 19 19 0 0 1-1.8-7.3h1.4v12.5h-5.1v-40h6.4v19.8l-2 3.5c.2-3.1.8-5.7 1.9-7.7a11 11 0 0 1 4.4-4.5c1.8-1 3.9-1.5 6.1-1.5a13.4 13.4 0 0 1 12.8 9.1c.7 1.9 1 3.8 1 6v1c0 2.2-.3 4.1-1 6a13.6 13.6 0 0 1-13.2 9.4Zm-1.2-5.5a8.4 8.4 0 0 0 7.9-5c.7-1.5 1.1-3.3 1.1-5.3s-.4-3.8-1.1-5.3a8.7 8.7 0 0 0-3.2-3.6 9.6 9.6 0 0 0-9.2-.2 8.5 8.5 0 0 0-3.3 3.2c-.8 1.4-1.3 3-1.3 5v2.3a9 9 0 0 0 1.3 4.8 9 9 0 0 0 3.4 3c1.4.7 2.8 1 4.4 1Zm27.3 3.9-10-28.9h6.5l9.5 28.9h-6Zm-7.5 12.2v-5.7h4.9c1 0 2-.1 2.9-.4a4 4 0 0 0 2-1.4c.4-.7.9-1.6 1.2-2.7l8.6-30.9h6.2l-9.3 32.4a14 14 0 0 1-2.5 5 8.9 8.9 0 0 1-4 2.8c-1.5.6-3.4.9-5.6.9h-4.4Zm9-12.2v-5.2h6.4v5.2H248Z"}),sn("path",{fill:"dark"===n?"#FFF":"#003DFF",d:"M534.4 9.1H528a.8.8 0 0 1-.7-.7V1.8c0-.4.2-.7.6-.8l6.5-1c.4 0 .8.2.9.6v7.8c0 .4-.4.7-.8.7zM428 35.2V.8c0-.5-.3-.8-.7-.8h-.2l-6.4 1c-.4 0-.7.4-.7.8v35c0 1.6 0 11.8 12.3 12.2.5 0 .8-.4.8-.8V43c0-.4-.3-.7-.6-.8-4.5-.5-4.5-6-4.5-7zm106.5-21.8H528c-.4 0-.7.4-.7.8v34c0 .4.3.8.7.8h6.5c.4 0 .8-.4.8-.8v-34c0-.5-.4-.8-.8-.8zm-17.7 21.8V.8c0-.5-.3-.8-.8-.8l-6.5 1c-.4 0-.7.4-.7.8v35c0 1.6 0 11.8 12.3 12.2.4 0 .8-.4.8-.8V43c0-.4-.3-.7-.7-.8-4.4-.5-4.4-6-4.4-7zm-22.2-20.6a16.5 16.5 0 0 1 8.6 9.3c.8 2.2 1.3 4.8 1.3 7.5a19.4 19.4 0 0 1-4.6 12.6 14.8 14.8 0 0 1-5.2 3.6c-2 .9-5.2 1.4-6.8 1.4a21 21 0 0 1-6.7-1.4 15.4 15.4 0 0 1-8.6-9.3 21.3 21.3 0 0 1 0-14.4 15.2 15.2 0 0 1 8.6-9.3c2-.8 4.3-1.2 6.7-1.2s4.6.4 6.7 1.2zm-6.7 27.6c2.7 0 4.7-1 6.2-3s2.2-4.3 2.2-7.8-.7-6.3-2.2-8.3-3.5-3-6.2-3-4.7 1-6.1 3c-1.5 2-2.2 4.8-2.2 8.3s.7 5.8 2.2 7.8 3.5 3 6.2 3zm-88.8-28.8c-6.2 0-11.7 3.3-14.8 8.2a18.6 18.6 0 0 0 4.8 25.2c1.8 1.2 4 1.8 6.2 1.7s.1 0 .1 0h.9c4.2-.7 8-4 9.1-8.1v7.4c0 .4.3.7.8.7h6.4a.7.7 0 0 0 .7-.7V14.2c0-.5-.3-.8-.7-.8h-13.5zm6.3 26.5a9.8 9.8 0 0 1-5.7 2h-.5a10 10 0 0 1-9.2-14c1.4-3.7 5-6.3 9-6.3h6.4v18.3zm152.3-26.5h13.5c.5 0 .8.3.8.7v33.7c0 .4-.3.7-.8.7h-6.4a.7.7 0 0 1-.8-.7v-7.4c-1.2 4-4.8 7.4-9 8h-.1a4.2 4.2 0 0 1-.5.1h-.9a10.3 10.3 0 0 1-7-2.6c-4-3.3-6.5-8.4-6.5-14.2 0-3.7 1-7.2 3-10 3-5 8.5-8.3 14.7-8.3zm.6 28.4c2.2-.1 4.2-.6 5.7-2V21.7h-6.3a9.8 9.8 0 0 0-9 6.4 10.2 10.2 0 0 0 9.1 13.9h.5zM452.8 13.4c-6.2 0-11.7 3.3-14.8 8.2a18.5 18.5 0 0 0 3.6 24.3 10.4 10.4 0 0 0 13 .6c2.2-1.5 3.8-3.7 4.5-6.1v7.8c0 2.8-.8 5-2.2 6.3-1.5 1.5-4 2.2-7.5 2.2l-6-.3c-.3 0-.7.2-.8.5l-1.6 5.5c-.1.4.1.8.5 1h.1c2.8.4 5.5.6 7 .6 6.3 0 11-1.4 14-4.1 2.7-2.5 4.2-6.3 4.5-11.4V14.2c0-.5-.4-.8-.8-.8h-13.5zm6.3 8.2v18.3a9.6 9.6 0 0 1-5.6 2h-1a10.3 10.3 0 0 1-8.8-14c1.4-3.7 5-6.3 9-6.3h6.4zM291 31.5A32 32 0 0 1 322.8 0h30.8c.6 0 1.2.5 1.2 1.2v61.5c0 1.1-1.3 1.7-2.2 1l-19.2-17a18 18 0 0 1-11 3.4 18.1 18.1 0 1 1 18.2-14.8c-.1.4-.5.7-.9.6-.1 0-.3 0-.4-.2l-3.8-3.4c-.4-.3-.6-.8-.7-1.4a12 12 0 1 0-2.4 8.3c.4-.4 1-.5 1.6-.2l14.7 13.1v-46H323a26 26 0 1 0 10 49.7c.8-.4 1.6-.2 2.3.3l3 2.7c.3.2.3.7 0 1l-.2.2a32 32 0 0 1-47.2-28.6z"}))))}),uc=Lr("PoweredBy"),lc=J({name:"powered-by"}),fc=J({name:"query-rule-context"}),dc=function(e){var t=e.cssClasses,n=e.templates;return e=e.items,sn(Io,{templateKey:"default",templates:n,rootProps:{className:t.root},data:{items:e}})},hc={default:function(e){return e=e.items,JSON.stringify(e,null,2)}},pc=J({name:"query-rule-custom-data"}),mc=Lr("QueryRuleCustomData"),gc=["item","sendEvent"],vc=J({name:"related-products"}),yc=(nc=(Hu={createElement:sn,Fragment:un}).createElement,rc=Hu.Fragment,function(e){var t=void 0===(t=e.classNames)?{}:t,n=void 0===(n=e.emptyComponent)?ha({createElement:nc,Fragment:rc}):n,r=void 0===(r=e.headerComponent)?pa({createElement:nc}):r,i=void 0===(i=e.itemComponent)?ma({createElement:nc,Fragment:rc}):i,a=void 0===(a=e.layout)?ga({createElement:nc}):a,o=e.items,s=e.status,c=e.translations,u=e.sendEvent;return e=fa(e,Ca),c=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Na(Object(n),!0).forEach((function(t){ua(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Na(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({title:"Related products",sliderLabel:"Related products"},c),t={root:da("ais-RelatedProducts",t.root),emptyRoot:da("ais-RelatedProducts",t.root,"ais-RelatedProducts--empty",t.emptyRoot,e.className),title:da("ais-RelatedProducts-title",t.title),container:da("ais-RelatedProducts-container",t.container),list:da("ais-RelatedProducts-list",t.list),item:da("ais-RelatedProducts-item",t.item)},0===o.length&&"idle"===s?nc("section",aa({},e,{className:t.emptyRoot}),nc(n,null)):nc("section",aa({},e,{className:t.root}),nc(r,{classNames:t,items:o,translations:c}),nc(a,{classNames:t,itemComponent:i,items:o,sendEvent:u}))});function bc(e){return e.replace(/^(0+)\d/,(function(e){return Number(e).toString()}))}function _c(e){var t=e.style,r=(e=e.children,Math.round(parseFloat(t.left))),i=[0,50,100].includes(r);return e=Math.round(100*parseInt(e,10))/100,sn("div",{style:n(n({},t),{},{marginLeft:100===r?"-2px":0}),className:da("rheostat-marker","rheostat-marker-horizontal",i&&"rheostat-marker-large")},i&&sn("div",{className:"rheostat-value"},e))}var wc=function(){u(t,ln);var e=m(t);function t(){var n,r;a(this,t);for(var i=arguments.length,o=new Array(i),c=0;c<i;c++)o[c]=arguments[c];return s(p(r=e.call.apply(e,[this].concat(o))),"state",{min:null==(n=r.props.values.min)?void 0:n.toString(),max:null==(n=r.props.values.max)?void 0:n.toString()}),s(p(r),"onInput",(function(e){return function(t){t=t.currentTarget.value,r.setState(s({},e,t))}})),s(p(r),"onSubmit",(function(e){e.preventDefault();var t=(e=r.state).min;e=e.max,r.props.refine([t?Number(t):void 0,e?Number(e):void 0])})),r}return o(t,[{key:"componentWillReceiveProps",value:function(e){var t;this.setState({min:null==(t=e.values.min)?void 0:t.toString(),max:null==(t=e.values.max)?void 0:t.toString()})}},{key:"render",value:function(){var e=(t=this.state).min,t=t.max,n=(o=this.props).min,r=o.max,i=o.step,a=o.cssClasses,o=o.templateProps,s=!(!n||!r)&&r<=n,u=Boolean(e||t);return sn("div",{className:da(a.root,!u&&a.noRefinement)},sn("form",{className:a.form,onSubmit:this.onSubmit},sn("label",{className:a.label},sn("input",{className:da(a.input,a.inputMin),type:"number",min:n,max:r,step:i,value:bc(null!=e?e:""),onInput:this.onInput("min"),placeholder:null==n?void 0:n.toString(),disabled:s})),sn(Io,c({},o,{templateKey:"separatorText",rootTagName:"span",rootProps:{className:a.separator}})),sn("label",{className:a.label},sn("input",{className:da(a.input,a.inputMax),type:"number",min:n,max:r,step:i,value:bc(null!=t?t:""),onInput:this.onInput("max"),placeholder:null==r?void 0:r.toString(),disabled:s})),sn(Io,c({},o,{templateKey:"submitText",rootTagName:"button",rootProps:{type:"submit",className:a.submit,disabled:s}}))))}}]),t}(),Sc=J({name:"range-input"}),Rc=Lr("RangeInput"),Pc={separatorText:function(){return"to"},submitText:function(){return"Go"}},xc=100;function Oc(e,t,n){return(e-t)/(n-t)*100}function Ec(e,t,n){return 0===e?t:100===e?n:Math.round(e/100*(n-t)+t)}function Cc(e){return["rheostat","vertical"===e.orientation?"rheostat-vertical":"rheostat-horizontal"].concat(e.className.split(" ")).join(" ")}function Nc(e){return Number(e.currentTarget.getAttribute("data-handle-key"))}function jc(e){e.stopPropagation(),e.preventDefault()}var Tc=sn("div",{className:"rheostat-background"}),kc=function(){u(t,ln);var e=m(t);function t(){var n;a(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return s(p(n=e.call.apply(e,[this].concat(i))),"x",[0,0].map((function(e){return e}))),s(p(n),"state",{className:Cc(n.props),handlePos:n.props.values.map((function(e){return Oc(e,n.props.min,n.props.max)})),handleDimensions:0,mousePos:null,sliderBox:{},slidingIndex:null,values:n.props.values}),s(p(n),"rheostat",{current:null}),s(p(n),"componentWillReceiveProps",(function(e){var t=(o=n.props).className,r=o.disabled,i=o.min,a=o.max,o=o.orientation,s=(c=n.state).values,c=c.slidingIndex;i=e.min!==i||e.max!==a,a=s.length!==e.values.length||s.some((function(t,n){return e.values[n]!==t})),s=e.className!==t||e.orientation!==o,t=e.disabled&&!r,s&&n.setState({className:Cc(e)}),(i||a)&&n.updateNewValues(e),t&&null!==c&&n.endSlide()})),s(p(n),"getPublicState",(function(){var e=n.props,t=e.min;return{max:e.max,min:t,values:n.state.values}})),s(p(n),"getSliderBoundingBox",(function(){var e=n.rheostat.current,t=e.getBoundingClientRect();return{height:t.height||e.clientHeight,left:t.left,top:t.top,width:t.width||e.clientWidth}})),s(p(n),"getProgressStyle",(function(e){var t=n.state.handlePos,r=t[e];return 0===e?"vertical"===n.props.orientation?{height:"".concat(r,"%"),top:0}:{left:0,width:"".concat(r,"%")}:(t=r-(r=t[e-1]),"vertical"===n.props.orientation?{height:"".concat(t,"%"),top:"".concat(r,"%")}:{left:"".concat(r,"%"),width:"".concat(t,"%")})})),s(p(n),"getMinValue",(function(e){return n.state.values[e-1]?Math.max(n.props.min,n.state.values[e-1]):n.props.min})),s(p(n),"getMaxValue",(function(e){return n.state.values[e+1]?Math.min(n.props.max,n.state.values[e+1]):n.props.max})),s(p(n),"getHandleDimensions",(function(e,t){return(e=e.currentTarget||null)?"vertical"===n.props.orientation?e.clientHeight/t.height*xc/2:e.clientWidth/t.width*xc/2:0})),s(p(n),"getClosestSnapPoint",(function(e){return n.props.snapPoints.length?n.props.snapPoints.reduce((function(t,n){return Math.abs(t-e)<Math.abs(n-e)?t:n})):e})),s(p(n),"getSnapPosition",(function(e){var t,r,i;return n.props.snap?(t=(r=n.props).max,i=Ec(e,r=r.min,t),Oc(n.getClosestSnapPoint(i),r,t)):e})),s(p(n),"getNextPositionForKey",(function(e,t){var r=(i=n.state).handlePos,i=i.values,a=(c=n.props).max,o=c.min,c=c.snapPoints,u=n.props.snap,l=i[e],f=r=r[e],d=1,h=(100<=a?r=Math.round(r):d=100/(a-o),null);if(u&&(h=c.indexOf(n.getClosestSnapPoint(i[e]))),s(i={},37,(function(e){return-1*e})),s(i,39,(function(e){return e})),s(i,38,(function(e){return e})),s(i,40,(function(e){return-1*e})),s(i,34,(function(e){return 1<e?-e:-10*e})),s(i,33,(function(e){return 1<e?e:10*e})),e=i,Object.prototype.hasOwnProperty.call(e,t))r+=e[t](d),u&&h&&(f<r?h<c.length-1&&(l=c[h+1]):0<h&&(l=c[h-1]));else if(36===t)r=0,u&&(l=c[0]);else{if(35!==t)return null;r=xc,u&&(l=c[c.length-1])}return u?Oc(l,o,a):r})),s(p(n),"getNextState",(function(e,t){var r=n.state.handlePos,i=(s=n.props).max,a=s.min,o=n.validatePosition(e,t),s=r.map((function(t,n){return n===e?o:t}));return{handlePos:s,values:s.map((function(e){return Ec(e,a,i)}))}})),s(p(n),"getClosestHandle",(function(e){var t=n.state.handlePos;return t.reduce((function(n,r,i){return Math.abs(t[i]-e)<Math.abs(t[n]-e)?i:n}),0)})),s(p(n),"setStartSlide",(function(e,t,r){var i=n.getSliderBoundingBox();n.setState({handleDimensions:n.getHandleDimensions(e,i),mousePos:{x:t,y:r},sliderBox:i,slidingIndex:Nc(e)})})),s(p(n),"startMouseSlide",(function(e){n.setStartSlide(e,e.clientX,e.clientY),document.addEventListener("mousemove",n.handleMouseSlide,!1),document.addEventListener("mouseup",n.endSlide,!1),jc(e)})),s(p(n),"startTouchSlide",(function(e){var t;1<e.changedTouches.length||(t=e.changedTouches[0],n.setStartSlide(e,t.clientX,t.clientY),document.addEventListener("touchmove",n.handleTouchSlide,!1),document.addEventListener("touchend",n.endSlide,!1),n.props.onSliderDragStart&&n.props.onSliderDragStart(),jc(e))})),s(p(n),"handleMouseSlide",(function(e){null!==n.state.slidingIndex&&(n.handleSlide(e.clientX,e.clientY),jc(e))})),s(p(n),"handleTouchSlide",(function(e){var t;null!==n.state.slidingIndex&&(1<e.changedTouches.length?n.endSlide():(t=e.changedTouches[0],n.handleSlide(t.clientX,t.clientY),jc(e)))})),s(p(n),"handleSlide",(function(e,t){var r=(i=n.state).slidingIndex,i=i.sliderBox;i="vertical"===n.props.orientation?(t-i.top)/i.height*xc:(e-i.left)/i.width*xc,n.slideTo(r,i),n.canMove(r,i)&&(n.setState({mousePos:{x:e,y:t}}),n.props.onSliderDragMove)&&n.props.onSliderDragMove()})),s(p(n),"endSlide",(function(){var e,t=n.state.slidingIndex;n.setState({slidingIndex:null}),document.removeEventListener("mouseup",n.endSlide,!1),document.removeEventListener("touchend",n.endSlide,!1),document.removeEventListener("touchmove",n.handleTouchSlide,!1),document.removeEventListener("mousemove",n.handleMouseSlide,!1),n.props.onSliderDragEnd&&n.props.onSliderDragEnd(),n.props.snap?(e=n.getSnapPosition(n.state.handlePos[t]),n.slideTo(t,e,(function(){return n.fireChangeEvent()}))):n.fireChangeEvent()})),s(p(n),"handleClick",(function(e){var t;e.target.getAttribute("data-handle-key")||(t=n.getSliderBoundingBox(),e=("vertical"===n.props.orientation?(e.clientY-t.top)/t.height:(e.clientX-t.left)/t.width)*xc,t=n.getClosestHandle(e),e=n.getSnapPosition(e),n.slideTo(t,e,(function(){return n.fireChangeEvent()})),n.props.onClick&&n.props.onClick())})),s(p(n),"handleKeydown",(function(e){var t,r=Nc(e);27===e.keyCode?e.currentTarget.blur():null!==(t=n.getNextPositionForKey(r,e.keyCode))&&(n.canMove(r,t)&&(n.slideTo(r,t,(function(){return n.fireChangeEvent()})),n.props.onKeyPress)&&n.props.onKeyPress(),jc(e))})),s(p(n),"validatePosition",(function(e,t){var r=(i=n.state).handlePos,i=i.handleDimensions;return Math.max(Math.min(t,void 0!==r[e+1]?r[e+1]-i:xc),void 0!==r[e-1]?r[e-1]+i:0)})),s(p(n),"validateValues",(function(e,t){var r=(t=t||n.props).max,i=t.min;return e.map((function(e,t,n){return e=Math.max(Math.min(e,r),i),n.length&&e<n[t-1]?n[t-1]:e}))})),s(p(n),"canMove",(function(e,t){var r=(i=n.state).handlePos,i=i.handleDimensions;return!(t<0||xc<t||(void 0!==r[e+1]?r[e+1]-i:1/0)<t||t<(void 0!==r[e-1]?r[e-1]+i:-1/0))})),s(p(n),"fireChangeEvent",(function(){var e=n.props.onChange;e&&e(n.getPublicState())})),s(p(n),"slideTo",(function(e,t,r){e=n.getNextState(e,t),n.setState(e,(function(){var e=n.props.onValuesUpdated;e&&e(n.getPublicState()),r&&r()}))})),s(p(n),"updateNewValues",(function(e){var t,r,i;null===n.state.slidingIndex&&(t=e.max,r=e.min,i=e.values,i=n.validateValues(i,e),n.setState({handlePos:i.map((function(e){return Oc(e,r,t)})),values:i},(function(){return n.fireChangeEvent()})))})),s(p(n),"render",(function(){var e,t=(e=n.props).children,r=e.disabled,i=e.handle,a=e.max,o=e.min,s=e.orientation,c=e.pitComponent,u=e.pitPoints,l=e.progressBar,f=(e=n.state).className,d=e.handlePos,h=e.values;return sn("div",{className:f,ref:n.rheostat,onClick:r?void 0:n.handleClick,style:{position:"relative"}},Tc,d.map((function(e,t){return e="vertical"===s?{top:"".concat(e,"%"),position:"absolute"}:{left:"".concat(e,"%"),position:"absolute"},sn(i,{"aria-valuemax":n.getMaxValue(t),"aria-valuemin":n.getMinValue(t),"aria-valuenow":h[t],"aria-disabled":r,"data-handle-key":t,className:"rheostat-handle",key:"handle-".concat(t),onClick:jc,onKeyDown:r?void 0:n.handleKeydown,onMouseDown:r?void 0:n.startMouseSlide,onTouchStart:r?void 0:n.startTouchSlide,role:"slider",style:e,tabIndex:0})})),d.map((function(e,t,r){return 0===t&&1<r.length?null:sn(l,{className:"rheostat-progress",key:"progress-bar-".concat(t),style:n.getProgressStyle(t)})})),c&&u.map((function(e){var t=Oc(e,o,a);return t="vertical"===s?{top:"".concat(t,"%"),position:"absolute"}:{left:"".concat(t,"%"),position:"absolute"},sn(c,{key:"pit-".concat(e),style:t},e)})),t)})),n}return o(t)}(),Ic=(s(kc,"defaultProps",{className:"",children:null,disabled:!1,handle:function(e){return sn("button",c({},e,{type:"button"}))},max:xc,min:0,onClick:null,onChange:null,onKeyPress:null,onSliderDragEnd:null,onSliderDragMove:null,onSliderDragStart:null,onValuesUpdated:null,orientation:"horizontal",pitComponent:null,pitPoints:[],progressBar:"div",snap:!1,snapPoints:[],values:[0]}),function(){u(t,ln);var e=m(t);function t(){var n;a(this,t);for(var r=arguments.length,o=new Array(r),u=0;u<r;u++)o[u]=arguments[u];return s(p(n=e.call.apply(e,[this].concat(o))),"handleChange",(function(e){e=e.values,n.isDisabled||n.props.refine(e)})),s(p(n),"createHandleComponent",(function(e){return function(t){var n=Math.round(100*parseFloat(t["aria-valuenow"]))/100;return n="object"===i(e)&&e.format?e.format(n):n,sn("div",c({},t,{className:da(t.className,0===t["data-handle-key"]&&"rheostat-handle-lower",1===t["data-handle-key"]&&"rheostat-handle-upper"),"aria-label":0===t["data-handle-key"]?"Minimum Filter Handle":"Maximum Filter Handle"}),e&&sn("div",{className:"rheostat-tooltip"},n))}})),n}return o(t,[{key:"isDisabled",get:function(){return this.props.min>=this.props.max}},{key:"computeDefaultPitPoints",value:function(e){var t=e.min,n=((e=e.max)-t)/34;return[t].concat(v(be({end:33}).map((function(e){return t+n*(e+1)}))),[e])}},{key:"computeSnapPoints",value:function(e){var t=e.min,n=e.max;if(e=e.step)return[].concat(v(be({start:t,end:n,step:e})),[n])}},{key:"render",value:function(){var e=(i=this.props).tooltips,t=i.step,n=i.pips,r=i.values,i=i.cssClasses,a=(o=this.isDisabled?{min:this.props.min,max:this.props.max+.001}:this.props).min,o=o.max;return t=this.computeSnapPoints({min:a,max:o,step:t}),n=!1===n?[]:this.computeDefaultPitPoints({min:a,max:o}),sn("div",{className:da(i.root,this.isDisabled&&i.disabledRoot)},sn(kc,{handle:this.createHandleComponent(e),onChange:this.handleChange,min:a,max:o,pitComponent:_c,pitPoints:n,snap:!0,snapPoints:t,values:this.isDisabled?[a,o]:r,disabled:this.isDisabled}))}}]),t}()),Fc=J({name:"range-slider"}),Ac=Lr("RangeSlider");function Mc(e){var t=e.children,n=e.count,r=e.value,i=e.url;return e=e.cssClasses,n?sn("a",{className:da(e.link),"aria-label":"".concat(r," & up"),href:i},t):sn("div",{className:da(e.link),"aria-label":"".concat(r," & up"),disabled:!0},t)}var Lc,Hc,Dc={item:function(e){var t=e.count,n=e.value,r=e.url,i=e.stars,a=e.cssClasses;return sn(Mc,{count:t,value:n,url:r,cssClasses:a},i.map((function(e,t){return sn("svg",{key:t,className:da(a.starIcon,e?a.fullStarIcon:a.emptyStarIcon),"aria-hidden":"true",width:"24",height:"24"},sn("use",{xlinkHref:e?"#ais-RatingMenu-starSymbol":"#ais-RatingMenu-starEmptySymbol"}))})),sn("span",{"aria-hidden":"true",className:da(a.label)},"& Up"),t&&sn("span",{className:da(a.count)},Ki(t)))}},qc=J({name:"rating-menu"}),Uc=Lr("RatingMenu"),Wc=sn("path",{d:"M12 .288l2.833 8.718h9.167l-7.417 5.389 2.833 8.718-7.416-5.388-7.417 5.388 2.833-8.718-7.416-5.389h9.167z"}),Bc=sn("path",{d:"M12 6.76l1.379 4.246h4.465l-3.612 2.625 1.379 4.246-3.611-2.625-3.612 2.625 1.379-4.246-3.612-2.625h4.465l1.38-4.246zm0-6.472l-2.833 8.718h-9.167l7.416 5.389-2.833 8.718 7.417-5.388 7.416 5.388-2.833-8.718 7.417-5.389h-9.167l-2.833-8.718z"}),$c=sn("path",{d:"M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"}),Vc=sn("path",{d:"M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z"}),Qc=sn("g",{fill:"none","fill-rule":"evenodd"},sn("g",{transform:"translate(1 1)","stroke-width":"2"},sn("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),sn("path",{d:"M36 18c0-9.94-8.06-18-18-18"},sn("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))),Kc={reset:function(e){return sn("svg",{className:e.cssClasses.resetIcon,viewBox:"0 0 20 20",width:"10",height:"10","aria-hidden":"true"},$c)},submit:function(e){return sn("svg",{className:e.cssClasses.submitIcon,width:"10",height:"10",viewBox:"0 0 40 40","aria-hidden":"true"},Vc)},loadingIndicator:function(e){return sn("svg",{"aria-label":"Results are loading",className:e.cssClasses.loadingIcon,width:"16",height:"16",viewBox:"0 0 38 38",stroke:"#444","aria-hidden":"true"},Qc)}},zc={item:function(e){var t=e.cssClasses,n=e.count,r=e.value,i=e.highlighted,a=e.isRefined;return e=e.isFromSearch,sn("label",{className:da(t.label)},sn("input",{type:"checkbox",className:da(t.checkbox),value:r,defaultChecked:a}),sn("span",{className:da(t.labelText),dangerouslySetInnerHTML:e?{__html:i}:void 0},!e&&i),sn("span",{className:da(t.count)},Ki(n)))},showMoreText:function(e){return e.isShowingMore?"Show less":"Show more"},searchableNoResults:function(){return"No results"}},Gc=J({name:"refinement-list"}),Jc=Lr("RefinementList"),Yc=Lr("SearchBox"),Xc=function(e){var t=e.cssClasses,n=e.templates,r=e.isRelevantSorted,i=e.isVirtualReplica,a=e.refine;return i?sn("div",{className:t.root},sn(Io,{templateKey:"text",templates:n,rootProps:{className:t.text},data:{isRelevantSorted:r}}),sn("button",{type:"button",className:t.button,onClick:function(){a(r?0:void 0)}},sn(Io,{rootTagName:"span",templateKey:"button",templates:n,data:{isRelevantSorted:r}}))):null},Zc={text:function(){return""},button:function(e){return e.isRelevantSorted?"See all results":"See relevant results"}},eu=J({name:"relevant-sort"}),tu=Lr("RelevantSort"),nu=J({name:"search-box"}),ru=Lr("SearchBox"),iu=J({name:"sort-by"}),au=Lr("SortBy"),ou=["nbHits","nbSortedHits","cssClasses","templateProps"],su=function(e){var t=e.nbHits,r=e.nbSortedHits,i=e.cssClasses,a=e.templateProps;return e=h(e,ou),sn("div",{className:da(i.root)},sn(Io,c({},a,{templateKey:"text",rootTagName:"span",rootProps:{className:i.text},data:n({hasManySortedResults:r&&1<r,hasNoSortedResults:0===r,hasOneSortedResults:1===r,hasManyResults:1<t,hasNoResults:0===t,hasOneResult:1===t,nbHits:t,nbSortedHits:r,cssClasses:i},e)})))},cu=J({name:"stats"}),uu=Lr("Stats"),lu={text:function(e){return"".concat((e.areHitsSorted?function(e){var t=e.nbHits,n=e.hasNoSortedResults,r=e.hasOneSortedResults,i=e.hasManySortedResults;return e=e.nbSortedHits,t="sorted out of ".concat(Ki(t)),n?"No relevant results ".concat(t):r?"1 relevant result ".concat(t):i?"".concat(Ki(e||0)," relevant results ").concat(t):""}:function(e){var t=e.nbHits,n=e.hasNoResults,r=e.hasOneResult;return e=e.hasManyResults,n?"No results":r?"1 result":e?"".concat(Ki(t)," results"):""})(e)," found in ").concat(e.processingTimeMS,"ms")}},fu=function(e){var t=e.currentRefinement,n=e.refine,r=e.cssClasses;return e=e.templateProps,sn("div",{className:r.root},sn("label",{className:r.label},sn("input",{className:r.checkbox,type:"checkbox",checked:t.isRefined,onChange:function(e){return n({isRefined:!e.target.checked})}}),sn(Io,c({},e,{rootTagName:"span",rootProps:{className:r.labelText},templateKey:"labelText",data:t}))))},du={labelText:function(e){return e.name}},hu=J({name:"toggle-refinement"}),pu=Lr("ToggleRefinement"),mu=["item","sendEvent"],gu=J({name:"trending-items"}),vu=(Lc=(Hu={createElement:sn,Fragment:un}).createElement,Hc=Hu.Fragment,function(e){var t=void 0===(t=e.classNames)?{}:t,n=void 0===(n=e.emptyComponent)?ha({createElement:Lc,Fragment:Hc}):n,r=void 0===(r=e.headerComponent)?pa({createElement:Lc}):r,i=void 0===(i=e.itemComponent)?ma({createElement:Lc,Fragment:Hc}):i,a=void 0===(a=e.layout)?ga({createElement:Lc}):a,o=e.items,s=e.status,c=e.translations,u=e.sendEvent;return e=fa(e,ja),c=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ta(Object(n),!0).forEach((function(t){ua(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ta(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({title:"Trending items",sliderLabel:"Trending items"},c),t={root:da("ais-TrendingItems",t.root),emptyRoot:da("ais-TrendingItems",t.root,"ais-TrendingItems--empty",t.emptyRoot,e.className),title:da("ais-TrendingItems-title",t.title),container:da("ais-TrendingItems-container",t.container),list:da("ais-TrendingItems-list",t.list),item:da("ais-TrendingItems-item",t.item)},0===o.length&&"idle"===s?Lc("section",aa({},e,{className:t.emptyRoot}),Lc(n,null)):Lc("section",aa({},e,{className:t.root}),Lc(r,{classNames:t,items:o,translations:c}),Lc(a,{classNames:t,itemComponent:i,items:o,sendEvent:u}))});function yu(e){var t=e.status,n=e.errorCode;return e=e.isListening,"error"===t&&"not-allowed"===n?Pu:sn(un,null,sn("path",{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z",fill:e?"currentColor":"none"}),xu,Ou,Eu)}var bu,_u,wu,Su,Ru=function(e){var t=e.cssClasses,n=e.isBrowserSupported,r=e.isListening,i=e.toggleListening,a=e.voiceListeningState,o=(e=e.templates,a.status),s=a.transcript,c=a.isSpeechFinal;return a=a.errorCode,sn("div",{className:t.root},sn(Io,{templateKey:"buttonText",rootTagName:"button",rootProps:{className:t.button,type:"button",title:"Search by voice".concat(n?"":" (not supported on this browser)"),onClick:function(e){e.currentTarget instanceof HTMLElement&&e.currentTarget.blur(),i()},disabled:!n},data:{status:o,errorCode:a,isListening:r,transcript:s,isSpeechFinal:c,isBrowserSupported:n},templates:e}),sn(Io,{templateKey:"status",rootProps:{className:t.status},data:{status:o,errorCode:a,isListening:r,transcript:s,isSpeechFinal:c,isBrowserSupported:n},templates:e}))},Pu=sn(un,null,sn("line",{x1:"1",y1:"1",x2:"23",y2:"23"}),sn("path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6"}),sn("path",{d:"M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23"}),sn("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),sn("line",{x1:"8",y1:"23",x2:"16",y2:"23"})),xu=sn("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),Ou=sn("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),Eu=sn("line",{x1:"8",y1:"23",x2:"16",y2:"23"}),Cu={buttonText:function(e){return sn("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},sn(yu,{status:e.status,errorCode:e.errorCode,isListening:e=e.isListening}))},status:function(e){return sn("p",null,e.transcript)}},Nu=J({name:"voice-search"}),ju=Lr("VoiceSearch"),Tu=["item","sendEvent"],ku=J({name:"frequently-bought-together"}),Iu=(bu=(Hu={createElement:sn,Fragment:un}).createElement,_u=Hu.Fragment,function(e){var t=void 0===(t=e.classNames)?{}:t,n=void 0===(n=e.emptyComponent)?ha({createElement:bu,Fragment:_u}):n,r=void 0===(r=e.headerComponent)?pa({createElement:bu}):r,i=void 0===(i=e.itemComponent)?ma({createElement:bu,Fragment:_u}):i,a=void 0===(a=e.layout)?ga({createElement:bu}):a,o=e.items,s=e.status,c=e.translations,u=e.sendEvent;return e=fa(e,Sa),c=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ra(Object(n),!0).forEach((function(t){ua(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ra(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({title:"Frequently bought together",sliderLabel:"Frequently bought together products"},c),t={root:da("ais-FrequentlyBoughtTogether",t.root),emptyRoot:da("ais-FrequentlyBoughtTogether",t.root,"ais-FrequentlyBoughtTogether--empty",t.emptyRoot,e.className),title:da("ais-FrequentlyBoughtTogether-title",t.title),container:da("ais-FrequentlyBoughtTogether-container",t.container),list:da("ais-FrequentlyBoughtTogether-list",t.list),item:da("ais-FrequentlyBoughtTogether-item",t.item)},0===o.length&&"idle"===s?bu("section",aa({},e,{className:t.emptyRoot}),bu(n,null)):bu("section",aa({},e,{className:t.root}),bu(r,{classNames:t,items:o,translations:c}),bu(a,{classNames:t,itemComponent:i,items:o,sendEvent:u}))}),Fu=["item","sendEvent"],Au=J({name:"looking-similar"}),Mu=(wu=(Hu={createElement:sn,Fragment:un}).createElement,Su=Hu.Fragment,function(e){var t=void 0===(t=e.classNames)?{}:t,n=void 0===(n=e.emptyComponent)?ha({createElement:wu,Fragment:Su}):n,r=void 0===(r=e.headerComponent)?pa({createElement:wu}):r,i=void 0===(i=e.itemComponent)?ma({createElement:wu,Fragment:Su}):i,a=void 0===(a=e.layout)?ga({createElement:wu}):a,o=e.items,s=e.status,c=e.translations,u=e.sendEvent;return e=fa(e,Oa),c=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ea(Object(n),!0).forEach((function(t){ua(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ea(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({title:"Looking similar",sliderLabel:"Looking similar"},c),t={root:da("ais-LookingSimilar",t.root),emptyRoot:da("ais-LookingSimilar",t.root,"ais-LookingSimilar--empty",t.emptyRoot,e.className),title:da("ais-LookingSimilar-title",t.title),container:da("ais-LookingSimilar-container",t.container),list:da("ais-LookingSimilar-list",t.list),item:da("ais-LookingSimilar-item",t.item)},0===o.length&&"idle"===s?wu("section",aa({},e,{className:t.emptyRoot}),wu(n,null)):wu("section",aa({},e,{className:t.root}),wu(r,{classNames:t,items:o,translations:c}),wu(a,{classNames:t,itemComponent:i,items:o,sendEvent:u}))});function Lu(e){return new Yi(e)}var Hu=w(so),Du=(so=w((function(e){return n(n({},kt(_)(e)),{},{$$widgetType:"ais.configureRelatedItems"})})),w(Wo));return Hu=Object.freeze({__proto__:null,EXPERIMENTAL_answers:Hu,EXPERIMENTAL_configureRelatedItems:so,EXPERIMENTAL_dynamicWidgets:Du,dynamicWidgets:Wo,analytics:function(e){var t,r,i,a,o,s,c,u,l,f,d=(f=e||{}).pushFunction,h=void 0===(m=f.delay)?3e3:m,p=void 0!==(m=f.triggerOnUIInteraction)&&m,m=f.pushInitialSearch,g=void 0!==(f=f.pushPagination)&&f;if(d)return t=null,r=function(e){var t,n,r=[];for(t in e)e.hasOwnProperty(t)&&(n=e[t].join("+"),r.push("".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(t),"_").concat(encodeURIComponent(n))));return r.join("&")},i=function(e){var t,n=[];for(t in e)if(e.hasOwnProperty(t)){var r=e[t];if(r.hasOwnProperty(">=")&&r.hasOwnProperty("<="))r[">="]&&r[">="][0]===r["<="]&&r["<="][0]?n.push("".concat(t,"=").concat(t,"_").concat(r[">="])):n.push("".concat(t,"=").concat(t,"_").concat(r[">="],"to").concat(r["<="]));else if(r.hasOwnProperty(">="))n.push("".concat(t,"=").concat(t,"_from").concat(r[">="]));else if(r.hasOwnProperty("<="))n.push("".concat(t,"=").concat(t,"_to").concat(r["<="]));else if(r.hasOwnProperty("=")){var i,a=[];for(i in r["="])r["="].hasOwnProperty(i)&&a.push(r["="][i]);n.push("".concat(t,"=").concat(t,"_").concat(a.join("-")))}}return n.join("&")},o=function(e){var t,o,s;null!==e&&(t=[],o=r(n(n(n({},e.state.disjunctiveFacetsRefinements),e.state.facetsRefinements),e.state.hierarchicalFacetsRefinements)),s=i(e.state.numericRefinements),""!==o&&t.push(o),""!==s&&t.push(s),o=t.join("&"),s="Query: ".concat(e.state.query||"",", ").concat(o),!0===g&&(s+=", Page: ".concat(e.state.page||0)),a!==s)&&(d(o,e.state,e.results),a=s)},c=!(a="")!==(void 0===m||m),u=function(){o(t)},l=function(){o(t)},{$$type:"ais.analytics",$$widgetType:"ais.analytics",init:function(){!0===p&&(document.addEventListener("click",u),window.addEventListener("beforeunload",l))},render:function(e){var n=e.results;e=e.state,n&&(!0===c?c=!1:(t={results:n,state:e},s&&clearTimeout(s),s=window.setTimeout((function(){return o(t)}),h)))},dispose:function(){!0===p&&(document.removeEventListener("click",u),window.removeEventListener("beforeunload",l))},getRenderState:function(e,t){return n(n({},e),{},{analytics:this.getWidgetRenderState(t)})},getWidgetRenderState:function(){return{widgetParams:e}}};throw new Error(Ko("The `pushFunction` option is required."))},breadcrumb:function(e){var t,r,i,a,o,s=(e=e||{}).container,c=e.attributes,u=e.separator,l=e.rootPath,f=e.transformItems,d=void 0===(d=e.templates)?{}:d;if(e=void 0===(e=e.cssClasses)?{}:e,s)return t=te(s),s={root:da(Yo(),e.root),noRefinementRoot:da(Yo({modifierName:"noRefinement"}),e.noRefinementRoot),list:da(Yo({descendantName:"list"}),e.list),item:da(Yo({descendantName:"item"}),e.item),selectedItem:da(Yo({descendantName:"item",modifierName:"selected"}),e.selectedItem),separator:da(Yo({descendantName:"separator"}),e.separator),link:da(Yo({descendantName:"link"}),e.link)},r=(e={containerNode:t,cssClasses:s,renderState:{},templates:d}).containerNode,i=e.cssClasses,a=e.renderState,o=e.templates,n(n({},mr((function(e,t){var n=e.canRefine,s=e.createURL,c=e.instantSearchInstance,u=e.items;e=e.refine,t?a.templateProps=ro({defaultTemplates:Go,templatesConfig:c.templatesConfig,templates:o}):Pn(sn(zo,{canRefine:n,cssClasses:i,createURL:s,items:u,refine:e,templateProps:a.templateProps}),r)}),(function(){return Pn(null,t)}))({attributes:c,separator:u,rootPath:l,transformItems:f})),{},{$$widgetType:"ais.breadcrumb"});throw new Error(Jo("The `container` option is required."))},clearRefinements:function(e){var t,r,i,a,o,s=(e=e||{}).container,c=void 0===(c=e.templates)?{}:c,u=e.includedAttributes,l=e.excludedAttributes,f=e.transformItems;if(e=void 0===(e=e.cssClasses)?{}:e,s)return t=te(s),s={root:da(ts(),e.root),button:da(ts({descendantName:"button"}),e.button),disabledButton:da(ts({descendantName:"button",modifierName:"disabled"}),e.disabledButton)},r=(e={containerNode:t,cssClasses:s,renderState:{},templates:c}).containerNode,i=e.cssClasses,a=e.renderState,o=e.templates,n(n({},Ft((function(e,t){var n=e.refine,s=e.canRefine;e=e.instantSearchInstance,t?a.templateProps=ro({defaultTemplates:Zo,templatesConfig:e.templatesConfig,templates:o}):Pn(sn(Xo,{refine:n,cssClasses:i,hasRefinements:s,templateProps:a.templateProps}),r)}),(function(){return Pn(null,t)}))({includedAttributes:u,excludedAttributes:l,transformItems:f})),{},{$$widgetType:"ais.clearRefinements"});throw new Error(es("The `container` option is required."))},configure:function(e){return n(n({},Nt(_)({searchParameters:e})),{},{$$widgetType:"ais.configure"})},currentRefinements:function(e){var t,r=(e=e||{}).container,i=e.includedAttributes,a=e.excludedAttributes,o=void 0===(o=e.cssClasses)?{}:o;if(e=e.transformItems,r)return t=te(r),r={root:da(is(),o.root),noRefinementRoot:da(is({modifierName:"noRefinement"}),o.noRefinementRoot),list:da(is({descendantName:"list"}),o.list),item:da(is({descendantName:"item"}),o.item),label:da(is({descendantName:"label"}),o.label),category:da(is({descendantName:"category"}),o.category),categoryLabel:da(is({descendantName:"categoryLabel"}),o.categoryLabel),delete:da(is({descendantName:"delete"}),o.delete)},n(n({},Lt(Bo,(function(){return Pn(null,t)}))({container:t,cssClasses:r,includedAttributes:i,excludedAttributes:a,transformItems:e})),{},{$$widgetType:"ais.currentRefinements"});throw new Error(rs("The `container` option is required."))},geoSearch:function(e){var t,r,c,l,f,d,g=void 0===(g=(e=e||{}).initialZoom)?1:g,v=void 0===(v=e.initialPosition)?{lat:0,lng:0}:v,y=void 0===(y=e.templates)?{}:y,b=void 0===(b=e.cssClasses)?{}:b,_=void 0===(_=e.builtInMarker)?{}:_,w=e.customHTMLMarker,S=void 0===(S=e.enableRefine)||S,R=void 0===(R=e.enableClearMapRefinement)||R,P=void 0===(P=e.enableRefineControl)||P,x=e.container,O=e.googleReference;if(e=h(e,ds),!x)throw new Error(ms("The `container` option is required."));if(O)return t=te(x),x={root:da(gs(),b.root),tree:gs({descendantName:"tree"}),map:da(gs({descendantName:"map"}),b.map),control:da(gs({descendantName:"control"}),b.control),label:da(gs({descendantName:"label"}),b.label),selectedLabel:da(gs({descendantName:"label",modifierName:"selected"}),b.selectedLabel),input:da(gs({descendantName:"input"}),b.input),redo:da(gs({descendantName:"redo"}),b.redo),disabledRedo:da(gs({descendantName:"redo",modifierName:"disabled"}),b.disabledRedo),reset:da(gs({descendantName:"reset"}),b.reset)},r=n(n({},os),y),c=n(n({},{createOptions:function(){return{}},events:{}}),_),l=(Boolean(w)||Boolean(y.HTMLMarker))&&n(n({},{createOptions:function(){return{}},events:{}}),w),d=O,f=function(){u(t,d.maps.OverlayView);var e=m(t);function t(n){var r,o=n.__id,c=n.position,u=n.map,l=n.template,f=n.className;return n=void 0===(n=n.anchor)?{x:0,y:0}:n,a(this,t),s(p(r=e.call(this)),"__id",void 0),s(p(r),"anchor",void 0),s(p(r),"offset",void 0),s(p(r),"listeners",void 0),s(p(r),"latLng",void 0),s(p(r),"element",void 0),r.__id=o,r.anchor=n,r.listeners={},r.latLng=new d.maps.LatLng(c),r.element=document.createElement("div"),r.element.className=f,r.element.style.position="absolute","object"===i(l)?Pn(l,r.element):r.element.innerHTML=l,r.setMap(u),r}return o(t,[{key:"onAdd",value:function(){this.getPanes().overlayMouseTarget.appendChild(this.element);var e=this.element.getBoundingClientRect();this.offset={x:this.anchor.x+e.width/2,y:this.anchor.y+e.height},this.element.style.width="".concat(e.width,"px")}},{key:"draw",value:function(){var e=this.getProjection().fromLatLngToDivPixel(this.latLng);this.element.style.left="".concat(Math.round(e.x-this.offset.x),"px"),this.element.style.top="".concat(Math.round(e.y-this.offset.y),"px"),this.element.style.zIndex=String(parseInt(this.element.style.top,10))}},{key:"onRemove",value:function(){var e=this;this.element&&(this.element.parentNode.removeChild(this.element),Object.keys(this.listeners).forEach((function(t){e.element.removeEventListener(t,e.listeners[t])})),delete this.element,delete this.listeners)}},{key:"addListener",value:function(e,t){this.listeners[e]=t;var n=this.element;return n.addEventListener(e,t),{remove:function(){return n.removeEventListener(e,t)}}}},{key:"getPosition",value:function(){return this.latLng}}]),t}(),b=l?function(e){var t=e.item;return e=h(e,ps),new f(n(n(n({},l.createOptions(t)),e),{},{__id:t.objectID,position:t._geoloc,className:da(gs({descendantName:"marker"})),template:To({templateKey:"HTMLMarker",templates:r,data:t})}))}:function(e){var t=e.item;return e=h(e,hs),new O.maps.Marker(n(n(n({},c.createOptions(t)),e),{},{__id:t.objectID,position:t._geoloc}))},_=l||c,n(n({},Pr(Qo,(function(){return Pn(null,t)}))(n(n({},e),{},{templates:r,renderState:{},container:t,googleReference:O,initialZoom:g,initialPosition:v,cssClasses:x,createMarker:b,markerOptions:_,enableRefine:S,enableClearMapRefinement:R,enableRefineControl:P}))),{},{$$widgetType:"ais.geoSearch"});throw new Error(ms("The `googleReference` option is required."))},hierarchicalMenu:function(e){var t,r,i,a,o,s,c=(e=e||{}).container,u=e.attributes,l=e.separator,f=e.rootPath,d=e.showParentLevel,h=e.limit,p=void 0!==(p=e.showMore)&&p,m=e.showMoreLimit,g=e.sortBy,v=e.transformItems,y=void 0===(y=e.templates)?{}:y;if(e=void 0===(e=e.cssClasses)?{}:e,c)return t=te(c),c={root:da(Os(),e.root),noRefinementRoot:da(Os({modifierName:"noRefinement"}),e.noRefinementRoot),list:da(Os({descendantName:"list"}),e.list),childList:da(Os({descendantName:"list",modifierName:"child"}),e.childList),item:da(Os({descendantName:"item"}),e.item),selectedItem:da(Os({descendantName:"item",modifierName:"selected"}),e.selectedItem),parentItem:da(Os({descendantName:"item",modifierName:"parent"}),e.parentItem),link:da(Os({descendantName:"link"}),e.link),selectedItemLink:da(Os({descendantName:"link",modifierName:"selected"}),e.selectedItemLink),label:da(Os({descendantName:"label"}),e.label),count:da(Os({descendantName:"count"}),e.count),showMore:da(Os({descendantName:"showMore"}),e.showMore),disabledShowMore:da(Os({descendantName:"showMore",modifierName:"disabled"}),e.disabledShowMore)},r=(e={cssClasses:c,containerNode:t,templates:y,showMore:p,renderState:{}}).cssClasses,i=e.containerNode,a=e.showMore,o=e.templates,s=e.renderState,n(n({},Bt((function(e,t){var n=e.createURL,c=e.items,u=e.refine,l=e.instantSearchInstance,f=e.isShowingMore,d=e.toggleShowMore;e=e.canToggleShowMore,t?s.templateProps=ro({defaultTemplates:Ps,templatesConfig:l.templatesConfig,templates:o}):Pn(sn(Rs,{createURL:n,cssClasses:r,facetValues:c,templateProps:s.templateProps,toggleRefinement:u,showMore:a,toggleShowMore:d,isShowingMore:f,canToggleShowMore:e}),i)}),(function(){return Pn(null,t)}))({attributes:u,separator:l,rootPath:f,showParentLevel:d,limit:h,showMore:p,showMoreLimit:m,sortBy:g,transformItems:v})),{},{$$widgetType:"ais.hierarchicalMenu"});throw new Error(xs("The `container` option is required."))},hits:function(e){var t,r,i,a,o,s=(e=e||{}).container,u=e.escapeHTML,l=e.transformItems,f=void 0===(f=e.templates)?{}:f;if(e=void 0===(e=e.cssClasses)?{}:e,s)return t=te(s),r=(s={containerNode:t,cssClasses:e,renderState:{},templates:f}).renderState,i=s.cssClasses,a=s.containerNode,o=s.templates,n(n({},Gt(Kt)((function(e,t){var s,u=e.items,l=e.results,f=e.instantSearchInstance,p=e.insights,m=e.bindEvent,g=e.sendEvent;e=e.banner,t?r.templateProps=ro({defaultTemplates:Es,templatesConfig:f.templatesConfig,templates:o}):(s=On({insights:p,sendEvent:g}),Pn(sn(js,{hits:u,itemComponent:function(e){var t=e.hit,i=e.index,a=h(e,Cs);return sn(Io,c({},r.templateProps,{templateKey:"item",rootTagName:"li",rootProps:n(n({},a),{},{onClick:function(e){s(e),a.onClick()},onAuxClick:function(e){s(e),a.onAuxClick()}}),data:n(n({},t),{},{get __hitIndex(){return i}}),bindEvent:m,sendEvent:g}))},sendEvent:g,classNames:i,emptyComponent:function(e){return e=c({},(d(e),e)),sn(Io,c({},r.templateProps,{rootProps:e,templateKey:"empty",data:l,rootTagName:"fragment"}))},banner:e,bannerComponent:o.banner?function(e){return sn(Io,c({},r.templateProps,{templateKey:"banner",data:e,rootTagName:"fragment"}))}:void 0}),a))}),(function(){return Pn(null,t)}))({escapeHTML:u,transformItems:l})),{},{$$widgetType:"ais.hits"});throw new Error(Ns("The `container` option is required."))},hitsPerPage:function(e){var t,r,i,a=(e=e||{}).container,o=e.items,s=void 0===(s=e.cssClasses)?{}:s;if(e=e.transformItems,a)return t=te(a),a={root:da(As(),s.root),select:da(As({descendantName:"select"}),s.select),option:da(As({descendantName:"option"}),s.option)},r=(s={containerNode:t,cssClasses:a}).containerNode,i=s.cssClasses,n(n({},Cn((function(e,t){var n=e.items;e=e.refine,t||(t=(X(n,(function(e){return e.isRefined}))||{}).value,Pn(sn("div",{className:i.root},sn(ks,{cssClasses:i,currentValue:t,options:n,setValue:e})),r))}),(function(){return Pn(null,t)}))({items:o,transformItems:e})),{},{$$widgetType:"ais.hitsPerPage"});throw new Error(Fs("The `container` option is required."))},index:Vi,infiniteHits:function(e){var t,r,i,a,o,s,c=(e=e||{}).container,u=e.escapeHTML,l=e.transformItems,f=void 0===(f=e.templates)?{}:f,d=void 0===(d=e.cssClasses)?{}:d,h=e.showPrevious;if(e=e.cache,c)return t=te(c),c={root:da(Ds(),d.root),emptyRoot:da(Ds({modifierName:"empty"}),d.emptyRoot),item:da(Ds({descendantName:"item"}),d.item),list:da(Ds({descendantName:"list"}),d.list),loadPrevious:da(Ds({descendantName:"loadPrevious"}),d.loadPrevious),disabledLoadPrevious:da(Ds({descendantName:"loadPrevious",modifierName:"disabled"}),d.disabledLoadPrevious),loadMore:da(Ds({descendantName:"loadMore"}),d.loadMore),disabledLoadMore:da(Ds({descendantName:"loadMore",modifierName:"disabled"}),d.disabledLoadMore),bannerRoot:da(Ds({descendantName:"banner"}),d.bannerRoot),bannerImage:da(Ds({descendantName:"banner-image"}),d.bannerImage),bannerLink:da(Ds({descendantName:"banner-link"}),d.bannerLink)},r=(d={containerNode:t,cssClasses:c,templates:f,showPrevious:h,renderState:{}}).containerNode,i=d.cssClasses,a=d.renderState,o=d.templates,s=d.showPrevious,n(n({},Gt(An)((function(e,t){var n=e.items,c=e.results,u=e.showMore,l=e.showPrevious,f=e.isFirstPage,d=e.isLastPage,h=e.instantSearchInstance,p=e.insights,m=e.bindEvent,g=e.sendEvent;e=e.banner,t?a.templateProps=ro({defaultTemplates:Ls,templatesConfig:h.templatesConfig,templates:o}):Pn(sn(Ms,{cssClasses:i,hits:n,results:c,hasShowPrevious:s,showPrevious:l,showMore:u,templateProps:a.templateProps,isFirstPage:f,isLastPage:d,insights:p,sendEvent:g,bindEvent:m,banner:e}),r)}),(function(){return Pn(null,t)}))({escapeHTML:u,transformItems:l,showPrevious:h,cache:e})),{},{$$widgetType:"ais.infiniteHits"});throw new Error(Hs("The `container` option is required."))},menu:function(e){var t,r,i,a,o,s,c=(e=e||{}).container,u=e.attribute,l=e.sortBy,f=e.limit,d=e.showMore,h=e.showMoreLimit,p=void 0===(p=e.cssClasses)?{}:p,m=void 0===(m=e.templates)?{}:m;if(e=e.transformItems,c)return t=te(c),c={root:da(Ws(),p.root),noRefinementRoot:da(Ws({modifierName:"noRefinement"}),p.noRefinementRoot),list:da(Ws({descendantName:"list"}),p.list),item:da(Ws({descendantName:"item"}),p.item),selectedItem:da(Ws({descendantName:"item",modifierName:"selected"}),p.selectedItem),link:da(Ws({descendantName:"link"}),p.link),label:da(Ws({descendantName:"label"}),p.label),count:da(Ws({descendantName:"count"}),p.count),showMore:da(Ws({descendantName:"showMore"}),p.showMore),disabledShowMore:da(Ws({descendantName:"showMore",modifierName:"disabled"}),p.disabledShowMore)},r=(p={containerNode:t,cssClasses:c,renderState:{},templates:m,showMore:d}).containerNode,i=p.cssClasses,a=p.renderState,o=p.templates,s=p.showMore,n(n({},Mn((function(e,t){var c=e.refine,u=e.items,l=e.createURL,f=e.instantSearchInstance,d=e.isShowingMore,h=e.toggleShowMore;e=e.canToggleShowMore,t?a.templateProps=ro({defaultTemplates:qs,templatesConfig:f.templatesConfig,templates:o}):(t=u.map((function(e){return n(n({},e),{},{url:l(e.value)})})),Pn(sn(Rs,{createURL:l,cssClasses:i,facetValues:t,showMore:s,templateProps:a.templateProps,toggleRefinement:c,toggleShowMore:h,isShowingMore:d,canToggleShowMore:e}),r))}),(function(){return Pn(null,t)}))({attribute:u,limit:f,showMore:d,showMoreLimit:h,sortBy:l,transformItems:e})),{},{$$widgetType:"ais.menu"});throw new Error(Us("The `container` option is required."))},menuSelect:function(e){var t,r,i,a,o,s=(e=e||{}).container,c=e.attribute,u=void 0===(u=e.sortBy)?["name:asc"]:u,l=void 0===(l=e.limit)?10:l,f=void 0===(f=e.cssClasses)?{}:f,d=void 0===(d=e.templates)?{}:d;if(e=e.transformItems,s)return t=te(s),s={root:da(Qs(),f.root),noRefinementRoot:da(Qs({modifierName:"noRefinement"}),f.noRefinementRoot),select:da(Qs({descendantName:"select"}),f.select),option:da(Qs({descendantName:"option"}),f.option)},r=(f={containerNode:t,cssClasses:s,renderState:{},templates:d}).containerNode,i=f.cssClasses,a=f.renderState,o=f.templates,n(n({},Mn((function(e,t){var n=e.refine,s=e.items;e=e.instantSearchInstance,t?a.templateProps=ro({defaultTemplates:$s,templatesConfig:e.templatesConfig,templates:o}):Pn(sn(Bs,{cssClasses:i,items:s,refine:n,templateProps:a.templateProps}),r)}),(function(){return Pn(null,t)}))({attribute:c,limit:l,sortBy:u,transformItems:e})),{},{$$widgetType:"ais.menuSelect"});throw new Error(Vs("The `container` option is required."))},numericMenu:function(e){var t,r,i,a,o,s,c=(e=e||{}).container,u=e.attribute,l=e.items,f=void 0===(f=e.cssClasses)?{}:f,d=void 0===(d=e.templates)?{}:d;if(e=e.transformItems,c)return t=te(c),c={root:da(Gs(),f.root),noRefinementRoot:da(Gs({modifierName:"noRefinement"}),f.noRefinementRoot),list:da(Gs({descendantName:"list"}),f.list),item:da(Gs({descendantName:"item"}),f.item),selectedItem:da(Gs({descendantName:"item",modifierName:"selected"}),f.selectedItem),label:da(Gs({descendantName:"label"}),f.label),radio:da(Gs({descendantName:"radio"}),f.radio),labelText:da(Gs({descendantName:"labelText"}),f.labelText)},r=(f={containerNode:t,attribute:u,cssClasses:c,renderState:{},templates:d}).containerNode,i=f.attribute,a=f.cssClasses,o=f.renderState,s=f.templates,n(n({},qn((function(e,t){var n=e.createURL,c=e.instantSearchInstance,u=e.refine;e=e.items,t?o.templateProps=ro({defaultTemplates:Ks,templatesConfig:c.templatesConfig,templates:s}):Pn(sn(Rs,{createURL:n,cssClasses:a,facetValues:e,templateProps:o.templateProps,toggleRefinement:u,attribute:i}),r)}),(function(){return Pn(null,t)}))({attribute:u,items:l,transformItems:e})),{},{$$widgetType:"ais.numericMenu"});throw new Error(zs("The `container` option is required."))},pagination:function(e){var t,r,i,a,o,s,c,u,l,f=(e=e||{}).container,d=void 0===(d=e.templates)?{}:d,h=void 0===(h=e.cssClasses)?{}:h,p=e.totalPages,m=e.padding,g=void 0===(g=e.showFirst)||g,v=void 0===(v=e.showLast)||v,y=void 0===(y=e.showPrevious)||y,b=void 0===(b=e.showNext)||b;if(e=void 0===(e=e.scrollTo)?"body":e,f)return t=te(f),e=!1!==(f=!0===e?"body":e)&&te(f),f={root:da(Xs(),h.root),noRefinementRoot:da(Xs({modifierName:"noRefinement"}),h.noRefinementRoot),list:da(Xs({descendantName:"list"}),h.list),item:da(Xs({descendantName:"item"}),h.item),firstPageItem:da(Xs({descendantName:"item",modifierName:"firstPage"}),h.firstPageItem),lastPageItem:da(Xs({descendantName:"item",modifierName:"lastPage"}),h.lastPageItem),previousPageItem:da(Xs({descendantName:"item",modifierName:"previousPage"}),h.previousPageItem),nextPageItem:da(Xs({descendantName:"item",modifierName:"nextPage"}),h.nextPageItem),pageItem:da(Xs({descendantName:"item",modifierName:"page"}),h.pageItem),selectedItem:da(Xs({descendantName:"item",modifierName:"selected"}),h.selectedItem),disabledItem:da(Xs({descendantName:"item",modifierName:"disabled"}),h.disabledItem),link:da(Xs({descendantName:"link"}),h.link)},h=n(n({},ec),d),r=(d={containerNode:t,cssClasses:f,templates:h,showFirst:g,showLast:v,showPrevious:y,showNext:b,scrollToNode:e}).containerNode,i=d.cssClasses,a=d.templates,o=d.showFirst,s=d.showLast,c=d.showPrevious,u=d.showNext,l=d.scrollToNode,n(n({},Vn((function(e,t){var n=e.createURL,f=e.currentRefinement,d=e.nbPages,h=e.pages,p=e.isFirstPage,m=e.isLastPage,g=e.refine;t||Pn(sn(Js,{createURL:n,cssClasses:i,currentPage:f,templates:a,nbPages:d,pages:h,isFirstPage:p,isLastPage:m,setCurrentPage:function(e){g(e),!1!==l&&l.scrollIntoView()},showFirst:o,showLast:s,showPrevious:c,showNext:u}),r)}),(function(){return Pn(null,t)}))({totalPages:p,padding:m})),{},{$$widgetType:"ais.pagination"});throw new Error(Zs("The `container` option is required."))},panel:function(e){var t=void 0===(i=(e=e||{}).templates)?{}:i,r=void 0===(i=e.hidden)?function(){return!1}:i,i=e.collapsed,a=(e=void 0===(e=e.cssClasses)?{}:e,document.createElement("div")),o=Boolean(i),s="function"==typeof i?i:function(){return!1},c={root:da(ac(),e.root),noRefinementRoot:da(ac({modifierName:"noRefinement"}),e.noRefinementRoot),collapsibleRoot:da(ac({modifierName:"collapsible"}),e.collapsibleRoot),collapsedRoot:da(ac({modifierName:"collapsed"}),e.collapsedRoot),collapseButton:da(ac({descendantName:"collapseButton"}),e.collapseButton),collapseIcon:da(ac({descendantName:"collapseIcon"}),e.collapseIcon),body:da(ac({descendantName:"body"}),e.body),header:da(ac({descendantName:"header"}),e.header),footer:da(ac({descendantName:"footer"}),e.footer)};return function(e){return function(i){var u,l,f,d,h,p,m,g;if(i&&i.container)return f={containerNode:u=te(i.container),bodyContainerNode:a,cssClasses:c,templates:n(n({},{collapseButtonText:function(e){return e=e.collapsed,'<svg\n class="'.concat(c.collapseIcon,'"\n style="width: 1em; height: 1em;"\n viewBox="0 0 500 500"\n >\n <path d="').concat(e?"M100 250l300-150v300z":"M250 400l150-300H100z",'" fill="currentColor" />\n </svg>')}}),t)},d=f.containerNode,h=f.bodyContainerNode,p=f.cssClasses,m=f.templates,l=function(e){var t=e.options,n=e.hidden,r=e.collapsible;e=e.collapsed,Pn(sn(tc,{cssClasses:p,hidden:n,collapsible:r,isCollapsed:e,templates:m,data:t,bodyElement:h}),d)},g=e(n(n({},i),{},{container:a})),n(n({},g),{},{init:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=t[0];i=n(n({},g.getWidgetRenderState?g.getWidgetRenderState(i):{}),i),l({options:i,hidden:!0,collapsible:o,collapsed:!1}),"function"==typeof g.init&&(i=g.init).call.apply(i,[this].concat(t))},render:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var a=t[0];a=n(n({},g.getWidgetRenderState?g.getWidgetRenderState(a):{}),a),l({options:a,hidden:Boolean(r(a)),collapsible:o,collapsed:Boolean(s(a))}),"function"==typeof g.render&&(a=g.render).call.apply(a,[this].concat(t))},dispose:function(){if(Pn(null,u),"function"==typeof g.dispose){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=g.dispose).call.apply(e,[this].concat(n))}}});throw new Error(ic("The `container` option is required in the widget within the panel."))}}},places:co,poweredBy:function(e){var t,r,i,a=(e=e||{}).container,o=void 0===(o=e.cssClasses)?{}:o;if(e=void 0===(e=e.theme)?"light":e,a)return t=te(a),a={root:da(uc(),uc({modifierName:"dark"===e?"dark":"light"}),o.root),link:da(uc({descendantName:"link"}),o.link),logo:da(uc({descendantName:"logo"}),o.logo)},r=(o={containerNode:t,cssClasses:a}).containerNode,i=o.cssClasses,n(n({},xr((function(e,t){var n=e.url;e=e.widgetParams,t&&(t=e.theme,Pn(sn(cc,{cssClasses:i,url:n,theme:void 0===t?"light":t}),r))}),(function(){return Pn(null,t)}))({theme:e})),{},{$$widgetType:"ais.poweredBy"});throw new Error(lc("The `container` option is required."))},queryRuleContext:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e.trackedFilters)return n(n({},Tr(_)(e)),{},{$$widgetType:"ais.queryRuleContext"});throw new Error(fc("The `trackedFilters` option is required."))},queryRuleCustomData:function(e){var t,r,i,a,o=(e=e||{}).container,s=void 0===(s=e.cssClasses)?{}:s,c=void 0===(c=e.templates)?{}:c;if(e=void 0===(e=e.transformItems)?function(e){return e}:e,o)return s={root:da(mc(),s.root)},t=te(o),o=n(n({},hc),c),r=(c={containerNode:t,cssClasses:s,renderState:{},templates:o}).containerNode,i=c.cssClasses,a=c.templates,n(n({},Tr((function(e){e=e.items,Pn(sn(dc,{cssClasses:i,templates:a,items:e}),r)}),(function(){Pn(null,t)}))({transformItems:e})),{},{$$widgetType:"ais.queryRuleCustomData"});throw new Error(pc("The `container` option is required."))},relatedProducts:function(e){var t,r,i,a,o,s=(e=e||{}).container,u=e.objectIDs,l=e.limit,f=e.queryParameters,d=e.fallbackParameters,p=e.threshold,m=e.escapeHTML,g=e.transformItems,v=void 0===(v=e.templates)?{}:v;if(e=void 0===(e=e.cssClasses)?{}:e,s)return t=te(s),r=(s={containerNode:t,cssClasses:e,renderState:{},templates:v}).renderState,i=s.cssClasses,a=s.containerNode,o=s.templates,n(n({},nr((function(e,t){var s,u,l=e.items,f=e.results,d=e.instantSearchInstance,p=e.sendEvent;t?r.templateProps=ro({defaultTemplates:{},templatesConfig:d.templatesConfig,templates:o}):(e=o.header?function(e){return sn(Io,c({},r.templateProps,{templateKey:"header",rootTagName:"fragment",data:{cssClasses:e.classNames,items:e.items}}))}:void 0,t=o.item?function(e){var t=e.item,i=e.sendEvent;return e=h(e,gc),sn(Io,c({},r.templateProps,{templateKey:"item",rootTagName:"fragment",data:t,sendEvent:i,rootProps:n({},e)}))}:void 0,s=o.empty?function(){return sn(Io,c({},r.templateProps,{templateKey:"empty",rootTagName:"fragment",data:f}))}:void 0,u=o.layout?function(e){return sn(Io,c({},r.templateProps,{templateKey:"layout",rootTagName:"fragment",data:{sendEvent:p,items:e.items,templates:{item:o.item?function(e){return e=e.item,sn(Io,c({},r.templateProps,{templateKey:"item",rootTagName:"fragment",data:e,sendEvent:p}))}:void 0},cssClasses:{list:e.classNames.list,item:e.classNames.item}},sendEvent:p}))}:void 0,Pn(sn(yc,{items:l,sendEvent:p,classNames:i,headerComponent:e,itemComponent:t,emptyComponent:s,layout:u,status:d.status}),a))}),(function(){return Pn(null,t)}))({objectIDs:u,limit:l,queryParameters:f,fallbackParameters:d,threshold:p,escapeHTML:m,transformItems:g})),{},{$$widgetType:"ais.relatedProducts"});throw new Error(vc("The `container` option is required."))},rangeInput:function(e){var t,r,i,a,o,s=(e=e||{}).container,c=e.attribute,u=e.min,l=e.max,f=void 0===(f=e.precision)?0:f,d=void 0===(d=e.cssClasses)?{}:d;if(e=void 0===(e=e.templates)?{}:e,s)return t=te(s),s={root:da(Rc(),d.root),noRefinement:da(Rc({modifierName:"noRefinement"})),form:da(Rc({descendantName:"form"}),d.form),label:da(Rc({descendantName:"label"}),d.label),input:da(Rc({descendantName:"input"}),d.input),inputMin:da(Rc({descendantName:"input",modifierName:"min"}),d.inputMin),inputMax:da(Rc({descendantName:"input",modifierName:"max"}),d.inputMax),separator:da(Rc({descendantName:"separator"}),d.separator),submit:da(Rc({descendantName:"submit"}),d.submit)},r=(d={containerNode:t,cssClasses:s,templates:e,renderState:{}}).containerNode,i=d.cssClasses,a=d.renderState,o=d.templates,n(n({},Jn((function(e,t){var n=e.refine,s=e.range,c=e.start,u=e.widgetParams;e=e.instantSearchInstance,t?a.templateProps=ro({defaultTemplates:Pc,templatesConfig:e.templatesConfig,templates:o}):(t=s.min,e=s.max,c=(s=g(c,2))[0],s=s[1],u=1/Math.pow(10,u.precision||0),Pn(sn(wc,{min:t,max:e,step:u,values:{min:c!==-1/0&&c!==t?c:void 0,max:s!==1/0&&s!==e?s:void 0},cssClasses:i,refine:n,templateProps:a.templateProps}),r))}),(function(){return Pn(null,t)}))({attribute:c,min:u,max:l,precision:f})),{},{$$type:"ais.rangeInput",$$widgetType:"ais.rangeInput"});throw new Error(Sc("The `container` option is required."))},rangeSlider:function(e){var t,r,i,a,o,s,c=(e=e||{}).container,u=e.attribute,l=e.min,f=e.max,d=void 0===(d=e.cssClasses)?{}:d,h=e.step,p=void 0===(p=e.pips)||p,m=void 0===(m=e.precision)?0:m;if(e=void 0===(e=e.tooltips)||e,c)return t=te(c),c={root:da(Ac(),d.root),disabledRoot:da(Ac({modifierName:"disabled"}),d.disabledRoot)},r=(d={containerNode:t,step:h,pips:p,tooltips:e,cssClasses:c}).containerNode,i=d.cssClasses,a=d.pips,o=d.step,s=d.tooltips,n(n({},Jn((function(e,t){var n,c=e.refine,u=e.range;e=e.start,t||(t=u.min,u=u.max,n=(e=g(e,2))[0],e=e[1],Pn(sn(Ic,{cssClasses:i,refine:c,min:t,max:u,values:[u<(c=n===-1/0?t:n)?u:c,(n=e===1/0?u:e)<t?t:n],tooltips:s,step:o,pips:a}),r))}),(function(){return Pn(null,t)}))({attribute:u,min:l,max:f,precision:m})),{},{$$type:"ais.rangeSlider",$$widgetType:"ais.rangeSlider"});throw new Error(Fc("The `container` option is required."))},ratingMenu:function(e){var t,r,i,a,o,s=(e=e||{}).container,c=e.attribute,u=void 0===(u=e.max)?5:u,l=void 0===(l=e.cssClasses)?{}:l;if(e=void 0===(e=e.templates)?{}:e,s)return t=te(s),s={root:da(Uc(),l.root),noRefinementRoot:da(Uc({modifierName:"noRefinement"}),l.noRefinementRoot),list:da(Uc({descendantName:"list"}),l.list),item:da(Uc({descendantName:"item"}),l.item),selectedItem:da(Uc({descendantName:"item",modifierName:"selected"}),l.selectedItem),disabledItem:da(Uc({descendantName:"item",modifierName:"disabled"}),l.disabledItem),link:da(Uc({descendantName:"link"}),l.link),starIcon:da(Uc({descendantName:"starIcon"}),l.starIcon),fullStarIcon:da(Uc({descendantName:"starIcon",modifierName:"full"}),l.fullStarIcon),emptyStarIcon:da(Uc({descendantName:"starIcon",modifierName:"empty"}),l.emptyStarIcon),label:da(Uc({descendantName:"label"}),l.label),count:da(Uc({descendantName:"count"}),l.count)},r=(l={containerNode:t,cssClasses:s,renderState:{},templates:e}).containerNode,i=l.cssClasses,a=l.templates,o=l.renderState,n(n({},or((function(e,t){var n=e.refine,s=e.items,c=e.createURL;e=e.instantSearchInstance,t?o.templateProps=ro({defaultTemplates:Dc,templatesConfig:e.templatesConfig,templates:a}):Pn(sn(Rs,{createURL:c,cssClasses:i,facetValues:s,templateProps:o.templateProps,toggleRefinement:n},sn("svg",{style:"display:none;"},sn("symbol",{id:Uc({descendantName:"starSymbol"}),viewBox:"0 0 24 24"},Wc),sn("symbol",{id:Uc({descendantName:"starEmptySymbol"}),viewBox:"0 0 24 24"},Bc))),r)}),(function(){return Pn(null,t)}))({attribute:c,max:u})),{},{$$widgetType:"ais.ratingMenu"});throw new Error(qc("The `container` option is required."))},refinementList:function(e){var t,r,i,a,o,s,c,u,l,f,d=(e=e||{}).container,h=e.attribute,p=e.operator,m=e.sortBy,g=e.limit,v=e.showMore,y=e.showMoreLimit,b=void 0!==(b=e.searchable)&&b,_=void 0===(_=e.searchablePlaceholder)?"Search...":_,w=e.searchableEscapeFacetValues,S=void 0===(S=e.searchableIsAlwaysActive)||S,R=void 0===(R=e.cssClasses)?{}:R,P=void 0===(P=e.templates)?{}:P;if(e=e.transformItems,d)return w=!!b&&Boolean(void 0===w||w),t=te(d),d={root:da(Jc(),R.root),noRefinementRoot:da(Jc({modifierName:"noRefinement"}),R.noRefinementRoot),list:da(Jc({descendantName:"list"}),R.list),item:da(Jc({descendantName:"item"}),R.item),selectedItem:da(Jc({descendantName:"item",modifierName:"selected"}),R.selectedItem),searchBox:da(Jc({descendantName:"searchBox"}),R.searchBox),label:da(Jc({descendantName:"label"}),R.label),checkbox:da(Jc({descendantName:"checkbox"}),R.checkbox),labelText:da(Jc({descendantName:"labelText"}),R.labelText),count:da(Jc({descendantName:"count"}),R.count),noResults:da(Jc({descendantName:"noResults"}),R.noResults),showMore:da(Jc({descendantName:"showMore"}),R.showMore),disabledShowMore:da(Jc({descendantName:"showMore",modifierName:"disabled"}),R.disabledShowMore),searchable:{root:da(Yc(),R.searchableRoot),form:da(Yc({descendantName:"form"}),R.searchableForm),input:da(Yc({descendantName:"input"}),R.searchableInput),submit:da(Yc({descendantName:"submit"}),R.searchableSubmit),submitIcon:da(Yc({descendantName:"submitIcon"}),R.searchableSubmitIcon),reset:da(Yc({descendantName:"reset"}),R.searchableReset),resetIcon:da(Yc({descendantName:"resetIcon"}),R.searchableResetIcon),loadingIndicator:da(Yc({descendantName:"loadingIndicator"}),R.searchableLoadingIndicator),loadingIcon:da(Yc({descendantName:"loadingIcon"}),R.searchableLoadingIcon)}},R={containerNode:t,cssClasses:d,templates:P,searchBoxTemplates:{submit:P.searchableSubmit,reset:P.searchableReset,loadingIndicator:P.searchableLoadingIndicator},renderState:{},searchable:b,searchablePlaceholder:_,searchableIsAlwaysActive:S,showMore:v},r=R.containerNode,i=R.cssClasses,a=R.templates,o=R.searchBoxTemplates,s=R.renderState,c=R.showMore,u=R.searchable,l=R.searchablePlaceholder,f=R.searchableIsAlwaysActive,n(n({},Yn((function(e,t){var n=e.refine,d=e.items,h=e.createURL,p=e.searchForItems,m=e.isFromSearch,g=e.instantSearchInstance,v=e.toggleShowMore,y=e.isShowingMore,b=e.hasExhaustiveItems;e=e.canToggleShowMore,t?(s.templateProps=ro({defaultTemplates:zc,templatesConfig:g.templatesConfig,templates:a}),s.searchBoxTemplateProps=ro({defaultTemplates:Kc,templatesConfig:g.templatesConfig,templates:o})):Pn(sn(Rs,{createURL:h,cssClasses:i,facetValues:d,templateProps:s.templateProps,searchBoxTemplateProps:s.searchBoxTemplateProps,toggleRefinement:n,searchFacetValues:u?p:void 0,searchPlaceholder:l,searchIsAlwaysActive:f,isFromSearch:m,showMore:c&&!m&&0<d.length,toggleShowMore:v,isShowingMore:y,hasExhaustiveItems:b,canToggleShowMore:e}),r)}),(function(){return Pn(null,t)}))({attribute:h,operator:p,limit:g,showMore:v,showMoreLimit:y,sortBy:m,escapeFacetValues:w,transformItems:e})),{},{$$widgetType:"ais.refinementList"});throw new Error(Gc("The `container` option is required."))},relevantSort:function(e){var t,r,i,a,o=e.container,s=void 0===(s=e.templates)?{}:s;if(e=void 0===(e=e.cssClasses)?{}:e,o)return t=te(o),o={root:da(tu(),e.root),text:da(tu({descendantName:"text"}),e.text),button:da(tu({descendantName:"button"}),e.button)},e=n(n({},Zc),s),r=(s={containerNode:t,cssClasses:o,renderState:{},templates:e}).containerNode,i=s.cssClasses,a=s.templates,n(n({},Fr((function(e){var t=e.isRelevantSorted,n=e.isVirtualReplica;e=e.refine,Pn(sn(Xc,{cssClasses:i,templates:a,isRelevantSorted:t,isVirtualReplica:n,refine:e}),r)}),(function(){Pn(null,t)}))({})),{},{$$widgetType:"ais.relevantSort"});throw new Error(eu("The `container` option is required."))},searchBox:function(e){var t,r,i,a,o,s,c,u,l,f,d,h=(e=e||{}).container,p=void 0===(p=e.placeholder)?"":p,m=void 0===(m=e.cssClasses)?{}:m,g=void 0!==(g=e.autofocus)&&g,v=void 0===(v=e.searchAsYouType)||v,y=void 0!==(y=e.ignoreCompositionEvents)&&y,b=void 0===(b=e.showReset)||b,_=void 0===(_=e.showSubmit)||_,w=void 0===(w=e.showLoadingIndicator)||w,S=e.queryHook;if(e=void 0===(e=e.templates)?{}:e,h)return t=te(h),h={root:da(ru(),m.root),form:da(ru({descendantName:"form"}),m.form),input:da(ru({descendantName:"input"}),m.input),submit:da(ru({descendantName:"submit"}),m.submit),submitIcon:da(ru({descendantName:"submitIcon"}),m.submitIcon),reset:da(ru({descendantName:"reset"}),m.reset),resetIcon:da(ru({descendantName:"resetIcon"}),m.resetIcon),loadingIndicator:da(ru({descendantName:"loadingIndicator"}),m.loadingIndicator),loadingIcon:da(ru({descendantName:"loadingIcon"}),m.loadingIcon)},m=n(n({},Kc),e),r=(e={containerNode:t,cssClasses:h,placeholder:p,templates:m,autofocus:g,searchAsYouType:v,ignoreCompositionEvents:y,showReset:b,showSubmit:_,showLoadingIndicator:w}).containerNode,i=e.cssClasses,a=e.placeholder,o=e.templates,s=e.autofocus,c=e.searchAsYouType,u=e.ignoreCompositionEvents,l=e.showReset,f=e.showSubmit,d=e.showLoadingIndicator,n(n({},ir((function(e){var t=e.refine,n=e.query;e=e.isSearchStalled,Pn(sn(vs,{query:n,placeholder:a,autofocus:s,refine:t,searchAsYouType:c,ignoreCompositionEvents:u,templates:o,showSubmit:f,showReset:l,showLoadingIndicator:d,isSearchStalled:e,cssClasses:i}),r)}),(function(){return Pn(null,t)}))({queryHook:S})),{},{$$widgetType:"ais.searchBox"});throw new Error(nu("The `container` option is required."))},sortBy:function(e){var t,r,i,a=(e=e||{}).container,o=e.items,s=void 0===(s=e.cssClasses)?{}:s;if(e=e.transformItems,a)return t=te(a),a={root:da(au(),s.root),select:da(au({descendantName:"select"}),s.select),option:da(au({descendantName:"option"}),s.option)},r=(s={containerNode:t,cssClasses:a}).containerNode,i=s.cssClasses,n(n({},ar((function(e,t){var n=e.currentRefinement,a=e.options;e=e.refine,t||Pn(sn("div",{className:i.root},sn(ks,{cssClasses:i,currentValue:n,options:a,setValue:e,ariaLabel:"Sort results by"})),r)}),(function(){return Pn(null,t)}))({container:t,items:o,transformItems:e})),{},{$$widgetType:"ais.sortBy"});throw new Error(iu("The `container` option is required."))},stats:function(e){var t,r,i,a,o,s=(e=e||{}).container,c=void 0===(c=e.cssClasses)?{}:c;if(e=void 0===(e=e.templates)?{}:e,s)return t=te(s),s={root:da(uu(),c.root),text:da(uu({descendantName:"text"}),c.text)},r=(c={containerNode:t,cssClasses:s,templates:e,renderState:{}}).renderState,i=c.cssClasses,a=c.containerNode,o=c.templates,n(n({},dr((function(e,t){var n=e.hitsPerPage,s=e.nbHits,c=e.nbSortedHits,u=e.areHitsSorted,l=e.nbPages,f=e.page,d=e.processingTimeMS,h=e.query;e=e.instantSearchInstance,t?r.templateProps=ro({defaultTemplates:lu,templatesConfig:e.templatesConfig,templates:o}):Pn(sn(su,{cssClasses:i,hitsPerPage:n,nbHits:s,nbSortedHits:c,areHitsSorted:u,nbPages:l,page:f,processingTimeMS:d,query:h,templateProps:r.templateProps}),a)}),(function(){return Pn(null,t)}))({})),{},{$$widgetType:"ais.stats"});throw new Error(cu("The `container` option is required."))},toggleRefinement:function(e){var t,r,i,a,o,s=(e=e||{}).container,c=e.attribute,u=void 0===(u=e.cssClasses)?{}:u,l=void 0===(l=e.templates)?{}:l,f=void 0===(f=e.on)||f;if(e=e.off,s)return t=te(s),s={root:da(pu(),u.root),label:da(pu({descendantName:"label"}),u.label),checkbox:da(pu({descendantName:"checkbox"}),u.checkbox),labelText:da(pu({descendantName:"labelText"}),u.labelText)},r=(u={containerNode:t,cssClasses:s,renderState:{},templates:l}).containerNode,i=u.cssClasses,a=u.renderState,o=u.templates,n(n({},hr((function(e,t){var n=e.value,s=e.refine;e=e.instantSearchInstance,t?a.templateProps=ro({defaultTemplates:du,templatesConfig:e.templatesConfig,templates:o}):Pn(sn(fu,{cssClasses:i,currentRefinement:n,templateProps:a.templateProps,refine:s}),r)}),(function(){return Pn(null,t)}))({attribute:c,on:f,off:e})),{},{$$widgetType:"ais.toggleRefinement"});throw new Error(hu("The `container` option is required."))},trendingItems:function(e){var t,r,i,a,o,s=(e=e||{}).container,u=e.facetName,l=e.facetValue,f=e.limit,d=e.queryParameters,p=e.fallbackParameters,m=e.threshold,g=e.escapeHTML,v=e.transformItems,y=void 0===(y=e.templates)?{}:y;if(e=void 0===(e=e.cssClasses)?{}:e,s)return t=te(s),r=(s={containerNode:t,cssClasses:e,renderState:{},templates:y}).renderState,i=s.cssClasses,a=s.containerNode,o=s.templates,n(n({},pr((function(e,t){var s,u,l=e.items,f=e.results,d=e.instantSearchInstance,p=e.sendEvent;t?r.templateProps=ro({defaultTemplates:{},templatesConfig:d.templatesConfig,templates:o}):(e=o.header?function(e){return sn(Io,c({},r.templateProps,{templateKey:"header",rootTagName:"fragment",data:{cssClasses:e.classNames,items:e.items}}))}:void 0,t=o.item?function(e){var t=e.item,i=e.sendEvent;return e=h(e,mu),sn(Io,c({},r.templateProps,{templateKey:"item",rootTagName:"fragment",data:t,sendEvent:i,rootProps:n({},e)}))}:void 0,s=o.empty?function(){return sn(Io,c({},r.templateProps,{templateKey:"empty",rootTagName:"fragment",data:f}))}:void 0,u=o.layout?function(e){return sn(Io,c({},r.templateProps,{templateKey:"layout",rootTagName:"fragment",data:{sendEvent:p,items:e.items,templates:{item:o.item?function(e){return e=e.item,sn(Io,c({},r.templateProps,{templateKey:"item",rootTagName:"fragment",data:e,sendEvent:p}))}:void 0},cssClasses:{list:e.classNames.list,item:e.classNames.item}},sendEvent:p}))}:void 0,Pn(sn(vu,{items:l,sendEvent:p,classNames:i,headerComponent:e,itemComponent:t,emptyComponent:s,layout:u,status:d.status}),a))}),(function(){return Pn(null,t)}))(n(n({},u&&l?{facetName:u,facetValue:l}:{}),{},{limit:f,queryParameters:d,fallbackParameters:p,threshold:m,escapeHTML:g,transformItems:v}))),{},{$$widgetType:"ais.trendingItems"});throw new Error(gu("The `container` option is required."))},voiceSearch:function(e){var t,r,i,a,o=(e=e||{}).container,s=void 0===(s=e.cssClasses)?{}:s,c=void 0===(c=e.templates)?{}:c,u=void 0!==(u=e.searchAsYouSpeak)&&u,l=e.language,f=e.additionalQueryParameters;if(e=e.createVoiceSearchHelper,o)return t=te(o),o={root:da(ju(),s.root),button:da(ju({descendantName:"button"}),s.button),status:da(ju({descendantName:"status"}),s.status)},s=n(n({},Cu),c),r=(c={containerNode:t,cssClasses:o,templates:s}).containerNode,i=c.cssClasses,a=c.templates,n(n({},Ir((function(e){var t=e.isBrowserSupported,n=e.isListening,o=e.toggleListening;e=e.voiceListeningState,Pn(sn(Ru,{cssClasses:i,templates:a,isBrowserSupported:t,isListening:n,toggleListening:o,voiceListeningState:e}),r)}),(function(){return Pn(null,t)}))({container:t,cssClasses:o,templates:s,searchAsYouSpeak:u,language:l,additionalQueryParameters:f,createVoiceSearchHelper:e})),{},{$$widgetType:"ais.voiceSearch"});throw new Error(Nu("The `container` option is required."))},frequentlyBoughtTogether:function(e){var t,r,i,a,o,s=(e=e||{}).container,u=e.objectIDs,l=e.limit,f=e.queryParameters,d=e.threshold,p=e.escapeHTML,m=e.transformItems,g=void 0===(g=e.templates)?{}:g;if(e=void 0===(e=e.cssClasses)?{}:e,s)return t=te(s),r=(s={containerNode:t,cssClasses:e,renderState:{},templates:g}).renderState,i=s.cssClasses,a=s.containerNode,o=s.templates,n(n({},Ar((function(e,t){var s,u,l=e.items,f=e.results,d=e.instantSearchInstance,p=e.sendEvent;t?r.templateProps=ro({defaultTemplates:{},templatesConfig:d.templatesConfig,templates:o}):(e=o.header?function(e){return sn(Io,c({},r.templateProps,{templateKey:"header",rootTagName:"fragment",data:{cssClasses:e.classNames,items:e.items}}))}:void 0,t=o.item?function(e){var t=e.item,i=e.sendEvent;return e=h(e,Tu),sn(Io,c({},r.templateProps,{templateKey:"item",rootTagName:"fragment",data:t,sendEvent:i,rootProps:n({},e)}))}:void 0,s=o.empty?function(){return sn(Io,c({},r.templateProps,{templateKey:"empty",rootTagName:"fragment",data:f}))}:void 0,u=o.layout?function(e){return sn(Io,c({},r.templateProps,{templateKey:"layout",rootTagName:"fragment",data:{sendEvent:p,items:e.items,templates:{item:o.item?function(e){return e=e.item,sn(Io,c({},r.templateProps,{templateKey:"item",rootTagName:"fragment",data:e,sendEvent:p}))}:void 0},cssClasses:{list:e.classNames.list,item:e.classNames.item}},sendEvent:p}))}:void 0,Pn(sn(Iu,{items:l,headerComponent:e,itemComponent:t,sendEvent:p,classNames:i,emptyComponent:s,layout:u,status:d.status}),a))}),(function(){return Pn(null,t)}))({objectIDs:u,limit:l,queryParameters:f,threshold:d,escapeHTML:p,transformItems:m})),{},{$$widgetType:"ais.frequentlyBoughtTogether"});throw new Error(ku("The `container` option is required."))},lookingSimilar:function(e){var t,r,i,a,o,s=(e=e||{}).container,u=e.objectIDs,l=e.limit,f=e.queryParameters,d=e.fallbackParameters,p=e.threshold,m=e.escapeHTML,g=e.transformItems,v=void 0===(v=e.templates)?{}:v;if(e=void 0===(e=e.cssClasses)?{}:e,s)return t=te(s),r=(s={containerNode:t,cssClasses:e,renderState:{},templates:v}).renderState,i=s.cssClasses,a=s.containerNode,o=s.templates,n(n({},Mr((function(e,t){var s,u,l=e.items,f=e.results,d=e.instantSearchInstance,p=e.sendEvent;t?r.templateProps=ro({defaultTemplates:{},templatesConfig:d.templatesConfig,templates:o}):(e=o.header?function(e){return sn(Io,c({},r.templateProps,{templateKey:"header",rootTagName:"fragment",data:{cssClasses:e.classNames,items:e.items}}))}:void 0,t=o.item?function(e){var t=e.item,i=e.sendEvent;return e=h(e,Fu),sn(Io,c({},r.templateProps,{templateKey:"item",rootTagName:"fragment",data:t,sendEvent:i,rootProps:n({},e)}))}:void 0,s=o.empty?function(){return sn(Io,c({},r.templateProps,{templateKey:"empty",rootTagName:"fragment",data:f}))}:void 0,u=o.layout?function(e){return sn(Io,c({},r.templateProps,{templateKey:"layout",rootTagName:"fragment",data:{sendEvent:p,items:e.items,templates:{item:o.item?function(e){return e=e.item,sn(Io,c({},r.templateProps,{templateKey:"item",rootTagName:"fragment",data:e,sendEvent:p}))}:void 0},cssClasses:{list:e.classNames.list,item:e.classNames.item}},sendEvent:p}))}:void 0,Pn(sn(Mu,{items:l,headerComponent:e,itemComponent:t,sendEvent:function(){},classNames:i,emptyComponent:s,layout:u,status:d.status}),a))}),(function(){return Pn(null,t)}))({objectIDs:u,limit:l,queryParameters:f,fallbackParameters:d,threshold:p,escapeHTML:m,transformItems:g})),{},{$$widgetType:"ais.lookingSimilar"});throw new Error(Au("The `container` option is required."))}}),Lu.version="4.77.3",Lu.connectors=Me,Lu.widgets=Hu,Lu.middlewares=Ur,Lu.routers=Ae,Lu.stateMappings=ke,Lu.templates=Wr,Lu.createInfiniteHitsSessionStorageCache=function(){var e=["ais.infiniteHits",(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).key].filter(Boolean).join(":");return{read:function(t){t=t.state;var n=Re((function(e){return e.window.sessionStorage}));if(!n)return null;try{var r=JSON.parse(n.getItem(e));return r&&de(r.state,Xr(t))?r.hits:null}catch(t){if(t instanceof SyntaxError)try{n.removeItem(e)}catch(t){}return null}},write:function(t){var n=t.state,r=(t=t.hits,Re((function(e){return e.window.sessionStorage})));if(r)try{r.setItem(e,JSON.stringify({state:Xr(n),hits:t}))}catch(t){}}}},Lu.highlight=$r,Lu.reverseHighlight=Qr,Lu.snippet=zr,Lu.reverseSnippet=Jr,Lu.insights=xn,Lu}()}(In);var Fn=t(In.exports);function An(){}function Mn(e,t){if(void 0===e||"function"!=typeof e)throw new Error("The render function is not valid (received type ".concat((n=e,Object.prototype.toString.call(n).slice(8,-1)),").\n\n").concat(t));var n}var Ln={"&":"&","<":"<",">":">",'"':""","'":"'"},Hn=/[&<>"']/g,Dn=RegExp(Hn.source),qn={"&":"&","<":"<",">":">",""":'"',"'":"'"},Un=/&(amp|quot|lt|gt|#39);/g,Wn=RegExp(Un.source);function Bn(e){return e&&Wn.test(e)?e.replace(Un,(function(e){return qn[e]})):e}function $n(e){return $n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$n(e)}function Vn(e){return Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vn(e)}function Qn(){return Qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qn.apply(this,arguments)}function Kn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kn(Object(n),!0).forEach((function(t){Gn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gn(e,t,n){return t=function(e){var t=function(e,t){if("object"!=Vn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Vn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==Vn(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jn={highlightPreTag:"__ais-highlight__",highlightPostTag:"__/ais-highlight__"},Yn="<mark>",Xn="</mark>";function Zn(e){return function(e){if(!function(e){return"object"===$n(e)&&null!==e}(e)||"[object Object]"!==function(e){return null===e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e)&&"string"!=typeof e.value?Object.keys(e).reduce((function(t,n){return zn(zn({},t),{},Gn({},n,Zn(e[n])))}),{}):Array.isArray(e)?e.map(Zn):zn(zn({},e),{},{value:(t=e.value,function(e){return e&&Dn.test(e)?e.replace(Hn,(function(e){return Ln[e]})):e}(t).replace(new RegExp(Jn.highlightPreTag,"g"),Yn).replace(new RegExp(Jn.highlightPostTag,"g"),Xn))});var t}function er(e){return JSON.parse(decodeURIComponent(atob(e)))}function tr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tr(Object(n),!0).forEach((function(t){rr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rr(e,t,n){return t=function(e){var t=function(e,t){if("object"!=ar(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=ar(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==ar(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ar(e){return ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ar(e)}function or(e){var t=e.getIndex,n=e.widgetType;e.methodName;var r=e.args,i=e.instantSearchInstance;if(1===r.length&&"object"===ar(r[0]))return[r[0]];var a=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t);else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ir(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ir(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r[0].split(":"),2),o=a[0],s=a[1],c=r[1],u=r[2],l=r[3]||{};if(!c)return[];if(("click"===o||"conversion"===o)&&!u)return[];var f=Array.isArray(c)?c:[c];if(0===f.length)return[];var d=f[0].__queryID,h=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=[],r=0;r<Math.ceil(e.length/t);r++)n.push(e.slice(r*t,(r+1)*t));return n}(f),p=h.map((function(e){return e.map((function(e){return e.objectID}))})),m=h.map((function(e){return e.map((function(e){return e.__position}))}));return"view"===o?"idle"!==i.status?[]:h.map((function(e,r){return{insightsMethod:"viewedObjectIDs",widgetType:n,eventType:o,payload:nr({eventName:u||"Hits Viewed",index:t(),objectIDs:p[r]},l),hits:e,eventModifier:s}})):"click"===o?h.map((function(e,r){return{insightsMethod:"clickedObjectIDsAfterSearch",widgetType:n,eventType:o,payload:nr({eventName:u||"Hit Clicked",index:t(),queryID:d,objectIDs:p[r],positions:m[r]},l),hits:e,eventModifier:s}})):"conversion"===o?h.map((function(e,r){return{insightsMethod:"convertedObjectIDsAfterSearch",widgetType:n,eventType:o,payload:nr({eventName:u||"Hit Converted",index:t(),queryID:d,objectIDs:p[r]},l),hits:e,eventModifier:s}})):[]}function sr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return["https://www.algolia.com/doc/api-reference/widgets/",(t=e).name,"/js/",void 0!==(n=t.connector)&&n?"#connector":""].join("");var t,n})).join(", ");return function(e){return[e,"See documentation: ".concat(r)].filter(Boolean).join("\n\n")}}function cr(e){var t,n="string"==typeof e,r=n?document.querySelector(e):e;if(!((t=r)instanceof HTMLElement||Boolean(t)&&t.nodeType>0)){var i="Container must be `string` or `HTMLElement`.";throw n&&(i+=" Unable to find ".concat(e)),new Error(i)}return r}function ur(e){var t=Xn,n=Yn,r=e.split(n),i=r.shift(),a=i?[{value:i,isHighlighted:!1}]:[];return r.forEach((function(e){var n=e.split(t);a.push({value:n[0],isHighlighted:!0}),""!==n[1]&&a.push({value:n[1],isHighlighted:!1})})),a}function lr(e,t){return(Array.isArray(t)?t:t.split(".")).reduce((function(e,t){return e&&e[t]}),e)}function fr(e){return fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fr(e)}function dr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dr(Object(n),!0).forEach((function(t){pr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pr(e,t,n){return t=function(e){var t=function(e,t){if("object"!=fr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=fr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==fr(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mr(e){return mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mr(e)}function gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gr(Object(n),!0).forEach((function(t){yr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yr(e,t,n){return t=function(e){var t=function(e,t){if("object"!=mr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=mr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==mr(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function br(e){return e!==Object(e)}function _r(e,t){if(e===t)return!0;if(br(e)||br(t)||"function"==typeof e||"function"==typeof t)return e===t;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(!(i in t))return!1;if(!_r(e[i],t[i]))return!1}return!0}function wr(e){return e.filter((function(e,t,n){return n.indexOf(e)===t}))}function Sr(e){return Array.isArray(e)?e:[e]}function Rr(){return Rr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rr.apply(null,arguments)}function Pr(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((function(e,t){return Array.isArray(t)?e.concat(t):e.concat([t])}),[]).filter(Boolean).join(" ")}var Or,Er,Cr,Nr,jr,Tr,kr,Ir,Fr,Ar,Mr,Lr=["parts","highlightedTagName","nonHighlightedTagName","separator","className","classNames"],Hr=["classNames","hits","itemComponent","sendEvent","emptyComponent","banner","bannerComponent"],Dr={},qr=[],Ur=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Wr=Array.isArray;function Br(e,t){for(var n in t)e[n]=t[n];return e}function $r(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Vr(e,t,n){var r,i,a,o={};for(a in t)"key"==a?r=t[a]:"ref"==a?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?Or.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return Qr(e,o,r,i,null)}function Qr(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==i?++Cr:i,__i:-1,__u:0};return null==i&&null!=Er.vnode&&Er.vnode(a),a}function Kr(e){return e.children}function zr(e,t){this.props=e,this.context=t}function Gr(e,t){if(null==t)return e.__?Gr(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Gr(e):null}function Jr(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Jr(e)}}function Yr(e){(!e.__d&&(e.__d=!0)&&Nr.push(e)&&!Xr.__r++||jr!==Er.debounceRendering)&&((jr=Er.debounceRendering)||Tr)(Xr)}function Xr(){for(var e,t,n,r,i,a,o,s=1;Nr.length;)Nr.length>s&&Nr.sort(kr),e=Nr.shift(),s=Nr.length,e.__d&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],t.__P&&((n=Br({},r)).__v=r.__v+1,Er.vnode&&Er.vnode(n),oi(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[i]:null,a,null==i?Gr(r):i,!!(32&r.__u),o),n.__v=r.__v,n.__.__k[n.__i]=n,si(a,n,o),n.__e!=i&&Jr(n)));Xr.__r=0}function Zr(e,t,n,r,i,a,o,s,c,u,l){var f,d,h,p,m,g,v=r&&r.__k||qr,y=t.length;for(c=ei(n,t,v,c,y),f=0;f<y;f++)null!=(h=n.__k[f])&&(d=-1===h.__i?Dr:v[h.__i]||Dr,h.__i=f,g=oi(e,h,d,i,a,o,s,c,u,l),p=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&ui(d.ref,null,h),l.push(h.ref,h.__c||p,h)),null==m&&null!=p&&(m=p),4&h.__u||d.__k===h.__k?c=ti(h,c,e):"function"==typeof h.type&&void 0!==g?c=g:p&&(c=p.nextSibling),h.__u&=-7);return n.__e=m,c}function ei(e,t,n,r,i){var a,o,s,c,u,l=n.length,f=l,d=0;for(e.__k=new Array(i),a=0;a<i;a++)null!=(o=t[a])&&"boolean"!=typeof o&&"function"!=typeof o?(c=a+d,(o=e.__k[a]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?Qr(null,o,null,null,null):Wr(o)?Qr(Kr,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?Qr(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,-1!==(u=o.__i=ni(o,n,c,f))&&(f--,(s=n[u])&&(s.__u|=2)),null==s||null===s.__v?(-1==u&&d--,"function"!=typeof o.type&&(o.__u|=4)):u!=c&&(u==c-1?d--:u==c+1?d++:(u>c?d--:d++,o.__u|=4))):e.__k[a]=null;if(f)for(a=0;a<l;a++)null!=(s=n[a])&&!(2&s.__u)&&(s.__e==r&&(r=Gr(s)),li(s,s));return r}function ti(e,t,n){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=ti(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=Gr(e)),n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function ni(e,t,n,r){var i,a,o=e.key,s=e.type,c=t[n];if(null===c||c&&o==c.key&&s===c.type&&!(2&c.__u))return n;if(r>(null==c||2&c.__u?0:1))for(i=n-1,a=n+1;i>=0||a<t.length;){if(i>=0){if((c=t[i])&&!(2&c.__u)&&o==c.key&&s===c.type)return i;i--}if(a<t.length){if((c=t[a])&&!(2&c.__u)&&o==c.key&&s===c.type)return a;a++}}return-1}function ri(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Ur.test(t)?n:n+"px"}function ii(e,t,n,r,i){var a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||ri(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||ri(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])a=t!=(t=t.replace(Ir,"$1")),t=t.toLowerCase()in e||"onFocusOut"==t||"onFocusIn"==t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r?n.u=r.u:(n.u=Fr,e.addEventListener(t,a?Mr:Ar,a)):e.removeEventListener(t,a?Mr:Ar,a);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function ai(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=Fr++;else if(t.t<n.u)return;return n(Er.event?Er.event(t):t)}}}function oi(e,t,n,r,i,a,o,s,c,u){var l,f,d,h,p,m,g,v,y,b,_,w,S,R,P,x,O,E,C=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(l=Er.__b)&&l(t);e:if("function"==typeof C)try{if(v=t.props,y="prototype"in C&&C.prototype.render,b=(l=C.contextType)&&r[l.__c],_=l?b?b.props.value:l.__:r,n.__c?g=(f=t.__c=n.__c).__=f.__E:(y?t.__c=f=new C(v,_):(t.__c=f=new zr(v,_),f.constructor=C,f.render=fi),b&&b.sub(f),f.props=v,f.state||(f.state={}),f.context=_,f.__n=r,d=f.__d=!0,f.__h=[],f._sb=[]),y&&null==f.__s&&(f.__s=f.state),y&&null!=C.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=Br({},f.__s)),Br(f.__s,C.getDerivedStateFromProps(v,f.__s))),h=f.props,p=f.state,f.__v=t,d)y&&null==C.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),y&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(y&&null==C.getDerivedStateFromProps&&v!==h&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(v,_),!f.__e&&(null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(v,f.__s,_)||t.__v==n.__v)){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some((function(e){e&&(e.__=t)})),w=0;w<f._sb.length;w++)f.__h.push(f._sb[w]);f._sb=[],f.__h.length&&o.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(v,f.__s,_),y&&null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(h,p,m)}))}if(f.context=_,f.props=v,f.__P=e,f.__e=!1,S=Er.__r,R=0,y){for(f.state=f.__s,f.__d=!1,S&&S(t),l=f.render(f.props,f.state,f.context),P=0;P<f._sb.length;P++)f.__h.push(f._sb[P]);f._sb=[]}else do{f.__d=!1,S&&S(t),l=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++R<25);f.state=f.__s,null!=f.getChildContext&&(r=Br(Br({},r),f.getChildContext())),y&&!d&&null!=f.getSnapshotBeforeUpdate&&(m=f.getSnapshotBeforeUpdate(h,p)),O=(x=null!=l&&l.type===Kr&&null==l.key)?l.props.children:l,x&&(l.props.children=null),s=Zr(e,Wr(O)?O:[O],t,n,r,i,a,o,s,c,u),f.base=t.__e,t.__u&=-161,f.__h.length&&o.push(f),g&&(f.__E=f.__=null)}catch(e){if(t.__v=null,c||null!=a)if(e.then){for(t.__u|=c?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__e=s}else for(E=a.length;E--;)$r(a[E]);else t.__e=n.__e,t.__k=n.__k;Er.__e(e,t,n)}else null==a&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=ci(n.__e,t,n,r,i,a,o,c,u);return(l=Er.diffed)&&l(t),128&t.__u?void 0:s}function si(e,t,n){for(var r=0;r<n.length;r++)ui(n[r],n[++r],n[++r]);Er.__c&&Er.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Er.__e(e,t.__v)}}))}function ci(e,t,n,r,i,a,o,s,c){var u,l,f,d,h,p,m,g=n.props,v=t.props,y=t.type;if("svg"==y?i="http://www.w3.org/2000/svg":"math"==y?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=a)for(u=0;u<a.length;u++)if((h=a[u])&&"setAttribute"in h==!!y&&(y?h.localName==y:3==h.nodeType)){e=h,a[u]=null;break}if(null==e){if(null==y)return document.createTextNode(v);e=document.createElementNS(i,y,v.is&&v),s&&(Er.__m&&Er.__m(t,a),s=!1),a=null}if(null===y)g===v||s&&e.data===v||(e.data=v);else{if(a=a&&Or.call(e.childNodes),g=n.props||Dr,!s&&null!=a)for(g={},u=0;u<e.attributes.length;u++)g[(h=e.attributes[u]).name]=h.value;for(u in g)if(h=g[u],"children"==u);else if("dangerouslySetInnerHTML"==u)f=h;else if(!(u in v)){if("value"==u&&"defaultValue"in v||"checked"==u&&"defaultChecked"in v)continue;ii(e,u,null,h,i)}for(u in v)h=v[u],"children"==u?d=h:"dangerouslySetInnerHTML"==u?l=h:"value"==u?p=h:"checked"==u?m=h:s&&"function"!=typeof h||g[u]===h||ii(e,u,h,g[u],i);if(l)s||f&&(l.__html===f.__html||l.__html===e.innerHTML)||(e.innerHTML=l.__html),t.__k=[];else if(f&&(e.innerHTML=""),Zr("template"===t.type?e.content:e,Wr(d)?d:[d],t,n,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":i,a,o,a?a[0]:n.__k&&Gr(n,0),s,c),null!=a)for(u=a.length;u--;)$r(a[u]);s||(u="value","progress"==y&&null==p?e.removeAttribute("value"):void 0!==p&&(p!==e[u]||"progress"==y&&!p||"option"==y&&p!==g[u])&&ii(e,u,p,g[u],i),u="checked",void 0!==m&&m!==e[u]&&ii(e,u,m,g[u],i))}return e}function ui(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){Er.__e(e,n)}}function li(e,t,n){var r,i;if(Er.unmount&&Er.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||ui(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Er.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&li(r[i],t,n||"function"!=typeof e.type);n||$r(e.__e),e.__c=e.__=e.__e=void 0}function fi(e,t,n){return this.constructor(e,n)}function di(e,t,n){var r,i,a;t==document&&(t=document.documentElement),Er.__&&Er.__(e,t),r=t.__k,i=[],a=[],oi(t,e=t.__k=Vr(Kr,null,[e]),r||Dr,Dr,t.namespaceURI,r?null:t.firstChild?Or.call(t.childNodes):null,i,r?r.__e:t.firstChild,!1,a),si(i,e,a)}function hi(e){return hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hi(e)}function pi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mi(e,t,n){return t=function(e){var t=function(e,t){if("object"!=hi(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=hi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==hi(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gi(e){return function(e){if(Array.isArray(e))return vi(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return vi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vi(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Or=qr.slice,Er={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&null!=a.getDerivedStateFromError&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},Cr=0,zr.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Br({},this.state),"function"==typeof e&&(e=e(Br({},n),this.props)),e&&Br(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Yr(this))},zr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Yr(this))},zr.prototype.render=Kr,Nr=[],Tr="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,kr=function(e,t){return e.__v.__b-t.__v.__b},Xr.__r=0,Ir=/(PointerCapture)$|Capture$/i,Fr=0,Ar=ai(!1),Mr=ai(!0);var yi={};!function(e){var t=/\S/,n=/\"/g,r=/\n/g,i=/\r/g,a=/\\/g,o=/\u2028/,s=/\u2029/;function c(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function u(e,t,n){if(t.charAt(n)!=e.charAt(0))return!1;for(var r=1,i=e.length;r<i;r++)if(t.charAt(n+r)!=e.charAt(r))return!1;return!0}e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(n,r){var i,a=n.length,o=0,s=null,l=null,f="",d=[],h=!1,p=0,m=0,g="{{",v="}}";function y(){f.length>0&&(d.push({tag:"_t",text:new String(f)}),f="")}function b(n,r){if(y(),n&&function(){for(var n=!0,r=m;r<d.length;r++)if(!(n=e.tags[d[r].tag]<e.tags._v||"_t"==d[r].tag&&null===d[r].text.match(t)))return!1;return n}())for(var i,a=m;a<d.length;a++)d[a].text&&((i=d[a+1])&&">"==i.tag&&(i.indent=d[a].text.toString()),d.splice(a,1));else r||d.push({tag:"\n"});h=!1,m=d.length}function _(e,t){var n="="+v,r=e.indexOf(n,t),i=c(e.substring(e.indexOf("=",t)+1,r)).split(" ");return g=i[0],v=i[i.length-1],r+n.length-1}for(r&&(r=r.split(" "),g=r[0],v=r[1]),p=0;p<a;p++)0==o?u(g,n,p)?(--p,y(),o=1):"\n"==n.charAt(p)?b(h):f+=n.charAt(p):1==o?(p+=g.length-1,"="==(s=(l=e.tags[n.charAt(p+1)])?n.charAt(p+1):"_v")?(p=_(n,p),o=0):(l&&p++,o=2),h=p):u(v,n,p)?(d.push({tag:s,n:c(f),otag:g,ctag:v,i:"/"==s?h-g.length:p+v.length}),f="",p+=v.length-1,o=0,"{"==s&&("}}"==v?p++:"}"===(i=d[d.length-1]).n.substr(i.n.length-1)&&(i.n=i.n.substring(0,i.n.length-1)))):f+=n.charAt(p);return b(h,!0),d};var l={_t:!0,"\n":!0,$:!0,"/":!0};function f(t,n,r,i){var a,o=[],s=null,c=null;for(a=r[r.length-1];t.length>0;){if(c=t.shift(),a&&"<"==a.tag&&!(c.tag in l))throw new Error("Illegal content in < super tag.");if(e.tags[c.tag]<=e.tags.$||d(c,i))r.push(c),c.nodes=f(t,c.tag,r,i);else{if("/"==c.tag){if(0===r.length)throw new Error("Closing tag without opener: /"+c.n);if(s=r.pop(),c.n!=s.n&&!h(c.n,s.n,i))throw new Error("Nesting error: "+s.n+" vs. "+c.n);return s.end=c.i,o}"\n"==c.tag&&(c.last=0==t.length||"\n"==t[0].tag)}o.push(c)}if(r.length>0)throw new Error("missing closing tag: "+r.pop().n);return o}function d(e,t){for(var n=0,r=t.length;n<r;n++)if(t[n].o==e.n)return e.tag="#",!0}function h(e,t,n){for(var r=0,i=n.length;r<i;r++)if(n[r].c==e&&n[r].o==t)return!0}function p(e){var t=[];for(var n in e.partials)t.push('"'+g(n)+'":{name:"'+g(e.partials[n].name)+'", '+p(e.partials[n])+"}");return"partials: {"+t.join(",")+"}, subs: "+function(e){var t=[];for(var n in e)t.push('"'+g(n)+'": function(c,p,t,i) {'+e[n]+"}");return"{ "+t.join(",")+" }"}(e.subs)}e.stringify=function(t,n,r){return"{code: function (c,p,i) { "+e.wrapMain(t.code)+" },"+p(t)+"}"};var m=0;function g(e){return e.replace(a,"\\\\").replace(n,'\\"').replace(r,"\\n").replace(i,"\\r").replace(o,"\\u2028").replace(s,"\\u2029")}function v(e){return~e.indexOf(".")?"d":"f"}function y(e,t){var n="<"+(t.prefix||"")+e.n+m++;return t.partials[n]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+g(n)+'",c,p,"'+(e.indent||"")+'"));',n}function b(e,t){t.code+="t.b(t.t(t."+v(e.n)+'("'+g(e.n)+'",c,p,0)));'}function _(e){return"t.b("+e+");"}e.generate=function(t,n,r){m=0;var i={code:"",subs:{},partials:{}};return e.walk(t,i),r.asString?this.stringify(i,n,r):this.makeTemplate(i,n,r)},e.wrapMain=function(e){return'var t=this;t.b(i=i||"");'+e+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(e,t,n){var r=this.makePartials(e);return r.code=new Function("c","p","i",this.wrapMain(e.code)),new this.template(r,t,this,n)},e.makePartials=function(e){var t,n={subs:{},partials:e.partials,name:e.name};for(t in n.partials)n.partials[t]=this.makePartials(n.partials[t]);for(t in e.subs)n.subs[t]=new Function("c","p","t","i",e.subs[t]);return n},e.codegen={"#":function(t,n){n.code+="if(t.s(t."+v(t.n)+'("'+g(t.n)+'",c,p,1),c,p,0,'+t.i+","+t.end+',"'+t.otag+" "+t.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(t.nodes,n),n.code+="});c.pop();}"},"^":function(t,n){n.code+="if(!t.s(t."+v(t.n)+'("'+g(t.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(t.nodes,n),n.code+="};"},">":y,"<":function(t,n){var r={partials:{},code:"",subs:{},inPartial:!0};e.walk(t.nodes,r);var i=n.partials[y(t,n)];i.subs=r.subs,i.partials=r.partials},$:function(t,n){var r={subs:{},code:"",partials:n.partials,prefix:t.n};e.walk(t.nodes,r),n.subs[t.n]=r.code,n.inPartial||(n.code+='t.sub("'+g(t.n)+'",c,p,i);')},"\n":function(e,t){t.code+=_('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+v(e.n)+'("'+g(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=_('"'+g(e.text)+'"')},"{":b,"&":b},e.walk=function(t,n){for(var r,i=0,a=t.length;i<a;i++)(r=e.codegen[t[i].tag])&&r(t[i],n);return n},e.parse=function(e,t,n){return f(e,0,[],(n=n||{}).sectionTags||[])},e.cache={},e.cacheKey=function(e,t){return[e,!!t.asString,!!t.disableLambda,t.delimiters,!!t.modelGet].join("||")},e.compile=function(t,n){n=n||{};var r=e.cacheKey(t,n),i=this.cache[r];if(i){var a=i.partials;for(var o in a)delete a[o].instance;return i}return i=this.generate(this.parse(this.scan(t,n.delimiters),t,n),t,n),this.cache[r]=i}}(yi);var bi={};(function(e){function t(e,t,n){var r;return t&&"object"==typeof t&&(void 0!==t[e]?r=t[e]:n&&t.get&&"function"==typeof t.get&&(r=t.get(e))),r}e.Template=function(e,t,n,r){e=e||{},this.r=e.code||this.r,this.c=n,this.options=r||{},this.text=t||"",this.partials=e.partials||{},this.subs=e.subs||{},this.buf=""},e.Template.prototype={r:function(e,t,n){return""},v:function(e){return e=c(e),s.test(e)?e.replace(n,"&").replace(r,"<").replace(i,">").replace(a,"'").replace(o,"""):e},t:c,render:function(e,t,n){return this.ri([e],t||{},n)},ri:function(e,t,n){return this.r(e,t,n)},ep:function(e,t){var n=this.partials[e],r=t[n.name];if(n.instance&&n.base==r)return n.instance;if("string"==typeof r){if(!this.c)throw new Error("No compiler available.");r=this.c.compile(r,this.options)}if(!r)return null;if(this.partials[e].base=r,n.subs){for(key in t.stackText||(t.stackText={}),n.subs)t.stackText[key]||(t.stackText[key]=void 0!==this.activeSub&&t.stackText[this.activeSub]?t.stackText[this.activeSub]:this.text);r=function(e,t,n,r,i,a){function o(){}function s(){}var c;o.prototype=e,s.prototype=e.subs;var u=new o;for(c in u.subs=new s,u.subsText={},u.buf="",r=r||{},u.stackSubs=r,u.subsText=a,t)r[c]||(r[c]=t[c]);for(c in r)u.subs[c]=r[c];for(c in i=i||{},u.stackPartials=i,n)i[c]||(i[c]=n[c]);for(c in i)u.partials[c]=i[c];return u}(r,n.subs,n.partials,this.stackSubs,this.stackPartials,t.stackText)}return this.partials[e].instance=r,r},rp:function(e,t,n,r){var i=this.ep(e,n);return i?i.ri(t,n,r):""},rs:function(e,t,n){var r=e[e.length-1];if(u(r))for(var i=0;i<r.length;i++)e.push(r[i]),n(e,t,this),e.pop();else n(e,t,this)},s:function(e,t,n,r,i,a,o){var s;return(!u(e)||0!==e.length)&&("function"==typeof e&&(e=this.ms(e,t,n,r,i,a,o)),s=!!e,!r&&s&&t&&t.push("object"==typeof e?e:t[t.length-1]),s)},d:function(e,n,r,i){var a,o=e.split("."),s=this.f(o[0],n,r,i),c=this.options.modelGet,l=null;if("."===e&&u(n[n.length-2]))s=n[n.length-1];else for(var f=1;f<o.length;f++)void 0!==(a=t(o[f],s,c))?(l=s,s=a):s="";return!(i&&!s)&&(i||"function"!=typeof s||(n.push(l),s=this.mv(s,n,r),n.pop()),s)},f:function(e,n,r,i){for(var a=!1,o=!1,s=this.options.modelGet,c=n.length-1;c>=0;c--)if(void 0!==(a=t(e,n[c],s))){o=!0;break}return o?(i||"function"!=typeof a||(a=this.mv(a,n,r)),a):!i&&""},ls:function(e,t,n,r,i){var a=this.options.delimiters;return this.options.delimiters=i,this.b(this.ct(c(e.call(t,r)),t,n)),this.options.delimiters=a,!1},ct:function(e,t,n){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(e,this.options).render(t,n)},b:function(e){this.buf+=e},fl:function(){var e=this.buf;return this.buf="",e},ms:function(e,t,n,r,i,a,o){var s,c=t[t.length-1],u=e.call(c);return"function"==typeof u?!!r||(s=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(u,c,n,s.substring(i,a),o)):u},mv:function(e,t,n){var r=t[t.length-1],i=e.call(r);return"function"==typeof i?this.ct(c(i.call(r)),r,n):i},sub:function(e,t,n,r){var i=this.subs[e];i&&(this.activeSub=e,i(t,n,this,r),this.activeSub=!1)}};var n=/&/g,r=/</g,i=/>/g,a=/\'/g,o=/\"/g,s=/[&<>\"\']/;function c(e){return String(null==e?"":e)}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}})(bi);var _i=yi;_i.Template=bi.Template,_i.template=_i.Template;var wi,Si,Ri,Pi,xi=t(_i),Oi=function(e,t,n,r){var i;t[0]=0;for(var a=1;a<t.length;a++){var o=t[a++],s=t[a]?(t[0]|=o?1:2,n[t[a++]]):t[++a];3===o?r[0]=s:4===o?r[1]=Object.assign(r[1]||{},s):5===o?(r[1]=r[1]||{})[t[++a]]=s:6===o?r[1][t[++a]]+=s+"":o?(i=e.apply(s,Oi(e,s,n,["",null])),r.push(i),s[0]?t[0]|=2:(t[a-2]=0,t[a]=i)):r.push(s)}return r},Ei=new Map,Ci=function(e){var t=Ei.get(this);return t||(t=new Map,Ei.set(this,t)),(t=Oi(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,i="",a="",o=[0],s=function(e){1===r&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?o.push(0,e,i):3===r&&(e||i)?(o.push(3,e,i),r=2):2===r&&"..."===i&&e?o.push(4,e,0):2===r&&i&&!e?o.push(5,0,!0,i):r>=5&&((i||!e&&5===r)&&(o.push(r,0,i,n),r=6),e&&(o.push(r,e,0,n),r=6)),i=""},c=0;c<e.length;c++){c&&(1===r&&s(),s(c));for(var u=0;u<e[c].length;u++)t=e[c][u],1===r?"<"===t?(s(),o=[o],r=3):i+=t:4===r?"--"===i&&">"===t?(r=1,i=""):i=t+i[0]:a?t===a?a="":i+=t:'"'===t||"'"===t?a=t:">"===t?(s(),r=1):r&&("="===t?(r=5,n=i,i=""):"/"===t&&(r<5||">"===e[c][u+1])?(s(),3===r&&(o=o[0]),r=o,(o=o[0]).push(2,0,r),r=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(s(),r=2):i+=t),3===r&&"!--"===i&&(r=4,o=o[0])}return s(),o}(e)),t),arguments,[])).length>1?t:t[0]}.bind(Vr),Ni=(Si=(wi={createElement:Vr,Fragment:Kr}).createElement,Ri=wi.Fragment,Pi=function(e){var t=e.createElement;return function(e){var n=e.classNames,r=e.children,i=e.highlightedTagName,a=e.isHighlighted,o=e.nonHighlightedTagName;return t(a?i:o,{className:a?n.highlighted:n.nonHighlighted},r)}}({createElement:Si}),function(e){var t=e.parts,n=e.highlightedTagName,r=void 0===n?"mark":n,i=e.nonHighlightedTagName,a=void 0===i?"span":i,o=e.separator,s=void 0===o?", ":o,c=e.className,u=e.classNames,l=void 0===u?{}:u,f=Pr(e,Lr);return Si("span",Rr({},f,{className:xr(l.root,c)}),t.map((function(e,n){var i=n===t.length-1;return Si(Ri,{key:n},e.map((function(e,t){return Si(Pi,{key:t,classNames:l,highlightedTagName:r,nonHighlightedTagName:a,isHighlighted:e.isHighlighted},e.value)})),!i&&Si("span",{className:l.separator},s))})))}),ji=["classNames"];function Ti(){return Ti=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ti.apply(this,arguments)}function ki(e){var t=e.classNames,n=void 0===t?{}:t,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,ji);return Vr(Ni,Ti({classNames:{root:xr("ais-Highlight",n.root),highlighted:xr("ais-Highlight-highlighted",n.highlighted),nonHighlighted:xr("ais-Highlight-nonHighlighted",n.nonHighlighted),separator:xr("ais-Highlight-separator",n.separator)}},r))}var Ii=["hit","attribute","cssClasses"];function Fi(){return Fi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fi.apply(this,arguments)}function Ai(e){var t=e.hit,n=e.attribute,r=e.cssClasses,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Ii),a=Sr(lr(t._highlightResult,n)||[]).map((function(e){return ur(Bn(e.value||""))}));return Vr(ki,Fi({},i,{parts:a,classNames:r}))}var Mi=["classNames"];function Li(){return Li=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Li.apply(this,arguments)}function Hi(e){var t=e.classNames,n=void 0===t?{}:t,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Mi);return Vr(Ni,Li({classNames:{root:xr("ais-ReverseHighlight",n.root),highlighted:xr("ais-ReverseHighlight-highlighted",n.highlighted),nonHighlighted:xr("ais-ReverseHighlight-nonHighlighted",n.nonHighlighted),separator:xr("ais-ReverseHighlight-separator",n.separator)}},r))}function Di(e){return Di="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Di(e)}var qi=["hit","attribute","cssClasses"],Ui=["isHighlighted"];function Wi(){return Wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wi.apply(this,arguments)}function Bi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bi(Object(n),!0).forEach((function(t){Vi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Vi(e,t,n){return t=function(e){var t=function(e,t){if("object"!=Di(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Di(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==Di(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qi(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ki(e){var t=e.hit,n=e.attribute,r=e.cssClasses,i=Qi(e,qi),a=Sr(lr(t._highlightResult,n)||[]).map((function(e){return ur(Bn(e.value||"")).map((function(e){var t=e.isHighlighted;return $i($i({},Qi(e,Ui)),{},{isHighlighted:!t})}))}));return Vr(Hi,Wi({},i,{parts:a,classNames:r}))}var zi=["classNames"];function Gi(){return Gi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gi.apply(this,arguments)}function Ji(e){var t=e.classNames,n=void 0===t?{}:t,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,zi);return Vr(Ni,Gi({classNames:{root:xr("ais-ReverseSnippet",n.root),highlighted:xr("ais-ReverseSnippet-highlighted",n.highlighted),nonHighlighted:xr("ais-ReverseSnippet-nonHighlighted",n.nonHighlighted),separator:xr("ais-ReverseSnippet-separator",n.separator)}},r))}function Yi(e){return Yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yi(e)}var Xi=["hit","attribute","cssClasses"],Zi=["isHighlighted"];function ea(){return ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ea.apply(this,arguments)}function ta(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function na(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ta(Object(n),!0).forEach((function(t){ra(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ta(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ra(e,t,n){return t=function(e){var t=function(e,t){if("object"!=Yi(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Yi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==Yi(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ia(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function aa(e){var t=e.hit,n=e.attribute,r=e.cssClasses,i=ia(e,Xi),a=Sr(lr(t._snippetResult,n)||[]).map((function(e){return ur(Bn(e.value||"")).map((function(e){var t=e.isHighlighted;return na(na({},ia(e,Zi)),{},{isHighlighted:!t})}))}));return Vr(Ji,ea({},i,{parts:a,classNames:r}))}var oa=["classNames"];function sa(){return sa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sa.apply(this,arguments)}function ca(e){var t=e.classNames,n=void 0===t?{}:t,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,oa);return Vr(Ni,sa({classNames:{root:xr("ais-Snippet",n.root),highlighted:xr("ais-Snippet-highlighted",n.highlighted),nonHighlighted:xr("ais-Snippet-nonHighlighted",n.nonHighlighted),separator:xr("ais-Snippet-separator",n.separator)}},r))}var ua=["hit","attribute","cssClasses"];function la(){return la=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},la.apply(this,arguments)}function fa(e){var t=e.hit,n=e.attribute,r=e.cssClasses,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,ua),a=Sr(lr(t._snippetResult,n)||[]).map((function(e){return ur(Bn(e.value||""))}));return Vr(ca,la({},i,{parts:a,classNames:r}))}function da(e){return da="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},da(e)}function ha(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ha(Object(n),!0).forEach((function(t){ma(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ha(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ma(e,t,n){return t=function(e){var t=function(e,t){if("object"!=da(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=da(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==da(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ga(){return ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ga.apply(this,arguments)}function va(e){return va="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},va(e)}function ya(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ba(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _a(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ea(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wa(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sa(e,t)}function Sa(e,t){return Sa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Sa(e,t)}function Ra(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=xa(e);if(t){var i=xa(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===va(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Pa(e)}(this,n)}}function Pa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xa(e){return xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xa(e)}function Oa(e,t,n){return(t=Ea(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ea(e){var t=function(e){if("object"!=va(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=va(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==va(t)?t:String(t)}var Ca=function(e){wa(n,e);var t=Ra(n);function n(){var e;ba(this,n);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return Oa(Pa(e=t.call.apply(t,[this].concat(i))),"ref",{current:null}),Oa(Pa(e),"nodes",[]),e}return _a(n,[{key:"componentDidMount",value:function(){var e,t=new DocumentFragment,n=document.createElement("div");n.innerHTML=this.props.content,this.nodes=function(e){if(Array.isArray(e))return ya(e)}(e=n.childNodes)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ya(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ya(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),this.nodes.forEach((function(e){return t.appendChild(e)})),this.ref.current.replaceWith(t)}},{key:"componentWillUnmount",value:function(){this.nodes.forEach((function(e){e instanceof Element?e.outerHTML="":e.nodeValue=""})),this.nodes[0].nodeValue&&(this.nodes[0].nodeValue="")}},{key:"render",value:function(){return Vr("div",{ref:this.ref})}}]),n}(zr),Na=function(e){wa(n,e);var t=Ra(n);function n(){return ba(this,n),t.apply(this,arguments)}return _a(n,[{key:"shouldComponentUpdate",value:function(e){return!_r(this.props.data,e.data)||this.props.templateKey!==e.templateKey||!_r(this.props.rootProps,e.rootProps)}},{key:"render",value:function(){var e="fragment"===this.props.rootTagName?Kr:this.props.rootTagName,t=this.props.useCustomCompileOptions[this.props.templateKey]?this.props.templatesConfig.compileOptions:{},n=function(e){var t=e.templates,n=e.templateKey,r=e.compileOptions,i=e.helpers,a=e.data,o=e.bindEvent,s=e.sendEvent,c=t[n];if("string"!=typeof c&&"function"!=typeof c)throw new Error("Template must be 'string' or 'function', was '".concat(da(c),"' (key: ").concat(n,")"));if("function"==typeof c){var u=o||{};return u.html=Ci,u.sendEvent=s,u.components={Highlight:Ai,ReverseHighlight:Ki,Snippet:fa,ReverseSnippet:aa},c(a,u)}var l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return Object.keys(e).reduce((function(r,i){return pa(pa({},r),{},ma({},i,(function(){var r=this;return function(a){return e[i].call(n,a,(function(e){return xi.compile(e,t).render(r)}))}})))}),{})}(i,r,a);return xi.compile(c,r).render(pa(pa({},a),{},{helpers:l})).replace(/[ \n\r\t\f\xA0]+/g,(function(e){return e.replace(/(^|\xA0+)[^\xA0]+/g,"$1 ")})).trim()}({templates:this.props.templates,templateKey:this.props.templateKey,compileOptions:t,helpers:this.props.templatesConfig.helpers,data:this.props.data,bindEvent:this.props.bindEvent,sendEvent:this.props.sendEvent});return null===n?null:"object"===va(n)?Vr(e,this.props.rootProps,n):e===Kr?Vr(Ca,{content:n,key:Math.random()}):Vr(e,ga({},this.props.rootProps,{dangerouslySetInnerHTML:{__html:n}}))}}]),n}(zr);function ja(e){return ja="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ja(e)}function Ta(e,t){return Ta=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ta(e,t)}function ka(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ia(e){return Ia=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ia(e)}function Fa(e,t,n){return(t=Aa(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aa(e){var t=function(e,t){if("object"!=ja(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=ja(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==ja(t)?t:String(t)}Oa(Na,"defaultProps",{data:{},rootTagName:"div",useCustomCompileOptions:{},templates:{},templatesConfig:{}});var Ma={query:"",showSubmit:!0,showReset:!0,showLoadingIndicator:!0,autofocus:!1,searchAsYouType:!0,ignoreCompositionEvents:!1,isSearchStalled:!1,disabled:!1,ariaLabel:"Search",onChange:An,onSubmit:An,onReset:An,refine:An},La=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ta(e,t)}(o,e);var t,n,r,i,a=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Ia(t);if(n){var i=Ia(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){if(t&&("object"===ja(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ka(e)}(this,e)});function o(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Fa(ka(e=a.call.apply(a,[this].concat(n))),"state",{query:e.props.query,focused:!1}),Fa(ka(e),"input",{current:null}),Fa(ka(e),"onInput",(function(t){var n=e.props,r=n.searchAsYouType,i=n.refine,a=n.onChange,o=t.target.value;e.props.ignoreCompositionEvents&&t.isComposing||(r&&i(o),e.setState({query:o}),a(t))})),Fa(ka(e),"onSubmit",(function(t){var n=e.props,r=n.searchAsYouType,i=n.refine,a=n.onSubmit;return t.preventDefault(),t.stopPropagation(),e.input.current&&e.input.current.blur(),r||i(e.state.query),a(t),!1})),Fa(ka(e),"onReset",(function(t){var n=e.props,r=n.refine,i=n.onReset;e.input.current&&e.input.current.focus(),r(""),e.setState({query:""}),i(t)})),Fa(ka(e),"onBlur",(function(){e.setState({focused:!1})})),Fa(ka(e),"onFocus",(function(){e.setState({focused:!0})})),e}return r=o,(i=[{key:"resetInput",value:function(){this.setState({query:""})}},{key:"componentWillReceiveProps",value:function(e){this.state.focused||e.query===this.state.query||this.setState({query:e.query})}},{key:"render",value:function(){var e=this.props,t=e.cssClasses,n=e.placeholder,r=e.autofocus,i=e.showSubmit,a=e.showReset,o=e.showLoadingIndicator,s=e.templates,c=e.isSearchStalled,u=e.ariaLabel;return Vr("div",{className:t.root},Vr("form",{action:"",role:"search",className:t.form,noValidate:!0,onSubmit:this.onSubmit,onReset:this.onReset},Vr("input",{ref:this.input,value:this.state.query,disabled:this.props.disabled,className:t.input,type:"search",placeholder:n,autoFocus:r,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",maxLength:512,onInput:this.onInput,oncompositionend:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,"aria-label":u}),Vr(Na,{templateKey:"submit",rootTagName:"button",rootProps:{className:t.submit,type:"submit",title:"Submit the search query",hidden:!i},templates:s,data:{cssClasses:t}}),Vr(Na,{templateKey:"reset",rootTagName:"button",rootProps:{className:t.reset,type:"reset",title:"Clear the search query",hidden:!(a&&this.state.query.trim()&&!c)},templates:s,data:{cssClasses:t}}),o&&Vr(Na,{templateKey:"loadingIndicator",rootTagName:"span",rootProps:{className:t.loadingIndicator,hidden:!c},templates:s,data:{cssClasses:t}})))}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Aa(r.key),r)}}(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),o}(zr);function Ha(e){return Ha="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ha(e)}function Da(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Da(Object(n),!0).forEach((function(t){Ua(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Da(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ua(e,t,n){return t=function(e){var t=function(e,t){if("object"!=Ha(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Ha(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==Ha(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Fa(La,"defaultProps",Ma);var Wa=sr({name:"hits",connector:!0}),Ba=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:An;return Mn(e,Wa()),function(n){var r,i,a=n||{},o=a.escapeHTML,s=void 0===o||o,c=a.transformItems,u=void 0===c?function(e){return e}:c;return{$$type:"ais.hits",init:function(t){e(qa(qa({},this.getWidgetRenderState(t)),{},{instantSearchInstance:t.instantSearchInstance}),!0)},render:function(t){var n=this.getWidgetRenderState(t);e(qa(qa({},n),{},{instantSearchInstance:t.instantSearchInstance}),!1),n.sendEvent("view:internal",n.items)},getRenderState:function(e,t){return qa(qa({},e),{},{hits:this.getWidgetRenderState(t)})},getWidgetRenderState:function(e){var t,a,o,c=e.results,l=e.helper,f=e.instantSearchInstance;if(r||(r=function(e){var t=e.instantSearchInstance,n=e.getIndex,r=e.widgetType,i={},a=void 0;return function(){for(var e=arguments.length,o=new Array(e),s=0;s<e;s++)o[s]=arguments[s];or({widgetType:r,getIndex:n,methodName:"sendEvent",args:o,instantSearchInstance:t}).forEach((function(e){"click"===e.eventType&&"internal"===e.eventModifier&&i[e.eventType]||(i[e.eventType]=!0,t.sendEventToInsights(e))})),clearTimeout(a),a=setTimeout((function(){i={}}),0)}}({instantSearchInstance:f,getIndex:function(){return l.getIndex()},widgetType:this.$$type})),i||(i=function(e){var t=e.getIndex,n=e.widgetType,r=e.instantSearchInstance;return function(){for(var e=arguments.length,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];var o,s=or({widgetType:n,getIndex:t,methodName:"bindEvent",args:i,instantSearchInstance:r});return s.length?"data-insights-event=".concat((o=s,btoa(encodeURIComponent(JSON.stringify(o))))):""}}({getIndex:function(){return l.getIndex()},widgetType:this.$$type,instantSearchInstance:f})),!c)return{hits:[],items:[],results:void 0,banner:void 0,sendEvent:r,bindEvent:i,widgetParams:n};s&&c.hits.length>0&&(c.hits=function(e){return void 0===e.__escaped&&((e=e.map((function(e){var t=Qn({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));return t._highlightResult&&(t._highlightResult=Zn(t._highlightResult)),t._snippetResult&&(t._snippetResult=Zn(t._snippetResult)),t}))).__escaped=!0),e}(c.hits));var d=function(e,t,n){return e.map((function(e,r){return hr(hr({},e),{},{__position:n*t+r+1})}))}(c.hits,c.page,c.hitsPerPage),h=function(e,t){return t?e.map((function(e){return vr(vr({},e),{},{__queryID:t})})):e}(d,c.queryID),p=u(h,{results:c});return{hits:p,items:p,results:c,banner:null===(t=c.renderingContent)||void 0===t||null===(a=t.widgets)||void 0===a||null===(o=a.banners)||void 0===o?void 0:o[0],sendEvent:r,bindEvent:i,widgetParams:n}},dispose:function(e){var n=e.state;return t(),s?n.setQueryParameters(Object.keys(Jn).reduce((function(e,t){return qa(qa({},e),{},Ua({},t,void 0))}),{})):n},getWidgetSearchParameters:function(e,t){return s?e.setQueryParameters(Jn):e}}}};function $a(e){return $a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$a(e)}function Va(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Va(Object(n),!0).forEach((function(t){Ka(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Va(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ka(e,t,n){return t=function(e){var t=function(e,t){if("object"!=$a(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=$a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==$a(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function za(e){return function(t,n){return e((function(e,n){var r=e.results,i=e.hits,a=e.instantSearchInstance;if(r&&i&&a){var o=function(e,t,n){return function(r){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];var s=a[0];if(!e){var c=sr({name:"instantsearch"});throw new Error(c("The `insightsClient` option has not been provided to `instantsearch`."))}if(!Array.isArray(s.objectIDs))throw new TypeError("Expected `objectIDs` to be an array.");var u=function(e){var t=e.method,n=e.results,r=e.hits,i=e.objectIDs,a=n.index,o=function(e,t){return t.map((function(t){var n=function(e){for(var n,r=0;r<e.length;r++)if((n=e[r]).objectID===t)return n}(e);if(void 0===n)throw new Error('Could not find objectID "'.concat(t,'" passed to `clickedObjectIDsAfterSearch` in the returned hits. This is necessary to infer the absolute position and the query ID.'));return n}))}(r,i),s=function(e){var t=wr(e.map((function(e){return e.__queryID})));if(t.length>1)throw new Error("Insights currently allows a single `queryID`. The `objectIDs` provided map to multiple `queryID`s.");var n=t[0];if("string"!=typeof n)throw new Error("Could not infer `queryID`. Ensure InstantSearch `clickAnalytics: true` was added with the Configure widget.\n\nSee: https://alg.li/lNiZZ7");return n}(o);switch(t){case"clickedObjectIDsAfterSearch":var c=function(e){return e.map((function(e){return e.__position}))}(o);return{index:a,queryID:s,objectIDs:i,positions:c};case"convertedObjectIDsAfterSearch":return{index:a,queryID:s,objectIDs:i};default:throw new Error('Unsupported method passed to insights: "'.concat(t,'".'))}}({method:r,results:t,hits:n,objectIDs:s.objectIDs});e(r,Qa(Qa({},u),s))}}(a.insightsClient,r,i);return t(Qa(Qa({},e),{},{insights:o}),n)}return t(e,n)}),n)}}function Ga(e,t,n){for(var r=e;r&&!n(r);){if(r===t)return null;r=r.parentElement}return r}var Ja={empty:function(){return"No results"},item:function(e){return JSON.stringify((n=["__hitIndex"],null==(t=e)?t:Object.keys(t).reduce((function(e,r){if(n.indexOf(r)>=0)return e;var i=r;return e[i]=t[i],e}),{})),null,2);var t,n}};function Ya(e){return Ya="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ya(e)}var Xa=["hit","index"];function Za(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function eo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Za(Object(n),!0).forEach((function(t){to(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Za(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function to(e,t,n){return t=function(e){var t=function(e,t){if("object"!=Ya(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=Ya(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==Ya(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function no(){return no=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},no.apply(this,arguments)}var ro=sr({name:"hits"}),io=function(e){var t=e.createElement,n=function(e){var t=e.createElement;return function(e){var n=e.classNames,r=e.banner;return r.image.urls[0].url?t("aside",{className:xr("ais-Hits-banner",n.bannerRoot)},r.link?t("a",{className:xr("ais-Hits-banner-link",n.bannerLink),href:r.link.url,target:r.link.target},t("img",{className:xr("ais-Hits-banner-image",n.bannerImage),src:r.image.urls[0].url,alt:r.image.title})):t("img",{className:xr("ais-Hits-banner-image",n.bannerImage),src:r.image.urls[0].url,alt:r.image.title})):null}}({createElement:t});return function(e){var r=e.classNames,i=void 0===r?{}:r,a=e.hits,o=e.itemComponent,s=e.sendEvent,c=e.emptyComponent,u=e.banner,l=e.bannerComponent,f=Pr(e,Hr);return t("div",Rr({},f,{className:xr("ais-Hits",i.root,0===a.length&&xr("ais-Hits--empty",i.emptyRoot),f.className)}),u&&(l?t(l,{className:xr("ais-Hits-banner",i.bannerRoot),banner:u}):t(n,{classNames:i,banner:u})),0===a.length&&c?t(c,null):t("ol",{className:xr("ais-Hits-list",i.list)},a.map((function(e,n){return t(o,{key:e.objectID,hit:e,index:n,className:xr("ais-Hits-item",i.item),onClick:function(){s("click:internal",e,"Hit Clicked")},onAuxClick:function(){s("click:internal",e,"Hit Clicked")}})}))))}}({createElement:Vr}),ao=function(e){var t=e.renderState,n=e.cssClasses,r=e.containerNode,i=e.templates;return function(e,a){var o=e.items,s=e.results,c=e.instantSearchInstance,u=e.insights,l=e.bindEvent,f=e.sendEvent,d=e.banner;if(a)t.templateProps=function(e){var t=e.defaultTemplates,n=e.templates,r=e.templatesConfig,i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wr([].concat(gi(Object.keys(e||{})),gi(Object.keys(t)))).reduce((function(n,r){var i=e?e[r]:void 0,a=t[r],o=void 0!==a&&a!==i;return n.templates[r]=o?a:i,n.useCustomCompileOptions[r]=o,n}),{templates:{},useCustomCompileOptions:{}})}(t,n);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pi(Object(n),!0).forEach((function(t){mi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({templatesConfig:r},i)}({defaultTemplates:Ja,templatesConfig:c.templatesConfig,templates:i});else{var h=function(e){var t=e.insights,n=e.sendEvent;return function(e){var r=Ga(e.target,e.currentTarget,(function(e){return e.hasAttribute("data-insights-event")}));r&&function(e){var t=e.getAttribute("data-insights-event");if("string"!=typeof t)throw new Error("The insights middleware expects `data-insights-event` to be a base64-encoded JSON string.");try{return er(t)}catch(e){throw new Error("The insights middleware was unable to parse `data-insights-event`.")}}(r).forEach((function(e){return n(e)}));var i=Ga(e.target,e.currentTarget,(function(e){return e.hasAttribute("data-insights-method")&&e.hasAttribute("data-insights-payload")}));if(i){var a=function(e){var t=e.getAttribute("data-insights-method"),n=e.getAttribute("data-insights-payload");if("string"!=typeof n)throw new Error("The insights helper expects `data-insights-payload` to be a base64-encoded JSON string.");try{return{method:t,payload:er(n)}}catch(e){throw new Error("The insights helper was unable to parse `data-insights-payload`.")}}(i),o=a.method,s=a.payload;t(o,s)}}}({insights:u,sendEvent:f});di(Vr(io,{hits:o,itemComponent:function(e){var n=e.hit,r=e.index,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Xa);return Vr(Na,no({},t.templateProps,{templateKey:"item",rootTagName:"li",rootProps:eo(eo({},i),{},{onClick:function(e){h(e),i.onClick()},onAuxClick:function(e){h(e),i.onAuxClick()}}),data:eo(eo({},n),{},{get __hitIndex(){return r}}),bindEvent:l,sendEvent:f}))},sendEvent:f,classNames:n,emptyComponent:function(e){var n=no({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));return Vr(Na,no({},t.templateProps,{rootProps:n,templateKey:"empty",data:s,rootTagName:"fragment"}))},banner:d,bannerComponent:i.banner?function(e){return Vr(Na,no({},t.templateProps,{templateKey:"banner",data:e,rootTagName:"fragment"}))}:void 0}),r)}}},oo=function(e){var t=e||{},n=t.container,r=t.escapeHTML,i=t.transformItems,a=t.templates,o=void 0===a?{}:a,s=t.cssClasses,c=void 0===s?{}:s;if(!n)throw new Error(ro("The `container` option is required."));var u=cr(n),l=ao({containerNode:u,cssClasses:c,renderState:{},templates:o});return eo(eo({},za(Ba)(l,(function(){return di(null,u)}))({escapeHTML:r,transformItems:i})),{},{$$widgetType:"ais.hits"})},so=Vr("path",{d:"M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"}),co=Vr("path",{d:"M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z"}),uo=Vr("g",{fill:"none","fill-rule":"evenodd"},Vr("g",{transform:"translate(1 1)","stroke-width":"2"},Vr("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),Vr("path",{d:"M36 18c0-9.94-8.06-18-18-18"},Vr("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))),lo={reset:function(e){return Vr("svg",{className:e.cssClasses.resetIcon,viewBox:"0 0 20 20",width:"10",height:"10","aria-hidden":"true"},so)},submit:function(e){return Vr("svg",{className:e.cssClasses.submitIcon,width:"10",height:"10",viewBox:"0 0 40 40","aria-hidden":"true"},co)},loadingIndicator:function(e){return Vr("svg",{"aria-label":"Results are loading",className:e.cssClasses.loadingIcon,width:"16",height:"16",viewBox:"0 0 38 38",stroke:"#444","aria-hidden":"true"},uo)}};function fo(e){return fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fo(e)}function ho(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function po(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ho(Object(n),!0).forEach((function(t){mo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ho(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mo(e,t,n){return t=function(e){var t=function(e,t){if("object"!=fo(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=fo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==fo(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var go=sr({name:"search-box",connector:!0}),vo=function(e,t){return t(e)};function yo(e){return yo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yo(e)}function bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bo(Object(n),!0).forEach((function(t){wo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wo(e,t,n){return t=function(e){var t=function(e,t){if("object"!=yo(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=yo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==yo(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var So=sr({name:"search-box"}),Ro=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.descendantName,n=e.modifierName,r=t?"-".concat(t):"",i=n?"--".concat(n):"";return"".concat("ais","-").concat("SearchBox").concat(r).concat(i)};!function(){let e=!1;function t(){const e=document.querySelector("script[data-sodo-search]");e&&e.remove();const t=document.getElementById("sodo-search-root");t&&t.remove()}Object.defineProperty(window,"SodoSearch",{configurable:!1,enumerable:!1,get:()=>({init:()=>{},preact:{render:()=>{},h:()=>{},Component:class{}}}),set:()=>{}}),new MutationObserver((e=>{for(const t of e)for(const e of t.addedNodes)1===e.nodeType&&("SCRIPT"===e.tagName&&e.hasAttribute("data-sodo-search")&&e.remove(),"sodo-search-root"===e.id&&e.remove())})).observe(document.documentElement,{childList:!0,subtree:!0}),t(),document.addEventListener("DOMContentLoaded",t);class n{constructor(t={}){if(e)return window.magicPagesSearch;const n=window.__MP_SEARCH_CONFIG__||{typesenseNodes:[{host:"localhost",port:"8108",protocol:"http"}],typesenseApiKey:null,collectionName:null,commonSearches:[],theme:"system",theme:"system",searchFields:{title:{weight:4,highlight:!0},excerpt:{weight:2,highlight:!0},html:{weight:1,highlight:!0}}};if(this.config={commonSearches:[],...n,...t,commonSearches:t.commonSearches||n.commonSearches||[]},!this.config.typesenseNodes||!this.config.typesenseApiKey||!this.config.collectionName)throw new Error("MagicPagesSearch: Missing required configuration");this.selectedIndex=-1,this.searchDebounceTimeout=null,this.cachedElements={},this.init(),e=!0}getParentAccentColor(){try{return window.getComputedStyle(document.documentElement).getPropertyValue("--ghost-accent-color").trim()||null}catch(e){return null}}updateDarkMode(){const e=window.matchMedia("(prefers-color-scheme: dark)").matches;this.doc&&this.doc.documentElement.classList.toggle("dark",e)}createIframe(){this.iframe=document.createElement("iframe");const e=window.innerWidth<640?3999999:3999997;this.iframe.style.cssText=`\n border: none;\n width: 100vw;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ${e};\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);\n `,window.visualViewport&&window.visualViewport.addEventListener("resize",(()=>{if(this.modal&&this.modal.classList.contains("hidden"))return;const e=this.doc.querySelector(".mp-modal-container");e&&(e.style.height=`${window.visualViewport.height}px`,e.style.transform=`translateY(${window.visualViewport.offsetTop}px)`)})),window.addEventListener("resize",(()=>{const e=window.innerWidth<640;this.iframe.style.zIndex=e?3999999:3999997})),document.body.appendChild(this.iframe),this.doc=this.iframe.contentDocument||this.iframe.contentWindow.document;const t=this.getParentAccentColor(),n=t?`\n :root {\n --ghost-accent-color: ${t};\n }`:"";this.doc.open(),this.doc.write(`\n <!DOCTYPE html>\n <html>\n <head>\n <style>${n}</style>\n <style>${BUNDLED_CSS}</style>\n </head>\n <body>\n <div id="mp-search-wrapper" data-theme="${this.config.theme}">\n <div id="mp-search-modal" class="hidden" role="dialog" aria-modal="true" aria-label="Search">\n <div class="mp-backdrop"></div>\n <div class="mp-modal-container">\n <button class="mp-close-button" aria-label="Close search">\n <span aria-hidden="true">×</span>\n </button>\n <div class="mp-modal-content">\n <div class="mp-search-header">\n <div id="mp-searchbox" role="search"></div>\n <div class="mp-keyboard-hints">\n <span>\n <kbd class="mp-kbd">↑↓</kbd>\n to navigate\n </span>\n <span>\n <kbd class="mp-kbd">esc</kbd>\n to close\n </span>\n </div>\n </div>\n <div class="mp-results-container">\n ${this.getCommonSearchesHtml()}\n <div id="mp-hits" role="region" aria-label="Search results"></div>\n <div id="mp-loading-state" class="mp-loading-state" role="status" aria-live="polite">\n <div class="mp-loading-spinner" aria-hidden="true"></div>\n <div>Searching...</div>\n </div>\n <div id="mp-empty-state" class="hidden" role="status" aria-live="polite">\n <div class="mp-empty-message">\n <p>No results found for your search</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </body>\n </html>\n `),this.doc.close(),this.modal=this.doc.getElementById("mp-search-modal"),this.wrapper=this.doc.getElementById("mp-search-wrapper"),this.cachedElements={modal:this.modal,wrapper:this.wrapper},this.updateDarkMode(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(()=>{this.updateDarkMode()})),new MutationObserver((()=>{this.updateDarkMode()})).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})}getCommonSearchesHtml(){return this.config.commonSearches?.length?`\n <div class="mp-common-searches">\n <div class="mp-common-searches-title" role="heading" aria-level="2">\n Common searches\n </div>\n <div id="mp-common-searches-container" role="list">\n ${this.config.commonSearches.map((e=>`\n <button type="button" \n class="mp-common-search-btn" \n data-search="${e}"\n role="listitem">\n ${e}\n </button>\n `)).join("")}\n </div>\n </div>\n `:'\n <div class="mp-common-searches">\n <div class="mp-empty-message">Start typing to search...</div>\n </div>\n '}getSearchParameters(){const e=Object.keys(this.config.searchFields||{}).length>0?this.config.searchFields:{title:{weight:4,highlight:!0},excerpt:{weight:2,highlight:!0},html:{weight:1,highlight:!0}},t=[],n=[],r=[];return Object.entries(e).forEach((([e,i])=>{t.push(e),n.push(i.weight||1),i.highlight&&r.push(e)})),{query_by:t.join(","),query_by_weights:n.join(","),highlight_full_fields:r.join(","),highlight_affix_num_tokens:20,include_fields:"title,url,excerpt,html",typo_tolerance:!0,num_typos:2,prefix:!0,per_page:10}}init(){this.createIframe(),this.initSearch(),this.initEventListeners(),this.handleThemeChange(),"#/search"===window.location.hash&&this.openModal()}initSearch(){const e=this.getSearchParameters(),t=new kn({server:{apiKey:this.config.typesenseApiKey,nodes:this.config.typesenseNodes},additionalSearchParameters:e});this.search=Fn({indexName:this.config.collectionName,searchClient:t.searchClient,searchFunction:e=>this.handleSearch(e)}),this.initWidgets(),this.search.start()}handleSearch(e){this.cachedElements.container||(this.cachedElements.container=this.doc.getElementById("mp-hits"),this.cachedElements.commonSearches=this.doc.querySelector(".mp-common-searches"),this.cachedElements.emptyState=this.doc.getElementById("mp-empty-state"),this.cachedElements.loadingState=this.doc.getElementById("mp-loading-state"));const{container:t,commonSearches:n,emptyState:r,loadingState:i}=this.cachedElements;r&&!e.state.query&&r.classList.add("hidden");const a=e.state.query?.trim();if(!a)return this.selectedIndex=-1,t&&t.classList.add("hidden"),n&&n.classList.remove("hidden"),r&&r.classList.add("hidden"),void(i&&i.classList.remove("active"));n&&n.classList.add("hidden"),t&&t.classList.remove("hidden"),i&&i.classList.add("active"),e.search()}initWidgets(){this.searchBox=function(e){var t=e||{},n=t.container,r=t.placeholder,i=void 0===r?"":r,a=t.cssClasses,o=void 0===a?{}:a,s=t.autofocus,c=void 0!==s&&s,u=t.searchAsYouType,l=void 0===u||u,f=t.ignoreCompositionEvents,d=void 0!==f&&f,h=t.showReset,p=void 0===h||h,m=t.showSubmit,g=void 0===m||m,v=t.showLoadingIndicator,y=void 0===v||v,b=t.queryHook,_=t.templates,w=void 0===_?{}:_;if(!n)throw new Error(So("The `container` option is required."));var S=cr(n),R={root:xr(Ro(),o.root),form:xr(Ro({descendantName:"form"}),o.form),input:xr(Ro({descendantName:"input"}),o.input),submit:xr(Ro({descendantName:"submit"}),o.submit),submitIcon:xr(Ro({descendantName:"submitIcon"}),o.submitIcon),reset:xr(Ro({descendantName:"reset"}),o.reset),resetIcon:xr(Ro({descendantName:"resetIcon"}),o.resetIcon),loadingIndicator:xr(Ro({descendantName:"loadingIndicator"}),o.loadingIndicator),loadingIcon:xr(Ro({descendantName:"loadingIcon"}),o.loadingIcon)},P=_o(_o({},lo),w),x=function(e){var t=e.containerNode,n=e.cssClasses,r=e.placeholder,i=e.templates,a=e.autofocus,o=e.searchAsYouType,s=e.ignoreCompositionEvents,c=e.showReset,u=e.showSubmit,l=e.showLoadingIndicator;return function(e){var f=e.refine,d=e.query,h=e.isSearchStalled;di(Vr(La,{query:d,placeholder:r,autofocus:a,refine:f,searchAsYouType:o,ignoreCompositionEvents:s,templates:i,showSubmit:u,showReset:c,showLoadingIndicator:l,isSearchStalled:h,cssClasses:n}),t)}}({containerNode:S,cssClasses:R,placeholder:i,templates:P,autofocus:c,searchAsYouType:l,ignoreCompositionEvents:d,showReset:p,showSubmit:g,showLoadingIndicator:y}),O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:An;return Mn(e,go()),function(n){var r,i,a=(n||{}).queryHook,o=void 0===a?vo:a;return{$$type:"ais.searchBox",init:function(t){var n=t.instantSearchInstance;e(po(po({},this.getWidgetRenderState(t)),{},{instantSearchInstance:n}),!0)},render:function(t){var n=t.instantSearchInstance;e(po(po({},this.getWidgetRenderState(t)),{},{instantSearchInstance:n}),!1)},dispose:function(e){var n=e.state;return t(),n.setQueryParameter("query",void 0)},getRenderState:function(e,t){return po(po({},e),{},{searchBox:this.getWidgetRenderState(t)})},getWidgetRenderState:function(e){var t=e.helper,a=e.instantSearchInstance,s=e.state;return r||(r=function(e){o(e,(function(e){return t.setQuery(e).search()}))},i=function(){t.setQuery("").search()}),{query:s.query||"",refine:r,clear:i,widgetParams:n,isSearchStalled:"stalled"===a.status}},getWidgetUiState:function(e,t){var n=t.searchParameters.query||"";return""===n||e&&e.query===n?e:po(po({},e),{},{query:n})},getWidgetSearchParameters:function(e,t){var n=t.uiState;return e.setQueryParameter("query",n.query||"")}}}}(x,(function(){return di(null,S)}));return _o(_o({},O({queryHook:b})),{},{$$widgetType:"ais.searchBox"})}({container:this.doc.querySelector("#mp-searchbox"),placeholder:"Search for anything",autofocus:!0,showReset:!1,showSubmit:!1,showLoadingIndicator:!1,searchAsYouType:!0,queryHook:(e,t)=>{this.searchDebounceTimeout&&clearTimeout(this.searchDebounceTimeout),this.searchDebounceTimeout=setTimeout((()=>{t(e)}),80)},cssClasses:{root:"",form:"",input:"mp-search-input",resetIcon:"hidden",submitIcon:"hidden"}}),this.search.addWidgets([this.searchBox,oo({container:this.doc.querySelector("#mp-hits"),cssClasses:{root:"",list:"mp-hits-list list-none",emptyRoot:"hidden",item:""},templates:{item:e=>{const t=this.doc.getElementById("mp-loading-state");t&&t.classList.remove("active");try{const t=document.createElement("div");t.innerHTML=e.excerpt||e.html||"";const n=(t.textContent||t.innerText||"").trim().substring(0,120).replace(/\s+[^\s]*$/,"..."),r=e._highlightResult?.title?.value||e.title||"Untitled";return`\n <a href="${e.url||"#"}" \n class="mp-result-link"\n aria-label="${r.replace(/<[^>]*>/g,"")}">\n <article class="mp-result-item" role="article">\n <h3 class="mp-result-title" role="heading" aria-level="3">${r}</h3>\n <p class="mp-result-excerpt" aria-label="Article excerpt">${n}</p>\n </article>\n </a>\n `}catch(e){return""}},empty:e=>{if(e.query&&e.query.trim()){const e=this.doc.getElementById("mp-empty-state"),t=this.doc.getElementById("mp-hits"),n=this.doc.getElementById("mp-loading-state");t&&t.classList.add("hidden"),e&&e.classList.remove("hidden"),n&&n.classList.remove("active")}return""}}})])}initEventListeners(){window.addEventListener("hashchange",(()=>{"#/search"===window.location.hash?this.openModal():this.modal&&!this.modal.classList.contains("hidden")&&this.closeModal()}));const e=this.doc.querySelector(".mp-close-button");e&&e.addEventListener("click",(()=>this.closeModal())),this.modal.addEventListener("click",(e=>{(e.target===this.modal||e.target.classList.contains("mp-backdrop"))&&this.closeModal()}));const t=this.modal.querySelector(".mp-modal-content");t&&t.addEventListener("click",(e=>e.stopPropagation())),this.attachCommonSearchListeners(),document.addEventListener("keydown",(e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),this.openModal()),"/"!==e.key||e.ctrlKey||e.metaKey||"INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||(e.preventDefault(),this.openModal())})),this.doc.addEventListener("keydown",(e=>this.handleKeydown(e))),document.querySelectorAll("[data-ghost-search]").forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation(),this.openModal()}))}));const n=this.doc.querySelector("#mp-hits");n&&n.addEventListener("click",(e=>{const t=e.target.closest(".mp-result-link");t&&(e.preventDefault(),window.location.href=t.href)}))}attachCommonSearchListeners(){const e=this.doc.getElementById("mp-common-searches-container");if(!e)return;const t=e=>{const t=e.target.closest(".mp-common-search-btn");if(!t)return;e.preventDefault();const n=t.dataset.search,r=this.doc.querySelector(".mp-search-input");r&&(this.selectedIndex=-1,r.value=n,r.dispatchEvent(new Event("input",{bubbles:!0})),this.search.helper.setQuery(n).search(),setTimeout((()=>{r.focus(),r.setSelectionRange(n.length,n.length)}),0))};e.addEventListener("click",t),e.addEventListener("touchend",t)}openModal(){this.iframe.style.pointerEvents="auto",this.iframe.style.opacity="1",this.modal.classList.remove("hidden");const e=this.doc.querySelector(".mp-search-input");e&&e.focus(),history.replaceState(null,null,"#/search")}closeModal(){this.iframe.style.opacity="0",this.iframe.style.pointerEvents="none",this.modal.classList.add("hidden"),this.selectedIndex=-1;const e=this.doc.querySelector(".mp-search-input");e&&(e.value=""),this.search.helper.setQuery("").search(),"#/search"===window.location.hash&&history.replaceState(null,null,window.location.pathname)}handleKeydown(e){if("Escape"===e.key)return e.preventDefault(),void this.closeModal();const t=e.target.classList.contains("mp-search-input");if(("INPUT"!==e.target.tagName||t)&&!(window.innerWidth<640))switch(e.key){case"ArrowDown":e.preventDefault(),this.navigateResults("next");break;case"ArrowUp":e.preventDefault(),this.navigateResults("prev");break;case"Enter":-1!==this.selectedIndex&&(e.preventDefault(),this.handleEnterKey())}}navigateResults(e){this.cachedElements.results||(this.cachedElements.results=this.doc.querySelectorAll("#mp-hits .mp-result-link, .mp-common-search-btn:not(.hidden)"));const t=[...this.cachedElements.results].filter((e=>null!==e.offsetParent&&!e.closest(".hidden")));if(this.cachedElements.results=null,0===t.length)return;-1===this.selectedIndex?this.selectedIndex="next"===e?0:t.length-1:this.selectedIndex="next"===e?(this.selectedIndex+1)%t.length:(this.selectedIndex-1+t.length)%t.length,t.forEach((e=>e.classList.remove("mp-selected")));const n=t[this.selectedIndex];n.classList.add("mp-selected"),n.scrollIntoView({block:"nearest",behavior:"auto"})}handleEnterKey(){const e=[...this.doc.querySelectorAll("#mp-hits .mp-result-link, .mp-common-search-btn:not(.hidden)")].filter((e=>null!==e.offsetParent&&!e.closest(".hidden")));if(this.selectedIndex>=0&&this.selectedIndex<e.length){const t=e[this.selectedIndex];if(t.classList.contains("mp-result-link"))window.location.href=t.href;else{const e=this.doc.querySelector(".mp-search-input");e.value=t.textContent.trim(),e.dispatchEvent(new Event("input",{bubbles:!0}))}}}handleThemeChange(){if(!this.wrapper)return;const e=e=>{this.wrapper.classList.toggle("dark",e)};switch(this.wrapper.classList.remove("dark"),this.config.theme){case"dark":e(!0);break;case"light":e(!1);break;default:const t=window.matchMedia("(prefers-color-scheme: dark)");e(t.matches),t.addEventListener("change",(t=>e(t.matches)))}}}window.MagicPagesSearch=n,document.addEventListener("DOMContentLoaded",(()=>{(window.__MP_SEARCH_CONFIG__||"#/search"===window.location.hash||document.querySelectorAll("[data-ghost-search]").length>0)&&(window.magicPagesSearch=new n)}))}()}();
|
|
1
|
+
!function(){var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(n){if(n.t)return n;var t=n.default;if("function"==typeof t){var e=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"t",{value:!0}),Object.keys(n).forEach((function(t){var r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})})),e}var e,r,i,o={},u={},s={},c={exports:{}};r=n,i=function(){var n=function(){},t="undefined",e=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],i={},o=null;function u(n,t){var e=n[t];if("function"==typeof e.bind)return e.bind(n);try{return Function.prototype.bind.call(e,n)}catch(t){return function(){return Function.prototype.apply.call(e,n,arguments)}}}function s(){console.log&&(console.log.apply||Function.prototype.apply.call(console.log,console,arguments))}function c(){for(var e=this.getLevel(),i=0;i<r.length;i++){var o=r[i];this[o]=i<e?n:this.methodFactory(o,e,this.name)}if(this.log=this.debug,typeof console===t&&e<this.levels.SILENT)return"No console available for logging"}function a(n){return function(){typeof console!==t&&(c.call(this),this[n].apply(this,arguments))}}function f(r,i,o){return function(r){return"debug"===r&&(r="log"),typeof console!==t&&("trace"===r&&e?s:void 0!==console[r]?u(console,r):void 0!==console.log?u(console,"log"):n)}(r)||a.apply(this,arguments)}function h(n,e){var u,s,a,h=this,l="loglevel";function d(){var n;if(typeof window!==t&&l){try{n=window.localStorage[l]}catch(n){}if(typeof n===t)try{var e=window.document.cookie,r=encodeURIComponent(l),i=e.indexOf(r+"=");-1!==i&&(n=/^([^;]+)/.exec(e.slice(i+r.length+1))[1])}catch(n){}return void 0===h.levels[n]&&(n=void 0),n}}function v(n){var t=n;if("string"==typeof t&&void 0!==h.levels[t.toUpperCase()]&&(t=h.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=h.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+n)}"string"==typeof n?l+=":"+n:"symbol"==typeof n&&(l=void 0),h.name=n,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=e||f,h.getLevel=function(){return null!=a?a:null!=s?s:u},h.setLevel=function(n,e){return a=v(n),!1!==e&&function(n){var e=(r[n]||"silent").toUpperCase();if(typeof window!==t&&l){try{return void(window.localStorage[l]=e)}catch(n){}try{window.document.cookie=encodeURIComponent(l)+"="+e+";"}catch(n){}}}(a),c.call(h)},h.setDefaultLevel=function(n){s=v(n),d()||h.setLevel(n,!1)},h.resetLevel=function(){a=null,function(){if(typeof window!==t&&l){try{window.localStorage.removeItem(l)}catch(n){}try{window.document.cookie=encodeURIComponent(l)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(n){}}}(),c.call(h)},h.enableAll=function(n){h.setLevel(h.levels.TRACE,n)},h.disableAll=function(n){h.setLevel(h.levels.SILENT,n)},h.rebuild=function(){if(o!==h&&(u=v(o.getLevel())),c.call(h),o===h)for(var n in i)i[n].rebuild()},u=v(o?o.getLevel():"WARN");var p=d();null!=p&&(a=v(p)),c.call(h)}(o=new h).getLogger=function(n){if("symbol"!=typeof n&&"string"!=typeof n||""===n)throw new TypeError("You must supply a name when creating a logger.");var t=i[n];return t||(t=i[n]=new h(n,o.methodFactory)),t};var l=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=l),o},o.getLoggers=function(){return i},o.default=o,o},(e=c).exports?e.exports=i():r.log=i();var a,f=c.exports,h={},l={},d={},v=n&&n.i||(a=function(n,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},a(n,t)},function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+t+" is not a constructor or null");function e(){this.constructor=n}a(n,t),n.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)});Object.defineProperty(d,"t",{value:!0});var p=function(n){function t(t){var e=this.constructor,r=n.call(this,t)||this;return r.name=e.name,Object.setPrototypeOf(r,e.prototype),r}return v(t,n),t}(Error);d.default=p;var m=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),b=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(l,"t",{value:!0});var w=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return m(t,n),t}(b(d).default);l.default=w;var y={},g=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),k=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(y,"t",{value:!0});var x=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return g(t,n),t}(k(d).default);y.default=x;var O={},S=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),_=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(O,"t",{value:!0});var j=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return S(t,n),t}(_(d).default);O.default=j;var E={},R=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),T=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(E,"t",{value:!0});var P=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return R(t,n),t}(T(d).default);E.default=P;var A={},N=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),C=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(A,"t",{value:!0});var M=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return N(t,n),t}(C(d).default);A.default=M;var U={},q=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),D=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(U,"t",{value:!0});var F=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return q(t,n),t}(D(d).default);U.default=F;var B={},L=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),z=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(B,"t",{value:!0});var H=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return L(t,n),t}(z(d).default);B.default=H;var I={},G=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),J=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(I,"t",{value:!0});var $=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return G(t,n),t}(J(d).default);I.default=$;var K={},W=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),X=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(K,"t",{value:!0});var V=function(n){function t(t,e){var r=n.call(this,t)||this;return r.importResults=e,r}return W(t,n),t}(X(d).default);K.default=V;var Y=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(h,"t",{value:!0}),h.ImportError=h.TypesenseError=h.ServerError=h.RequestUnauthorized=h.RequestMalformed=h.ObjectUnprocessable=h.ObjectNotFound=h.ObjectAlreadyExists=h.MissingConfigurationError=h.HTTPError=void 0;var Z=Y(l);h.HTTPError=Z.default;var Q=Y(y);h.MissingConfigurationError=Q.default;var nn=Y(O);h.ObjectAlreadyExists=nn.default;var tn=Y(E);h.ObjectNotFound=tn.default;var en=Y(A);h.ObjectUnprocessable=en.default;var rn=Y(U);h.RequestMalformed=rn.default;var on=Y(B);h.RequestUnauthorized=on.default;var un=Y(I);h.ServerError=un.default;var sn=Y(K);h.ImportError=sn.default;var cn=Y(d);h.TypesenseError=cn.default;var an=n&&n.u||function(){return an=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var i in t=arguments[e])Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n},an.apply(this,arguments)},fn=n&&n.h||(Object.create?function(n,t,e,r){void 0===r&&(r=e);var i=Object.getOwnPropertyDescriptor(t,e);i&&!("get"in i?!t.t:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,r,i)}:function(n,t,e,r){void 0===r&&(r=e),n[r]=t[e]}),hn=n&&n.l||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),ln=n&&n.v||function(n){if(n&&n.t)return n;var t={};if(null!=n)for(var e in n)"default"!==e&&Object.prototype.hasOwnProperty.call(n,e)&&fn(t,n,e);return hn(t,n),t};Object.defineProperty(s,"t",{value:!0});var dn=ln(f),vn=h,pn=function(){function n(n){var t=this;this.nodes=n.nodes||[],this.nodes=this.nodes.map((function(n){return t.setDefaultPathInNode(n)})).map((function(n){return t.setDefaultPortInNode(n)})).map((function(n){return an({},n)})),null==n.randomizeNodes&&(n.randomizeNodes=!0),!0===n.randomizeNodes&&this.shuffleArray(this.nodes),this.nearestNode=n.nearestNode,this.nearestNode=this.setDefaultPathInNode(this.nearestNode),this.nearestNode=this.setDefaultPortInNode(this.nearestNode),this.connectionTimeoutSeconds=n.connectionTimeoutSeconds||n.timeoutSeconds||5,this.healthcheckIntervalSeconds=n.healthcheckIntervalSeconds||60,this.numRetries=n.numRetries||this.nodes.length+(null==this.nearestNode?0:1)||3,this.retryIntervalSeconds=n.retryIntervalSeconds||.1,this.apiKey=n.apiKey,this.sendApiKeyAsQueryParam=n.sendApiKeyAsQueryParam,this.cacheSearchResultsForSeconds=n.cacheSearchResultsForSeconds||0,this.useServerSideSearchCache=n.useServerSideSearchCache||!1,this.logger=n.logger||dn,this.logLevel=n.logLevel||"warn",this.logger.setLevel(this.logLevel),this.additionalHeaders=n.additionalHeaders,this.httpAgent=n.httpAgent,this.httpsAgent=n.httpsAgent,this.showDeprecationWarnings(n),this.validate()}return n.prototype.validate=function(){if(null==this.nodes||0===this.nodes.length||this.validateNodes())throw new vn.MissingConfigurationError("Ensure that nodes[].protocol, nodes[].host and nodes[].port are set");if(null!=this.nearestNode&&this.isNodeMissingAnyParameters(this.nearestNode))throw new vn.MissingConfigurationError("Ensure that nearestNodes.protocol, nearestNodes.host and nearestNodes.port are set");if(null==this.apiKey)throw new vn.MissingConfigurationError("Ensure that apiKey is set");return!0},n.prototype.validateNodes=function(){var n=this;return this.nodes.some((function(t){return n.isNodeMissingAnyParameters(t)}))},n.prototype.isNodeMissingAnyParameters=function(n){return!["protocol","host","port","path"].every((function(t){return n.hasOwnProperty(t)}))&&null==n.url},n.prototype.setDefaultPathInNode=function(n){return null==n||n.hasOwnProperty("path")||(n.path=""),n},n.prototype.setDefaultPortInNode=function(n){if(null!=n&&!n.hasOwnProperty("port")&&n.hasOwnProperty("protocol"))switch(n.protocol){case"https":n.port=443;break;case"http":n.port=80}return n},n.prototype.showDeprecationWarnings=function(n){n.timeoutSeconds&&this.logger.warn("Deprecation warning: timeoutSeconds is now renamed to connectionTimeoutSeconds"),n.masterNode&&this.logger.warn("Deprecation warning: masterNode is now consolidated to nodes, starting with Typesense Server v0.12"),n.readReplicaNodes&&this.logger.warn("Deprecation warning: readReplicaNodes is now consolidated to nodes, starting with Typesense Server v0.12")},n.prototype.shuffleArray=function(n){for(var t,e=n.length-1;e>0;e--){var r=Math.floor(Math.random()*(e+1));t=[n[r],n[e]],n[e]=t[0],n[r]=t[1]}},n}();s.default=pn;var mn={};function bn(n,t){return function(){return n.apply(t,arguments)}}const{toString:wn}=Object.prototype,{getPrototypeOf:yn}=Object,gn=(kn=Object.create(null),n=>{const t=wn.call(n);return kn[t]||(kn[t]=t.slice(8,-1).toLowerCase())});var kn;const xn=n=>(n=n.toLowerCase(),t=>gn(t)===n),On=n=>t=>typeof t===n,{isArray:Sn}=Array,_n=On("undefined"),jn=xn("ArrayBuffer"),En=On("string"),Rn=On("function"),Tn=On("number"),Pn=n=>null!==n&&"object"==typeof n,An=n=>{if("object"!==gn(n))return!1;const t=yn(n);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in n||Symbol.iterator in n)},Nn=xn("Date"),Cn=xn("File"),Mn=xn("Blob"),Un=xn("FileList"),qn=xn("URLSearchParams"),[Dn,Fn,Bn,Ln]=["ReadableStream","Request","Response","Headers"].map(xn);function zn(n,t,{allOwnKeys:e=!1}={}){if(null==n)return;let r,i;if("object"!=typeof n&&(n=[n]),Sn(n))for(r=0,i=n.length;r<i;r++)t.call(null,n[r],r,n);else{const i=e?Object.getOwnPropertyNames(n):Object.keys(n),o=i.length;let u;for(r=0;r<o;r++)u=i[r],t.call(null,n[u],u,n)}}function Hn(n,t){t=t.toLowerCase();const e=Object.keys(n);let r,i=e.length;for(;i-- >0;)if(r=e[i],t===r.toLowerCase())return r;return null}const In="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n,Gn=n=>!_n(n)&&n!==In,Jn=($n="undefined"!=typeof Uint8Array&&yn(Uint8Array),n=>$n&&n instanceof $n);var $n;const Kn=xn("HTMLFormElement"),Wn=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),Xn=xn("RegExp"),Vn=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),r={};zn(e,((e,i)=>{let o;!1!==(o=t(e,i,n))&&(r[i]=o||e)})),Object.defineProperties(n,r)},Yn="abcdefghijklmnopqrstuvwxyz",Zn="0123456789",Qn={DIGIT:Zn,ALPHA:Yn,ALPHA_DIGIT:Yn+Yn.toUpperCase()+Zn},nt=xn("AsyncFunction"),tt=(et="function"==typeof setImmediate,rt=Rn(In.postMessage),et?setImmediate:rt?(it="axios@"+Math.random(),ot=[],In.addEventListener("message",(({source:n,data:t})=>{n===In&&t===it&&ot.length&&ot.shift()()}),!1),n=>{ot.push(n),In.postMessage(it,"*")}):n=>setTimeout(n));var et,rt,it,ot;const ut="undefined"!=typeof queueMicrotask?queueMicrotask.bind(In):"undefined"!=typeof process&&process.nextTick||tt;var st={isArray:Sn,isArrayBuffer:jn,isBuffer:function(n){return null!==n&&!_n(n)&&null!==n.constructor&&!_n(n.constructor)&&Rn(n.constructor.isBuffer)&&n.constructor.isBuffer(n)},isFormData:n=>{let t;return n&&("function"==typeof FormData&&n instanceof FormData||Rn(n.append)&&("formdata"===(t=gn(n))||"object"===t&&Rn(n.toString)&&"[object FormData]"===n.toString()))},isArrayBufferView:function(n){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer&&jn(n.buffer),t},isString:En,isNumber:Tn,isBoolean:n=>!0===n||!1===n,isObject:Pn,isPlainObject:An,isReadableStream:Dn,isRequest:Fn,isResponse:Bn,isHeaders:Ln,isUndefined:_n,isDate:Nn,isFile:Cn,isBlob:Mn,isRegExp:Xn,isFunction:Rn,isStream:n=>Pn(n)&&Rn(n.pipe),isURLSearchParams:qn,isTypedArray:Jn,isFileList:Un,forEach:zn,merge:function n(){const{caseless:t}=Gn(this)&&this||{},e={},r=(r,i)=>{const o=t&&Hn(e,i)||i;An(e[o])&&An(r)?e[o]=n(e[o],r):An(r)?e[o]=n({},r):Sn(r)?e[o]=r.slice():e[o]=r};for(let n=0,t=arguments.length;n<t;n++)arguments[n]&&zn(arguments[n],r);return e},extend:(n,t,e,{allOwnKeys:r}={})=>(zn(t,((t,r)=>{e&&Rn(t)?n[r]=bn(t,e):n[r]=t}),{allOwnKeys:r}),n),trim:n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:n=>(65279===n.charCodeAt(0)&&(n=n.slice(1)),n),inherits:(n,t,e,r)=>{n.prototype=Object.create(t.prototype,r),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},toFlatObject:(n,t,e,r)=>{let i,o,u;const s={};if(t=t||{},null==n)return t;do{for(i=Object.getOwnPropertyNames(n),o=i.length;o-- >0;)u=i[o],r&&!r(u,n,t)||s[u]||(t[u]=n[u],s[u]=!0);n=!1!==e&&yn(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},kindOf:gn,kindOfTest:xn,endsWith:(n,t,e)=>{n+="",(void 0===e||e>n.length)&&(e=n.length),e-=t.length;const r=n.indexOf(t,e);return-1!==r&&r===e},toArray:n=>{if(!n)return null;if(Sn(n))return n;let t=n.length;if(!Tn(t))return null;const e=Array(t);for(;t-- >0;)e[t]=n[t];return e},forEachEntry:(n,t)=>{const e=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=e.next())&&!r.done;){const e=r.value;t.call(n,e[0],e[1])}},matchAll:(n,t)=>{let e;const r=[];for(;null!==(e=n.exec(t));)r.push(e);return r},isHTMLForm:Kn,hasOwnProperty:Wn,hasOwnProp:Wn,reduceDescriptors:Vn,freezeMethods:n=>{Vn(n,((t,e)=>{if(Rn(n)&&-1!==["arguments","caller","callee"].indexOf(e))return!1;const r=n[e];Rn(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")}))}))},toObjectSet:(n,t)=>{const e={},r=n=>{n.forEach((n=>{e[n]=!0}))};return Sn(n)?r(n):r((n+"").split(t)),e},toCamelCase:n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(n,t,e){return t.toUpperCase()+e})),noop:()=>{},toFiniteNumber:(n,t)=>null!=n&&Number.isFinite(n=+n)?n:t,findKey:Hn,global:In,isContextDefined:Gn,ALPHABET:Qn,generateString:(n=16,t=Qn.ALPHA_DIGIT)=>{let e="";const{length:r}=t;for(;n--;)e+=t[Math.random()*r|0];return e},isSpecCompliantForm:function(n){return!!(n&&Rn(n.append)&&"FormData"===n[Symbol.toStringTag]&&n[Symbol.iterator])},toJSONObject:n=>{const t=[,,,,,,,,,,],e=(n,r)=>{if(Pn(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[r]=n;const i=Sn(n)?[]:{};return zn(n,((n,t)=>{const o=e(n,r+1);!_n(o)&&(i[t]=o)})),t[r]=void 0,i}}return n};return e(n,0)},isAsyncFn:nt,isThenable:n=>n&&(Pn(n)||Rn(n))&&Rn(n.then)&&Rn(n.catch),setImmediate:tt,asap:ut};function ct(n,t,e,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}st.inherits(ct,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:st.toJSONObject(this.config),code:this.code,status:this.status}}});const at=ct.prototype,ft={};function ht(n){return st.isPlainObject(n)||st.isArray(n)}function lt(n){return st.endsWith(n,"[]")?n.slice(0,-2):n}function dt(n,t,e){return n?n.concat(t).map((function(n,t){return n=lt(n),!e&&t?"["+n+"]":n})).join(e?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((n=>{ft[n]={value:n}})),Object.defineProperties(ct,ft),Object.defineProperty(at,"isAxiosError",{value:!0}),ct.from=(n,t,e,r,i,o)=>{const u=Object.create(at);return st.toFlatObject(n,u,(function(n){return n!==Error.prototype}),(n=>"isAxiosError"!==n)),ct.call(u,n.message,t,e,r,i),u.cause=n,u.name=n.name,o&&Object.assign(u,o),u};const vt=st.toFlatObject(st,{},null,(function(n){return/^is[A-Z]/.test(n)}));function pt(n,t,e){if(!st.isObject(n))throw new TypeError("target must be an object");t=t||new FormData;const r=(e=st.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(n,t){return!st.isUndefined(t[n])}))).metaTokens,i=e.visitor||a,o=e.dots,u=e.indexes,s=(e.Blob||"undefined"!=typeof Blob&&Blob)&&st.isSpecCompliantForm(t);if(!st.isFunction(i))throw new TypeError("visitor must be a function");function c(n){if(null===n)return"";if(st.isDate(n))return n.toISOString();if(!s&&st.isBlob(n))throw new ct("Blob is not supported. Use a Buffer instead.");return st.isArrayBuffer(n)||st.isTypedArray(n)?s&&"function"==typeof Blob?new Blob([n]):Buffer.from(n):n}function a(n,e,i){let s=n;if(n&&!i&&"object"==typeof n)if(st.endsWith(e,"{}"))e=r?e:e.slice(0,-2),n=JSON.stringify(n);else if(st.isArray(n)&&function(n){return st.isArray(n)&&!n.some(ht)}(n)||(st.isFileList(n)||st.endsWith(e,"[]"))&&(s=st.toArray(n)))return e=lt(e),s.forEach((function(n,r){!st.isUndefined(n)&&null!==n&&t.append(!0===u?dt([e],r,o):null===u?e:e+"[]",c(n))})),!1;return!!ht(n)||(t.append(dt(i,e,o),c(n)),!1)}const f=[],h=Object.assign(vt,{defaultVisitor:a,convertValue:c,isVisitable:ht});if(!st.isObject(n))throw new TypeError("data must be an object");return function n(e,r){if(!st.isUndefined(e)){if(-1!==f.indexOf(e))throw Error("Circular reference detected in "+r.join("."));f.push(e),st.forEach(e,(function(e,o){!0===(!(st.isUndefined(e)||null===e)&&i.call(t,e,st.isString(o)?o.trim():o,r,h))&&n(e,r?r.concat(o):[o])})),f.pop()}}(n),t}function mt(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,(function(n){return t[n]}))}function bt(n,t){this.p=[],n&&pt(n,this,t)}const wt=bt.prototype;function yt(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function gt(n,t,e){if(!t)return n;const r=e&&e.encode||yt;st.isFunction(e)&&(e={serialize:e});const i=e&&e.serialize;let o;if(o=i?i(t,e):st.isURLSearchParams(t)?t.toString():new bt(t,e).toString(r),o){const t=n.indexOf("#");-1!==t&&(n=n.slice(0,t)),n+=(-1===n.indexOf("?")?"?":"&")+o}return n}wt.append=function(n,t){this.p.push([n,t])},wt.toString=function(n){const t=n?function(t){return n.call(this,t,mt)}:mt;return this.p.map((function(n){return t(n[0])+"="+t(n[1])}),"").join("&")};var kt=class{constructor(){this.handlers=[]}use(n,t,e){return this.handlers.push({fulfilled:n,rejected:t,synchronous:!!e&&e.synchronous,runWhen:e?e.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){st.forEach(this.handlers,(function(t){null!==t&&n(t)}))}},xt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ot={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:bt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const St="undefined"!=typeof window&&"undefined"!=typeof document,_t="object"==typeof navigator&&navigator||void 0,jt=St&&(!_t||["ReactNative","NativeScript","NS"].indexOf(_t.product)<0),Et="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Rt=St&&window.location.href||"http://localhost";var Tt={...Object.freeze({__proto__:null,hasBrowserEnv:St,hasStandardBrowserWebWorkerEnv:Et,hasStandardBrowserEnv:jt,navigator:_t,origin:Rt}),...Ot};function Pt(n){function t(n,e,r,i){let o=n[i++];if("__proto__"===o)return!0;const u=Number.isFinite(+o),s=i>=n.length;return o=!o&&st.isArray(r)?r.length:o,s?(st.hasOwnProp(r,o)?r[o]=[r[o],e]:r[o]=e,!u):(r[o]&&st.isObject(r[o])||(r[o]=[]),t(n,e,r[o],i)&&st.isArray(r[o])&&(r[o]=function(n){const t={},e=Object.keys(n);let r;const i=e.length;let o;for(r=0;r<i;r++)o=e[r],t[o]=n[o];return t}(r[o])),!u)}if(st.isFormData(n)&&st.isFunction(n.entries)){const e={};return st.forEachEntry(n,((n,r)=>{t(function(n){return st.matchAll(/\w+|\[(\w*)]/g,n).map((n=>"[]"===n[0]?"":n[1]||n[0]))}(n),r,e,0)})),e}return null}const At={transitional:xt,adapter:["xhr","http","fetch"],transformRequest:[function(n,t){const e=t.getContentType()||"",r=e.indexOf("application/json")>-1,i=st.isObject(n);if(i&&st.isHTMLForm(n)&&(n=new FormData(n)),st.isFormData(n))return r?JSON.stringify(Pt(n)):n;if(st.isArrayBuffer(n)||st.isBuffer(n)||st.isStream(n)||st.isFile(n)||st.isBlob(n)||st.isReadableStream(n))return n;if(st.isArrayBufferView(n))return n.buffer;if(st.isURLSearchParams(n))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let o;if(i){if(e.indexOf("application/x-www-form-urlencoded")>-1)return function(n,t){return pt(n,new Tt.classes.URLSearchParams,Object.assign({visitor:function(n,t,e,r){return Tt.isNode&&st.isBuffer(n)?(this.append(t,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(n,this.formSerializer).toString();if((o=st.isFileList(n))||e.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return pt(o?{"files[]":n}:n,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(n){if(st.isString(n))try{return(0,JSON.parse)(n),st.trim(n)}catch(n){if("SyntaxError"!==n.name)throw n}return(0,JSON.stringify)(n)}(n)):n}],transformResponse:[function(n){const t=this.transitional||At.transitional,e=t&&t.forcedJSONParsing,r="json"===this.responseType;if(st.isResponse(n)||st.isReadableStream(n))return n;if(n&&st.isString(n)&&(e&&!this.responseType||r)){const e=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(n)}catch(n){if(e){if("SyntaxError"===n.name)throw ct.from(n,ct.ERR_BAD_RESPONSE,this,null,this.response);throw n}}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Tt.classes.FormData,Blob:Tt.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};st.forEach(["delete","get","head","post","put","patch"],(n=>{At.headers[n]={}}));var Nt=At;const Ct=st.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Mt=Symbol("internals");function Ut(n){return n&&(n+"").trim().toLowerCase()}function qt(n){return!1===n||null==n?n:st.isArray(n)?n.map(qt):n+""}function Dt(n,t,e,r,i){return st.isFunction(r)?r.call(this,t,e):(i&&(t=e),st.isString(t)?st.isString(r)?-1!==t.indexOf(r):st.isRegExp(r)?r.test(t):void 0:void 0)}class Ft{constructor(n){n&&this.set(n)}set(n,t,e){const r=this;function i(n,t,e){const i=Ut(t);if(!i)throw Error("header name must be a non-empty string");const o=st.findKey(r,i);(!o||void 0===r[o]||!0===e||void 0===e&&!1!==r[o])&&(r[o||t]=qt(n))}const o=(n,t)=>st.forEach(n,((n,e)=>i(n,e,t)));if(st.isPlainObject(n)||n instanceof this.constructor)o(n,t);else if(st.isString(n)&&(n=n.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim()))o((n=>{const t={};let e,r,i;return n&&n.split("\n").forEach((function(n){i=n.indexOf(":"),e=n.substring(0,i).trim().toLowerCase(),r=n.substring(i+1).trim(),!e||t[e]&&Ct[e]||("set-cookie"===e?t[e]?t[e].push(r):t[e]=[r]:t[e]=t[e]?t[e]+", "+r:r)})),t})(n),t);else if(st.isHeaders(n))for(const[t,r]of n.entries())i(r,t,e);else null!=n&&i(t,n,e);return this}get(n,t){if(n=Ut(n)){const e=st.findKey(this,n);if(e){const n=this[e];if(!t)return n;if(!0===t)return function(n){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=e.exec(n);)t[r[1]]=r[2];return t}(n);if(st.isFunction(t))return t.call(this,n,e);if(st.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,t){if(n=Ut(n)){const e=st.findKey(this,n);return!(!e||void 0===this[e]||t&&!Dt(0,this[e],e,t))}return!1}delete(n,t){const e=this;let r=!1;function i(n){if(n=Ut(n)){const i=st.findKey(e,n);!i||t&&!Dt(0,e[i],i,t)||(delete e[i],r=!0)}}return st.isArray(n)?n.forEach(i):i(n),r}clear(n){const t=Object.keys(this);let e=t.length,r=!1;for(;e--;){const i=t[e];n&&!Dt(0,this[i],i,n,!0)||(delete this[i],r=!0)}return r}normalize(n){const t=this,e={};return st.forEach(this,((r,i)=>{const o=st.findKey(e,i);if(o)return t[o]=qt(r),void delete t[i];const u=n?function(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((n,t,e)=>t.toUpperCase()+e))}(i):(i+"").trim();u!==i&&delete t[i],t[u]=qt(r),e[u]=!0})),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const t=Object.create(null);return st.forEach(this,((e,r)=>{null!=e&&!1!==e&&(t[r]=n&&st.isArray(e)?e.join(", "):e)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([n,t])=>n+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...t){const e=new this(n);return t.forEach((n=>e.set(n))),e}static accessor(n){const t=(this[Mt]=this[Mt]={accessors:{}}).accessors,e=this.prototype;function r(n){const r=Ut(n);t[r]||(function(n,t){const e=st.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(n,r+e,{value:function(n,e,i){return this[r].call(this,t,n,e,i)},configurable:!0})}))}(e,n),t[r]=!0)}return st.isArray(n)?n.forEach(r):r(n),this}}Ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),st.reduceDescriptors(Ft.prototype,(({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(n){this[e]=n}}})),st.freezeMethods(Ft);var Bt=Ft;function Lt(n,t){const e=this||Nt,r=t||e,i=Bt.from(r.headers);let o=r.data;return st.forEach(n,(function(n){o=n.call(e,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function zt(n){return!(!n||!n.m)}function Ht(n,t,e){ct.call(this,n??"canceled",ct.ERR_CANCELED,t,e),this.name="CanceledError"}function It(n,t,e){const r=e.config.validateStatus;e.status&&r&&!r(e.status)?t(new ct("Request failed with status code "+e.status,[ct.ERR_BAD_REQUEST,ct.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e)):n(e)}st.inherits(Ht,ct,{m:!0});const Gt=(n,t,e=3)=>{let r=0;const i=function(n,t){const e=Array(n=n||10),r=Array(n);let i,o=0,u=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),a=r[u];i||(i=c),e[o]=s,r[o]=c;let f=u,h=0;for(;f!==o;)h+=e[f++],f%=n;if(o=(o+1)%n,o===u&&(u=(u+1)%n),c-i<t)return;const l=a&&c-a;return l?Math.round(1e3*h/l):void 0}}(50,250);return function(n,t){let e,r,i=0,o=1e3/t;const u=(t,o=Date.now())=>{i=o,e=null,r&&(clearTimeout(r),r=null),n.apply(null,t)};return[(...n)=>{const t=Date.now(),s=t-i;s>=o?u(n,t):(e=n,r||(r=setTimeout((()=>{r=null,u(e)}),o-s)))},()=>e&&u(e)]}((e=>{const o=e.loaded,u=e.lengthComputable?e.total:void 0,s=o-r,c=i(s);r=o,n({loaded:o,total:u,progress:u?o/u:void 0,bytes:s,rate:c||void 0,estimated:c&&u&&o<=u?(u-o)/c:void 0,event:e,lengthComputable:null!=u,[t?"download":"upload"]:!0})}),e)},Jt=(n,t)=>{const e=null!=n;return[r=>t[0]({lengthComputable:e,total:n,loaded:r}),t[1]]},$t=n=>(...t)=>st.asap((()=>n(...t)));var Kt=Tt.hasStandardBrowserEnv?((n,t)=>e=>(e=new URL(e,Tt.origin),n.protocol===e.protocol&&n.host===e.host&&(t||n.port===e.port)))(new URL(Tt.origin),Tt.navigator&&/(msie|trident)/i.test(Tt.navigator.userAgent)):()=>!0,Wt=Tt.hasStandardBrowserEnv?{write(n,t,e,r,i,o){const u=[n+"="+encodeURIComponent(t)];st.isNumber(e)&&u.push("expires="+new Date(e).toGMTString()),st.isString(r)&&u.push("path="+r),st.isString(i)&&u.push("domain="+i),!0===o&&u.push("secure"),document.cookie=u.join("; ")},read(n){const t=document.cookie.match(RegExp("(^|;\\s*)("+n+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Xt(n,t){return n&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}(n,t):t}const Vt=n=>n instanceof Bt?{...n}:n;function Yt(n,t){t=t||{};const e={};function r(n,t,e,r){return st.isPlainObject(n)&&st.isPlainObject(t)?st.merge.call({caseless:r},n,t):st.isPlainObject(t)?st.merge({},t):st.isArray(t)?t.slice():t}function i(n,t,e,i){return st.isUndefined(t)?st.isUndefined(n)?void 0:r(void 0,n,0,i):r(n,t,0,i)}function o(n,t){if(!st.isUndefined(t))return r(void 0,t)}function u(n,t){return st.isUndefined(t)?st.isUndefined(n)?void 0:r(void 0,n):r(void 0,t)}function s(e,i,o){return o in t?r(e,i):o in n?r(void 0,e):void 0}const c={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:s,headers:(n,t,e)=>i(Vt(n),Vt(t),0,!0)};return st.forEach(Object.keys(Object.assign({},n,t)),(function(r){const o=c[r]||i,u=o(n[r],t[r],r);st.isUndefined(u)&&o!==s||(e[r]=u)})),e}var Zt=n=>{const t=Yt({},n);let e,{data:r,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:u,headers:s,auth:c}=t;if(t.headers=s=Bt.from(s),t.url=gt(Xt(t.baseURL,t.url),n.params,n.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),st.isFormData(r))if(Tt.hasStandardBrowserEnv||Tt.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(e=s.getContentType())){const[n,...t]=e?e.split(";").map((n=>n.trim())).filter(Boolean):[];s.setContentType([n||"multipart/form-data",...t].join("; "))}if(Tt.hasStandardBrowserEnv&&(i&&st.isFunction(i)&&(i=i(t)),i||!1!==i&&Kt(t.url))){const n=o&&u&&Wt.read(u);n&&s.set(o,n)}return t},Qt="undefined"!=typeof XMLHttpRequest&&function(n){return new Promise((function(t,e){const r=Zt(n);let i=r.data;const o=Bt.from(r.headers).normalize();let u,s,c,a,f,{responseType:h,onUploadProgress:l,onDownloadProgress:d}=r;function v(){a&&a(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;function m(){if(!p)return;const r=Bt.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());It((function(n){t(n),v()}),(function(n){e(n),v()}),{data:h&&"text"!==h&&"json"!==h?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:n,request:p}),p=null}p.open(r.method.toUpperCase(),r.url,!0),p.timeout=r.timeout,"onloadend"in p?p.onloadend=m:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(m)},p.onabort=function(){p&&(e(new ct("Request aborted",ct.ECONNABORTED,n,p)),p=null)},p.onerror=function(){e(new ct("Network Error",ct.ERR_NETWORK,n,p)),p=null},p.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||xt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),e(new ct(t,i.clarifyTimeoutError?ct.ETIMEDOUT:ct.ECONNABORTED,n,p)),p=null},void 0===i&&o.setContentType(null),"setRequestHeader"in p&&st.forEach(o.toJSON(),(function(n,t){p.setRequestHeader(t,n)})),st.isUndefined(r.withCredentials)||(p.withCredentials=!!r.withCredentials),h&&"json"!==h&&(p.responseType=r.responseType),d&&([c,f]=Gt(d,!0),p.addEventListener("progress",c)),l&&p.upload&&([s,a]=Gt(l),p.upload.addEventListener("progress",s),p.upload.addEventListener("loadend",a)),(r.cancelToken||r.signal)&&(u=t=>{p&&(e(!t||t.type?new Ht(null,n,p):t),p.abort(),p=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const b=function(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}(r.url);b&&-1===Tt.protocols.indexOf(b)?e(new ct("Unsupported protocol "+b+":",ct.ERR_BAD_REQUEST,n)):p.send(i||null)}))},ne=(n,t)=>{const{length:e}=n=n?n.filter(Boolean):[];if(t||e){let e,r=new AbortController;const i=function(n){if(!e){e=!0,u();const t=n instanceof Error?n:this.reason;r.abort(t instanceof ct?t:new Ht(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{o=null,i(new ct(`timeout ${t} of ms exceeded`,ct.ETIMEDOUT))}),t);const u=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach((n=>{n.unsubscribe?n.unsubscribe(i):n.removeEventListener("abort",i)})),n=null)};n.forEach((n=>n.addEventListener("abort",i)));const{signal:s}=r;return s.unsubscribe=()=>st.asap(u),s}};const te=function*(n,t){let e=n.byteLength;if(e<t)return void(yield n);let r,i=0;for(;i<e;)r=i+t,yield n.slice(i,r),i=r},ee=(n,t,e,r)=>{const i=async function*(n,t){for await(const e of async function*(n){if(n[Symbol.asyncIterator])return void(yield*n);const t=n.getReader();try{for(;;){const{done:n,value:e}=await t.read();if(n)break;yield e}}finally{await t.cancel()}}(n))yield*te(e,t)}(n,t);let o,u=0,s=n=>{o||(o=!0,r&&r(n))};return new ReadableStream({async pull(n){try{const{done:t,value:r}=await i.next();if(t)return s(),void n.close();let o=r.byteLength;if(e){let n=u+=o;e(n)}n.enqueue(new Uint8Array(r))}catch(n){throw s(n),n}},cancel:n=>(s(n),i.return())},{highWaterMark:2})},re="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,ie=re&&"function"==typeof ReadableStream,oe=re&&("function"==typeof TextEncoder?(ue=new TextEncoder,n=>ue.encode(n)):async n=>new Uint8Array(await new Response(n).arrayBuffer()));var ue;const se=(n,...t)=>{try{return!!n(...t)}catch(n){return!1}},ce=ie&&se((()=>{let n=!1;const t=new Request(Tt.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!t})),ae=ie&&se((()=>st.isReadableStream(new Response("").body))),fe={stream:ae&&(n=>n.body)};var he;re&&(he=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((n=>{!fe[n]&&(fe[n]=st.isFunction(he[n])?t=>t[n]():(t,e)=>{throw new ct(`Response type '${n}' is not supported`,ct.ERR_NOT_SUPPORT,e)})})));const le={http:null,xhr:Qt,fetch:re&&(async n=>{let{url:t,method:e,data:r,signal:i,cancelToken:o,timeout:u,onDownloadProgress:s,onUploadProgress:c,responseType:a,headers:f,withCredentials:h="same-origin",fetchOptions:l}=Zt(n);a=a?(a+"").toLowerCase():"text";let d,v=ne([i,o&&o.toAbortSignal()],u);const p=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let m;try{if(c&&ce&&"get"!==e&&"head"!==e&&0!==(m=await(async(n,t)=>st.toFiniteNumber(n.getContentLength())??(async n=>{if(null==n)return 0;if(st.isBlob(n))return n.size;if(st.isSpecCompliantForm(n)){const t=new Request(Tt.origin,{method:"POST",body:n});return(await t.arrayBuffer()).byteLength}return st.isArrayBufferView(n)||st.isArrayBuffer(n)?n.byteLength:(st.isURLSearchParams(n)&&(n+=""),st.isString(n)?(await oe(n)).byteLength:void 0)})(t))(f,r))){let n,e=new Request(t,{method:"POST",body:r,duplex:"half"});if(st.isFormData(r)&&(n=e.headers.get("content-type"))&&f.setContentType(n),e.body){const[n,t]=Jt(m,Gt($t(c)));r=ee(e.body,65536,n,t)}}st.isString(h)||(h=h?"include":"omit");const i="credentials"in Request.prototype;d=new Request(t,{...l,signal:v,method:e.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:i?h:void 0});let o=await fetch(d);const u=ae&&("stream"===a||"response"===a);if(ae&&(s||u&&p)){const n={};["status","statusText","headers"].forEach((t=>{n[t]=o[t]}));const t=st.toFiniteNumber(o.headers.get("content-length")),[e,r]=s&&Jt(t,Gt($t(s),!0))||[];o=new Response(ee(o.body,65536,e,(()=>{r&&r(),p&&p()})),n)}a=a||"text";let b=await fe[st.findKey(fe,a)||"text"](o,n);return!u&&p&&p(),await new Promise(((t,e)=>{It(t,e,{data:b,headers:Bt.from(o.headers),status:o.status,statusText:o.statusText,config:n,request:d})}))}catch(t){if(p&&p(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new ct("Network Error",ct.ERR_NETWORK,n,d),{cause:t.cause||t});throw ct.from(t,t&&t.code,n,d)}})};st.forEach(le,((n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch(n){}Object.defineProperty(n,"adapterName",{value:t})}}));const de=n=>"- "+n,ve=n=>st.isFunction(n)||null===n||!1===n;var pe=n=>{n=st.isArray(n)?n:[n];const{length:t}=n;let e,r;const i={};for(let o=0;o<t;o++){let t;if(e=n[o],r=e,!ve(e)&&(r=le[(t=e+"").toLowerCase()],void 0===r))throw new ct(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+o]=r}if(!r){const n=Object.entries(i).map((([n,t])=>`adapter ${n} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new ct("There is no suitable adapter to dispatch the request "+(t?n.length>1?"since :\n"+n.map(de).join("\n"):" "+de(n[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function me(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Ht(null,n)}function be(n){return me(n),n.headers=Bt.from(n.headers),n.data=Lt.call(n,n.transformRequest),-1!==["post","put","patch"].indexOf(n.method)&&n.headers.setContentType("application/x-www-form-urlencoded",!1),pe(n.adapter||Nt.adapter)(n).then((function(t){return me(n),t.data=Lt.call(n,n.transformResponse,t),t.headers=Bt.from(t.headers),t}),(function(t){return zt(t)||(me(n),t&&t.response&&(t.response.data=Lt.call(n,n.transformResponse,t.response),t.response.headers=Bt.from(t.response.headers))),Promise.reject(t)}))}const we={};["object","boolean","number","function","string","symbol"].forEach(((n,t)=>{we[n]=function(e){return typeof e===n||"a"+(t<1?"n ":" ")+n}}));const ye={};we.transitional=function(n,t,e){return(r,i,o)=>{if(!1===n)throw new ct(function(n,t){return"[Axios v1.7.9] Transitional option '"+n+"'"+t+(e?". "+e:"")}(i," has been removed"+(t?" in "+t:"")),ct.ERR_DEPRECATED);return t&&!ye[i]&&(ye[i]=!0),!n||n(r,i,o)}},we.spelling=function(n){return(n,t)=>!0};var ge={assertOptions:function(n,t,e){if("object"!=typeof n)throw new ct("options must be an object",ct.ERR_BAD_OPTION_VALUE);const r=Object.keys(n);let i=r.length;for(;i-- >0;){const o=r[i],u=t[o];if(u){const t=n[o],e=void 0===t||u(t,o,n);if(!0!==e)throw new ct("option "+o+" must be "+e,ct.ERR_BAD_OPTION_VALUE)}else if(!0!==e)throw new ct("Unknown option "+o,ct.ERR_BAD_OPTION)}},validators:we};const ke=ge.validators;class xe{constructor(n){this.defaults=n,this.interceptors={request:new kt,response:new kt}}async request(n,t){try{return await this.k(n,t)}catch(n){if(n instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();const e=t.stack?t.stack.replace(/^.+\n/,""):"";try{n.stack?e&&!(n.stack+"").endsWith(e.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+e):n.stack=e}catch(n){}}throw n}}k(n,t){"string"==typeof n?(t=t||{}).url=n:t=n||{},t=Yt(this.defaults,t);const{transitional:e,paramsSerializer:r,headers:i}=t;void 0!==e&&ge.assertOptions(e,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),null!=r&&(st.isFunction(r)?t.paramsSerializer={serialize:r}:ge.assertOptions(r,{encode:ke.function,serialize:ke.function},!0)),ge.assertOptions(t,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&st.merge(i.common,i[t.method]);i&&st.forEach(["delete","get","head","post","put","patch","common"],(n=>{delete i[n]})),t.headers=Bt.concat(o,i);const u=[];let s=!0;this.interceptors.request.forEach((function(n){"function"==typeof n.runWhen&&!1===n.runWhen(t)||(s=s&&n.synchronous,u.unshift(n.fulfilled,n.rejected))}));const c=[];let a;this.interceptors.response.forEach((function(n){c.push(n.fulfilled,n.rejected)}));let f,h=0;if(!s){const n=[be.bind(this),void 0];for(n.unshift.apply(n,u),n.push.apply(n,c),f=n.length,a=Promise.resolve(t);h<f;)a=a.then(n[h++],n[h++]);return a}f=u.length;let l=t;for(h=0;h<f;){const n=u[h++],t=u[h++];try{l=n(l)}catch(n){t.call(this,n);break}}try{a=be(l)}catch(n){return Promise.reject(n)}for(h=0,f=c.length;h<f;)a=a.then(c[h++],c[h++]);return a}getUri(n){return gt(Xt((n=Yt(this.defaults,n)).baseURL,n.url),n.params,n.paramsSerializer)}}st.forEach(["delete","get","head","options"],(function(n){xe.prototype[n]=function(t,e){return this.request(Yt(e||{},{method:n,url:t,data:(e||{}).data}))}})),st.forEach(["post","put","patch"],(function(n){function t(t){return function(e,r,i){return this.request(Yt(i||{},{method:n,headers:t?{"Content-Type":"multipart/form-data"}:{},url:e,data:r}))}}xe.prototype[n]=t(),xe.prototype[n+"Form"]=t(!0)}));var Oe=xe;class Se{constructor(n){if("function"!=typeof n)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(n){t=n}));const e=this;this.promise.then((n=>{if(!e.O)return;let t=e.O.length;for(;t-- >0;)e.O[t](n);e.O=null})),this.promise.then=n=>{let t;const r=new Promise((n=>{e.subscribe(n),t=n})).then(n);return r.cancel=function(){e.unsubscribe(t)},r},n((function(n,r,i){e.reason||(e.reason=new Ht(n,r,i),t(e.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){this.reason?n(this.reason):this.O?this.O.push(n):this.O=[n]}unsubscribe(n){if(!this.O)return;const t=this.O.indexOf(n);-1!==t&&this.O.splice(t,1)}toAbortSignal(){const n=new AbortController,t=t=>{n.abort(t)};return this.subscribe(t),n.signal.unsubscribe=()=>this.unsubscribe(t),n.signal}static source(){let n;return{token:new Se((function(t){n=t})),cancel:n}}}var _e=Se;const je={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(je).forEach((([n,t])=>{je[t]=n}));var Ee=je;const Re=function n(t){const e=new Oe(t),r=bn(Oe.prototype.request,e);return st.extend(r,Oe.prototype,e,{allOwnKeys:!0}),st.extend(r,e,null,{allOwnKeys:!0}),r.create=function(e){return n(Yt(t,e))},r}(Nt);Re.Axios=Oe,Re.CanceledError=Ht,Re.CancelToken=_e,Re.isCancel=zt,Re.VERSION="1.7.9",Re.toFormData=pt,Re.AxiosError=ct,Re.Cancel=Re.CanceledError,Re.all=function(n){return Promise.all(n)},Re.spread=function(n){return function(t){return n.apply(null,t)}},Re.isAxiosError=function(n){return st.isObject(n)&&!0===n.isAxiosError},Re.mergeConfig=Yt,Re.AxiosHeaders=Bt,Re.formToJSON=n=>Pt(st.isHTMLForm(n)?new FormData(n):n),Re.getAdapter=pe,Re.HttpStatusCode=Ee,Re.default=Re;var Te=Re,Pe=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Ae=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Ne=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(mn,"t",{value:!0});var Ce=Ne(Te),Me=h,Ue=Ne(d),qe=!0,De=function(){function n(n){this.configuration=n,this.apiKey=this.configuration.apiKey,this.nodes=null==this.configuration.nodes?this.configuration.nodes:JSON.parse(JSON.stringify(this.configuration.nodes)),this.nearestNode=null==this.configuration.nearestNode?this.configuration.nearestNode:JSON.parse(JSON.stringify(this.configuration.nearestNode)),this.connectionTimeoutSeconds=this.configuration.connectionTimeoutSeconds,this.healthcheckIntervalSeconds=this.configuration.healthcheckIntervalSeconds,this.numRetriesPerRequest=this.configuration.numRetries,this.retryIntervalSeconds=this.configuration.retryIntervalSeconds,this.sendApiKeyAsQueryParam=this.configuration.sendApiKeyAsQueryParam,this.additionalUserHeaders=this.configuration.additionalHeaders,this.logger=this.configuration.logger,this.initializeMetadataForNodes(),this.currentNodeIndex=-1}return n.prototype.get=function(n,t,e){void 0===t&&(t={});var r=void 0===e?{}:e,i=r.abortSignal,o=void 0===i?null:i,u=r.responseType,s=void 0===u?void 0:u;return Pe(this,void 0,void 0,(function(){return Ae(this,(function(e){return[2,this.performRequest("get",n,{queryParameters:t,abortSignal:o,responseType:s})]}))}))},n.prototype.delete=function(n,t){return void 0===t&&(t={}),Pe(this,void 0,void 0,(function(){return Ae(this,(function(e){return[2,this.performRequest("delete",n,{queryParameters:t})]}))}))},n.prototype.post=function(n,t,e,r){return void 0===t&&(t={}),void 0===e&&(e={}),void 0===r&&(r={}),Pe(this,void 0,void 0,(function(){return Ae(this,(function(i){return[2,this.performRequest("post",n,{queryParameters:e,bodyParameters:t,additionalHeaders:r})]}))}))},n.prototype.put=function(n,t,e){return void 0===t&&(t={}),void 0===e&&(e={}),Pe(this,void 0,void 0,(function(){return Ae(this,(function(r){return[2,this.performRequest("put",n,{queryParameters:e,bodyParameters:t})]}))}))},n.prototype.patch=function(n,t,e){return void 0===t&&(t={}),void 0===e&&(e={}),Pe(this,void 0,void 0,(function(){return Ae(this,(function(r){return[2,this.performRequest("patch",n,{queryParameters:e,bodyParameters:t})]}))}))},n.prototype.performRequest=function(n,t,e){var r,i,o,u=e.queryParameters,s=void 0===u?null:u,c=e.bodyParameters,a=void 0===c?null:c,f=e.additionalHeaders,h=void 0===f?{}:f,l=e.abortSignal,d=void 0===l?null:l,v=e.responseType,p=void 0===v?void 0:v,m=e.skipConnectionTimeout,b=void 0!==m&&m;return Pe(this,void 0,void 0,(function(){var e,u,c,f,l,v;return Ae(this,(function(m){switch(m.label){case 0:this.configuration.validate(),e=Date.now(),this.logger.debug("Request #".concat(e,": Performing ").concat(n.toUpperCase()," request: ").concat(t)),c=function(c){var l,v,m,w,y,g,k;return Ae(this,(function(x){switch(x.label){case 0:if(l=f.getNextNode(e),f.logger.debug("Request #".concat(e,": Attempting ").concat(n.toUpperCase()," request Try #").concat(c," to Node ").concat(l.index)),d&&d.aborted)return[2,{value:Promise.reject(Error("Request aborted by caller."))}];v=void 0,x.label=1;case 1:return x.trys.push([1,3,5,6]),m={method:n,url:f.uriFor(t,l),headers:Object.assign({},f.defaultHeaders(),h,f.additionalUserHeaders),maxContentLength:1/0,maxBodyLength:1/0,responseType:p,validateStatus:function(n){return n>0},transformResponse:[function(n,t){var e=n;return void 0!==t&&"string"==typeof n&&t["content-type"]&&t["content-type"].startsWith("application/json")&&(e=JSON.parse(n)),e}]},!0!==b&&(m.timeout=1e3*f.connectionTimeoutSeconds),s&&0!==Object.keys(s).length&&(m.params=s),f.sendApiKeyAsQueryParam&&(m.params=m.params||{},m.params["x-typesense-api-key"]=f.apiKey),f.configuration.httpAgent&&(f.logger.debug("Request #".concat(e,": Using custom httpAgent")),m.httpAgent=f.configuration.httpAgent),f.configuration.httpsAgent&&(f.logger.debug("Request #".concat(e,": Using custom httpsAgent")),m.httpsAgent=f.configuration.httpsAgent),a&&("string"==typeof a&&0!==a.length||"object"==typeof a&&0!==Object.keys(a).length)&&(m.data=a),d&&(w=Ce.default.CancelToken,y=w.source(),v=function(){return y.cancel()},d.addEventListener("abort",v),m.cancelToken=y.token),[4,(0,Ce.default)(m)];case 2:if((g=x.sent()).status>=1&&g.status<=499&&f.setNodeHealthcheck(l,qe),f.logger.debug("Request #".concat(e,": Request to Node ").concat(l.index," was made. Response Code was ").concat(g.status,".")),g.status>=200&&g.status<300)return[2,{value:Promise.resolve(g.data)}];if(g.status<500)return[2,{value:Promise.reject(f.customErrorForResponse(g,null===(r=g.data)||void 0===r?void 0:r.message))}];throw f.customErrorForResponse(g,null===(i=g.data)||void 0===i?void 0:i.message);case 3:return k=x.sent(),f.setNodeHealthcheck(l,!1),u=k,f.logger.warn("Request #".concat(e,": Request to Node ").concat(l.index,' failed due to "').concat(k.code," ").concat(k.message).concat(null==k.response?"":" - "+JSON.stringify(null===(o=k.response)||void 0===o?void 0:o.data),'"')),f.logger.warn("Request #".concat(e,": Sleeping for ").concat(f.retryIntervalSeconds,"s and then retrying request...")),[4,f.timer(f.retryIntervalSeconds)];case 4:return x.sent(),[3,6];case 5:return d&&v&&d.removeEventListener("abort",v),[7];case 6:return[2]}}))},f=this,l=1,m.label=1;case 1:return l<=this.numRetriesPerRequest+1?[5,c(l)]:[3,4];case 2:if("object"==typeof(v=m.sent()))return[2,v.value];m.label=3;case 3:return l++,[3,1];case 4:return this.logger.debug("Request #".concat(e,": No retries left. Raising last error")),[2,Promise.reject(u)]}}))}))},n.prototype.getNextNode=function(n){if(void 0===n&&(n=0),null!=this.nearestNode){if(this.logger.debug("Request #".concat(n,": Nodes Health: Node ").concat(this.nearestNode.index," is ").concat(!0===this.nearestNode.isHealthy?"Healthy":"Unhealthy")),!0===this.nearestNode.isHealthy||this.nodeDueForHealthcheck(this.nearestNode,n))return this.logger.debug("Request #".concat(n,": Updated current node to Node ").concat(this.nearestNode.index)),this.nearestNode;this.logger.debug("Request #".concat(n,": Falling back to individual nodes"))}this.logger.debug("Request #".concat(n,": Nodes Health: ").concat(this.nodes.map((function(n){return"Node ".concat(n.index," is ").concat(!0===n.isHealthy?"Healthy":"Unhealthy")})).join(" || ")));for(var t=this.nodes[0],e=0;e<=this.nodes.length;e++)if(this.currentNodeIndex=(this.currentNodeIndex+1)%this.nodes.length,!0===(t=this.nodes[this.currentNodeIndex]).isHealthy||this.nodeDueForHealthcheck(t,n))return this.logger.debug("Request #".concat(n,": Updated current node to Node ").concat(t.index)),t;return this.logger.debug("Request #".concat(n,": No healthy nodes were found. Returning the next node, Node ").concat(t.index)),t},n.prototype.nodeDueForHealthcheck=function(n,t){void 0===t&&(t=0);var e=Date.now()-n.lastAccessTimestamp>1e3*this.healthcheckIntervalSeconds;return e&&this.logger.debug("Request #".concat(t,": Node ").concat(n.index," has exceeded healtcheckIntervalSeconds of ").concat(this.healthcheckIntervalSeconds,". Adding it back into rotation.")),e},n.prototype.initializeMetadataForNodes=function(){var n=this;null!=this.nearestNode&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,qe)),this.nodes.forEach((function(t,e){t.index=e,n.setNodeHealthcheck(t,qe)}))},n.prototype.setNodeHealthcheck=function(n,t){n.isHealthy=t,n.lastAccessTimestamp=Date.now()},n.prototype.uriFor=function(n,t){return null!=t.url?"".concat(t.url).concat(n):"".concat(t.protocol,"://").concat(t.host,":").concat(t.port).concat(t.path).concat(n)},n.prototype.defaultHeaders=function(){var n={};return this.sendApiKeyAsQueryParam||(n["X-TYPESENSE-API-KEY"]=this.apiKey),n["Content-Type"]="application/json",n},n.prototype.timer=function(n){return Pe(this,void 0,void 0,(function(){return Ae(this,(function(t){return[2,new Promise((function(t){return setTimeout(t,1e3*n)}))]}))}))},n.prototype.customErrorForResponse=function(n,t){var e="Request failed with HTTP code ".concat(n.status);"string"==typeof t&&""!==t.trim()&&(e+=" | Server said: ".concat(t));var r=new Ue.default(e);return(r=400===n.status?new Me.RequestMalformed(e):401===n.status?new Me.RequestUnauthorized(e):404===n.status?new Me.ObjectNotFound(e):409===n.status?new Me.ObjectAlreadyExists(e):422===n.status?new Me.ObjectUnprocessable(e):n.status>=500&&n.status<=599?new Me.ServerError(e):new Me.HTTPError(e)).httpStatus=n.status,r},n}();mn.default=De;var Fe={},Be=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Le=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(Fe,"t",{value:!0});var ze="/collections",He=function(){function n(n){this.apiCall=n}return n.prototype.create=function(n,t){return void 0===t&&(t={}),Be(this,void 0,void 0,(function(){return Le(this,(function(e){return[2,this.apiCall.post(ze,n,t)]}))}))},n.prototype.retrieve=function(){return Be(this,void 0,void 0,(function(){return Le(this,(function(n){return[2,this.apiCall.get(ze)]}))}))},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return ze},enumerable:!1,configurable:!0}),n}();Fe.default=He;var Ie={},Ge={},Je={},$e={},Ke=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},We=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Xe=n&&n.j||function(n,t,e){if(e||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return n.concat(r||Array.prototype.slice.call(t))};Object.defineProperty($e,"t",{value:!0});var Ve=function(){function n(){this.responseCache=new Map,this.responsePromiseCache=new Map}return n.prototype.clearCache=function(){this.responseCache=new Map,this.responsePromiseCache=new Map},n.prototype.perform=function(n,t,e,r){return Ke(this,void 0,void 0,(function(){var i,o,u,s,c,a,f,h,l,d,v;return We(this,(function(p){switch(p.label){case 0:if(i=r.cacheResponseForSeconds,o=void 0===i?120:i,u=r.maxSize,s=void 0===u?100:u,o<=0||s<=0)return[2,t.call.apply(t,Xe([n],e,!1))];if(c=JSON.stringify(e),a=this.responseCache.get(c),f=Date.now(),a){if(f-a.requestTimestamp<1e3*o)return this.responseCache.delete(c),this.responseCache.set(c,a),[2,Promise.resolve(a.response)];this.responseCache.delete(c)}if(h=this.responsePromiseCache.get(c)){if(f-h.requestTimestamp<1e3*o)return this.responsePromiseCache.delete(c),this.responsePromiseCache.set(c,h),[2,h.responsePromise];this.responsePromiseCache.delete(c)}return l=t.call.apply(t,Xe([n],e,!1)),this.responsePromiseCache.set(c,{requestTimestamp:f,responsePromise:l}),[4,l];case 1:return d=p.sent(),this.responseCache.set(c,{requestTimestamp:f,response:d}),this.responseCache.size>s&&(v=this.responseCache.keys().next().value,this.responseCache.delete(v)),this.responsePromiseCache.size>s&&(v=this.responsePromiseCache.keys().next().value,this.responsePromiseCache.delete(v)),[2,d]}}))}))},n}();$e.default=Ve;var Ye=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Ze=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Qe=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Je,"t",{value:!0}),Je.SearchOnlyDocuments=void 0;var nr=Qe($e),tr=Qe(Fe),er="/documents",rr=function(){function n(n,t,e){this.collectionName=n,this.apiCall=t,this.configuration=e,this.requestWithCache=new nr.default}return n.prototype.clearCache=function(){this.requestWithCache.clearCache()},n.prototype.search=function(n,t){var e=void 0===t?{}:t,r=e.cacheSearchResultsForSeconds,i=void 0===r?this.configuration.cacheSearchResultsForSeconds:r,o=e.abortSignal,u=void 0===o?null:o;return Ye(this,void 0,void 0,(function(){var t,e,r;return Ze(this,(function(o){for(e in t={},!0===this.configuration.useServerSideSearchCache&&(t.use_cache=!0),n)Array.isArray(n[e])&&(t[e]=n[e].join(","));return r=Object.assign({},n,t),[2,this.requestWithCache.perform(this.apiCall,this.apiCall.get,[this.endpointPath("search"),r,{abortSignal:u}],{cacheResponseForSeconds:i})]}))}))},n.prototype.endpointPath=function(n){return"".concat(tr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(er).concat(void 0===n?"":"/"+n)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return er},enumerable:!1,configurable:!0}),n}();Je.SearchOnlyDocuments=rr;var ir=n&&n.i||function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},n(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),or=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},ur=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(Ge,"t",{value:!0});var sr=h,cr=function(n){function t(t,e,r){return n.call(this,t,e,r)||this}return ir(t,n),t.prototype.create=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){return ur(this,(function(e){if(!n)throw Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),n,t)]}))}))},t.prototype.upsert=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){return ur(this,(function(e){if(!n)throw Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),n,Object.assign({},t,{action:"upsert"}))]}))}))},t.prototype.update=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){return ur(this,(function(e){if(!n)throw Error("No document provided");return null!=t.filter_by?[2,this.apiCall.patch(this.endpointPath(),n,Object.assign({},t))]:[2,this.apiCall.post(this.endpointPath(),n,Object.assign({},t,{action:"update"}))]}))}))},t.prototype.delete=function(n){return void 0===n&&(n={}),or(this,void 0,void 0,(function(){return ur(this,(function(t){return[2,this.apiCall.delete(this.endpointPath(),n)]}))}))},t.prototype.createMany=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){return ur(this,(function(e){return this.configuration.logger.warn("createMany is deprecated and will be removed in a future version. Use import instead, which now takes both an array of documents or a JSONL string of documents"),[2,this.import(n,t)]}))}))},t.prototype.import=function(n,t){return void 0===t&&(t={}),or(this,void 0,void 0,(function(){var e,r,i,o;return ur(this,(function(u){switch(u.label){case 0:if(Array.isArray(n))try{e=n.map((function(n){return JSON.stringify(n)})).join("\n")}catch(n){if(RangeError instanceof n&&(null==n?void 0:n.includes("Too many properties to enumerate")))throw Error("".concat(n,"\n It looks like you have reached a Node.js limit that restricts the number of keys in an Object: https://stackoverflow.com/questions/9282869/are-there-limits-to-the-number-of-properties-in-a-javascript-object\n\n Please try reducing the number of keys in your document, or using CURL to import your data.\n "));throw Error(n)}else e=n;return[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:t,bodyParameters:e,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0})];case 1:if(r=u.sent(),Array.isArray(n)){if(i=r.split("\n").map((function(n){return JSON.parse(n)})),(o=i.filter((function(n){return!1===n.success}))).length>0)throw new sr.ImportError("".concat(i.length-o.length," documents imported successfully, ").concat(o.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),i);return[2,i]}return[2,r]}}))}))},t.prototype.export=function(n){return void 0===n&&(n={}),or(this,void 0,void 0,(function(){return ur(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),n)]}))}))},t.prototype.exportStream=function(n){return void 0===n&&(n={}),or(this,void 0,void 0,(function(){return ur(this,(function(t){return[2,this.apiCall.get(this.endpointPath("export"),n,{responseType:"stream"})]}))}))},t}(Je.SearchOnlyDocuments);Ge.default=cr;var ar={},fr=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},hr=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},lr=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(ar,"t",{value:!0});var dr=lr(Fe),vr=function(){function n(n,t){this.collectionName=n,this.apiCall=t}return n.prototype.upsert=function(n,t){return fr(this,void 0,void 0,(function(){return hr(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return fr(this,void 0,void 0,(function(){return hr(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(dr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/overrides"},enumerable:!1,configurable:!0}),n}();ar.default=vr;var pr={},mr=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},br=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},wr=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(pr,"t",{value:!0});var yr=wr(Fe),gr=wr(ar),kr=function(){function n(n,t,e){this.collectionName=n,this.overrideId=t,this.apiCall=e}return n.prototype.retrieve=function(){return mr(this,void 0,void 0,(function(){return br(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return mr(this,void 0,void 0,(function(){return br(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(yr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(gr.default.RESOURCEPATH,"/").concat(this.overrideId)},n}();pr.default=kr;var xr={},Or=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Sr=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},_r=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(xr,"t",{value:!0});var jr=_r(Fe),Er=function(){function n(n,t){this.collectionName=n,this.apiCall=t}return n.prototype.upsert=function(n,t){return Or(this,void 0,void 0,(function(){return Sr(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return Or(this,void 0,void 0,(function(){return Sr(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(jr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/synonyms"},enumerable:!1,configurable:!0}),n}();xr.default=Er;var Rr={},Tr=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Pr=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Ar=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Rr,"t",{value:!0});var Nr=Ar(Fe),Cr=Ar(xr),Mr=function(){function n(n,t,e){this.collectionName=n,this.synonymId=t,this.apiCall=e}return n.prototype.retrieve=function(){return Tr(this,void 0,void 0,(function(){return Pr(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return Tr(this,void 0,void 0,(function(){return Pr(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(Nr.default.RESOURCEPATH,"/").concat(this.collectionName).concat(Cr.default.RESOURCEPATH,"/").concat(this.synonymId)},n}();Rr.default=Mr;var Ur={},qr=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Dr=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Fr=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Ur,"t",{value:!0}),Ur.Document=void 0;var Br=Fr(Fe),Lr=Fr(Ge),zr=function(){function n(n,t,e){this.collectionName=n,this.documentId=t,this.apiCall=e}return n.prototype.retrieve=function(){return qr(this,void 0,void 0,(function(){return Dr(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return qr(this,void 0,void 0,(function(){return Dr(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.update=function(n,t){return void 0===t&&(t={}),qr(this,void 0,void 0,(function(){return Dr(this,(function(e){return[2,this.apiCall.patch(this.endpointPath(),n,t)]}))}))},n.prototype.endpointPath=function(){return"".concat(Br.default.RESOURCEPATH,"/").concat(this.collectionName).concat(Lr.default.RESOURCEPATH,"/").concat(this.documentId)},n}();Ur.Document=zr;var Hr=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Ir=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Gr=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Ie,"t",{value:!0});var Jr=Gr(Fe),$r=Gr(Ge),Kr=h,Wr=Gr(ar),Xr=Gr(pr),Vr=Gr(xr),Yr=Gr(Rr),Zr=Ur,Qr=function(){function n(n,t,e){this.name=n,this.apiCall=t,this.configuration=e,this.individualDocuments={},this.individualOverrides={},this.individualSynonyms={},this.name=n,this.apiCall=t,this.configuration=e,this.R=new $r.default(this.name,this.apiCall,this.configuration),this.T=new Wr.default(this.name,this.apiCall),this.P=new Vr.default(this.name,this.apiCall)}return n.prototype.retrieve=function(){return Hr(this,void 0,void 0,(function(){return Ir(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.update=function(n){return Hr(this,void 0,void 0,(function(){return Ir(this,(function(t){return[2,this.apiCall.patch(this.endpointPath(),n)]}))}))},n.prototype.delete=function(){return Hr(this,void 0,void 0,(function(){return Ir(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.exists=function(){return Hr(this,void 0,void 0,(function(){var n;return Ir(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.retrieve()];case 1:return t.sent(),[2,!0];case 2:if((n=t.sent())instanceof Kr.ObjectNotFound)return[2,!1];throw n;case 3:return[2]}}))}))},n.prototype.documents=function(n){return n?(void 0===this.individualDocuments[n]&&(this.individualDocuments[n]=new Zr.Document(this.name,n,this.apiCall)),this.individualDocuments[n]):this.R},n.prototype.overrides=function(n){return void 0===n?this.T:(void 0===this.individualOverrides[n]&&(this.individualOverrides[n]=new Xr.default(this.name,n,this.apiCall)),this.individualOverrides[n])},n.prototype.synonyms=function(n){return void 0===n?this.P:(void 0===this.individualSynonyms[n]&&(this.individualSynonyms[n]=new Yr.default(this.name,n,this.apiCall)),this.individualSynonyms[n])},n.prototype.endpointPath=function(){return"".concat(Jr.default.RESOURCEPATH,"/").concat(this.name)},n}();Ie.default=Qr;var ni={},ti=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},ei=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(ni,"t",{value:!0});var ri="/aliases",ii=function(){function n(n){this.apiCall=n}return n.prototype.upsert=function(n,t){return ti(this,void 0,void 0,(function(){return ei(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return ti(this,void 0,void 0,(function(){return ei(this,(function(n){return[2,this.apiCall.get(ri)]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH,"/").concat(t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return ri},enumerable:!1,configurable:!0}),n}();ni.default=ii;var oi={},ui=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},si=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},ci=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(oi,"t",{value:!0});var ai=ci(ni),fi=function(){function n(n,t){this.name=n,this.apiCall=t}return n.prototype.retrieve=function(){return ui(this,void 0,void 0,(function(){return si(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return ui(this,void 0,void 0,(function(){return si(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(ai.default.RESOURCEPATH,"/").concat(this.name)},n}();oi.default=fi;var hi={};const li=t(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var di=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},vi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(hi,"t",{value:!0});var pi=li,mi="/keys",bi=function(){function n(n){this.apiCall=n,this.apiCall=n}return n.prototype.create=function(t){return di(this,void 0,void 0,(function(){return vi(this,(function(e){return[2,this.apiCall.post(n.RESOURCEPATH,t)]}))}))},n.prototype.retrieve=function(){return di(this,void 0,void 0,(function(){return vi(this,(function(n){return[2,this.apiCall.get(mi)]}))}))},n.prototype.generateScopedSearchKey=function(n,t){var e=JSON.stringify(t),r=Buffer.from((0,pi.createHmac)("sha256",n).update(e).digest("base64")),i=n.substr(0,4),o="".concat(r).concat(i).concat(e);return Buffer.from(o).toString("base64")},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return mi},enumerable:!1,configurable:!0}),n}();hi.default=bi;var wi={},yi=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},gi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},ki=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(wi,"t",{value:!0});var xi=ki(hi),Oi=function(){function n(n,t){this.id=n,this.apiCall=t}return n.prototype.retrieve=function(){return yi(this,void 0,void 0,(function(){return gi(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return yi(this,void 0,void 0,(function(){return gi(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(xi.default.RESOURCEPATH,"/").concat(this.id)},n}();wi.default=Oi;var Si={},_i=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},ji=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(Si,"t",{value:!0});var Ei=function(){function n(n){this.apiCall=n}return n.prototype.retrieve=function(){return _i(this,void 0,void 0,(function(){return ji(this,(function(n){return[2,this.apiCall.get("/debug")]}))}))},n}();Si.default=Ei;var Ri={},Ti=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Pi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(Ri,"t",{value:!0});var Ai=function(){function n(n){this.apiCall=n}return n.prototype.retrieve=function(){return Ti(this,void 0,void 0,(function(){return Pi(this,(function(n){return[2,this.apiCall.get("/metrics.json")]}))}))},n}();Ri.default=Ai;var Ni={},Ci=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Mi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(Ni,"t",{value:!0});var Ui=function(){function n(n){this.apiCall=n}return n.prototype.retrieve=function(){return Ci(this,void 0,void 0,(function(){return Mi(this,(function(n){return[2,this.apiCall.get("/health")]}))}))},n}();Ni.default=Ui;var qi={},Di=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Fi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(qi,"t",{value:!0});var Bi=function(){function n(n){this.apiCall=n}return n.prototype.perform=function(n,t){return void 0===t&&(t={}),Di(this,void 0,void 0,(function(){return Fi(this,(function(e){return[2,this.apiCall.post("".concat("/operations","/").concat(n),{},t)]}))}))},n}();qi.default=Bi;var Li={},zi=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Hi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Ii=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Li,"t",{value:!0});var Gi=Ii($e),Ji=function(){function n(n,t,e){void 0===e&&(e=!1),this.apiCall=n,this.configuration=t,this.useTextContentType=e,this.requestWithCache=new Gi.default}return n.prototype.clearCache=function(){this.requestWithCache.clearCache()},n.prototype.perform=function(n,t,e){void 0===t&&(t={});var r=(void 0===e?{}:e).cacheSearchResultsForSeconds,i=void 0===r?this.configuration.cacheSearchResultsForSeconds:r;return zi(this,void 0,void 0,(function(){var e,r,o;return Hi(this,(function(u){return e={},this.useTextContentType&&(e["content-type"]="text/plain"),r={},!0===this.configuration.useServerSideSearchCache&&(r.use_cache=!0),o=Object.assign({},t,r),[2,this.requestWithCache.perform(this.apiCall,this.apiCall.post,["/multi_search",n,o,e],{cacheResponseForSeconds:i})]}))}))},n}();Li.default=Ji;var $i={},Ki=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Wi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty($i,"t",{value:!0});var Xi=function(){function n(n){this.apiCall=n}return n.prototype.upsert=function(n,t){return Ki(this,void 0,void 0,(function(){return Wi(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return Ki(this,void 0,void 0,(function(){return Wi(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/presets"},enumerable:!1,configurable:!0}),n}();$i.default=Xi;var Vi={},Yi=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Zi=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Qi=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Vi,"t",{value:!0});var no=Qi($i),to=function(){function n(n,t){this.presetId=n,this.apiCall=t}return n.prototype.retrieve=function(){return Yi(this,void 0,void 0,(function(){return Zi(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return Yi(this,void 0,void 0,(function(){return Zi(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(no.default.RESOURCEPATH,"/").concat(this.presetId)},n}();Vi.default=to;var eo={},ro={},io=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},oo=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(ro,"t",{value:!0});var uo=function(){function n(n){this.apiCall=n,this.apiCall=n}return n.prototype.upsert=function(n,t){return io(this,void 0,void 0,(function(){return oo(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return io(this,void 0,void 0,(function(){return oo(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/analytics/rules"},enumerable:!1,configurable:!0}),n}();ro.default=uo;var so={},co=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},ao=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},fo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(so,"t",{value:!0});var ho=fo(ro),lo=function(){function n(n,t){this.name=n,this.apiCall=t}return n.prototype.retrieve=function(){return co(this,void 0,void 0,(function(){return ao(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return co(this,void 0,void 0,(function(){return ao(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(ho.default.RESOURCEPATH,"/").concat(this.name)},n}();so.default=lo;var vo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(eo,"t",{value:!0});var po=vo(ro),mo=vo(so),bo=function(){function n(n){this.apiCall=n,this.individualAnalyticsRules={},this.apiCall=n,this.A=new po.default(this.apiCall)}return n.prototype.rules=function(n){return void 0===n?this.A:(void 0===this.individualAnalyticsRules[n]&&(this.individualAnalyticsRules[n]=new mo.default(n,this.apiCall)),this.individualAnalyticsRules[n])},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/analytics"},enumerable:!1,configurable:!0}),n}();eo.default=bo;var wo={},yo=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},go=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(wo,"t",{value:!0});var ko=function(){function n(n){this.apiCall=n}return n.prototype.upsert=function(n,t){return yo(this,void 0,void 0,(function(){return go(this,(function(e){return[2,this.apiCall.put(this.endpointPath(n),t)]}))}))},n.prototype.retrieve=function(){return yo(this,void 0,void 0,(function(){return go(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/stopwords"},enumerable:!1,configurable:!0}),n}();wo.default=ko;var xo={},Oo=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},So=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},_o=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(xo,"t",{value:!0});var jo=_o(wo),Eo=function(){function n(n,t){this.stopwordId=n,this.apiCall=t}return n.prototype.retrieve=function(){return Oo(this,void 0,void 0,(function(){return So(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return Oo(this,void 0,void 0,(function(){return So(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(jo.default.RESOURCEPATH,"/").concat(this.stopwordId)},n}();xo.default=Eo;var Ro={},To={},Po=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Ao=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(To,"t",{value:!0});var No=function(){function n(n){this.apiCall=n,this.apiCall=n}return n.prototype.create=function(n){return Po(this,void 0,void 0,(function(){return Ao(this,(function(t){return[2,this.apiCall.post(this.endpointPath(),n)]}))}))},n.prototype.retrieve=function(){return Po(this,void 0,void 0,(function(){return Ao(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.endpointPath=function(t){return"".concat(n.RESOURCEPATH).concat(void 0===t?"":"/"+t)},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return"/conversations/models"},enumerable:!1,configurable:!0}),n}();To.default=No;var Co={},Mo=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Uo=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},qo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Co,"t",{value:!0});var Do=qo(To),Fo=function(){function n(n,t){this.id=n,this.apiCall=t}return n.prototype.update=function(n){return Mo(this,void 0,void 0,(function(){return Uo(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),n)]}))}))},n.prototype.retrieve=function(){return Mo(this,void 0,void 0,(function(){return Uo(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.delete=function(){return Mo(this,void 0,void 0,(function(){return Uo(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(Do.default.RESOURCEPATH,"/").concat(this.id)},n}();Co.default=Fo;var Bo=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Lo=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},zo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(Ro,"t",{value:!0});var Ho=zo(To),Io=zo(Co),Go="/conversations",Jo=function(){function n(n){this.apiCall=n,this.individualConversationModels={},this.apiCall=n,this.N=new Ho.default(this.apiCall)}return n.prototype.retrieve=function(){return Bo(this,void 0,void 0,(function(){return Lo(this,(function(n){return[2,this.apiCall.get(Go)]}))}))},n.prototype.models=function(n){return void 0===n?this.N:(void 0===this.individualConversationModels[n]&&(this.individualConversationModels[n]=new Io.default(n,this.apiCall)),this.individualConversationModels[n])},Object.defineProperty(n,"RESOURCEPATH",{get:function(){return Go},enumerable:!1,configurable:!0}),n}();Ro.default=Jo;var $o={},Ko=n&&n.S||function(n,t,e,r){return new(e||(e=Promise))((function(i,o){function u(n){try{c(r.next(n))}catch(n){o(n)}}function s(n){try{c(r.throw(n))}catch(n){o(n)}}function c(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}c((r=r.apply(n,t||[])).next())}))},Wo=n&&n._||function(n,t){var e,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(u=0)),u;)try{if(e=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,r=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){u=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(6===s[0]&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(n,u)}catch(n){s=[6,n],r=0}finally{e=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Xo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty($o,"t",{value:!0});var Vo=Xo(Ro),Yo=function(){function n(n,t){this.id=n,this.apiCall=t}return n.prototype.retrieve=function(){return Ko(this,void 0,void 0,(function(){return Wo(this,(function(n){return[2,this.apiCall.get(this.endpointPath())]}))}))},n.prototype.update=function(n){return Ko(this,void 0,void 0,(function(){return Wo(this,(function(t){return[2,this.apiCall.put(this.endpointPath(),n)]}))}))},n.prototype.delete=function(){return Ko(this,void 0,void 0,(function(){return Wo(this,(function(n){return[2,this.apiCall.delete(this.endpointPath())]}))}))},n.prototype.endpointPath=function(){return"".concat(Vo.default.RESOURCEPATH,"/").concat(this.id)},n}();$o.default=Yo;var Zo=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(u,"t",{value:!0});var Qo=Zo(s),nu=Zo(mn),tu=Zo(Fe),eu=Zo(Ie),ru=Zo(ni),iu=Zo(oi),ou=Zo(hi),uu=Zo(wi),su=Zo(Si),cu=Zo(Ri),au=Zo(Ni),fu=Zo(qi),hu=Zo(Li),lu=Zo($i),du=Zo(Vi),vu=Zo(eo),pu=Zo(wo),mu=Zo(xo),bu=Zo(Ro),wu=Zo($o),yu=function(){function n(n){var t;n.sendApiKeyAsQueryParam=null!==(t=n.sendApiKeyAsQueryParam)&&void 0!==t&&t,this.configuration=new Qo.default(n),this.apiCall=new nu.default(this.configuration),this.debug=new su.default(this.apiCall),this.metrics=new cu.default(this.apiCall),this.health=new au.default(this.apiCall),this.operations=new fu.default(this.apiCall),this.multiSearch=new hu.default(this.apiCall,this.configuration),this.C=new tu.default(this.apiCall),this.individualCollections={},this.M=new ru.default(this.apiCall),this.individualAliases={},this.U=new ou.default(this.apiCall),this.individualKeys={},this.D=new lu.default(this.apiCall),this.individualPresets={},this.F=new pu.default(this.apiCall),this.individualStopwords={},this.analytics=new vu.default(this.apiCall),this.B=new bu.default(this.apiCall),this.individualConversations={}}return n.prototype.collections=function(n){return void 0===n?this.C:(void 0===this.individualCollections[n]&&(this.individualCollections[n]=new eu.default(n,this.apiCall,this.configuration)),this.individualCollections[n])},n.prototype.aliases=function(n){return void 0===n?this.M:(void 0===this.individualAliases[n]&&(this.individualAliases[n]=new iu.default(n,this.apiCall)),this.individualAliases[n])},n.prototype.keys=function(n){return void 0===n?this.U:(void 0===this.individualKeys[n]&&(this.individualKeys[n]=new uu.default(n,this.apiCall)),this.individualKeys[n])},n.prototype.presets=function(n){return void 0===n?this.D:(void 0===this.individualPresets[n]&&(this.individualPresets[n]=new du.default(n,this.apiCall)),this.individualPresets[n])},n.prototype.stopwords=function(n){return void 0===n?this.F:(void 0===this.individualStopwords[n]&&(this.individualStopwords[n]=new mu.default(n,this.apiCall)),this.individualStopwords[n])},n.prototype.conversations=function(n){return void 0===n?this.B:(void 0===this.individualConversations[n]&&(this.individualConversations[n]=new wu.default(n,this.apiCall)),this.individualConversations[n])},n}();u.default=yu;var gu={},ku={};Object.defineProperty(ku,"t",{value:!0}),ku.SearchOnlyCollection=void 0;var xu=Je,Ou=function(){function n(n,t,e){this.name=n,this.apiCall=t,this.configuration=e,this.R=new xu.SearchOnlyDocuments(this.name,this.apiCall,this.configuration)}return n.prototype.documents=function(){return this.R},n}();ku.SearchOnlyCollection=Ou;var Su=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(gu,"t",{value:!0});var _u=Su(s),ju=Su(mn),Eu=Su(Li),Ru=ku,Tu=function(){function n(n){var t;n.sendApiKeyAsQueryParam=null===(t=n.sendApiKeyAsQueryParam)||void 0===t||t,!0===n.sendApiKeyAsQueryParam&&(n.apiKey||"").length>2e3&&(n.sendApiKeyAsQueryParam=!1),this.configuration=new _u.default(n),this.apiCall=new ju.default(this.configuration),this.multiSearch=new Eu.default(this.apiCall,this.configuration,!0),this.individualCollections={}}return n.prototype.clearCache=function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEach((function(n){n[0],n[1].documents().clearCache()}))},n.prototype.collections=function(n){if(n)return void 0===this.individualCollections[n]&&(this.individualCollections[n]=new Ru.SearchOnlyCollection(n,this.apiCall,this.configuration)),this.individualCollections[n];throw Error("Typesense.SearchClient only supports search operations, so the collectionName that needs to be searched must be specified. Use Typesense.Client if you need to access the collection object.")},n}();gu.default=Tu;var Pu=n&&n.h||(Object.create?function(n,t,e,r){void 0===r&&(r=e);var i=Object.getOwnPropertyDescriptor(t,e);i&&!("get"in i?!t.t:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(n,r,i)}:function(n,t,e,r){void 0===r&&(r=e),n[r]=t[e]}),Au=n&&n.l||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),Nu=n&&n.v||function(n){if(n&&n.t)return n;var t={};if(null!=n)for(var e in n)"default"!==e&&Object.prototype.hasOwnProperty.call(n,e)&&Pu(t,n,e);return Au(t,n),t},Cu=n&&n.o||function(n){return n&&n.t?n:{default:n}};Object.defineProperty(o,"t",{value:!0}),o.Errors=o.SearchClient=o.Client=void 0;var Mu=Cu(u);o.Client=Mu.default;var Uu=Cu(gu);o.SearchClient=Uu.default;var qu=Nu(h);o.Errors=qu;var Du=o.default={Client:Mu.default,SearchClient:Uu.default,Errors:qu};!function(){let n=!1,t=null;function e(){if(!n)return;const t=document.querySelector("script[data-sodo-search]");t&&t.remove();const e=document.getElementById("sodo-search-root");e&&e.remove()}class r{constructor(t={}){if(n)return window.magicPagesSearch;this.isModalOpen=!1;const e=window.__MP_SEARCH_CONFIG__||{typesenseNodes:[{host:"localhost",port:"8108",protocol:"http"}],typesenseApiKey:null,collectionName:null,commonSearches:[],theme:"system",searchFields:{title:{weight:4,highlight:!0},excerpt:{weight:2,highlight:!0},html:{weight:1,highlight:!0}}};if(this.config={commonSearches:[],...e,...t,commonSearches:t.commonSearches||e.commonSearches||[]},!this.config.typesenseNodes||!this.config.typesenseApiKey||!this.config.collectionName)throw Error("MagicPagesSearch: Missing required Typesense configuration");this.selectedIndex=-1,this.searchDebounceTimeout=null,this.cachedElements={},this.init(),n=!0}getParentAccentColor(){try{return window.getComputedStyle(document.documentElement).getPropertyValue("--ghost-accent-color").trim()||null}catch(n){return null}}updateDarkMode(){const n=window.matchMedia("(prefers-color-scheme: dark)").matches;this.doc&&this.doc.documentElement.classList.toggle("dark",n)}async createIframe(){this.iframe=document.createElement("iframe");const n=window.innerWidth<640?3999999:3999997;this.iframe.style.cssText=`\n border: none;\n width: 100vw;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ${n};\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);\n `,window.addEventListener("resize",(()=>{const n=window.innerWidth<640;this.iframe.style.zIndex=n?3999999:3999997})),document.body||await new Promise((n=>{const t=new MutationObserver((()=>{document.body&&(t.disconnect(),n())}));t.observe(document.documentElement,{childList:!0})})),document.body.appendChild(this.iframe),this.doc=this.iframe.contentDocument||this.iframe.contentWindow.document;const t=this.getParentAccentColor(),e=t?`\n :root {\n --ghost-accent-color: ${t};\n }`:"";this.doc.open(),this.doc.write(`\n <!DOCTYPE html>\n <html>\n <head>\n <style>${e}</style>\n <style>/* Base document styles for iframe */\n:root {\n /* Color system */\n --color-base-50: 255 255 255;\n --color-base-100: 250 250 250;\n --color-base-200: 229 231 235;\n --color-base-300: 209 213 219;\n --color-base-700: 55 65 81;\n --color-base-800: 31 41 55;\n --color-base-900: 17 24 39;\n --color-base-950: 3 7 18;\n\n /* Animation configs */\n --transition-base: 80ms cubic-bezier(0.4, 0, 0.2, 1);\n --transition-smooth: 120ms cubic-bezier(0.4, 0, 0.2, 1);\n --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n}\n\n/* System/Default theme (light) */\n#mp-search-wrapper {\n --color-surface: rgb(252, 252, 252);\n --color-surface-elevated: rgb(255, 255, 255);\n --color-surface-hover: rgba(0, 0, 0, 0.04);\n --color-text: rgb(23, 23, 23);\n --color-text-secondary: rgb(82, 82, 82);\n --color-border: rgba(0, 0, 0, 0.08);\n --color-backdrop: rgba(0, 0, 0, 0.15);\n --accent-color: var(--ghost-accent-color, #6366f1);\n --accent-color-hover: color-mix(in srgb, black 15%, var(--accent-color));\n --color-result-bg: rgb(252, 252, 252);\n --color-result-hover: color-mix(in srgb, var(--accent-color) 8%, transparent);\n}\n\n/* Dark theme based on system preference */\n@media (prefers-color-scheme: dark) {\n #mp-search-wrapper {\n --color-surface: rgb(32, 32, 32);\n --color-surface-elevated: rgb(45, 45, 45);\n --color-surface-hover: rgba(255, 255, 255, 0.04);\n --color-text: rgb(250, 250, 250);\n --color-text-secondary: rgb(161, 161, 161);\n --color-border: rgba(255, 255, 255, 0.08);\n --color-backdrop: rgba(0, 0, 0, 0.4);\n --accent-color: var(--ghost-accent-color, #818cf8);\n --accent-color-hover: color-mix(in srgb, white 15%, var(--accent-color));\n --color-result-bg: rgb(38, 38, 38);\n --color-result-hover: color-mix(in srgb, var(--accent-color) 8%, transparent);\n }\n}\n\n/* Base resets for iframe document */\nhtml,\nbody {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n line-height: 1.5;\n}\n\n/* Utility classes */\n.hidden {\n display: none !important;\n}\n\n/* List reset */\n.list-none {\n list-style: none !important;\n padding-left: 0;\n}\n\n/* Reset InstantSearch cancel button */\n.ais-SearchBox-input[type="search"]::-webkit-search-cancel-button {\n display: none;\n}\n\n/* Modal structure */\n#mp-search-wrapper {\n position: fixed;\n inset: 0;\n width: 100%;\n height: 100%;\n display: flex;\n background-color: var(--color-backdrop);\n backdrop-filter: blur(4px);\n align-items: flex-start;\n justify-content: center;\n -webkit-tap-highlight-color: transparent;\n padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);\n /* Above subscribe button on mobile */\n z-index: 3999999;\n}\n\n@media (min-width: 640px) {\n #mp-search-wrapper {\n /* Below subscribe button on desktop */\n z-index: 3999997;\n }\n}\n\n#mp-search-modal {\n position: fixed;\n inset: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n padding: 0;\n}\n\n@media (min-width: 640px) {\n #mp-search-modal {\n padding-top: 10vh;\n padding-left: 1rem;\n padding-right: 1rem;\n }\n}\n\n#mp-search-modal.hidden {\n display: none;\n}\n\n/* Backdrop with glass effect */\n.mp-backdrop {\n position: fixed;\n inset: 0;\n width: 100%;\n height: 100%;\n backdrop-filter: blur(8px);\n background: var(--color-backdrop);\n transition: opacity var(--transition-smooth);\n}\n\n/* Modal container and content */\n.mp-modal-container {\n position: relative;\n z-index: 1;\n width: 100%;\n max-width: 42rem;\n margin: 0 auto;\n padding: 0;\n height: 100vh;\n display: flex;\n flex-direction: column;\n transition: transform 0.1s ease-out;\n}\n\n@media (min-width: 640px) {\n .mp-modal-container {\n padding: 1.25rem;\n height: auto;\n max-height: 60vh;\n min-height: 20vh;\n }\n}\n\n@media (min-width: 640px) {\n .mp-modal-container {\n padding: 1.25rem;\n }\n}\n\n.mp-modal-content {\n background: var(--color-surface);\n border: none;\n border-radius: 0;\n box-shadow: none;\n overflow: hidden;\n width: 100%;\n position: relative;\n height: 100%;\n display: flex;\n flex-direction: column;\n /* Ensure content doesn't overflow viewport */\n max-height: 100%;\n}\n\n@media (min-width: 640px) {\n .mp-modal-content {\n border: 1px solid var(--color-border);\n border-radius: 0.75rem;\n box-shadow: var(--shadow-lg);\n }\n}\n\n\n\n.mp-results-container {\n overflow-y: auto;\n overscroll-behavior: contain;\n position: relative;\n scroll-behavior: smooth;\n padding: 0.5rem 0;\n -webkit-overflow-scrolling: touch;\n flex: 1;\n min-height: 0;\n background: var(--color-surface);\n}\n\n@media (min-width: 640px) {\n .mp-results-container {\n height: auto;\n max-height: calc(60vh - 4rem);\n padding-bottom: 1rem;\n }\n}\n\n/* Loading state */\n.mp-loading-state {\n display: none;\n padding: 2rem 1.25rem;\n text-align: center;\n color: var(--color-text-secondary);\n}\n\n.mp-loading-state.active {\n display: block;\n}\n\n.mp-loading-spinner {\n display: inline-block;\n width: 2rem;\n height: 2rem;\n margin-bottom: 1rem;\n border: 2px solid var(--color-border);\n border-top-color: var(--accent-color);\n border-radius: 50%;\n animation: mp-spin 0.8s linear infinite;\n}\n\n@keyframes mp-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Search header */\n.mp-search-header {\n align-items: center;\n border-bottom: 1px solid var(--color-border);\n padding: 0.75rem 1.25rem;\n position: relative;\n background: var(--color-surface-elevated);\n display: grid;\n grid-template-columns: 1fr auto;\n align-items: center;\n gap: 1rem;\n}\n\n@media (min-width: 640px) {\n .mp-search-header {\n padding: 0.875rem 1.5rem;\n }\n}\n\n.mp-search-input {\n -webkit-appearance: none;\n background: transparent;\n border-radius: 0.75rem;\n border: none;\n box-shadow: none;\n color: var(--color-text);\n font-size: 1rem;\n height: 2.75rem;\n outline: none;\n padding: 0.75rem 0.75rem 0.75rem 2.75rem;\n width: 100%;\n transition: all var(--transition-smooth);\n background: var(--color-surface);\n letter-spacing: -0.011em;\n}\n\n/* Hide the search clear button */\n.mp-search-input::-webkit-search-cancel-button {\n -webkit-appearance: none;\n display: none;\n}\n\n@media (min-width: 640px) {\n .mp-search-input {\n font-size: 1.125rem;\n height: 3rem;\n padding: 0.875rem 0.875rem 0.875rem 3rem;\n }\n}\n\n.mp-search-input:focus,\n.mp-search-input:focus-visible {\n background: var(--color-surface-hover);\n outline: none;\n box-shadow: none;\n}\n\n.mp-search-input::placeholder {\n color: var(--color-text-secondary);\n opacity: 0.7;\n}\n\n.mp-search-header {\n position: relative;\n padding-right: 4.25rem;\n}\n\n.mp-search-header:before {\n content: "";\n background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='rgb(55, 65, 81)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z' /%3E%3C/svg%3E");\n height: 1.125rem;\n width: 1.125rem;\n position: absolute;\n left: 2rem;\n top: 50%;\n transform: translateY(-50%);\n opacity: 0.7;\n color: var(--color-text);\n pointer-events: none;\n z-index: 1;\n transition: opacity var(--transition-base);\n}\n\n@media (min-width: 640px) {\n .mp-search-header {\n padding-right: 0;\n }\n\n .mp-search-header:before {\n left: 2.4rem;\n top: 50%;\n }\n}\n\n.dark .mp-search-header:before {\n background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='rgb(209, 213, 219)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z' /%3E%3C/svg%3E");\n}\n\n/* Results container */\n.mp-results-container {\n flex: 1;\n overflow-y: auto;\n padding: 0.75rem calc(1.5rem - 6px) 0.75rem 1.5rem;\n scroll-behavior: smooth;\n min-height: 0;\n}\n\n.mp-results-container::-webkit-scrollbar {\n width: 6px;\n}\n\n.mp-results-container::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.mp-results-container::-webkit-scrollbar-thumb {\n background: var(--color-border);\n border-radius: 3px;\n}\n\n.mp-results-container> :last-child {\n margin-bottom: 0.75rem;\n}\n\n/* Common searches */\n.mp-common-searches {\n padding: 0.75rem 0;\n padding-right: 6px;\n margin: 0;\n}\n\n.mp-common-searches.hidden {\n display: none;\n}\n\n.mp-common-searches-title {\n color: var(--color-text-secondary);\n font-size: 0.75rem;\n font-weight: 600;\n letter-spacing: 0.05em;\n margin: 0 0 0.75rem;\n text-transform: uppercase;\n}\n\n.mp-common-search-btn {\n background: transparent;\n border: none;\n color: var(--color-text);\n border-radius: 0.5rem;\n cursor: pointer;\n display: flex;\n align-items: center;\n width: 100%;\n padding: 0.75rem 1rem;\n text-decoration: none;\n transition: all var(--transition-base);\n font-size: 0.875rem;\n text-align: left;\n border: 1px solid transparent;\n}\n\n.mp-common-search-btn:hover,\n.mp-common-search-btn.mp-selected {\n background: var(--color-result-hover);\n border-color: var(--accent-color);\n}\n\n.mp-hits-list {\n margin-block-start: 0.5rem;\n margin-block-end: 0.5rem;\n}\n\n/* Search result link wrapper */\n.mp-result-link {\n text-decoration: none;\n color: inherit;\n display: block;\n}\n\n/* Search results */\n.mp-result-item {\n border-radius: 0.75rem;\n display: block;\n margin: 0.5rem 0;\n padding: 1.25rem;\n text-decoration: none;\n transition: background-color var(--transition-base), transform var(--transition-base);\n border: 1px solid transparent;\n word-break: break-word;\n background: var(--color-result-bg);\n}\n\n.mp-result-link:hover .mp-result-item,\n.mp-result-link.mp-selected .mp-result-item,\n.mp-result-link:focus .mp-result-item {\n background: var(--color-result-hover);\n border-color: var(--accent-color);\n transform: translateX(2px);\n}\n\n.mp-result-title {\n color: var(--accent-color);\n font-size: 1.125rem;\n font-weight: 600;\n line-height: 1.4;\n margin-top: 0;\n margin-bottom: 0.5rem;\n word-break: break-word;\n transition: color var(--transition-base);\n}\n\n.mp-result-excerpt {\n color: var(--color-text-secondary);\n font-size: 0.9375rem;\n line-height: 1.6;\n margin: 0;\n word-break: break-word;\n}\n\n/* Keyboard hints */\n.mp-keyboard-hints {\n display: flex;\n align-items: center;\n font-size: 0.75rem;\n gap: 1rem;\n color: var(--color-text-secondary);\n white-space: nowrap;\n user-select: none;\n margin-right: 0.5rem;\n}\n\n.mp-kbd {\n background: var(--color-surface-elevated);\n border: 1px solid var(--color-border);\n border-radius: 0.375rem;\n color: var(--color-text-secondary);\n font-size: 0.75rem;\n padding: 0.25rem 0.375rem;\n box-shadow: var(--shadow-sm);\n font-size: 0.75rem;\n font-weight: 500;\n padding: 0.25rem 0.5rem;\n box-shadow: var(--shadow-sm);\n margin: 0 0.25rem;\n}\n\n/* Empty state */\n.mp-empty-message {\n color: var(--color-text-secondary);\n font-size: 1rem;\n padding: 2.5rem 1.5rem;\n text-align: center;\n}\n\n/* Close button */\n.mp-close-button {\n position: fixed;\n top: 1.25rem;\n right: 1.5rem;\n width: 2rem;\n height: 2rem;\n border-radius: 9999px;\n border: 1px solid var(--color-border);\n background: var(--color-surface-elevated);\n color: var(--color-text-secondary);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all var(--transition-base);\n font-size: 1.25rem;\n line-height: 1;\n z-index: 50;\n padding: 0;\n}\n\n.mp-close-button:hover {\n background: var(--color-surface-hover);\n color: var(--color-text);\n border-color: var(--accent-color);\n}\n\n.mp-close-button:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--accent-color);\n border-color: var(--accent-color);\n}\n\n/* Highlight styles */\n.ais-Highlight-highlighted,\n.ais-Snippet-highlighted {\n background: none;\n background: color-mix(in srgb, var(--accent-color) 15%, transparent);\n color: color-mix(in srgb, var(--accent-color) 85%, var(--color-text));\n font-weight: 600;\n}\n\n/* Mobile optimizations */\n@media (max-width: 640px) {\n .mp-keyboard-hints {\n display: none;\n }\n\n .mp-modal-content {\n margin-top: 0;\n border-radius: 0;\n height: 100vh;\n }\n\n .mp-modal-container {\n padding: 0;\n margin: 0;\n }\n\n .mp-results-container {\n padding-bottom: 1.5rem;\n max-height: calc(100vh - 4rem);\n }\n}</style>\n </head>\n <body>\n <div id="mp-search-wrapper" data-theme="${this.config.theme}">\n <div id="mp-search-modal" class="hidden" role="dialog" aria-modal="true" aria-label="Search">\n <div class="mp-backdrop"></div>\n <div class="mp-modal-container">\n <button class="mp-close-button" aria-label="Close search">\n <span aria-hidden="true">×</span>\n </button>\n <div class="mp-modal-content">\n <div class="mp-search-header">\n <div id="mp-searchbox" role="search"></div>\n <div class="mp-keyboard-hints">\n <span>\n <kbd class="mp-kbd">↑↓</kbd>\n to navigate\n </span>\n <span>\n <kbd class="mp-kbd">esc</kbd>\n to close\n </span>\n </div>\n </div>\n <div class="mp-results-container">\n ${this.getCommonSearchesHtml()}\n <div id="mp-hits" role="region" aria-label="Search results"></div>\n <div id="mp-loading-state" class="mp-loading-state" role="status" aria-live="polite">\n <div class="mp-loading-spinner" aria-hidden="true"></div>\n <div>Searching...</div>\n </div>\n <div id="mp-empty-state" class="hidden" role="status" aria-live="polite">\n <div class="mp-empty-message">\n <p>No results found for your search</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </body>\n </html>\n `),this.doc.close(),this.modal=this.doc.getElementById("mp-search-modal"),this.wrapper=this.doc.getElementById("mp-search-wrapper"),this.cachedElements={modal:this.modal,wrapper:this.wrapper},this.updateDarkMode(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(()=>{this.updateDarkMode()})),new MutationObserver((()=>{this.updateDarkMode()})).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),window.visualViewport&&window.visualViewport.addEventListener("resize",(()=>{if(this.modal&&this.modal.classList.contains("hidden"))return;const n=this.doc.querySelector(".mp-modal-container");n&&(n.style.height=window.visualViewport.height+"px",n.style.transform=`translateY(${window.visualViewport.offsetTop}px)`)}))}getCommonSearchesHtml(){return this.config.commonSearches?.length?`\n <div class="mp-common-searches">\n <div class="mp-common-searches-title" role="heading" aria-level="2">\n Common searches\n </div>\n <div id="mp-common-searches-container" role="list">\n ${this.config.commonSearches.map((n=>`\n <button type="button" \n class="mp-common-search-btn" \n data-search="${n}"\n role="listitem">\n ${n}\n </button>\n `)).join("")}\n </div>\n </div>\n `:'\n <div class="mp-common-searches">\n <div class="mp-empty-message">Start typing to search...</div>\n </div>\n '}getSearchParameters(){const n=Object.keys(this.config.searchFields||{}).length>0?this.config.searchFields:{title:{weight:4,highlight:!0},excerpt:{weight:2,highlight:!0},html:{weight:1,highlight:!0}},t=[],e=[],r=[];return Object.entries(n).forEach((([n,i])=>{t.push(n),e.push(i.weight||1),i.highlight&&r.push(n)})),{query_by:t.join(","),query_by_weights:e.join(","),highlight_full_fields:r.join(","),highlight_affix_num_tokens:20,include_fields:"title,url,excerpt,html",typo_tolerance:!0,num_typos:2,prefix:!0,per_page:10}}async init(){await this.setupUI(),await this.setupSearch(),this.initEventListeners(),this.setupHashHandling(),await this.handleInitialState()}async setupUI(){this.createIframe(),this.handleThemeChange()}async setupSearch(){await this.initSearch()}setupHashHandling(){window.addEventListener("hashchange",(()=>this.syncWithHash()))}async handleInitialState(){await this.syncWithHash()}async syncWithHash(){const n="#/search"===window.location.hash;n!==this.isModalOpen&&await this.setModalState(n)}initSearch(){this.initWidgets(),this.searchInput&&(this.cachedElements.commonSearches=this.doc.querySelector(".mp-common-searches"),this.cachedElements.loadingState=this.doc.getElementById("mp-loading-state"))}async handleSearch(n){const{commonSearches:t,emptyState:e,loadingState:r}=this.cachedElements;if(n=n?.trim(),!n)return this.selectedIndex=-1,this.hitsList&&this.hitsList.classList.add("hidden"),t&&t.classList.remove("hidden"),e&&e.classList.add("hidden"),void(r&&r.classList.remove("active"));t&&t.classList.add("hidden"),this.hitsList&&this.hitsList.classList.remove("hidden"),r&&r.classList.add("active");try{this.typesenseClient||(this.typesenseClient=new Du.Client({nodes:this.config.typesenseNodes,apiKey:this.config.typesenseApiKey,connectionTimeoutSeconds:2}));const t=this.getSearchParameters(),i={q:n,query_by:t.query_by,query_by_weights:t.query_by_weights,highlight_full_fields:t.highlight_full_fields,highlight_affix_num_tokens:t.highlight_affix_num_tokens,include_fields:t.include_fields,typo_tolerance:t.typo_tolerance,num_typos:t.num_typos,prefix:t.prefix,per_page:t.per_page},o=await this.typesenseClient.collections(this.config.collectionName).documents().search(i);if(r&&r.classList.remove("active"),0===o.hits.length)return e&&e.classList.remove("hidden"),void(this.hitsList&&(this.hitsList.innerHTML="",this.hitsList.classList.add("hidden")));e&&e.classList.add("hidden"),this.hitsList&&(this.hitsList.innerHTML=o.hits.map((n=>{const t=document.createElement("div");t.innerHTML=n.document.excerpt||n.document.html||"";const e=(t.textContent||t.innerText||"").trim().substring(0,120).replace(/\s+[^\s]*$/,"..."),r=n.document.title||"Untitled";return`\n <a href="${n.document.url||"#"}" \n class="mp-result-link"\n aria-label="${r.replace(/<[^>]*>/g,"")}">\n <article class="mp-result-item" role="article">\n <h3 class="mp-result-title" role="heading" aria-level="3">${r}</h3>\n <p class="mp-result-excerpt" aria-label="Article excerpt">${e}</p>\n </article>\n </a>\n `})).join(""),this.hitsList.classList.remove("hidden"))}catch(n){r&&r.classList.remove("active"),e&&e.classList.remove("hidden"),this.hitsList&&(this.hitsList.innerHTML="",this.hitsList.classList.add("hidden"))}}initWidgets(){const n=this.doc.querySelector("#mp-searchbox");if(!n)return;n.innerHTML="";const t=this.doc.createElement("form");t.className="",t.setAttribute("novalidate",""),t.setAttribute("role","search");const e=this.doc.createElement("input");e.type="search",e.placeholder="Search for anything",e.className="mp-search-input",e.setAttribute("autocomplete","off"),e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false"),e.setAttribute("maxlength","512"),e.setAttribute("aria-label","Search"),t.appendChild(e),n.appendChild(t),this.searchInput=e,setTimeout((()=>e.focus()),0),t.addEventListener("submit",(n=>{n.preventDefault()})),e.addEventListener("input",(n=>{const t=n.target.value;this.searchDebounceTimeout&&clearTimeout(this.searchDebounceTimeout),this.searchDebounceTimeout=setTimeout((()=>{this.handleSearch(t)}),80)})),this.searchInput=e,this.searchForm=t;const r=this.doc.querySelector("#mp-hits");if(!r)return;const i=this.doc.createElement("div");i.className="mp-hits-list list-none",r.appendChild(i),this.hitsList=i}initEventListeners(){const n=this.doc.querySelector(".mp-close-button");n&&n.addEventListener("click",(()=>this.closeModal())),this.modal.addEventListener("click",(n=>{(n.target===this.modal||n.target.classList.contains("mp-backdrop"))&&this.closeModal()}));const t=this.modal.querySelector(".mp-modal-content");t&&t.addEventListener("click",(n=>n.stopPropagation())),this.attachCommonSearchListeners(),document.addEventListener("keydown",(n=>{(n.metaKey||n.ctrlKey)&&"k"===n.key&&(n.preventDefault(),this.openModal()),"/"!==n.key||n.ctrlKey||n.metaKey||"INPUT"===n.target.tagName||"TEXTAREA"===n.target.tagName||(n.preventDefault(),this.openModal())})),this.doc.addEventListener("keydown",(n=>this.handleKeydown(n))),document.querySelectorAll("[data-ghost-search]").forEach((n=>{n.addEventListener("click",(n=>{n.preventDefault(),n.stopPropagation(),this.openModal()}))}));const e=this.doc.querySelector("#mp-hits");e&&e.addEventListener("click",(n=>{const t=n.target.closest(".mp-result-link");t&&(n.preventDefault(),window.location.href=t.href)}))}attachCommonSearchListeners(){const n=this.doc.getElementById("mp-common-searches-container");if(!n)return;const t=n=>{const t=n.target.closest(".mp-common-search-btn");if(!t)return;n.preventDefault();const e=t.dataset.search,r=this.doc.querySelector(".mp-search-input");r&&(this.selectedIndex=-1,r.value=e,r.dispatchEvent(new Event("input",{bubbles:!0})),this.search.helper.setQuery(e).search(),setTimeout((()=>{r.focus(),r.setSelectionRange(e.length,e.length)}),0))};n.addEventListener("click",t),n.addEventListener("touchend",t)}async setModalState(n,t={}){const{skipUrlUpdate:e=!1}=t;if(n&&!this.searchUI&&await this.initSearch(),n&&(await new Promise((n=>{const t=()=>{this.iframe&&this.doc&&"complete"===this.doc.readyState?n():setTimeout(t,10)};t()})),await new Promise((n=>setTimeout(n,50)))),this.iframe.style.pointerEvents=n?"auto":"none",this.iframe.style.opacity=n?"1":"0",this.modal.classList.toggle("hidden",!n),n){const n=this.doc.querySelector(".mp-search-input");n&&n.focus()}else this.selectedIndex=-1,this.searchInput&&(this.searchInput.value=""),this.handleSearch("");if(!e){const t=n?"#/search":"";window.location.hash!==t&&history.replaceState(null,null,t||window.location.pathname)}}async openModal(){await this.setModalState(!0)}closeModal(){this.setModalState(!1)}handleKeydown(n){if("Escape"===n.key)return n.preventDefault(),void this.closeModal();if(n.target===this.searchInput&&!(window.innerWidth<640))switch(n.key){case"ArrowDown":n.preventDefault(),this.navigateResults("next");break;case"ArrowUp":n.preventDefault(),this.navigateResults("prev");break;case"Enter":-1!==this.selectedIndex&&(n.preventDefault(),this.handleEnterKey())}}navigateResults(n){const t=[...this.doc.querySelectorAll(".mp-result-link, .mp-common-search-btn:not(.hidden)")].filter((n=>null!==n.offsetParent&&!n.closest(".hidden")));if(0===t.length)return;-1===this.selectedIndex?this.selectedIndex="next"===n?0:t.length-1:this.selectedIndex="next"===n?(this.selectedIndex+1)%t.length:(this.selectedIndex-1+t.length)%t.length,t.forEach((n=>n.classList.remove("mp-selected")));const e=t[this.selectedIndex];e.classList.add("mp-selected"),e.scrollIntoView({block:"nearest",behavior:"auto"})}handleEnterKey(){const n=[...this.doc.querySelectorAll(".mp-result-link, .mp-common-search-btn:not(.hidden)")].filter((n=>null!==n.offsetParent&&!n.closest(".hidden")));if(this.selectedIndex>=0&&this.selectedIndex<n.length){const t=n[this.selectedIndex];t.classList.contains("mp-result-link")?window.location.href=t.href:(this.searchInput.value=t.textContent.trim(),this.searchInput.dispatchEvent(new Event("input",{bubbles:!0})))}}handleThemeChange(){if(!this.wrapper)return;const n=n=>{this.wrapper.classList.toggle("dark",n)};switch(this.wrapper.classList.remove("dark"),this.config.theme){case"dark":n(!0);break;case"light":n(!1);break;default:const t=window.matchMedia("(prefers-color-scheme: dark)");n(t.matches),t.addEventListener("change",(t=>n(t.matches)))}}}function i(){!window.magicPagesSearch&&(window.__MP_SEARCH_CONFIG__||"#/search"===window.location.hash||document.querySelectorAll("[data-ghost-search]").length>0)&&(window.magicPagesSearch=new r,function(){t=new MutationObserver((t=>{if(n)for(const n of t)for(const t of n.addedNodes)1===t.nodeType&&("SCRIPT"===t.tagName&&t.hasAttribute("data-sodo-search")||"sodo-search-root"===t.id)&&t.remove()})),t.observe(document.documentElement,{childList:!0,subtree:!0});const r=setInterval(e,100);setTimeout((()=>{clearInterval(r),t&&(t.disconnect(),t=null)}),5e3)}())}window.MagicPagesSearch=r,new Promise((n=>{if(document.body)n();else{const t=new MutationObserver((()=>{document.body&&(t.disconnect(),n())}));t.observe(document.documentElement,{childList:!0})}})).then(i),"loading"===document.readyState&&document.addEventListener("DOMContentLoaded",i)}()}();
|