From 1ad87f80ac71df392c32cde75e7b82ef3010e5af Mon Sep 17 00:00:00 2001 From: Antti Ala-Ilkka Date: Fri, 20 Sep 2019 09:58:56 +0300 Subject: [PATCH] Increase version --- dist/addsearch-js-client.min.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/addsearch-js-client.min.js b/dist/addsearch-js-client.min.js index 7881445..4bb09cd 100644 --- a/dist/addsearch-js-client.min.js +++ b/dist/addsearch-js-client.min.js @@ -1,4 +1,4 @@ -window.AddSearchClient=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=8)}([function(t,e,n){"use strict";t.exports={isFunction:function(t){return t&&"[object Function]"==={}.toString.call(t)}}},function(t,e,n){"use strict";t.exports=function(){this.settings={keyword:"*",callback:null,fuzzy:!0,paging:{page:1,pageSize:10,sortBy:"relevance",sortOrder:"desc"},customFieldFilters:[],userToken:null,suggestionsSize:10,facetFields:[]},this.getSettings=function(){return this.settings},this.setKeyword=function(t){this.settings.keyword=t||"*"},this.setCallback=function(t){this.settings.callback=t},this.setSuggestionsPrefix=function(t){this.settings.suggestionsPrefix=t},this.setSuggestionsSize=function(t){this.settings.suggestionsSize=t},this.setLanguage=function(t){if(t&&2!==t.length)throw'use 2-char language code (e.g. "en")';this.settings.lang=t},this.useFuzzyMatch=function(t){this.settings.fuzzy=t},this.setCategoryFilters=function(t){this.settings.categories=t},this.setFilterObject=function(t){this.settings.filterObject=t},this.setPriceRangeFilter=function(t,e){this.settings.priceFromCents=t,this.settings.priceToCents=e},this.addCustomFieldFilter=function(t,e){var n=encodeURIComponent(t+"="+e);this.settings.customFieldFilters.push(n)},this.removeCustomFieldFilter=function(t,e){var n=!1,r=encodeURIComponent(t+"="+e);e||(n=!0,r=encodeURIComponent(t+"="));for(var i=this.settings.customFieldFilters.length;i>0;i--){var s=this.settings.customFieldFilters[i-1];n&&0===s.indexOf(r)?this.settings.customFieldFilters.splice(i-1,1):s===r&&this.settings.customFieldFilters.splice(i-1,1)}},this.setDateFilter=function(t,e){this.settings.dateFrom=t,this.settings.dateTo=e},this.setKeyword=function(t){this.settings.keyword=t||"*"},this.setJWT=function(t){this.settings.jwt=t},this.setUserToken=function(t){this.settings.userToken=t},this.setPersonalizationEvents=function(t){this.settings.personalizationEvents=t},this.setResultType=function(t){this.settings.resultType=t},this.addFacetField=function(t){this.settings.facetFields.push(t)},this.setNumberOfFacets=function(t){this.settings.numFacets=t},this.setPaging=function(t,e,n,r){if(t<1)throw"page must be 1 or bigger";if(e<1||e>50)throw"pageSize must be 1-50";if("asc"!==r&&"desc"!==r)throw"sortOrder must be asc or desc";this.settings.paging.page=t,this.settings.paging.pageSize=e,this.settings.paging.sortBy=n,this.settings.paging.sortOrder=r},this.nextPage=function(){this.settings.paging.page=this.settings.paging.page+1},this.previousPage=function(){this.settings.paging.page>0&&(this.settings.paging.page=this.settings.paging.page-1)}}},function(t,e,n){"use strict";n.r(e),n.d(e,"Headers",function(){return c}),n.d(e,"Request",function(){return y}),n.d(e,"Response",function(){return m}),n.d(e,"DOMException",function(){return w}),n.d(e,"fetch",function(){return _});var r={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function o(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function u(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r.iterable&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function l(t){var e=new FileReader,n=f(e);return e.readAsArrayBuffer(t),n}function d(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:r.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():r.arrayBuffer&&r.blob&&function(t){return t&&DataView.prototype.isPrototypeOf(t)}(t)?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=d(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,n=f(e);return e.readAsText(t),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function b(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}}),e}function m(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},p.call(y.prototype),p.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},m.error=function(){var t=new m(null,{status:0,statusText:""});return t.type="error",t};var v=[301,302,303,307,308];m.redirect=function(t,e){if(-1===v.indexOf(e))throw new RangeError("Invalid status code");return new m(null,{status:e,headers:{location:t}})};var w=self.DOMException;try{new w}catch(t){(w=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack}).prototype=Object.create(Error.prototype),w.prototype.constructor=w}function _(t,e){return new Promise(function(n,i){var s=new y(t,e);if(s.signal&&s.signal.aborted)return i(new w("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}o.onload=function(){var t={status:o.status,statusText:o.statusText,headers:function(t){var e=new c;return t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}}),e}(o.getAllResponseHeaders()||"")};t.url="responseURL"in o?o.responseURL:t.headers.get("X-Request-URL");var e="response"in o?o.response:o.responseText;n(new m(e,t))},o.onerror=function(){i(new TypeError("Network request failed"))},o.ontimeout=function(){i(new TypeError("Network request failed"))},o.onabort=function(){i(new w("Aborted","AbortError"))},o.open(s.method,s.url,!0),"include"===s.credentials?o.withCredentials=!0:"omit"===s.credentials&&(o.withCredentials=!1),"responseType"in o&&r.blob&&(o.responseType="blob"),s.headers.forEach(function(t,e){o.setRequestHeader(e,t)}),s.signal&&(s.signal.addEventListener("abort",a),o.onreadystatechange=function(){4===o.readyState&&s.signal.removeEventListener("abort",a)}),o.send(void 0===s._bodyInit?null:s._bodyInit)})}_.polyfill=!0,self.fetch||(self.fetch=_,self.Headers=c,self.Request=y,self.Response=m)},function(t,e,n){n(2),t.exports=self.fetch.bind(self)},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){var n,r,i=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var u,c=[],h=!1,f=-1;function l(){h&&u&&(h=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!h){var t=a(l);h=!0;for(var e=c.length;e;){for(u=c,c=[];++f1)for(var n=1;n0;i--){var s=this.settings.customFieldFilters[i-1];n&&0===s.indexOf(r)?this.settings.customFieldFilters.splice(i-1,1):s===r&&this.settings.customFieldFilters.splice(i-1,1)}},this.setDateFilter=function(t,e){this.settings.dateFrom=t,this.settings.dateTo=e},this.setKeyword=function(t){this.settings.keyword=t||"*"},this.setJWT=function(t){this.settings.jwt=t},this.setUserToken=function(t){this.settings.userToken=t},this.setPersonalizationEvents=function(t){this.settings.personalizationEvents=t},this.setResultType=function(t){this.settings.resultType=t},this.addFacetField=function(t){this.settings.facetFields.push(t)},this.setNumberOfFacets=function(t){this.settings.numFacets=t},this.setPaging=function(t,e,n,r){if(t<1)throw"page must be 1 or bigger";if(e<1||e>300)throw"pageSize must be 1-300";if("asc"!==r&&"desc"!==r)throw"sortOrder must be asc or desc";this.settings.paging.page=t,this.settings.paging.pageSize=e,this.settings.paging.sortBy=n,this.settings.paging.sortOrder=r},this.nextPage=function(){this.settings.paging.page=this.settings.paging.page+1},this.previousPage=function(){this.settings.paging.page>0&&(this.settings.paging.page=this.settings.paging.page-1)}}},function(t,e,n){"use strict";n.r(e),n.d(e,"Headers",function(){return c}),n.d(e,"Request",function(){return y}),n.d(e,"Response",function(){return m}),n.d(e,"DOMException",function(){return w}),n.d(e,"fetch",function(){return _});var r={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function o(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function u(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r.iterable&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function l(t){var e=new FileReader,n=f(e);return e.readAsArrayBuffer(t),n}function d(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:r.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():r.arrayBuffer&&r.blob&&function(t){return t&&DataView.prototype.isPrototypeOf(t)}(t)?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=d(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,n=f(e);return e.readAsText(t),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function b(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}}),e}function m(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},p.call(y.prototype),p.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},m.error=function(){var t=new m(null,{status:0,statusText:""});return t.type="error",t};var v=[301,302,303,307,308];m.redirect=function(t,e){if(-1===v.indexOf(e))throw new RangeError("Invalid status code");return new m(null,{status:e,headers:{location:t}})};var w=self.DOMException;try{new w}catch(t){(w=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack}).prototype=Object.create(Error.prototype),w.prototype.constructor=w}function _(t,e){return new Promise(function(n,i){var s=new y(t,e);if(s.signal&&s.signal.aborted)return i(new w("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}o.onload=function(){var t={status:o.status,statusText:o.statusText,headers:function(t){var e=new c;return t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}}),e}(o.getAllResponseHeaders()||"")};t.url="responseURL"in o?o.responseURL:t.headers.get("X-Request-URL");var e="response"in o?o.response:o.responseText;n(new m(e,t))},o.onerror=function(){i(new TypeError("Network request failed"))},o.ontimeout=function(){i(new TypeError("Network request failed"))},o.onabort=function(){i(new w("Aborted","AbortError"))},o.open(s.method,s.url,!0),"include"===s.credentials?o.withCredentials=!0:"omit"===s.credentials&&(o.withCredentials=!1),"responseType"in o&&r.blob&&(o.responseType="blob"),s.headers.forEach(function(t,e){o.setRequestHeader(e,t)}),s.signal&&(s.signal.addEventListener("abort",a),o.onreadystatechange=function(){4===o.readyState&&s.signal.removeEventListener("abort",a)}),o.send(void 0===s._bodyInit?null:s._bodyInit)})}_.polyfill=!0,self.fetch||(self.fetch=_,self.Headers=c,self.Request=y,self.Response=m)},function(t,e,n){n(2),t.exports=self.fetch.bind(self)},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){var n,r,i=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var u,c=[],h=!1,f=-1;function l(){h&&u&&(h=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!h){var t=a(l);h=!0;for(var e=c.length;e;){for(u=c,c=[];++f1)for(var n=1;n