@findhotel/sapi 0.23.5 → 0.23.6

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/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).sapi=t()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return n(null==t&&r.path)}},r.exports),r.exports}function r(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}function n(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};var a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var i=Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function u(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function c(e){return this instanceof c?(this.v=e,this):new c(e)}var l=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var f=Object.freeze({__proto__:null,__extends:function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},get __assign(){return a},__rest:function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},__decorate:function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},__param:function(e,t){return function(r,n){t(r,n,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}s((n=n.apply(e,t||[])).next())}))},__generator:function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},__createBinding:i,__exportStar:function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},__values:u,__read:s,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,u=a.length;i<u;i++,o++)n[o]=a[i];return n},__await:c,__asyncGenerator:function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),a=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){a.push([e,t,r,n])>1||u(e,t)}))})}function u(e,t){try{!function(e){e.value instanceof c?Promise.resolve(e.value.v).then(s,l):f(a[0][2],e)}(o[e](t))}catch(e){f(a[0][3],e)}}function s(e){u("next",e)}function l(e){u("throw",e)}function f(e,t){e(t),a.shift(),a.length&&u(a[0][0],a[0][1])}},__asyncDelegator:function(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:c(e[n](t)),done:"return"===n}:o?o(t):t}:o}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=u(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return l(t,e),t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},__classPrivateFieldSet:function(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}}),d=t((function(e,t){e.exports=function(){function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}function n(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e){var t,r="algoliasearch-client-js-".concat(e.key),n=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},a=function(){return JSON.parse(n().getItem(r)||"{}")};return{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var r=JSON.stringify(e),n=a()[r];return Promise.all([n||t(),void 0!==n])})).then((function(e){var t=o(e,2),n=t[0],a=t[1];return Promise.all([n,a||r.miss(n)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var o=a();return o[JSON.stringify(e)]=t,n().setItem(r,JSON.stringify(o)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function u(e){var t=a(e.caches),r=t.shift();return void 0===r?{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,r.miss(e)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(e,n,o).catch((function(){return u({caches:t}).get(e,n,o)}))},set:function(e,n){return r.set(e,n).catch((function(){return u({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return u({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return u({caches:t}).clear()}))}}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var i=n(),u=o&&o.miss||function(){return Promise.resolve()};return i.then((function(e){return u(e)})).then((function(){return i}))},set:function(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function c(e,t,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:function(){return e===g.WithinHeaders?n:{}},queryParameters:function(){return e===g.WithinQueryParameters?n:{}}}}function l(e){var t=0;return e((function r(){return t++,new Promise((function(n){setTimeout((function(){n(e(r))}),Math.min(100*t,1e3))}))}))}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return Promise.resolve()};return Object.assign(e,{wait:function(r){return f(e.then((function(e){return Promise.all([t(e,r),e])})).then((function(e){return e[1]})))}})}function d(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function h(e,t){return t?(Object.keys(t).forEach((function(r){e[r]=t[r](e)})),e):e}function p(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=0;return e.replace(/%s/g,(function(){return encodeURIComponent(r[o++])}))}var g={WithinQueryParameters:0,WithinHeaders:1};function v(e,t){var r=e||{},n=r.data||{};return Object.keys(r).forEach((function(e){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])})),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var y={Read:1,Write:2,Any:3},m=1,b=2,_=3;function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;return r(r({},e),{},{status:t,lastUpdate:Date.now()})}function O(e){return"string"==typeof e?{protocol:"https",url:e,accept:y.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||y.Any}}var T="DELETE",I="GET",S="POST",x="PUT";function P(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(w(t))}))}))).then((function(e){var r=e.filter((function(e){return function(e){return e.status===m||Date.now()-e.lastUpdate>12e4}(e)})),n=e.filter((function(e){return function(e){return e.status===_&&Date.now()-e.lastUpdate<=12e4}(e)})),o=[].concat(a(r),a(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return O(e)})):t}}))}function E(e,t,n,o){var i=[],u=function(e,t){if(e.method!==I&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:r(r({},e.data),t.data);return JSON.stringify(n)}}(n,o),s=function(e,t){var n=r(r({},e.headers),t.headers),o={};return Object.keys(n).forEach((function(e){var t=n[e];o[e.toLowerCase()]=t})),o}(e,o),c=n.method,l=n.method!==I?{}:r(r({},n.data),o.data),f=r(r(r({"x-algolia-agent":e.userAgent.value},e.queryParameters),l),o.queryParameters),d=0,h=function t(r,a){var l=r.pop();if(void 0===l)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:A(i)};var h={data:u,headers:s,method:c,url:C(l,n.path,f),connectTimeout:a(d,e.timeouts.connect),responseTimeout:a(d,o.timeout)},p=function(e){var t={request:h,response:e,host:l,triesLeft:r.length};return i.push(t),t},g={onSucess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var o=p(n);return n.isTimedOut&&d++,Promise.all([e.logger.info("Retryable failure",R(o)),e.hostsCache.set(l,w(l,n.isTimedOut?_:b))]).then((function(){return t(r,a)}))},onFail:function(e){throw p(e),function(e,t){var r=e.content,n=e.status,o=r;try{o=JSON.parse(r).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(o,n,t)}(e,A(i))}};return e.requester.send(h).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,r=e.status;return!t&&0==~~r}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSucess(e):t.onFail(e)}(e,g)}))};return P(e.hostsCache,t).then((function(e){return h(a(e.statelessHosts).reverse(),e.getTimeout)}))}function k(e){var t=e.hostsCache,r=e.logger,n=e.requester,a=e.requestsCache,i=e.responsesCache,u=e.timeouts,s=e.userAgent,c=e.hosts,l=e.queryParameters,f={hostsCache:t,logger:r,requester:n,requestsCache:a,responsesCache:i,timeouts:u,userAgent:s,headers:e.headers,queryParameters:l,hosts:c.map((function(e){return O(e)})),read:function(e,t){var r=v(t,f.timeouts.read),n=function(){return E(f,f.hosts.filter((function(e){return 0!=(e.accept&y.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var a={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(a,(function(){return f.requestsCache.get(a,(function(){return f.requestsCache.set(a,n()).then((function(e){return Promise.all([f.requestsCache.delete(a),e])}),(function(e){return Promise.all([f.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=o(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(a,e)}})},write:function(e,t){return E(f,f.hosts.filter((function(e){return 0!=(e.accept&y.Write)})),e,v(t,f.timeouts.write))}};return f}function j(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var r="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(r)&&(t.value="".concat(t.value).concat(r)),t}};return t}function C(e,t,r){var n=D(r),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(o+="?".concat(n)),o}function D(e){return Object.keys(e).map((function(t){return p("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function A(e){return e.map((function(e){return R(e)}))}function R(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return r(r({},e),{},{request:r(r({},e.request),{},{headers:r(r({},e.request.headers),t)})})}var N=function(e){return function(t,r){return e.transporter.write({method:S,path:"2/abtests",data:t},r)}},M=function(e){return function(t,r){return e.transporter.write({method:T,path:p("2/abtests/%s",t)},r)}},U=function(e){return function(t,r){return e.transporter.read({method:I,path:p("2/abtests/%s",t)},r)}},B=function(e){return function(t){return e.transporter.read({method:I,path:"2/abtests"},t)}},L=function(e){return function(t,r){return e.transporter.write({method:S,path:p("2/abtests/%s/stop",t)},r)}},q=function(e){return function(t){return e.transporter.read({method:I,path:"1/strategies/personalization"},t)}},F=function(e){return function(t,r){return e.transporter.write({method:S,path:"1/strategies/personalization",data:t},r)}};function H(e){return function t(r){return e.request(r).then((function(n){if(void 0!==e.batch&&e.batch(n.hits),!e.shouldStop(n))return n.cursor?t({cursor:n.cursor}):t({page:(r.page||0)+1})}))}({})}var W=function(e){return function(t,o){var a=o||{},i=a.queryParameters,u=n(a,["queryParameters"]),s=r({acl:t},void 0!==i?{queryParameters:i}:{});return f(e.transporter.write({method:S,path:"1/keys",data:s},u),(function(t,r){return l((function(n){return X(e)(t.key,r).catch((function(e){if(404!==e.status)throw e;return n()}))}))}))}},z=function(e){return function(t,r,n){var o=v(n);return o.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:S,path:"1/clusters/mapping",data:{cluster:r}},o)}},Y=function(e){return function(t,r,n){return e.transporter.write({method:S,path:"1/clusters/mapping/batch",data:{users:t,cluster:r}},n)}},K=function(e){return function(t,r,n){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:"copy",destination:r}},n),(function(r,n){return re(e)(t,{methods:{waitTask:tt}}).waitTask(r.taskID,n)}))}},V=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Rules]}))}},G=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Settings]}))}},J=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Synonyms]}))}},Q=function(e){return function(t,r){return f(e.transporter.write({method:T,path:p("1/keys/%s",t)},r),(function(r,n){return l((function(r){return X(e)(t,n).then(r).catch((function(e){if(404!==e.status)throw e}))}))}))}},X=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/keys/%s",t)},r)}},$=function(e){return function(t){return e.transporter.read({method:I,path:"1/logs"},t)}},Z=function(e){return function(t){return e.transporter.read({method:I,path:"1/clusters/mapping/top"},t)}},ee=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/clusters/mapping/%s",t)},r)}},te=function(e){return function(t){var r=t||{},o=r.retrieveMappings,a=n(r,["retrieveMappings"]);return!0===o&&(a.getClusters=!0),e.transporter.read({method:I,path:"1/clusters/mapping/pending"},a)}},re=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h({transporter:e.transporter,appId:e.appId,indexName:t},r.methods)}},ne=function(e){return function(t){return e.transporter.read({method:I,path:"1/keys"},t)}},oe=function(e){return function(t){return e.transporter.read({method:I,path:"1/clusters"},t)}},ae=function(e){return function(t){return e.transporter.read({method:I,path:"1/indexes"},t)}},ie=function(e){return function(t){return e.transporter.read({method:I,path:"1/clusters/mapping"},t)}},ue=function(e){return function(t,r,n){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:"move",destination:r}},n),(function(r,n){return re(e)(t,{methods:{waitTask:tt}}).waitTask(r.taskID,n)}))}},se=function(e){return function(t,r){return f(e.transporter.write({method:S,path:"1/indexes/*/batch",data:{requests:t}},r),(function(t,r){return Promise.all(Object.keys(t.taskID).map((function(n){return re(e)(n,{methods:{waitTask:tt}}).waitTask(t.taskID[n],r)})))}))}},ce=function(e){return function(t,r){return e.transporter.read({method:S,path:"1/indexes/*/objects",data:{requests:t}},r)}},le=function(e){return function(t,n){var o=t.map((function(e){return r(r({},e),{},{params:D(e.params||{})})}));return e.transporter.read({method:S,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},n)}},fe=function(e){return function(t,o){return Promise.all(t.map((function(t){var a=t.params,i=a.facetName,u=a.facetQuery,s=n(a,["facetName","facetQuery"]);return re(e)(t.indexName,{methods:{searchForFacetValues:Xe}}).searchForFacetValues(i,u,r(r({},o),s))})))}},de=function(e){return function(t,r){var n=v(r);return n.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:T,path:"1/clusters/mapping"},n)}},he=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/keys/%s/restore",t)},r),(function(r,n){return l((function(r){return X(e)(t,n).catch((function(e){if(404!==e.status)throw e;return r()}))}))}))}},pe=function(e){return function(t,r){return e.transporter.read({method:S,path:"1/clusters/mapping/search",data:{query:t}},r)}},ge=function(e){return function(t,r){var o=Object.assign({},r),a=r||{},i=a.queryParameters,u=n(a,["queryParameters"]),s=i?{queryParameters:i}:{},c=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(e.transporter.write({method:x,path:p("1/keys/%s",t),data:s},u),(function(r,n){return l((function(r){return X(e)(t,n).then((function(e){return function(e){return Object.keys(o).filter((function(e){return-1!==c.indexOf(e)})).every((function(t){return e[t]===o[t]}))}(e)?Promise.resolve():r()}))}))}))}},ve=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/indexes/%s/batch",e.indexName),data:{requests:t}},r),(function(t,r){return tt(e)(t.taskID,r)}))}},ye=function(e){return function(t){return H(r(r({shouldStop:function(e){return void 0===e.cursor}},t),{},{request:function(r){return e.transporter.read({method:S,path:p("1/indexes/%s/browse",e.indexName),data:r},t)}}))}},me=function(e){return function(t){var n=r({hitsPerPage:1e3},t);return H(r(r({shouldStop:function(e){return e.hits.length<n.hitsPerPage}},n),{},{request:function(t){return $e(e)("",r(r({},n),t)).then((function(e){return r(r({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},be=function(e){return function(t){var n=r({hitsPerPage:1e3},t);return H(r(r({shouldStop:function(e){return e.hits.length<n.hitsPerPage}},n),{},{request:function(t){return Ze(e)("",r(r({},n),t)).then((function(e){return r(r({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},_e=function(e){return function(t,r,o){var a=o||{},i=a.batchSize,u=n(a,["batchSize"]),s={taskIDs:[],objectIDs:[]};return f(function n(){var o,a=[];for(o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;o<t.length&&(a.push(t[o]),a.length!==(i||1e3));o++);return 0===a.length?Promise.resolve(s):ve(e)(a.map((function(e){return{action:r,body:e}})),u).then((function(e){return s.objectIDs=s.objectIDs.concat(e.objectIDs),s.taskIDs.push(e.taskID),o++,n(o)}))}(),(function(t,r){return Promise.all(t.taskIDs.map((function(t){return tt(e)(t,r)})))}))}},we=function(e){return function(t){return f(e.transporter.write({method:S,path:p("1/indexes/%s/clear",e.indexName)},t),(function(t,r){return tt(e)(t.taskID,r)}))}},Oe=function(e){return function(t){var r=t||{},o=r.forwardToReplicas,a=v(n(r,["forwardToReplicas"]));return o&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/rules/clear",e.indexName)},a),(function(t,r){return tt(e)(t.taskID,r)}))}},Te=function(e){return function(t){var r=t||{},o=r.forwardToReplicas,a=v(n(r,["forwardToReplicas"]));return o&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/synonyms/clear",e.indexName)},a),(function(t,r){return tt(e)(t.taskID,r)}))}},Ie=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/indexes/%s/deleteByQuery",e.indexName),data:t},r),(function(t,r){return tt(e)(t.taskID,r)}))}},Se=function(e){return function(t){return f(e.transporter.write({method:T,path:p("1/indexes/%s",e.indexName)},t),(function(t,r){return tt(e)(t.taskID,r)}))}},xe=function(e){return function(t,r){return f(Pe(e)([t],r).then((function(e){return{taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},Pe=function(e){return function(t,r){var n=t.map((function(e){return{objectID:e}}));return _e(e)(n,rt.DeleteObject,r)}},Ee=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=v(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:T,path:p("1/indexes/%s/rules/%s",e.indexName,t)},i),(function(t,r){return tt(e)(t.taskID,r)}))}},ke=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=v(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:T,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},i),(function(t,r){return tt(e)(t.taskID,r)}))}},je=function(e){return function(t){return Ue(e)(t).then((function(){return!0})).catch((function(e){if(404!==e.status)throw e;return!1}))}},Ce=function(e){return function(t,r,n){return e.transporter.read({method:S,path:p("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n)}},De=function(e){return function(t,a){var i=a||{},u=i.query,s=i.paginate,c=n(i,["query","paginate"]),l=0;return function n(){return Qe(e)(u||"",r(r({},c),{},{page:l})).then((function(e){for(var r=0,a=Object.entries(e.hits);r<a.length;r++){var i=o(a[r],2),u=i[0],c=i[1];if(t(c))return{object:c,position:parseInt(u,10),page:l}}if(l++,!1===s||l>=e.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return n()}))}()}},Ae=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/indexes/%s/%s",e.indexName,t)},r)}},Re=function(){return function(e,t){for(var r=0,n=Object.entries(e.hits);r<n.length;r++){var a=o(n[r],2),i=a[0];if(a[1].objectID===t)return parseInt(i,10)}return-1}},Ne=function(e){return function(t,o){var a=o||{},i=a.attributesToRetrieve,u=n(a,["attributesToRetrieve"]),s=t.map((function(t){return r({indexName:e.indexName,objectID:t},i?{attributesToRetrieve:i}:{})}));return e.transporter.read({method:S,path:"1/indexes/*/objects",data:{requests:s}},u)}},Me=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/indexes/%s/rules/%s",e.indexName,t)},r)}},Ue=function(e){return function(t){return e.transporter.read({method:I,path:p("1/indexes/%s/settings",e.indexName),data:{getVersion:2}},t)}},Be=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},r)}},Le=function(e){return function(t,r){return f(qe(e)([t],r).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},qe=function(e){return function(t,r){var o=r||{},a=o.createIfNotExists,i=n(o,["createIfNotExists"]),u=a?rt.PartialUpdateObject:rt.PartialUpdateObjectNoCreate;return _e(e)(t,u,i)}},Fe=function(e){return function(t,i){var u=i||{},s=u.safe,c=u.autoGenerateObjectIDIfNotExist,l=u.batchSize,d=n(u,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),h=function(t,r,n,o){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:n,destination:r}},o),(function(t,r){return tt(e)(t.taskID,r)}))},g=Math.random().toString(36).substring(7),v="".concat(e.indexName,"_tmp_").concat(g),y=Ye({appId:e.appId,transporter:e.transporter,indexName:v}),m=[],b=h(e.indexName,v,"copy",r(r({},d),{},{scope:["settings","synonyms","rules"]}));return m.push(b),f((s?b.wait(d):b).then((function(){var e=y(t,r(r({},d),{},{autoGenerateObjectIDIfNotExist:c,batchSize:l}));return m.push(e),s?e.wait(d):e})).then((function(){var t=h(v,e.indexName,"move",d);return m.push(t),s?t.wait(d):t})).then((function(){return Promise.all(m)})).then((function(e){var t=o(e,3),r=t[0],n=t[1],i=t[2];return{objectIDs:n.objectIDs,taskIDs:[r.taskID].concat(a(n.taskIDs),[i.taskID])}})),(function(e,t){return Promise.all(m.map((function(e){return e.wait(t)})))}))}},He=function(e){return function(t,n){return Ve(e)(t,r(r({},n),{},{clearExistingRules:!0}))}},We=function(e){return function(t,n){return Je(e)(t,r(r({},n),{},{clearExistingSynonyms:!0}))}},ze=function(e){return function(t,r){return f(Ye(e)([t],r).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},Ye=function(e){return function(t,r){var o=r||{},a=o.autoGenerateObjectIDIfNotExist,i=n(o,["autoGenerateObjectIDIfNotExist"]),u=a?rt.AddObject:rt.UpdateObject;if(u===rt.UpdateObject){var s=!0,c=!1,l=void 0;try{for(var d,h=t[Symbol.iterator]();!(s=(d=h.next()).done);s=!0)if(void 0===d.value.objectID)return f(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(e){c=!0,l=e}finally{try{s||null==h.return||h.return()}finally{if(c)throw l}}}return _e(e)(t,u,i)}},Ke=function(e){return function(t,r){return Ve(e)([t],r)}},Ve=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=o.clearExistingRules,u=v(n(o,["forwardToReplicas","clearExistingRules"]));return a&&(u.queryParameters.forwardToReplicas=1),i&&(u.queryParameters.clearExistingRules=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/rules/batch",e.indexName),data:t},u),(function(t,r){return tt(e)(t.taskID,r)}))}},Ge=function(e){return function(t,r){return Je(e)([t],r)}},Je=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=o.clearExistingSynonyms,u=o.replaceExistingSynonyms,s=v(n(o,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return a&&(s.queryParameters.forwardToReplicas=1),(u||i)&&(s.queryParameters.replaceExistingSynonyms=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/synonyms/batch",e.indexName),data:t},s),(function(t,r){return tt(e)(t.taskID,r)}))}},Qe=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},Xe=function(e){return function(t,r,n){return e.transporter.read({method:S,path:p("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},$e=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/rules/search",e.indexName),data:{query:t}},r)}},Ze=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/synonyms/search",e.indexName),data:{query:t}},r)}},et=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=v(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:x,path:p("1/indexes/%s/settings",e.indexName),data:t},i),(function(t,r){return tt(e)(t.taskID,r)}))}},tt=function(e){return function(t,r){return l((function(n){return function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/indexes/%s/task/%s",e.indexName,t.toString())},r)}}(e)(t,r).then((function(e){return"published"!==e.status?n():void 0}))}))}},rt={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},nt={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},ot=1,at=2,it=3;function ut(e,t,n){var o,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return r.setRequestHeader(t,e.headers[t])}));var n,o=function(e,n){return setTimeout((function(){r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e)},a=o(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=o(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(o=it,{debug:function(e,t){return ot>=o&&console.debug(e,t),Promise.resolve()},info:function(e,t){return at>=o&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:u({caches:[i({key:"".concat("4.8.0","-").concat(e)}),s()]}),userAgent:j("4.8.0").add({segment:"Browser"})};return function(e){var t=e.appId,n=c(void 0!==e.authMode?e.authMode:g.WithinHeaders,t,e.apiKey),o=k(r(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:y.Read},{url:"".concat(t,".algolia.net"),accept:y.Write}].concat(d([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({transporter:o,appId:t,addAlgoliaAgent:function(e,t){o.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then((function(){}))}},e.methods)}(r(r(r({},a),n),{},{methods:{search:le,searchForFacetValues:fe,multipleBatch:se,multipleGetObjects:ce,multipleQueries:le,copyIndex:K,copySettings:G,copySynonyms:J,copyRules:V,moveIndex:ue,listIndices:ae,getLogs:$,listClusters:oe,multipleSearchForFacetValues:fe,getApiKey:X,addApiKey:W,listApiKeys:ne,updateApiKey:ge,deleteApiKey:Q,restoreApiKey:he,assignUserID:z,assignUserIDs:Y,getUserID:ee,searchUserIDs:pe,listUserIDs:ie,getTopUserIDs:Z,removeUserID:de,hasPendingMappings:te,initIndex:function(e){return function(t){return re(e)(t,{methods:{batch:ve,delete:Se,findAnswers:Ce,getObject:Ae,getObjects:Ne,saveObject:ze,saveObjects:Ye,search:Qe,searchForFacetValues:Xe,waitTask:tt,setSettings:et,getSettings:Ue,partialUpdateObject:Le,partialUpdateObjects:qe,deleteObject:xe,deleteObjects:Pe,deleteBy:Ie,clearObjects:we,browseObjects:ye,getObjectPosition:Re,findObject:De,exists:je,saveSynonym:Ge,saveSynonyms:Je,getSynonym:Be,searchSynonyms:Ze,browseSynonyms:be,deleteSynonym:ke,clearSynonyms:Te,replaceAllObjects:Fe,replaceAllSynonyms:We,searchRules:$e,getRule:Me,deleteRule:Ee,saveRule:Ke,saveRules:Ve,replaceAllRules:He,browseRules:me,clearRules:Oe}})}},initAnalytics:function(){return function(e){return function(e){var t=e.region||"us",n=c(g.WithinHeaders,e.appId,e.apiKey),o=k(r(r({hosts:[{url:"analytics.".concat(t,".algolia.com")}]},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/json"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(r(r(r({},a),e),{},{methods:{addABTest:N,getABTest:U,getABTests:B,stopABTest:L,deleteABTest:M}}))}},initRecommendation:function(){return function(e){return function(e){var t=e.region||"us",n=c(g.WithinHeaders,e.appId,e.apiKey),o=k(r(r({hosts:[{url:"recommendation.".concat(t,".algolia.com")}]},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/json"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(r(r(r({},a),e),{},{methods:{getPersonalizationStrategy:q,setPersonalizationStrategy:F}}))}}}}))}return ut.version="4.8.0",ut}()})),h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function p(e,t){function r(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}var y,m=function(e,t){this.target=t,this.type=e},b=function(e){function t(t,r){var n=e.call(this,"error",r)||this;return n.message=t.message,n.error=t,n}return p(t,e),t}(m),_=function(e){function t(t,r,n){void 0===t&&(t=1e3),void 0===r&&(r="");var o=e.call(this,"close",n)||this;return o.wasClean=!0,o.code=t,o.reason=r,o}return p(t,e),t}(m),w=function(){if("undefined"!=typeof WebSocket)return WebSocket},O={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},T=function(){function e(e,t,r){var n=this;void 0===r&&(r={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){n._debug("open event");var t=n._options.minUptime,r=void 0===t?O.minUptime:t;clearTimeout(n._connectTimeout),n._uptimeTimeout=setTimeout((function(){return n._acceptOpen()}),r),n._ws.binaryType=n._binaryType,n._messageQueue.forEach((function(e){return n._ws.send(e)})),n._messageQueue=[],n.onopen&&n.onopen(e),n._listeners.open.forEach((function(t){return n._callEventListener(e,t)}))},this._handleMessage=function(e){n._debug("message event"),n.onmessage&&n.onmessage(e),n._listeners.message.forEach((function(t){return n._callEventListener(e,t)}))},this._handleError=function(e){n._debug("error event",e.message),n._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),n.onerror&&n.onerror(e),n._debug("exec error listeners"),n._listeners.error.forEach((function(t){return n._callEventListener(e,t)})),n._connect()},this._handleClose=function(e){n._debug("close event"),n._clearTimeouts(),n._shouldReconnect&&n._connect(),n.onclose&&n.onclose(e),n._listeners.close.forEach((function(t){return n._callEventListener(e,t)}))},this._url=e,this._protocols=t,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(e,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CONNECTING",{get:function(){return e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OPEN",{get:function(){return e.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSING",{get:function(){return e.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSED",{get:function(){return e.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce((function(e,t){return"string"==typeof t?e+=t.length:t instanceof Blob?e+=t.size:e+=t.byteLength,e}),0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),e.prototype.close=function(e,t){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,t):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},e.prototype.reconnect=function(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,t),this._connect()):this._connect()},e.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{var t=this._options.maxEnqueuedMessages,r=void 0===t?O.maxEnqueuedMessages:t;this._messageQueue.length<r&&(this._debug("enqueue",e),this._messageQueue.push(e))}},e.prototype.addEventListener=function(e,t){this._listeners[e]&&this._listeners[e].push(t)},e.prototype.dispatchEvent=function(e){var t,r,n=this._listeners[e.type];if(n)try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}(n),a=o.next();!a.done;a=o.next()){var i=a.value;this._callEventListener(e,i)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return!0},e.prototype.removeEventListener=function(e,t){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter((function(e){return e!==t})))},e.prototype._debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._options.debug&&console.log.apply(console,v(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,r=void 0===t?O.reconnectionDelayGrowFactor:t,n=e.minReconnectionDelay,o=void 0===n?O.minReconnectionDelay:n,a=e.maxReconnectionDelay,i=void 0===a?O.maxReconnectionDelay:a,u=0;return this._retryCount>0&&(u=o*Math.pow(r,this._retryCount-1))>i&&(u=i),this._debug("next delay",u),u},e.prototype._wait=function(){var e=this;return new Promise((function(t){setTimeout(t,e._getNextDelay())}))},e.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var t=e();if("string"==typeof t)return Promise.resolve(t);if(t.then)return t}throw Error("Invalid URL")},e.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var t=this._options,r=t.maxRetries,n=void 0===r?O.maxRetries:r,o=t.connectionTimeout,a=void 0===o?O.connectionTimeout:o,i=t.WebSocket,u=void 0===i?w():i;if(this._retryCount>=n)this._debug("max retries reached",this._retryCount,">=",n);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),!function(e){return void 0!==e&&!!e&&2===e.CLOSING}(u))throw Error("No valid WebSocket class provided");this._wait().then((function(){return e._getNextUrl(e._url)})).then((function(t){e._closeCalled||(e._debug("connect",{url:t,protocols:e._protocols}),e._ws=e._protocols?new u(t,e._protocols):new u(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout((function(){return e._handleTimeout()}),a))}))}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new b(Error("TIMEOUT"),this))},e.prototype._disconnect=function(e,t){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new _(e,t,this))}catch(e){}}},e.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},e.prototype._callEventListener=function(e,t){"handleEvent"in t?t.handleEvent(e):t(e)},e.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},e.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},e.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},e}(),I=Object.freeze({__proto__:null,default:T}),S=new Uint8Array(16);function x(){if(!y&&!(y="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return y(S)}var P=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function E(e){return"string"==typeof e&&P.test(e)}for(var k,j,C=[],D=0;D<256;++D)C.push((D+256).toString(16).substr(1));function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(C[e[t+0]]+C[e[t+1]]+C[e[t+2]]+C[e[t+3]]+"-"+C[e[t+4]]+C[e[t+5]]+"-"+C[e[t+6]]+C[e[t+7]]+"-"+C[e[t+8]]+C[e[t+9]]+"-"+C[e[t+10]]+C[e[t+11]]+C[e[t+12]]+C[e[t+13]]+C[e[t+14]]+C[e[t+15]]).toLowerCase();if(!E(r))throw TypeError("Stringified UUID is invalid");return r}var R=0,N=0;function M(e){if(!E(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}function U(e,t,r){function n(e,n,o,a){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=M(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+e.length);if(i.set(n),i.set(e,n.length),(i=r(i))[6]=15&i[6]|t,i[8]=63&i[8]|128,o){a=a||0;for(var u=0;u<16;++u)o[a+u]=i[u];return o}return A(i)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function B(e){return 14+(e+64>>>9<<4)+1}function L(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function q(e,t,r,n,o,a){return L((i=L(L(t,e),L(n,a)))<<(u=o)|i>>>32-u,r);var i,u}function F(e,t,r,n,o,a,i){return q(t&r|~t&n,e,t,o,a,i)}function H(e,t,r,n,o,a,i){return q(t&n|r&~n,e,t,o,a,i)}function W(e,t,r,n,o,a,i){return q(t^r^n,e,t,o,a,i)}function z(e,t,r,n,o,a,i){return q(r^(t|~n),e,t,o,a,i)}var Y=U("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){for(var t=[],r=32*e.length,n="0123456789abcdef",o=0;o<r;o+=8){var a=e[o>>5]>>>o%32&255,i=parseInt(n.charAt(a>>>4&15)+n.charAt(15&a),16);t.push(i)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[B(t)-1]=t;for(var r=1732584193,n=-271733879,o=-1732584194,a=271733878,i=0;i<e.length;i+=16){var u=r,s=n,c=o,l=a;r=F(r,n,o,a,e[i],7,-680876936),a=F(a,r,n,o,e[i+1],12,-389564586),o=F(o,a,r,n,e[i+2],17,606105819),n=F(n,o,a,r,e[i+3],22,-1044525330),r=F(r,n,o,a,e[i+4],7,-176418897),a=F(a,r,n,o,e[i+5],12,1200080426),o=F(o,a,r,n,e[i+6],17,-1473231341),n=F(n,o,a,r,e[i+7],22,-45705983),r=F(r,n,o,a,e[i+8],7,1770035416),a=F(a,r,n,o,e[i+9],12,-1958414417),o=F(o,a,r,n,e[i+10],17,-42063),n=F(n,o,a,r,e[i+11],22,-1990404162),r=F(r,n,o,a,e[i+12],7,1804603682),a=F(a,r,n,o,e[i+13],12,-40341101),o=F(o,a,r,n,e[i+14],17,-1502002290),r=H(r,n=F(n,o,a,r,e[i+15],22,1236535329),o,a,e[i+1],5,-165796510),a=H(a,r,n,o,e[i+6],9,-1069501632),o=H(o,a,r,n,e[i+11],14,643717713),n=H(n,o,a,r,e[i],20,-373897302),r=H(r,n,o,a,e[i+5],5,-701558691),a=H(a,r,n,o,e[i+10],9,38016083),o=H(o,a,r,n,e[i+15],14,-660478335),n=H(n,o,a,r,e[i+4],20,-405537848),r=H(r,n,o,a,e[i+9],5,568446438),a=H(a,r,n,o,e[i+14],9,-1019803690),o=H(o,a,r,n,e[i+3],14,-187363961),n=H(n,o,a,r,e[i+8],20,1163531501),r=H(r,n,o,a,e[i+13],5,-1444681467),a=H(a,r,n,o,e[i+2],9,-51403784),o=H(o,a,r,n,e[i+7],14,1735328473),r=W(r,n=H(n,o,a,r,e[i+12],20,-1926607734),o,a,e[i+5],4,-378558),a=W(a,r,n,o,e[i+8],11,-2022574463),o=W(o,a,r,n,e[i+11],16,1839030562),n=W(n,o,a,r,e[i+14],23,-35309556),r=W(r,n,o,a,e[i+1],4,-1530992060),a=W(a,r,n,o,e[i+4],11,1272893353),o=W(o,a,r,n,e[i+7],16,-155497632),n=W(n,o,a,r,e[i+10],23,-1094730640),r=W(r,n,o,a,e[i+13],4,681279174),a=W(a,r,n,o,e[i],11,-358537222),o=W(o,a,r,n,e[i+3],16,-722521979),n=W(n,o,a,r,e[i+6],23,76029189),r=W(r,n,o,a,e[i+9],4,-640364487),a=W(a,r,n,o,e[i+12],11,-421815835),o=W(o,a,r,n,e[i+15],16,530742520),r=z(r,n=W(n,o,a,r,e[i+2],23,-995338651),o,a,e[i],6,-198630844),a=z(a,r,n,o,e[i+7],10,1126891415),o=z(o,a,r,n,e[i+14],15,-1416354905),n=z(n,o,a,r,e[i+5],21,-57434055),r=z(r,n,o,a,e[i+12],6,1700485571),a=z(a,r,n,o,e[i+3],10,-1894986606),o=z(o,a,r,n,e[i+10],15,-1051523),n=z(n,o,a,r,e[i+1],21,-2054922799),r=z(r,n,o,a,e[i+8],6,1873313359),a=z(a,r,n,o,e[i+15],10,-30611744),o=z(o,a,r,n,e[i+6],15,-1560198380),n=z(n,o,a,r,e[i+13],21,1309151649),r=z(r,n,o,a,e[i+4],6,-145523070),a=z(a,r,n,o,e[i+11],10,-1120210379),o=z(o,a,r,n,e[i+2],15,718787259),n=z(n,o,a,r,e[i+9],21,-343485551),r=L(r,u),n=L(n,s),o=L(o,c),a=L(a,l)}return[r,n,o,a]}(function(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(B(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}));function K(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function V(e,t){return e<<t|e>>>32-t}var G=U("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var o=0;o<n.length;++o)e.push(n.charCodeAt(o))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,i=Math.ceil(a/16),u=new Array(i),s=0;s<i;++s){for(var c=new Uint32Array(16),l=0;l<16;++l)c[l]=e[64*s+4*l]<<24|e[64*s+4*l+1]<<16|e[64*s+4*l+2]<<8|e[64*s+4*l+3];u[s]=c}u[i-1][14]=8*(e.length-1)/Math.pow(2,32),u[i-1][14]=Math.floor(u[i-1][14]),u[i-1][15]=8*(e.length-1)&4294967295;for(var f=0;f<i;++f){for(var d=new Uint32Array(80),h=0;h<16;++h)d[h]=u[f][h];for(var p=16;p<80;++p)d[p]=V(d[p-3]^d[p-8]^d[p-14]^d[p-16],1);for(var g=r[0],v=r[1],y=r[2],m=r[3],b=r[4],_=0;_<80;++_){var w=Math.floor(_/20),O=V(g,5)+K(w,v,y,m)+b+t[w]+d[_]>>>0;b=m,m=y,y=V(v,30)>>>0,v=g,g=O}r[0]=r[0]+g>>>0,r[1]=r[1]+v>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}));var J=Object.freeze({__proto__:null,v1:function(e,t,r){var n=t&&r||0,o=t||new Array(16),a=(e=e||{}).node||k,i=void 0!==e.clockseq?e.clockseq:j;if(null==a||null==i){var u=e.random||(e.rng||x)();null==a&&(a=k=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==i&&(i=j=16383&(u[6]<<8|u[7]))}var s=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:N+1,l=s-R+(c-N)/1e4;if(l<0&&void 0===e.clockseq&&(i=i+1&16383),(l<0||s>R)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");R=s,N=c,j=i;var f=(1e4*(268435455&(s+=122192928e5))+c)%4294967296;o[n++]=f>>>24&255,o[n++]=f>>>16&255,o[n++]=f>>>8&255,o[n++]=255&f;var d=s/4294967296*1e4&268435455;o[n++]=d>>>8&255,o[n++]=255&d,o[n++]=d>>>24&15|16,o[n++]=d>>>16&255,o[n++]=i>>>8|128,o[n++]=255&i;for(var h=0;h<6;++h)o[n+h]=a[h];return t||A(o)},v3:Y,v4:function(e,t,r){var n=(e=e||{}).random||(e.rng||x)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return A(n)},v5:G,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!E(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:E,stringify:A,parse:M}),Q=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheapestRate=void 0,t.getCheapestRate=function(e){if(0!==e.offers.length)return Math.min.apply(Math,e.offers.map((function(e){return e.nightlyRate})))}})),X=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateDiscount=void 0,t.calculateDiscount=function(e,t,r){return void 0===t||void 0===r||0===r?0:e<t?-1*(e-t)/t:e>r?-1*(e-r)/r:0}}));function $(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Z(e){$(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function ee(e){$(1,arguments);var t=Z(e);return!isNaN(t)}var te={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function re(e){return function(t){var r=t||{},n=r.width?String(r.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var ne={date:re({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:re({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:re({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},oe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ae(e){return function(t,r){var n,o=r||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,i=o.width?String(o.width):a;n=e.formattingValues[i]||e.formattingValues[a]}else{var u=e.defaultWidth,s=o.width?String(o.width):e.defaultWidth;n=e.values[s]||e.values[u]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function ie(e){return function(t,r){var n=String(t),o=r||{},a=o.width,i=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],u=n.match(i);if(!u)return null;var s,c=u[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth];return s="[object Array]"===Object.prototype.toString.call(l)?function(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r}(l,(function(e){return e.test(c)})):function(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}(l,(function(e){return e.test(c)})),s=e.valueCallback?e.valueCallback(s):s,{value:s=o.valueCallback?o.valueCallback(s):s,rest:n.slice(c.length)}}}var ue,se={code:"en-US",formatDistance:function(e,t,r){var n;return r=r||{},n="string"==typeof te[e]?te[e]:1===t?te[e].one:te[e].other.replace("{{count}}",t),r.addSuffix?r.comparison>0?"in "+n:n+" ago":n},formatLong:ne,formatRelative:function(e,t,r,n){return oe[e]},localize:{ordinalNumber:function(e,t){var r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:ae({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ae({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:ae({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:ae({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:ae({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(ue={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var r=String(e),n=t||{},o=r.match(ue.matchPattern);if(!o)return null;var a=o[0],i=r.match(ue.parsePattern);if(!i)return null;var u=ue.valueCallback?ue.valueCallback(i[0]):i[0];return{value:u=n.valueCallback?n.valueCallback(u):u,rest:r.slice(a.length)}}),era:ie({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ie({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:ie({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ie({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ie({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ce(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function le(e,t){$(2,arguments);var r=Z(e).getTime(),n=ce(t);return new Date(r+n)}function fe(e,t){$(2,arguments);var r=ce(t);return le(e,-r)}function de(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return r+n}var he=function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return de("yy"===t?n%100:n,t.length)},pe=function(e,t){var r=e.getUTCMonth();return"M"===t?String(r+1):de(r+1,2)},ge=function(e,t){return de(e.getUTCDate(),t.length)},ve=function(e,t){return de(e.getUTCHours()%12||12,t.length)},ye=function(e,t){return de(e.getUTCHours(),t.length)},me=function(e,t){return de(e.getUTCMinutes(),t.length)},be=function(e,t){return de(e.getUTCSeconds(),t.length)},_e=function(e,t){var r=t.length,n=e.getUTCMilliseconds();return de(Math.floor(n*Math.pow(10,r-3)),t.length)},we=864e5;function Oe(e){$(1,arguments);var t=1,r=Z(e),n=r.getUTCDay(),o=(n<t?7:0)+n-t;return r.setUTCDate(r.getUTCDate()-o),r.setUTCHours(0,0,0,0),r}function Te(e){$(1,arguments);var t=Z(e),r=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(r+1,0,4),n.setUTCHours(0,0,0,0);var o=Oe(n),a=new Date(0);a.setUTCFullYear(r,0,4),a.setUTCHours(0,0,0,0);var i=Oe(a);return t.getTime()>=o.getTime()?r+1:t.getTime()>=i.getTime()?r:r-1}function Ie(e){$(1,arguments);var t=Te(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=Oe(r);return n}var Se=6048e5;function xe(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:ce(o),i=null==r.weekStartsOn?a:ce(r.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Z(e),s=u.getUTCDay(),c=(s<i?7:0)+s-i;return u.setUTCDate(u.getUTCDate()-c),u.setUTCHours(0,0,0,0),u}function Pe(e,t){$(1,arguments);var r=Z(e,t),n=r.getUTCFullYear(),o=t||{},a=o.locale,i=a&&a.options&&a.options.firstWeekContainsDate,u=null==i?1:ce(i),s=null==o.firstWeekContainsDate?u:ce(o.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(n+1,0,s),c.setUTCHours(0,0,0,0);var l=xe(c,t),f=new Date(0);f.setUTCFullYear(n,0,s),f.setUTCHours(0,0,0,0);var d=xe(f,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function Ee(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.firstWeekContainsDate,a=null==o?1:ce(o),i=null==r.firstWeekContainsDate?a:ce(r.firstWeekContainsDate),u=Pe(e,t),s=new Date(0);s.setUTCFullYear(u,0,i),s.setUTCHours(0,0,0,0);var c=xe(s,t);return c}var ke=6048e5;var je="midnight",Ce="noon",De="morning",Ae="afternoon",Re="evening",Ne="night",Me={G:function(e,t,r){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){var n=e.getUTCFullYear(),o=n>0?n:1-n;return r.ordinalNumber(o,{unit:"year"})}return he(e,t)},Y:function(e,t,r,n){var o=Pe(e,n),a=o>0?o:1-o;return"YY"===t?de(a%100,2):"Yo"===t?r.ordinalNumber(a,{unit:"year"}):de(a,t.length)},R:function(e,t){return de(Te(e),t.length)},u:function(e,t){return de(e.getUTCFullYear(),t.length)},Q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return de(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return de(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){var n=e.getUTCMonth();switch(t){case"M":case"MM":return pe(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return de(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var o=function(e,t){$(1,arguments);var r=Z(e),n=xe(r,t).getTime()-Ee(r,t).getTime();return Math.round(n/ke)+1}(e,n);return"wo"===t?r.ordinalNumber(o,{unit:"week"}):de(o,t.length)},I:function(e,t,r){var n=function(e){$(1,arguments);var t=Z(e),r=Oe(t).getTime()-Ie(t).getTime();return Math.round(r/Se)+1}(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):de(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):ge(e,t)},D:function(e,t,r){var n=function(e){$(1,arguments);var t=Z(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),o=r-n;return Math.floor(o/we)+1}(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):de(n,t.length)},E:function(e,t,r){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var o=e.getUTCDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return de(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var o=e.getUTCDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return de(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){var n=e.getUTCDay(),o=0===n?7:n;switch(t){case"i":return String(o);case"ii":return de(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n,o=e.getUTCHours();switch(n=12===o?Ce:0===o?je:o/12>=1?"pm":"am",t){case"b":case"bb":case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n,o=e.getUTCHours();switch(n=o>=17?Re:o>=12?Ae:o>=4?De:Ne,t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){var n=e.getUTCHours()%12;return 0===n&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return ve(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):ye(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):de(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):de(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):me(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):be(e,t)},S:function(e,t){return _e(e,t)},X:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Be(o);case"XXXX":case"XX":return Le(o);case"XXXXX":case"XXX":default:return Le(o,":")}},x:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return Be(o);case"xxxx":case"xx":return Le(o);case"xxxxx":case"xxx":default:return Le(o,":")}},O:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ue(o,":");case"OOOO":default:return"GMT"+Le(o,":")}},z:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ue(o,":");case"zzzz":default:return"GMT"+Le(o,":")}},t:function(e,t,r,n){var o=n._originalDate||e;return de(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,r,n){return de((n._originalDate||e).getTime(),t.length)}};function Ue(e,t){var r=e>0?"-":"+",n=Math.abs(e),o=Math.floor(n/60),a=n%60;if(0===a)return r+String(o);var i=t||"";return r+String(o)+i+de(a,2)}function Be(e,t){return e%60==0?(e>0?"-":"+")+de(Math.abs(e)/60,2):Le(e,t)}function Le(e,t){var r=t||"",n=e>0?"-":"+",o=Math.abs(e);return n+de(Math.floor(o/60),2)+r+de(o%60,2)}function qe(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Fe(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var He={p:Fe,P:function(e,t){var r,n=e.match(/(P+)(p+)?/),o=n[1],a=n[2];if(!a)return qe(e,t);switch(o){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",qe(o,t)).replace("{{time}}",Fe(a,t))}},We=6e4;function ze(e){return e.getTime()%We}function Ye(e){var t=new Date(e.getTime()),r=Math.ceil(t.getTimezoneOffset());t.setSeconds(0,0);var n=r>0?(We+ze(t))%We:ze(t);return r*We+n}var Ke=["D","DD"],Ve=["YY","YYYY"];function Ge(e){return-1!==Ke.indexOf(e)}function Je(e){return-1!==Ve.indexOf(e)}function Qe(e,t,r){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://git.io/fxCyr"))}var Xe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ze=/^'([^]*?)'?$/,et=/''/g,tt=/[a-zA-Z]/;function rt(e){return e.match(Ze)[1].replace(et,"'")}var nt=Object.freeze({__proto__:null,default:function(e,t,r){$(2,arguments);var n=String(t),o=r||{},a=o.locale||se,i=a.options&&a.options.firstWeekContainsDate,u=null==i?1:ce(i),s=null==o.firstWeekContainsDate?u:ce(o.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,l=null==c?0:ce(c),f=null==o.weekStartsOn?l:ce(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var d=Z(e);if(!ee(d))throw new RangeError("Invalid time value");var h=Ye(d),p=fe(d,h),g={firstWeekContainsDate:s,weekStartsOn:f,locale:a,_originalDate:d},v=n.match($e).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,He[t])(e,a.formatLong,g):e})).join("").match(Xe).map((function(r){if("''"===r)return"'";var n=r[0];if("'"===n)return rt(r);var i=Me[n];if(i)return!o.useAdditionalWeekYearTokens&&Je(r)&&Qe(r,t,e),!o.useAdditionalDayOfYearTokens&&Ge(r)&&Qe(r,t,e),i(p,r,a.localize,g);if(n.match(tt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return r})).join("");return v}});function ot(e,t){$(2,arguments);var r=Z(e),n=ce(t);return isNaN(n)?new Date(NaN):n?(r.setDate(r.getDate()+n),r):r}var at=Object.freeze({__proto__:null,default:ot});function it(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:ce(o),i=null==r.weekStartsOn?a:ce(r.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var u=Z(e),s=u.getDay(),c=6+(s<i?-7:0)-(s-i);return u.setHours(0,0,0,0),u.setDate(u.getDate()+c),u}var ut=Object.freeze({__proto__:null,default:function(e){return $(1,arguments),it(e,{weekStartsOn:1})}});var st=Object.freeze({__proto__:null,default:function(e,t){$(2,arguments);var r=ce(t),n=7*r;return ot(e,n)}}),ct=36e5,lt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ft=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,dt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ht=/^([+-])(\d{2})(?::?(\d{2}))?$/;function pt(e){var t,r={},n=e.split(lt.dateTimeDelimiter);if(n.length>2)return r;if(/:/.test(n[0])?(r.date=null,t=n[0]):(r.date=n[0],t=n[1],lt.timeZoneDelimiter.test(r.date)&&(r.date=e.split(lt.timeZoneDelimiter)[0],t=e.substr(r.date.length,e.length))),t){var o=lt.timezone.exec(t);o?(r.time=t.replace(o[1],""),r.timezone=o[1]):r.time=t}return r}function gt(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:null};var o=n[1]&&parseInt(n[1]),a=n[2]&&parseInt(n[2]);return{year:null==a?o:100*a,restDateString:e.slice((n[1]||n[2]).length)}}function vt(e,t){if(null===t)return null;var r=e.match(ft);if(!r)return null;var n=!!r[4],o=yt(r[1]),a=yt(r[2])-1,i=yt(r[3]),u=yt(r[4]),s=yt(r[5])-1;if(n)return function(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}(0,u,s)?function(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var o=n.getUTCDay()||7,a=7*(t-1)+r+1-o;return n.setUTCDate(n.getUTCDate()+a),n}(t,u,s):new Date(NaN);var c=new Date(0);return function(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(wt[t]||(Ot(e)?29:28))}(t,a,i)&&function(e,t){return t>=1&&t<=(Ot(e)?366:365)}(t,o)?(c.setUTCFullYear(t,a,Math.max(o,i)),c):new Date(NaN)}function yt(e){return e?parseInt(e):1}function mt(e){var t=e.match(dt);if(!t)return null;var r=bt(t[1]),n=bt(t[2]),o=bt(t[3]);return function(e,t,r){if(24===e)return 0===t&&0===r;return r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}(r,n,o)?r*ct+6e4*n+1e3*o:NaN}function bt(e){return e&&parseFloat(e.replace(",","."))||0}function _t(e){if("Z"===e)return 0;var t=e.match(ht);if(!t)return 0;var r="+"===t[1]?-1:1,n=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?r*(n*ct+6e4*o):NaN}var wt=[31,null,31,30,31,30,31,31,30,31,30,31];function Ot(e){return e%400==0||e%4==0&&e%100}var Tt=Object.freeze({__proto__:null,default:function(e,t){$(1,arguments);var r=t||{},n=null==r.additionalDigits?2:ce(r.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var o,a=pt(e);if(a.date){var i=gt(a.date,n);o=vt(i.restDateString,i.year)}if(isNaN(o)||!o)return new Date(NaN);var u,s=o.getTime(),c=0;if(a.time&&(c=mt(a.time),isNaN(c)||null===c))return new Date(NaN);if(!a.timezone){var l=new Date(s+c),f=new Date(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate(),l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds());return f.setFullYear(l.getUTCFullYear()),f}return u=_t(a.timezone),isNaN(u)?new Date(NaN):new Date(s+c+u)}}),It=r(f),St=r(nt),xt=r(at),Pt=r(ut),Et=r(st),kt=r(Tt),jt=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheckInCheckOutDates=t.dateToMiddayUTC=t.DATE_FORMAT=void 0;var r=It.__importDefault(St),n=It.__importDefault(xt),o=It.__importDefault(Pt),a=It.__importDefault(Et),i=It.__importDefault(kt);function u(e){return i.default(e+" 12:00:00")}t.DATE_FORMAT="yyyy-MM-dd",t.dateToMiddayUTC=u;var s=function(e,t){return n.default(e,t)};t.getCheckInCheckOutDates=function(e,i){var c,l=e.checkIn,f=e.checkOut,d=e.dayDistance,h=e.nights,p=void 0===h?1:h,g=u(r.default(new Date,t.DATE_FORMAT));c=void 0!==l?u(l):d?s(g,d):function(e){for(var i,s=e.daysFromNow,c=e.blockedDefaultDates,l=u(r.default(new Date,t.DATE_FORMAT)),f=o.default(n.default(l,s));i=r.default(f,t.DATE_FORMAT),c.includes(i);)f=a.default(f,1);return f}(i);var v=void 0===f?s(c,p):u(f);return{checkIn:r.default(c,t.DATE_FORMAT),checkOut:r.default(v,t.DATE_FORMAT)}}})),Ct=t((function(e,t){function r(e){void 0===e&&(e=[]);var t={},r={};e.forEach((function(e){var r=e[0],n=e[1],o=e[2],a=e[3];n&&(t[r]=X.calculateDiscount(n,o,a))}));var n=Math.min.apply(Math,Object.values(t)),o=Math.max.apply(Math,Object.values(t));return e.forEach((function(e){var a=e[0],i=e[1],u=(e[2],e[3]),s=i&&u&&u>0?o===n?1:(t[a]-n)/(o-n):void 0;void 0!==s&&(r[a]=Number(s.toFixed(2)))})),r}Object.defineProperty(t,"__esModule",{value:!0}),t.getDealScores=t.calculateDealScores=void 0,t.calculateDealScores=r,t.getDealScores=function(e){var t=e.offset,n=e.anchorHotelId,o=e.hotelIds,a=e.hotelEntities,i=e.hotelOfferEntities;return r((void 0===n||t>0?o:It.__spreadArrays([n],o)).map((function(e){var t,r,n,o=a[e],u=i[e],s=null!==(t=null==o?void 0:o.regularPriceRange)&&void 0!==t?t:[],c=s[0],l=s[1];return[e,null===(n=null===(r=null==u?void 0:u.offers)||void 0===r?void 0:r[0])||void 0===n?void 0:n.nightlyRate,c,l]})))}})),Dt=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.omit=void 0,t.omit=function(e,t){for(var r={},n={},o=0,a=e.length;o<a;)n[e[o]]=1,o+=1;for(var i in t)Object.prototype.hasOwnProperty.call(n,i)||(r[i]=t[i]);return r}}));function At(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if("production"!==process.env.NODE_ENV){var o=Pr[e],a=o?"function"==typeof o?o.apply(null,r):o:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Rt(e){return!!e&&!!e[Sr]}function Nt(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===Er}(e)||Array.isArray(e)||!!e[Ir]||!!e.constructor[Ir]||Ht(e)||Wt(e))}function Mt(e,t,r){void 0===r&&(r=!1),0===Ut(e)?(r?Object.keys:kr)(e).forEach((function(n){r&&"symbol"==typeof n||t(n,e[n],e)})):e.forEach((function(r,n){return t(n,r,e)}))}function Ut(e){var t=e[Sr];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Ht(e)?2:Wt(e)?3:0}function Bt(e,t){return 2===Ut(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Lt(e,t){return 2===Ut(e)?e.get(t):e[t]}function qt(e,t,r){var n=Ut(e);2===n?e.set(t,r):3===n?(e.delete(t),e.add(r)):e[t]=r}function Ft(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function Ht(e){return _r&&e instanceof Map}function Wt(e){return wr&&e instanceof Set}function zt(e){return e.o||e.t}function Yt(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=jr(e);delete t[Sr];for(var r=kr(t),n=0;n<r.length;n++){var o=r[n],a=t[o];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Kt(e,t){return void 0===t&&(t=!1),Gt(e)||Rt(e)||!Nt(e)||(Ut(e)>1&&(e.set=e.add=e.clear=e.delete=Vt),Object.freeze(e),t&&Mt(e,(function(e,t){return Kt(t,!0)}),!0)),e}function Vt(){At(2)}function Gt(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Jt(e){var t=Cr[e];return t||At(18,e),t}function Qt(e,t){Cr[e]||(Cr[e]=t)}function Xt(){return"production"===process.env.NODE_ENV||mr||At(0),mr}function $t(e,t){t&&(Jt("Patches"),e.u=[],e.s=[],e.v=t)}function Zt(e){er(e),e.p.forEach(rr),e.p=null}function er(e){e===mr&&(mr=e.l)}function tr(e){return mr={p:[],l:mr,h:e,m:!0,_:0}}function rr(e){var t=e[Sr];0===t.i||1===t.i?t.j():t.O=!0}function nr(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;return t.h.g||Jt("ES5").S(t,e,n),n?(r[Sr].P&&(Zt(t),At(4)),Nt(e)&&(e=or(t,e),t.l||ir(t,e)),t.u&&Jt("Patches").M(r[Sr],e,t.u,t.s)):e=or(t,r,[]),Zt(t),t.u&&t.v(t.u,t.s),e!==Tr?e:void 0}function or(e,t,r){if(Gt(t))return t;var n=t[Sr];if(!n)return Mt(t,(function(o,a){return ar(e,n,t,o,a,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return ir(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=Yt(n.k):n.o;Mt(3===n.i?new Set(o):o,(function(t,a){return ar(e,n,o,t,a,r)})),ir(e,o,!1),r&&e.u&&Jt("Patches").R(n,r,e.u,e.s)}return n.o}function ar(e,t,r,n,o,a){if("production"!==process.env.NODE_ENV&&o===r&&At(5),Rt(o)){var i=or(e,o,a&&t&&3!==t.i&&!Bt(t.D,n)?a.concat(n):void 0);if(qt(r,n,i),!Rt(i))return;e.m=!1}if(Nt(o)&&!Gt(o)){if(!e.h.F&&e._<1)return;or(e,o),t&&t.A.l||ir(e,o)}}function ir(e,t,r){void 0===r&&(r=!1),e.h.F&&e.m&&Kt(t,r)}function ur(e,t){var r=e[Sr];return(r?zt(r):e)[t]}function sr(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function cr(e){e.P||(e.P=!0,e.l&&cr(e.l))}function lr(e){e.o||(e.o=Yt(e.t))}function fr(e,t,r){var n=Ht(t)?Jt("MapSet").N(t,r):Wt(t)?Jt("MapSet").T(t,r):e.g?function(e,t){var r=Array.isArray(e),n={i:r?1:0,A:t?t.A:Xt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=n,a=Dr;r&&(o=[n],a=Ar);var i=Proxy.revocable(o,a),u=i.revoke,s=i.proxy;return n.k=s,n.j=u,s}(t,r):Jt("ES5").J(t,r);return(r?r.A:Xt()).p.push(n),n}function dr(e){return Rt(e)||At(22,e),function e(t){if(!Nt(t))return t;var r,n=t[Sr],o=Ut(t);if(n){if(!n.P&&(n.i<4||!Jt("ES5").K(n)))return n.t;n.I=!0,r=hr(t,o),n.I=!1}else r=hr(t,o);return Mt(r,(function(t,o){n&&Lt(n.t,t)===o||qt(r,t,e(o))})),3===o?new Set(r):r}(e)}function hr(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Yt(e)}function pr(){function e(e,t){var r=a[e];return r?r.enumerable=t:a[e]=r={configurable:!0,enumerable:t,get:function(){var t=this[Sr];return"production"!==process.env.NODE_ENV&&o(t),Dr.get(t,e)},set:function(t){var r=this[Sr];"production"!==process.env.NODE_ENV&&o(r),Dr.set(r,e,t)}},r}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][Sr];if(!o.P)switch(o.i){case 5:n(o)&&cr(o);break;case 4:r(o)&&cr(o)}}}function r(e){for(var t=e.t,r=e.k,n=kr(r),o=n.length-1;o>=0;o--){var a=n[o];if(a!==Sr){var i=t[a];if(void 0===i&&!Bt(t,a))return!0;var u=r[a],s=u&&u[Sr];if(s?s.t!==i:!Ft(u,i))return!0}}var c=!!t[Sr];return n.length!==kr(t).length+(c?0:1)}function n(e){var t=e.k;if(t.length!==e.t.length)return!0;var r=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!r||r.get)}function o(e){e.O&&At(3,JSON.stringify(zt(e)))}var a={};Qt("ES5",{J:function(t,r){var n=Array.isArray(t),o=function(t,r){if(t){for(var n=Array(r.length),o=0;o<r.length;o++)Object.defineProperty(n,""+o,e(o,!0));return n}var a=jr(r);delete a[Sr];for(var i=kr(a),u=0;u<i.length;u++){var s=i[u];a[s]=e(s,t||!!a[s].enumerable)}return Object.create(Object.getPrototypeOf(r),a)}(n,t),a={i:n?5:4,A:r?r.A:Xt(),P:!1,I:!1,D:{},l:r,t:t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,Sr,{value:a,writable:!0}),o},S:function(e,r,o){o?Rt(r)&&r[Sr].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var r=t[Sr];if(r){var o=r.t,a=r.k,i=r.D,u=r.i;if(4===u)Mt(a,(function(t){t!==Sr&&(void 0!==o[t]||Bt(o,t)?i[t]||e(a[t]):(i[t]=!0,cr(r)))})),Mt(o,(function(e){void 0!==a[e]||Bt(a,e)||(i[e]=!1,cr(r))}));else if(5===u){if(n(r)&&(cr(r),i.length=!0),a.length<o.length)for(var s=a.length;s<o.length;s++)i[s]=!1;else for(var c=o.length;c<a.length;c++)i[c]=!0;for(var l=Math.min(a.length,o.length),f=0;f<l;f++)void 0===i[f]&&e(a[f])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?r(e):n(e)}})}function gr(){function e(t){if(!Nt(t))return t;if(Array.isArray(t))return t.map(e);if(Ht(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(Wt(t))return new Set(Array.from(t).map(e));var r=Object.create(Object.getPrototypeOf(t));for(var n in t)r[n]=e(t[n]);return Bt(t,Ir)&&(r[Ir]=t[Ir]),r}function t(t){return Rt(t)?e(t):t}var r="add";Qt("Patches",{$:function(t,n){return n.forEach((function(n){for(var o=n.path,a=n.op,i=t,u=0;u<o.length-1;u++){var s=Ut(i),c=""+o[u];0!==s&&1!==s||"__proto__"!==c&&"constructor"!==c||At(24),"function"==typeof i&&"prototype"===c&&At(24),"object"!=typeof(i=Lt(i,c))&&At(15,o.join("/"))}var l=Ut(i),f=e(n.value),d=o[o.length-1];switch(a){case"replace":switch(l){case 2:return i.set(d,f);case 3:At(16);default:return i[d]=f}case r:switch(l){case 1:return i.splice(d,0,f);case 2:return i.set(d,f);case 3:return i.add(f);default:return i[d]=f}case"remove":switch(l){case 1:return i.splice(d,1);case 2:return i.delete(d);case 3:return i.delete(n.value);default:return delete i[d]}default:At(17,a)}})),t},R:function(e,n,o,a){switch(e.i){case 0:case 4:case 2:return function(e,n,o,a){var i=e.t,u=e.o;Mt(e.D,(function(e,s){var c=Lt(i,e),l=Lt(u,e),f=s?Bt(i,e)?"replace":r:"remove";if(c!==l||"replace"!==f){var d=n.concat(e);o.push("remove"===f?{op:f,path:d}:{op:f,path:d,value:l}),a.push(f===r?{op:"remove",path:d}:"remove"===f?{op:r,path:d,value:t(c)}:{op:"replace",path:d,value:t(c)})}}))}(e,n,o,a);case 5:case 1:return function(e,n,o,a){var i=e.t,u=e.D,s=e.o;if(s.length<i.length){var c=[s,i];i=c[0],s=c[1];var l=[a,o];o=l[0],a=l[1]}for(var f=0;f<i.length;f++)if(u[f]&&s[f]!==i[f]){var d=n.concat([f]);o.push({op:"replace",path:d,value:t(s[f])}),a.push({op:"replace",path:d,value:t(i[f])})}for(var h=i.length;h<s.length;h++){var p=n.concat([h]);o.push({op:r,path:p,value:t(s[h])})}i.length<s.length&&a.push({op:"replace",path:n.concat(["length"]),value:i.length})}(e,n,o,a);case 3:return function(e,t,n,o){var a=e.t,i=e.o,u=0;a.forEach((function(e){if(!i.has(e)){var a=t.concat([u]);n.push({op:"remove",path:a,value:e}),o.unshift({op:r,path:a,value:e})}u++})),u=0,i.forEach((function(e){if(!a.has(e)){var i=t.concat([u]);n.push({op:r,path:i,value:e}),o.unshift({op:"remove",path:i,value:e})}u++}))}(e,n,o,a)}},M:function(e,t,r,n){r.push({op:"replace",path:[],value:t===Tr?void 0:t}),n.push({op:"replace",path:[],value:e.t})}})}function vr(){function e(e,t){function r(){this.constructor=e}o(e,t),e.prototype=(r.prototype=t.prototype,new r)}function t(e){e.o||(e.D=new Map,e.o=new Map(e.t))}function r(e){e.o||(e.o=new Set,e.t.forEach((function(t){if(Nt(t)){var r=fr(e.A.h,t,e);e.p.set(t,r),e.o.add(r)}else e.o.add(t)})))}function n(e){e.O&&At(3,JSON.stringify(zt(e)))}var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},a=function(){function r(e,t){return this[Sr]={i:2,l:t,A:t?t.A:Xt(),P:!1,I:!1,o:void 0,D:void 0,t:e,k:this,C:!1,O:!1},this}e(r,Map);var o=r.prototype;return Object.defineProperty(o,"size",{get:function(){return zt(this[Sr]).size}}),o.has=function(e){return zt(this[Sr]).has(e)},o.set=function(e,r){var o=this[Sr];return n(o),zt(o).has(e)&&zt(o).get(e)===r||(t(o),cr(o),o.D.set(e,!0),o.o.set(e,r),o.D.set(e,!0)),this},o.delete=function(e){if(!this.has(e))return!1;var r=this[Sr];return n(r),t(r),cr(r),r.D.set(e,!1),r.o.delete(e),!0},o.clear=function(){var e=this[Sr];n(e),zt(e).size&&(t(e),cr(e),e.D=new Map,Mt(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},o.forEach=function(e,t){var r=this;zt(this[Sr]).forEach((function(n,o){e.call(t,r.get(o),o,r)}))},o.get=function(e){var r=this[Sr];n(r);var o=zt(r).get(e);if(r.I||!Nt(o))return o;if(o!==r.t.get(e))return o;var a=fr(r.A.h,o,r);return t(r),r.o.set(e,a),a},o.keys=function(){return zt(this[Sr]).keys()},o.values=function(){var e,t=this,r=this.keys();return(e={})[xr]=function(){return t.values()},e.next=function(){var e=r.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},o.entries=function(){var e,t=this,r=this.keys();return(e={})[xr]=function(){return t.entries()},e.next=function(){var e=r.next();if(e.done)return e;var n=t.get(e.value);return{done:!1,value:[e.value,n]}},e},o[xr]=function(){return this.entries()},r}(),i=function(){function t(e,t){return this[Sr]={i:3,l:t,A:t?t.A:Xt(),P:!1,I:!1,o:void 0,t:e,k:this,p:new Map,O:!1,C:!1},this}e(t,Set);var o=t.prototype;return Object.defineProperty(o,"size",{get:function(){return zt(this[Sr]).size}}),o.has=function(e){var t=this[Sr];return n(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},o.add=function(e){var t=this[Sr];return n(t),this.has(e)||(r(t),cr(t),t.o.add(e)),this},o.delete=function(e){if(!this.has(e))return!1;var t=this[Sr];return n(t),r(t),cr(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},o.clear=function(){var e=this[Sr];n(e),zt(e).size&&(r(e),cr(e),e.o.clear())},o.values=function(){var e=this[Sr];return n(e),r(e),e.o.values()},o.entries=function(){var e=this[Sr];return n(e),r(e),e.o.entries()},o.keys=function(){return this.values()},o[xr]=function(){return this.values()},o.forEach=function(e,t){for(var r=this.values(),n=r.next();!n.done;)e.call(t,n.value,n.value,this),n=r.next()},t}();Qt("MapSet",{N:function(e,t){return new a(e,t)},T:function(e,t){return new i(e,t)}})}var yr,mr,br="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),_r="undefined"!=typeof Map,wr="undefined"!=typeof Set,Or="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Tr=br?Symbol.for("immer-nothing"):((yr={})["immer-nothing"]=!0,yr),Ir=br?Symbol.for("immer-draftable"):"__$immer_draftable",Sr=br?Symbol.for("immer-state"):"__$immer_state",xr="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Pr={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Er=""+Object.prototype.constructor,kr="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,jr=Object.getOwnPropertyDescriptors||function(e){var t={};return kr(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},Cr={},Dr={get:function(e,t){if(t===Sr)return e;var r=zt(e);if(!Bt(r,t))return function(e,t,r){var n,o=sr(t,r);return o?"value"in o?o.value:null===(n=o.get)||void 0===n?void 0:n.call(e.k):void 0}(e,r,t);var n=r[t];return e.I||!Nt(n)?n:n===ur(e.t,t)?(lr(e),e.o[t]=fr(e.A.h,n,e)):n},has:function(e,t){return t in zt(e)},ownKeys:function(e){return Reflect.ownKeys(zt(e))},set:function(e,t,r){var n=sr(zt(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var o=ur(zt(e),t),a=null==o?void 0:o[Sr];if(a&&a.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(Ft(r,o)&&(void 0!==r||Bt(e.t,t)))return!0;lr(e),cr(e)}return e.o[t]===r&&"number"!=typeof r&&(void 0!==r||t in e.o)||(e.o[t]=r,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==ur(e.t,t)||t in e.t?(e.D[t]=!1,lr(e),cr(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=zt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty:function(){At(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){At(12)}},Ar={};Mt(Dr,(function(e,t){Ar[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ar.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&At(13),Dr.deleteProperty.call(this,e[0],t)},Ar.set=function(e,t,r){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&At(14),Dr.set.call(this,e[0],t,r,e[0])};var Rr=function(){function e(e){var t=this;this.g=Or,this.F=!0,this.produce=function(e,r,n){if("function"==typeof e&&"function"!=typeof r){var o=r;r=e;var a=t;return function(e){var t=this;void 0===e&&(e=o);for(var n=arguments.length,i=Array(n>1?n-1:0),u=1;u<n;u++)i[u-1]=arguments[u];return a.produce(e,(function(e){var n;return(n=r).call.apply(n,[t,e].concat(i))}))}}var i;if("function"!=typeof r&&At(6),void 0!==n&&"function"!=typeof n&&At(7),Nt(e)){var u=tr(t),s=fr(t,e,void 0),c=!0;try{i=r(s),c=!1}finally{c?Zt(u):er(u)}return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return $t(u,n),nr(e,u)}),(function(e){throw Zt(u),e})):($t(u,n),nr(i,u))}if(!e||"object"!=typeof e){if((i=r(e))===Tr)return;return void 0===i&&(i=e),t.F&&Kt(i,!0),i}At(21,e)},this.produceWithPatches=function(e,r){return"function"==typeof e?function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return t.produceWithPatches(r,(function(t){return e.apply(void 0,[t].concat(o))}))}:[t.produce(e,r,(function(e,t){n=e,o=t})),n,o];var n,o},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){Nt(e)||At(8),Rt(e)&&(e=dr(e));var t=tr(this),r=fr(this,e,void 0);return r[Sr].C=!0,er(t),r},t.finishDraft=function(e,t){var r=e&&e[Sr];"production"!==process.env.NODE_ENV&&(r&&r.C||At(9),r.I&&At(10));var n=r.A;return $t(n,t),nr(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!Or&&At(20),this.g=e},t.applyPatches=function(e,t){var r;for(r=t.length-1;r>=0;r--){var n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}var o=Jt("Patches").$;return Rt(e)?o(e,t):this.produce(e,(function(e){return o(e,t.slice(r+1))}))},e}(),Nr=new Rr,Mr=Nr.produce,Ur=Nr.produceWithPatches.bind(Nr),Br=Nr.setAutoFreeze.bind(Nr),Lr=Nr.setUseProxies.bind(Nr),qr=Nr.applyPatches.bind(Nr),Fr=Nr.createDraft.bind(Nr),Hr=Nr.finishDraft.bind(Nr),Wr=r(Object.freeze({__proto__:null,default:Mr,Immer:Rr,applyPatches:qr,castDraft:function(e){return e},castImmutable:function(e){return e},createDraft:Fr,current:dr,enableAllPlugins:function(){pr(),vr(),gr()},enableES5:pr,enableMapSet:vr,enablePatches:gr,finishDraft:Hr,freeze:Kt,immerable:Ir,isDraft:Rt,isDraftable:Nt,nothing:Tr,original:function(e){return Rt(e)||At(23,e),e[Sr].t},produce:Mr,produceWithPatches:Ur,setAutoFreeze:Br,setUseProxies:Lr})),zr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createState=void 0,t.createState=function(e){var t=e;return{current:function(){return t},get:function(e){return t[e]},update:function(e){t=Wr.produce(t,e)}}}})),Yr=t((function(e,t){e.exports=function e(t,r,o){function a(u,s){if(!r[u]){if(!t[u]){if(!s&&n)return n();if(i)return i(u,!0);throw new Error("Cannot find module '"+u+"'")}var c=r[u]={exports:{}};t[u][0].call(c.exports,(function(e){return a(t[u][1][e]||e)}),c,c.exports,e,t,r,o)}return r[u].exports}for(var i=n,u=0;u<o.length;u++)a(o[u]);return a}({1:[function(e,t,r){(function(n,o,a,i,u,s,c,l,f){var d=e("crypto");function h(e,t){return function(e,t){var r;if(void 0===(r="passthrough"!==t.algorithm?d.createHash(t.algorithm):new b).write&&(r.write=r.update,r.end=r.update),m(t,r).dispatch(e),r.update||r.end(""),r.digest)return r.digest("buffer"===t.encoding?void 0:t.encoding);var n=r.read();return"buffer"!==t.encoding?n.toString(t.encoding):n}(e,t=v(e,t))}(r=t.exports=h).sha1=function(e){return h(e)},r.keys=function(e){return h(e,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},r.MD5=function(e){return h(e,{algorithm:"md5",encoding:"hex"})},r.keysMD5=function(e){return h(e,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var p=d.getHashes?d.getHashes().slice():["sha1","md5"];p.push("passthrough");var g=["buffer","hex","binary","base64"];function v(e,t){t=t||{};var r={};if(r.algorithm=t.algorithm||"sha1",r.encoding=t.encoding||"hex",r.excludeValues=!!t.excludeValues,r.algorithm=r.algorithm.toLowerCase(),r.encoding=r.encoding.toLowerCase(),r.ignoreUnknown=!0===t.ignoreUnknown,r.respectType=!1!==t.respectType,r.respectFunctionNames=!1!==t.respectFunctionNames,r.respectFunctionProperties=!1!==t.respectFunctionProperties,r.unorderedArrays=!0===t.unorderedArrays,r.unorderedSets=!1!==t.unorderedSets,r.unorderedObjects=!1!==t.unorderedObjects,r.replacer=t.replacer||void 0,r.excludeKeys=t.excludeKeys||void 0,void 0===e)throw new Error("Object argument required.");for(var n=0;n<p.length;++n)p[n].toLowerCase()===r.algorithm.toLowerCase()&&(r.algorithm=p[n]);if(-1===p.indexOf(r.algorithm))throw new Error('Algorithm "'+r.algorithm+'" not supported. supported values: '+p.join(", "));if(-1===g.indexOf(r.encoding)&&"passthrough"!==r.algorithm)throw new Error('Encoding "'+r.encoding+'" not supported. supported values: '+g.join(", "));return r}function y(e){if("function"==typeof e)return null!=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(e))}function m(e,t,r){function n(e){return t.update?t.update(e,"utf8"):t.write(e,"utf8")}return r=r||[],{dispatch:function(t){return e.replacer&&(t=e.replacer(t)),this["_"+(null===t?"null":typeof t)](t)},_object:function(t){var o,i=Object.prototype.toString.call(t),u=/\[object (.*)\]/i.exec(i);if(u=(u=u?u[1]:"unknown:["+i+"]").toLowerCase(),0<=(o=r.indexOf(t)))return this.dispatch("[CIRCULAR:"+o+"]");if(r.push(t),void 0!==a&&a.isBuffer&&a.isBuffer(t))return n("buffer:"),n(t);if("object"===u||"function"===u||"asyncfunction"===u){var s=Object.keys(t);e.unorderedObjects&&(s=s.sort()),!1===e.respectType||y(t)||s.splice(0,0,"prototype","__proto__","constructor"),e.excludeKeys&&(s=s.filter((function(t){return!e.excludeKeys(t)}))),n("object:"+s.length+":");var c=this;return s.forEach((function(r){c.dispatch(r),n(":"),e.excludeValues||c.dispatch(t[r]),n(",")}))}if(!this["_"+u]){if(e.ignoreUnknown)return n("["+u+"]");throw new Error('Unknown object type "'+u+'"')}this["_"+u](t)},_array:function(t,o){o=void 0!==o?o:!1!==e.unorderedArrays;var a=this;if(n("array:"+t.length+":"),!o||t.length<=1)return t.forEach((function(e){return a.dispatch(e)}));var i=[],u=t.map((function(t){var n=new b,o=r.slice();return m(e,n,o).dispatch(t),i=i.concat(o.slice(r.length)),n.read().toString()}));return r=r.concat(i),u.sort(),this._array(u,!1)},_date:function(e){return n("date:"+e.toJSON())},_symbol:function(e){return n("symbol:"+e.toString())},_error:function(e){return n("error:"+e.toString())},_boolean:function(e){return n("bool:"+e.toString())},_string:function(e){n("string:"+e.length+":"),n(e.toString())},_function:function(t){n("fn:"),y(t)?this.dispatch("[native]"):this.dispatch(t.toString()),!1!==e.respectFunctionNames&&this.dispatch("function-name:"+String(t.name)),e.respectFunctionProperties&&this._object(t)},_number:function(e){return n("number:"+e.toString())},_xml:function(e){return n("xml:"+e.toString())},_null:function(){return n("Null")},_undefined:function(){return n("Undefined")},_regexp:function(e){return n("regex:"+e.toString())},_uint8array:function(e){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint8clampedarray:function(e){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(e))},_int8array:function(e){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint16array:function(e){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_int16array:function(e){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_uint32array:function(e){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_int32array:function(e){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_float32array:function(e){return n("float32array:"),this.dispatch(Array.prototype.slice.call(e))},_float64array:function(e){return n("float64array:"),this.dispatch(Array.prototype.slice.call(e))},_arraybuffer:function(e){return n("arraybuffer:"),this.dispatch(new Uint8Array(e))},_url:function(e){return n("url:"+e.toString())},_map:function(t){n("map:");var r=Array.from(t);return this._array(r,!1!==e.unorderedSets)},_set:function(t){n("set:");var r=Array.from(t);return this._array(r,!1!==e.unorderedSets)},_file:function(e){return n("file:"),this.dispatch([e.name,e.size,e.type,e.lastModfied])},_blob:function(){if(e.ignoreUnknown)return n("[blob]");throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n')},_domwindow:function(){return n("domwindow")},_process:function(){return n("process")},_timer:function(){return n("timer")},_pipe:function(){return n("pipe")},_tcp:function(){return n("tcp")},_udp:function(){return n("udp")},_tty:function(){return n("tty")},_statwatcher:function(){return n("statwatcher")},_securecontext:function(){return n("securecontext")},_connection:function(){return n("connection")},_zlib:function(){return n("zlib")},_context:function(){return n("context")},_nodescript:function(){return n("nodescript")},_httpparser:function(){return n("httpparser")},_dataview:function(){return n("dataview")},_signal:function(){return n("signal")},_fsevent:function(){return n("fsevent")},_tlswrap:function(){return n("tlswrap")}}}function b(){return{buf:"",write:function(e){this.buf+=e},end:function(e){this.buf+=e},read:function(){return this.buf}}}r.writeToStream=function(e,t,r){return void 0===r&&(r=t,t={}),m(t=v(e,t),r).dispatch(e)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_5812b7fb.js","/")},{buffer:3,crypto:5,lYpoI2:10}],2:[function(e,t,r){(function(e,t,n,o,a,i,u,s,c){!function(e){var t="undefined"!=typeof Uint8Array?Uint8Array:Array,r="+".charCodeAt(0),n="/".charCodeAt(0),o="0".charCodeAt(0),a="a".charCodeAt(0),i="A".charCodeAt(0),u="-".charCodeAt(0),s="_".charCodeAt(0);function c(e){var t=e.charCodeAt(0);return t===r||t===u?62:t===n||t===s?63:t<o?-1:t<o+10?t-o+26+26:t<i+26?t-i:t<a+26?t-a+26:void 0}e.toByteArray=function(e){var r,n;if(0<e.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.length,a="="===e.charAt(o-2)?2:"="===e.charAt(o-1)?1:0,i=new t(3*e.length/4-a),u=0<a?e.length-4:e.length,s=0;function l(e){i[s++]=e}for(r=0;r<u;r+=4,0)l((16711680&(n=c(e.charAt(r))<<18|c(e.charAt(r+1))<<12|c(e.charAt(r+2))<<6|c(e.charAt(r+3))))>>16),l((65280&n)>>8),l(255&n);return 2==a?l(255&(n=c(e.charAt(r))<<2|c(e.charAt(r+1))>>4)):1==a&&(l((n=c(e.charAt(r))<<10|c(e.charAt(r+1))<<4|c(e.charAt(r+2))>>2)>>8&255),l(255&n)),i},e.fromByteArray=function(e){var t,r,n,o,a=e.length%3,i="";function u(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,n=e.length-a;t<n;t+=3)i+=u((o=r=(e[t]<<16)+(e[t+1]<<8)+e[t+2])>>18&63)+u(o>>12&63)+u(o>>6&63)+u(63&o);switch(a){case 1:i+=u((r=e[e.length-1])>>2),i+=u(r<<4&63),i+="==";break;case 2:i+=u((r=(e[e.length-2]<<8)+e[e.length-1])>>10),i+=u(r>>4&63),i+=u(r<<2&63),i+="="}return i}}(void 0===r?this.base64js={}:r)}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:10}],3:[function(e,t,r){(function(t,n,o,a,i,u,s,c,l){var f=e("base64-js"),d=e("ieee754");function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var n,a,i,u,s,c=typeof e;if("base64"===t&&"string"==c)for(e=(n=e).trim?n.trim():n.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==c)a=j(e);else if("string"==c)a=o.byteLength(e,t);else{if("object"!=c)throw new Error("First argument needs to be a number, array or string.");a=j(e.length)}if(o._useTypedArrays?i=o._augment(new Uint8Array(a)):((i=this).length=a,i._isBuffer=!0),o._useTypedArrays&&"number"==typeof e.byteLength)i._set(e);else if(C(s=e)||o.isBuffer(s)||s&&"object"==typeof s&&"number"==typeof s.length)for(u=0;u<a;u++)o.isBuffer(e)?i[u]=e.readUInt8(u):i[u]=e[u];else if("string"==c)i.write(e,0,t);else if("number"==c&&!o._useTypedArrays&&!r)for(u=0;u<a;u++)i[u]=0;return i}function h(e,t,r,n){return o._charsWritten=N(function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function p(e,t,r,n){return o._charsWritten=N(function(e){for(var t,r,n,o=[],a=0;a<e.length;a++)r=(t=e.charCodeAt(a))>>8,n=t%256,o.push(n),o.push(r);return o}(t),e,r,n)}function g(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;o++)n+=String.fromCharCode(e[o]);return n}function v(e,t,r,n){n||(q("boolean"==typeof r,"missing or invalid endian"),q(null!=t,"missing offset"),q(t+1<e.length,"Trying to read beyond buffer length"));var o,a=e.length;if(!(a<=t))return r?(o=e[t],t+1<a&&(o|=e[t+1]<<8)):(o=e[t]<<8,t+1<a&&(o|=e[t+1])),o}function y(e,t,r,n){n||(q("boolean"==typeof r,"missing or invalid endian"),q(null!=t,"missing offset"),q(t+3<e.length,"Trying to read beyond buffer length"));var o,a=e.length;if(!(a<=t))return r?(t+2<a&&(o=e[t+2]<<16),t+1<a&&(o|=e[t+1]<<8),o|=e[t],t+3<a&&(o+=e[t+3]<<24>>>0)):(t+1<a&&(o=e[t+1]<<16),t+2<a&&(o|=e[t+2]<<8),t+3<a&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}function m(e,t,r,n){if(n||(q("boolean"==typeof r,"missing or invalid endian"),q(null!=t,"missing offset"),q(t+1<e.length,"Trying to read beyond buffer length")),!(e.length<=t)){var o=v(e,t,r,!0);return 32768&o?-1*(65535-o+1):o}}function b(e,t,r,n){if(n||(q("boolean"==typeof r,"missing or invalid endian"),q(null!=t,"missing offset"),q(t+3<e.length,"Trying to read beyond buffer length")),!(e.length<=t)){var o=y(e,t,r,!0);return 2147483648&o?-1*(4294967295-o+1):o}}function _(e,t,r,n){return n||(q("boolean"==typeof r,"missing or invalid endian"),q(t+3<e.length,"Trying to read beyond buffer length")),d.read(e,t,r,23,4)}function w(e,t,r,n){return n||(q("boolean"==typeof r,"missing or invalid endian"),q(t+7<e.length,"Trying to read beyond buffer length")),d.read(e,t,r,52,8)}function O(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+1<e.length,"trying to write beyond buffer length"),U(t,65535));var a=e.length;if(!(a<=r))for(var i=0,u=Math.min(a-r,2);i<u;i++)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function T(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+3<e.length,"trying to write beyond buffer length"),U(t,4294967295));var a=e.length;if(!(a<=r))for(var i=0,u=Math.min(a-r,4);i<u;i++)e[r+i]=t>>>8*(n?i:3-i)&255}function I(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+1<e.length,"Trying to write beyond buffer length"),B(t,32767,-32768)),e.length<=r||O(e,0<=t?t:65535+t+1,r,n,o)}function S(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+3<e.length,"Trying to write beyond buffer length"),B(t,2147483647,-2147483648)),e.length<=r||T(e,0<=t?t:4294967295+t+1,r,n,o)}function x(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+3<e.length,"Trying to write beyond buffer length"),L(t,34028234663852886e22,-34028234663852886e22)),e.length<=r||d.write(e,t,r,n,23,4)}function P(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+7<e.length,"Trying to write beyond buffer length"),L(t,17976931348623157e292,-17976931348623157e292)),e.length<=r||d.write(e,t,r,n,52,8)}r.Buffer=o,r.SlowBuffer=o,r.INSPECT_MAX_BYTES=50,o.poolSize=8192,o._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(e){return!1}}(),o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=A(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=R(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw new Error("Unknown encoding")}return r},o.concat=function(e,t){if(q(C(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new o(0);if(1===e.length)return e[0];if("number"!=typeof t)for(a=t=0;a<e.length;a++)t+=e[a].length;for(var r=new o(t),n=0,a=0;a<e.length;a++){var i=e[a];i.copy(r,n),n+=i.length}return r},o.prototype.write=function(e,t,r,n){var a;isFinite(t)?isFinite(r)||(n=r,r=void 0):(a=n,n=t,t=r,r=a),t=Number(t)||0;var i,u,s,c,l,f,d,g,v,y=this.length-t;switch((!r||y<(r=Number(r)))&&(r=y),n=String(n||"utf8").toLowerCase()){case"hex":i=function(e,t,r,n){r=Number(r)||0;var a=e.length-r;(!n||a<(n=Number(n)))&&(n=a);var i=t.length;q(i%2==0,"Invalid hex string"),i/2<n&&(n=i/2);for(var u=0;u<n;u++){var s=parseInt(t.substr(2*u,2),16);q(!isNaN(s),"Invalid hex string"),e[r+u]=s}return o._charsWritten=2*u,u}(this,e,t,r);break;case"utf8":case"utf-8":f=this,d=e,g=t,v=r,i=o._charsWritten=N(A(d),f,g,v);break;case"ascii":case"binary":i=h(this,e,t,r);break;case"base64":u=this,s=e,c=t,l=r,i=o._charsWritten=N(R(s),u,c,l);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=p(this,e,t,r);break;default:throw new Error("Unknown encoding")}return i},o.prototype.toString=function(e,t,r){var n,o,a,i,u=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(r=void 0!==r?Number(r):r=u.length)===t)return"";switch(e){case"hex":n=function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||n<r)&&(r=n);for(var o="",a=t;a<r;a++)o+=D(e[a]);return o}(u,t,r);break;case"utf8":case"utf-8":n=function(e,t,r){var n="",o="";r=Math.min(e.length,r);for(var a=t;a<r;a++)e[a]<=127?(n+=M(o)+String.fromCharCode(e[a]),o=""):o+="%"+e[a].toString(16);return n+M(o)}(u,t,r);break;case"ascii":case"binary":n=g(u,t,r);break;case"base64":o=u,i=r,n=0===(a=t)&&i===o.length?f.fromByteArray(o):f.fromByteArray(o.slice(a,i));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=function(e,t,r){for(var n=e.slice(t,r),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+256*n[a+1]);return o}(u,t,r);break;default:throw new Error("Unknown encoding")}return n},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.copy=function(e,t,r,n){if(r=r||0,n||0===n||(n=this.length),t=t||0,n!==r&&0!==e.length&&0!==this.length){q(r<=n,"sourceEnd < sourceStart"),q(0<=t&&t<e.length,"targetStart out of bounds"),q(0<=r&&r<this.length,"sourceStart out of bounds"),q(0<=n&&n<=this.length,"sourceEnd out of bounds"),n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var a=n-r;if(a<100||!o._useTypedArrays)for(var i=0;i<a;i++)e[i+t]=this[i+r];else e._set(this.subarray(r,r+a),t)}},o.prototype.slice=function(e,t){var r=this.length;if(e=k(e,r,0),t=k(t,r,r),o._useTypedArrays)return o._augment(this.subarray(e,t));for(var n=t-e,a=new o(n,void 0,!0),i=0;i<n;i++)a[i]=this[i+e];return a},o.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},o.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},o.prototype.readUInt8=function(e,t){if(t||(q(null!=e,"missing offset"),q(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return this[e]},o.prototype.readUInt16LE=function(e,t){return v(this,e,!0,t)},o.prototype.readUInt16BE=function(e,t){return v(this,e,!1,t)},o.prototype.readUInt32LE=function(e,t){return y(this,e,!0,t)},o.prototype.readUInt32BE=function(e,t){return y(this,e,!1,t)},o.prototype.readInt8=function(e,t){if(t||(q(null!=e,"missing offset"),q(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){return m(this,e,!0,t)},o.prototype.readInt16BE=function(e,t){return m(this,e,!1,t)},o.prototype.readInt32LE=function(e,t){return b(this,e,!0,t)},o.prototype.readInt32BE=function(e,t){return b(this,e,!1,t)},o.prototype.readFloatLE=function(e,t){return _(this,e,!0,t)},o.prototype.readFloatBE=function(e,t){return _(this,e,!1,t)},o.prototype.readDoubleLE=function(e,t){return w(this,e,!0,t)},o.prototype.readDoubleBE=function(e,t){return w(this,e,!1,t)},o.prototype.writeUInt8=function(e,t,r){r||(q(null!=e,"missing value"),q(null!=t,"missing offset"),q(t<this.length,"trying to write beyond buffer length"),U(e,255)),t>=this.length||(this[t]=e)},o.prototype.writeUInt16LE=function(e,t,r){O(this,e,t,!0,r)},o.prototype.writeUInt16BE=function(e,t,r){O(this,e,t,!1,r)},o.prototype.writeUInt32LE=function(e,t,r){T(this,e,t,!0,r)},o.prototype.writeUInt32BE=function(e,t,r){T(this,e,t,!1,r)},o.prototype.writeInt8=function(e,t,r){r||(q(null!=e,"missing value"),q(null!=t,"missing offset"),q(t<this.length,"Trying to write beyond buffer length"),B(e,127,-128)),t>=this.length||(0<=e?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},o.prototype.writeInt16LE=function(e,t,r){I(this,e,t,!0,r)},o.prototype.writeInt16BE=function(e,t,r){I(this,e,t,!1,r)},o.prototype.writeInt32LE=function(e,t,r){S(this,e,t,!0,r)},o.prototype.writeInt32BE=function(e,t,r){S(this,e,t,!1,r)},o.prototype.writeFloatLE=function(e,t,r){x(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){x(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){P(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){P(this,e,t,!1,r)},o.prototype.fill=function(e,t,r){if(e=e||0,t=t||0,r=r||this.length,"string"==typeof e&&(e=e.charCodeAt(0)),q("number"==typeof e&&!isNaN(e),"value is not a number"),q(t<=r,"end < start"),r!==t&&0!==this.length){q(0<=t&&t<this.length,"start out of bounds"),q(0<=r&&r<=this.length,"end out of bounds");for(var n=t;n<r;n++)this[n]=e}},o.prototype.inspect=function(){for(var e=[],t=this.length,n=0;n<t;n++)if(e[n]=D(this[n]),n===r.INSPECT_MAX_BYTES){e[n+1]="...";break}return"<Buffer "+e.join(" ")+">"},o.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(o._useTypedArrays)return new o(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;t<r;t+=1)e[t]=this[t];return e.buffer};var E=o.prototype;function k(e,t,r){return"number"!=typeof e?r:t<=(e=~~e)?t:0<=e||0<=(e+=t)?e:0}function j(e){return(e=~~Math.ceil(+e))<0?0:e}function C(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function D(e){return e<16?"0"+e.toString(16):e.toString(16)}function A(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<=127)t.push(e.charCodeAt(r));else{var o=r;55296<=n&&n<=57343&&r++;for(var a=encodeURIComponent(e.slice(o,r+1)).substr(1).split("%"),i=0;i<a.length;i++)t.push(parseInt(a[i],16))}}return t}function R(e){return f.toByteArray(e)}function N(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);o++)t[o+r]=e[o];return o}function M(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function U(e,t){q("number"==typeof e,"cannot write a non-number as a number"),q(0<=e,"specified a negative value for writing an unsigned value"),q(e<=t,"value is larger than maximum value for type"),q(Math.floor(e)===e,"value has a fractional component")}function B(e,t,r){q("number"==typeof e,"cannot write a non-number as a number"),q(e<=t,"value larger than maximum allowed value"),q(r<=e,"value smaller than minimum allowed value"),q(Math.floor(e)===e,"value has a fractional component")}function L(e,t,r){q("number"==typeof e,"cannot write a non-number as a number"),q(e<=t,"value larger than maximum allowed value"),q(r<=e,"value smaller than minimum allowed value")}function q(e,t){if(!e)throw new Error(t||"Failed assertion")}o._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=E.get,e.set=E.set,e.write=E.write,e.toString=E.toString,e.toLocaleString=E.toString,e.toJSON=E.toJSON,e.copy=E.copy,e.slice=E.slice,e.readUInt8=E.readUInt8,e.readUInt16LE=E.readUInt16LE,e.readUInt16BE=E.readUInt16BE,e.readUInt32LE=E.readUInt32LE,e.readUInt32BE=E.readUInt32BE,e.readInt8=E.readInt8,e.readInt16LE=E.readInt16LE,e.readInt16BE=E.readInt16BE,e.readInt32LE=E.readInt32LE,e.readInt32BE=E.readInt32BE,e.readFloatLE=E.readFloatLE,e.readFloatBE=E.readFloatBE,e.readDoubleLE=E.readDoubleLE,e.readDoubleBE=E.readDoubleBE,e.writeUInt8=E.writeUInt8,e.writeUInt16LE=E.writeUInt16LE,e.writeUInt16BE=E.writeUInt16BE,e.writeUInt32LE=E.writeUInt32LE,e.writeUInt32BE=E.writeUInt32BE,e.writeInt8=E.writeInt8,e.writeInt16LE=E.writeInt16LE,e.writeInt16BE=E.writeInt16BE,e.writeInt32LE=E.writeInt32LE,e.writeInt32BE=E.writeInt32BE,e.writeFloatLE=E.writeFloatLE,e.writeFloatBE=E.writeFloatBE,e.writeDoubleLE=E.writeDoubleLE,e.writeDoubleBE=E.writeDoubleBE,e.fill=E.fill,e.inspect=E.inspect,e.toArrayBuffer=E.toArrayBuffer,e}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:11,lYpoI2:10}],4:[function(e,t,r){(function(r,n,o,a,i,u,s,c,l){o=e("buffer").Buffer;var f=4,d=new o(f);d.fill(0),t.exports={hash:function(e,t,r,n){return o.isBuffer(e)||(e=new o(e)),function(e,t,r){for(var n=new o(t),a=r?n.writeInt32BE:n.writeInt32LE,i=0;i<e.length;i++)a.call(n,e[i],4*i,!0);return n}(t(function(e,t){var r;e.length%f!=0&&(r=e.length+(f-e.length%f),e=o.concat([e,d],r));for(var n=[],a=t?e.readInt32BE:e.readInt32LE,i=0;i<e.length;i+=f)n.push(a.call(e,i));return n}(e,n),8*e.length),r,n)}}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],5:[function(e,t,r){(function(t,n,o,a,i,u,s,c,l){o=e("buffer").Buffer;var f=e("./sha"),d=e("./sha256"),h=e("./rng"),p={sha1:f,sha256:d,md5:e("./md5")},g=64,v=new o(g);function y(e,t){var r=p[e=e||"sha1"],n=[];return r||m("algorithm:",e,"is not yet supported"),{update:function(e){return o.isBuffer(e)||(e=new o(e)),n.push(e),e.length,this},digest:function(e){var a=o.concat(n),i=t?function(e,t,r){o.isBuffer(t)||(t=new o(t)),o.isBuffer(r)||(r=new o(r)),t.length>g?t=e(t):t.length<g&&(t=o.concat([t,v],g));for(var n=new o(g),a=new o(g),i=0;i<g;i++)n[i]=54^t[i],a[i]=92^t[i];var u=e(o.concat([n,r]));return e(o.concat([a,u]))}(r,t,a):r(a);return n=null,e?i.toString(e):i}}}function m(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}v.fill(0),r.createHash=function(e){return y(e)},r.createHmac=y,r.randomBytes=function(e,t){if(!t||!t.call)return new o(h(e));try{t.call(this,void 0,new o(h(e)))}catch(e){t(e)}},function(e,t){for(var r in e)t(e[r],r)}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],(function(e){r[e]=function(){m("sorry,",e,"is not implemented yet")}}))}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:10}],6:[function(e,t,r){(function(r,n,o,a,i,u,s,c,l){var f=e("./helpers");function d(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var r=1732584193,n=-271733879,o=-1732584194,a=271733878,i=0;i<e.length;i+=16){var u=r,s=n,c=o,l=a;r=p(r,n,o,a,e[i+0],7,-680876936),a=p(a,r,n,o,e[i+1],12,-389564586),o=p(o,a,r,n,e[i+2],17,606105819),n=p(n,o,a,r,e[i+3],22,-1044525330),r=p(r,n,o,a,e[i+4],7,-176418897),a=p(a,r,n,o,e[i+5],12,1200080426),o=p(o,a,r,n,e[i+6],17,-1473231341),n=p(n,o,a,r,e[i+7],22,-45705983),r=p(r,n,o,a,e[i+8],7,1770035416),a=p(a,r,n,o,e[i+9],12,-1958414417),o=p(o,a,r,n,e[i+10],17,-42063),n=p(n,o,a,r,e[i+11],22,-1990404162),r=p(r,n,o,a,e[i+12],7,1804603682),a=p(a,r,n,o,e[i+13],12,-40341101),o=p(o,a,r,n,e[i+14],17,-1502002290),r=g(r,n=p(n,o,a,r,e[i+15],22,1236535329),o,a,e[i+1],5,-165796510),a=g(a,r,n,o,e[i+6],9,-1069501632),o=g(o,a,r,n,e[i+11],14,643717713),n=g(n,o,a,r,e[i+0],20,-373897302),r=g(r,n,o,a,e[i+5],5,-701558691),a=g(a,r,n,o,e[i+10],9,38016083),o=g(o,a,r,n,e[i+15],14,-660478335),n=g(n,o,a,r,e[i+4],20,-405537848),r=g(r,n,o,a,e[i+9],5,568446438),a=g(a,r,n,o,e[i+14],9,-1019803690),o=g(o,a,r,n,e[i+3],14,-187363961),n=g(n,o,a,r,e[i+8],20,1163531501),r=g(r,n,o,a,e[i+13],5,-1444681467),a=g(a,r,n,o,e[i+2],9,-51403784),o=g(o,a,r,n,e[i+7],14,1735328473),r=v(r,n=g(n,o,a,r,e[i+12],20,-1926607734),o,a,e[i+5],4,-378558),a=v(a,r,n,o,e[i+8],11,-2022574463),o=v(o,a,r,n,e[i+11],16,1839030562),n=v(n,o,a,r,e[i+14],23,-35309556),r=v(r,n,o,a,e[i+1],4,-1530992060),a=v(a,r,n,o,e[i+4],11,1272893353),o=v(o,a,r,n,e[i+7],16,-155497632),n=v(n,o,a,r,e[i+10],23,-1094730640),r=v(r,n,o,a,e[i+13],4,681279174),a=v(a,r,n,o,e[i+0],11,-358537222),o=v(o,a,r,n,e[i+3],16,-722521979),n=v(n,o,a,r,e[i+6],23,76029189),r=v(r,n,o,a,e[i+9],4,-640364487),a=v(a,r,n,o,e[i+12],11,-421815835),o=v(o,a,r,n,e[i+15],16,530742520),r=y(r,n=v(n,o,a,r,e[i+2],23,-995338651),o,a,e[i+0],6,-198630844),a=y(a,r,n,o,e[i+7],10,1126891415),o=y(o,a,r,n,e[i+14],15,-1416354905),n=y(n,o,a,r,e[i+5],21,-57434055),r=y(r,n,o,a,e[i+12],6,1700485571),a=y(a,r,n,o,e[i+3],10,-1894986606),o=y(o,a,r,n,e[i+10],15,-1051523),n=y(n,o,a,r,e[i+1],21,-2054922799),r=y(r,n,o,a,e[i+8],6,1873313359),a=y(a,r,n,o,e[i+15],10,-30611744),o=y(o,a,r,n,e[i+6],15,-1560198380),n=y(n,o,a,r,e[i+13],21,1309151649),r=y(r,n,o,a,e[i+4],6,-145523070),a=y(a,r,n,o,e[i+11],10,-1120210379),o=y(o,a,r,n,e[i+2],15,718787259),n=y(n,o,a,r,e[i+9],21,-343485551),r=m(r,u),n=m(n,s),o=m(o,c),a=m(a,l)}return Array(r,n,o,a)}function h(e,t,r,n,o,a){return m((i=m(m(t,e),m(n,a)))<<(u=o)|i>>>32-u,r);var i,u}function p(e,t,r,n,o,a,i){return h(t&r|~t&n,e,t,o,a,i)}function g(e,t,r,n,o,a,i){return h(t&n|r&~n,e,t,o,a,i)}function v(e,t,r,n,o,a,i){return h(t^r^n,e,t,o,a,i)}function y(e,t,r,n,o,a,i){return h(r^(t|~n),e,t,o,a,i)}function m(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return f.hash(e,d,16)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],7:[function(e,t,r){(function(e,r,n,o,a,i,u,s,c){var l;l=function(e){for(var t,r=new Array(e),n=0;n<e;n++)0==(3&n)&&(t=4294967296*Math.random()),r[n]=t>>>((3&n)<<3)&255;return r},t.exports=l}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],8:[function(e,t,r){(function(r,n,o,a,i,u,s,c,l){var f=e("./helpers");function d(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var r,n,o,a,i,u=Array(80),s=1732584193,c=-271733879,l=-1732584194,f=271733878,d=-1009589776,g=0;g<e.length;g+=16){for(var v=s,y=c,m=l,b=f,_=d,w=0;w<80;w++){u[w]=w<16?e[g+w]:p(u[w-3]^u[w-8]^u[w-14]^u[w-16],1);var O=h(h(p(s,5),(o=c,a=l,i=f,(n=w)<20?o&a|~o&i:!(n<40)&&n<60?o&a|o&i|a&i:o^a^i)),h(h(d,u[w]),(r=w)<20?1518500249:r<40?1859775393:r<60?-1894007588:-899497514));d=f,f=l,l=p(c,30),c=s,s=O}s=h(s,v),c=h(c,y),l=h(l,m),f=h(f,b),d=h(d,_)}return Array(s,c,l,f,d)}function h(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function p(e,t){return e<<t|e>>>32-t}t.exports=function(e){return f.hash(e,d,20,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],9:[function(e,t,r){(function(r,n,o,a,i,u,s,c,l){function f(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function d(e,t){return e>>>t|e<<32-t}function h(e,t){var r,n,o,a,i,u,s,c,l,h,p=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),g=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),v=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var y,m,b,_,w,O,T,I,S=0;S<e.length;S+=16){r=g[0],n=g[1],o=g[2],a=g[3],i=g[4],u=g[5],s=g[6],c=g[7];for(var x=0;x<64;x++)v[x]=x<16?e[x+S]:f(f(f(d(I=v[x-2],17)^d(I,19)^I>>>10,v[x-7]),d(T=v[x-15],7)^d(T,18)^T>>>3),v[x-16]),l=f(f(f(f(c,d(O=i,6)^d(O,11)^d(O,25)),(w=i)&u^~w&s),p[x]),v[x]),h=f(d(_=r,2)^d(_,13)^d(_,22),(y=r)&(m=n)^y&(b=o)^m&b),c=s,s=u,u=i,i=f(a,l),a=o,o=n,n=r,r=f(l,h);g[0]=f(r,g[0]),g[1]=f(n,g[1]),g[2]=f(o,g[2]),g[3]=f(a,g[3]),g[4]=f(i,g[4]),g[5]=f(u,g[5]),g[6]=f(s,g[6]),g[7]=f(c,g[7])}return g}var p=e("./helpers");t.exports=function(e){return p.hash(e,h,32,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],10:[function(e,t,r){(function(e,r,n,o,a,i,u,s,c){function l(){}(e=t.exports={}).nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",(function(e){var t=e.source;t!==window&&null!==t||"process-tick"!==e.data||(e.stopPropagation(),0<r.length&&r.shift()())}),!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=l,e.addListener=l,e.once=l,e.off=l,e.removeListener=l,e.removeAllListeners=l,e.emit=l,e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){throw new Error("process.chdir is not supported")}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:10}],11:[function(e,t,r){(function(e,t,n,o,a,i,u,s,c){r.read=function(e,t,r,n,o){var a,i,u=8*o-n-1,s=(1<<u)-1,c=s>>1,l=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,a=h&(1<<-l)-1,h>>=-l,l+=u;0<l;a=256*a+e[t+f],f+=d,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=n;0<l;i=256*i+e[t+f],f+=d,l-=8);if(0===a)a=1-c;else{if(a===s)return i?NaN:1/0*(h?-1:1);i+=Math.pow(2,n),a-=c}return(h?-1:1)*i*Math.pow(2,a-n)},r.write=function(e,t,r,n,o,a){var i,u,s,c=8*a-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-i))<1&&(i--,s*=2),2<=(t+=1<=i+f?d/s:d*Math.pow(2,1-f))*s&&(i++,s/=2),l<=i+f?(u=0,i=l):1<=i+f?(u=(t*s-1)*Math.pow(2,o),i+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,o),i=0));8<=o;e[r+h]=255&u,h+=p,u/=256,o-=8);for(i=i<<o|u,c+=o;0<c;e[r+h]=255&i,h+=p,i/=256,c-=8);e[r+h-p]|=128*g}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/ieee754/index.js","/node_modules/ieee754")},{buffer:3,lYpoI2:10}]},{},[1])(1)})),Kr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSearchId=void 0;var r=It.__importDefault(Yr);t.generateSearchId=function(e,t){var n=t.anonymousId,o=t.language,a=t.currency,i=t.countryCode;return r.default(It.__assign(It.__assign({},e),{anonymousId:n,language:o,currency:a,countryCode:i}))}})),Vr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.augmentHotelWithRegularPriceRange=void 0,t.augmentHotelWithRegularPriceRange=function(e,t,r){var n;if(void 0===(null===(n=e.pricing)||void 0===n?void 0:n.medianRateBkt)||void 0===r)return e;var o=e.pricing.medianRateBkt*r*t,a=(e.pricing.medianRateBkt+1)*r*t;return It.__assign(It.__assign({},e),{regularPriceRange:[Math.floor(o),Math.ceil(a)]})}})),Gr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmpty=void 0,t.removeEmpty=function e(t){return Object.entries(t).filter((function(e){e[0];var t=e[1];return null!=t})).reduce((function(t,r){var n,o=r[0],a=r[1];return It.__assign(It.__assign({},t),((n={})[o]=a===new Object(a)?e(a):a,n))}),{})}})),Jr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),It.__exportStar(Q,t),It.__exportStar(X,t),It.__exportStar(jt,t),It.__exportStar(Ct,t),It.__exportStar(Dt,t),It.__exportStar(zr,t),It.__exportStar(Kr,t),It.__exportStar(Vr,t),It.__exportStar(Gr,t)})),Qr=t((function(e,t){function r(e,t,r,n){return!(void 0!==r&&e.nightlyRate<r)&&!(void 0!==n&&n<t&&e.nightlyRate>n)}function n(e,t){var n,o=e.filters,a=void 0===o?{}:o,i=e.priceBucketWidth,u=e.priceBucketsCount,s=e.exchangeRate;if(void 0===i)return t;var c=a.priceMin,l=a.priceMax,f=u*Math.round(i*s);if((void 0!==c||void 0!==l)&&!(null===(n=t.offers)||void 0===n?void 0:n.some((function(e){return r(e,f,c,l)}))))return It.__assign(It.__assign({},t),{offers:[]});return t}function o(e,t){var r=t.sortField,n=t.sortOrder;return"price"===r?function(e,t){return e.sort((function(e,r){var n,o,a=(null!==(n=Jr.getCheapestRate(e))&&void 0!==n?n:0)-(null!==(o=Jr.getCheapestRate(r))&&void 0!==o?o:0);return"ascending"===t?a:-a}))}(e,void 0===n?"ascending":n):e}function a(e){var t=e.topOfferData,r=e.anchorPriceRateBreakdown,n=r.calculatedTotalRate,o=r.nightlyRate;return It.__assign(It.__assign({},t),{anchorPrice:n,anchorPriceNightly:o})}Object.defineProperty(t,"__esModule",{value:!0}),t.augmentRaaResponse=t.augmentHotelOffersWithAnchorPrice=t.augmentOffersWithAnchorPrice=t.augmentTopOfferDataWithAnchorPrice=t.applyPriceFilter=t.isOfferInPriceRange=t.generateSortingBoost=void 0,t.generateSortingBoost=function(e){var t;return(null===(t=null==e?void 0:e.filters)||void 0===t?void 0:t.freeCancellation)?"freeCancellation=true:100":void 0},t.isOfferInPriceRange=r,t.applyPriceFilter=n,t.augmentTopOfferDataWithAnchorPrice=a;function i(e,t){var r=e.offers;if(!(null==r?void 0:r.length))return r;var n=t.anchorPrice;return void 0===n?r:r.map((function(e){return It.__assign(It.__assign({},e),{hasAnchorPrice:n-e.calculatedTotalRate>.03*n})}))}function u(e){var t=e.anchorPriceRateBreakdown,r=e.topOfferData;if(void 0===t||void 0===r)return e;var n=a(e),o=i(e,n);return It.__assign(It.__assign({},e),{topOfferData:n,offers:o})}t.augmentOffersWithAnchorPrice=i,t.augmentHotelOffersWithAnchorPrice=u,t.augmentRaaResponse=function(e,t){var r,a=e.hotelOfferEntities,i=e.anchorHotelOfferEntity;a&&(r=a.map((function(e){return n(t,e)})),void 0!==t.sortField&&(r=o(r,t)));var s=[],c={};return null==r||r.forEach((function(e){s.push(e.id),c[e.id]=u(e)})),void 0!==i&&(c[i.id]=u(i)),{hotelIds:s,hotelOfferEntities:c}}})),Xr=r(I),$r=r(J),Zr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.raa=void 0;var r,n=It.__importDefault(Xr);!function(e){e[e.Connecting=0]="Connecting",e[e.Open=1]="Open",e[e.Closing=2]="Closing",e[e.Closed=3]="Closed"}(r||(r={}));t.raa=function(e,t){if(void 0===e)throw new TypeError("RAA endpoint must be provided");if("undefined"==typeof WebSocket&&void 0===t.WebSocket)throw new TypeError("Client does not support WebSocket");var o,a=new n.default(e,[],{maxRetries:20,WebSocket:t.WebSocket}),i={};function u(e){t.logger.log({name:"WebsocketConnectionClosed",value:{service:"daedalus",code:e.code,reason:e.reason,wasClean:e.wasClean}}),void 0!==i.current&&a.reconnect()}function s(e){t.logger.log({name:"WebsocketError",value:It.__assign(It.__assign({},e),{service:"daedalus"})}),void 0!==i.current&&a.reconnect()}function c(){var e=i.current;void 0!==e&&a.send(e)}function l(e){var t;try{t=JSON.parse(e.data)}catch(e){console.log("WEBSOCKET: error parsing message")}void 0!==o&&o(t)}return a.addEventListener("open",c),a.addEventListener("close",u),a.addEventListener("error",s),a.addEventListener("message",l),{getOffers:function(e,n){return It.__awaiter(this,void 0,void 0,(function(){var u;return It.__generator(this,(function(s){return u={},i.current=function(e,t){var r,n,o,a,i,u={checkIn:e.checkIn,checkOut:e.checkOut,destination:null!==(n=null===(r=e.hotelIds)||void 0===r?void 0:r.join(","))&&void 0!==n?n:"",getAllOffers:e.getAllOffers,highlightedHotelID:e.anchorHotelId,rooms:e.rooms,cugDeals:null===(o=e.cugDeals)||void 0===o?void 0:o.join(","),profileId:null!==(a=e.originId)&&void 0!==a?a:"default",searchId:e.searchId,useAlternativeRaaKeys:e.useAlternativeRaaKeys,preferredRate:e.preferredRate,trafficSource:e.trafficSource,deviceCategory:t.deviceType,languageCode:t.language,userCountryCode:t.countryCode,currencyCode:t.currency,anonymousId:t.anonymousId,includeLocalTaxes:t.includeLocalTaxes,includeTaxes:t.includeTaxes,skipBackendAugmentation:t.skipBackendAugmentation,facetsEnabled:t.facetsEnabled,sapiCliKey:t.sapiCliKey,sortingBoost:Qr.generateSortingBoost(e),clientRequestId:$r.v4(),roomLimit:1,anchorRoomLimit:2};try{i=JSON.stringify(u)}catch(e){console.log("WEBSOCKET: error serialising query")}return i}(e,t),[2,new Promise((function(t){o=function(r){var o;if(void 0!==r)if(r.status.complete)t(u),i.current=void 0;else{var a=r.results.find((function(t){return t.id===e.anchorHotelId}));a?u.anchorHotelOfferEntity=Jr.omit(["errors"],a):u.hotelOfferEntities=null===(o=r.results)||void 0===o?void 0:o.map((function(e){return Jr.omit(["errors"],e)})),"function"==typeof n&&n(It.__assign({},u))}},a.readyState===r.Open&&void 0!==i.current&&a.send(i.current)}))]}))}))}}}})),en=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),It.__exportStar(Zr,t),It.__exportStar(Qr,t)}));function tn(e){$(1,arguments);var t=Z(e);return t.setHours(0,0,0,0),t}var rn=864e5;function nn(e,t){$(2,arguments);var r=tn(e),n=tn(t),o=r.getTime()-Ye(r),a=n.getTime()-Ye(n);return Math.round((o-a)/rn)}function on(e,t){var r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}var an=r(Object.freeze({__proto__:null,default:function(e,t){$(2,arguments);var r=Z(e),n=Z(t),o=on(r,n),a=Math.abs(nn(r,n));r.setDate(r.getDate()-o*a);var i=on(r,n)===-o,u=o*(a-i);return 0===u?0:u}})),un=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.pickIndexVariation=t.hitToPlaceSuggest=t.hitToHotelSuggest=t.hitToPlaceTypeAnchor=t.hitToHotelTypeAnchor=t.hitToHotel=t.placeTypeToPlaceTypeName=t.validateHit=t.mergeTranslatedAttributes=t.attributeWithFallback=t.getValueFromTranslatedHightlightResult=t.getStringFromTranslatedArray=t.translatedArrayToString=t.toString=t.getTranslatedAttributes=t.isNotEmptyOrWhiteSpace=t.getTagsFilter=t.getCheckInNights=void 0;var r=It.__importDefault(an),n=It.__importDefault(St);function o(e,t){var o=Jr.dateToMiddayUTC(e),a=Jr.dateToMiddayUTC(t);return n.default(o,"yyMMdd")+"-"+r.default(a,o)}function a(e){return Boolean(e&&""!==(null==e?void 0:e.trim()))}function i(e,t){for(var r=0,n=t;r<n.length;r++){var o=n[r];if(a(null==e?void 0:e[o]))return e[o]}return""}function u(e,t,r){void 0===r&&(r=", ");var n={};return t.forEach((function(o){var i=e[o]||[];n[o]=i.map((function(r,n){if(a(r))return r;var o=t.find((function(t){var r;return a(null===(r=null==e?void 0:e[t])||void 0===r?void 0:r[n])}));return o?e[o][n]:""})).join(""+r)})),i(n,t)}function s(e,t,r){var n={};return t.forEach((function(o){var i=e[o]||[],u=-1===r?void 0:r+1,s=i.slice(r,u).toString();if(a(s))n[o]=s;else{var c=t.find((function(t){var n;return a(null===(n=null==e?void 0:e[t])||void 0===n?void 0:n[r])}));n[o]=c?e[c][r]:""}})),i(n,t)}function c(e,t){var r={};return t.forEach((function(n){var o,i=null===(o=e[n])||void 0===o?void 0:o.value;if(a(i))r[n]=i;else{var u=t.find((function(t){var r;return a(null===(r=e[t])||void 0===r?void 0:r.value)}));r[n]=u?e[u].value:""}})),i(r,t)}function l(e,t,r){var n,o=e[t];if(!o){var a=r.indexOf(t),i=null!==(n=r.slice(a).find((function(t){return e[t]})))&&void 0!==n?n:"en";o=e[i]}return void 0===o&&(o=[]),"string"==typeof o?[o]:o}function f(e,t,r){for(var n={},o=0,a=r;o<a.length;o++){var i=a[o];n[i]=It.__spreadArrays(l(e,i,r),l(t,i,r))}return u(n,r)}function d(e,t,r){if(void 0===e)return t;try{for(var n in t)if(void 0===e[n])throw new TypeError("Hotel "+e.objectID+" is missing "+n+" field")}catch(e){r||console.error(e)}return It.__assign(It.__assign({},t),e)}function h(e){if(void 0===e)return"property";switch(e){case 0:return"country";case 23:return"city";case 64:case 1010:return"airport";case 199:case 232:case 251:case 1024:return"station";default:return"area"}}t.getCheckInNights=o,t.getTagsFilter=function(e,t){return["tags:-u"+o(e,t)]},t.isNotEmptyOrWhiteSpace=a,t.getTranslatedAttributes=function(e,t){var r=[];return e.forEach((function(e){var n=t.map((function(t){return t+"."+e}));r.push.apply(r,n)})),r},t.toString=i,t.translatedArrayToString=u,t.getStringFromTranslatedArray=s,t.getValueFromTranslatedHightlightResult=c,t.attributeWithFallback=l,t.mergeTranslatedAttributes=f,t.validateHit=d,t.placeTypeToPlaceTypeName=h,t.hitToHotel=function(e,t){var r=d(e,{address:{},placeADName:{},placeDN:{},hotelName:{}}),n=It.__assign(It.__assign({},r),{displayAddress:f(r.address,r.placeADName,t),placeDisplayName:u(r.placeDN,t),hotelName:i(r.hotelName,t)});return Jr.omit(["address","placeDN","placeADName"],n)},t.hitToHotelTypeAnchor=function(e,t){var r=d(e,{hotelName:{},placeDN:{}}),n=It.__assign(It.__assign({},r),{hotelName:i(r.hotelName,t),placeDisplayName:u(r.placeDN,t)});return Jr.omit(["placeADN","placeDN"],n)},t.hitToPlaceTypeAnchor=function(e,t){var r=d(e,{placeName:{},placeDN:{}}),n=It.__assign(It.__assign({},r),{placeName:i(r.placeName,t),placeDisplayName:u(r.placeDN,t)});return Jr.omit(["placeADN","placeDN"],n)},t.hitToHotelSuggest=function(e,t){var r=d(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",hotelName:{},_highlightResult:{}}),n=s(r.placeADN,t,-1),o=s(r.placeDN,t,1),u=a(o)?o+", "+n:n,l=c(r._highlightResult.hotelName,t);return{objectID:r.objectID.replace(r.objectType+":",""),objectType:r.objectType,value:i(r.hotelName,t),highlightValue:l,placeDisplayName:u,placeTypeName:h()}},t.hitToPlaceSuggest=function(e,t){var r=d(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",placeName:{},placeType:0,_highlightResult:{}}),n=s(r.placeADN,t,-1),o=s(r.placeDN,t,1),u=a(o)?o+", "+n:n,l=c(r._highlightResult.placeName,t);return{objectID:r.objectID.replace(r.objectType+":",""),objectType:r.objectType,value:i(r.placeName,t),highlightValue:l,placeDisplayName:u,placeTypeName:h(r.placeType)}},t.pickIndexVariation=function(e,t){var r=e.find((function(e){return e.variationID&&t.includes(e.variationID)}));return null!=r?r:e.find((function(e){return void 0===e.variationID}))}})),sn=t((function(e,t){var r;function n(e){var t=un.getTranslatedAttributes(e,["placeName","placeADN","placeDN","hotelName"]);return It.__spreadArrays(["objectType","placeType","placeCategory","objectID","_geoloc","priceBucketWidth","polygon","pageSize"],t)}function o(e){var t=un.getTranslatedAttributes(e,["hotelName","placeADName","placeDN","address"]);return It.__spreadArrays(["_geoloc","checkInTime","checkOutTime","facilities","guestRating","guestType","imageURIs","propertyTypeId","reviewCount","starRating","themeIds","objectID","lastBooked","isDeleted","pricing","sentiments","country"],t)}Object.defineProperty(t,"__esModule",{value:!0}),t.getAnchor=void 0,function(e){e[e.Hotel=0]="Hotel",e[e.Place=1]="Place",e[e.Location=2]="Location",e[e.Query=3]="Query",e[e.Unknown=4]="Unknown"}(r||(r={})),t.getAnchor=function(e,t,a){var i=this,u=e.search,s=t.autocompleteIndex,c=t.hotelIndex,l=a.languages;return function(e){return It.__awaiter(i,void 0,void 0,(function(){var t,a,i,f,d,h,p,g,v,y,m,b,_;return It.__generator(this,(function(w){switch(w.label){case 0:switch(t=function(e){return e.hotelId?r.Hotel:e.placeId?r.Place:e.geolocation?r.Location:e.query?r.Query:r.Unknown}(e),a=e.hotelId,i=e.placeId,f=e.query,d=[],t){case r.Query:d.push({indexName:s,params:{query:f,hitsPerPage:1,attributesToRetrieve:n(l),attributesToHighlight:[]}}),d.push({indexName:c,params:{query:f,hitsPerPage:1,attributesToRetrieve:o(l),attributesToHighlight:[]}});break;case r.Hotel:a&&d.push({indexName:s,params:{facetFilters:[["objectID:hotel:"+a]],attributesToRetrieve:n(l),attributesToHighlight:[]}},{indexName:c,params:{facetFilters:[["objectID:"+a]],attributesToRetrieve:o(l),attributesToHighlight:[]}});break;case r.Place:default:i&&d.push({indexName:s,params:{facetFilters:[["objectID:place:"+i]],attributesToRetrieve:n(l),attributesToHighlight:[]}})}return[4,u(d)];case 1:switch(g=w.sent().results,v=null===(m=g[0])||void 0===m?void 0:m.hits[0],y=null===(b=g[1])||void 0===b?void 0:b.hits[0],null==v?void 0:v.objectType){case"hotel":h=un.hitToHotelTypeAnchor(v,l),p=un.hitToHotel(y,l);break;case"place":default:h=un.hitToPlaceTypeAnchor(v,l)}return[2,{anchor:h,anchorHotel:p,anchorType:null!==(_=null==v?void 0:v.objectType)&&void 0!==_?_:"place"}]}}))}))}}}));var cn=r(Object.freeze({__proto__:null,default:function(e){$(1,arguments);var t=Z(e),r=t.getDay();return 0===r||6===r}})),ln=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generatePriceFilter=t.generateSortByPriceFilter=void 0;var r=It.__importDefault(an),n=It.__importDefault(cn);t.generateSortByPriceFilter=function(e){for(var t=[],r=e;r>0;--r){var n=100*(e+1-r);t.push("pricing.minRateBkt:"+r+"<score="+n+">")}return t},t.generatePriceFilter=function(e){var t=e.priceMin,o=e.priceMax,a=e.priceBucketWidth,i=e.priceBucketsCount,u=e.checkIn,s=e.checkOut,c=e.margin,l=void 0===c?2:c,f=[];if(void 0===t&&void 0===o||void 0===a)return f;var d=t?Math.floor(t/a)-l:0,h=o?Math.ceil(o/a)+l:i;d<0&&(d=0),h>i&&(h=i);var p=d,g=function(e,t){if(!e||!t)return"pricing.medianRateBkt";var o=Jr.dateToMiddayUTC(e),a=Jr.dateToMiddayUTC(t);return 1===r.default(a,o)?n.default(o)?"pricing.medianRateSaSuBkt":"pricing.medianRateMoFrBkt":"pricing.medianRateBkt"}(u,s);do{f.push(g+":"+p+"<score=10000>"),p++}while(p<=h);return f}})),fn=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===dn}(e)}(e)};var dn="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function hn(e,t){return!1!==t.clone&&t.isMergeableObject(e)?mn((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function pn(e,t,r){return e.concat(t).map((function(e){return hn(e,r)}))}function gn(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function vn(e,t){try{return t in e}catch(e){return!1}}function yn(e,t,r){var n={};return r.isMergeableObject(e)&&gn(e).forEach((function(t){n[t]=hn(e[t],r)})),gn(t).forEach((function(o){(function(e,t){return vn(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(vn(e,o)&&r.isMergeableObject(t[o])?n[o]=function(e,t){if(!t.customMerge)return mn;var r=t.customMerge(e);return"function"==typeof r?r:mn}(o,r)(e[o],t[o],r):n[o]=hn(t[o],r))})),n}function mn(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||pn,r.isMergeableObject=r.isMergeableObject||fn,r.cloneUnlessOtherwiseSpecified=hn;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):yn(e,t,r):hn(t,r)}mn.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return mn(e,r,t)}),{})};var bn=mn,_n=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getAppConfig=t.PRICE_BUCKET_COUNT=void 0;var r=It.__importDefault(bn);t.PRICE_BUCKET_COUNT=31;var n={daedalus:{raaEndpoint:"wss://d2jxsjsbxzs3ta.cloudfront.net"},sapiBackend:{baseUrl:"dikcjxfwieazv.cloudfront.net",endpoints:{search:"search",offers:"ws/offers"}},saf:{baseUrl:"sapi.findhotel.services",endpoints:{offersRooms:"1/offers-rooms",search:"1/search"}},algolia:{apiKey:"efa703d5c0057a24487bc9bdcb597770",hotelIndex:"prod_hotel_v3",autocompleteIndex:"prod_autocomplete_v2_os000007",lovIndex:"prod_lov_v2",currencyIndex:"prod_curr_v1",hsoIndex:[{name:"prod_hso_v1",objectID:"prod_hotelranking_v1_pp000003_tags"},{name:"prod_hso_v1",objectID:"prod_hotelranking_v1_pp000004_tags2",variationID:"pp000004-tags2-b"}]},client:{features:["offers","search","suggests","configs"],blockedDefaultDates:["2022-02-27"],daysFromNow:45,fallbackLanguages:{"pt-BR":["pt"],"zh-CN":["zh"],"zh-HK":["zh"],"zh-TW":["zh"],iw:["he"],nb:["no"],nn:["no"]}}},o={"findhotel-website":n,"findhotel-website-e2e":It.__assign(It.__assign({},n),{daedalus:{raaEndpoint:void 0},saf:It.__assign(It.__assign({},n.saf),{baseUrl:"sapi-e2e.findhotel.services"}),sapiBackend:It.__assign(It.__assign({},n.sapiBackend),{baseUrl:"d30gf1e3i1dery.cloudfront.net"})}),"findhotel-website-stg":It.__assign(It.__assign({},n),{sapiBackend:It.__assign(It.__assign({},n.sapiBackend),{baseUrl:"d3vuhpa0o0tale.cloudfront.net"})}),"findhotel-website-ci":It.__assign(It.__assign({},n),{sapiBackend:It.__assign(It.__assign({},n.sapiBackend),{baseUrl:"d1ue1wauc6u0m5.cloudfront.net"})}),"findhotel-website-dev":It.__assign(It.__assign({},n),{sapiBackend:It.__assign(It.__assign({},n.sapiBackend),{baseUrl:"d3b8t16k1aaypx.cloudfront.net"})}),"findhotel-checkout":It.__assign(It.__assign({},n),{client:It.__assign(It.__assign({},n.client),{features:["rooms"]})}),"findhotel-checkout-e2e":It.__assign(It.__assign({},n),{saf:It.__assign(It.__assign({},n.saf),{baseUrl:"sapi-e2e.findhotel.services"}),client:It.__assign(It.__assign({},n.client),{features:["rooms"]})}),"findhotel-checkout-stg":It.__assign(It.__assign({},n),{saf:It.__assign(It.__assign({},n.saf),{baseUrl:"sapi-stg.findhotel.services"}),client:It.__assign(It.__assign({},n.client),{features:["rooms"]})})};t.getAppConfig=function(e,t){var n=o[e];if(void 0===n)throw new Error("Profile key is not valid");return t&&(n=r.default(n,t)),n.daedalus.raaEndpoint?n:It.__assign(It.__assign({},n),{daedalus:{raaEndpoint:"http:"===(null===location||void 0===location?void 0:location.protocol)?"ws://"+location.host:"https:"===(null===location||void 0===location?void 0:location.protocol)?"wss://"+location.host:""}})}})),wn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.geoSearch=void 0;function r(e){var t=e.anchorHotelId,r=e.checkIn,n=e.checkOut,o=e.filters,a=void 0===o?{}:o,i=a.facilities,u=a.starRating,s=a.propertyTypeId,c=a.themeIds,l=[];if(null==s?void 0:s.length){var f=s.map((function(e){return"propertyTypeId:"+e}));l.push(f)}if(null==i?void 0:i.length){var d=i.map((function(e){return"facilities:"+e}));l.push.apply(l,d)}if(null==c?void 0:c.length){var h=c.map((function(e){return"themeIds:"+e}));l.push.apply(l,h)}if(null==u?void 0:u.length){var p=[];u.forEach((function(e){p.push("starRating:"+Number(e)),p.push("starRating:"+(Number(e)+.5))})),l.push(p)}return t&&l.push("objectID:-"+t),r&&n&&l.push(un.getTagsFilter(r,n)),l}function n(e){var t=e.guestRating;return(null==t?void 0:t.length)?["guestRating.overall>="+t[0]]:[]}function o(e){var t="isDeleted = 0";return e.noHostels&&(t+=" AND propertyTypeId != 5"),t}function a(e,t){var r=e.filters,n=void 0===r?{}:r,o=e.checkIn,a=e.checkOut,i=e.sortField,u=n.priceMin,s=n.priceMax,c=t.hsoFilter,l=t.priceBucketWidth,f=t.exchangeRate,d=It.__spreadArrays(c);if("price"===i){var h=ln.generateSortByPriceFilter(_n.PRICE_BUCKET_COUNT);d=It.__spreadArrays(d,h)}if(u||s){var p=ln.generatePriceFilter({priceMin:u,priceMax:s,checkIn:o,checkOut:a,priceBucketsCount:_n.PRICE_BUCKET_COUNT,priceBucketWidth:l&&l*f});d=It.__spreadArrays(d,p)}return d}var i=["facilities","propertyTypeId","starRating","themeIds","pricing.medianRateBkt","pricing.medianRateMoFrBkt","pricing.medianRateSaSuBkt","pricing.minRateBkt","tags"];t.geoSearch=function(e,t,u){var s=this,c=e.search,l=t.hotelIndex;return function(e){return It.__awaiter(s,void 0,void 0,(function(){var t,s,f,d,h,p,g,v,y,m,b,_,w,O,T,I,S,x,P,E,k,j,C;return It.__generator(this,(function(D){switch(D.label){case 0:return t=e.boundingBox,s=e.polygon,f=e.geolocation,d=e.length,h=void 0===d?u.requestSize:d,p=e.offset,g=void 0===p?0:p,v=e.filters,m={length:h,offset:g,facets:i,attributesToHighlight:[],getRankingInfo:!1,filters:o(y=void 0===v?{}:v),numericFilters:n(y),facetFilters:r(e),attributesToRetrieve:(A=u.languages,R=un.getTranslatedAttributes(A,["hotelName","placeADName","placeDN","address"]),It.__spreadArrays(["_geoloc","checkInTime","checkOutTime","facilities","guestRating","guestType","imageURIs","propertyTypeId","reviewCount","starRating","themeIds","objectID","lastBooked","isDeleted","pricing","sentiments","country"],R)),optionalFilters:a(e,u)},void 0!==y.hotelName&&(m.query=y.hotelName),t?m.insideBoundingBox=[t]:s?m.insidePolygon=s:f&&(m.aroundLatLng=f.lat+", "+f.lon,m.aroundRadius=null!==(x=f.radius)&&void 0!==x?x:2e4,m.aroundPrecision=null!==(P=f.precision)&&void 0!==P?P:5e3),[4,c([{indexName:l,params:m}])];case 1:for(b=D.sent(),_=b.results[0],w=[],O={},T=0,I=_.hits;T<I.length;T++)S=I[T],O[S.objectID]=un.hitToHotel(S,u.languages),w.push(S.objectID);return[2,{hotelIds:w,hotelEntities:O,resultsCount:null!==(E=_.length)&&void 0!==E?E:0,resultsCountTotal:null!==(k=_.nbHits)&&void 0!==k?k:0,offset:null!==(j=_.offset)&&void 0!==j?j:0,facets:null!==(C=_.facets)&&void 0!==C?C:{}}]}var A,R}))}))}}})),On=t((function(e,t){function r(e){return un.getTranslatedAttributes(e,["placeName","hotelName"])}function n(e){var t=un.getTranslatedAttributes(e,["placeName","placeADN","placeDN","hotelName"]);return It.__spreadArrays(["objectType","objectID","placeType"],t)}Object.defineProperty(t,"__esModule",{value:!0}),t.loadSuggests=void 0,t.loadSuggests=function(e,t,o){var a=this,i=e.search,u=t.autocompleteIndex,s=o.languages,c=o.suggestsCount,l=void 0===c?6:c;return function(e){return It.__awaiter(a,void 0,void 0,(function(){var t,o,a;return It.__generator(this,(function(c){switch(c.label){case 0:return t=[{indexName:u,params:{query:e,filters:"isDeleted != 1",hitsPerPage:l,attributesToRetrieve:n(s),attributesToHighlight:r(s)}}],[4,i(t)];case 1:return o=c.sent().results,[2,null===(a=o[0])||void 0===a?void 0:a.hits.map((function(e){switch(e.objectType){case"hotel":return un.hitToHotelSuggest(e,s);case"place":default:return un.hitToPlaceSuggest(e,s)}}))]}}))}))}}})),Tn=t((function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}}}));e(Tn);var In=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e};var Sn=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function xn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Pn=function(e,t,r){return t&&xn(e.prototype,t),r&&xn(e,r),e};var En=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n};var kn=function(e){if(Array.isArray(e))return En(e)};var jn=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)};var Cn=function(e,t){if(e){if("string"==typeof e)return En(e,t);var r=Object.prototype.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)?En(e,t):void 0}};var Dn=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.")};var An=Tn((function(e){return kn(e)||jn(e)||Cn(e)||Dn()})),Rn={functions:"Jexl Function",transforms:"Transform"},Nn={ArrayLiteral:function(e){return this.evalArray(e.value)},BinaryExpression:function(e){var t=this,r=this._grammar.elements[e.operator];if(r.evalOnDemand){var n=function(e){return{eval:function(){return t.eval(e)}}};return r.evalOnDemand(n(e.left),n(e.right))}return this.Promise.all([this.eval(e.left),this.eval(e.right)]).then((function(e){return r.eval(e[0],e[1])}))},ConditionalExpression:function(e){var t=this;return this.eval(e.test).then((function(r){return r?e.consequent?t.eval(e.consequent):r:t.eval(e.alternate)}))},FilterExpression:function(e){var t=this;return this.eval(e.subject).then((function(r){return e.relative?t._filterRelative(r,e.expr):t._filterStatic(r,e.expr)}))},Identifier:function(e){return e.from?this.eval(e.from).then((function(t){if(null!=t)return Array.isArray(t)&&(t=t[0]),t[e.value]})):e.relative?this._relContext[e.value]:this._context[e.value]},Literal:function(e){return e.value},ObjectLiteral:function(e){return this.evalMap(e.value)},FunctionCall:function(e){var t=Rn[e.pool];if(!t)throw new Error("Corrupt AST: Pool '".concat(e.pool,"' not found"));var r=this._grammar[e.pool][e.name];if(!r)throw new Error("".concat(t," ").concat(e.name," is not defined."));return this.evalArray(e.args||[]).then((function(e){return r.apply(void 0,(0,An.default)(e))}))},UnaryExpression:function(e){var t=this;return this.eval(e.right).then((function(r){return t._grammar.elements[e.operator].eval(r)}))}},Mn=Tn(Sn),Un=Tn(Pn),Bn=function(){function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Promise;(0,Mn.default)(this,e),this._grammar=t,this._context=r||{},this._relContext=n||this._context,this.Promise=o}return(0,Un.default)(e,[{key:"eval",value:function(e){var t=this;return this.Promise.resolve().then((function(){return Nn[e.type].call(t,e)}))}},{key:"evalArray",value:function(e){var t=this;return this.Promise.all(e.map((function(e){return t.eval(e)})))}},{key:"evalMap",value:function(e){var t=this,r=Object.keys(e),n={},o=r.map((function(r){return t.eval(e[r])}));return this.Promise.all(o).then((function(e){return e.forEach((function(e,t){n[r[t]]=e})),n}))}},{key:"_filterRelative",value:function(t,r){var n=this,o=[];return Array.isArray(t)||(t=void 0===t?[]:[t]),t.forEach((function(t){var a=new e(n._grammar,n._context,t,n.Promise);o.push(a.eval(r))})),this.Promise.all(o).then((function(e){var r=[];return e.forEach((function(e,n){e&&r.push(t[n])})),r}))}},{key:"_filterStatic",value:function(e,t){return this.eval(t).then((function(t){return"boolean"==typeof t?t?e:void 0:e[t]}))}}]),e}(),Ln=Tn(Sn),qn=Tn(Pn),Fn=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/,Hn=/^[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][a-zA-Zа-яА-Я0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*$/,Wn=/\\\\/,zn=/^\s*$/,Yn=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],Kn=["[a-zA-Zа-яА-Я_À-ÖØ-öø-ÿ\\$][a-zA-Z0-9а-яА-Я_À-ÖØ-öø-ÿ\\$]*","(?:(?:[0-9]*\\.[0-9]+)|[0-9]+)"],Vn=["binaryOp","unaryOp","openParen","openBracket","question","colon"],Gn=function(){function e(t){(0,Ln.default)(this,e),this._grammar=t}return(0,qn.default)(e,[{key:"getElements",value:function(e){var t=this._getSplitRegex();return e.split(t).filter((function(e){return e}))}},{key:"getTokens",value:function(e){for(var t=[],r=!1,n=0;n<e.length;n++)this._isWhitespace(e[n])?t.length&&(t[t.length-1].raw+=e[n]):"-"===e[n]&&this._isNegative(t)?r=!0:(r&&(e[n]="-"+e[n],r=!1),t.push(this._createToken(e[n])));return r&&t.push(this._createToken("-")),t}},{key:"tokenize",value:function(e){var t=this.getElements(e);return this.getTokens(t)}},{key:"_createToken",value:function(e){var t={type:"literal",value:e,raw:e};if('"'===e[0]||"'"===e[0])t.value=this._unquote(e);else if(e.match(Fn))t.value=parseFloat(e);else if("true"===e||"false"===e)t.value="true"===e;else if(this._grammar.elements[e])t.type=this._grammar.elements[e].type;else{if(!e.match(Hn))throw new Error("Invalid expression token: ".concat(e));t.type="identifier"}return t}},{key:"_escapeRegExp",value:function(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(Hn)&&(e="\\b"+e+"\\b"),e}},{key:"_getSplitRegex",value:function(){var e=this;if(!this._splitRegex){var t=Object.keys(this._grammar.elements).sort((function(e,t){return t.length-e.length})).map((function(t){return e._escapeRegExp(t)}),this);this._splitRegex=new RegExp("("+[Yn.join("|"),t.join("|"),Kn.join("|")].join("|")+")")}return this._splitRegex}},{key:"_isNegative",value:function(e){return!e.length||Vn.some((function(t){return t===e[e.length-1].type}))}},{key:"_isWhitespace",value:function(e){return!!e.match(zn)}},{key:"_unquote",value:function(e){var t=e[0],r=new RegExp("\\\\"+t,"g");return e.substr(1,e.length-2).replace(r,t).replace(Wn,"\\")}}]),e}(),Jn={argVal:function(e){e&&this._cursor.args.push(e)},arrayStart:function(){this._placeAtCursor({type:"ArrayLiteral",value:[]})},arrayVal:function(e){e&&this._cursor.value.push(e)},binaryOp:function(e){for(var t=this._grammar.elements[e.value].precedence||0,r=this._cursor._parent;r&&r.operator&&this._grammar.elements[r.operator].precedence>=t;)this._cursor=r,r=r._parent;var n={type:"BinaryExpression",operator:e.value,left:this._cursor};this._setParent(this._cursor,n),this._cursor=r,this._placeAtCursor(n)},dot:function(){this._nextIdentEncapsulate=this._cursor&&"UnaryExpression"!==this._cursor.type&&("BinaryExpression"!==this._cursor.type||"BinaryExpression"===this._cursor.type&&this._cursor.right),this._nextIdentRelative=!this._cursor||this._cursor&&!this._nextIdentEncapsulate,this._nextIdentRelative&&(this._relative=!0)},filter:function(e){this._placeBeforeCursor({type:"FilterExpression",expr:e,relative:this._subParser.isRelative(),subject:this._cursor})},functionCall:function(){this._placeBeforeCursor({type:"FunctionCall",name:this._cursor.value,args:[],pool:"functions"})},identifier:function(e){var t={type:"Identifier",value:e.value};this._nextIdentEncapsulate?(t.from=this._cursor,this._placeBeforeCursor(t),this._nextIdentEncapsulate=!1):(this._nextIdentRelative&&(t.relative=!0,this._nextIdentRelative=!1),this._placeAtCursor(t))},literal:function(e){this._placeAtCursor({type:"Literal",value:e.value})},objKey:function(e){this._curObjKey=e.value},objStart:function(){this._placeAtCursor({type:"ObjectLiteral",value:{}})},objVal:function(e){this._cursor.value[this._curObjKey]=e},subExpression:function(e){this._placeAtCursor(e)},ternaryEnd:function(e){this._cursor.alternate=e},ternaryMid:function(e){this._cursor.consequent=e},ternaryStart:function(){this._tree={type:"ConditionalExpression",test:this._tree},this._cursor=this._tree},transform:function(e){this._placeBeforeCursor({type:"FunctionCall",name:e.value,args:[this._cursor],pool:"transforms"})},unaryOp:function(e){this._placeAtCursor({type:"UnaryExpression",operator:e.value})}},Qn={states:{expectOperand:{tokenTypes:{literal:{toState:"expectBinOp"},identifier:{toState:"identifier"},unaryOp:{},openParen:{toState:"subExpression"},openCurl:{toState:"expectObjKey",handler:Jn.objStart},dot:{toState:"traverse"},openBracket:{toState:"arrayVal",handler:Jn.arrayStart}}},expectBinOp:{tokenTypes:{binaryOp:{toState:"expectOperand"},pipe:{toState:"expectTransform"},dot:{toState:"traverse"},question:{toState:"ternaryMid",handler:Jn.ternaryStart}},completable:!0},expectTransform:{tokenTypes:{identifier:{toState:"postTransform",handler:Jn.transform}}},expectObjKey:{tokenTypes:{identifier:{toState:"expectKeyValSep",handler:Jn.objKey},closeCurl:{toState:"expectBinOp"}}},expectKeyValSep:{tokenTypes:{colon:{toState:"objVal"}}},postTransform:{tokenTypes:{openParen:{toState:"argVal"},binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},postArgs:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},identifier:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},openParen:{toState:"argVal",handler:Jn.functionCall},pipe:{toState:"expectTransform"},question:{toState:"ternaryMid",handler:Jn.ternaryStart}},completable:!0},traverse:{tokenTypes:{identifier:{toState:"identifier"}}},filter:{subHandler:Jn.filter,endStates:{closeBracket:"identifier"}},subExpression:{subHandler:Jn.subExpression,endStates:{closeParen:"expectBinOp"}},argVal:{subHandler:Jn.argVal,endStates:{comma:"argVal",closeParen:"postArgs"}},objVal:{subHandler:Jn.objVal,endStates:{comma:"expectObjKey",closeCurl:"expectBinOp"}},arrayVal:{subHandler:Jn.arrayVal,endStates:{comma:"arrayVal",closeBracket:"expectBinOp"}},ternaryMid:{subHandler:Jn.ternaryMid,endStates:{colon:"ternaryEnd"}},ternaryEnd:{subHandler:Jn.ternaryEnd,completable:!0}}},Xn=Tn(Sn),$n=Tn(Pn),Zn=Qn.states,eo=function(){function e(t,r,n){(0,Xn.default)(this,e),this._grammar=t,this._state="expectOperand",this._tree=null,this._exprStr=r||"",this._relative=!1,this._stopMap=n||{}}return(0,$n.default)(e,[{key:"addToken",value:function(e){if("complete"===this._state)throw new Error("Cannot add a new token to a completed Parser");var t=Zn[this._state],r=this._exprStr;if(this._exprStr+=e.raw,t.subHandler){this._subParser||this._startSubExpression(r);var n=this._subParser.addToken(e);if(n){if(this._endSubExpression(),this._parentStop)return n;this._state=n}}else{if(!t.tokenTypes[e.type]){if(this._stopMap[e.type])return this._stopMap[e.type];throw new Error("Token ".concat(e.raw," (").concat(e.type,") unexpected in expression: ").concat(this._exprStr))}var o=t.tokenTypes[e.type],a=Jn[e.type];o.handler&&(a=o.handler),a&&a.call(this,e),o.toState&&(this._state=o.toState)}return!1}},{key:"addTokens",value:function(e){e.forEach(this.addToken,this)}},{key:"complete",value:function(){if(this._cursor&&!Zn[this._state].completable)throw new Error("Unexpected end of expression: ".concat(this._exprStr));return this._subParser&&this._endSubExpression(),this._state="complete",this._cursor?this._tree:null}},{key:"isRelative",value:function(){return this._relative}},{key:"_endSubExpression",value:function(){Zn[this._state].subHandler.call(this,this._subParser.complete()),this._subParser=null}},{key:"_placeAtCursor",value:function(e){this._cursor?(this._cursor.right=e,this._setParent(e,this._cursor)):this._tree=e,this._cursor=e}},{key:"_placeBeforeCursor",value:function(e){this._cursor=this._cursor._parent,this._placeAtCursor(e)}},{key:"_setParent",value:function(e,t){Object.defineProperty(e,"_parent",{value:t,writable:!0})}},{key:"_startSubExpression",value:function(t){var r=Zn[this._state].endStates;r||(this._parentStop=!0,r=this._stopMap),this._subParser=new e(this._grammar,t,r)}}]),e}(),to=Tn(Sn),ro=Tn(Pn),no=function(){function e(t){(0,to.default)(this,e),t(this._resolve.bind(this),this._reject.bind(this))}return(0,ro.default)(e,[{key:"catch",value:function(e){if(this.error)try{this._resolve(e(this.error))}catch(e){this._reject(e)}return this}},{key:"then",value:function(e,t){if(!this.error)try{this._resolve(e(this.value))}catch(e){this._reject(e)}return t&&this.catch(t),this}},{key:"_reject",value:function(e){this.value=void 0,this.error=e}},{key:"_resolve",value:function(t){t instanceof e?t.error?this._reject(t.error):this._resolve(t.value):(this.value=t,this.error=void 0)}}]),e}();no.all=function(e){return new no((function(t){t(e.map((function(e){for(;e instanceof no;){if(e.error)throw Error(e.error);e=e.value}return e})))}))},no.resolve=function(e){return new no((function(t){return t(e)}))},no.reject=function(e){return new no((function(t,r){return r(e)}))};var oo=no,ao=Tn(Sn),io=Tn(Pn),uo=function(){function e(t,r){(0,ao.default)(this,e),this._grammar=t,this._exprStr=r,this._ast=null}return(0,io.default)(e,[{key:"compile",value:function(){var e=new Gn(this._grammar),t=new eo(this._grammar),r=e.tokenize(this._exprStr);return t.addTokens(r),this._ast=t.complete(),this}},{key:"eval",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._eval(e,Promise)}},{key:"evalSync",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._eval(e,oo);if(t.error)throw t.error;return t.value}},{key:"_eval",value:function(e,t){var r=this;return t.resolve().then((function(){var n=r._getAst();return new Bn(r._grammar,e,void 0,t).eval(n)}))}},{key:"_getAst",value:function(){return this._ast||this.compile(),this._ast}}]),e}(),so=function(){return{elements:{".":{type:"dot"},"[":{type:"openBracket"},"]":{type:"closeBracket"},"|":{type:"pipe"},"{":{type:"openCurl"},"}":{type:"closeCurl"},":":{type:"colon"},",":{type:"comma"},"(":{type:"openParen"},")":{type:"closeParen"},"?":{type:"question"},"+":{type:"binaryOp",precedence:30,eval:function(e,t){return e+t}},"-":{type:"binaryOp",precedence:30,eval:function(e,t){return e-t}},"*":{type:"binaryOp",precedence:40,eval:function(e,t){return e*t}},"/":{type:"binaryOp",precedence:40,eval:function(e,t){return e/t}},"//":{type:"binaryOp",precedence:40,eval:function(e,t){return Math.floor(e/t)}},"%":{type:"binaryOp",precedence:50,eval:function(e,t){return e%t}},"^":{type:"binaryOp",precedence:50,eval:function(e,t){return Math.pow(e,t)}},"==":{type:"binaryOp",precedence:20,eval:function(e,t){return e==t}},"!=":{type:"binaryOp",precedence:20,eval:function(e,t){return e!=t}},">":{type:"binaryOp",precedence:20,eval:function(e,t){return e>t}},">=":{type:"binaryOp",precedence:20,eval:function(e,t){return e>=t}},"<":{type:"binaryOp",precedence:20,eval:function(e,t){return e<t}},"<=":{type:"binaryOp",precedence:20,eval:function(e,t){return e<=t}},"&&":{type:"binaryOp",precedence:10,evalOnDemand:function(e,t){return e.eval().then((function(e){return e?t.eval():e}))}},"||":{type:"binaryOp",precedence:10,evalOnDemand:function(e,t){return e.eval().then((function(e){return e||t.eval()}))}},in:{type:"binaryOp",precedence:20,eval:function(e,t){return"string"==typeof t?-1!==t.indexOf(e):!!Array.isArray(t)&&t.some((function(t){return t===e}))}},"!":{type:"unaryOp",precedence:1/0,eval:function(e){return!e}}},functions:{},transforms:{}}},co=Tn(In),lo=Tn(Sn),fo=Tn(Pn),ho=so,po=function(){function e(){(0,lo.default)(this,e),this.expr=this.expr.bind(this),this._grammar=ho()}return(0,fo.default)(e,[{key:"addBinaryOp",value:function(e,t,r,n){this._addGrammarElement(e,(0,co.default)({type:"binaryOp",precedence:t},n?"evalOnDemand":"eval",r))}},{key:"addFunction",value:function(e,t){this._grammar.functions[e]=t}},{key:"addFunctions",value:function(e){for(var t in e)this._grammar.functions[t]=e[t]}},{key:"addUnaryOp",value:function(e,t){this._addGrammarElement(e,{type:"unaryOp",weight:1/0,eval:t})}},{key:"addTransform",value:function(e,t){this._grammar.transforms[e]=t}},{key:"addTransforms",value:function(e){for(var t in e)this._grammar.transforms[t]=e[t]}},{key:"compile",value:function(e){return this.createExpression(e).compile()}},{key:"createExpression",value:function(e){return new uo(this._grammar,e)}},{key:"getFunction",value:function(e){return this._grammar.functions[e]}},{key:"getTransform",value:function(e){return this._grammar.transforms[e]}},{key:"eval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.createExpression(e);return r.eval(t)}},{key:"evalSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.createExpression(e);return r.evalSync(t)}},{key:"expr",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=e.reduce((function(e,t,n){return e+=t+(n<r.length?r[n]:"")}),"");return this.createExpression(o)}},{key:"removeOp",value:function(e){!this._grammar.elements[e]||"binaryOp"!==this._grammar.elements[e].type&&"unaryOp"!==this._grammar.elements[e].type||delete this._grammar.elements[e]}},{key:"_addGrammarElement",value:function(e,t){this._grammar.elements[e]=t}}]),e}(),go=new po,vo=po;go.Jexl=vo;var yo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.loadConfigs=t.getLovAttributesToRetrieve=t.exchangeRatesFromResponse=t.evaluateHsoConfigs=void 0;var r=It.__importDefault(go);function n(e){var t={};return e.forEach((function(e){var r=e.objectID,n=e.rate;t[r]=n})),t}function o(e){var t=un.getTranslatedAttributes(e,["value"]);return It.__spreadArrays(["id","categoryID","objectID"],t)}r.default.addTransform("map",(function(e,t){return e.map((function(e){return t.replace(/%s/g,e)}))})),t.evaluateHsoConfigs=function(e,t){void 0===t&&(t=[]);var n=[];return t.some((function(t){try{r.default.evalSync(t.criteria,e)&&(n=t.value.map((function(t){return r.default.evalSync(t,e)})))}catch(e){}return n.length>0})),n},t.exchangeRatesFromResponse=n,t.getLovAttributesToRetrieve=o,t.loadConfigs=function(e,t,r){var a,i,u,s,c=e.search,l=t.hsoIndex,f=t.lovIndex,d=t.currencyIndex;return It.__awaiter(this,void 0,void 0,(function(){var e,t,h,p,g,v,y,m,b,_,w;return It.__generator(this,(function(O){switch(O.label){case 0:return e=r.currencies,t=r.languages,h=r.variations,p=e.map((function(e){return"objectID:"+e})),g=un.pickIndexVariation(l,h),v=(null==g?void 0:g.objectID)?["objectID:"+g.objectID]:void 0,y=[{indexName:g.name,params:{facetFilters:v,attributesToHighlight:[],getRankingInfo:!1}},{indexName:f,params:{hitsPerPage:1e3,attributesToRetrieve:o(t),attributesToHighlight:[],getRankingInfo:!1}},{indexName:d,params:{hitsPerPage:p.length,query:"",attributesToRetrieve:["rate"],attributesToHighlight:[],facetFilters:[p],getRankingInfo:!1}}],[4,c(y)];case 1:return m=O.sent().results,b=null===(a=m[0])||void 0===a?void 0:a.hits,_=null===(i=m[1])||void 0===i?void 0:i.hits,w=null===(u=m[2])||void 0===u?void 0:u.hits,[2,{hso:null===(s=b[0])||void 0===s?void 0:s.hso,lov:_,exchangeRates:n(w)}]}}))}))}})),mo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),It.__exportStar(sn,t),It.__exportStar(wn,t),It.__exportStar(un,t),It.__exportStar(ln,t),It.__exportStar(On,t),It.__exportStar(yo,t)})),bo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.search=t.getRequestSize=t.prepareSearchParameters=void 0;function r(e,t,r,n){var o,a=It.__assign(It.__assign({},t),{offset:r,anchorHotelId:n});if(null===(o=a.boundingBox)||void 0===o?void 0:o.length)return a;var i=e.polygon;return(null==i?void 0:i.length)?It.__assign(It.__assign({},a),{polygon:i}):e._geoloc?It.__assign(It.__assign({},a),{geolocation:e._geoloc}):a}function n(e,t){var r=e.rooms,n=void 0===r?"2":r,o=Jr.getCheckInCheckOutDates(e,t),a=o.checkIn,i=o.checkOut;return It.__assign(It.__assign({},e),{checkIn:a,checkOut:i,rooms:n})}function o(e,t,r){var n,o,a=e.anchor,i=e.anchorType;return void 0!==a.pageSize&&a.pageSize>=r.pageSize&&void 0===(null===(n=t.filters)||void 0===n?void 0:n.priceMin)&&void 0===(null===(o=t.filters)||void 0===o?void 0:o.priceMax)&&"price"!==t.sortField?a.pageSize:"hotel"===i?45:65}t.prepareSearchParameters=n,t.getRequestSize=o,t.search=function(e){var t=this,a=e.getFeatureEnabled,i=e.appConfig,u=e.algoliaClient,s=e.offersClient,c=e.options,l=e.configs,f=l.hso,d=l.exchangeRates,h=c.languages,p=d[c.currency],g=a("offers");return function(e,a){return void 0===a&&(a={}),It.__awaiter(t,void 0,void 0,(function(){var t,l,d,v,y,m,b,_,w,O,T,I,S,x,P,E=this;return It.__generator(this,(function(k){switch(k.label){case 0:return t=Jr.createState({}),l=0,d=a.onStart,v=a.onAnchorReceived,y=a.onHotelsReceived,m=a.onOffersReceived,b=a.onComplete,_=n(e,i.client),w=Jr.generateSearchId(e,c),t.update((function(e){e.searchParameters=_,e.searchId=w})),"function"==typeof d&&d(t.current()),[4,mo.getAnchor(u,i.algolia,c)(_)];case 1:return O=k.sent(),t.update((function(e){var t,r;if(e.anchor=O.anchor,e.anchorType=O.anchorType,void 0!==O.anchorHotel){var n=O.anchorHotel.objectID;e.anchorHotelId=n,e.hotelEntities=It.__assign(It.__assign({},null!==(r=e.hotelEntities)&&void 0!==r?r:{}),((t={})[n]=O.anchorHotel,t))}})),"function"==typeof v&&v(t.current()),T="hotel"===O.anchorType?"hotel_search":"place_search",I=f[T],S=mo.geoSearch(u,i.algolia,{languages:h,exchangeRate:p,priceBucketWidth:O.anchor.priceBucketWidth,requestSize:o(O,_,c),hsoFilter:mo.evaluateHsoConfigs({anchorHotel:O.anchorHotel,searchParameters:_,checkInNights:mo.getCheckInNights(_.checkIn,_.checkOut)},I)}),[4,(x=function(e){return void 0===e&&(e=0),It.__awaiter(E,void 0,void 0,(function(){var n,o,a,i,u,l,f;return It.__generator(this,(function(d){switch(d.label){case 0:return!0===_.skipGeoSearch?[3,2]:[4,S(r(O.anchor,_,e,null===(l=O.anchorHotel)||void 0===l?void 0:l.objectID))];case 1:n=d.sent(),t.update((function(e){var t;e.facets=n.facets,e.resultsCount=n.resultsCount,e.resultsCountTotal=n.resultsCountTotal,e.offset=n.offset,e.hotelIds=n.hotelIds,e.hotelEntities=It.__assign(It.__assign({},null!==(t=e.hotelEntities)&&void 0!==t?t:{}),n.hotelEntities),e.hotelsHaveStaticPosition=function(e,t,r){var n,o,a,i;if("price"===e.sortField)return!1;if(void 0!==(null===(n=e.filters)||void 0===n?void 0:n.priceMin)||void 0!==(null===(o=e.filters)||void 0===o?void 0:o.priceMax))return!1;if(r){var u=mo.getCheckInNights(e.checkIn,e.checkOut);return(null!==(i=null===(a=r.tags)||void 0===a?void 0:a["a"+u])&&void 0!==i?i:0)>=t}return!0}(_,c.pageSize,n.facets)})),t.update((function(e){Object.keys(e.hotelEntities).forEach((function(t){e.hotelEntities[t]=Jr.augmentHotelWithRegularPriceRange(e.hotelEntities[t],p,e.anchor.priceBucketWidth)}))})),d.label=2;case 2:return"function"==typeof y&&y(t.current()),g&&void 0!==s?(o=t.get("hotelIds"),a=It.__assign(It.__assign({},_),{searchId:w,hotelIds:o,anchorHotelId:null===(f=O.anchorHotel)||void 0===f?void 0:f.objectID}),[4,s.getOffers(a,(function(e){var r=en.augmentRaaResponse(e,It.__assign(It.__assign(It.__assign(It.__assign({},a),O.anchor),c),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:p}));t.update((function(e){r.hotelIds.length>0&&(e.hotelIds=r.hotelIds),e.hotelOfferEntities=It.__assign(It.__assign({},e.hotelOfferEntities),r.hotelOfferEntities)})),"function"==typeof m&&m(t.current())}))]):[3,4];case 3:i=d.sent(),u=en.augmentRaaResponse(i,It.__assign(It.__assign(It.__assign(It.__assign({},a),O.anchor),c),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:p})),t.update((function(e){e.hotelIds=u.hotelIds,e.hotelOfferEntities=u.hotelOfferEntities})),t.update((function(e){e.dealScores=Jr.getDealScores(e)})),d.label=4;case 4:return"function"==typeof b&&b(t.current()),[2,t.current()]}}))}))})(_.offset)];case 2:return P=k.sent(),[2,{loadOffers:function(e){return It.__awaiter(E,void 0,void 0,(function(){var t,r,n,o,a;return It.__generator(this,(function(i){switch(i.label){case 0:if(!e)throw new Error("Hotel id must be provided");if(!g||!s)throw new Error("Offers loading is disabled");return t=e===P.anchorHotelId,r=It.__assign(It.__assign({},_),{searchId:w,getAllOffers:!0,hotelIds:t?void 0:[e],anchorHotelId:t?e:void 0}),[4,s.getOffers(r)];case 1:return n=i.sent(),o=en.augmentRaaResponse(n,It.__assign(It.__assign(It.__assign(It.__assign({},r),O.anchor),c),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:p})),[2,null===(a=o.hotelOfferEntities)||void 0===a?void 0:a[e]]}}))}))},loadMore:function(){return It.__awaiter(E,void 0,void 0,(function(){return It.__generator(this,(function(e){return l+=o(O,_,c),[2,x(l)]}))}))}}]}}))}))}}}));var _o=Object.freeze({__proto__:null,default:function(e,t){return t=t||{},new Promise((function(r,n){var o=new XMLHttpRequest,a=[],i=[],u={},s=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:s,headers:{keys:function(){return a},entries:function(){return i},get:function(e){return u[e.toLowerCase()]},has:function(e){return e.toLowerCase()in u}}}};for(var c in o.open(t.method||"get",e,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){a.push(t=t.toLowerCase()),i.push([t,r]),u[t]=u[t]?u[t]+","+r:r})),r(s())},o.onerror=n,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(c,t.headers[c]);o.send(t.body||null)}))}}),wo={};try{!function(e,t){if(new e("q=%2B").get("q")!==t||new e({q:t}).get("q")!==t||new e([["q",t]]).get("q")!==t||"q=%0A"!==new e("q=\n").toString()||"q=+%26"!==new e({q:" &"}).toString()||"q=%25zx"!==new e({q:"%zx"}).toString())throw e;wo.URLSearchParams=e}(URLSearchParams,"+")}catch(e){!function(e,t,r){var n=e.create,o=e.defineProperty,a=/[!'\(\)~]|%20|%00/g,i=/%(?![0-9a-fA-F]{2})/g,u=/\+/g,s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"},c={append:function(e,t){h(this._ungap,e,t)},delete:function(e){delete this._ungap[e]},get:function(e){return this.has(e)?this._ungap[e][0]:null},getAll:function(e){return this.has(e)?this._ungap[e].slice(0):[]},has:function(e){return e in this._ungap},set:function(e,r){this._ungap[e]=[t(r)]},forEach:function(e,r){var n=this;for(var o in n._ungap)n._ungap[o].forEach(a,o);function a(a){e.call(r,a,t(o),n)}},toJSON:function(){return{}},toString:function(){var e=[];for(var t in this._ungap)for(var r=g(t),n=0,o=this._ungap[t];n<o.length;n++)e.push(r+"="+g(o[n]));return e.join("&")}};for(var l in c)o(f.prototype,l,{configurable:!0,writable:!0,value:c[l]});function f(e){var t=n(null);switch(o(this,"_ungap",{value:t}),!0){case!e:break;case"string"==typeof e:"?"===e.charAt(0)&&(e=e.slice(1));for(var a=e.split("&"),i=0,u=a.length;i<u;i++){var s=(c=a[i]).indexOf("=");-1<s?h(t,p(c.slice(0,s)),p(c.slice(s+1))):c.length&&h(t,p(c),"")}break;case r(e):for(i=0,u=e.length;i<u;i++){var c;h(t,(c=e[i])[0],c[1])}break;case"forEach"in e:e.forEach(d,t);break;default:for(var l in e)h(t,l,e[l])}}function d(e,t){h(this,t,e)}function h(e,t,n){var o=r(n)?n.join(","):n;t in e?e[t].push(o):e[t]=[o]}function p(e){return decodeURIComponent(e.replace(i,"%25").replace(u," "))}function g(e){return encodeURIComponent(e).replace(a,v)}function v(e){return s[e]}wo.URLSearchParams=f}(Object,String,Array.isArray)}!function(e){var t=!1;try{t=!!Symbol.iterator}catch(e){}function r(e,r){var n=[];return e.forEach(r,n),t?n[Symbol.iterator]():{next:function(){var e=n.shift();return{done:void 0===e,value:e}}}}"forEach"in e||(e.forEach=function(e,t){var r=this,n=Object.create(null);this.toString().replace(/=[\s\S]*?(?:&|$)/g,"=").split("=").forEach((function(o){o.length&&!(o in n)&&(n[o]=r.getAll(o)).forEach((function(n){e.call(t,n,o,r)}))}))}),"keys"in e||(e.keys=function(){return r(this,(function(e,t){this.push(t)}))}),"values"in e||(e.values=function(){return r(this,(function(e,t){this.push(e)}))}),"entries"in e||(e.entries=function(){return r(this,(function(e,t){this.push([t,e])}))}),t&&!(Symbol.iterator in e)&&(e[Symbol.iterator]=e.entries),"sort"in e||(e.sort=function(){for(var e,t,r,n=this.entries(),o=n.next(),a=o.done,i=[],u=Object.create(null);!a;)t=(r=o.value)[0],i.push(t),t in u||(u[t]=[]),u[t].push(r[1]),a=(o=n.next()).done;for(i.sort(),e=0;e<i.length;e++)this.delete(i[e]);for(e=0;e<i.length;e++)t=i[e],this.append(t,u[t].shift())}),function(t){var r=t.defineProperty,n=t.getOwnPropertyDescriptor,o=function(t){var r=t.append;t.append=e.append,URLSearchParams.call(t,t._usp.search.slice(1)),t.append=r},a=function(e,t){if(!(e instanceof t))throw new TypeError("'searchParams' accessed on an object that does not implement interface "+t.name)},i=function(i){var u,s,c=i.prototype,l=n(c,"searchParams"),f=n(c,"href"),d=n(c,"search");!l&&d&&d.set&&(s=function(t){function n(r,n){e.append.call(this,r,n),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}function o(r){e.delete.call(this,r),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}function a(r,n){e.set.call(this,r,n),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}return function(e,t){return e.append=n,e.delete=o,e.set=a,r(e,"_usp",{configurable:!0,writable:!0,value:t})}}(d),u=function(e,t){return r(e,"_searchParams",{configurable:!0,writable:!0,value:s(t,e)}),t},t.defineProperties(c,{href:{get:function(){return f.get.call(this)},set:function(e){var t=this._searchParams;f.set.call(this,e),t&&o(t)}},search:{get:function(){return d.get.call(this)},set:function(e){var t=this._searchParams;d.set.call(this,e),t&&o(t)}},searchParams:{get:function(){return a(this,i),this._searchParams||u(this,new URLSearchParams(this.search.slice(1)))},set:function(e){a(this,i),u(this,e)}}}))};try{i(HTMLAnchorElement),/^function|object$/.test(typeof URL)&&URL.prototype&&i(URL)}catch(e){}}(Object)}(wo.URLSearchParams.prototype);var Oo=wo.URLSearchParams,To=Object.freeze({__proto__:null,default:Oo}),Io=r(_o),So=r(To),xo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.backendSearch=t.createRequestString=void 0;var r=It.__importDefault(Io),n=It.__importDefault(So);function o(e){var t,r,o,a,i,u,s,c,l,f,d,h,p,g,v,y,m,b,_,w=e.profileKey,O=e.searchParameters,T=e.options,I=e.offset,S=e.attributes,x=Jr.removeEmpty({offset:I,profileId:w,query:O.query,hotelId:O.hotelId,placeId:O.placeId,checkIn:O.checkIn,checkOut:O.checkOut,rooms:O.rooms,dayDistance:O.dayDistance,nights:O.nights,sortField:O.sortField,sortOrder:O.sortOrder,boundingBox:null===(t=O.boundingBox)||void 0===t?void 0:t.join(","),currency:T.currency,language:T.language,variations:null===(r=T.variations)||void 0===r?void 0:r.join(","),starRating:null===(a=null===(o=O.filters)||void 0===o?void 0:o.starRating)||void 0===a?void 0:a.join(","),guestRating:null===(u=null===(i=O.filters)||void 0===i?void 0:i.guestRating)||void 0===u?void 0:u.join(","),propertyTypeId:null===(c=null===(s=O.filters)||void 0===s?void 0:s.propertyTypeId)||void 0===c?void 0:c.join(","),facilities:null===(f=null===(l=O.filters)||void 0===l?void 0:l.facilities)||void 0===f?void 0:f.join(","),themeIds:null===(h=null===(d=O.filters)||void 0===d?void 0:d.themeIds)||void 0===h?void 0:h.join(","),chainIds:null===(g=null===(p=O.filters)||void 0===p?void 0:p.chainIds)||void 0===g?void 0:g.join(","),noHostels:null===(v=O.filters)||void 0===v?void 0:v.noHostels,priceMin:null===(y=O.filters)||void 0===y?void 0:y.priceMin,priceMax:null===(m=O.filters)||void 0===m?void 0:m.priceMax,hotelName:null===(b=O.filters)||void 0===b?void 0:b.hotelName,freeCancellation:null===(_=O.filters)||void 0===_?void 0:_.freeCancellation,attributes:null==S?void 0:S.join(","),anonymousId:T.anonymousId});return new n.default(x).toString()}function a(e,t){var n=e.baseUrl,a=e.endpoints;return It.__awaiter(this,void 0,void 0,(function(){var e,i,u,s,c,l;return It.__generator(this,(function(f){switch(f.label){case 0:return e=o(t),[4,r.default("https://"+n+"/"+a.search+"?"+e)];case 1:return(i=f.sent()).ok?[2,i.json()]:(u=t.searchParameters,s=t.options,c=t.offset,l=t.attributes,s.logger.log({name:"SearchFailed",value:It.__assign(It.__assign({},u),{offset:c,attributes:l,language:s.language,currency:s.currency,deviceType:s.deviceType})}),[2,Promise.reject(i)])}}))}))}t.createRequestString=o,t.backendSearch=function(e){var t,r=this,n=e.getFeatureEnabled,o=e.profileKey,i=e.appConfig,u=e.offersClient,s=e.options,c=n("offers"),l=!1;return function(e,n){return void 0===n&&(n={}),It.__awaiter(r,void 0,void 0,(function(){var r,f,d,h,p,g,v,y,m,b,_=this;return It.__generator(this,(function(w){switch(w.label){case 0:return r=Jr.createState({}),f=n.onStart,d=n.onAnchorReceived,h=n.onHotelsReceived,p=n.onOffersReceived,g=n.onComplete,v=0,y=bo.prepareSearchParameters(e,i.client),m=Jr.generateSearchId(e,s),r.update((function(e){e.searchParameters=y,e.searchId=m})),"function"==typeof f&&f(r.current()),b=function(e,n){return void 0===e&&(e=0),It.__awaiter(_,void 0,void 0,(function(){var f,v,b,_,w,O;return It.__generator(this,(function(T){switch(T.label){case 0:return[4,a(i.sapiBackend,{profileKey:o,searchParameters:y,options:s,offset:e,attributes:n})];case 1:return f=T.sent(),l||(t=f.exchangeRates[s.currency],(null===(O=s.callbacks)||void 0===O?void 0:O.onConfigReceived)&&s.callbacks.onConfigReceived({lov:f.lov,exchangeRates:f.exchangeRates}),l=!0),(void 0===n||n.includes("anchor"))&&(r.update((function(e){e.anchor=f.anchor,e.anchorHotelId=f.anchorHotelId,e.anchorType=f.anchorType,e.hotelEntities=f.hotelEntities})),"function"==typeof d&&d(r.current())),r.update((function(e){e.facets=f.facets,e.hotelEntities=f.hotelEntities,e.hotelIds=f.hotelIds,e.hotelsHaveStaticPosition=f.hotelsHaveStaticPosition,e.offset=f.offset,e.resultsCount=f.resultsCount,e.resultsCountTotal=f.resultsCountTotal})),"function"==typeof h&&h(r.current()),c&&void 0!==u?(v=r.get("hotelIds"),b=It.__assign(It.__assign({},y),{searchId:m,hotelIds:v,anchorHotelId:r.get("anchorHotelId")}),[4,u.getOffers(b,(function(e){var n=en.augmentRaaResponse(e,It.__assign(It.__assign(It.__assign(It.__assign({},b),r.get("anchor")),s),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:t}));r.update((function(e){n.hotelIds.length>0&&(e.hotelIds=n.hotelIds),e.hotelOfferEntities=It.__assign(It.__assign({},e.hotelOfferEntities),n.hotelOfferEntities)})),"function"==typeof p&&p(r.current())}))]):[3,3];case 2:_=T.sent(),w=en.augmentRaaResponse(_,It.__assign(It.__assign(It.__assign(It.__assign({},b),r.get("anchor")),s),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:t})),r.update((function(e){e.hotelIds=w.hotelIds,e.hotelOfferEntities=w.hotelOfferEntities})),r.update((function(e){e.dealScores=Jr.getDealScores(e)})),T.label=3;case 3:return"function"==typeof g&&g(r.current()),[2,r.current()]}}))}))},[4,l?b(y.offset,["anchor","anchorHotelId","anchorType","facets","resultsCount","resultsCountTotal","offset","hotelIds","hotelEntities","hotelsHaveStaticPosition"]):b(y.offset)];case 1:return w.sent(),[2,{loadOffers:function(e){return It.__awaiter(_,void 0,void 0,(function(){var n,o,a,i,l;return It.__generator(this,(function(f){switch(f.label){case 0:if(!e)throw new Error("Hotel id must be provided");if(!c||!u)throw new Error("Offers loading is disabled");return n=e===r.get("anchorHotelId"),o=It.__assign(It.__assign({},y),{searchId:m,getAllOffers:!0,hotelIds:n?void 0:[e],anchorHotelId:n?e:void 0}),[4,u.getOffers(o)];case 1:return a=f.sent(),i=en.augmentRaaResponse(a,It.__assign(It.__assign(It.__assign(It.__assign({},o),r.get("anchor")),s),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:t})),[2,null===(l=i.hotelOfferEntities)||void 0===l?void 0:l[e]]}}))}))},loadMore:function(){return It.__awaiter(_,void 0,void 0,(function(){return It.__generator(this,(function(e){var t,n;return v+=bo.getRequestSize({anchor:r.get("anchor"),anchorHotel:(t=r.get("hotelEntities"),n=r.get("anchorHotelId"),n?t[n]:void 0),anchorType:r.get("anchorType")},y,s),[2,b(v,["offset","facets","resultsCount","resultsCountTotal","hotelIds","hotelEntities","hotelsHaveStaticPosition"])]}))}))}}]}}))}))}}})),Po=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.suggest=void 0,t.suggest=function(e){var t=this,r=e.appConfig,n=e.algoliaClient,o=e.options.languages;return function(e,a){return It.__awaiter(t,void 0,void 0,(function(){return It.__generator(this,(function(t){switch(t.label){case 0:return[4,mo.loadSuggests(n,r.algolia,{suggestsCount:a,languages:o})(e)];case 1:return[2,t.sent()]}}))}))}}})),Eo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.rooms=t.createRequestString=void 0;var r=It.__importDefault(Io),n=It.__importDefault(So);function o(e,t){var r,o=e.hotelId,a=e.checkIn,i=e.checkOut,u=e.rooms,s=e.providerCode,c=e.cugDeals,l=Jr.removeEmpty({hotelId:o,checkIn:a,checkOut:i,rooms:u,providerCode:s,cugDeals:c,deviceType:t.deviceType,language:t.language,currency:t.currency,aid:t.anonymousId,variations:null===(r=t.variations)||void 0===r?void 0:r.join(",")});return new n.default(l).toString()}t.createRequestString=o,t.rooms=function(e){var t=this,n=e.appConfig,a=e.options;return function(e){return It.__awaiter(t,void 0,void 0,(function(){var t,i,u;return It.__generator(this,(function(s){switch(s.label){case 0:return t=o(e,a),[4,r.default("https://"+n.saf.baseUrl+"/"+n.saf.endpoints.offersRooms+"?"+t)];case 1:return(i=s.sent()).ok?[4,i.json()]:[3,3];case 2:return u=s.sent(),[2,It.__assign({hotelId:e.hotelId,anonymousId:a.anonymousId},u)];case 3:return[2,Promise.reject(i)]}}))}))}}})),ko=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.offers=t.sapiResponseToHotelOfferEntity=void 0;var r,n=It.__importDefault(Xr),o=It.__importDefault(an);function a(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.baseRate;return t&&(n+=e.taxes),r&&(n+=e.localTaxes),n}function i(e,t,r){var n=o.default(Jr.dateToMiddayUTC(r),Jr.dateToMiddayUTC(t));if(n<1)throw new Error("checkOut cannot be the same or less than checkIn");return 1===n?e:e/n}function u(e,t){var r,n={baseRate:e.anchorRate.base,localTaxes:e.anchorRate.hotelFees,taxes:e.anchorRate.taxes},o=a(n,t.includeTaxes,t.includeLocalTaxes),u=i(o,t.checkIn,t.checkOut);return{anchorPriceRateBreakdown:It.__assign(It.__assign({},n),{calculatedTotalRate:o,nightlyRate:u}),availableOffersCount:e.availableOffersCount,fetchedAllOffers:e.fetchedAllOffers,hasMoreOffers:e.hasMoreOffers,id:e.id,offers:null===(r=e.offers)||void 0===r?void 0:r.map((function(r){return function(e,t,r){var n,o,u,s,c,l={baseRate:e.rate.base,localTaxes:e.rate.hotelFees,taxes:e.rate.taxes},f=a(l,r.includeTaxes,r.includeLocalTaxes),d=i(f,r.checkIn,r.checkOut),h=null!==(n=e.tags)&&void 0!==n?n:[],p=h.includes("top_offer"),g=h.includes("anchor_price"),v=h.includes("exclusive_cheapest_offer"),y=null===(o=e.package.amenities)||void 0===o?void 0:o.filter((function(e){return["allInclusive","breakfast","partialBreakfast","lunch","dinner","fullBoard","halfBoard","meals"].includes(e)})),m=e.package.refundable&&(0===e.cancellationPenalties.length||e.cancellationPenalties.some((function(e){return 0===e.amount||0===e.percent||0===e.nights})));return{id:e.id,bookURI:e.url,providerCode:e.providerCode,proxyProviderCode:e.intermediaryProvider,rateBreakdown:l,nightlyRate:d,calculatedTotalRate:f,availableRooms:e.availableRooms,cug:e.accessTier?e.accessTier.split(","):null,currency:e.currency,meals:y,tags:h,canPayLater:e.package.canPayLater,hasAnchorPrice:p,hasFreeCancellation:m,isAnchorPriceOffer:g,isTopOffer:p,isCheapest:v,roomID:e.roomID,roomName:null===(u=null==t?void 0:t[e.roomID])||void 0===u?void 0:u.name,additionalProviderParams:{feedId:null!==(c=null===(s=e.metadata)||void 0===s?void 0:s.feedID)&&void 0!==c?c:""}}}(r,e.rooms,t)})),topOfferData:{anchorPrice:o,anchorPriceNightly:u,offerIndexes:[0,1,2,3]}}}!function(e){e[e.Connecting=0]="Connecting",e[e.Open=1]="Open",e[e.Closing=2]="Closing",e[e.Closed=3]="Closed"}(r||(r={})),t.sapiResponseToHotelOfferEntity=u,t.offers=function(e,t){if("undefined"==typeof WebSocket&&void 0===t.WebSocket)throw new TypeError("Client does not support WebSocket");var o,a="wss://"+e.baseUrl+"/"+e.endpoints.offers,i=new n.default(a,[],{maxRetries:20,WebSocket:t.WebSocket}),s={};function c(e){t.logger.log({name:"WebsocketConnectionClosed",value:{service:"sapi",code:e.code,reason:e.reason,wasClean:e.wasClean}}),void 0!==s.current&&i.reconnect()}function l(e){t.logger.log({name:"WebsocketError",value:It.__assign(It.__assign({},e),{service:"sapi"})}),void 0!==s.current&&i.reconnect()}function f(){var e=s.current;void 0!==e&&i.send(e)}function d(e){var t;try{t=JSON.parse(e.data)}catch(e){console.log("WEBSOCKET: error parsing message")}"function"==typeof o&&o(t)}return i.addEventListener("open",f),i.addEventListener("close",c),i.addEventListener("error",l),i.addEventListener("message",d),{getOffers:function(e,n){return It.__awaiter(this,void 0,void 0,(function(){var a;return It.__generator(this,(function(c){return a={},s.current=function(e,t){var r,n={checkIn:e.checkIn,checkOut:e.checkOut,anchorHotelId:e.anchorHotelId,hotelIds:e.hotelIds,rooms:e.rooms,searchId:e.searchId,cugDeals:e.cugDeals,language:t.language,deviceType:t.deviceType,anonymousId:t.anonymousId,currency:t.currency,originId:e.originId,brand:t.brand,clientRequestId:$r.v4(),sortingBoost:en.generateSortingBoost(e),roomLimit:1,anchorRoomLimit:2,getAllOffers:Boolean(e.getAllOffers),preferredRate:e.preferredRate,label:e.trafficSource,countryCode:t.countryCode};try{r=JSON.stringify(n)}catch(e){console.log("WEBSOCKET: error serialising request")}return r}(e,t),[2,new Promise((function(c){o=function(r){var o,i;if(void 0!==r)if(r.status.complete)c(a),s.current=void 0;else{var l=null===(o=r.results)||void 0===o?void 0:o.find((function(t){return t.id===e.anchorHotelId}));l?a.anchorHotelOfferEntity=u(l,It.__assign(It.__assign({},e),t)):a.hotelOfferEntities=null===(i=r.results)||void 0===i?void 0:i.map((function(r){return u(r,It.__assign(It.__assign({},e),t))})),"function"==typeof n&&n(It.__assign({},a))}},i.readyState===r.Open&&void 0!==s.current&&i.send(s.current)}))]}))}))}}}})),jo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sapi=void 0;var r=It.__importDefault(d),n={log:function(){}};function o(e){void 0===e&&(e={});var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r+"-"+e[r]);return t}t.sapi=function(e,t){var a,i,u,s,c,l,f,d,h,p,g;return It.__awaiter(this,void 0,void 0,(function(){function v(e){return m.client.features.includes(e)}var y,m,b,_,w,O,T,I,S,x,P;return It.__generator(this,(function(E){switch(E.label){case 0:if(!e)throw new Error("Profile key is required");return y=It.__assign(It.__assign({},t),{logger:null!==(a=t.logger)&&void 0!==a?a:n,variations:o(t.variations),currency:null!==(u=null===(i=t.currency)||void 0===i?void 0:i.toUpperCase())&&void 0!==u?u:"USD",deviceType:null!==(c=null!==(s=t.deviceType)&&void 0!==s?s:t.deviceCategory)&&void 0!==c?c:"desktop",countryCode:null!==(l=t.countryCode)&&void 0!==l?l:t.userCountry,pageSize:null!==(f=t.pageSize)&&void 0!==f?f:20}),m=_n.getAppConfig(e,y.initWithAppConfig),b=r.default("4UYGJP42KQ",m.algolia.apiKey,y.algoliaClientOptions),v("offers")&&m.daedalus.raaEndpoint&&(_=(null===(d=y.variations)||void 0===d?void 0:d.includes("a41n36ps-sapi-offers-b"))?ko.offers(m.sapiBackend,y):en.raa(m.daedalus.raaEndpoint,y)),w={appConfig:m,algoliaClient:b,getFeatureEnabled:v,profileKey:e,offersClient:_,options:It.__assign(It.__assign({},y),{languages:It.__spreadArrays([y.language],null!==(h=m.client.fallbackLanguages[y.language])&&void 0!==h?h:[],["en"])})},(O=null===(p=y.variations)||void 0===p?void 0:p.includes("c48b82da-sapi-backend-b"))||!v("configs")?[3,2]:[4,mo.loadConfigs(b,m.algolia,It.__assign(It.__assign({},w.options),{currencies:[y.currency,"EUR"]}))];case 1:T=E.sent(),(null===(g=y.callbacks)||void 0===g?void 0:g.onConfigReceived)&&(I=T.exchangeRates,S=T.lov,y.callbacks.onConfigReceived({exchangeRates:I,lov:S})),w.configs=T,E.label=2;case 2:return x=function(e){return v("search")?O?xo.backendSearch(e):bo.search(e):function(){throw new Error("Search is not enabled for this Profile key")}},P=function(e){return v("suggests")?Po.suggest(e):function(){throw new Error("Autosuggest is not enabled for this Profile key")}},[2,{rooms:function(e){return v("rooms")?Eo.rooms(e):function(){throw new Error("Rooms search is not enabled for this Profile key")}}(w),search:x(w),suggest:P(w)}]}}))}))}})),Co=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Do=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Ao=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Ro=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),No=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),It.__exportStar(Co,t),It.__exportStar(Do,t),It.__exportStar(Ao,t),It.__exportStar(Ro,t)}));return e(t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Wr.enableES5(),It.__exportStar(jo,t),It.__exportStar(No,t),t.default=jo.sapi})))}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).sapi=t()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return n(null==t&&r.path)}},r.exports),r.exports}function r(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}function n(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};var a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var i=Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function u(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function c(e){return this instanceof c?(this.v=e,this):new c(e)}var l=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var f=Object.freeze({__proto__:null,__extends:function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},get __assign(){return a},__rest:function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},__decorate:function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},__param:function(e,t){return function(r,n){t(r,n,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}s((n=n.apply(e,t||[])).next())}))},__generator:function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},__createBinding:i,__exportStar:function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},__values:u,__read:s,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,u=a.length;i<u;i++,o++)n[o]=a[i];return n},__await:c,__asyncGenerator:function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),a=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){a.push([e,t,r,n])>1||u(e,t)}))})}function u(e,t){try{!function(e){e.value instanceof c?Promise.resolve(e.value.v).then(s,l):f(a[0][2],e)}(o[e](t))}catch(e){f(a[0][3],e)}}function s(e){u("next",e)}function l(e){u("throw",e)}function f(e,t){e(t),a.shift(),a.length&&u(a[0][0],a[0][1])}},__asyncDelegator:function(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:c(e[n](t)),done:"return"===n}:o?o(t):t}:o}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=u(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return l(t,e),t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},__classPrivateFieldSet:function(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}}),d=t((function(e,t){e.exports=function(){function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}function n(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e){var t,r="algoliasearch-client-js-".concat(e.key),n=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},a=function(){return JSON.parse(n().getItem(r)||"{}")};return{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var r=JSON.stringify(e),n=a()[r];return Promise.all([n||t(),void 0!==n])})).then((function(e){var t=o(e,2),n=t[0],a=t[1];return Promise.all([n,a||r.miss(n)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var o=a();return o[JSON.stringify(e)]=t,n().setItem(r,JSON.stringify(o)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function u(e){var t=a(e.caches),r=t.shift();return void 0===r?{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,r.miss(e)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(e,n,o).catch((function(){return u({caches:t}).get(e,n,o)}))},set:function(e,n){return r.set(e,n).catch((function(){return u({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return u({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return u({caches:t}).clear()}))}}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var i=n(),u=o&&o.miss||function(){return Promise.resolve()};return i.then((function(e){return u(e)})).then((function(){return i}))},set:function(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function c(e,t,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:function(){return e===g.WithinHeaders?n:{}},queryParameters:function(){return e===g.WithinQueryParameters?n:{}}}}function l(e){var t=0;return e((function r(){return t++,new Promise((function(n){setTimeout((function(){n(e(r))}),Math.min(100*t,1e3))}))}))}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return Promise.resolve()};return Object.assign(e,{wait:function(r){return f(e.then((function(e){return Promise.all([t(e,r),e])})).then((function(e){return e[1]})))}})}function d(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function h(e,t){return t?(Object.keys(t).forEach((function(r){e[r]=t[r](e)})),e):e}function p(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=0;return e.replace(/%s/g,(function(){return encodeURIComponent(r[o++])}))}var g={WithinQueryParameters:0,WithinHeaders:1};function v(e,t){var r=e||{},n=r.data||{};return Object.keys(r).forEach((function(e){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])})),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var y={Read:1,Write:2,Any:3},m=1,b=2,_=3;function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;return r(r({},e),{},{status:t,lastUpdate:Date.now()})}function O(e){return"string"==typeof e?{protocol:"https",url:e,accept:y.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||y.Any}}var T="DELETE",I="GET",S="POST",x="PUT";function P(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(w(t))}))}))).then((function(e){var r=e.filter((function(e){return function(e){return e.status===m||Date.now()-e.lastUpdate>12e4}(e)})),n=e.filter((function(e){return function(e){return e.status===_&&Date.now()-e.lastUpdate<=12e4}(e)})),o=[].concat(a(r),a(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return O(e)})):t}}))}function E(e,t,n,o){var i=[],u=function(e,t){if(e.method!==I&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:r(r({},e.data),t.data);return JSON.stringify(n)}}(n,o),s=function(e,t){var n=r(r({},e.headers),t.headers),o={};return Object.keys(n).forEach((function(e){var t=n[e];o[e.toLowerCase()]=t})),o}(e,o),c=n.method,l=n.method!==I?{}:r(r({},n.data),o.data),f=r(r(r({"x-algolia-agent":e.userAgent.value},e.queryParameters),l),o.queryParameters),d=0,h=function t(r,a){var l=r.pop();if(void 0===l)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:A(i)};var h={data:u,headers:s,method:c,url:C(l,n.path,f),connectTimeout:a(d,e.timeouts.connect),responseTimeout:a(d,o.timeout)},p=function(e){var t={request:h,response:e,host:l,triesLeft:r.length};return i.push(t),t},g={onSucess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var o=p(n);return n.isTimedOut&&d++,Promise.all([e.logger.info("Retryable failure",R(o)),e.hostsCache.set(l,w(l,n.isTimedOut?_:b))]).then((function(){return t(r,a)}))},onFail:function(e){throw p(e),function(e,t){var r=e.content,n=e.status,o=r;try{o=JSON.parse(r).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(o,n,t)}(e,A(i))}};return e.requester.send(h).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,r=e.status;return!t&&0==~~r}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSucess(e):t.onFail(e)}(e,g)}))};return P(e.hostsCache,t).then((function(e){return h(a(e.statelessHosts).reverse(),e.getTimeout)}))}function k(e){var t=e.hostsCache,r=e.logger,n=e.requester,a=e.requestsCache,i=e.responsesCache,u=e.timeouts,s=e.userAgent,c=e.hosts,l=e.queryParameters,f={hostsCache:t,logger:r,requester:n,requestsCache:a,responsesCache:i,timeouts:u,userAgent:s,headers:e.headers,queryParameters:l,hosts:c.map((function(e){return O(e)})),read:function(e,t){var r=v(t,f.timeouts.read),n=function(){return E(f,f.hosts.filter((function(e){return 0!=(e.accept&y.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var a={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(a,(function(){return f.requestsCache.get(a,(function(){return f.requestsCache.set(a,n()).then((function(e){return Promise.all([f.requestsCache.delete(a),e])}),(function(e){return Promise.all([f.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=o(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(a,e)}})},write:function(e,t){return E(f,f.hosts.filter((function(e){return 0!=(e.accept&y.Write)})),e,v(t,f.timeouts.write))}};return f}function j(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var r="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(r)&&(t.value="".concat(t.value).concat(r)),t}};return t}function C(e,t,r){var n=D(r),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(o+="?".concat(n)),o}function D(e){return Object.keys(e).map((function(t){return p("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function A(e){return e.map((function(e){return R(e)}))}function R(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return r(r({},e),{},{request:r(r({},e.request),{},{headers:r(r({},e.request.headers),t)})})}var N=function(e){return function(t,r){return e.transporter.write({method:S,path:"2/abtests",data:t},r)}},M=function(e){return function(t,r){return e.transporter.write({method:T,path:p("2/abtests/%s",t)},r)}},U=function(e){return function(t,r){return e.transporter.read({method:I,path:p("2/abtests/%s",t)},r)}},B=function(e){return function(t){return e.transporter.read({method:I,path:"2/abtests"},t)}},L=function(e){return function(t,r){return e.transporter.write({method:S,path:p("2/abtests/%s/stop",t)},r)}},q=function(e){return function(t){return e.transporter.read({method:I,path:"1/strategies/personalization"},t)}},F=function(e){return function(t,r){return e.transporter.write({method:S,path:"1/strategies/personalization",data:t},r)}};function H(e){return function t(r){return e.request(r).then((function(n){if(void 0!==e.batch&&e.batch(n.hits),!e.shouldStop(n))return n.cursor?t({cursor:n.cursor}):t({page:(r.page||0)+1})}))}({})}var W=function(e){return function(t,o){var a=o||{},i=a.queryParameters,u=n(a,["queryParameters"]),s=r({acl:t},void 0!==i?{queryParameters:i}:{});return f(e.transporter.write({method:S,path:"1/keys",data:s},u),(function(t,r){return l((function(n){return X(e)(t.key,r).catch((function(e){if(404!==e.status)throw e;return n()}))}))}))}},z=function(e){return function(t,r,n){var o=v(n);return o.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:S,path:"1/clusters/mapping",data:{cluster:r}},o)}},Y=function(e){return function(t,r,n){return e.transporter.write({method:S,path:"1/clusters/mapping/batch",data:{users:t,cluster:r}},n)}},K=function(e){return function(t,r,n){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:"copy",destination:r}},n),(function(r,n){return re(e)(t,{methods:{waitTask:tt}}).waitTask(r.taskID,n)}))}},V=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Rules]}))}},G=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Settings]}))}},J=function(e){return function(t,n,o){return K(e)(t,n,r(r({},o),{},{scope:[nt.Synonyms]}))}},Q=function(e){return function(t,r){return f(e.transporter.write({method:T,path:p("1/keys/%s",t)},r),(function(r,n){return l((function(r){return X(e)(t,n).then(r).catch((function(e){if(404!==e.status)throw e}))}))}))}},X=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/keys/%s",t)},r)}},$=function(e){return function(t){return e.transporter.read({method:I,path:"1/logs"},t)}},Z=function(e){return function(t){return e.transporter.read({method:I,path:"1/clusters/mapping/top"},t)}},ee=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/clusters/mapping/%s",t)},r)}},te=function(e){return function(t){var r=t||{},o=r.retrieveMappings,a=n(r,["retrieveMappings"]);return!0===o&&(a.getClusters=!0),e.transporter.read({method:I,path:"1/clusters/mapping/pending"},a)}},re=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h({transporter:e.transporter,appId:e.appId,indexName:t},r.methods)}},ne=function(e){return function(t){return e.transporter.read({method:I,path:"1/keys"},t)}},oe=function(e){return function(t){return e.transporter.read({method:I,path:"1/clusters"},t)}},ae=function(e){return function(t){return e.transporter.read({method:I,path:"1/indexes"},t)}},ie=function(e){return function(t){return e.transporter.read({method:I,path:"1/clusters/mapping"},t)}},ue=function(e){return function(t,r,n){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:"move",destination:r}},n),(function(r,n){return re(e)(t,{methods:{waitTask:tt}}).waitTask(r.taskID,n)}))}},se=function(e){return function(t,r){return f(e.transporter.write({method:S,path:"1/indexes/*/batch",data:{requests:t}},r),(function(t,r){return Promise.all(Object.keys(t.taskID).map((function(n){return re(e)(n,{methods:{waitTask:tt}}).waitTask(t.taskID[n],r)})))}))}},ce=function(e){return function(t,r){return e.transporter.read({method:S,path:"1/indexes/*/objects",data:{requests:t}},r)}},le=function(e){return function(t,n){var o=t.map((function(e){return r(r({},e),{},{params:D(e.params||{})})}));return e.transporter.read({method:S,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},n)}},fe=function(e){return function(t,o){return Promise.all(t.map((function(t){var a=t.params,i=a.facetName,u=a.facetQuery,s=n(a,["facetName","facetQuery"]);return re(e)(t.indexName,{methods:{searchForFacetValues:Xe}}).searchForFacetValues(i,u,r(r({},o),s))})))}},de=function(e){return function(t,r){var n=v(r);return n.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:T,path:"1/clusters/mapping"},n)}},he=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/keys/%s/restore",t)},r),(function(r,n){return l((function(r){return X(e)(t,n).catch((function(e){if(404!==e.status)throw e;return r()}))}))}))}},pe=function(e){return function(t,r){return e.transporter.read({method:S,path:"1/clusters/mapping/search",data:{query:t}},r)}},ge=function(e){return function(t,r){var o=Object.assign({},r),a=r||{},i=a.queryParameters,u=n(a,["queryParameters"]),s=i?{queryParameters:i}:{},c=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(e.transporter.write({method:x,path:p("1/keys/%s",t),data:s},u),(function(r,n){return l((function(r){return X(e)(t,n).then((function(e){return function(e){return Object.keys(o).filter((function(e){return-1!==c.indexOf(e)})).every((function(t){return e[t]===o[t]}))}(e)?Promise.resolve():r()}))}))}))}},ve=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/indexes/%s/batch",e.indexName),data:{requests:t}},r),(function(t,r){return tt(e)(t.taskID,r)}))}},ye=function(e){return function(t){return H(r(r({shouldStop:function(e){return void 0===e.cursor}},t),{},{request:function(r){return e.transporter.read({method:S,path:p("1/indexes/%s/browse",e.indexName),data:r},t)}}))}},me=function(e){return function(t){var n=r({hitsPerPage:1e3},t);return H(r(r({shouldStop:function(e){return e.hits.length<n.hitsPerPage}},n),{},{request:function(t){return $e(e)("",r(r({},n),t)).then((function(e){return r(r({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},be=function(e){return function(t){var n=r({hitsPerPage:1e3},t);return H(r(r({shouldStop:function(e){return e.hits.length<n.hitsPerPage}},n),{},{request:function(t){return Ze(e)("",r(r({},n),t)).then((function(e){return r(r({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},_e=function(e){return function(t,r,o){var a=o||{},i=a.batchSize,u=n(a,["batchSize"]),s={taskIDs:[],objectIDs:[]};return f(function n(){var o,a=[];for(o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;o<t.length&&(a.push(t[o]),a.length!==(i||1e3));o++);return 0===a.length?Promise.resolve(s):ve(e)(a.map((function(e){return{action:r,body:e}})),u).then((function(e){return s.objectIDs=s.objectIDs.concat(e.objectIDs),s.taskIDs.push(e.taskID),o++,n(o)}))}(),(function(t,r){return Promise.all(t.taskIDs.map((function(t){return tt(e)(t,r)})))}))}},we=function(e){return function(t){return f(e.transporter.write({method:S,path:p("1/indexes/%s/clear",e.indexName)},t),(function(t,r){return tt(e)(t.taskID,r)}))}},Oe=function(e){return function(t){var r=t||{},o=r.forwardToReplicas,a=v(n(r,["forwardToReplicas"]));return o&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/rules/clear",e.indexName)},a),(function(t,r){return tt(e)(t.taskID,r)}))}},Te=function(e){return function(t){var r=t||{},o=r.forwardToReplicas,a=v(n(r,["forwardToReplicas"]));return o&&(a.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/synonyms/clear",e.indexName)},a),(function(t,r){return tt(e)(t.taskID,r)}))}},Ie=function(e){return function(t,r){return f(e.transporter.write({method:S,path:p("1/indexes/%s/deleteByQuery",e.indexName),data:t},r),(function(t,r){return tt(e)(t.taskID,r)}))}},Se=function(e){return function(t){return f(e.transporter.write({method:T,path:p("1/indexes/%s",e.indexName)},t),(function(t,r){return tt(e)(t.taskID,r)}))}},xe=function(e){return function(t,r){return f(Pe(e)([t],r).then((function(e){return{taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},Pe=function(e){return function(t,r){var n=t.map((function(e){return{objectID:e}}));return _e(e)(n,rt.DeleteObject,r)}},Ee=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=v(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:T,path:p("1/indexes/%s/rules/%s",e.indexName,t)},i),(function(t,r){return tt(e)(t.taskID,r)}))}},ke=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=v(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:T,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},i),(function(t,r){return tt(e)(t.taskID,r)}))}},je=function(e){return function(t){return Ue(e)(t).then((function(){return!0})).catch((function(e){if(404!==e.status)throw e;return!1}))}},Ce=function(e){return function(t,r,n){return e.transporter.read({method:S,path:p("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n)}},De=function(e){return function(t,a){var i=a||{},u=i.query,s=i.paginate,c=n(i,["query","paginate"]),l=0;return function n(){return Qe(e)(u||"",r(r({},c),{},{page:l})).then((function(e){for(var r=0,a=Object.entries(e.hits);r<a.length;r++){var i=o(a[r],2),u=i[0],c=i[1];if(t(c))return{object:c,position:parseInt(u,10),page:l}}if(l++,!1===s||l>=e.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return n()}))}()}},Ae=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/indexes/%s/%s",e.indexName,t)},r)}},Re=function(){return function(e,t){for(var r=0,n=Object.entries(e.hits);r<n.length;r++){var a=o(n[r],2),i=a[0];if(a[1].objectID===t)return parseInt(i,10)}return-1}},Ne=function(e){return function(t,o){var a=o||{},i=a.attributesToRetrieve,u=n(a,["attributesToRetrieve"]),s=t.map((function(t){return r({indexName:e.indexName,objectID:t},i?{attributesToRetrieve:i}:{})}));return e.transporter.read({method:S,path:"1/indexes/*/objects",data:{requests:s}},u)}},Me=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/indexes/%s/rules/%s",e.indexName,t)},r)}},Ue=function(e){return function(t){return e.transporter.read({method:I,path:p("1/indexes/%s/settings",e.indexName),data:{getVersion:2}},t)}},Be=function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/indexes/%s/synonyms/%s",e.indexName,t)},r)}},Le=function(e){return function(t,r){return f(qe(e)([t],r).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},qe=function(e){return function(t,r){var o=r||{},a=o.createIfNotExists,i=n(o,["createIfNotExists"]),u=a?rt.PartialUpdateObject:rt.PartialUpdateObjectNoCreate;return _e(e)(t,u,i)}},Fe=function(e){return function(t,i){var u=i||{},s=u.safe,c=u.autoGenerateObjectIDIfNotExist,l=u.batchSize,d=n(u,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),h=function(t,r,n,o){return f(e.transporter.write({method:S,path:p("1/indexes/%s/operation",t),data:{operation:n,destination:r}},o),(function(t,r){return tt(e)(t.taskID,r)}))},g=Math.random().toString(36).substring(7),v="".concat(e.indexName,"_tmp_").concat(g),y=Ye({appId:e.appId,transporter:e.transporter,indexName:v}),m=[],b=h(e.indexName,v,"copy",r(r({},d),{},{scope:["settings","synonyms","rules"]}));return m.push(b),f((s?b.wait(d):b).then((function(){var e=y(t,r(r({},d),{},{autoGenerateObjectIDIfNotExist:c,batchSize:l}));return m.push(e),s?e.wait(d):e})).then((function(){var t=h(v,e.indexName,"move",d);return m.push(t),s?t.wait(d):t})).then((function(){return Promise.all(m)})).then((function(e){var t=o(e,3),r=t[0],n=t[1],i=t[2];return{objectIDs:n.objectIDs,taskIDs:[r.taskID].concat(a(n.taskIDs),[i.taskID])}})),(function(e,t){return Promise.all(m.map((function(e){return e.wait(t)})))}))}},He=function(e){return function(t,n){return Ve(e)(t,r(r({},n),{},{clearExistingRules:!0}))}},We=function(e){return function(t,n){return Je(e)(t,r(r({},n),{},{clearExistingSynonyms:!0}))}},ze=function(e){return function(t,r){return f(Ye(e)([t],r).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,r){return tt(e)(t.taskID,r)}))}},Ye=function(e){return function(t,r){var o=r||{},a=o.autoGenerateObjectIDIfNotExist,i=n(o,["autoGenerateObjectIDIfNotExist"]),u=a?rt.AddObject:rt.UpdateObject;if(u===rt.UpdateObject){var s=!0,c=!1,l=void 0;try{for(var d,h=t[Symbol.iterator]();!(s=(d=h.next()).done);s=!0)if(void 0===d.value.objectID)return f(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(e){c=!0,l=e}finally{try{s||null==h.return||h.return()}finally{if(c)throw l}}}return _e(e)(t,u,i)}},Ke=function(e){return function(t,r){return Ve(e)([t],r)}},Ve=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=o.clearExistingRules,u=v(n(o,["forwardToReplicas","clearExistingRules"]));return a&&(u.queryParameters.forwardToReplicas=1),i&&(u.queryParameters.clearExistingRules=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/rules/batch",e.indexName),data:t},u),(function(t,r){return tt(e)(t.taskID,r)}))}},Ge=function(e){return function(t,r){return Je(e)([t],r)}},Je=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=o.clearExistingSynonyms,u=o.replaceExistingSynonyms,s=v(n(o,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return a&&(s.queryParameters.forwardToReplicas=1),(u||i)&&(s.queryParameters.replaceExistingSynonyms=1),f(e.transporter.write({method:S,path:p("1/indexes/%s/synonyms/batch",e.indexName),data:t},s),(function(t,r){return tt(e)(t.taskID,r)}))}},Qe=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},Xe=function(e){return function(t,r,n){return e.transporter.read({method:S,path:p("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},$e=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/rules/search",e.indexName),data:{query:t}},r)}},Ze=function(e){return function(t,r){return e.transporter.read({method:S,path:p("1/indexes/%s/synonyms/search",e.indexName),data:{query:t}},r)}},et=function(e){return function(t,r){var o=r||{},a=o.forwardToReplicas,i=v(n(o,["forwardToReplicas"]));return a&&(i.queryParameters.forwardToReplicas=1),f(e.transporter.write({method:x,path:p("1/indexes/%s/settings",e.indexName),data:t},i),(function(t,r){return tt(e)(t.taskID,r)}))}},tt=function(e){return function(t,r){return l((function(n){return function(e){return function(t,r){return e.transporter.read({method:I,path:p("1/indexes/%s/task/%s",e.indexName,t.toString())},r)}}(e)(t,r).then((function(e){return"published"!==e.status?n():void 0}))}))}},rt={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},nt={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},ot=1,at=2,it=3;function ut(e,t,n){var o,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return r.setRequestHeader(t,e.headers[t])}));var n,o=function(e,n){return setTimeout((function(){r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e)},a=o(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=o(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(o=it,{debug:function(e,t){return ot>=o&&console.debug(e,t),Promise.resolve()},info:function(e,t){return at>=o&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:u({caches:[i({key:"".concat("4.8.0","-").concat(e)}),s()]}),userAgent:j("4.8.0").add({segment:"Browser"})};return function(e){var t=e.appId,n=c(void 0!==e.authMode?e.authMode:g.WithinHeaders,t,e.apiKey),o=k(r(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:y.Read},{url:"".concat(t,".algolia.net"),accept:y.Write}].concat(d([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({transporter:o,appId:t,addAlgoliaAgent:function(e,t){o.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then((function(){}))}},e.methods)}(r(r(r({},a),n),{},{methods:{search:le,searchForFacetValues:fe,multipleBatch:se,multipleGetObjects:ce,multipleQueries:le,copyIndex:K,copySettings:G,copySynonyms:J,copyRules:V,moveIndex:ue,listIndices:ae,getLogs:$,listClusters:oe,multipleSearchForFacetValues:fe,getApiKey:X,addApiKey:W,listApiKeys:ne,updateApiKey:ge,deleteApiKey:Q,restoreApiKey:he,assignUserID:z,assignUserIDs:Y,getUserID:ee,searchUserIDs:pe,listUserIDs:ie,getTopUserIDs:Z,removeUserID:de,hasPendingMappings:te,initIndex:function(e){return function(t){return re(e)(t,{methods:{batch:ve,delete:Se,findAnswers:Ce,getObject:Ae,getObjects:Ne,saveObject:ze,saveObjects:Ye,search:Qe,searchForFacetValues:Xe,waitTask:tt,setSettings:et,getSettings:Ue,partialUpdateObject:Le,partialUpdateObjects:qe,deleteObject:xe,deleteObjects:Pe,deleteBy:Ie,clearObjects:we,browseObjects:ye,getObjectPosition:Re,findObject:De,exists:je,saveSynonym:Ge,saveSynonyms:Je,getSynonym:Be,searchSynonyms:Ze,browseSynonyms:be,deleteSynonym:ke,clearSynonyms:Te,replaceAllObjects:Fe,replaceAllSynonyms:We,searchRules:$e,getRule:Me,deleteRule:Ee,saveRule:Ke,saveRules:Ve,replaceAllRules:He,browseRules:me,clearRules:Oe}})}},initAnalytics:function(){return function(e){return function(e){var t=e.region||"us",n=c(g.WithinHeaders,e.appId,e.apiKey),o=k(r(r({hosts:[{url:"analytics.".concat(t,".algolia.com")}]},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/json"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(r(r(r({},a),e),{},{methods:{addABTest:N,getABTest:U,getABTests:B,stopABTest:L,deleteABTest:M}}))}},initRecommendation:function(){return function(e){return function(e){var t=e.region||"us",n=c(g.WithinHeaders,e.appId,e.apiKey),o=k(r(r({hosts:[{url:"recommendation.".concat(t,".algolia.com")}]},e),{},{headers:r(r(r({},n.headers()),{"content-type":"application/json"}),e.headers),queryParameters:r(r({},n.queryParameters()),e.queryParameters)}));return h({appId:e.appId,transporter:o},e.methods)}(r(r(r({},a),e),{},{methods:{getPersonalizationStrategy:q,setPersonalizationStrategy:F}}))}}}}))}return ut.version="4.8.0",ut}()})),h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function p(e,t){function r(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}var y,m=function(e,t){this.target=t,this.type=e},b=function(e){function t(t,r){var n=e.call(this,"error",r)||this;return n.message=t.message,n.error=t,n}return p(t,e),t}(m),_=function(e){function t(t,r,n){void 0===t&&(t=1e3),void 0===r&&(r="");var o=e.call(this,"close",n)||this;return o.wasClean=!0,o.code=t,o.reason=r,o}return p(t,e),t}(m),w=function(){if("undefined"!=typeof WebSocket)return WebSocket},O={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},T=function(){function e(e,t,r){var n=this;void 0===r&&(r={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){n._debug("open event");var t=n._options.minUptime,r=void 0===t?O.minUptime:t;clearTimeout(n._connectTimeout),n._uptimeTimeout=setTimeout((function(){return n._acceptOpen()}),r),n._ws.binaryType=n._binaryType,n._messageQueue.forEach((function(e){return n._ws.send(e)})),n._messageQueue=[],n.onopen&&n.onopen(e),n._listeners.open.forEach((function(t){return n._callEventListener(e,t)}))},this._handleMessage=function(e){n._debug("message event"),n.onmessage&&n.onmessage(e),n._listeners.message.forEach((function(t){return n._callEventListener(e,t)}))},this._handleError=function(e){n._debug("error event",e.message),n._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),n.onerror&&n.onerror(e),n._debug("exec error listeners"),n._listeners.error.forEach((function(t){return n._callEventListener(e,t)})),n._connect()},this._handleClose=function(e){n._debug("close event"),n._clearTimeouts(),n._shouldReconnect&&n._connect(),n.onclose&&n.onclose(e),n._listeners.close.forEach((function(t){return n._callEventListener(e,t)}))},this._url=e,this._protocols=t,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(e,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CONNECTING",{get:function(){return e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OPEN",{get:function(){return e.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSING",{get:function(){return e.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSED",{get:function(){return e.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce((function(e,t){return"string"==typeof t?e+=t.length:t instanceof Blob?e+=t.size:e+=t.byteLength,e}),0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),e.prototype.close=function(e,t){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,t):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},e.prototype.reconnect=function(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,t),this._connect()):this._connect()},e.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{var t=this._options.maxEnqueuedMessages,r=void 0===t?O.maxEnqueuedMessages:t;this._messageQueue.length<r&&(this._debug("enqueue",e),this._messageQueue.push(e))}},e.prototype.addEventListener=function(e,t){this._listeners[e]&&this._listeners[e].push(t)},e.prototype.dispatchEvent=function(e){var t,r,n=this._listeners[e.type];if(n)try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}(n),a=o.next();!a.done;a=o.next()){var i=a.value;this._callEventListener(e,i)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return!0},e.prototype.removeEventListener=function(e,t){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter((function(e){return e!==t})))},e.prototype._debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._options.debug&&console.log.apply(console,v(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,r=void 0===t?O.reconnectionDelayGrowFactor:t,n=e.minReconnectionDelay,o=void 0===n?O.minReconnectionDelay:n,a=e.maxReconnectionDelay,i=void 0===a?O.maxReconnectionDelay:a,u=0;return this._retryCount>0&&(u=o*Math.pow(r,this._retryCount-1))>i&&(u=i),this._debug("next delay",u),u},e.prototype._wait=function(){var e=this;return new Promise((function(t){setTimeout(t,e._getNextDelay())}))},e.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var t=e();if("string"==typeof t)return Promise.resolve(t);if(t.then)return t}throw Error("Invalid URL")},e.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var t=this._options,r=t.maxRetries,n=void 0===r?O.maxRetries:r,o=t.connectionTimeout,a=void 0===o?O.connectionTimeout:o,i=t.WebSocket,u=void 0===i?w():i;if(this._retryCount>=n)this._debug("max retries reached",this._retryCount,">=",n);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),!function(e){return void 0!==e&&!!e&&2===e.CLOSING}(u))throw Error("No valid WebSocket class provided");this._wait().then((function(){return e._getNextUrl(e._url)})).then((function(t){e._closeCalled||(e._debug("connect",{url:t,protocols:e._protocols}),e._ws=e._protocols?new u(t,e._protocols):new u(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout((function(){return e._handleTimeout()}),a))}))}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new b(Error("TIMEOUT"),this))},e.prototype._disconnect=function(e,t){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new _(e,t,this))}catch(e){}}},e.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},e.prototype._callEventListener=function(e,t){"handleEvent"in t?t.handleEvent(e):t(e)},e.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},e.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},e.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},e}(),I=Object.freeze({__proto__:null,default:T}),S=new Uint8Array(16);function x(){if(!y&&!(y="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return y(S)}var P=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function E(e){return"string"==typeof e&&P.test(e)}for(var k,j,C=[],D=0;D<256;++D)C.push((D+256).toString(16).substr(1));function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(C[e[t+0]]+C[e[t+1]]+C[e[t+2]]+C[e[t+3]]+"-"+C[e[t+4]]+C[e[t+5]]+"-"+C[e[t+6]]+C[e[t+7]]+"-"+C[e[t+8]]+C[e[t+9]]+"-"+C[e[t+10]]+C[e[t+11]]+C[e[t+12]]+C[e[t+13]]+C[e[t+14]]+C[e[t+15]]).toLowerCase();if(!E(r))throw TypeError("Stringified UUID is invalid");return r}var R=0,N=0;function M(e){if(!E(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}function U(e,t,r){function n(e,n,o,a){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=M(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+e.length);if(i.set(n),i.set(e,n.length),(i=r(i))[6]=15&i[6]|t,i[8]=63&i[8]|128,o){a=a||0;for(var u=0;u<16;++u)o[a+u]=i[u];return o}return A(i)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function B(e){return 14+(e+64>>>9<<4)+1}function L(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function q(e,t,r,n,o,a){return L((i=L(L(t,e),L(n,a)))<<(u=o)|i>>>32-u,r);var i,u}function F(e,t,r,n,o,a,i){return q(t&r|~t&n,e,t,o,a,i)}function H(e,t,r,n,o,a,i){return q(t&n|r&~n,e,t,o,a,i)}function W(e,t,r,n,o,a,i){return q(t^r^n,e,t,o,a,i)}function z(e,t,r,n,o,a,i){return q(r^(t|~n),e,t,o,a,i)}var Y=U("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){for(var t=[],r=32*e.length,n="0123456789abcdef",o=0;o<r;o+=8){var a=e[o>>5]>>>o%32&255,i=parseInt(n.charAt(a>>>4&15)+n.charAt(15&a),16);t.push(i)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[B(t)-1]=t;for(var r=1732584193,n=-271733879,o=-1732584194,a=271733878,i=0;i<e.length;i+=16){var u=r,s=n,c=o,l=a;r=F(r,n,o,a,e[i],7,-680876936),a=F(a,r,n,o,e[i+1],12,-389564586),o=F(o,a,r,n,e[i+2],17,606105819),n=F(n,o,a,r,e[i+3],22,-1044525330),r=F(r,n,o,a,e[i+4],7,-176418897),a=F(a,r,n,o,e[i+5],12,1200080426),o=F(o,a,r,n,e[i+6],17,-1473231341),n=F(n,o,a,r,e[i+7],22,-45705983),r=F(r,n,o,a,e[i+8],7,1770035416),a=F(a,r,n,o,e[i+9],12,-1958414417),o=F(o,a,r,n,e[i+10],17,-42063),n=F(n,o,a,r,e[i+11],22,-1990404162),r=F(r,n,o,a,e[i+12],7,1804603682),a=F(a,r,n,o,e[i+13],12,-40341101),o=F(o,a,r,n,e[i+14],17,-1502002290),r=H(r,n=F(n,o,a,r,e[i+15],22,1236535329),o,a,e[i+1],5,-165796510),a=H(a,r,n,o,e[i+6],9,-1069501632),o=H(o,a,r,n,e[i+11],14,643717713),n=H(n,o,a,r,e[i],20,-373897302),r=H(r,n,o,a,e[i+5],5,-701558691),a=H(a,r,n,o,e[i+10],9,38016083),o=H(o,a,r,n,e[i+15],14,-660478335),n=H(n,o,a,r,e[i+4],20,-405537848),r=H(r,n,o,a,e[i+9],5,568446438),a=H(a,r,n,o,e[i+14],9,-1019803690),o=H(o,a,r,n,e[i+3],14,-187363961),n=H(n,o,a,r,e[i+8],20,1163531501),r=H(r,n,o,a,e[i+13],5,-1444681467),a=H(a,r,n,o,e[i+2],9,-51403784),o=H(o,a,r,n,e[i+7],14,1735328473),r=W(r,n=H(n,o,a,r,e[i+12],20,-1926607734),o,a,e[i+5],4,-378558),a=W(a,r,n,o,e[i+8],11,-2022574463),o=W(o,a,r,n,e[i+11],16,1839030562),n=W(n,o,a,r,e[i+14],23,-35309556),r=W(r,n,o,a,e[i+1],4,-1530992060),a=W(a,r,n,o,e[i+4],11,1272893353),o=W(o,a,r,n,e[i+7],16,-155497632),n=W(n,o,a,r,e[i+10],23,-1094730640),r=W(r,n,o,a,e[i+13],4,681279174),a=W(a,r,n,o,e[i],11,-358537222),o=W(o,a,r,n,e[i+3],16,-722521979),n=W(n,o,a,r,e[i+6],23,76029189),r=W(r,n,o,a,e[i+9],4,-640364487),a=W(a,r,n,o,e[i+12],11,-421815835),o=W(o,a,r,n,e[i+15],16,530742520),r=z(r,n=W(n,o,a,r,e[i+2],23,-995338651),o,a,e[i],6,-198630844),a=z(a,r,n,o,e[i+7],10,1126891415),o=z(o,a,r,n,e[i+14],15,-1416354905),n=z(n,o,a,r,e[i+5],21,-57434055),r=z(r,n,o,a,e[i+12],6,1700485571),a=z(a,r,n,o,e[i+3],10,-1894986606),o=z(o,a,r,n,e[i+10],15,-1051523),n=z(n,o,a,r,e[i+1],21,-2054922799),r=z(r,n,o,a,e[i+8],6,1873313359),a=z(a,r,n,o,e[i+15],10,-30611744),o=z(o,a,r,n,e[i+6],15,-1560198380),n=z(n,o,a,r,e[i+13],21,1309151649),r=z(r,n,o,a,e[i+4],6,-145523070),a=z(a,r,n,o,e[i+11],10,-1120210379),o=z(o,a,r,n,e[i+2],15,718787259),n=z(n,o,a,r,e[i+9],21,-343485551),r=L(r,u),n=L(n,s),o=L(o,c),a=L(a,l)}return[r,n,o,a]}(function(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(B(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}));function K(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function V(e,t){return e<<t|e>>>32-t}var G=U("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var o=0;o<n.length;++o)e.push(n.charCodeAt(o))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,i=Math.ceil(a/16),u=new Array(i),s=0;s<i;++s){for(var c=new Uint32Array(16),l=0;l<16;++l)c[l]=e[64*s+4*l]<<24|e[64*s+4*l+1]<<16|e[64*s+4*l+2]<<8|e[64*s+4*l+3];u[s]=c}u[i-1][14]=8*(e.length-1)/Math.pow(2,32),u[i-1][14]=Math.floor(u[i-1][14]),u[i-1][15]=8*(e.length-1)&4294967295;for(var f=0;f<i;++f){for(var d=new Uint32Array(80),h=0;h<16;++h)d[h]=u[f][h];for(var p=16;p<80;++p)d[p]=V(d[p-3]^d[p-8]^d[p-14]^d[p-16],1);for(var g=r[0],v=r[1],y=r[2],m=r[3],b=r[4],_=0;_<80;++_){var w=Math.floor(_/20),O=V(g,5)+K(w,v,y,m)+b+t[w]+d[_]>>>0;b=m,m=y,y=V(v,30)>>>0,v=g,g=O}r[0]=r[0]+g>>>0,r[1]=r[1]+v>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}));var J=Object.freeze({__proto__:null,v1:function(e,t,r){var n=t&&r||0,o=t||new Array(16),a=(e=e||{}).node||k,i=void 0!==e.clockseq?e.clockseq:j;if(null==a||null==i){var u=e.random||(e.rng||x)();null==a&&(a=k=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==i&&(i=j=16383&(u[6]<<8|u[7]))}var s=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:N+1,l=s-R+(c-N)/1e4;if(l<0&&void 0===e.clockseq&&(i=i+1&16383),(l<0||s>R)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");R=s,N=c,j=i;var f=(1e4*(268435455&(s+=122192928e5))+c)%4294967296;o[n++]=f>>>24&255,o[n++]=f>>>16&255,o[n++]=f>>>8&255,o[n++]=255&f;var d=s/4294967296*1e4&268435455;o[n++]=d>>>8&255,o[n++]=255&d,o[n++]=d>>>24&15|16,o[n++]=d>>>16&255,o[n++]=i>>>8|128,o[n++]=255&i;for(var h=0;h<6;++h)o[n+h]=a[h];return t||A(o)},v3:Y,v4:function(e,t,r){var n=(e=e||{}).random||(e.rng||x)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return A(n)},v5:G,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!E(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)},validate:E,stringify:A,parse:M}),Q=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheapestRate=void 0,t.getCheapestRate=function(e){if(0!==e.offers.length)return Math.min.apply(Math,e.offers.map((function(e){return e.nightlyRate})))}})),X=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateDiscount=void 0,t.calculateDiscount=function(e,t,r){return void 0===t||void 0===r||0===r?0:e<t?-1*(e-t)/t:e>r?-1*(e-r)/r:0}}));function $(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Z(e){$(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function ee(e){$(1,arguments);var t=Z(e);return!isNaN(t)}var te={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function re(e){return function(t){var r=t||{},n=r.width?String(r.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var ne={date:re({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:re({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:re({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},oe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ae(e){return function(t,r){var n,o=r||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,i=o.width?String(o.width):a;n=e.formattingValues[i]||e.formattingValues[a]}else{var u=e.defaultWidth,s=o.width?String(o.width):e.defaultWidth;n=e.values[s]||e.values[u]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function ie(e){return function(t,r){var n=String(t),o=r||{},a=o.width,i=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],u=n.match(i);if(!u)return null;var s,c=u[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth];return s="[object Array]"===Object.prototype.toString.call(l)?function(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r}(l,(function(e){return e.test(c)})):function(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}(l,(function(e){return e.test(c)})),s=e.valueCallback?e.valueCallback(s):s,{value:s=o.valueCallback?o.valueCallback(s):s,rest:n.slice(c.length)}}}var ue,se={code:"en-US",formatDistance:function(e,t,r){var n;return r=r||{},n="string"==typeof te[e]?te[e]:1===t?te[e].one:te[e].other.replace("{{count}}",t),r.addSuffix?r.comparison>0?"in "+n:n+" ago":n},formatLong:ne,formatRelative:function(e,t,r,n){return oe[e]},localize:{ordinalNumber:function(e,t){var r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:ae({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ae({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:ae({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:ae({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:ae({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(ue={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var r=String(e),n=t||{},o=r.match(ue.matchPattern);if(!o)return null;var a=o[0],i=r.match(ue.parsePattern);if(!i)return null;var u=ue.valueCallback?ue.valueCallback(i[0]):i[0];return{value:u=n.valueCallback?n.valueCallback(u):u,rest:r.slice(a.length)}}),era:ie({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ie({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:ie({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ie({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ie({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ce(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function le(e,t){$(2,arguments);var r=Z(e).getTime(),n=ce(t);return new Date(r+n)}function fe(e,t){$(2,arguments);var r=ce(t);return le(e,-r)}function de(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return r+n}var he=function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return de("yy"===t?n%100:n,t.length)},pe=function(e,t){var r=e.getUTCMonth();return"M"===t?String(r+1):de(r+1,2)},ge=function(e,t){return de(e.getUTCDate(),t.length)},ve=function(e,t){return de(e.getUTCHours()%12||12,t.length)},ye=function(e,t){return de(e.getUTCHours(),t.length)},me=function(e,t){return de(e.getUTCMinutes(),t.length)},be=function(e,t){return de(e.getUTCSeconds(),t.length)},_e=function(e,t){var r=t.length,n=e.getUTCMilliseconds();return de(Math.floor(n*Math.pow(10,r-3)),t.length)},we=864e5;function Oe(e){$(1,arguments);var t=1,r=Z(e),n=r.getUTCDay(),o=(n<t?7:0)+n-t;return r.setUTCDate(r.getUTCDate()-o),r.setUTCHours(0,0,0,0),r}function Te(e){$(1,arguments);var t=Z(e),r=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(r+1,0,4),n.setUTCHours(0,0,0,0);var o=Oe(n),a=new Date(0);a.setUTCFullYear(r,0,4),a.setUTCHours(0,0,0,0);var i=Oe(a);return t.getTime()>=o.getTime()?r+1:t.getTime()>=i.getTime()?r:r-1}function Ie(e){$(1,arguments);var t=Te(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=Oe(r);return n}var Se=6048e5;function xe(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:ce(o),i=null==r.weekStartsOn?a:ce(r.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Z(e),s=u.getUTCDay(),c=(s<i?7:0)+s-i;return u.setUTCDate(u.getUTCDate()-c),u.setUTCHours(0,0,0,0),u}function Pe(e,t){$(1,arguments);var r=Z(e,t),n=r.getUTCFullYear(),o=t||{},a=o.locale,i=a&&a.options&&a.options.firstWeekContainsDate,u=null==i?1:ce(i),s=null==o.firstWeekContainsDate?u:ce(o.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(n+1,0,s),c.setUTCHours(0,0,0,0);var l=xe(c,t),f=new Date(0);f.setUTCFullYear(n,0,s),f.setUTCHours(0,0,0,0);var d=xe(f,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function Ee(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.firstWeekContainsDate,a=null==o?1:ce(o),i=null==r.firstWeekContainsDate?a:ce(r.firstWeekContainsDate),u=Pe(e,t),s=new Date(0);s.setUTCFullYear(u,0,i),s.setUTCHours(0,0,0,0);var c=xe(s,t);return c}var ke=6048e5;var je="midnight",Ce="noon",De="morning",Ae="afternoon",Re="evening",Ne="night",Me={G:function(e,t,r){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){var n=e.getUTCFullYear(),o=n>0?n:1-n;return r.ordinalNumber(o,{unit:"year"})}return he(e,t)},Y:function(e,t,r,n){var o=Pe(e,n),a=o>0?o:1-o;return"YY"===t?de(a%100,2):"Yo"===t?r.ordinalNumber(a,{unit:"year"}):de(a,t.length)},R:function(e,t){return de(Te(e),t.length)},u:function(e,t){return de(e.getUTCFullYear(),t.length)},Q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return de(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return de(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){var n=e.getUTCMonth();switch(t){case"M":case"MM":return pe(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return de(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var o=function(e,t){$(1,arguments);var r=Z(e),n=xe(r,t).getTime()-Ee(r,t).getTime();return Math.round(n/ke)+1}(e,n);return"wo"===t?r.ordinalNumber(o,{unit:"week"}):de(o,t.length)},I:function(e,t,r){var n=function(e){$(1,arguments);var t=Z(e),r=Oe(t).getTime()-Ie(t).getTime();return Math.round(r/Se)+1}(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):de(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):ge(e,t)},D:function(e,t,r){var n=function(e){$(1,arguments);var t=Z(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),o=r-n;return Math.floor(o/we)+1}(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):de(n,t.length)},E:function(e,t,r){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var o=e.getUTCDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return de(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var o=e.getUTCDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return de(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){var n=e.getUTCDay(),o=0===n?7:n;switch(t){case"i":return String(o);case"ii":return de(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n,o=e.getUTCHours();switch(n=12===o?Ce:0===o?je:o/12>=1?"pm":"am",t){case"b":case"bb":case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n,o=e.getUTCHours();switch(n=o>=17?Re:o>=12?Ae:o>=4?De:Ne,t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){var n=e.getUTCHours()%12;return 0===n&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return ve(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):ye(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):de(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):de(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):me(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):be(e,t)},S:function(e,t){return _e(e,t)},X:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Be(o);case"XXXX":case"XX":return Le(o);case"XXXXX":case"XXX":default:return Le(o,":")}},x:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return Be(o);case"xxxx":case"xx":return Le(o);case"xxxxx":case"xxx":default:return Le(o,":")}},O:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ue(o,":");case"OOOO":default:return"GMT"+Le(o,":")}},z:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ue(o,":");case"zzzz":default:return"GMT"+Le(o,":")}},t:function(e,t,r,n){var o=n._originalDate||e;return de(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,r,n){return de((n._originalDate||e).getTime(),t.length)}};function Ue(e,t){var r=e>0?"-":"+",n=Math.abs(e),o=Math.floor(n/60),a=n%60;if(0===a)return r+String(o);var i=t||"";return r+String(o)+i+de(a,2)}function Be(e,t){return e%60==0?(e>0?"-":"+")+de(Math.abs(e)/60,2):Le(e,t)}function Le(e,t){var r=t||"",n=e>0?"-":"+",o=Math.abs(e);return n+de(Math.floor(o/60),2)+r+de(o%60,2)}function qe(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Fe(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var He={p:Fe,P:function(e,t){var r,n=e.match(/(P+)(p+)?/),o=n[1],a=n[2];if(!a)return qe(e,t);switch(o){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",qe(o,t)).replace("{{time}}",Fe(a,t))}},We=6e4;function ze(e){return e.getTime()%We}function Ye(e){var t=new Date(e.getTime()),r=Math.ceil(t.getTimezoneOffset());t.setSeconds(0,0);var n=r>0?(We+ze(t))%We:ze(t);return r*We+n}var Ke=["D","DD"],Ve=["YY","YYYY"];function Ge(e){return-1!==Ke.indexOf(e)}function Je(e){return-1!==Ve.indexOf(e)}function Qe(e,t,r){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://git.io/fxCyr"))}var Xe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ze=/^'([^]*?)'?$/,et=/''/g,tt=/[a-zA-Z]/;function rt(e){return e.match(Ze)[1].replace(et,"'")}var nt=Object.freeze({__proto__:null,default:function(e,t,r){$(2,arguments);var n=String(t),o=r||{},a=o.locale||se,i=a.options&&a.options.firstWeekContainsDate,u=null==i?1:ce(i),s=null==o.firstWeekContainsDate?u:ce(o.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,l=null==c?0:ce(c),f=null==o.weekStartsOn?l:ce(o.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var d=Z(e);if(!ee(d))throw new RangeError("Invalid time value");var h=Ye(d),p=fe(d,h),g={firstWeekContainsDate:s,weekStartsOn:f,locale:a,_originalDate:d},v=n.match($e).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,He[t])(e,a.formatLong,g):e})).join("").match(Xe).map((function(r){if("''"===r)return"'";var n=r[0];if("'"===n)return rt(r);var i=Me[n];if(i)return!o.useAdditionalWeekYearTokens&&Je(r)&&Qe(r,t,e),!o.useAdditionalDayOfYearTokens&&Ge(r)&&Qe(r,t,e),i(p,r,a.localize,g);if(n.match(tt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return r})).join("");return v}});function ot(e,t){$(2,arguments);var r=Z(e),n=ce(t);return isNaN(n)?new Date(NaN):n?(r.setDate(r.getDate()+n),r):r}var at=Object.freeze({__proto__:null,default:ot});function it(e,t){$(1,arguments);var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:ce(o),i=null==r.weekStartsOn?a:ce(r.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var u=Z(e),s=u.getDay(),c=6+(s<i?-7:0)-(s-i);return u.setHours(0,0,0,0),u.setDate(u.getDate()+c),u}var ut=Object.freeze({__proto__:null,default:function(e){return $(1,arguments),it(e,{weekStartsOn:1})}});var st=Object.freeze({__proto__:null,default:function(e,t){$(2,arguments);var r=ce(t),n=7*r;return ot(e,n)}}),ct=36e5,lt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ft=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,dt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ht=/^([+-])(\d{2})(?::?(\d{2}))?$/;function pt(e){var t,r={},n=e.split(lt.dateTimeDelimiter);if(n.length>2)return r;if(/:/.test(n[0])?(r.date=null,t=n[0]):(r.date=n[0],t=n[1],lt.timeZoneDelimiter.test(r.date)&&(r.date=e.split(lt.timeZoneDelimiter)[0],t=e.substr(r.date.length,e.length))),t){var o=lt.timezone.exec(t);o?(r.time=t.replace(o[1],""),r.timezone=o[1]):r.time=t}return r}function gt(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:null};var o=n[1]&&parseInt(n[1]),a=n[2]&&parseInt(n[2]);return{year:null==a?o:100*a,restDateString:e.slice((n[1]||n[2]).length)}}function vt(e,t){if(null===t)return null;var r=e.match(ft);if(!r)return null;var n=!!r[4],o=yt(r[1]),a=yt(r[2])-1,i=yt(r[3]),u=yt(r[4]),s=yt(r[5])-1;if(n)return function(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}(0,u,s)?function(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var o=n.getUTCDay()||7,a=7*(t-1)+r+1-o;return n.setUTCDate(n.getUTCDate()+a),n}(t,u,s):new Date(NaN);var c=new Date(0);return function(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(wt[t]||(Ot(e)?29:28))}(t,a,i)&&function(e,t){return t>=1&&t<=(Ot(e)?366:365)}(t,o)?(c.setUTCFullYear(t,a,Math.max(o,i)),c):new Date(NaN)}function yt(e){return e?parseInt(e):1}function mt(e){var t=e.match(dt);if(!t)return null;var r=bt(t[1]),n=bt(t[2]),o=bt(t[3]);return function(e,t,r){if(24===e)return 0===t&&0===r;return r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}(r,n,o)?r*ct+6e4*n+1e3*o:NaN}function bt(e){return e&&parseFloat(e.replace(",","."))||0}function _t(e){if("Z"===e)return 0;var t=e.match(ht);if(!t)return 0;var r="+"===t[1]?-1:1,n=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?r*(n*ct+6e4*o):NaN}var wt=[31,null,31,30,31,30,31,31,30,31,30,31];function Ot(e){return e%400==0||e%4==0&&e%100}var Tt=Object.freeze({__proto__:null,default:function(e,t){$(1,arguments);var r=t||{},n=null==r.additionalDigits?2:ce(r.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var o,a=pt(e);if(a.date){var i=gt(a.date,n);o=vt(i.restDateString,i.year)}if(isNaN(o)||!o)return new Date(NaN);var u,s=o.getTime(),c=0;if(a.time&&(c=mt(a.time),isNaN(c)||null===c))return new Date(NaN);if(!a.timezone){var l=new Date(s+c),f=new Date(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate(),l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds());return f.setFullYear(l.getUTCFullYear()),f}return u=_t(a.timezone),isNaN(u)?new Date(NaN):new Date(s+c+u)}}),It=r(f),St=r(nt),xt=r(at),Pt=r(ut),Et=r(st),kt=r(Tt),jt=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getCheckInCheckOutDates=t.dateToMiddayUTC=t.DATE_FORMAT=void 0;var r=It.__importDefault(St),n=It.__importDefault(xt),o=It.__importDefault(Pt),a=It.__importDefault(Et),i=It.__importDefault(kt);function u(e){return i.default(e+" 12:00:00")}t.DATE_FORMAT="yyyy-MM-dd",t.dateToMiddayUTC=u;var s=function(e,t){return n.default(e,t)};t.getCheckInCheckOutDates=function(e,i){var c,l=e.checkIn,f=e.checkOut,d=e.dayDistance,h=e.nights,p=void 0===h?1:h,g=u(r.default(new Date,t.DATE_FORMAT));c=void 0!==l?u(l):d?s(g,d):function(e){for(var i,s=e.daysFromNow,c=e.blockedDefaultDates,l=u(r.default(new Date,t.DATE_FORMAT)),f=o.default(n.default(l,s));i=r.default(f,t.DATE_FORMAT),c.includes(i);)f=a.default(f,1);return f}(i);var v=void 0===f?s(c,p):u(f);return{checkIn:r.default(c,t.DATE_FORMAT),checkOut:r.default(v,t.DATE_FORMAT)}}})),Ct=t((function(e,t){function r(e){void 0===e&&(e=[]);var t={},r={};e.forEach((function(e){var r=e[0],n=e[1],o=e[2],a=e[3];n&&(t[r]=X.calculateDiscount(n,o,a))}));var n=Math.min.apply(Math,Object.values(t)),o=Math.max.apply(Math,Object.values(t));return e.forEach((function(e){var a=e[0],i=e[1],u=(e[2],e[3]),s=i&&u&&u>0?o===n?1:(t[a]-n)/(o-n):void 0;void 0!==s&&(r[a]=Number(s.toFixed(2)))})),r}Object.defineProperty(t,"__esModule",{value:!0}),t.getDealScores=t.calculateDealScores=void 0,t.calculateDealScores=r,t.getDealScores=function(e){var t=e.offset,n=e.anchorHotelId,o=e.hotelIds,a=e.hotelEntities,i=e.hotelOfferEntities;return r((void 0===n||t>0?o:It.__spreadArrays([n],o)).map((function(e){var t,r,n,o=a[e],u=i[e],s=null!==(t=null==o?void 0:o.regularPriceRange)&&void 0!==t?t:[],c=s[0],l=s[1];return[e,null===(n=null===(r=null==u?void 0:u.offers)||void 0===r?void 0:r[0])||void 0===n?void 0:n.nightlyRate,c,l]})))}})),Dt=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.omit=void 0,t.omit=function(e,t){for(var r={},n={},o=0,a=e.length;o<a;)n[e[o]]=1,o+=1;for(var i in t)Object.prototype.hasOwnProperty.call(n,i)||(r[i]=t[i]);return r}}));function At(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if("production"!==process.env.NODE_ENV){var o=Pr[e],a=o?"function"==typeof o?o.apply(null,r):o:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Rt(e){return!!e&&!!e[Sr]}function Nt(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===Er}(e)||Array.isArray(e)||!!e[Ir]||!!e.constructor[Ir]||Ht(e)||Wt(e))}function Mt(e,t,r){void 0===r&&(r=!1),0===Ut(e)?(r?Object.keys:kr)(e).forEach((function(n){r&&"symbol"==typeof n||t(n,e[n],e)})):e.forEach((function(r,n){return t(n,r,e)}))}function Ut(e){var t=e[Sr];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Ht(e)?2:Wt(e)?3:0}function Bt(e,t){return 2===Ut(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Lt(e,t){return 2===Ut(e)?e.get(t):e[t]}function qt(e,t,r){var n=Ut(e);2===n?e.set(t,r):3===n?(e.delete(t),e.add(r)):e[t]=r}function Ft(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function Ht(e){return _r&&e instanceof Map}function Wt(e){return wr&&e instanceof Set}function zt(e){return e.o||e.t}function Yt(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=jr(e);delete t[Sr];for(var r=kr(t),n=0;n<r.length;n++){var o=r[n],a=t[o];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Kt(e,t){return void 0===t&&(t=!1),Gt(e)||Rt(e)||!Nt(e)||(Ut(e)>1&&(e.set=e.add=e.clear=e.delete=Vt),Object.freeze(e),t&&Mt(e,(function(e,t){return Kt(t,!0)}),!0)),e}function Vt(){At(2)}function Gt(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Jt(e){var t=Cr[e];return t||At(18,e),t}function Qt(e,t){Cr[e]||(Cr[e]=t)}function Xt(){return"production"===process.env.NODE_ENV||mr||At(0),mr}function $t(e,t){t&&(Jt("Patches"),e.u=[],e.s=[],e.v=t)}function Zt(e){er(e),e.p.forEach(rr),e.p=null}function er(e){e===mr&&(mr=e.l)}function tr(e){return mr={p:[],l:mr,h:e,m:!0,_:0}}function rr(e){var t=e[Sr];0===t.i||1===t.i?t.j():t.O=!0}function nr(e,t){t._=t.p.length;var r=t.p[0],n=void 0!==e&&e!==r;return t.h.g||Jt("ES5").S(t,e,n),n?(r[Sr].P&&(Zt(t),At(4)),Nt(e)&&(e=or(t,e),t.l||ir(t,e)),t.u&&Jt("Patches").M(r[Sr],e,t.u,t.s)):e=or(t,r,[]),Zt(t),t.u&&t.v(t.u,t.s),e!==Tr?e:void 0}function or(e,t,r){if(Gt(t))return t;var n=t[Sr];if(!n)return Mt(t,(function(o,a){return ar(e,n,t,o,a,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return ir(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=Yt(n.k):n.o;Mt(3===n.i?new Set(o):o,(function(t,a){return ar(e,n,o,t,a,r)})),ir(e,o,!1),r&&e.u&&Jt("Patches").R(n,r,e.u,e.s)}return n.o}function ar(e,t,r,n,o,a){if("production"!==process.env.NODE_ENV&&o===r&&At(5),Rt(o)){var i=or(e,o,a&&t&&3!==t.i&&!Bt(t.D,n)?a.concat(n):void 0);if(qt(r,n,i),!Rt(i))return;e.m=!1}if(Nt(o)&&!Gt(o)){if(!e.h.F&&e._<1)return;or(e,o),t&&t.A.l||ir(e,o)}}function ir(e,t,r){void 0===r&&(r=!1),e.h.F&&e.m&&Kt(t,r)}function ur(e,t){var r=e[Sr];return(r?zt(r):e)[t]}function sr(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function cr(e){e.P||(e.P=!0,e.l&&cr(e.l))}function lr(e){e.o||(e.o=Yt(e.t))}function fr(e,t,r){var n=Ht(t)?Jt("MapSet").N(t,r):Wt(t)?Jt("MapSet").T(t,r):e.g?function(e,t){var r=Array.isArray(e),n={i:r?1:0,A:t?t.A:Xt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=n,a=Dr;r&&(o=[n],a=Ar);var i=Proxy.revocable(o,a),u=i.revoke,s=i.proxy;return n.k=s,n.j=u,s}(t,r):Jt("ES5").J(t,r);return(r?r.A:Xt()).p.push(n),n}function dr(e){return Rt(e)||At(22,e),function e(t){if(!Nt(t))return t;var r,n=t[Sr],o=Ut(t);if(n){if(!n.P&&(n.i<4||!Jt("ES5").K(n)))return n.t;n.I=!0,r=hr(t,o),n.I=!1}else r=hr(t,o);return Mt(r,(function(t,o){n&&Lt(n.t,t)===o||qt(r,t,e(o))})),3===o?new Set(r):r}(e)}function hr(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Yt(e)}function pr(){function e(e,t){var r=a[e];return r?r.enumerable=t:a[e]=r={configurable:!0,enumerable:t,get:function(){var t=this[Sr];return"production"!==process.env.NODE_ENV&&o(t),Dr.get(t,e)},set:function(t){var r=this[Sr];"production"!==process.env.NODE_ENV&&o(r),Dr.set(r,e,t)}},r}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][Sr];if(!o.P)switch(o.i){case 5:n(o)&&cr(o);break;case 4:r(o)&&cr(o)}}}function r(e){for(var t=e.t,r=e.k,n=kr(r),o=n.length-1;o>=0;o--){var a=n[o];if(a!==Sr){var i=t[a];if(void 0===i&&!Bt(t,a))return!0;var u=r[a],s=u&&u[Sr];if(s?s.t!==i:!Ft(u,i))return!0}}var c=!!t[Sr];return n.length!==kr(t).length+(c?0:1)}function n(e){var t=e.k;if(t.length!==e.t.length)return!0;var r=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!r||r.get)}function o(e){e.O&&At(3,JSON.stringify(zt(e)))}var a={};Qt("ES5",{J:function(t,r){var n=Array.isArray(t),o=function(t,r){if(t){for(var n=Array(r.length),o=0;o<r.length;o++)Object.defineProperty(n,""+o,e(o,!0));return n}var a=jr(r);delete a[Sr];for(var i=kr(a),u=0;u<i.length;u++){var s=i[u];a[s]=e(s,t||!!a[s].enumerable)}return Object.create(Object.getPrototypeOf(r),a)}(n,t),a={i:n?5:4,A:r?r.A:Xt(),P:!1,I:!1,D:{},l:r,t:t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,Sr,{value:a,writable:!0}),o},S:function(e,r,o){o?Rt(r)&&r[Sr].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var r=t[Sr];if(r){var o=r.t,a=r.k,i=r.D,u=r.i;if(4===u)Mt(a,(function(t){t!==Sr&&(void 0!==o[t]||Bt(o,t)?i[t]||e(a[t]):(i[t]=!0,cr(r)))})),Mt(o,(function(e){void 0!==a[e]||Bt(a,e)||(i[e]=!1,cr(r))}));else if(5===u){if(n(r)&&(cr(r),i.length=!0),a.length<o.length)for(var s=a.length;s<o.length;s++)i[s]=!1;else for(var c=o.length;c<a.length;c++)i[c]=!0;for(var l=Math.min(a.length,o.length),f=0;f<l;f++)void 0===i[f]&&e(a[f])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?r(e):n(e)}})}function gr(){function e(t){if(!Nt(t))return t;if(Array.isArray(t))return t.map(e);if(Ht(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(Wt(t))return new Set(Array.from(t).map(e));var r=Object.create(Object.getPrototypeOf(t));for(var n in t)r[n]=e(t[n]);return Bt(t,Ir)&&(r[Ir]=t[Ir]),r}function t(t){return Rt(t)?e(t):t}var r="add";Qt("Patches",{$:function(t,n){return n.forEach((function(n){for(var o=n.path,a=n.op,i=t,u=0;u<o.length-1;u++){var s=Ut(i),c=""+o[u];0!==s&&1!==s||"__proto__"!==c&&"constructor"!==c||At(24),"function"==typeof i&&"prototype"===c&&At(24),"object"!=typeof(i=Lt(i,c))&&At(15,o.join("/"))}var l=Ut(i),f=e(n.value),d=o[o.length-1];switch(a){case"replace":switch(l){case 2:return i.set(d,f);case 3:At(16);default:return i[d]=f}case r:switch(l){case 1:return i.splice(d,0,f);case 2:return i.set(d,f);case 3:return i.add(f);default:return i[d]=f}case"remove":switch(l){case 1:return i.splice(d,1);case 2:return i.delete(d);case 3:return i.delete(n.value);default:return delete i[d]}default:At(17,a)}})),t},R:function(e,n,o,a){switch(e.i){case 0:case 4:case 2:return function(e,n,o,a){var i=e.t,u=e.o;Mt(e.D,(function(e,s){var c=Lt(i,e),l=Lt(u,e),f=s?Bt(i,e)?"replace":r:"remove";if(c!==l||"replace"!==f){var d=n.concat(e);o.push("remove"===f?{op:f,path:d}:{op:f,path:d,value:l}),a.push(f===r?{op:"remove",path:d}:"remove"===f?{op:r,path:d,value:t(c)}:{op:"replace",path:d,value:t(c)})}}))}(e,n,o,a);case 5:case 1:return function(e,n,o,a){var i=e.t,u=e.D,s=e.o;if(s.length<i.length){var c=[s,i];i=c[0],s=c[1];var l=[a,o];o=l[0],a=l[1]}for(var f=0;f<i.length;f++)if(u[f]&&s[f]!==i[f]){var d=n.concat([f]);o.push({op:"replace",path:d,value:t(s[f])}),a.push({op:"replace",path:d,value:t(i[f])})}for(var h=i.length;h<s.length;h++){var p=n.concat([h]);o.push({op:r,path:p,value:t(s[h])})}i.length<s.length&&a.push({op:"replace",path:n.concat(["length"]),value:i.length})}(e,n,o,a);case 3:return function(e,t,n,o){var a=e.t,i=e.o,u=0;a.forEach((function(e){if(!i.has(e)){var a=t.concat([u]);n.push({op:"remove",path:a,value:e}),o.unshift({op:r,path:a,value:e})}u++})),u=0,i.forEach((function(e){if(!a.has(e)){var i=t.concat([u]);n.push({op:r,path:i,value:e}),o.unshift({op:"remove",path:i,value:e})}u++}))}(e,n,o,a)}},M:function(e,t,r,n){r.push({op:"replace",path:[],value:t===Tr?void 0:t}),n.push({op:"replace",path:[],value:e.t})}})}function vr(){function e(e,t){function r(){this.constructor=e}o(e,t),e.prototype=(r.prototype=t.prototype,new r)}function t(e){e.o||(e.D=new Map,e.o=new Map(e.t))}function r(e){e.o||(e.o=new Set,e.t.forEach((function(t){if(Nt(t)){var r=fr(e.A.h,t,e);e.p.set(t,r),e.o.add(r)}else e.o.add(t)})))}function n(e){e.O&&At(3,JSON.stringify(zt(e)))}var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},a=function(){function r(e,t){return this[Sr]={i:2,l:t,A:t?t.A:Xt(),P:!1,I:!1,o:void 0,D:void 0,t:e,k:this,C:!1,O:!1},this}e(r,Map);var o=r.prototype;return Object.defineProperty(o,"size",{get:function(){return zt(this[Sr]).size}}),o.has=function(e){return zt(this[Sr]).has(e)},o.set=function(e,r){var o=this[Sr];return n(o),zt(o).has(e)&&zt(o).get(e)===r||(t(o),cr(o),o.D.set(e,!0),o.o.set(e,r),o.D.set(e,!0)),this},o.delete=function(e){if(!this.has(e))return!1;var r=this[Sr];return n(r),t(r),cr(r),r.D.set(e,!1),r.o.delete(e),!0},o.clear=function(){var e=this[Sr];n(e),zt(e).size&&(t(e),cr(e),e.D=new Map,Mt(e.t,(function(t){e.D.set(t,!1)})),e.o.clear())},o.forEach=function(e,t){var r=this;zt(this[Sr]).forEach((function(n,o){e.call(t,r.get(o),o,r)}))},o.get=function(e){var r=this[Sr];n(r);var o=zt(r).get(e);if(r.I||!Nt(o))return o;if(o!==r.t.get(e))return o;var a=fr(r.A.h,o,r);return t(r),r.o.set(e,a),a},o.keys=function(){return zt(this[Sr]).keys()},o.values=function(){var e,t=this,r=this.keys();return(e={})[xr]=function(){return t.values()},e.next=function(){var e=r.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},o.entries=function(){var e,t=this,r=this.keys();return(e={})[xr]=function(){return t.entries()},e.next=function(){var e=r.next();if(e.done)return e;var n=t.get(e.value);return{done:!1,value:[e.value,n]}},e},o[xr]=function(){return this.entries()},r}(),i=function(){function t(e,t){return this[Sr]={i:3,l:t,A:t?t.A:Xt(),P:!1,I:!1,o:void 0,t:e,k:this,p:new Map,O:!1,C:!1},this}e(t,Set);var o=t.prototype;return Object.defineProperty(o,"size",{get:function(){return zt(this[Sr]).size}}),o.has=function(e){var t=this[Sr];return n(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},o.add=function(e){var t=this[Sr];return n(t),this.has(e)||(r(t),cr(t),t.o.add(e)),this},o.delete=function(e){if(!this.has(e))return!1;var t=this[Sr];return n(t),r(t),cr(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},o.clear=function(){var e=this[Sr];n(e),zt(e).size&&(r(e),cr(e),e.o.clear())},o.values=function(){var e=this[Sr];return n(e),r(e),e.o.values()},o.entries=function(){var e=this[Sr];return n(e),r(e),e.o.entries()},o.keys=function(){return this.values()},o[xr]=function(){return this.values()},o.forEach=function(e,t){for(var r=this.values(),n=r.next();!n.done;)e.call(t,n.value,n.value,this),n=r.next()},t}();Qt("MapSet",{N:function(e,t){return new a(e,t)},T:function(e,t){return new i(e,t)}})}var yr,mr,br="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),_r="undefined"!=typeof Map,wr="undefined"!=typeof Set,Or="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Tr=br?Symbol.for("immer-nothing"):((yr={})["immer-nothing"]=!0,yr),Ir=br?Symbol.for("immer-draftable"):"__$immer_draftable",Sr=br?Symbol.for("immer-state"):"__$immer_state",xr="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Pr={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Er=""+Object.prototype.constructor,kr="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,jr=Object.getOwnPropertyDescriptors||function(e){var t={};return kr(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},Cr={},Dr={get:function(e,t){if(t===Sr)return e;var r=zt(e);if(!Bt(r,t))return function(e,t,r){var n,o=sr(t,r);return o?"value"in o?o.value:null===(n=o.get)||void 0===n?void 0:n.call(e.k):void 0}(e,r,t);var n=r[t];return e.I||!Nt(n)?n:n===ur(e.t,t)?(lr(e),e.o[t]=fr(e.A.h,n,e)):n},has:function(e,t){return t in zt(e)},ownKeys:function(e){return Reflect.ownKeys(zt(e))},set:function(e,t,r){var n=sr(zt(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var o=ur(zt(e),t),a=null==o?void 0:o[Sr];if(a&&a.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(Ft(r,o)&&(void 0!==r||Bt(e.t,t)))return!0;lr(e),cr(e)}return e.o[t]===r&&"number"!=typeof r&&(void 0!==r||t in e.o)||(e.o[t]=r,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==ur(e.t,t)||t in e.t?(e.D[t]=!1,lr(e),cr(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=zt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty:function(){At(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){At(12)}},Ar={};Mt(Dr,(function(e,t){Ar[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ar.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&At(13),Dr.deleteProperty.call(this,e[0],t)},Ar.set=function(e,t,r){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&At(14),Dr.set.call(this,e[0],t,r,e[0])};var Rr=function(){function e(e){var t=this;this.g=Or,this.F=!0,this.produce=function(e,r,n){if("function"==typeof e&&"function"!=typeof r){var o=r;r=e;var a=t;return function(e){var t=this;void 0===e&&(e=o);for(var n=arguments.length,i=Array(n>1?n-1:0),u=1;u<n;u++)i[u-1]=arguments[u];return a.produce(e,(function(e){var n;return(n=r).call.apply(n,[t,e].concat(i))}))}}var i;if("function"!=typeof r&&At(6),void 0!==n&&"function"!=typeof n&&At(7),Nt(e)){var u=tr(t),s=fr(t,e,void 0),c=!0;try{i=r(s),c=!1}finally{c?Zt(u):er(u)}return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return $t(u,n),nr(e,u)}),(function(e){throw Zt(u),e})):($t(u,n),nr(i,u))}if(!e||"object"!=typeof e){if((i=r(e))===Tr)return;return void 0===i&&(i=e),t.F&&Kt(i,!0),i}At(21,e)},this.produceWithPatches=function(e,r){return"function"==typeof e?function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return t.produceWithPatches(r,(function(t){return e.apply(void 0,[t].concat(o))}))}:[t.produce(e,r,(function(e,t){n=e,o=t})),n,o];var n,o},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){Nt(e)||At(8),Rt(e)&&(e=dr(e));var t=tr(this),r=fr(this,e,void 0);return r[Sr].C=!0,er(t),r},t.finishDraft=function(e,t){var r=e&&e[Sr];"production"!==process.env.NODE_ENV&&(r&&r.C||At(9),r.I&&At(10));var n=r.A;return $t(n,t),nr(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!Or&&At(20),this.g=e},t.applyPatches=function(e,t){var r;for(r=t.length-1;r>=0;r--){var n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}var o=Jt("Patches").$;return Rt(e)?o(e,t):this.produce(e,(function(e){return o(e,t.slice(r+1))}))},e}(),Nr=new Rr,Mr=Nr.produce,Ur=Nr.produceWithPatches.bind(Nr),Br=Nr.setAutoFreeze.bind(Nr),Lr=Nr.setUseProxies.bind(Nr),qr=Nr.applyPatches.bind(Nr),Fr=Nr.createDraft.bind(Nr),Hr=Nr.finishDraft.bind(Nr),Wr=r(Object.freeze({__proto__:null,default:Mr,Immer:Rr,applyPatches:qr,castDraft:function(e){return e},castImmutable:function(e){return e},createDraft:Fr,current:dr,enableAllPlugins:function(){pr(),vr(),gr()},enableES5:pr,enableMapSet:vr,enablePatches:gr,finishDraft:Hr,freeze:Kt,immerable:Ir,isDraft:Rt,isDraftable:Nt,nothing:Tr,original:function(e){return Rt(e)||At(23,e),e[Sr].t},produce:Mr,produceWithPatches:Ur,setAutoFreeze:Br,setUseProxies:Lr})),zr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createState=void 0,t.createState=function(e){var t=e;return{current:function(){return t},get:function(e){return t[e]},update:function(e){t=Wr.produce(t,e)}}}})),Yr=t((function(e,t){e.exports=function e(t,r,o){function a(u,s){if(!r[u]){if(!t[u]){if(!s&&n)return n();if(i)return i(u,!0);throw new Error("Cannot find module '"+u+"'")}var c=r[u]={exports:{}};t[u][0].call(c.exports,(function(e){return a(t[u][1][e]||e)}),c,c.exports,e,t,r,o)}return r[u].exports}for(var i=n,u=0;u<o.length;u++)a(o[u]);return a}({1:[function(e,t,r){(function(n,o,a,i,u,s,c,l,f){var d=e("crypto");function h(e,t){return function(e,t){var r;if(void 0===(r="passthrough"!==t.algorithm?d.createHash(t.algorithm):new b).write&&(r.write=r.update,r.end=r.update),m(t,r).dispatch(e),r.update||r.end(""),r.digest)return r.digest("buffer"===t.encoding?void 0:t.encoding);var n=r.read();return"buffer"!==t.encoding?n.toString(t.encoding):n}(e,t=v(e,t))}(r=t.exports=h).sha1=function(e){return h(e)},r.keys=function(e){return h(e,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},r.MD5=function(e){return h(e,{algorithm:"md5",encoding:"hex"})},r.keysMD5=function(e){return h(e,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var p=d.getHashes?d.getHashes().slice():["sha1","md5"];p.push("passthrough");var g=["buffer","hex","binary","base64"];function v(e,t){t=t||{};var r={};if(r.algorithm=t.algorithm||"sha1",r.encoding=t.encoding||"hex",r.excludeValues=!!t.excludeValues,r.algorithm=r.algorithm.toLowerCase(),r.encoding=r.encoding.toLowerCase(),r.ignoreUnknown=!0===t.ignoreUnknown,r.respectType=!1!==t.respectType,r.respectFunctionNames=!1!==t.respectFunctionNames,r.respectFunctionProperties=!1!==t.respectFunctionProperties,r.unorderedArrays=!0===t.unorderedArrays,r.unorderedSets=!1!==t.unorderedSets,r.unorderedObjects=!1!==t.unorderedObjects,r.replacer=t.replacer||void 0,r.excludeKeys=t.excludeKeys||void 0,void 0===e)throw new Error("Object argument required.");for(var n=0;n<p.length;++n)p[n].toLowerCase()===r.algorithm.toLowerCase()&&(r.algorithm=p[n]);if(-1===p.indexOf(r.algorithm))throw new Error('Algorithm "'+r.algorithm+'" not supported. supported values: '+p.join(", "));if(-1===g.indexOf(r.encoding)&&"passthrough"!==r.algorithm)throw new Error('Encoding "'+r.encoding+'" not supported. supported values: '+g.join(", "));return r}function y(e){if("function"==typeof e)return null!=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(e))}function m(e,t,r){function n(e){return t.update?t.update(e,"utf8"):t.write(e,"utf8")}return r=r||[],{dispatch:function(t){return e.replacer&&(t=e.replacer(t)),this["_"+(null===t?"null":typeof t)](t)},_object:function(t){var o,i=Object.prototype.toString.call(t),u=/\[object (.*)\]/i.exec(i);if(u=(u=u?u[1]:"unknown:["+i+"]").toLowerCase(),0<=(o=r.indexOf(t)))return this.dispatch("[CIRCULAR:"+o+"]");if(r.push(t),void 0!==a&&a.isBuffer&&a.isBuffer(t))return n("buffer:"),n(t);if("object"===u||"function"===u||"asyncfunction"===u){var s=Object.keys(t);e.unorderedObjects&&(s=s.sort()),!1===e.respectType||y(t)||s.splice(0,0,"prototype","__proto__","constructor"),e.excludeKeys&&(s=s.filter((function(t){return!e.excludeKeys(t)}))),n("object:"+s.length+":");var c=this;return s.forEach((function(r){c.dispatch(r),n(":"),e.excludeValues||c.dispatch(t[r]),n(",")}))}if(!this["_"+u]){if(e.ignoreUnknown)return n("["+u+"]");throw new Error('Unknown object type "'+u+'"')}this["_"+u](t)},_array:function(t,o){o=void 0!==o?o:!1!==e.unorderedArrays;var a=this;if(n("array:"+t.length+":"),!o||t.length<=1)return t.forEach((function(e){return a.dispatch(e)}));var i=[],u=t.map((function(t){var n=new b,o=r.slice();return m(e,n,o).dispatch(t),i=i.concat(o.slice(r.length)),n.read().toString()}));return r=r.concat(i),u.sort(),this._array(u,!1)},_date:function(e){return n("date:"+e.toJSON())},_symbol:function(e){return n("symbol:"+e.toString())},_error:function(e){return n("error:"+e.toString())},_boolean:function(e){return n("bool:"+e.toString())},_string:function(e){n("string:"+e.length+":"),n(e.toString())},_function:function(t){n("fn:"),y(t)?this.dispatch("[native]"):this.dispatch(t.toString()),!1!==e.respectFunctionNames&&this.dispatch("function-name:"+String(t.name)),e.respectFunctionProperties&&this._object(t)},_number:function(e){return n("number:"+e.toString())},_xml:function(e){return n("xml:"+e.toString())},_null:function(){return n("Null")},_undefined:function(){return n("Undefined")},_regexp:function(e){return n("regex:"+e.toString())},_uint8array:function(e){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint8clampedarray:function(e){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(e))},_int8array:function(e){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint16array:function(e){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_int16array:function(e){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_uint32array:function(e){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_int32array:function(e){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_float32array:function(e){return n("float32array:"),this.dispatch(Array.prototype.slice.call(e))},_float64array:function(e){return n("float64array:"),this.dispatch(Array.prototype.slice.call(e))},_arraybuffer:function(e){return n("arraybuffer:"),this.dispatch(new Uint8Array(e))},_url:function(e){return n("url:"+e.toString())},_map:function(t){n("map:");var r=Array.from(t);return this._array(r,!1!==e.unorderedSets)},_set:function(t){n("set:");var r=Array.from(t);return this._array(r,!1!==e.unorderedSets)},_file:function(e){return n("file:"),this.dispatch([e.name,e.size,e.type,e.lastModfied])},_blob:function(){if(e.ignoreUnknown)return n("[blob]");throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n')},_domwindow:function(){return n("domwindow")},_process:function(){return n("process")},_timer:function(){return n("timer")},_pipe:function(){return n("pipe")},_tcp:function(){return n("tcp")},_udp:function(){return n("udp")},_tty:function(){return n("tty")},_statwatcher:function(){return n("statwatcher")},_securecontext:function(){return n("securecontext")},_connection:function(){return n("connection")},_zlib:function(){return n("zlib")},_context:function(){return n("context")},_nodescript:function(){return n("nodescript")},_httpparser:function(){return n("httpparser")},_dataview:function(){return n("dataview")},_signal:function(){return n("signal")},_fsevent:function(){return n("fsevent")},_tlswrap:function(){return n("tlswrap")}}}function b(){return{buf:"",write:function(e){this.buf+=e},end:function(e){this.buf+=e},read:function(){return this.buf}}}r.writeToStream=function(e,t,r){return void 0===r&&(r=t,t={}),m(t=v(e,t),r).dispatch(e)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_5812b7fb.js","/")},{buffer:3,crypto:5,lYpoI2:10}],2:[function(e,t,r){(function(e,t,n,o,a,i,u,s,c){!function(e){var t="undefined"!=typeof Uint8Array?Uint8Array:Array,r="+".charCodeAt(0),n="/".charCodeAt(0),o="0".charCodeAt(0),a="a".charCodeAt(0),i="A".charCodeAt(0),u="-".charCodeAt(0),s="_".charCodeAt(0);function c(e){var t=e.charCodeAt(0);return t===r||t===u?62:t===n||t===s?63:t<o?-1:t<o+10?t-o+26+26:t<i+26?t-i:t<a+26?t-a+26:void 0}e.toByteArray=function(e){var r,n;if(0<e.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.length,a="="===e.charAt(o-2)?2:"="===e.charAt(o-1)?1:0,i=new t(3*e.length/4-a),u=0<a?e.length-4:e.length,s=0;function l(e){i[s++]=e}for(r=0;r<u;r+=4,0)l((16711680&(n=c(e.charAt(r))<<18|c(e.charAt(r+1))<<12|c(e.charAt(r+2))<<6|c(e.charAt(r+3))))>>16),l((65280&n)>>8),l(255&n);return 2==a?l(255&(n=c(e.charAt(r))<<2|c(e.charAt(r+1))>>4)):1==a&&(l((n=c(e.charAt(r))<<10|c(e.charAt(r+1))<<4|c(e.charAt(r+2))>>2)>>8&255),l(255&n)),i},e.fromByteArray=function(e){var t,r,n,o,a=e.length%3,i="";function u(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,n=e.length-a;t<n;t+=3)i+=u((o=r=(e[t]<<16)+(e[t+1]<<8)+e[t+2])>>18&63)+u(o>>12&63)+u(o>>6&63)+u(63&o);switch(a){case 1:i+=u((r=e[e.length-1])>>2),i+=u(r<<4&63),i+="==";break;case 2:i+=u((r=(e[e.length-2]<<8)+e[e.length-1])>>10),i+=u(r>>4&63),i+=u(r<<2&63),i+="="}return i}}(void 0===r?this.base64js={}:r)}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:10}],3:[function(e,t,r){(function(t,n,o,a,i,u,s,c,l){var f=e("base64-js"),d=e("ieee754");function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var n,a,i,u,s,c=typeof e;if("base64"===t&&"string"==c)for(e=(n=e).trim?n.trim():n.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==c)a=j(e);else if("string"==c)a=o.byteLength(e,t);else{if("object"!=c)throw new Error("First argument needs to be a number, array or string.");a=j(e.length)}if(o._useTypedArrays?i=o._augment(new Uint8Array(a)):((i=this).length=a,i._isBuffer=!0),o._useTypedArrays&&"number"==typeof e.byteLength)i._set(e);else if(C(s=e)||o.isBuffer(s)||s&&"object"==typeof s&&"number"==typeof s.length)for(u=0;u<a;u++)o.isBuffer(e)?i[u]=e.readUInt8(u):i[u]=e[u];else if("string"==c)i.write(e,0,t);else if("number"==c&&!o._useTypedArrays&&!r)for(u=0;u<a;u++)i[u]=0;return i}function h(e,t,r,n){return o._charsWritten=N(function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function p(e,t,r,n){return o._charsWritten=N(function(e){for(var t,r,n,o=[],a=0;a<e.length;a++)r=(t=e.charCodeAt(a))>>8,n=t%256,o.push(n),o.push(r);return o}(t),e,r,n)}function g(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;o++)n+=String.fromCharCode(e[o]);return n}function v(e,t,r,n){n||(q("boolean"==typeof r,"missing or invalid endian"),q(null!=t,"missing offset"),q(t+1<e.length,"Trying to read beyond buffer length"));var o,a=e.length;if(!(a<=t))return r?(o=e[t],t+1<a&&(o|=e[t+1]<<8)):(o=e[t]<<8,t+1<a&&(o|=e[t+1])),o}function y(e,t,r,n){n||(q("boolean"==typeof r,"missing or invalid endian"),q(null!=t,"missing offset"),q(t+3<e.length,"Trying to read beyond buffer length"));var o,a=e.length;if(!(a<=t))return r?(t+2<a&&(o=e[t+2]<<16),t+1<a&&(o|=e[t+1]<<8),o|=e[t],t+3<a&&(o+=e[t+3]<<24>>>0)):(t+1<a&&(o=e[t+1]<<16),t+2<a&&(o|=e[t+2]<<8),t+3<a&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}function m(e,t,r,n){if(n||(q("boolean"==typeof r,"missing or invalid endian"),q(null!=t,"missing offset"),q(t+1<e.length,"Trying to read beyond buffer length")),!(e.length<=t)){var o=v(e,t,r,!0);return 32768&o?-1*(65535-o+1):o}}function b(e,t,r,n){if(n||(q("boolean"==typeof r,"missing or invalid endian"),q(null!=t,"missing offset"),q(t+3<e.length,"Trying to read beyond buffer length")),!(e.length<=t)){var o=y(e,t,r,!0);return 2147483648&o?-1*(4294967295-o+1):o}}function _(e,t,r,n){return n||(q("boolean"==typeof r,"missing or invalid endian"),q(t+3<e.length,"Trying to read beyond buffer length")),d.read(e,t,r,23,4)}function w(e,t,r,n){return n||(q("boolean"==typeof r,"missing or invalid endian"),q(t+7<e.length,"Trying to read beyond buffer length")),d.read(e,t,r,52,8)}function O(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+1<e.length,"trying to write beyond buffer length"),U(t,65535));var a=e.length;if(!(a<=r))for(var i=0,u=Math.min(a-r,2);i<u;i++)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function T(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+3<e.length,"trying to write beyond buffer length"),U(t,4294967295));var a=e.length;if(!(a<=r))for(var i=0,u=Math.min(a-r,4);i<u;i++)e[r+i]=t>>>8*(n?i:3-i)&255}function I(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+1<e.length,"Trying to write beyond buffer length"),B(t,32767,-32768)),e.length<=r||O(e,0<=t?t:65535+t+1,r,n,o)}function S(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+3<e.length,"Trying to write beyond buffer length"),B(t,2147483647,-2147483648)),e.length<=r||T(e,0<=t?t:4294967295+t+1,r,n,o)}function x(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+3<e.length,"Trying to write beyond buffer length"),L(t,34028234663852886e22,-34028234663852886e22)),e.length<=r||d.write(e,t,r,n,23,4)}function P(e,t,r,n,o){o||(q(null!=t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(null!=r,"missing offset"),q(r+7<e.length,"Trying to write beyond buffer length"),L(t,17976931348623157e292,-17976931348623157e292)),e.length<=r||d.write(e,t,r,n,52,8)}r.Buffer=o,r.SlowBuffer=o,r.INSPECT_MAX_BYTES=50,o.poolSize=8192,o._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(e){return!1}}(),o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=A(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=R(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw new Error("Unknown encoding")}return r},o.concat=function(e,t){if(q(C(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new o(0);if(1===e.length)return e[0];if("number"!=typeof t)for(a=t=0;a<e.length;a++)t+=e[a].length;for(var r=new o(t),n=0,a=0;a<e.length;a++){var i=e[a];i.copy(r,n),n+=i.length}return r},o.prototype.write=function(e,t,r,n){var a;isFinite(t)?isFinite(r)||(n=r,r=void 0):(a=n,n=t,t=r,r=a),t=Number(t)||0;var i,u,s,c,l,f,d,g,v,y=this.length-t;switch((!r||y<(r=Number(r)))&&(r=y),n=String(n||"utf8").toLowerCase()){case"hex":i=function(e,t,r,n){r=Number(r)||0;var a=e.length-r;(!n||a<(n=Number(n)))&&(n=a);var i=t.length;q(i%2==0,"Invalid hex string"),i/2<n&&(n=i/2);for(var u=0;u<n;u++){var s=parseInt(t.substr(2*u,2),16);q(!isNaN(s),"Invalid hex string"),e[r+u]=s}return o._charsWritten=2*u,u}(this,e,t,r);break;case"utf8":case"utf-8":f=this,d=e,g=t,v=r,i=o._charsWritten=N(A(d),f,g,v);break;case"ascii":case"binary":i=h(this,e,t,r);break;case"base64":u=this,s=e,c=t,l=r,i=o._charsWritten=N(R(s),u,c,l);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=p(this,e,t,r);break;default:throw new Error("Unknown encoding")}return i},o.prototype.toString=function(e,t,r){var n,o,a,i,u=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(r=void 0!==r?Number(r):r=u.length)===t)return"";switch(e){case"hex":n=function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||n<r)&&(r=n);for(var o="",a=t;a<r;a++)o+=D(e[a]);return o}(u,t,r);break;case"utf8":case"utf-8":n=function(e,t,r){var n="",o="";r=Math.min(e.length,r);for(var a=t;a<r;a++)e[a]<=127?(n+=M(o)+String.fromCharCode(e[a]),o=""):o+="%"+e[a].toString(16);return n+M(o)}(u,t,r);break;case"ascii":case"binary":n=g(u,t,r);break;case"base64":o=u,i=r,n=0===(a=t)&&i===o.length?f.fromByteArray(o):f.fromByteArray(o.slice(a,i));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=function(e,t,r){for(var n=e.slice(t,r),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+256*n[a+1]);return o}(u,t,r);break;default:throw new Error("Unknown encoding")}return n},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.copy=function(e,t,r,n){if(r=r||0,n||0===n||(n=this.length),t=t||0,n!==r&&0!==e.length&&0!==this.length){q(r<=n,"sourceEnd < sourceStart"),q(0<=t&&t<e.length,"targetStart out of bounds"),q(0<=r&&r<this.length,"sourceStart out of bounds"),q(0<=n&&n<=this.length,"sourceEnd out of bounds"),n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var a=n-r;if(a<100||!o._useTypedArrays)for(var i=0;i<a;i++)e[i+t]=this[i+r];else e._set(this.subarray(r,r+a),t)}},o.prototype.slice=function(e,t){var r=this.length;if(e=k(e,r,0),t=k(t,r,r),o._useTypedArrays)return o._augment(this.subarray(e,t));for(var n=t-e,a=new o(n,void 0,!0),i=0;i<n;i++)a[i]=this[i+e];return a},o.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},o.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},o.prototype.readUInt8=function(e,t){if(t||(q(null!=e,"missing offset"),q(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return this[e]},o.prototype.readUInt16LE=function(e,t){return v(this,e,!0,t)},o.prototype.readUInt16BE=function(e,t){return v(this,e,!1,t)},o.prototype.readUInt32LE=function(e,t){return y(this,e,!0,t)},o.prototype.readUInt32BE=function(e,t){return y(this,e,!1,t)},o.prototype.readInt8=function(e,t){if(t||(q(null!=e,"missing offset"),q(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){return m(this,e,!0,t)},o.prototype.readInt16BE=function(e,t){return m(this,e,!1,t)},o.prototype.readInt32LE=function(e,t){return b(this,e,!0,t)},o.prototype.readInt32BE=function(e,t){return b(this,e,!1,t)},o.prototype.readFloatLE=function(e,t){return _(this,e,!0,t)},o.prototype.readFloatBE=function(e,t){return _(this,e,!1,t)},o.prototype.readDoubleLE=function(e,t){return w(this,e,!0,t)},o.prototype.readDoubleBE=function(e,t){return w(this,e,!1,t)},o.prototype.writeUInt8=function(e,t,r){r||(q(null!=e,"missing value"),q(null!=t,"missing offset"),q(t<this.length,"trying to write beyond buffer length"),U(e,255)),t>=this.length||(this[t]=e)},o.prototype.writeUInt16LE=function(e,t,r){O(this,e,t,!0,r)},o.prototype.writeUInt16BE=function(e,t,r){O(this,e,t,!1,r)},o.prototype.writeUInt32LE=function(e,t,r){T(this,e,t,!0,r)},o.prototype.writeUInt32BE=function(e,t,r){T(this,e,t,!1,r)},o.prototype.writeInt8=function(e,t,r){r||(q(null!=e,"missing value"),q(null!=t,"missing offset"),q(t<this.length,"Trying to write beyond buffer length"),B(e,127,-128)),t>=this.length||(0<=e?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},o.prototype.writeInt16LE=function(e,t,r){I(this,e,t,!0,r)},o.prototype.writeInt16BE=function(e,t,r){I(this,e,t,!1,r)},o.prototype.writeInt32LE=function(e,t,r){S(this,e,t,!0,r)},o.prototype.writeInt32BE=function(e,t,r){S(this,e,t,!1,r)},o.prototype.writeFloatLE=function(e,t,r){x(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){x(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){P(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){P(this,e,t,!1,r)},o.prototype.fill=function(e,t,r){if(e=e||0,t=t||0,r=r||this.length,"string"==typeof e&&(e=e.charCodeAt(0)),q("number"==typeof e&&!isNaN(e),"value is not a number"),q(t<=r,"end < start"),r!==t&&0!==this.length){q(0<=t&&t<this.length,"start out of bounds"),q(0<=r&&r<=this.length,"end out of bounds");for(var n=t;n<r;n++)this[n]=e}},o.prototype.inspect=function(){for(var e=[],t=this.length,n=0;n<t;n++)if(e[n]=D(this[n]),n===r.INSPECT_MAX_BYTES){e[n+1]="...";break}return"<Buffer "+e.join(" ")+">"},o.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(o._useTypedArrays)return new o(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;t<r;t+=1)e[t]=this[t];return e.buffer};var E=o.prototype;function k(e,t,r){return"number"!=typeof e?r:t<=(e=~~e)?t:0<=e||0<=(e+=t)?e:0}function j(e){return(e=~~Math.ceil(+e))<0?0:e}function C(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function D(e){return e<16?"0"+e.toString(16):e.toString(16)}function A(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<=127)t.push(e.charCodeAt(r));else{var o=r;55296<=n&&n<=57343&&r++;for(var a=encodeURIComponent(e.slice(o,r+1)).substr(1).split("%"),i=0;i<a.length;i++)t.push(parseInt(a[i],16))}}return t}function R(e){return f.toByteArray(e)}function N(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);o++)t[o+r]=e[o];return o}function M(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function U(e,t){q("number"==typeof e,"cannot write a non-number as a number"),q(0<=e,"specified a negative value for writing an unsigned value"),q(e<=t,"value is larger than maximum value for type"),q(Math.floor(e)===e,"value has a fractional component")}function B(e,t,r){q("number"==typeof e,"cannot write a non-number as a number"),q(e<=t,"value larger than maximum allowed value"),q(r<=e,"value smaller than minimum allowed value"),q(Math.floor(e)===e,"value has a fractional component")}function L(e,t,r){q("number"==typeof e,"cannot write a non-number as a number"),q(e<=t,"value larger than maximum allowed value"),q(r<=e,"value smaller than minimum allowed value")}function q(e,t){if(!e)throw new Error(t||"Failed assertion")}o._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=E.get,e.set=E.set,e.write=E.write,e.toString=E.toString,e.toLocaleString=E.toString,e.toJSON=E.toJSON,e.copy=E.copy,e.slice=E.slice,e.readUInt8=E.readUInt8,e.readUInt16LE=E.readUInt16LE,e.readUInt16BE=E.readUInt16BE,e.readUInt32LE=E.readUInt32LE,e.readUInt32BE=E.readUInt32BE,e.readInt8=E.readInt8,e.readInt16LE=E.readInt16LE,e.readInt16BE=E.readInt16BE,e.readInt32LE=E.readInt32LE,e.readInt32BE=E.readInt32BE,e.readFloatLE=E.readFloatLE,e.readFloatBE=E.readFloatBE,e.readDoubleLE=E.readDoubleLE,e.readDoubleBE=E.readDoubleBE,e.writeUInt8=E.writeUInt8,e.writeUInt16LE=E.writeUInt16LE,e.writeUInt16BE=E.writeUInt16BE,e.writeUInt32LE=E.writeUInt32LE,e.writeUInt32BE=E.writeUInt32BE,e.writeInt8=E.writeInt8,e.writeInt16LE=E.writeInt16LE,e.writeInt16BE=E.writeInt16BE,e.writeInt32LE=E.writeInt32LE,e.writeInt32BE=E.writeInt32BE,e.writeFloatLE=E.writeFloatLE,e.writeFloatBE=E.writeFloatBE,e.writeDoubleLE=E.writeDoubleLE,e.writeDoubleBE=E.writeDoubleBE,e.fill=E.fill,e.inspect=E.inspect,e.toArrayBuffer=E.toArrayBuffer,e}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:11,lYpoI2:10}],4:[function(e,t,r){(function(r,n,o,a,i,u,s,c,l){o=e("buffer").Buffer;var f=4,d=new o(f);d.fill(0),t.exports={hash:function(e,t,r,n){return o.isBuffer(e)||(e=new o(e)),function(e,t,r){for(var n=new o(t),a=r?n.writeInt32BE:n.writeInt32LE,i=0;i<e.length;i++)a.call(n,e[i],4*i,!0);return n}(t(function(e,t){var r;e.length%f!=0&&(r=e.length+(f-e.length%f),e=o.concat([e,d],r));for(var n=[],a=t?e.readInt32BE:e.readInt32LE,i=0;i<e.length;i+=f)n.push(a.call(e,i));return n}(e,n),8*e.length),r,n)}}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],5:[function(e,t,r){(function(t,n,o,a,i,u,s,c,l){o=e("buffer").Buffer;var f=e("./sha"),d=e("./sha256"),h=e("./rng"),p={sha1:f,sha256:d,md5:e("./md5")},g=64,v=new o(g);function y(e,t){var r=p[e=e||"sha1"],n=[];return r||m("algorithm:",e,"is not yet supported"),{update:function(e){return o.isBuffer(e)||(e=new o(e)),n.push(e),e.length,this},digest:function(e){var a=o.concat(n),i=t?function(e,t,r){o.isBuffer(t)||(t=new o(t)),o.isBuffer(r)||(r=new o(r)),t.length>g?t=e(t):t.length<g&&(t=o.concat([t,v],g));for(var n=new o(g),a=new o(g),i=0;i<g;i++)n[i]=54^t[i],a[i]=92^t[i];var u=e(o.concat([n,r]));return e(o.concat([a,u]))}(r,t,a):r(a);return n=null,e?i.toString(e):i}}}function m(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}v.fill(0),r.createHash=function(e){return y(e)},r.createHmac=y,r.randomBytes=function(e,t){if(!t||!t.call)return new o(h(e));try{t.call(this,void 0,new o(h(e)))}catch(e){t(e)}},function(e,t){for(var r in e)t(e[r],r)}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],(function(e){r[e]=function(){m("sorry,",e,"is not implemented yet")}}))}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:10}],6:[function(e,t,r){(function(r,n,o,a,i,u,s,c,l){var f=e("./helpers");function d(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var r=1732584193,n=-271733879,o=-1732584194,a=271733878,i=0;i<e.length;i+=16){var u=r,s=n,c=o,l=a;r=p(r,n,o,a,e[i+0],7,-680876936),a=p(a,r,n,o,e[i+1],12,-389564586),o=p(o,a,r,n,e[i+2],17,606105819),n=p(n,o,a,r,e[i+3],22,-1044525330),r=p(r,n,o,a,e[i+4],7,-176418897),a=p(a,r,n,o,e[i+5],12,1200080426),o=p(o,a,r,n,e[i+6],17,-1473231341),n=p(n,o,a,r,e[i+7],22,-45705983),r=p(r,n,o,a,e[i+8],7,1770035416),a=p(a,r,n,o,e[i+9],12,-1958414417),o=p(o,a,r,n,e[i+10],17,-42063),n=p(n,o,a,r,e[i+11],22,-1990404162),r=p(r,n,o,a,e[i+12],7,1804603682),a=p(a,r,n,o,e[i+13],12,-40341101),o=p(o,a,r,n,e[i+14],17,-1502002290),r=g(r,n=p(n,o,a,r,e[i+15],22,1236535329),o,a,e[i+1],5,-165796510),a=g(a,r,n,o,e[i+6],9,-1069501632),o=g(o,a,r,n,e[i+11],14,643717713),n=g(n,o,a,r,e[i+0],20,-373897302),r=g(r,n,o,a,e[i+5],5,-701558691),a=g(a,r,n,o,e[i+10],9,38016083),o=g(o,a,r,n,e[i+15],14,-660478335),n=g(n,o,a,r,e[i+4],20,-405537848),r=g(r,n,o,a,e[i+9],5,568446438),a=g(a,r,n,o,e[i+14],9,-1019803690),o=g(o,a,r,n,e[i+3],14,-187363961),n=g(n,o,a,r,e[i+8],20,1163531501),r=g(r,n,o,a,e[i+13],5,-1444681467),a=g(a,r,n,o,e[i+2],9,-51403784),o=g(o,a,r,n,e[i+7],14,1735328473),r=v(r,n=g(n,o,a,r,e[i+12],20,-1926607734),o,a,e[i+5],4,-378558),a=v(a,r,n,o,e[i+8],11,-2022574463),o=v(o,a,r,n,e[i+11],16,1839030562),n=v(n,o,a,r,e[i+14],23,-35309556),r=v(r,n,o,a,e[i+1],4,-1530992060),a=v(a,r,n,o,e[i+4],11,1272893353),o=v(o,a,r,n,e[i+7],16,-155497632),n=v(n,o,a,r,e[i+10],23,-1094730640),r=v(r,n,o,a,e[i+13],4,681279174),a=v(a,r,n,o,e[i+0],11,-358537222),o=v(o,a,r,n,e[i+3],16,-722521979),n=v(n,o,a,r,e[i+6],23,76029189),r=v(r,n,o,a,e[i+9],4,-640364487),a=v(a,r,n,o,e[i+12],11,-421815835),o=v(o,a,r,n,e[i+15],16,530742520),r=y(r,n=v(n,o,a,r,e[i+2],23,-995338651),o,a,e[i+0],6,-198630844),a=y(a,r,n,o,e[i+7],10,1126891415),o=y(o,a,r,n,e[i+14],15,-1416354905),n=y(n,o,a,r,e[i+5],21,-57434055),r=y(r,n,o,a,e[i+12],6,1700485571),a=y(a,r,n,o,e[i+3],10,-1894986606),o=y(o,a,r,n,e[i+10],15,-1051523),n=y(n,o,a,r,e[i+1],21,-2054922799),r=y(r,n,o,a,e[i+8],6,1873313359),a=y(a,r,n,o,e[i+15],10,-30611744),o=y(o,a,r,n,e[i+6],15,-1560198380),n=y(n,o,a,r,e[i+13],21,1309151649),r=y(r,n,o,a,e[i+4],6,-145523070),a=y(a,r,n,o,e[i+11],10,-1120210379),o=y(o,a,r,n,e[i+2],15,718787259),n=y(n,o,a,r,e[i+9],21,-343485551),r=m(r,u),n=m(n,s),o=m(o,c),a=m(a,l)}return Array(r,n,o,a)}function h(e,t,r,n,o,a){return m((i=m(m(t,e),m(n,a)))<<(u=o)|i>>>32-u,r);var i,u}function p(e,t,r,n,o,a,i){return h(t&r|~t&n,e,t,o,a,i)}function g(e,t,r,n,o,a,i){return h(t&n|r&~n,e,t,o,a,i)}function v(e,t,r,n,o,a,i){return h(t^r^n,e,t,o,a,i)}function y(e,t,r,n,o,a,i){return h(r^(t|~n),e,t,o,a,i)}function m(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return f.hash(e,d,16)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],7:[function(e,t,r){(function(e,r,n,o,a,i,u,s,c){var l;l=function(e){for(var t,r=new Array(e),n=0;n<e;n++)0==(3&n)&&(t=4294967296*Math.random()),r[n]=t>>>((3&n)<<3)&255;return r},t.exports=l}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],8:[function(e,t,r){(function(r,n,o,a,i,u,s,c,l){var f=e("./helpers");function d(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var r,n,o,a,i,u=Array(80),s=1732584193,c=-271733879,l=-1732584194,f=271733878,d=-1009589776,g=0;g<e.length;g+=16){for(var v=s,y=c,m=l,b=f,_=d,w=0;w<80;w++){u[w]=w<16?e[g+w]:p(u[w-3]^u[w-8]^u[w-14]^u[w-16],1);var O=h(h(p(s,5),(o=c,a=l,i=f,(n=w)<20?o&a|~o&i:!(n<40)&&n<60?o&a|o&i|a&i:o^a^i)),h(h(d,u[w]),(r=w)<20?1518500249:r<40?1859775393:r<60?-1894007588:-899497514));d=f,f=l,l=p(c,30),c=s,s=O}s=h(s,v),c=h(c,y),l=h(l,m),f=h(f,b),d=h(d,_)}return Array(s,c,l,f,d)}function h(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function p(e,t){return e<<t|e>>>32-t}t.exports=function(e){return f.hash(e,d,20,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],9:[function(e,t,r){(function(r,n,o,a,i,u,s,c,l){function f(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function d(e,t){return e>>>t|e<<32-t}function h(e,t){var r,n,o,a,i,u,s,c,l,h,p=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),g=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),v=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var y,m,b,_,w,O,T,I,S=0;S<e.length;S+=16){r=g[0],n=g[1],o=g[2],a=g[3],i=g[4],u=g[5],s=g[6],c=g[7];for(var x=0;x<64;x++)v[x]=x<16?e[x+S]:f(f(f(d(I=v[x-2],17)^d(I,19)^I>>>10,v[x-7]),d(T=v[x-15],7)^d(T,18)^T>>>3),v[x-16]),l=f(f(f(f(c,d(O=i,6)^d(O,11)^d(O,25)),(w=i)&u^~w&s),p[x]),v[x]),h=f(d(_=r,2)^d(_,13)^d(_,22),(y=r)&(m=n)^y&(b=o)^m&b),c=s,s=u,u=i,i=f(a,l),a=o,o=n,n=r,r=f(l,h);g[0]=f(r,g[0]),g[1]=f(n,g[1]),g[2]=f(o,g[2]),g[3]=f(a,g[3]),g[4]=f(i,g[4]),g[5]=f(u,g[5]),g[6]=f(s,g[6]),g[7]=f(c,g[7])}return g}var p=e("./helpers");t.exports=function(e){return p.hash(e,h,32,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],10:[function(e,t,r){(function(e,r,n,o,a,i,u,s,c){function l(){}(e=t.exports={}).nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",(function(e){var t=e.source;t!==window&&null!==t||"process-tick"!==e.data||(e.stopPropagation(),0<r.length&&r.shift()())}),!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=l,e.addListener=l,e.once=l,e.off=l,e.removeListener=l,e.removeAllListeners=l,e.emit=l,e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){throw new Error("process.chdir is not supported")}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:10}],11:[function(e,t,r){(function(e,t,n,o,a,i,u,s,c){r.read=function(e,t,r,n,o){var a,i,u=8*o-n-1,s=(1<<u)-1,c=s>>1,l=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,a=h&(1<<-l)-1,h>>=-l,l+=u;0<l;a=256*a+e[t+f],f+=d,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=n;0<l;i=256*i+e[t+f],f+=d,l-=8);if(0===a)a=1-c;else{if(a===s)return i?NaN:1/0*(h?-1:1);i+=Math.pow(2,n),a-=c}return(h?-1:1)*i*Math.pow(2,a-n)},r.write=function(e,t,r,n,o,a){var i,u,s,c=8*a-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-i))<1&&(i--,s*=2),2<=(t+=1<=i+f?d/s:d*Math.pow(2,1-f))*s&&(i++,s/=2),l<=i+f?(u=0,i=l):1<=i+f?(u=(t*s-1)*Math.pow(2,o),i+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,o),i=0));8<=o;e[r+h]=255&u,h+=p,u/=256,o-=8);for(i=i<<o|u,c+=o;0<c;e[r+h]=255&i,h+=p,i/=256,c-=8);e[r+h-p]|=128*g}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/ieee754/index.js","/node_modules/ieee754")},{buffer:3,lYpoI2:10}]},{},[1])(1)})),Kr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSearchId=void 0;var r=It.__importDefault(Yr);t.generateSearchId=function(e,t){var n=t.anonymousId,o=t.language,a=t.currency,i=t.countryCode;return r.default(It.__assign(It.__assign({},e),{anonymousId:n,language:o,currency:a,countryCode:i}))}})),Vr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.augmentHotelWithRegularPriceRange=void 0,t.augmentHotelWithRegularPriceRange=function(e,t,r){var n;if(void 0===(null===(n=e.pricing)||void 0===n?void 0:n.medianRateBkt)||void 0===r)return e;var o=e.pricing.medianRateBkt*r*t,a=(e.pricing.medianRateBkt+1)*r*t;return It.__assign(It.__assign({},e),{regularPriceRange:[Math.floor(o),Math.ceil(a)]})}})),Gr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeEmpty=void 0,t.removeEmpty=function e(t){return Object.entries(t).filter((function(e){e[0];var t=e[1];return null!=t})).reduce((function(t,r){var n,o=r[0],a=r[1];return It.__assign(It.__assign({},t),((n={})[o]=a===new Object(a)?e(a):a,n))}),{})}})),Jr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),It.__exportStar(Q,t),It.__exportStar(X,t),It.__exportStar(jt,t),It.__exportStar(Ct,t),It.__exportStar(Dt,t),It.__exportStar(zr,t),It.__exportStar(Kr,t),It.__exportStar(Vr,t),It.__exportStar(Gr,t)})),Qr=t((function(e,t){function r(e,t,r,n){return!(void 0!==r&&e.nightlyRate<r)&&!(void 0!==n&&n<t&&e.nightlyRate>n)}function n(e,t){var n,o=e.filters,a=void 0===o?{}:o,i=e.priceBucketWidth,u=e.priceBucketsCount,s=e.exchangeRate;if(void 0===i)return t;var c=a.priceMin,l=a.priceMax,f=u*Math.round(i*s);if((void 0!==c||void 0!==l)&&!(null===(n=t.offers)||void 0===n?void 0:n.some((function(e){return r(e,f,c,l)}))))return It.__assign(It.__assign({},t),{offers:[]});return t}function o(e,t){var r=t.sortField,n=t.sortOrder;return"price"===r?function(e,t){return e.sort((function(e,r){var n,o,a=(null!==(n=Jr.getCheapestRate(e))&&void 0!==n?n:0)-(null!==(o=Jr.getCheapestRate(r))&&void 0!==o?o:0);return"ascending"===t?a:-a}))}(e,void 0===n?"ascending":n):e}function a(e){var t=e.topOfferData,r=e.anchorPriceRateBreakdown,n=r.calculatedTotalRate,o=r.nightlyRate;return It.__assign(It.__assign({},t),{anchorPrice:n,anchorPriceNightly:o})}Object.defineProperty(t,"__esModule",{value:!0}),t.augmentRaaResponse=t.augmentHotelOffersWithAnchorPrice=t.augmentOffersWithAnchorPrice=t.augmentTopOfferDataWithAnchorPrice=t.applyPriceFilter=t.isOfferInPriceRange=t.generateSortingBoost=void 0,t.generateSortingBoost=function(e){var t;return(null===(t=null==e?void 0:e.filters)||void 0===t?void 0:t.freeCancellation)?"freeCancellation=true:100":void 0},t.isOfferInPriceRange=r,t.applyPriceFilter=n,t.augmentTopOfferDataWithAnchorPrice=a;function i(e,t){var r=e.offers;if(!(null==r?void 0:r.length))return r;var n=t.anchorPrice;return void 0===n?r:r.map((function(e){return It.__assign(It.__assign({},e),{hasAnchorPrice:n-e.calculatedTotalRate>.03*n})}))}function u(e){var t=e.anchorPriceRateBreakdown,r=e.topOfferData;if(void 0===t||void 0===r)return e;var n=a(e),o=i(e,n);return It.__assign(It.__assign({},e),{topOfferData:n,offers:o})}t.augmentOffersWithAnchorPrice=i,t.augmentHotelOffersWithAnchorPrice=u,t.augmentRaaResponse=function(e,t){var r,a=e.hotelOfferEntities,i=e.anchorHotelOfferEntity;a&&(r=a.map((function(e){return n(t,e)})),void 0!==t.sortField&&(r=o(r,t)));var s=[],c={};return null==r||r.forEach((function(e){s.push(e.id),c[e.id]=u(e)})),void 0!==i&&(c[i.id]=u(i)),{hotelIds:s,hotelOfferEntities:c}}})),Xr=r(I),$r=r(J),Zr=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.raa=void 0;var r,n=It.__importDefault(Xr);!function(e){e[e.Connecting=0]="Connecting",e[e.Open=1]="Open",e[e.Closing=2]="Closing",e[e.Closed=3]="Closed"}(r||(r={}));t.raa=function(e,t){if(void 0===e)throw new TypeError("RAA endpoint must be provided");if("undefined"==typeof WebSocket&&void 0===t.WebSocket)throw new TypeError("Client does not support WebSocket");var o,a=new n.default(e,[],{maxRetries:20,WebSocket:t.WebSocket}),i={};function u(e){t.logger.log({name:"WebsocketConnectionClosed",value:{service:"daedalus",code:e.code,reason:e.reason,wasClean:e.wasClean}}),void 0!==i.current&&a.reconnect()}function s(e){t.logger.log({name:"WebsocketError",value:It.__assign(It.__assign({},e),{service:"daedalus"})}),void 0!==i.current&&a.reconnect()}function c(){var e=i.current;void 0!==e&&a.send(e)}function l(e){var t;try{t=JSON.parse(e.data)}catch(e){console.log("WEBSOCKET: error parsing message")}void 0!==o&&o(t)}return a.addEventListener("open",c),a.addEventListener("close",u),a.addEventListener("error",s),a.addEventListener("message",l),{getOffers:function(e,n){return It.__awaiter(this,void 0,void 0,(function(){var u;return It.__generator(this,(function(s){return u={},i.current=function(e,t){var r,n,o,a,i,u={checkIn:e.checkIn,checkOut:e.checkOut,destination:null!==(n=null===(r=e.hotelIds)||void 0===r?void 0:r.join(","))&&void 0!==n?n:"",getAllOffers:e.getAllOffers,highlightedHotelID:e.anchorHotelId,rooms:e.rooms,cugDeals:null===(o=e.cugDeals)||void 0===o?void 0:o.join(","),profileId:null!==(a=e.originId)&&void 0!==a?a:"default",searchId:e.searchId,useAlternativeRaaKeys:e.useAlternativeRaaKeys,preferredRate:e.preferredRate,trafficSource:e.trafficSource,deviceCategory:t.deviceType,languageCode:t.language,userCountryCode:t.countryCode,currencyCode:t.currency,anonymousId:t.anonymousId,includeLocalTaxes:t.includeLocalTaxes,includeTaxes:t.includeTaxes,skipBackendAugmentation:t.skipBackendAugmentation,facetsEnabled:t.facetsEnabled,sapiCliKey:t.sapiCliKey,sortingBoost:Qr.generateSortingBoost(e),clientRequestId:$r.v4(),roomLimit:1,anchorRoomLimit:2};try{i=JSON.stringify(u)}catch(e){console.log("WEBSOCKET: error serialising query")}return i}(e,t),[2,new Promise((function(t){o=function(r){var o;if(void 0!==r)if(r.status.complete)t(u),i.current=void 0;else{var a=r.results.find((function(t){return t.id===e.anchorHotelId}));a?u.anchorHotelOfferEntity=Jr.omit(["errors"],a):u.hotelOfferEntities=null===(o=r.results)||void 0===o?void 0:o.map((function(e){return Jr.omit(["errors"],e)})),"function"==typeof n&&n(It.__assign({},u))}},a.readyState===r.Open&&void 0!==i.current&&a.send(i.current)}))]}))}))}}}})),en=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),It.__exportStar(Zr,t),It.__exportStar(Qr,t)}));function tn(e){$(1,arguments);var t=Z(e);return t.setHours(0,0,0,0),t}var rn=864e5;function nn(e,t){$(2,arguments);var r=tn(e),n=tn(t),o=r.getTime()-Ye(r),a=n.getTime()-Ye(n);return Math.round((o-a)/rn)}function on(e,t){var r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}var an=r(Object.freeze({__proto__:null,default:function(e,t){$(2,arguments);var r=Z(e),n=Z(t),o=on(r,n),a=Math.abs(nn(r,n));r.setDate(r.getDate()-o*a);var i=on(r,n)===-o,u=o*(a-i);return 0===u?0:u}})),un=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.pickIndexVariation=t.hitToPlaceSuggest=t.hitToHotelSuggest=t.hitToPlaceTypeAnchor=t.hitToHotelTypeAnchor=t.hitToHotel=t.placeTypeToPlaceTypeName=t.validateHit=t.mergeTranslatedAttributes=t.attributeWithFallback=t.getValueFromTranslatedHightlightResult=t.getStringFromTranslatedArray=t.translatedArrayToString=t.toString=t.getTranslatedAttributes=t.isNotEmptyOrWhiteSpace=t.getTagsFilter=t.getCheckInNights=void 0;var r=It.__importDefault(an),n=It.__importDefault(St);function o(e,t){var o=Jr.dateToMiddayUTC(e),a=Jr.dateToMiddayUTC(t);return n.default(o,"yyMMdd")+"-"+r.default(a,o)}function a(e){return Boolean(e&&""!==(null==e?void 0:e.trim()))}function i(e,t){for(var r=0,n=t;r<n.length;r++){var o=n[r];if(a(null==e?void 0:e[o]))return e[o]}return""}function u(e,t,r){void 0===r&&(r=", ");var n={};return t.forEach((function(o){var i=(null==e?void 0:e[o])||[];n[o]=i.map((function(r,n){if(a(r))return r;var o=t.find((function(t){var r;return a(null===(r=null==e?void 0:e[t])||void 0===r?void 0:r[n])}));return o?e[o][n]:""})).join(""+r)})),i(n,t)}function s(e,t,r){var n={};return t.forEach((function(o){var i=e[o]||[],u=-1===r?void 0:r+1,s=i.slice(r,u).toString();if(a(s))n[o]=s;else{var c=t.find((function(t){var n;return a(null===(n=null==e?void 0:e[t])||void 0===n?void 0:n[r])}));n[o]=c?e[c][r]:""}})),i(n,t)}function c(e,t){var r={};return t.forEach((function(n){var o,i=null===(o=e[n])||void 0===o?void 0:o.value;if(a(i))r[n]=i;else{var u=t.find((function(t){var r;return a(null===(r=e[t])||void 0===r?void 0:r.value)}));r[n]=u?e[u].value:""}})),i(r,t)}function l(e,t,r){var n,o=e[t];if(!o){var a=r.indexOf(t),i=null!==(n=r.slice(a).find((function(t){return e[t]})))&&void 0!==n?n:"en";o=e[i]}return void 0===o&&(o=[]),"string"==typeof o?[o]:o}function f(e,t,r){for(var n={},o=0,a=r;o<a.length;o++){var i=a[o];n[i]=It.__spreadArrays(l(e,i,r),l(t,i,r))}return u(n,r)}function d(e,t,r){if(void 0===e)return t;try{for(var n in t)if(void 0===e[n])throw new TypeError("Hotel "+e.objectID+" is missing "+n+" field")}catch(e){r||console.error(e)}return It.__assign(It.__assign({},t),e)}function h(e){if(void 0===e)return"property";switch(e){case 0:return"country";case 23:return"city";case 64:case 1010:return"airport";case 199:case 232:case 251:case 1024:return"station";default:return"area"}}t.getCheckInNights=o,t.getTagsFilter=function(e,t){return["tags:-u"+o(e,t)]},t.isNotEmptyOrWhiteSpace=a,t.getTranslatedAttributes=function(e,t){var r=[];return e.forEach((function(e){var n=t.map((function(t){return t+"."+e}));r.push.apply(r,n)})),r},t.toString=i,t.translatedArrayToString=u,t.getStringFromTranslatedArray=s,t.getValueFromTranslatedHightlightResult=c,t.attributeWithFallback=l,t.mergeTranslatedAttributes=f,t.validateHit=d,t.placeTypeToPlaceTypeName=h,t.hitToHotel=function(e,t){var r=d(e,{address:{},placeADName:{},placeDN:{},hotelName:{}}),n=It.__assign(It.__assign({},r),{displayAddress:f(r.address,r.placeADName,t),placeDisplayName:u(r.placeDN,t),hotelName:i(r.hotelName,t)});return Jr.omit(["address","placeDN","placeADName"],n)},t.hitToHotelTypeAnchor=function(e,t){var r=d(e,{hotelName:{},placeDN:{}}),n=It.__assign(It.__assign({},r),{hotelName:i(r.hotelName,t),placeDisplayName:u(r.placeDN,t)});return Jr.omit(["placeADN","placeDN"],n)},t.hitToPlaceTypeAnchor=function(e,t){var r=d(e,{placeName:{},placeDN:{}}),n=It.__assign(It.__assign({},r),{placeName:i(r.placeName,t),placeDisplayName:u(r.placeDN,t)});return Jr.omit(["placeADN","placeDN"],n)},t.hitToHotelSuggest=function(e,t){var r=d(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",hotelName:{},_highlightResult:{}}),n=s(r.placeADN,t,-1),o=s(r.placeDN,t,1),u=a(o)?o+", "+n:n,l=c(r._highlightResult.hotelName,t);return{objectID:r.objectID.replace(r.objectType+":",""),objectType:r.objectType,value:i(r.hotelName,t),highlightValue:l,placeDisplayName:u,placeTypeName:h()}},t.hitToPlaceSuggest=function(e,t){var r=d(e,{objectID:"",placeADN:{},placeDN:{},objectType:"",placeName:{},placeType:0,_highlightResult:{}}),n=s(r.placeADN,t,-1),o=s(r.placeDN,t,1),u=a(o)?o+", "+n:n,l=c(r._highlightResult.placeName,t);return{objectID:r.objectID.replace(r.objectType+":",""),objectType:r.objectType,value:i(r.placeName,t),highlightValue:l,placeDisplayName:u,placeTypeName:h(r.placeType)}},t.pickIndexVariation=function(e,t){var r=e.find((function(e){return e.variationID&&t.includes(e.variationID)}));return null!=r?r:e.find((function(e){return void 0===e.variationID}))}})),sn=t((function(e,t){var r;function n(e){var t=un.getTranslatedAttributes(e,["placeName","placeADN","placeDN","hotelName"]);return It.__spreadArrays(["objectType","placeType","placeCategory","objectID","_geoloc","priceBucketWidth","polygon","pageSize"],t)}function o(e){var t=un.getTranslatedAttributes(e,["hotelName","placeADName","placeDN","address"]);return It.__spreadArrays(["_geoloc","checkInTime","checkOutTime","facilities","guestRating","guestType","imageURIs","propertyTypeId","reviewCount","starRating","themeIds","objectID","lastBooked","isDeleted","pricing","sentiments","country"],t)}Object.defineProperty(t,"__esModule",{value:!0}),t.getAnchor=void 0,function(e){e[e.Hotel=0]="Hotel",e[e.Place=1]="Place",e[e.Location=2]="Location",e[e.Query=3]="Query",e[e.Unknown=4]="Unknown"}(r||(r={})),t.getAnchor=function(e,t,a){var i=this,u=e.search,s=t.autocompleteIndex,c=t.hotelIndex,l=a.languages;return function(e){return It.__awaiter(i,void 0,void 0,(function(){var t,a,i,f,d,h,p,g,v,y,m,b,_;return It.__generator(this,(function(w){switch(w.label){case 0:switch(t=function(e){return e.hotelId?r.Hotel:e.placeId?r.Place:e.geolocation?r.Location:e.query?r.Query:r.Unknown}(e),a=e.hotelId,i=e.placeId,f=e.query,d=[],t){case r.Query:d.push({indexName:s,params:{query:f,hitsPerPage:1,attributesToRetrieve:n(l),attributesToHighlight:[]}}),d.push({indexName:c,params:{query:f,hitsPerPage:1,attributesToRetrieve:o(l),attributesToHighlight:[]}});break;case r.Hotel:a&&d.push({indexName:s,params:{facetFilters:[["objectID:hotel:"+a]],attributesToRetrieve:n(l),attributesToHighlight:[]}},{indexName:c,params:{facetFilters:[["objectID:"+a]],attributesToRetrieve:o(l),attributesToHighlight:[]}});break;case r.Place:default:i&&d.push({indexName:s,params:{facetFilters:[["objectID:place:"+i]],attributesToRetrieve:n(l),attributesToHighlight:[]}})}return[4,u(d)];case 1:switch(g=w.sent().results,v=null===(m=g[0])||void 0===m?void 0:m.hits[0],y=null===(b=g[1])||void 0===b?void 0:b.hits[0],null==v?void 0:v.objectType){case"hotel":h=un.hitToHotelTypeAnchor(v,l),p=un.hitToHotel(y,l);break;case"place":default:h=un.hitToPlaceTypeAnchor(v,l)}return[2,{anchor:h,anchorHotel:p,anchorType:null!==(_=null==v?void 0:v.objectType)&&void 0!==_?_:"place"}]}}))}))}}}));var cn=r(Object.freeze({__proto__:null,default:function(e){$(1,arguments);var t=Z(e),r=t.getDay();return 0===r||6===r}})),ln=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.generatePriceFilter=t.generateSortByPriceFilter=void 0;var r=It.__importDefault(an),n=It.__importDefault(cn);t.generateSortByPriceFilter=function(e){for(var t=[],r=e;r>0;--r){var n=100*(e+1-r);t.push("pricing.minRateBkt:"+r+"<score="+n+">")}return t},t.generatePriceFilter=function(e){var t=e.priceMin,o=e.priceMax,a=e.priceBucketWidth,i=e.priceBucketsCount,u=e.checkIn,s=e.checkOut,c=e.margin,l=void 0===c?2:c,f=[];if(void 0===t&&void 0===o||void 0===a)return f;var d=t?Math.floor(t/a)-l:0,h=o?Math.ceil(o/a)+l:i;d<0&&(d=0),h>i&&(h=i);var p=d,g=function(e,t){if(!e||!t)return"pricing.medianRateBkt";var o=Jr.dateToMiddayUTC(e),a=Jr.dateToMiddayUTC(t);return 1===r.default(a,o)?n.default(o)?"pricing.medianRateSaSuBkt":"pricing.medianRateMoFrBkt":"pricing.medianRateBkt"}(u,s);do{f.push(g+":"+p+"<score=10000>"),p++}while(p<=h);return f}})),fn=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===dn}(e)}(e)};var dn="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function hn(e,t){return!1!==t.clone&&t.isMergeableObject(e)?mn((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function pn(e,t,r){return e.concat(t).map((function(e){return hn(e,r)}))}function gn(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function vn(e,t){try{return t in e}catch(e){return!1}}function yn(e,t,r){var n={};return r.isMergeableObject(e)&&gn(e).forEach((function(t){n[t]=hn(e[t],r)})),gn(t).forEach((function(o){(function(e,t){return vn(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(vn(e,o)&&r.isMergeableObject(t[o])?n[o]=function(e,t){if(!t.customMerge)return mn;var r=t.customMerge(e);return"function"==typeof r?r:mn}(o,r)(e[o],t[o],r):n[o]=hn(t[o],r))})),n}function mn(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||pn,r.isMergeableObject=r.isMergeableObject||fn,r.cloneUnlessOtherwiseSpecified=hn;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):yn(e,t,r):hn(t,r)}mn.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return mn(e,r,t)}),{})};var bn=mn,_n=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getAppConfig=t.PRICE_BUCKET_COUNT=void 0;var r=It.__importDefault(bn);t.PRICE_BUCKET_COUNT=31;var n={daedalus:{raaEndpoint:"wss://d2jxsjsbxzs3ta.cloudfront.net"},sapiBackend:{baseUrl:"dikcjxfwieazv.cloudfront.net",endpoints:{search:"search",offers:"ws/offers"}},saf:{baseUrl:"sapi.findhotel.services",endpoints:{offersRooms:"1/offers-rooms",search:"1/search",hotel:"1/hotel"}},algolia:{apiKey:"efa703d5c0057a24487bc9bdcb597770",hotelIndex:"prod_hotel_v3",autocompleteIndex:"prod_autocomplete_v2_os000007",lovIndex:"prod_lov_v2",currencyIndex:"prod_curr_v1",hsoIndex:[{name:"prod_hso_v1",objectID:"prod_hotelranking_v1_pp000003_tags"},{name:"prod_hso_v1",objectID:"prod_hotelranking_v1_pp000004_tags2",variationID:"pp000004-tags2-b"}]},client:{features:["offers","search","suggests","configs"],blockedDefaultDates:["2022-02-27"],daysFromNow:45,fallbackLanguages:{"pt-BR":["pt"],"zh-CN":["zh"],"zh-HK":["zh"],"zh-TW":["zh"],iw:["he"],nb:["no"],nn:["no"]}}},o={"findhotel-website":n,"findhotel-website-e2e":It.__assign(It.__assign({},n),{daedalus:{raaEndpoint:void 0},saf:It.__assign(It.__assign({},n.saf),{baseUrl:"sapi-e2e.findhotel.services"}),sapiBackend:It.__assign(It.__assign({},n.sapiBackend),{baseUrl:"d30gf1e3i1dery.cloudfront.net"})}),"findhotel-website-stg":It.__assign(It.__assign({},n),{sapiBackend:It.__assign(It.__assign({},n.sapiBackend),{baseUrl:"d3vuhpa0o0tale.cloudfront.net"})}),"findhotel-website-ci":It.__assign(It.__assign({},n),{sapiBackend:It.__assign(It.__assign({},n.sapiBackend),{baseUrl:"d1ue1wauc6u0m5.cloudfront.net"})}),"findhotel-website-dev":It.__assign(It.__assign({},n),{sapiBackend:It.__assign(It.__assign({},n.sapiBackend),{baseUrl:"d3b8t16k1aaypx.cloudfront.net"})}),"findhotel-checkout":It.__assign(It.__assign({},n),{client:It.__assign(It.__assign({},n.client),{features:["rooms","get-hotel"]})}),"findhotel-checkout-e2e":It.__assign(It.__assign({},n),{saf:It.__assign(It.__assign({},n.saf),{baseUrl:"sapi-e2e.findhotel.services"}),client:It.__assign(It.__assign({},n.client),{features:["rooms","get-hotel"]})}),"findhotel-checkout-stg":It.__assign(It.__assign({},n),{saf:It.__assign(It.__assign({},n.saf),{baseUrl:"sapi-stg.findhotel.services"}),client:It.__assign(It.__assign({},n.client),{features:["rooms"]})})};t.getAppConfig=function(e,t){var n=o[e];if(void 0===n)throw new Error("Profile key is not valid");return t&&(n=r.default(n,t)),n.daedalus.raaEndpoint?n:It.__assign(It.__assign({},n),{daedalus:{raaEndpoint:"http:"===(null===location||void 0===location?void 0:location.protocol)?"ws://"+location.host:"https:"===(null===location||void 0===location?void 0:location.protocol)?"wss://"+location.host:""}})}})),wn=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.geoSearch=void 0;function r(e){var t=e.anchorHotelId,r=e.checkIn,n=e.checkOut,o=e.filters,a=void 0===o?{}:o,i=a.facilities,u=a.starRating,s=a.propertyTypeId,c=a.themeIds,l=[];if(null==s?void 0:s.length){var f=s.map((function(e){return"propertyTypeId:"+e}));l.push(f)}if(null==i?void 0:i.length){var d=i.map((function(e){return"facilities:"+e}));l.push.apply(l,d)}if(null==c?void 0:c.length){var h=c.map((function(e){return"themeIds:"+e}));l.push.apply(l,h)}if(null==u?void 0:u.length){var p=[];u.forEach((function(e){p.push("starRating:"+Number(e)),p.push("starRating:"+(Number(e)+.5))})),l.push(p)}return t&&l.push("objectID:-"+t),r&&n&&l.push(un.getTagsFilter(r,n)),l}function n(e){var t=e.guestRating;return(null==t?void 0:t.length)?["guestRating.overall>="+t[0]]:[]}function o(e){var t="isDeleted = 0";return e.noHostels&&(t+=" AND propertyTypeId != 5"),t}function a(e,t){var r=e.filters,n=void 0===r?{}:r,o=e.checkIn,a=e.checkOut,i=e.sortField,u=n.priceMin,s=n.priceMax,c=t.hsoFilter,l=t.priceBucketWidth,f=t.exchangeRate,d=It.__spreadArrays(c);if("price"===i){var h=ln.generateSortByPriceFilter(_n.PRICE_BUCKET_COUNT);d=It.__spreadArrays(d,h)}if(u||s){var p=ln.generatePriceFilter({priceMin:u,priceMax:s,checkIn:o,checkOut:a,priceBucketsCount:_n.PRICE_BUCKET_COUNT,priceBucketWidth:l&&l*f});d=It.__spreadArrays(d,p)}return d}var i=["facilities","propertyTypeId","starRating","themeIds","pricing.medianRateBkt","pricing.medianRateMoFrBkt","pricing.medianRateSaSuBkt","pricing.minRateBkt","tags"];t.geoSearch=function(e,t,u){var s=this,c=e.search,l=t.hotelIndex;return function(e){return It.__awaiter(s,void 0,void 0,(function(){var t,s,f,d,h,p,g,v,y,m,b,_,w,O,T,I,S,x,P,E,k,j,C;return It.__generator(this,(function(D){switch(D.label){case 0:return t=e.boundingBox,s=e.polygon,f=e.geolocation,d=e.length,h=void 0===d?u.requestSize:d,p=e.offset,g=void 0===p?0:p,v=e.filters,m={length:h,offset:g,facets:i,attributesToHighlight:[],getRankingInfo:!1,filters:o(y=void 0===v?{}:v),numericFilters:n(y),facetFilters:r(e),attributesToRetrieve:(A=u.languages,R=un.getTranslatedAttributes(A,["hotelName","placeADName","placeDN","address"]),It.__spreadArrays(["_geoloc","checkInTime","checkOutTime","facilities","guestRating","guestType","imageURIs","propertyTypeId","reviewCount","starRating","themeIds","objectID","lastBooked","isDeleted","pricing","sentiments","country"],R)),optionalFilters:a(e,u)},void 0!==y.hotelName&&(m.query=y.hotelName),t?m.insideBoundingBox=[t]:s?m.insidePolygon=s:f&&(m.aroundLatLng=f.lat+", "+f.lon,m.aroundRadius=null!==(x=f.radius)&&void 0!==x?x:2e4,m.aroundPrecision=null!==(P=f.precision)&&void 0!==P?P:5e3),[4,c([{indexName:l,params:m}])];case 1:for(b=D.sent(),_=b.results[0],w=[],O={},T=0,I=_.hits;T<I.length;T++)S=I[T],O[S.objectID]=un.hitToHotel(S,u.languages),w.push(S.objectID);return[2,{hotelIds:w,hotelEntities:O,resultsCount:null!==(E=_.length)&&void 0!==E?E:0,resultsCountTotal:null!==(k=_.nbHits)&&void 0!==k?k:0,offset:null!==(j=_.offset)&&void 0!==j?j:0,facets:null!==(C=_.facets)&&void 0!==C?C:{}}]}var A,R}))}))}}})),On=t((function(e,t){function r(e){return un.getTranslatedAttributes(e,["placeName","hotelName"])}function n(e){var t=un.getTranslatedAttributes(e,["placeName","placeADN","placeDN","hotelName"]);return It.__spreadArrays(["objectType","objectID","placeType"],t)}Object.defineProperty(t,"__esModule",{value:!0}),t.loadSuggests=void 0,t.loadSuggests=function(e,t,o){var a=this,i=e.search,u=t.autocompleteIndex,s=o.languages,c=o.suggestsCount,l=void 0===c?6:c;return function(e){return It.__awaiter(a,void 0,void 0,(function(){var t,o,a;return It.__generator(this,(function(c){switch(c.label){case 0:return t=[{indexName:u,params:{query:e,filters:"isDeleted != 1",hitsPerPage:l,attributesToRetrieve:n(s),attributesToHighlight:r(s)}}],[4,i(t)];case 1:return o=c.sent().results,[2,null===(a=o[0])||void 0===a?void 0:a.hits.map((function(e){switch(e.objectType){case"hotel":return un.hitToHotelSuggest(e,s);case"place":default:return un.hitToPlaceSuggest(e,s)}}))]}}))}))}}})),Tn=t((function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}}}));e(Tn);var In=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e};var Sn=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function xn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Pn=function(e,t,r){return t&&xn(e.prototype,t),r&&xn(e,r),e};var En=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n};var kn=function(e){if(Array.isArray(e))return En(e)};var jn=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)};var Cn=function(e,t){if(e){if("string"==typeof e)return En(e,t);var r=Object.prototype.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)?En(e,t):void 0}};var Dn=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.")};var An=Tn((function(e){return kn(e)||jn(e)||Cn(e)||Dn()})),Rn={functions:"Jexl Function",transforms:"Transform"},Nn={ArrayLiteral:function(e){return this.evalArray(e.value)},BinaryExpression:function(e){var t=this,r=this._grammar.elements[e.operator];if(r.evalOnDemand){var n=function(e){return{eval:function(){return t.eval(e)}}};return r.evalOnDemand(n(e.left),n(e.right))}return this.Promise.all([this.eval(e.left),this.eval(e.right)]).then((function(e){return r.eval(e[0],e[1])}))},ConditionalExpression:function(e){var t=this;return this.eval(e.test).then((function(r){return r?e.consequent?t.eval(e.consequent):r:t.eval(e.alternate)}))},FilterExpression:function(e){var t=this;return this.eval(e.subject).then((function(r){return e.relative?t._filterRelative(r,e.expr):t._filterStatic(r,e.expr)}))},Identifier:function(e){return e.from?this.eval(e.from).then((function(t){if(null!=t)return Array.isArray(t)&&(t=t[0]),t[e.value]})):e.relative?this._relContext[e.value]:this._context[e.value]},Literal:function(e){return e.value},ObjectLiteral:function(e){return this.evalMap(e.value)},FunctionCall:function(e){var t=Rn[e.pool];if(!t)throw new Error("Corrupt AST: Pool '".concat(e.pool,"' not found"));var r=this._grammar[e.pool][e.name];if(!r)throw new Error("".concat(t," ").concat(e.name," is not defined."));return this.evalArray(e.args||[]).then((function(e){return r.apply(void 0,(0,An.default)(e))}))},UnaryExpression:function(e){var t=this;return this.eval(e.right).then((function(r){return t._grammar.elements[e.operator].eval(r)}))}},Mn=Tn(Sn),Un=Tn(Pn),Bn=function(){function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Promise;(0,Mn.default)(this,e),this._grammar=t,this._context=r||{},this._relContext=n||this._context,this.Promise=o}return(0,Un.default)(e,[{key:"eval",value:function(e){var t=this;return this.Promise.resolve().then((function(){return Nn[e.type].call(t,e)}))}},{key:"evalArray",value:function(e){var t=this;return this.Promise.all(e.map((function(e){return t.eval(e)})))}},{key:"evalMap",value:function(e){var t=this,r=Object.keys(e),n={},o=r.map((function(r){return t.eval(e[r])}));return this.Promise.all(o).then((function(e){return e.forEach((function(e,t){n[r[t]]=e})),n}))}},{key:"_filterRelative",value:function(t,r){var n=this,o=[];return Array.isArray(t)||(t=void 0===t?[]:[t]),t.forEach((function(t){var a=new e(n._grammar,n._context,t,n.Promise);o.push(a.eval(r))})),this.Promise.all(o).then((function(e){var r=[];return e.forEach((function(e,n){e&&r.push(t[n])})),r}))}},{key:"_filterStatic",value:function(e,t){return this.eval(t).then((function(t){return"boolean"==typeof t?t?e:void 0:e[t]}))}}]),e}(),Ln=Tn(Sn),qn=Tn(Pn),Fn=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/,Hn=/^[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][a-zA-Zа-яА-Я0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*$/,Wn=/\\\\/,zn=/^\s*$/,Yn=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],Kn=["[a-zA-Zа-яА-Я_À-ÖØ-öø-ÿ\\$][a-zA-Z0-9а-яА-Я_À-ÖØ-öø-ÿ\\$]*","(?:(?:[0-9]*\\.[0-9]+)|[0-9]+)"],Vn=["binaryOp","unaryOp","openParen","openBracket","question","colon"],Gn=function(){function e(t){(0,Ln.default)(this,e),this._grammar=t}return(0,qn.default)(e,[{key:"getElements",value:function(e){var t=this._getSplitRegex();return e.split(t).filter((function(e){return e}))}},{key:"getTokens",value:function(e){for(var t=[],r=!1,n=0;n<e.length;n++)this._isWhitespace(e[n])?t.length&&(t[t.length-1].raw+=e[n]):"-"===e[n]&&this._isNegative(t)?r=!0:(r&&(e[n]="-"+e[n],r=!1),t.push(this._createToken(e[n])));return r&&t.push(this._createToken("-")),t}},{key:"tokenize",value:function(e){var t=this.getElements(e);return this.getTokens(t)}},{key:"_createToken",value:function(e){var t={type:"literal",value:e,raw:e};if('"'===e[0]||"'"===e[0])t.value=this._unquote(e);else if(e.match(Fn))t.value=parseFloat(e);else if("true"===e||"false"===e)t.value="true"===e;else if(this._grammar.elements[e])t.type=this._grammar.elements[e].type;else{if(!e.match(Hn))throw new Error("Invalid expression token: ".concat(e));t.type="identifier"}return t}},{key:"_escapeRegExp",value:function(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(Hn)&&(e="\\b"+e+"\\b"),e}},{key:"_getSplitRegex",value:function(){var e=this;if(!this._splitRegex){var t=Object.keys(this._grammar.elements).sort((function(e,t){return t.length-e.length})).map((function(t){return e._escapeRegExp(t)}),this);this._splitRegex=new RegExp("("+[Yn.join("|"),t.join("|"),Kn.join("|")].join("|")+")")}return this._splitRegex}},{key:"_isNegative",value:function(e){return!e.length||Vn.some((function(t){return t===e[e.length-1].type}))}},{key:"_isWhitespace",value:function(e){return!!e.match(zn)}},{key:"_unquote",value:function(e){var t=e[0],r=new RegExp("\\\\"+t,"g");return e.substr(1,e.length-2).replace(r,t).replace(Wn,"\\")}}]),e}(),Jn={argVal:function(e){e&&this._cursor.args.push(e)},arrayStart:function(){this._placeAtCursor({type:"ArrayLiteral",value:[]})},arrayVal:function(e){e&&this._cursor.value.push(e)},binaryOp:function(e){for(var t=this._grammar.elements[e.value].precedence||0,r=this._cursor._parent;r&&r.operator&&this._grammar.elements[r.operator].precedence>=t;)this._cursor=r,r=r._parent;var n={type:"BinaryExpression",operator:e.value,left:this._cursor};this._setParent(this._cursor,n),this._cursor=r,this._placeAtCursor(n)},dot:function(){this._nextIdentEncapsulate=this._cursor&&"UnaryExpression"!==this._cursor.type&&("BinaryExpression"!==this._cursor.type||"BinaryExpression"===this._cursor.type&&this._cursor.right),this._nextIdentRelative=!this._cursor||this._cursor&&!this._nextIdentEncapsulate,this._nextIdentRelative&&(this._relative=!0)},filter:function(e){this._placeBeforeCursor({type:"FilterExpression",expr:e,relative:this._subParser.isRelative(),subject:this._cursor})},functionCall:function(){this._placeBeforeCursor({type:"FunctionCall",name:this._cursor.value,args:[],pool:"functions"})},identifier:function(e){var t={type:"Identifier",value:e.value};this._nextIdentEncapsulate?(t.from=this._cursor,this._placeBeforeCursor(t),this._nextIdentEncapsulate=!1):(this._nextIdentRelative&&(t.relative=!0,this._nextIdentRelative=!1),this._placeAtCursor(t))},literal:function(e){this._placeAtCursor({type:"Literal",value:e.value})},objKey:function(e){this._curObjKey=e.value},objStart:function(){this._placeAtCursor({type:"ObjectLiteral",value:{}})},objVal:function(e){this._cursor.value[this._curObjKey]=e},subExpression:function(e){this._placeAtCursor(e)},ternaryEnd:function(e){this._cursor.alternate=e},ternaryMid:function(e){this._cursor.consequent=e},ternaryStart:function(){this._tree={type:"ConditionalExpression",test:this._tree},this._cursor=this._tree},transform:function(e){this._placeBeforeCursor({type:"FunctionCall",name:e.value,args:[this._cursor],pool:"transforms"})},unaryOp:function(e){this._placeAtCursor({type:"UnaryExpression",operator:e.value})}},Qn={states:{expectOperand:{tokenTypes:{literal:{toState:"expectBinOp"},identifier:{toState:"identifier"},unaryOp:{},openParen:{toState:"subExpression"},openCurl:{toState:"expectObjKey",handler:Jn.objStart},dot:{toState:"traverse"},openBracket:{toState:"arrayVal",handler:Jn.arrayStart}}},expectBinOp:{tokenTypes:{binaryOp:{toState:"expectOperand"},pipe:{toState:"expectTransform"},dot:{toState:"traverse"},question:{toState:"ternaryMid",handler:Jn.ternaryStart}},completable:!0},expectTransform:{tokenTypes:{identifier:{toState:"postTransform",handler:Jn.transform}}},expectObjKey:{tokenTypes:{identifier:{toState:"expectKeyValSep",handler:Jn.objKey},closeCurl:{toState:"expectBinOp"}}},expectKeyValSep:{tokenTypes:{colon:{toState:"objVal"}}},postTransform:{tokenTypes:{openParen:{toState:"argVal"},binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},postArgs:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},identifier:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},openParen:{toState:"argVal",handler:Jn.functionCall},pipe:{toState:"expectTransform"},question:{toState:"ternaryMid",handler:Jn.ternaryStart}},completable:!0},traverse:{tokenTypes:{identifier:{toState:"identifier"}}},filter:{subHandler:Jn.filter,endStates:{closeBracket:"identifier"}},subExpression:{subHandler:Jn.subExpression,endStates:{closeParen:"expectBinOp"}},argVal:{subHandler:Jn.argVal,endStates:{comma:"argVal",closeParen:"postArgs"}},objVal:{subHandler:Jn.objVal,endStates:{comma:"expectObjKey",closeCurl:"expectBinOp"}},arrayVal:{subHandler:Jn.arrayVal,endStates:{comma:"arrayVal",closeBracket:"expectBinOp"}},ternaryMid:{subHandler:Jn.ternaryMid,endStates:{colon:"ternaryEnd"}},ternaryEnd:{subHandler:Jn.ternaryEnd,completable:!0}}},Xn=Tn(Sn),$n=Tn(Pn),Zn=Qn.states,eo=function(){function e(t,r,n){(0,Xn.default)(this,e),this._grammar=t,this._state="expectOperand",this._tree=null,this._exprStr=r||"",this._relative=!1,this._stopMap=n||{}}return(0,$n.default)(e,[{key:"addToken",value:function(e){if("complete"===this._state)throw new Error("Cannot add a new token to a completed Parser");var t=Zn[this._state],r=this._exprStr;if(this._exprStr+=e.raw,t.subHandler){this._subParser||this._startSubExpression(r);var n=this._subParser.addToken(e);if(n){if(this._endSubExpression(),this._parentStop)return n;this._state=n}}else{if(!t.tokenTypes[e.type]){if(this._stopMap[e.type])return this._stopMap[e.type];throw new Error("Token ".concat(e.raw," (").concat(e.type,") unexpected in expression: ").concat(this._exprStr))}var o=t.tokenTypes[e.type],a=Jn[e.type];o.handler&&(a=o.handler),a&&a.call(this,e),o.toState&&(this._state=o.toState)}return!1}},{key:"addTokens",value:function(e){e.forEach(this.addToken,this)}},{key:"complete",value:function(){if(this._cursor&&!Zn[this._state].completable)throw new Error("Unexpected end of expression: ".concat(this._exprStr));return this._subParser&&this._endSubExpression(),this._state="complete",this._cursor?this._tree:null}},{key:"isRelative",value:function(){return this._relative}},{key:"_endSubExpression",value:function(){Zn[this._state].subHandler.call(this,this._subParser.complete()),this._subParser=null}},{key:"_placeAtCursor",value:function(e){this._cursor?(this._cursor.right=e,this._setParent(e,this._cursor)):this._tree=e,this._cursor=e}},{key:"_placeBeforeCursor",value:function(e){this._cursor=this._cursor._parent,this._placeAtCursor(e)}},{key:"_setParent",value:function(e,t){Object.defineProperty(e,"_parent",{value:t,writable:!0})}},{key:"_startSubExpression",value:function(t){var r=Zn[this._state].endStates;r||(this._parentStop=!0,r=this._stopMap),this._subParser=new e(this._grammar,t,r)}}]),e}(),to=Tn(Sn),ro=Tn(Pn),no=function(){function e(t){(0,to.default)(this,e),t(this._resolve.bind(this),this._reject.bind(this))}return(0,ro.default)(e,[{key:"catch",value:function(e){if(this.error)try{this._resolve(e(this.error))}catch(e){this._reject(e)}return this}},{key:"then",value:function(e,t){if(!this.error)try{this._resolve(e(this.value))}catch(e){this._reject(e)}return t&&this.catch(t),this}},{key:"_reject",value:function(e){this.value=void 0,this.error=e}},{key:"_resolve",value:function(t){t instanceof e?t.error?this._reject(t.error):this._resolve(t.value):(this.value=t,this.error=void 0)}}]),e}();no.all=function(e){return new no((function(t){t(e.map((function(e){for(;e instanceof no;){if(e.error)throw Error(e.error);e=e.value}return e})))}))},no.resolve=function(e){return new no((function(t){return t(e)}))},no.reject=function(e){return new no((function(t,r){return r(e)}))};var oo=no,ao=Tn(Sn),io=Tn(Pn),uo=function(){function e(t,r){(0,ao.default)(this,e),this._grammar=t,this._exprStr=r,this._ast=null}return(0,io.default)(e,[{key:"compile",value:function(){var e=new Gn(this._grammar),t=new eo(this._grammar),r=e.tokenize(this._exprStr);return t.addTokens(r),this._ast=t.complete(),this}},{key:"eval",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._eval(e,Promise)}},{key:"evalSync",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._eval(e,oo);if(t.error)throw t.error;return t.value}},{key:"_eval",value:function(e,t){var r=this;return t.resolve().then((function(){var n=r._getAst();return new Bn(r._grammar,e,void 0,t).eval(n)}))}},{key:"_getAst",value:function(){return this._ast||this.compile(),this._ast}}]),e}(),so=function(){return{elements:{".":{type:"dot"},"[":{type:"openBracket"},"]":{type:"closeBracket"},"|":{type:"pipe"},"{":{type:"openCurl"},"}":{type:"closeCurl"},":":{type:"colon"},",":{type:"comma"},"(":{type:"openParen"},")":{type:"closeParen"},"?":{type:"question"},"+":{type:"binaryOp",precedence:30,eval:function(e,t){return e+t}},"-":{type:"binaryOp",precedence:30,eval:function(e,t){return e-t}},"*":{type:"binaryOp",precedence:40,eval:function(e,t){return e*t}},"/":{type:"binaryOp",precedence:40,eval:function(e,t){return e/t}},"//":{type:"binaryOp",precedence:40,eval:function(e,t){return Math.floor(e/t)}},"%":{type:"binaryOp",precedence:50,eval:function(e,t){return e%t}},"^":{type:"binaryOp",precedence:50,eval:function(e,t){return Math.pow(e,t)}},"==":{type:"binaryOp",precedence:20,eval:function(e,t){return e==t}},"!=":{type:"binaryOp",precedence:20,eval:function(e,t){return e!=t}},">":{type:"binaryOp",precedence:20,eval:function(e,t){return e>t}},">=":{type:"binaryOp",precedence:20,eval:function(e,t){return e>=t}},"<":{type:"binaryOp",precedence:20,eval:function(e,t){return e<t}},"<=":{type:"binaryOp",precedence:20,eval:function(e,t){return e<=t}},"&&":{type:"binaryOp",precedence:10,evalOnDemand:function(e,t){return e.eval().then((function(e){return e?t.eval():e}))}},"||":{type:"binaryOp",precedence:10,evalOnDemand:function(e,t){return e.eval().then((function(e){return e||t.eval()}))}},in:{type:"binaryOp",precedence:20,eval:function(e,t){return"string"==typeof t?-1!==t.indexOf(e):!!Array.isArray(t)&&t.some((function(t){return t===e}))}},"!":{type:"unaryOp",precedence:1/0,eval:function(e){return!e}}},functions:{},transforms:{}}},co=Tn(In),lo=Tn(Sn),fo=Tn(Pn),ho=so,po=function(){function e(){(0,lo.default)(this,e),this.expr=this.expr.bind(this),this._grammar=ho()}return(0,fo.default)(e,[{key:"addBinaryOp",value:function(e,t,r,n){this._addGrammarElement(e,(0,co.default)({type:"binaryOp",precedence:t},n?"evalOnDemand":"eval",r))}},{key:"addFunction",value:function(e,t){this._grammar.functions[e]=t}},{key:"addFunctions",value:function(e){for(var t in e)this._grammar.functions[t]=e[t]}},{key:"addUnaryOp",value:function(e,t){this._addGrammarElement(e,{type:"unaryOp",weight:1/0,eval:t})}},{key:"addTransform",value:function(e,t){this._grammar.transforms[e]=t}},{key:"addTransforms",value:function(e){for(var t in e)this._grammar.transforms[t]=e[t]}},{key:"compile",value:function(e){return this.createExpression(e).compile()}},{key:"createExpression",value:function(e){return new uo(this._grammar,e)}},{key:"getFunction",value:function(e){return this._grammar.functions[e]}},{key:"getTransform",value:function(e){return this._grammar.transforms[e]}},{key:"eval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.createExpression(e);return r.eval(t)}},{key:"evalSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.createExpression(e);return r.evalSync(t)}},{key:"expr",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=e.reduce((function(e,t,n){return e+=t+(n<r.length?r[n]:"")}),"");return this.createExpression(o)}},{key:"removeOp",value:function(e){!this._grammar.elements[e]||"binaryOp"!==this._grammar.elements[e].type&&"unaryOp"!==this._grammar.elements[e].type||delete this._grammar.elements[e]}},{key:"_addGrammarElement",value:function(e,t){this._grammar.elements[e]=t}}]),e}(),go=new po,vo=po;go.Jexl=vo;var yo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.loadConfigs=t.getLovAttributesToRetrieve=t.exchangeRatesFromResponse=t.evaluateHsoConfigs=void 0;var r=It.__importDefault(go);function n(e){var t={};return e.forEach((function(e){var r=e.objectID,n=e.rate;t[r]=n})),t}function o(e){var t=un.getTranslatedAttributes(e,["value"]);return It.__spreadArrays(["id","categoryID","objectID"],t)}r.default.addTransform("map",(function(e,t){return e.map((function(e){return t.replace(/%s/g,e)}))})),t.evaluateHsoConfigs=function(e,t){void 0===t&&(t=[]);var n=[];return t.some((function(t){try{r.default.evalSync(t.criteria,e)&&(n=t.value.map((function(t){return r.default.evalSync(t,e)})))}catch(e){}return n.length>0})),n},t.exchangeRatesFromResponse=n,t.getLovAttributesToRetrieve=o,t.loadConfigs=function(e,t,r){var a,i,u,s,c=e.search,l=t.hsoIndex,f=t.lovIndex,d=t.currencyIndex;return It.__awaiter(this,void 0,void 0,(function(){var e,t,h,p,g,v,y,m,b,_,w;return It.__generator(this,(function(O){switch(O.label){case 0:return e=r.currencies,t=r.languages,h=r.variations,p=e.map((function(e){return"objectID:"+e})),g=un.pickIndexVariation(l,h),v=(null==g?void 0:g.objectID)?["objectID:"+g.objectID]:void 0,y=[{indexName:g.name,params:{facetFilters:v,attributesToHighlight:[],getRankingInfo:!1}},{indexName:f,params:{hitsPerPage:1e3,attributesToRetrieve:o(t),attributesToHighlight:[],getRankingInfo:!1}},{indexName:d,params:{hitsPerPage:p.length,query:"",attributesToRetrieve:["rate"],attributesToHighlight:[],facetFilters:[p],getRankingInfo:!1}}],[4,c(y)];case 1:return m=O.sent().results,b=null===(a=m[0])||void 0===a?void 0:a.hits,_=null===(i=m[1])||void 0===i?void 0:i.hits,w=null===(u=m[2])||void 0===u?void 0:u.hits,[2,{hso:null===(s=b[0])||void 0===s?void 0:s.hso,lov:_,exchangeRates:n(w)}]}}))}))}})),mo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),It.__exportStar(sn,t),It.__exportStar(wn,t),It.__exportStar(un,t),It.__exportStar(ln,t),It.__exportStar(On,t),It.__exportStar(yo,t)})),bo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.search=t.getRequestSize=t.prepareSearchParameters=void 0;function r(e,t,r,n){var o,a=It.__assign(It.__assign({},t),{offset:r,anchorHotelId:n});if(null===(o=a.boundingBox)||void 0===o?void 0:o.length)return a;var i=e.polygon;return(null==i?void 0:i.length)?It.__assign(It.__assign({},a),{polygon:i}):e._geoloc?It.__assign(It.__assign({},a),{geolocation:e._geoloc}):a}function n(e,t){var r=e.rooms,n=void 0===r?"2":r,o=Jr.getCheckInCheckOutDates(e,t),a=o.checkIn,i=o.checkOut;return It.__assign(It.__assign({},e),{checkIn:a,checkOut:i,rooms:n})}function o(e,t,r){var n,o,a=e.anchor,i=e.anchorType;return void 0!==a.pageSize&&a.pageSize>=r.pageSize&&void 0===(null===(n=t.filters)||void 0===n?void 0:n.priceMin)&&void 0===(null===(o=t.filters)||void 0===o?void 0:o.priceMax)&&"price"!==t.sortField?a.pageSize:"hotel"===i?45:65}t.prepareSearchParameters=n,t.getRequestSize=o,t.search=function(e){var t=this,a=e.getFeatureEnabled,i=e.appConfig,u=e.algoliaClient,s=e.offersClient,c=e.options,l=e.configs,f=l.hso,d=l.exchangeRates,h=c.languages,p=d[c.currency],g=a("offers");return function(e,a){return void 0===a&&(a={}),It.__awaiter(t,void 0,void 0,(function(){var t,l,d,v,y,m,b,_,w,O,T,I,S,x,P,E=this;return It.__generator(this,(function(k){switch(k.label){case 0:return t=Jr.createState({}),l=0,d=a.onStart,v=a.onAnchorReceived,y=a.onHotelsReceived,m=a.onOffersReceived,b=a.onComplete,_=n(e,i.client),w=Jr.generateSearchId(e,c),t.update((function(e){e.searchParameters=_,e.searchId=w})),"function"==typeof d&&d(t.current()),[4,mo.getAnchor(u,i.algolia,c)(_)];case 1:return O=k.sent(),t.update((function(e){var t,r;if(e.anchor=O.anchor,e.anchorType=O.anchorType,void 0!==O.anchorHotel){var n=O.anchorHotel.objectID;e.anchorHotelId=n,e.hotelEntities=It.__assign(It.__assign({},null!==(r=e.hotelEntities)&&void 0!==r?r:{}),((t={})[n]=O.anchorHotel,t))}})),"function"==typeof v&&v(t.current()),T="hotel"===O.anchorType?"hotel_search":"place_search",I=f[T],S=mo.geoSearch(u,i.algolia,{languages:h,exchangeRate:p,priceBucketWidth:O.anchor.priceBucketWidth,requestSize:o(O,_,c),hsoFilter:mo.evaluateHsoConfigs({anchorHotel:O.anchorHotel,searchParameters:_,checkInNights:mo.getCheckInNights(_.checkIn,_.checkOut)},I)}),[4,(x=function(e){return void 0===e&&(e=0),It.__awaiter(E,void 0,void 0,(function(){var n,o,a,i,u,l,f;return It.__generator(this,(function(d){switch(d.label){case 0:return!0===_.skipGeoSearch?[3,2]:[4,S(r(O.anchor,_,e,null===(l=O.anchorHotel)||void 0===l?void 0:l.objectID))];case 1:n=d.sent(),t.update((function(e){var t;e.facets=n.facets,e.resultsCount=n.resultsCount,e.resultsCountTotal=n.resultsCountTotal,e.offset=n.offset,e.hotelIds=n.hotelIds,e.hotelEntities=It.__assign(It.__assign({},null!==(t=e.hotelEntities)&&void 0!==t?t:{}),n.hotelEntities),e.hotelsHaveStaticPosition=function(e,t,r){var n,o,a,i;if("price"===e.sortField)return!1;if(void 0!==(null===(n=e.filters)||void 0===n?void 0:n.priceMin)||void 0!==(null===(o=e.filters)||void 0===o?void 0:o.priceMax))return!1;if(r){var u=mo.getCheckInNights(e.checkIn,e.checkOut);return(null!==(i=null===(a=r.tags)||void 0===a?void 0:a["a"+u])&&void 0!==i?i:0)>=t}return!0}(_,c.pageSize,n.facets)})),t.update((function(e){Object.keys(e.hotelEntities).forEach((function(t){e.hotelEntities[t]=Jr.augmentHotelWithRegularPriceRange(e.hotelEntities[t],p,e.anchor.priceBucketWidth)}))})),d.label=2;case 2:return"function"==typeof y&&y(t.current()),g&&void 0!==s?(o=t.get("hotelIds"),a=It.__assign(It.__assign({},_),{searchId:w,hotelIds:o,anchorHotelId:null===(f=O.anchorHotel)||void 0===f?void 0:f.objectID}),[4,s.getOffers(a,(function(e){var r=en.augmentRaaResponse(e,It.__assign(It.__assign(It.__assign(It.__assign({},a),O.anchor),c),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:p}));t.update((function(e){r.hotelIds.length>0&&(e.hotelIds=r.hotelIds),e.hotelOfferEntities=It.__assign(It.__assign({},e.hotelOfferEntities),r.hotelOfferEntities)})),"function"==typeof m&&m(t.current())}))]):[3,4];case 3:i=d.sent(),u=en.augmentRaaResponse(i,It.__assign(It.__assign(It.__assign(It.__assign({},a),O.anchor),c),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:p})),t.update((function(e){e.hotelIds=u.hotelIds,e.hotelOfferEntities=u.hotelOfferEntities})),t.update((function(e){e.dealScores=Jr.getDealScores(e)})),d.label=4;case 4:return"function"==typeof b&&b(t.current()),[2,t.current()]}}))}))})(_.offset)];case 2:return P=k.sent(),[2,{loadOffers:function(e){return It.__awaiter(E,void 0,void 0,(function(){var t,r,n,o,a;return It.__generator(this,(function(i){switch(i.label){case 0:if(!e)throw new Error("Hotel id must be provided");if(!g||!s)throw new Error("Offers loading is disabled");return t=e===P.anchorHotelId,r=It.__assign(It.__assign({},_),{searchId:w,getAllOffers:!0,hotelIds:t?void 0:[e],anchorHotelId:t?e:void 0}),[4,s.getOffers(r)];case 1:return n=i.sent(),o=en.augmentRaaResponse(n,It.__assign(It.__assign(It.__assign(It.__assign({},r),O.anchor),c),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:p})),[2,null===(a=o.hotelOfferEntities)||void 0===a?void 0:a[e]]}}))}))},loadMore:function(){return It.__awaiter(E,void 0,void 0,(function(){return It.__generator(this,(function(e){return l+=o(O,_,c),[2,x(l)]}))}))}}]}}))}))}}}));var _o=Object.freeze({__proto__:null,default:function(e,t){return t=t||{},new Promise((function(r,n){var o=new XMLHttpRequest,a=[],i=[],u={},s=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:s,headers:{keys:function(){return a},entries:function(){return i},get:function(e){return u[e.toLowerCase()]},has:function(e){return e.toLowerCase()in u}}}};for(var c in o.open(t.method||"get",e,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){a.push(t=t.toLowerCase()),i.push([t,r]),u[t]=u[t]?u[t]+","+r:r})),r(s())},o.onerror=n,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(c,t.headers[c]);o.send(t.body||null)}))}}),wo={};try{!function(e,t){if(new e("q=%2B").get("q")!==t||new e({q:t}).get("q")!==t||new e([["q",t]]).get("q")!==t||"q=%0A"!==new e("q=\n").toString()||"q=+%26"!==new e({q:" &"}).toString()||"q=%25zx"!==new e({q:"%zx"}).toString())throw e;wo.URLSearchParams=e}(URLSearchParams,"+")}catch(e){!function(e,t,r){var n=e.create,o=e.defineProperty,a=/[!'\(\)~]|%20|%00/g,i=/%(?![0-9a-fA-F]{2})/g,u=/\+/g,s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"},c={append:function(e,t){h(this._ungap,e,t)},delete:function(e){delete this._ungap[e]},get:function(e){return this.has(e)?this._ungap[e][0]:null},getAll:function(e){return this.has(e)?this._ungap[e].slice(0):[]},has:function(e){return e in this._ungap},set:function(e,r){this._ungap[e]=[t(r)]},forEach:function(e,r){var n=this;for(var o in n._ungap)n._ungap[o].forEach(a,o);function a(a){e.call(r,a,t(o),n)}},toJSON:function(){return{}},toString:function(){var e=[];for(var t in this._ungap)for(var r=g(t),n=0,o=this._ungap[t];n<o.length;n++)e.push(r+"="+g(o[n]));return e.join("&")}};for(var l in c)o(f.prototype,l,{configurable:!0,writable:!0,value:c[l]});function f(e){var t=n(null);switch(o(this,"_ungap",{value:t}),!0){case!e:break;case"string"==typeof e:"?"===e.charAt(0)&&(e=e.slice(1));for(var a=e.split("&"),i=0,u=a.length;i<u;i++){var s=(c=a[i]).indexOf("=");-1<s?h(t,p(c.slice(0,s)),p(c.slice(s+1))):c.length&&h(t,p(c),"")}break;case r(e):for(i=0,u=e.length;i<u;i++){var c;h(t,(c=e[i])[0],c[1])}break;case"forEach"in e:e.forEach(d,t);break;default:for(var l in e)h(t,l,e[l])}}function d(e,t){h(this,t,e)}function h(e,t,n){var o=r(n)?n.join(","):n;t in e?e[t].push(o):e[t]=[o]}function p(e){return decodeURIComponent(e.replace(i,"%25").replace(u," "))}function g(e){return encodeURIComponent(e).replace(a,v)}function v(e){return s[e]}wo.URLSearchParams=f}(Object,String,Array.isArray)}!function(e){var t=!1;try{t=!!Symbol.iterator}catch(e){}function r(e,r){var n=[];return e.forEach(r,n),t?n[Symbol.iterator]():{next:function(){var e=n.shift();return{done:void 0===e,value:e}}}}"forEach"in e||(e.forEach=function(e,t){var r=this,n=Object.create(null);this.toString().replace(/=[\s\S]*?(?:&|$)/g,"=").split("=").forEach((function(o){o.length&&!(o in n)&&(n[o]=r.getAll(o)).forEach((function(n){e.call(t,n,o,r)}))}))}),"keys"in e||(e.keys=function(){return r(this,(function(e,t){this.push(t)}))}),"values"in e||(e.values=function(){return r(this,(function(e,t){this.push(e)}))}),"entries"in e||(e.entries=function(){return r(this,(function(e,t){this.push([t,e])}))}),t&&!(Symbol.iterator in e)&&(e[Symbol.iterator]=e.entries),"sort"in e||(e.sort=function(){for(var e,t,r,n=this.entries(),o=n.next(),a=o.done,i=[],u=Object.create(null);!a;)t=(r=o.value)[0],i.push(t),t in u||(u[t]=[]),u[t].push(r[1]),a=(o=n.next()).done;for(i.sort(),e=0;e<i.length;e++)this.delete(i[e]);for(e=0;e<i.length;e++)t=i[e],this.append(t,u[t].shift())}),function(t){var r=t.defineProperty,n=t.getOwnPropertyDescriptor,o=function(t){var r=t.append;t.append=e.append,URLSearchParams.call(t,t._usp.search.slice(1)),t.append=r},a=function(e,t){if(!(e instanceof t))throw new TypeError("'searchParams' accessed on an object that does not implement interface "+t.name)},i=function(i){var u,s,c=i.prototype,l=n(c,"searchParams"),f=n(c,"href"),d=n(c,"search");!l&&d&&d.set&&(s=function(t){function n(r,n){e.append.call(this,r,n),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}function o(r){e.delete.call(this,r),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}function a(r,n){e.set.call(this,r,n),r=this.toString(),t.set.call(this._usp,r?"?"+r:"")}return function(e,t){return e.append=n,e.delete=o,e.set=a,r(e,"_usp",{configurable:!0,writable:!0,value:t})}}(d),u=function(e,t){return r(e,"_searchParams",{configurable:!0,writable:!0,value:s(t,e)}),t},t.defineProperties(c,{href:{get:function(){return f.get.call(this)},set:function(e){var t=this._searchParams;f.set.call(this,e),t&&o(t)}},search:{get:function(){return d.get.call(this)},set:function(e){var t=this._searchParams;d.set.call(this,e),t&&o(t)}},searchParams:{get:function(){return a(this,i),this._searchParams||u(this,new URLSearchParams(this.search.slice(1)))},set:function(e){a(this,i),u(this,e)}}}))};try{i(HTMLAnchorElement),/^function|object$/.test(typeof URL)&&URL.prototype&&i(URL)}catch(e){}}(Object)}(wo.URLSearchParams.prototype);var Oo=wo.URLSearchParams,To=Object.freeze({__proto__:null,default:Oo}),Io=r(_o),So=r(To),xo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.backendSearch=t.createRequestString=void 0;var r=It.__importDefault(Io),n=It.__importDefault(So);function o(e){var t,r,o,a,i,u,s,c,l,f,d,h,p,g,v,y,m,b,_,w=e.profileKey,O=e.searchParameters,T=e.options,I=e.offset,S=e.attributes,x=Jr.removeEmpty({offset:I,profileId:w,query:O.query,hotelId:O.hotelId,placeId:O.placeId,checkIn:O.checkIn,checkOut:O.checkOut,rooms:O.rooms,dayDistance:O.dayDistance,nights:O.nights,sortField:O.sortField,sortOrder:O.sortOrder,boundingBox:null===(t=O.boundingBox)||void 0===t?void 0:t.join(","),currency:T.currency,language:T.language,variations:null===(r=T.variations)||void 0===r?void 0:r.join(","),starRating:null===(a=null===(o=O.filters)||void 0===o?void 0:o.starRating)||void 0===a?void 0:a.join(","),guestRating:null===(u=null===(i=O.filters)||void 0===i?void 0:i.guestRating)||void 0===u?void 0:u.join(","),propertyTypeId:null===(c=null===(s=O.filters)||void 0===s?void 0:s.propertyTypeId)||void 0===c?void 0:c.join(","),facilities:null===(f=null===(l=O.filters)||void 0===l?void 0:l.facilities)||void 0===f?void 0:f.join(","),themeIds:null===(h=null===(d=O.filters)||void 0===d?void 0:d.themeIds)||void 0===h?void 0:h.join(","),chainIds:null===(g=null===(p=O.filters)||void 0===p?void 0:p.chainIds)||void 0===g?void 0:g.join(","),noHostels:null===(v=O.filters)||void 0===v?void 0:v.noHostels,priceMin:null===(y=O.filters)||void 0===y?void 0:y.priceMin,priceMax:null===(m=O.filters)||void 0===m?void 0:m.priceMax,hotelName:null===(b=O.filters)||void 0===b?void 0:b.hotelName,freeCancellation:null===(_=O.filters)||void 0===_?void 0:_.freeCancellation,attributes:null==S?void 0:S.join(","),anonymousId:T.anonymousId,sapiOverride:"undefined"==typeof window?null:new n.default(window.location.search).get("sapiOverride")});return new n.default(x).toString()}function a(e,t){var n=e.baseUrl,a=e.endpoints;return It.__awaiter(this,void 0,void 0,(function(){var e,i,u,s,c,l;return It.__generator(this,(function(f){switch(f.label){case 0:return e=o(t),[4,r.default("https://"+n+"/"+a.search+"?"+e)];case 1:return(i=f.sent()).ok?[2,i.json()]:(u=t.searchParameters,s=t.options,c=t.offset,l=t.attributes,s.logger.log({name:"SearchFailed",value:It.__assign(It.__assign({},u),{offset:c,attributes:l,language:s.language,currency:s.currency,deviceType:s.deviceType})}),[2,Promise.reject(i)])}}))}))}t.createRequestString=o,t.backendSearch=function(e){var t,r=this,n=e.getFeatureEnabled,o=e.profileKey,i=e.appConfig,u=e.offersClient,s=e.options,c=n("offers"),l=!1;return function(e,n){return void 0===n&&(n={}),It.__awaiter(r,void 0,void 0,(function(){var r,f,d,h,p,g,v,y,m,b,_=this;return It.__generator(this,(function(w){switch(w.label){case 0:return r=Jr.createState({}),f=n.onStart,d=n.onAnchorReceived,h=n.onHotelsReceived,p=n.onOffersReceived,g=n.onComplete,v=0,y=bo.prepareSearchParameters(e,i.client),m=Jr.generateSearchId(e,s),r.update((function(e){e.searchParameters=y,e.searchId=m})),"function"==typeof f&&f(r.current()),b=function(e,n){return void 0===e&&(e=0),It.__awaiter(_,void 0,void 0,(function(){var f,v,b,_,w,O;return It.__generator(this,(function(T){switch(T.label){case 0:return[4,a(i.sapiBackend,{profileKey:o,searchParameters:y,options:s,offset:e,attributes:n})];case 1:return f=T.sent(),l||(t=f.exchangeRates[s.currency],(null===(O=s.callbacks)||void 0===O?void 0:O.onConfigReceived)&&s.callbacks.onConfigReceived({lov:f.lov,exchangeRates:f.exchangeRates}),l=!0),(void 0===n||n.includes("anchor"))&&(r.update((function(e){e.anchor=f.anchor,e.anchorHotelId=f.anchorHotelId,e.anchorType=f.anchorType,e.hotelEntities=f.hotelEntities})),"function"==typeof d&&d(r.current())),r.update((function(e){e.facets=f.facets,e.hotelEntities=f.hotelEntities,e.hotelIds=f.hotelIds,e.hotelsHaveStaticPosition=f.hotelsHaveStaticPosition,e.offset=f.offset,e.resultsCount=f.resultsCount,e.resultsCountTotal=f.resultsCountTotal})),"function"==typeof h&&h(r.current()),c&&void 0!==u?(v=r.get("hotelIds"),b=It.__assign(It.__assign({},y),{searchId:m,hotelIds:v,anchorHotelId:r.get("anchorHotelId")}),[4,u.getOffers(b,(function(e){var n=en.augmentRaaResponse(e,It.__assign(It.__assign(It.__assign(It.__assign({},b),r.get("anchor")),s),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:t}));r.update((function(e){n.hotelIds.length>0&&(e.hotelIds=n.hotelIds),e.hotelOfferEntities=It.__assign(It.__assign({},e.hotelOfferEntities),n.hotelOfferEntities)})),"function"==typeof p&&p(r.current())}))]):[3,3];case 2:_=T.sent(),w=en.augmentRaaResponse(_,It.__assign(It.__assign(It.__assign(It.__assign({},b),r.get("anchor")),s),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:t})),r.update((function(e){e.hotelIds=w.hotelIds,e.hotelOfferEntities=w.hotelOfferEntities})),r.update((function(e){e.dealScores=Jr.getDealScores(e)})),T.label=3;case 3:return"function"==typeof g&&g(r.current()),[2,r.current()]}}))}))},[4,l?b(y.offset,["anchor","anchorHotelId","anchorType","facets","resultsCount","resultsCountTotal","offset","hotelIds","hotelEntities","hotelsHaveStaticPosition"]):b(y.offset)];case 1:return w.sent(),[2,{loadOffers:function(e){return It.__awaiter(_,void 0,void 0,(function(){var n,o,a,i,l;return It.__generator(this,(function(f){switch(f.label){case 0:if(!e)throw new Error("Hotel id must be provided");if(!c||!u)throw new Error("Offers loading is disabled");return n=e===r.get("anchorHotelId"),o=It.__assign(It.__assign({},y),{searchId:m,getAllOffers:!0,hotelIds:n?void 0:[e],anchorHotelId:n?e:void 0}),[4,u.getOffers(o)];case 1:return a=f.sent(),i=en.augmentRaaResponse(a,It.__assign(It.__assign(It.__assign(It.__assign({},o),r.get("anchor")),s),{priceBucketsCount:_n.PRICE_BUCKET_COUNT,exchangeRate:t})),[2,null===(l=i.hotelOfferEntities)||void 0===l?void 0:l[e]]}}))}))},loadMore:function(){return It.__awaiter(_,void 0,void 0,(function(){return It.__generator(this,(function(e){var t,n;return v+=bo.getRequestSize({anchor:r.get("anchor"),anchorHotel:(t=r.get("hotelEntities"),n=r.get("anchorHotelId"),n?t[n]:void 0),anchorType:r.get("anchorType")},y,s),[2,b(v,["offset","facets","resultsCount","resultsCountTotal","hotelIds","hotelEntities","hotelsHaveStaticPosition"])]}))}))}}]}}))}))}}})),Po=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.suggest=void 0,t.suggest=function(e){var t=this,r=e.appConfig,n=e.algoliaClient,o=e.options.languages;return function(e,a){return It.__awaiter(t,void 0,void 0,(function(){return It.__generator(this,(function(t){switch(t.label){case 0:return[4,mo.loadSuggests(n,r.algolia,{suggestsCount:a,languages:o})(e)];case 1:return[2,t.sent()]}}))}))}}})),Eo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.rooms=t.createRequestString=void 0;var r=It.__importDefault(Io),n=It.__importDefault(So);function o(e,t){var r,o=e.hotelId,a=e.checkIn,i=e.checkOut,u=e.rooms,s=e.providerCode,c=e.cugDeals,l=Jr.removeEmpty({hotelId:o,checkIn:a,checkOut:i,rooms:u,providerCode:s,cugDeals:c,deviceType:t.deviceType,language:t.language,currency:t.currency,aid:t.anonymousId,variations:null===(r=t.variations)||void 0===r?void 0:r.join(",")});return new n.default(l).toString()}t.createRequestString=o,t.rooms=function(e){var t=this,n=e.appConfig,a=e.options;return function(e){return It.__awaiter(t,void 0,void 0,(function(){var t,i,u;return It.__generator(this,(function(s){switch(s.label){case 0:return t=o(e,a),[4,r.default("https://"+n.saf.baseUrl+"/"+n.saf.endpoints.offersRooms+"?"+t)];case 1:return(i=s.sent()).ok?[4,i.json()]:[3,3];case 2:return u=s.sent(),[2,It.__assign({hotelId:e.hotelId,anonymousId:a.anonymousId},u)];case 3:return[2,Promise.reject(i)]}}))}))}}})),ko=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hotel=t.createRequestString=t.safToSapiHotel=void 0;var r=It.__importDefault(Io),n=It.__importDefault(So);function o(e,t){var r=e.checkInInst,n=e.checkInSpInst,o=e.feesMnd,a=e.feesOpt,i=e.policies,u=e.hotelName,s=e.placeDN,c=e.address,l=e.placeADName,f=e.propertyType,d=e.facilities,h=e.sentiments,p=e.themes,g=It.__assign(It.__assign({},e),{checkInInst:r&&un.toString(r,t),checkInSpInst:n&&un.toString(n,t),feesMnd:o&&un.toString(o,t),feesOpt:a&&un.toString(a,t),hotelName:un.toString(u,t),policies:i&&un.toString(i,t),placeDisplayName:s&&un.translatedArrayToString(s,t),displayAddress:c&&l&&un.mergeTranslatedAttributes(c,l,t),facilities:null==d?void 0:d.map((function(e){return It.__assign(It.__assign({},e),{value:un.toString(e.value,t)})})),sentiments:null==h?void 0:h.map((function(e){return It.__assign(It.__assign({},e),{value:un.toString(e.value,t)})})),themes:null==p?void 0:p.map((function(e){return It.__assign(It.__assign({},e),{value:un.toString(e.value,t)})})),propertyType:f&&It.__assign(It.__assign({},f),{value:un.toString(f.value,t)})});return Jr.omit(["placeDN","placeADName","address"],g)}function a(e,t){var r=Jr.removeEmpty({id:e,language:t.join(","),attributes:["objectID","address","guestRating","isDeleted","starRating","_geoloc","feesOpt","placeADName","checkInSpInst","policies","phone","imageURIs","checkInTime","placeDN","checkInInst","reviewCount","chainID","checkInEnd","lastBooked","checkOutTime","feesMnd","reviewCountBkt","hotelName","sentiments","facilities","placeID","guestType","themes","propertyType","checkInMinAge","pricing"].join(",")});return new n.default(r).toString()}t.safToSapiHotel=o,t.createRequestString=a,t.hotel=function(e){var t=this,n=e.appConfig,i=e.options;return function(e){return It.__awaiter(t,void 0,void 0,(function(){var t,u;return It.__generator(this,(function(s){switch(s.label){case 0:return t=a(e,i.languages),[4,r.default("https://"+n.saf.baseUrl+"/"+n.saf.endpoints.hotel+"?"+t)];case 1:return(u=s.sent()).ok?[4,u.json()]:[3,3];case 2:return[2,o(s.sent(),i.languages)];case 3:return[2,Promise.reject(u)]}}))}))}}})),jo=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.offers=t.sapiResponseToHotelOfferEntity=void 0;var r,n=It.__importDefault(Xr),o=It.__importDefault(an);function a(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.baseRate;return t&&(n+=e.taxes),r&&(n+=e.localTaxes),n}function i(e,t,r){var n=o.default(Jr.dateToMiddayUTC(r),Jr.dateToMiddayUTC(t));if(n<1)throw new Error("checkOut cannot be the same or less than checkIn");return 1===n?e:e/n}function u(e,t){var r,n={baseRate:e.anchorRate.base,localTaxes:e.anchorRate.hotelFees,taxes:e.anchorRate.taxes},o=a(n,t.includeTaxes,t.includeLocalTaxes),u=i(o,t.checkIn,t.checkOut);return{anchorPriceRateBreakdown:It.__assign(It.__assign({},n),{calculatedTotalRate:o,nightlyRate:u}),availableOffersCount:e.availableOffersCount,fetchedAllOffers:e.fetchedAllOffers,hasMoreOffers:e.hasMoreOffers,id:e.id,offers:null===(r=e.offers)||void 0===r?void 0:r.map((function(r){return function(e,t,r){var n,o,u,s,c,l={baseRate:e.rate.base,localTaxes:e.rate.hotelFees,taxes:e.rate.taxes},f=a(l,r.includeTaxes,r.includeLocalTaxes),d=i(f,r.checkIn,r.checkOut),h=null!==(n=e.tags)&&void 0!==n?n:[],p=h.includes("top_offer"),g=h.includes("anchor_price"),v=h.includes("exclusive_cheapest_offer"),y=null===(o=e.package.amenities)||void 0===o?void 0:o.filter((function(e){return["allInclusive","breakfast","partialBreakfast","lunch","dinner","fullBoard","halfBoard","meals"].includes(e)})),m=e.package.refundable&&(0===e.cancellationPenalties.length||e.cancellationPenalties.some((function(e){return 0===e.amount||0===e.percent||0===e.nights})));return{id:e.id,bookURI:e.url,providerCode:e.providerCode,proxyProviderCode:e.intermediaryProvider,rateBreakdown:l,nightlyRate:d,calculatedTotalRate:f,availableRooms:e.availableRooms,cug:e.accessTier?e.accessTier.split(","):null,currency:e.currency,meals:y,tags:h,canPayLater:e.package.canPayLater,hasAnchorPrice:p,hasFreeCancellation:m,isAnchorPriceOffer:g,isTopOffer:p,isCheapest:v,roomID:e.roomID,roomName:null===(u=null==t?void 0:t[e.roomID])||void 0===u?void 0:u.name,additionalProviderParams:{feedId:null!==(c=null===(s=e.metadata)||void 0===s?void 0:s.feedID)&&void 0!==c?c:""}}}(r,e.rooms,t)})),topOfferData:{anchorPrice:o,anchorPriceNightly:u,offerIndexes:[0,1,2,3]}}}!function(e){e[e.Connecting=0]="Connecting",e[e.Open=1]="Open",e[e.Closing=2]="Closing",e[e.Closed=3]="Closed"}(r||(r={})),t.sapiResponseToHotelOfferEntity=u,t.offers=function(e,t){if("undefined"==typeof WebSocket&&void 0===t.WebSocket)throw new TypeError("Client does not support WebSocket");var o,a="wss://"+e.baseUrl+"/"+e.endpoints.offers,i=new n.default(a,[],{maxRetries:20,WebSocket:t.WebSocket}),s={};function c(e){t.logger.log({name:"WebsocketConnectionClosed",value:{service:"sapi",code:e.code,reason:e.reason,wasClean:e.wasClean}}),void 0!==s.current&&i.reconnect()}function l(e){t.logger.log({name:"WebsocketError",value:It.__assign(It.__assign({},e),{service:"sapi"})}),void 0!==s.current&&i.reconnect()}function f(){var e=s.current;void 0!==e&&i.send(e)}function d(e){var t;try{t=JSON.parse(e.data)}catch(e){console.log("WEBSOCKET: error parsing message")}"function"==typeof o&&o(t)}return i.addEventListener("open",f),i.addEventListener("close",c),i.addEventListener("error",l),i.addEventListener("message",d),{getOffers:function(e,n){return It.__awaiter(this,void 0,void 0,(function(){var a;return It.__generator(this,(function(c){return a={},s.current=function(e,t){var r,n={checkIn:e.checkIn,checkOut:e.checkOut,anchorHotelId:e.anchorHotelId,hotelIds:e.hotelIds,rooms:e.rooms,searchId:e.searchId,cugDeals:e.cugDeals,language:t.language,deviceType:t.deviceType,anonymousId:t.anonymousId,currency:t.currency,originId:e.originId,brand:t.brand,clientRequestId:$r.v4(),sortingBoost:en.generateSortingBoost(e),roomLimit:1,anchorRoomLimit:2,getAllOffers:Boolean(e.getAllOffers),preferredRate:e.preferredRate,label:e.trafficSource,countryCode:t.countryCode};try{r=JSON.stringify(n)}catch(e){console.log("WEBSOCKET: error serialising request")}return r}(e,t),[2,new Promise((function(c){o=function(r){var o,i;if(void 0!==r)if(r.status.complete)c(a),s.current=void 0;else{var l=null===(o=r.results)||void 0===o?void 0:o.find((function(t){return t.id===e.anchorHotelId}));l?a.anchorHotelOfferEntity=u(l,It.__assign(It.__assign({},e),t)):a.hotelOfferEntities=null===(i=r.results)||void 0===i?void 0:i.map((function(r){return u(r,It.__assign(It.__assign({},e),t))})),"function"==typeof n&&n(It.__assign({},a))}},i.readyState===r.Open&&void 0!==s.current&&i.send(s.current)}))]}))}))}}}})),Co=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sapi=void 0;var r=It.__importDefault(d),n={log:function(){}};function o(e){void 0===e&&(e={});var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r+"-"+e[r]);return t}t.sapi=function(e,t){var a,i,u,s,c,l,f,d,h,p,g;return It.__awaiter(this,void 0,void 0,(function(){function v(e){return m.client.features.includes(e)}var y,m,b,_,w,O,T,I,S,x,P,E;return It.__generator(this,(function(k){switch(k.label){case 0:if(!e)throw new Error("Profile key is required");return y=It.__assign(It.__assign({},t),{logger:null!==(a=t.logger)&&void 0!==a?a:n,variations:o(t.variations),currency:null!==(u=null===(i=t.currency)||void 0===i?void 0:i.toUpperCase())&&void 0!==u?u:"USD",deviceType:null!==(c=null!==(s=t.deviceType)&&void 0!==s?s:t.deviceCategory)&&void 0!==c?c:"desktop",countryCode:null!==(l=t.countryCode)&&void 0!==l?l:t.userCountry,pageSize:null!==(f=t.pageSize)&&void 0!==f?f:20}),m=_n.getAppConfig(e,y.initWithAppConfig),b=r.default("4UYGJP42KQ",m.algolia.apiKey,y.algoliaClientOptions),v("offers")&&m.daedalus.raaEndpoint&&(_=(null===(d=y.variations)||void 0===d?void 0:d.includes("a41n36ps-sapi-offers-b"))?jo.offers(m.sapiBackend,y):en.raa(m.daedalus.raaEndpoint,y)),w={appConfig:m,algoliaClient:b,getFeatureEnabled:v,profileKey:e,offersClient:_,options:It.__assign(It.__assign({},y),{languages:It.__spreadArrays([y.language],null!==(h=m.client.fallbackLanguages[y.language])&&void 0!==h?h:[],["en"])})},(O=null===(p=y.variations)||void 0===p?void 0:p.includes("c48b82da-sapi-backend-b"))||!v("configs")?[3,2]:[4,mo.loadConfigs(b,m.algolia,It.__assign(It.__assign({},w.options),{currencies:[y.currency,"EUR"]}))];case 1:T=k.sent(),(null===(g=y.callbacks)||void 0===g?void 0:g.onConfigReceived)&&(I=T.exchangeRates,S=T.lov,y.callbacks.onConfigReceived({exchangeRates:I,lov:S})),w.configs=T,k.label=2;case 2:return x=function(e){return v("search")?O?xo.backendSearch(e):bo.search(e):function(){throw new Error("Search is not enabled for this Profile key")}},P=function(e){return v("suggests")?Po.suggest(e):function(){throw new Error("Autosuggest is not enabled for this Profile key")}},E=function(e){return v("get-hotel")?ko.hotel(e):function(){throw new Error("Get hotel is not alowed for this Profile key")}},[2,{rooms:function(e){return v("rooms")?Eo.rooms(e):function(){throw new Error("Rooms search is not enabled for this Profile key")}}(w),search:x(w),suggest:P(w),hotel:E(w)}]}}))}))}})),Do=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Ao=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),Ro=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0})})),No=t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),It.__exportStar(Do,t),It.__exportStar(Ao,t),It.__exportStar(Ro,t)}));return e(t((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Wr.enableES5(),It.__exportStar(Co,t),It.__exportStar(No,t),t.default=Co.sapi})))}));