LocalCDN-Firefox-Chrome-Brave/resources/algoliasearch/4.14.2/algoliasearch.min.jsm

1 line
31 KiB
JavaScript
Raw Normal View History

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).algoliasearch=e()}(this,function(){"use strict";function e(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function g(n){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?e(Object(a),!0).forEach(function(t){var e,r;e=n,r=a[t=t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(a,t))})}return n}function d(t,e){if(null==t)return{};var r,n=function(t,e){if(null==t)return{};for(var r,n={},a=Object.keys(t),o=0;o<a.length;o++)r=a[o],0<=e.indexOf(r)||(n[r]=t[r]);return n}(t,e);if(Object.getOwnPropertySymbols)for(var a=Object.getOwnPropertySymbols(t),o=0;o<a.length;o++)r=a[o],0<=e.indexOf(r)||Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r]);return n}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){a=!0,o=t}finally{try{n||null==u.return||u.return()}finally{if(a)throw o}}return r}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function b(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function h(t){var o=0<arguments.length&&void 0!==t?t:{serializable:!0},i={};return{get:function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},t=JSON.stringify(t);if(t in i)return Promise.resolve(o.serializable?JSON.parse(i[t]):i[t]);var n=e(),a=r&&r.miss||function(){return Promise.resolve()};return n.then(function(t){return a(t)}).then(function(){return n})},set:function(t,e){return i[JSON.stringify(t)]=o.serializable?JSON.stringify(e):e,Promise.resolve(e)},delete:function(t){return delete i[JSON.stringify(t)],Promise.resolve()},clear:function(){return i={},Promise.resolve()}}}function m(t,e,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":e};return{headers:function(){return t===P.WithinHeaders?n:{}},queryParameters:function(){return t===P.WithinQueryParameters?n:{}}}}function u(r){var n=0;return r(function e(){return n++,new Promise(function(t){setTimeout(function(){t(r(e))},Math.min(100*n,1e3))})})}function l(t,e){var r=1<arguments.length&&void 0!==e?e:function(t,e){return Promise.resolve()};return Object.assign(t,{wait:function(e){return l(t.then(function(t){return Promise.all([r(t,e),t])}).then(function(t){return t[1]}))}})}function y(e,r){return r&&Object.keys(r).forEach(function(t){e[t]=r[t](e)}),e}function v(t){for(var e=arguments.length,r=new Array(1<e?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var a=0;return t.replace(/%s/g,function(){return encodeURIComponent(r[a++])})}var P={WithinQueryParameters:0,WithinHeaders:1};function w(t,e){var r=t||{},n=r.data||{};return Object.keys(r).forEach(function(t){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(t)&&(n[t]=r[t])}),{data:0<Object.entries(n).length?n:void 0,timeout:r.timeout||e,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var O={Read:1,Write:2,Any:3},J=2,I=3;function x(t,e){e=1<arguments.length&&void 0!==e?e:1;return g(g({},t),{},{status:e,lastUpdate:Date.now()})}function j(t){return"string"==typeof t?{protoco