-
-
Notifications
You must be signed in to change notification settings - Fork 76
/
typesense.min.js
3 lines (3 loc) · 104 KB
/
typesense.min.js
1
2
3
/*! For license information please see typesense.min.js.LICENSE.txt */
var Typesense;(()=>{var e={65:function(e,t,n){var r,o;!function(i,a){"use strict";r=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],o={},i=null;function a(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(){for(var n=this.getLevel(),o=0;o<r.length;o++){var i=r[o];this[i]=o<n?e:this.methodFactory(i,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return"No console available for logging"}function u(e){return function(){typeof console!==t&&(c.call(this),this[e].apply(this,arguments))}}function l(r,o,i){return function(r){return"debug"===r&&(r="log"),typeof console!==t&&("trace"===r&&n?s:void 0!==console[r]?a(console,r):void 0!==console.log?a(console,"log"):e)}(r)||u.apply(this,arguments)}function h(e,n){var a,s,u,h=this,p="loglevel";function f(){var e;if(typeof window!==t&&p){try{e=window.localStorage[p]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(p),o=n.indexOf(r+"=");-1!==o&&(e=/^([^;]+)/.exec(n.slice(o+r.length+1))[1])}catch(e){}return void 0===h.levels[e]&&(e=void 0),e}}function d(e){var t=e;if("string"==typeof t&&void 0!==h.levels[t.toUpperCase()]&&(t=h.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=h.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?p+=":"+e:"symbol"==typeof e&&(p=void 0),h.name=e,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=n||l,h.getLevel=function(){return null!=u?u:null!=s?s:a},h.setLevel=function(e,n){return u=d(e),!1!==n&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t&&p){try{return void(window.localStorage[p]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(p)+"="+n+";"}catch(e){}}}(u),c.call(h)},h.setDefaultLevel=function(e){s=d(e),f()||h.setLevel(e,!1)},h.resetLevel=function(){u=null,function(){if(typeof window!==t&&p){try{window.localStorage.removeItem(p)}catch(e){}try{window.document.cookie=encodeURIComponent(p)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),c.call(h)},h.enableAll=function(e){h.setLevel(h.levels.TRACE,e)},h.disableAll=function(e){h.setLevel(h.levels.SILENT,e)},h.rebuild=function(){if(i!==h&&(a=d(i.getLevel())),c.call(h),i===h)for(var e in o)o[e].rebuild()},a=d(i?i.getLevel():"WARN");var y=f();null!=y&&(u=d(y)),c.call(h)}(i=new h).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=o[e];return t||(t=o[e]=new h(e,i.methodFactory)),t};var p=typeof window!==t?window.log:void 0;return i.noConflict=function(){return typeof window!==t&&window.log===i&&(window.log=p),i},i.getLoggers=function(){return o},i.default=i,i},void 0===(o=r.call(t,n,t,e))||(e.exports=o)}()},612:()=>{},939:()=>{},82:()=>{},633:(e,t,n)=>{var r=n(738).default;function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",h=c.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),a=new _(r||[]);return s(i,"_invoke",{value:A(e,n,a)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var y="suspendedStart",v="suspendedYield",m="executing",g="completed",w={};function b(){}function C(){}function R(){}var k={};p(k,u,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(U([])));S&&S!==i&&a.call(S,u)&&(k=S);var O=R.prototype=b.prototype=Object.create(k);function P(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function n(o,i,s,c){var u=d(e[o],e,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==r(h)&&a.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,s,c)}),(function(e){n("throw",e,s,c)})):t.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,c)}))}c(u.arg)}var o;s(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function A(e,n,r){var o=y;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=T(s,r);if(c){if(c===w)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===y)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var u=d(e,n,r);if("normal"===u.type){if(o=r.done?g:v,u.arg===w)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=g,r.method="throw",r.arg=u.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),w;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function U(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(a.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(r(e)+" is not iterable")}return C.prototype=R,s(O,"constructor",{value:R,configurable:!0}),s(R,"constructor",{value:C,configurable:!0}),C.displayName=p(R,h,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===C||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,R):(e.__proto__=R,p(e,h,"GeneratorFunction")),e.prototype=Object.create(O),e},n.awrap=function(e){return{__await:e}},P(x.prototype),p(x.prototype,l,(function(){return this})),n.AsyncIterator=x,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new x(f(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},P(O),p(O,h,"Generator"),p(O,u,(function(){return this})),p(O,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=U,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,w):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),w},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:U(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},n}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},756:(e,t,n)=>{var r=n(633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{Client:()=>gr,Errors:()=>t,SearchClient:()=>br,default:()=>Cr});var e={};n.r(e),n.d(e,{hasBrowserEnv:()=>De,hasStandardBrowserEnv:()=>He,hasStandardBrowserWebWorkerEnv:()=>Me,navigator:()=>Be,origin:()=>Ke});var t={};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:String(t)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.r(t),n.d(t,{HTTPError:()=>fn,ImportError:()=>kn,MissingConfigurationError:()=>k,ObjectAlreadyExists:()=>rn,ObjectNotFound:()=>en,ObjectUnprocessable:()=>sn,RequestMalformed:()=>Vt,RequestUnauthorized:()=>Xt,ServerError:()=>ln,TypesenseError:()=>b});var l=n(65);function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}function m(e){var t="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(v())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&d(o,n.prototype),o}(e,arguments,f(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,e)},m(e)}function g(e,t,n){return t=f(t),p(e,w()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(w=function(){return!!e})()}var b=function(e){function t(e){var n;return o(this,t),(n=g(this,t,[e])).name=(this instanceof t?this.constructor:void 0).name,Object.setPrototypeOf(h(n),(this instanceof t?this.constructor:void 0).prototype),n}return y(t,e),c(t)}(m(Error));function C(e,t,n){return t=f(t),p(e,R()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function R(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(R=function(){return!!e})()}var k=function(e){function t(){return o(this,t),C(this,t,arguments)}return y(t,e),c(t)}(b);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var S=function(){function e(t){var n=this;o(this,e),this.nodes=t.nodes||[],this.nodes=this.nodes.map((function(e){return n.setDefaultPathInNode(e)})).map((function(e){return n.setDefaultPortInNode(e)})).map((function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e)})),null==t.randomizeNodes&&(t.randomizeNodes=!0),!0===t.randomizeNodes&&this.shuffleArray(this.nodes),this.nearestNode=t.nearestNode,this.nearestNode=this.setDefaultPathInNode(this.nearestNode),this.nearestNode=this.setDefaultPortInNode(this.nearestNode),this.connectionTimeoutSeconds=t.connectionTimeoutSeconds||t.timeoutSeconds||5,this.healthcheckIntervalSeconds=t.healthcheckIntervalSeconds||60,this.numRetries=(void 0!==t.numRetries&&t.numRetries>=0?t.numRetries:this.nodes.length+(null==this.nearestNode?0:1))||3,this.retryIntervalSeconds=t.retryIntervalSeconds||.1,this.apiKey=t.apiKey,this.sendApiKeyAsQueryParam=t.sendApiKeyAsQueryParam,this.cacheSearchResultsForSeconds=t.cacheSearchResultsForSeconds||0,this.useServerSideSearchCache=t.useServerSideSearchCache||!1,this.logger=t.logger||l,this.logLevel=t.logLevel||"warn",this.logger.setLevel(this.logLevel),this.additionalHeaders=t.additionalHeaders,this.httpAgent=t.httpAgent,this.httpsAgent=t.httpsAgent,this.paramsSerializer=t.paramsSerializer,this.showDeprecationWarnings(t),this.validate()}return c(e,[{key:"validate",value:function(){if(null==this.nodes||0===this.nodes.length||this.validateNodes())throw new k("Ensure that nodes[].protocol, nodes[].host and nodes[].port are set");if(null!=this.nearestNode&&this.isNodeMissingAnyParameters(this.nearestNode))throw new k("Ensure that nearestNodes.protocol, nearestNodes.host and nearestNodes.port are set");if(null==this.apiKey)throw new k("Ensure that apiKey is set");return!0}},{key:"validateNodes",value:function(){var e=this;return this.nodes.some((function(t){return e.isNodeMissingAnyParameters(t)}))}},{key:"isNodeMissingAnyParameters",value:function(e){return!["protocol","host","port","path"].every((function(t){return e.hasOwnProperty(t)}))&&null==e.url}},{key:"setDefaultPathInNode",value:function(e){return null==e||e.hasOwnProperty("path")||(e.path=""),e}},{key:"setDefaultPortInNode",value:function(e){if(null!=e&&!e.hasOwnProperty("port")&&e.hasOwnProperty("protocol"))switch(e.protocol){case"https":e.port=443;break;case"http":e.port=80}return e}},{key:"showDeprecationWarnings",value:function(e){e.timeoutSeconds&&this.logger.warn("Deprecation warning: timeoutSeconds is now renamed to connectionTimeoutSeconds"),e.masterNode&&this.logger.warn("Deprecation warning: masterNode is now consolidated to nodes, starting with Typesense Server v0.12"),e.readReplicaNodes&&this.logger.warn("Deprecation warning: readReplicaNodes is now consolidated to nodes, starting with Typesense Server v0.12")}},{key:"shuffleArray",value:function(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=[e[n],e[t]];e[t]=r[0],e[n]=r[1]}}}]),e}();function O(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function P(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){O(i,r,o,a,s,"next",e)}function s(e){O(i,r,o,a,s,"throw",e)}a(void 0)}))}}var x=n(756),A=n.n(x);function T(e,t){return function(){return e.apply(t,arguments)}}const{toString:N}=Object.prototype,{getPrototypeOf:j}=Object,_=(U=Object.create(null),e=>{const t=N.call(e);return U[t]||(U[t]=t.slice(8,-1).toLowerCase())});var U;const L=e=>(e=e.toLowerCase(),t=>_(t)===e),I=e=>t=>typeof t===e,{isArray:q}=Array,F=I("undefined"),D=L("ArrayBuffer"),B=I("string"),H=I("function"),M=I("number"),K=e=>null!==e&&"object"==typeof e,z=e=>{if("object"!==_(e))return!1;const t=j(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},J=L("Date"),W=L("File"),G=L("Blob"),V=L("FileList"),Q=L("URLSearchParams"),[$,X,Y,Z]=["ReadableStream","Request","Response","Headers"].map(L);function ee(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),q(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function te(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const ne="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,re=e=>!F(e)&&e!==ne,oe=(ie="undefined"!=typeof Uint8Array&&j(Uint8Array),e=>ie&&e instanceof ie);var ie;const ae=L("HTMLFormElement"),se=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ce=L("RegExp"),ue=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ee(n,((n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)},le="abcdefghijklmnopqrstuvwxyz",he="0123456789",pe={DIGIT:he,ALPHA:le,ALPHA_DIGIT:le+le.toUpperCase()+he},fe=L("AsyncFunction"),de=(ye="function"==typeof setImmediate,ve=H(ne.postMessage),ye?setImmediate:ve?(me=`axios@${Math.random()}`,ge=[],ne.addEventListener("message",(({source:e,data:t})=>{e===ne&&t===me&&ge.length&&ge.shift()()}),!1),e=>{ge.push(e),ne.postMessage(me,"*")}):e=>setTimeout(e));var ye,ve,me,ge;const we="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ne):"undefined"!=typeof process&&process.nextTick||de,be={isArray:q,isArrayBuffer:D,isBuffer:function(e){return null!==e&&!F(e)&&null!==e.constructor&&!F(e.constructor)&&H(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||H(e.append)&&("formdata"===(t=_(e))||"object"===t&&H(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&D(e.buffer),t},isString:B,isNumber:M,isBoolean:e=>!0===e||!1===e,isObject:K,isPlainObject:z,isReadableStream:$,isRequest:X,isResponse:Y,isHeaders:Z,isUndefined:F,isDate:J,isFile:W,isBlob:G,isRegExp:ce,isFunction:H,isStream:e=>K(e)&&H(e.pipe),isURLSearchParams:Q,isTypedArray:oe,isFileList:V,forEach:ee,merge:function e(){const{caseless:t}=re(this)&&this||{},n={},r=(r,o)=>{const i=t&&te(n,o)||o;z(n[i])&&z(r)?n[i]=e(n[i],r):z(r)?n[i]=e({},r):q(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&ee(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(ee(t,((t,r)=>{n&&H(t)?e[r]=T(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&j(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:_,kindOfTest:L,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(q(e))return e;let t=e.length;if(!M(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ae,hasOwnProperty:se,hasOwnProp:se,reduceDescriptors:ue,freezeMethods:e=>{ue(e,((t,n)=>{if(H(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];H(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return q(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:te,global:ne,isContextDefined:re,ALPHABET:pe,generateString:(e=16,t=pe.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&H(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(K(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=q(e)?[]:{};return ee(e,((e,t)=>{const i=n(e,r+1);!F(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:fe,isThenable:e=>e&&(K(e)||H(e))&&H(e.then)&&H(e.catch),setImmediate:de,asap:we};function Ce(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}be.inherits(Ce,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:be.toJSONObject(this.config),code:this.code,status:this.status}}});const Re=Ce.prototype,ke={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{ke[e]={value:e}})),Object.defineProperties(Ce,ke),Object.defineProperty(Re,"isAxiosError",{value:!0}),Ce.from=(e,t,n,r,o,i)=>{const a=Object.create(Re);return be.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Ce.call(a,e.message,t,n,r,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};const Ee=Ce;function Se(e){return be.isPlainObject(e)||be.isArray(e)}function Oe(e){return be.endsWith(e,"[]")?e.slice(0,-2):e}function Pe(e,t,n){return e?e.concat(t).map((function(e,t){return e=Oe(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const xe=be.toFlatObject(be,{},null,(function(e){return/^is[A-Z]/.test(e)})),Ae=function(e,t,n){if(!be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=be.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!be.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&be.isSpecCompliantForm(t);if(!be.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(be.isDate(e))return e.toISOString();if(!s&&be.isBlob(e))throw new Ee("Blob is not supported. Use a Buffer instead.");return be.isArrayBuffer(e)||be.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(be.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(be.isArray(e)&&function(e){return be.isArray(e)&&!e.some(Se)}(e)||(be.isFileList(e)||be.endsWith(n,"[]"))&&(s=be.toArray(e)))return n=Oe(n),s.forEach((function(e,r){!be.isUndefined(e)&&null!==e&&t.append(!0===a?Pe([n],r,i):null===a?n:n+"[]",c(e))})),!1;return!!Se(e)||(t.append(Pe(o,n,i),c(e)),!1)}const l=[],h=Object.assign(xe,{defaultVisitor:u,convertValue:c,isVisitable:Se});if(!be.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!be.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),be.forEach(n,(function(n,i){!0===(!(be.isUndefined(n)||null===n)&&o.call(t,n,be.isString(i)?i.trim():i,r,h))&&e(n,r?r.concat(i):[i])})),l.pop()}}(e),t};function Te(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Ne(e,t){this._pairs=[],e&&Ae(e,this,t)}const je=Ne.prototype;je.append=function(e,t){this._pairs.push([e,t])},je.toString=function(e){const t=e?function(t){return e.call(this,t,Te)}:Te;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const _e=Ne;function Ue(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Le(e,t,n){if(!t)return e;const r=n&&n.encode||Ue,o=n&&n.serialize;let i;if(i=o?o(t,n):be.isURLSearchParams(t)?t.toString():new _e(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Ie=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){be.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},qe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Fe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:_e,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},De="undefined"!=typeof window&&"undefined"!=typeof document,Be="object"==typeof navigator&&navigator||void 0,He=De&&(!Be||["ReactNative","NativeScript","NS"].indexOf(Be.product)<0),Me="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ke=De&&window.location.href||"http://localhost",ze={...e,...Fe},Je=function(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;return i=!i&&be.isArray(r)?r.length:i,s?(be.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a):(r[i]&&be.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&be.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!a)}if(be.isFormData(e)&&be.isFunction(e.entries)){const n={};return be.forEachEntry(e,((e,r)=>{t(function(e){return be.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},We={transitional:qe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=be.isObject(e);if(o&&be.isHTMLForm(e)&&(e=new FormData(e)),be.isFormData(e))return r?JSON.stringify(Je(e)):e;if(be.isArrayBuffer(e)||be.isBuffer(e)||be.isStream(e)||be.isFile(e)||be.isBlob(e)||be.isReadableStream(e))return e;if(be.isArrayBufferView(e))return e.buffer;if(be.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ae(e,new ze.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ze.isNode&&be.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=be.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ae(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(be.isString(e))try{return(0,JSON.parse)(e),be.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||We.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(be.isResponse(e)||be.isReadableStream(e))return e;if(e&&be.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Ee.from(e,Ee.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ze.classes.FormData,Blob:ze.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};be.forEach(["delete","get","head","post","put","patch"],(e=>{We.headers[e]={}}));const Ge=We,Ve=be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Qe=Symbol("internals");function $e(e){return e&&String(e).trim().toLowerCase()}function Xe(e){return!1===e||null==e?e:be.isArray(e)?e.map(Xe):String(e)}function Ye(e,t,n,r,o){return be.isFunction(r)?r.call(this,t,n):(o&&(t=n),be.isString(t)?be.isString(r)?-1!==t.indexOf(r):be.isRegExp(r)?r.test(t):void 0:void 0)}class Ze{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=$e(t);if(!o)throw new Error("header name must be a non-empty string");const i=be.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Xe(e))}const i=(e,t)=>be.forEach(e,((e,n)=>o(e,n,t)));if(be.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(be.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Ve[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(be.isHeaders(e))for(const[t,r]of e.entries())o(r,t,n);else null!=e&&o(t,e,n);return this}get(e,t){if(e=$e(e)){const n=be.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(be.isFunction(t))return t.call(this,e,n);if(be.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=$e(e)){const n=be.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ye(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=$e(e)){const o=be.findKey(n,e);!o||t&&!Ye(0,n[o],o,t)||(delete n[o],r=!0)}}return be.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Ye(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return be.forEach(this,((r,o)=>{const i=be.findKey(n,o);if(i)return t[i]=Xe(r),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();a!==o&&delete t[o],t[a]=Xe(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return be.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&be.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Qe]=this[Qe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=$e(e);t[r]||(function(e,t){const n=be.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return be.isArray(e)?e.forEach(r):r(e),this}}Ze.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),be.reduceDescriptors(Ze.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),be.freezeMethods(Ze);const et=Ze;function tt(e,t){const n=this||Ge,r=t||n,o=et.from(r.headers);let i=r.data;return be.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function nt(e){return!(!e||!e.__CANCEL__)}function rt(e,t,n){Ee.call(this,null==e?"canceled":e,Ee.ERR_CANCELED,t,n),this.name="CanceledError"}be.inherits(rt,Ee,{__CANCEL__:!0});const ot=rt;function it(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ee("Request failed with status code "+n.status,[Ee.ERR_BAD_REQUEST,Ee.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const at=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=r[a];o||(o=c),n[i]=s,r[i]=c;let l=a,h=0;for(;l!==i;)h+=n[l++],l%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;const p=u&&c-u;return p?Math.round(1e3*h/p):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const a=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(n=e,r||(r=setTimeout((()=>{r=null,a(n)}),i-s)))},()=>n&&a(n)]}((n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,c=o(s);r=i,e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})}),n)},st=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ct=e=>(...t)=>be.asap((()=>e(...t))),ut=ze.hasStandardBrowserEnv?function(){const e=ze.navigator&&/(msie|trident)/i.test(ze.navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=be.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},lt=ze.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];be.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),be.isString(r)&&a.push("path="+r),be.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ht(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const pt=e=>e instanceof et?{...e}:e;function ft(e,t){t=t||{};const n={};function r(e,t,n){return be.isPlainObject(e)&&be.isPlainObject(t)?be.merge.call({caseless:n},e,t):be.isPlainObject(t)?be.merge({},t):be.isArray(t)?t.slice():t}function o(e,t,n){return be.isUndefined(t)?be.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!be.isUndefined(t))return r(void 0,t)}function a(e,t){return be.isUndefined(t)?be.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>o(pt(e),pt(t),!0)};return be.forEach(Object.keys(Object.assign({},e,t)),(function(r){const i=c[r]||o,a=i(e[r],t[r],r);be.isUndefined(a)&&i!==s||(n[r]=a)})),n}const dt=e=>{const t=ft({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:c}=t;if(t.headers=s=et.from(s),t.url=Le(ht(t.baseURL,t.url),e.params,e.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),be.isFormData(r))if(ze.hasStandardBrowserEnv||ze.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(n=s.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(ze.hasStandardBrowserEnv&&(o&&be.isFunction(o)&&(o=o(t)),o||!1!==o&&ut(t.url))){const e=i&&a&<.read(a);e&&s.set(i,e)}return t},yt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=dt(e);let o=r.data;const i=et.from(r.headers).normalize();let a,s,c,u,l,{responseType:h,onUploadProgress:p,onDownloadProgress:f}=r;function d(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function v(){if(!y)return;const r=et.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());it((function(e){t(e),d()}),(function(e){n(e),d()}),{data:h&&"text"!==h&&"json"!==h?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,"onloadend"in y?y.onloadend=v:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(v)},y.onabort=function(){y&&(n(new Ee("Request aborted",Ee.ECONNABORTED,e,y)),y=null)},y.onerror=function(){n(new Ee("Network Error",Ee.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||qe;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ee(t,o.clarifyTimeoutError?Ee.ETIMEDOUT:Ee.ECONNABORTED,e,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&be.forEach(i.toJSON(),(function(e,t){y.setRequestHeader(t,e)})),be.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),h&&"json"!==h&&(y.responseType=r.responseType),f&&([c,l]=at(f,!0),y.addEventListener("progress",c)),p&&y.upload&&([s,u]=at(p),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{y&&(n(!t||t.type?new ot(null,e,y):t),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);m&&-1===ze.protocols.indexOf(m)?n(new Ee("Unsupported protocol "+m+":",Ee.ERR_BAD_REQUEST,e)):y.send(o||null)}))},vt=(e,t)=>{let n,r=new AbortController;const o=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Ee?t:new ot(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{o(new Ee(`timeout ${t} of ms exceeded`,Ee.ETIMEDOUT))}),t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e&&(e.removeEventListener?e.removeEventListener("abort",o):e.unsubscribe(o))})),e=null)};e.forEach((e=>e&&e.addEventListener&&e.addEventListener("abort",o)));const{signal:s}=r;return s.unsubscribe=a,[s,()=>{i&&clearTimeout(i),i=null}]},mt=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},gt=(e,t,n,r,o)=>{const i=async function*(e,t,n){for await(const r of e)yield*mt(ArrayBuffer.isView(r)?r:await n(String(r)),t)}(e,t,o);let a,s=0,c=e=>{a||(a=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return c(),void e.close();let o=r.byteLength;if(n){let e=s+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw c(e),e}},cancel:e=>(c(e),i.return())},{highWaterMark:2})},wt="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,bt=wt&&"function"==typeof ReadableStream,Ct=wt&&("function"==typeof TextEncoder?(Rt=new TextEncoder,e=>Rt.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Rt;const kt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Et=bt&&kt((()=>{let e=!1;const t=new Request(ze.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),St=bt&&kt((()=>be.isReadableStream(new Response("").body))),Ot={stream:St&&(e=>e.body)};var Pt;wt&&(Pt=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Ot[e]&&(Ot[e]=be.isFunction(Pt[e])?t=>t[e]():(t,n)=>{throw new Ee(`Response type '${e}' is not supported`,Ee.ERR_NOT_SUPPORT,n)})})));const xt={http:null,xhr:yt,fetch:wt&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:c,responseType:u,headers:l,withCredentials:h="same-origin",fetchOptions:p}=dt(e);u=u?(u+"").toLowerCase():"text";let f,d,[y,v]=o||i||a?vt([o,i],a):[];const m=()=>{!f&&setTimeout((()=>{y&&y.unsubscribe()})),f=!0};let g;try{if(c&&Et&&"get"!==n&&"head"!==n&&0!==(g=await(async(e,t)=>{const n=be.toFiniteNumber(e.getContentLength());return null==n?(async e=>null==e?0:be.isBlob(e)?e.size:be.isSpecCompliantForm(e)?(await new Request(e).arrayBuffer()).byteLength:be.isArrayBufferView(e)||be.isArrayBuffer(e)?e.byteLength:(be.isURLSearchParams(e)&&(e+=""),be.isString(e)?(await Ct(e)).byteLength:void 0))(t):n})(l,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(be.isFormData(r)&&(e=n.headers.get("content-type"))&&l.setContentType(e),n.body){const[e,t]=st(g,at(ct(c)));r=gt(n.body,65536,e,t,Ct)}}be.isString(h)||(h=h?"include":"omit");const o="credentials"in Request.prototype;d=new Request(t,{...p,signal:y,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:o?h:void 0});let i=await fetch(d);const a=St&&("stream"===u||"response"===u);if(St&&(s||a)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=be.toFiniteNumber(i.headers.get("content-length")),[n,r]=s&&st(t,at(ct(s),!0))||[];i=new Response(gt(i.body,65536,n,(()=>{r&&r(),a&&m()}),Ct),e)}u=u||"text";let f=await Ot[be.findKey(Ot,u)||"text"](i,e);return!a&&m(),v&&v(),await new Promise(((t,n)=>{it(t,n,{data:f,headers:et.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:d})}))}catch(t){if(m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Ee("Network Error",Ee.ERR_NETWORK,e,d),{cause:t.cause||t});throw Ee.from(t,t&&t.code,e,d)}})};be.forEach(xt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const At=e=>`- ${e}`,Tt=e=>be.isFunction(e)||null===e||!1===e,Nt=e=>{e=be.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){let t;if(n=e[i],r=n,!Tt(n)&&(r=xt[(t=String(n)).toLowerCase()],void 0===r))throw new Ee(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+i]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(At).join("\n"):" "+At(e[0]):"as no adapter specified";throw new Ee("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function jt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ot(null,e)}function _t(e){return jt(e),e.headers=et.from(e.headers),e.data=tt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Nt(e.adapter||Ge.adapter)(e).then((function(t){return jt(e),t.data=tt.call(e,e.transformResponse,t),t.headers=et.from(t.headers),t}),(function(t){return nt(t)||(jt(e),t&&t.response&&(t.response.data=tt.call(e,e.transformResponse,t.response),t.response.headers=et.from(t.response.headers))),Promise.reject(t)}))}const Ut={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ut[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Lt={};Ut.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.5] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Ee(r(o," has been removed"+(t?" in "+t:"")),Ee.ERR_DEPRECATED);return t&&!Lt[o]&&(Lt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}};const It={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ee("options must be an object",Ee.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new Ee("option "+i+" must be "+n,Ee.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Ee("Unknown option "+i,Ee.ERR_BAD_OPTION)}},validators:Ut},qt=It.validators;class Ft{constructor(e){this.defaults=e,this.interceptors={request:new Ie,response:new Ie}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ft(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&It.assertOptions(n,{silentJSONParsing:qt.transitional(qt.boolean),forcedJSONParsing:qt.transitional(qt.boolean),clarifyTimeoutError:qt.transitional(qt.boolean)},!1),null!=r&&(be.isFunction(r)?t.paramsSerializer={serialize:r}:It.assertOptions(r,{encode:qt.function,serialize:qt.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&be.merge(o.common,o[t.method]);o&&be.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=et.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,h=0;if(!s){const e=[_t.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);h<l;)u=u.then(e[h++],e[h++]);return u}l=a.length;let p=t;for(h=0;h<l;){const e=a[h++],t=a[h++];try{p=e(p)}catch(e){t.call(this,e);break}}try{u=_t.call(this,p)}catch(e){return Promise.reject(e)}for(h=0,l=c.length;h<l;)u=u.then(c[h++],c[h++]);return u}getUri(e){return Le(ht((e=ft(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}be.forEach(["delete","get","head","options"],(function(e){Ft.prototype[e]=function(t,n){return this.request(ft(n||{},{method:e,url:t,data:(n||{}).data}))}})),be.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(ft(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ft.prototype[e]=t(),Ft.prototype[e+"Form"]=t(!0)}));const Dt=Ft;class Bt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new ot(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Bt((function(t){e=t})),cancel:e}}}const Ht=Bt,Mt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Mt).forEach((([e,t])=>{Mt[t]=e}));const Kt=Mt,zt=function e(t){const n=new Dt(t),r=T(Dt.prototype.request,n);return be.extend(r,Dt.prototype,n,{allOwnKeys:!0}),be.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ft(t,n))},r}(Ge);zt.Axios=Dt,zt.CanceledError=ot,zt.CancelToken=Ht,zt.isCancel=nt,zt.VERSION="1.7.5",zt.toFormData=Ae,zt.AxiosError=Ee,zt.Cancel=zt.CanceledError,zt.all=function(e){return Promise.all(e)},zt.spread=function(e){return function(t){return e.apply(null,t)}},zt.isAxiosError=function(e){return be.isObject(e)&&!0===e.isAxiosError},zt.mergeConfig=ft,zt.AxiosHeaders=et,zt.formToJSON=e=>Je(be.isHTMLForm(e)?new FormData(e):e),zt.getAdapter=Nt,zt.HttpStatusCode=Kt,zt.default=zt;const Jt=zt;function Wt(e,t,n){return t=f(t),p(e,Gt()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function Gt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gt=function(){return!!e})()}var Vt=function(e){function t(){return o(this,t),Wt(this,t,arguments)}return y(t,e),c(t)}(b);function Qt(e,t,n){return t=f(t),p(e,$t()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function $t(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($t=function(){return!!e})()}var Xt=function(e){function t(){return o(this,t),Qt(this,t,arguments)}return y(t,e),c(t)}(b);function Yt(e,t,n){return t=f(t),p(e,Zt()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function Zt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zt=function(){return!!e})()}var en=function(e){function t(){return o(this,t),Yt(this,t,arguments)}return y(t,e),c(t)}(b);function tn(e,t,n){return t=f(t),p(e,nn()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function nn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nn=function(){return!!e})()}var rn=function(e){function t(){return o(this,t),tn(this,t,arguments)}return y(t,e),c(t)}(b);function on(e,t,n){return t=f(t),p(e,an()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function an(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(an=function(){return!!e})()}var sn=function(e){function t(){return o(this,t),on(this,t,arguments)}return y(t,e),c(t)}(b);function cn(e,t,n){return t=f(t),p(e,un()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function un(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(un=function(){return!!e})()}var ln=function(e){function t(){return o(this,t),cn(this,t,arguments)}return y(t,e),c(t)}(b);function hn(e,t,n){return t=f(t),p(e,pn()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function pn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pn=function(){return!!e})()}var fn=function(e){function t(){return o(this,t),hn(this,t,arguments)}return y(t,e),c(t)}(b),dn=n(939),yn=n(82),vn=!0,mn="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,gn=function(){function e(t){o(this,e),this.configuration=t,this.apiKey=this.configuration.apiKey,this.nodes=null==this.configuration.nodes?this.configuration.nodes:JSON.parse(JSON.stringify(this.configuration.nodes)),this.nearestNode=null==this.configuration.nearestNode?this.configuration.nearestNode:JSON.parse(JSON.stringify(this.configuration.nearestNode)),this.connectionTimeoutSeconds=this.configuration.connectionTimeoutSeconds,this.healthcheckIntervalSeconds=this.configuration.healthcheckIntervalSeconds,this.numRetriesPerRequest=this.configuration.numRetries,this.retryIntervalSeconds=this.configuration.retryIntervalSeconds,this.sendApiKeyAsQueryParam=this.configuration.sendApiKeyAsQueryParam,this.additionalUserHeaders=this.configuration.additionalHeaders,this.logger=this.configuration.logger,this.initializeMetadataForNodes(),this.currentNodeIndex=-1}var t,n,r,a,s,u,l;return c(e,[{key:"get",value:(l=P(A().mark((function e(t){var n,r,o,i,a,s,c=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:{},o=(r=c.length>2&&void 0!==c[2]?c[2]:{}).abortSignal,i=void 0===o?null:o,a=r.responseType,s=void 0===a?void 0:a,e.abrupt("return",this.performRequest("get",t,{queryParameters:n,abortSignal:i,responseType:s}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"delete",value:(u=P(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},e.abrupt("return",this.performRequest("delete",t,{queryParameters:n}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"post",value:(s=P(A().mark((function e(t){var n,r,o,i=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},r=i.length>2&&void 0!==i[2]?i[2]:{},o=i.length>3&&void 0!==i[3]?i[3]:{},e.abrupt("return",this.performRequest("post",t,{queryParameters:r,bodyParameters:n,additionalHeaders:o}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"put",value:(a=P(A().mark((function e(t){var n,r,o=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=o.length>2&&void 0!==o[2]?o[2]:{},e.abrupt("return",this.performRequest("put",t,{queryParameters:r,bodyParameters:n}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"patch",value:(r=P(A().mark((function e(t){var n,r,o=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=o.length>2&&void 0!==o[2]?o[2]:{},e.abrupt("return",this.performRequest("patch",t,{queryParameters:r,bodyParameters:n}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"performRequest",value:(n=P(A().mark((function e(t,n,r){var o,a,s,c,u,l,h,p,f,d,y,v,m,g,w,b,C,R,k,E,S=this;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=r.queryParameters,a=void 0===o?null:o,s=r.bodyParameters,c=void 0===s?null:s,u=r.additionalHeaders,l=void 0===u?{}:u,h=r.abortSignal,p=void 0===h?null:h,f=r.responseType,d=void 0===f?void 0:f,y=r.skipConnectionTimeout,v=void 0!==y&&y,m=r.enableKeepAlive,g=void 0===m?void 0:m,this.configuration.validate(),w=Date.now(),C=!1,this.logger.debug("Request #".concat(w,": Performing ").concat(t.toUpperCase()," request: ").concat(n)),R=A().mark((function e(){var r,o,s,u,h,f,y,m,R,k;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=S.getNextNode(w),S.logger.debug("Request #".concat(w,": Attempting ").concat(t.toUpperCase()," request Try #").concat(E," to Node ").concat(r.index)),!p||!p.aborted){e.next=4;break}return e.abrupt("return",{v:Promise.reject(new Error("Request aborted by caller."))});case 4:return e.prev=4,s={method:t,url:S.uriFor(n,r),headers:Object.assign({},S.defaultHeaders(),l,S.additionalUserHeaders),maxContentLength:1/0,maxBodyLength:1/0,responseType:d,validateStatus:function(e){return e>0},transformResponse:[function(e,t){var n=e;return void 0!==t&&"string"==typeof e&&t["content-type"]&&t["content-type"].startsWith("application/json")&&(n=JSON.parse(e)),n}]},!0!==v&&(s.timeout=1e3*S.connectionTimeoutSeconds),a&&0!==Object.keys(a).length&&(s.params=a),S.sendApiKeyAsQueryParam&&(s.params=s.params||{},s.params["x-typesense-api-key"]=S.apiKey),S.configuration.httpAgent?(S.logger.debug("Request #".concat(w,": Using custom httpAgent")),s.httpAgent=S.configuration.httpAgent):!0===g&&(mn?(S.logger.debug("Request #".concat(w,": Enabling KeepAlive")),s.httpAgent=new dn.Agent({keepAlive:!0})):S.logger.warn("Request #".concat(w,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),S.configuration.httpsAgent?(S.logger.debug("Request #".concat(w,": Using custom httpsAgent")),s.httpsAgent=S.configuration.httpsAgent):!0===g&&(mn?(S.logger.debug("Request #".concat(w,": Enabling keepAlive")),s.httpsAgent=new yn.Agent({keepAlive:!0})):S.logger.warn("Request #".concat(w,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),S.configuration.paramsSerializer&&(S.logger.debug("Request #".concat(w,": Using custom paramsSerializer")),s.paramsSerializer=S.configuration.paramsSerializer),c&&("string"==typeof c&&0!==c.length||"object"===i(c)&&0!==Object.keys(c).length)&&(s.data=c),p&&(u=Jt.CancelToken,h=u.source(),o=function(){C=!0,h.cancel()},p.addEventListener("abort",o),s.cancelToken=h.token),e.next=16,Jt(s);case 16:if((f=e.sent).status>=1&&f.status<=499&&S.setNodeHealthcheck(r,vn),S.logger.debug("Request #".concat(w,": Request to Node ").concat(r.index," was made. Response Code was ").concat(f.status,".")),!(f.status>=200&&f.status<300)){e.next=23;break}return e.abrupt("return",{v:Promise.resolve(f.data)});case 23:if(!(f.status<500)){e.next=27;break}return e.abrupt("return",{v:Promise.reject(S.customErrorForResponse(f,null===(y=f.data)||void 0===y?void 0:y.message))});case 27:throw S.customErrorForResponse(f,null===(m=f.data)||void 0===m?void 0:m.message);case 28:e.next=40;break;case 30:if(e.prev=30,e.t0=e.catch(4),C||S.setNodeHealthcheck(r,!1),b=e.t0,S.logger.warn("Request #".concat(w,": Request to Node ").concat(r.index,' failed due to "').concat(null!==(R=null===e.t0||void 0===e.t0?void 0:e.t0.code)&&void 0!==R?R:""," ").concat(e.t0.message).concat(null==e.t0.response?"":" - "+JSON.stringify(null===(k=e.t0.response)||void 0===k?void 0:k.data),'"')),!C){e.next=37;break}return e.abrupt("return",{v:Promise.reject(new Error("Request aborted by caller."))});case 37:return E<S.numRetriesPerRequest+1&&S.logger.warn("Request #".concat(w,": Sleeping for ").concat(S.retryIntervalSeconds,"s and then retrying request...")),e.next=40,S.timer(S.retryIntervalSeconds);case 40:return e.prev=40,p&&o&&p.removeEventListener("abort",o),e.finish(40);case 43:case"end":return e.stop()}}),e,null,[[4,30,40,43]])})),E=1;case 7:if(!(E<=this.numRetriesPerRequest+1)){e.next=15;break}return e.delegateYield(R(),"t0",9);case 9:if(!(k=e.t0)){e.next=12;break}return e.abrupt("return",k.v);case 12:E++,e.next=7;break;case 15:return this.logger.debug("Request #".concat(w,": No retries left. Raising last error")),e.abrupt("return",Promise.reject(b));case 17:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"getNextNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(null!=this.nearestNode){if(this.logger.debug("Request #".concat(e,": Nodes Health: Node ").concat(this.nearestNode.index," is ").concat(!0===this.nearestNode.isHealthy?"Healthy":"Unhealthy")),!0===this.nearestNode.isHealthy||this.nodeDueForHealthcheck(this.nearestNode,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(this.nearestNode.index)),this.nearestNode;this.logger.debug("Request #".concat(e,": Falling back to individual nodes"))}this.logger.debug("Request #".concat(e,": Nodes Health: ").concat(this.nodes.map((function(e){return"Node ".concat(e.index," is ").concat(!0===e.isHealthy?"Healthy":"Unhealthy")})).join(" || ")));for(var t=this.nodes[0],n=0;n<=this.nodes.length;n++)if(this.currentNodeIndex=(this.currentNodeIndex+1)%this.nodes.length,!0===(t=this.nodes[this.currentNodeIndex]).isHealthy||this.nodeDueForHealthcheck(t,e))return this.logger.debug("Request #".concat(e,": Updated current node to Node ").concat(t.index)),t;return this.logger.debug("Request #".concat(e,": No healthy nodes were found. Returning the next node, Node ").concat(t.index)),t}},{key:"nodeDueForHealthcheck",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Date.now()-e.lastAccessTimestamp>1e3*this.healthcheckIntervalSeconds;return n&&this.logger.debug("Request #".concat(t,": Node ").concat(e.index," has exceeded healtcheckIntervalSeconds of ").concat(this.healthcheckIntervalSeconds,". Adding it back into rotation.")),n}},{key:"initializeMetadataForNodes",value:function(){var e=this;null!=this.nearestNode&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,vn)),this.nodes.forEach((function(t,n){t.index=n,e.setNodeHealthcheck(t,vn)}))}},{key:"setNodeHealthcheck",value:function(e,t){e.isHealthy=t,e.lastAccessTimestamp=Date.now()}},{key:"uriFor",value:function(e,t){return null!=t.url?"".concat(t.url).concat(e):"".concat(t.protocol,"://").concat(t.host,":").concat(t.port).concat(t.path).concat(e)}},{key:"defaultHeaders",value:function(){var e={};return this.sendApiKeyAsQueryParam||(e["X-TYPESENSE-API-KEY"]=this.apiKey),e["Content-Type"]="application/json",e}},{key:"timer",value:(t=P(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){return setTimeout(e,1e3*t)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"customErrorForResponse",value:function(e,t){var n="Request failed with HTTP code ".concat(e.status);"string"==typeof t&&""!==t.trim()&&(n+=" | Server said: ".concat(t));var r=new b(n);return(r=400===e.status?new Vt(n):401===e.status?new Xt(n):404===e.status?new en(n):409===e.status?new rn(n):422===e.status?new sn(n):e.status>=500&&e.status<=599?new ln(n):new fn(n)).httpStatus=e.status,r}}]),e}(),wn="/collections",bn=function(){function e(t){o(this,e),this.apiCall=t}var t,n;return c(e,[{key:"create",value:(n=P(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},e.abrupt("return",this.apiCall.post(wn,t,n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"retrieve",value:(t=P(A().mark((function e(){var t,n=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",this.apiCall.get(wn,t));case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"RESOURCEPATH",get:function(){return wn}}]),e}();function Cn(e,t,n){return t=f(t),p(e,Rn()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function Rn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rn=function(){return!!e})()}var kn=function(e){function t(e,n){var r;return o(this,t),(r=Cn(this,t,[e])).importResults=n,r}return y(t,e),c(t)}(b);function En(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Sn(e,t){if(e){if("string"==typeof e)return En(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?En(e,t):void 0}}function On(e){return function(e){if(Array.isArray(e))return En(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Sn(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Pn=function(){function e(){o(this,e),u(this,"responseCache",new Map),u(this,"responsePromiseCache",new Map)}var t;return c(e,[{key:"clearCache",value:function(){this.responseCache=new Map,this.responsePromiseCache=new Map}},{key:"perform",value:(t=P(A().mark((function e(t,n,r,o){var i,a,s,c,u,l,h,p,f,d,y,v;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=o.cacheResponseForSeconds,a=void 0===i?120:i,s=o.maxSize,c=void 0===s?100:s,!(a<=0||c<=0)){e.next=4;break}return e.abrupt("return",n.call.apply(n,[t].concat(On(r))));case 4:if(u=JSON.stringify(r),l=this.responseCache.get(u),h=Date.now(),!l){e.next=16;break}if(!(h-l.requestTimestamp<1e3*a)){e.next=15;break}return this.responseCache.delete(u),this.responseCache.set(u,l),e.abrupt("return",Promise.resolve(l.response));case 15:this.responseCache.delete(u);case 16:if(!(p=this.responsePromiseCache.get(u))){e.next=26;break}if(!(h-p.requestTimestamp<1e3*a)){e.next=25;break}return this.responsePromiseCache.delete(u),this.responsePromiseCache.set(u,p),e.abrupt("return",p.responsePromise);case 25:this.responsePromiseCache.delete(u);case 26:return f=n.call.apply(n,[t].concat(On(r))),this.responsePromiseCache.set(u,{requestTimestamp:h,responsePromise:f}),e.next=30,f;case 30:return d=e.sent,this.responseCache.set(u,{requestTimestamp:h,response:d}),this.responseCache.size>c&&(y=this.responseCache.keys().next().value)&&this.responseCache.delete(y),this.responsePromiseCache.size>c&&(v=this.responsePromiseCache.keys().next().value)&&this.responsePromiseCache.delete(v),e.abrupt("return",d);case 37:case"end":return e.stop()}}),e,this)}))),function(e,n,r,o){return t.apply(this,arguments)})}]),e}();function xn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function An(e){return Object.keys(Ln).filter((function(t){return void 0!==e[t]})).every((function(t){return n=e[t],!Array.isArray(n);var n}))}function Tn(e){var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xn(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);if(!Object.keys(Ln).filter((function(e){return Array.isArray(t[e])})).map((function(e){return t[e]=t[e].join(","),e})).length&&An(t))return t;if(!An(t))throw new Error("Failed to normalize arrayable params: ".concat(JSON.stringify(t)));return t}var Nn="/documents",jn=function(){function e(t,n,r){o(this,e),u(this,"requestWithCache",new Pn),this.collectionName=t,this.apiCall=n,this.configuration=r}var t;return c(e,[{key:"clearCache",value:function(){this.requestWithCache.clearCache()}},{key:"search",value:(t=P(A().mark((function e(t){var n,r,o,i,a,s,c,u,l=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(n=l.length>1&&void 0!==l[1]?l[1]:{}).cacheSearchResultsForSeconds,o=void 0===r?this.configuration.cacheSearchResultsForSeconds:r,i=n.abortSignal,a=void 0===i?null:i,s={},!0===this.configuration.useServerSideSearchCache&&(s.use_cache=!0),c=Tn(t),u=Object.assign({},s,c),e.abrupt("return",this.requestWithCache.perform(this.apiCall,this.apiCall.get,[this.endpointPath("search"),u,{abortSignal:a}],{cacheResponseForSeconds:o}));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"endpointPath",value:function(e){return"".concat(bn.RESOURCEPATH,"/").concat(this.collectionName).concat(Nn).concat(void 0===e?"":"/"+e)}}],[{key:"RESOURCEPATH",get:function(){return Nn}}]),e}();function _n(e,t,n){return t=f(t),p(e,Un()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function Un(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Un=function(){return!!e})()}var Ln={query_by:"query_by",query_by_weights:"query_by_weights",facet_by:"facet_by",group_by:"group_by",include_fields:"include_fields",exclude_fields:"exclude_fields",highlight_fields:"highlight_fields",highlight_full_fields:"highlight_full_fields",pinned_hits:"pinned_hits",hidden_hits:"hidden_hits",infix:"infix",override_tags:"override_tags",num_typos:"num_typos",prefix:"prefix",sort_by:"sort_by"},In="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,qn=function(e){function t(e,n,r){return o(this,t),_n(this,t,[e,n,r])}var n,r,i,a,s,u,l,h,p;return y(t,e),c(t,[{key:"create",value:(p=P(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.length>1&&void 0!==r[1]?r[1]:{},t){e.next=3;break}throw new Error("No document provided");case 3:return e.abrupt("return",this.apiCall.post(this.endpointPath(),t,n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"upsert",value:(h=P(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.length>1&&void 0!==r[1]?r[1]:{},t){e.next=3;break}throw new Error("No document provided");case 3:return e.abrupt("return",this.apiCall.post(this.endpointPath(),t,Object.assign({},n,{action:"upsert"})));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"update",value:(l=P(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.length>1&&void 0!==r[1]?r[1]:{},t){e.next=3;break}throw new Error("No document provided");case 3:if(null==n.filter_by){e.next=7;break}return e.abrupt("return",this.apiCall.patch(this.endpointPath(),t,Object.assign({},n)));case 7:return e.abrupt("return",this.apiCall.post(this.endpointPath(),t,Object.assign({},n,{action:"update"})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"delete",value:(u=P(A().mark((function e(){var t,n=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",this.apiCall.delete(this.endpointPath(),t));case 2:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"createMany",value:(s=P(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},this.configuration.logger.warn("createMany is deprecated and will be removed in a future version. Use import instead, which now takes both an array of documents or a JSONL string of documents"),e.abrupt("return",this.import(t,n));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"import",value:(a=P(A().mark((function e(t){var n,r,o,i,a,s=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:{},!Array.isArray(t)){e.next=13;break}e.prev=2,r=t.map((function(e){return JSON.stringify(e)})).join("\n"),e.next=11;break;case 6:if(e.prev=6,e.t0=e.catch(2),!(e.t0 instanceof RangeError&&e.t0.message.includes("Too many properties to enumerate"))){e.next=10;break}throw new Error("".concat(e.t0,"\n It looks like you have reached a Node.js limit that restricts the number of keys in an Object: https://stackoverflow.com/questions/9282869/are-there-limits-to-the-number-of-properties-in-a-javascript-object\n\n Please try reducing the number of keys in your document, or using CURL to import your data.\n "));case 10:throw new Error(e.t0);case 11:e.next=14;break;case 13:r=t;case 14:return e.next=16,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:n,bodyParameters:r,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0,enableKeepAlive:!!In});case 16:if(o=e.sent,!Array.isArray(t)){e.next=27;break}if(i=o.split("\n").map((function(e){return JSON.parse(e)})),!((a=i.filter((function(e){return!1===e.success}))).length>0)){e.next=24;break}throw new kn("".concat(i.length-a.length," documents imported successfully, ").concat(a.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),i);case 24:return e.abrupt("return",i);case 25:e.next=28;break;case 27:return e.abrupt("return",o);case 28:case"end":return e.stop()}}),e,this,[[2,6]])}))),function(e){return a.apply(this,arguments)})},{key:"importStream",value:(i=P(A().mark((function e(t){var n,r,o,i,a=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:n,bodyParameters:t,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0,enableKeepAlive:!!In});case 3:if(r=e.sent,o=r.split("\n").map((function(e){return JSON.parse(e)})),!((i=o.filter((function(e){return!1===e.success}))).length>0)){e.next=10;break}throw new kn("".concat(o.length-i.length," documents imported successfully, ").concat(i.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),o);case 10:return e.abrupt("return",o);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"export",value:(r=P(A().mark((function e(){var t,n=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",this.apiCall.get(this.endpointPath("export"),t));case 2:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"exportStream",value:(n=P(A().mark((function e(){var t,n=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",this.apiCall.get(this.endpointPath("export"),t,{responseType:"stream"}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})}]),t}(jn),Fn=function(){function e(t,n){o(this,e),this.collectionName=t,this.apiCall=n}var t,n;return c(e,[{key:"upsert",value:(n=P(A().mark((function e(t,n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(t),n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(bn.RESOURCEPATH,"/").concat(this.collectionName).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/overrides"}}]),e}(),Dn=function(){function e(t,n,r){o(this,e),this.collectionName=t,this.overrideId=n,this.apiCall=r}var t,n;return c(e,[{key:"retrieve",value:(n=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(bn.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(Fn.RESOURCEPATH,"/").concat(encodeURIComponent(this.overrideId))}}]),e}(),Bn=function(){function e(t,n){o(this,e),this.collectionName=t,this.apiCall=n}var t,n;return c(e,[{key:"upsert",value:(n=P(A().mark((function e(t,n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(t),n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(bn.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/synonyms"}}]),e}(),Hn=function(){function e(t,n,r){o(this,e),this.collectionName=t,this.synonymId=n,this.apiCall=r}var t,n;return c(e,[{key:"retrieve",value:(n=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(bn.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(Bn.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymId))}}]),e}(),Mn=function(){function e(t,n,r){o(this,e),this.collectionName=t,this.documentId=n,this.apiCall=r}var t,n,r;return c(e,[{key:"retrieve",value:(r=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"delete",value:(n=P(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"update",value:(t=P(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},e.abrupt("return",this.apiCall.patch(this.endpointPath(),t,n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(bn.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(qn.RESOURCEPATH,"/").concat(encodeURIComponent(this.documentId))}}]),e}(),Kn=function(){function e(t,n,r){o(this,e),u(this,"individualDocuments",{}),u(this,"individualOverrides",{}),u(this,"individualSynonyms",{}),this.name=t,this.apiCall=n,this.configuration=r,this.name=t,this.apiCall=n,this.configuration=r,this._documents=new qn(this.name,this.apiCall,this.configuration),this._overrides=new Fn(this.name,this.apiCall),this._synonyms=new Bn(this.name,this.apiCall)}var t,n,r,i;return c(e,[{key:"retrieve",value:(i=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"update",value:(r=P(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.patch(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"delete",value:(n=P(A().mark((function e(){var t,n=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.abrupt("return",this.apiCall.delete(this.endpointPath(),t));case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"exists",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.retrieve();case 3:return e.abrupt("return",!0);case 6:if(e.prev=6,e.t0=e.catch(0),!(e.t0 instanceof en)){e.next=10;break}return e.abrupt("return",!1);case 10:throw e.t0;case 11:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return t.apply(this,arguments)})},{key:"documents",value:function(e){return e?(void 0===this.individualDocuments[e]&&(this.individualDocuments[e]=new Mn(this.name,e,this.apiCall)),this.individualDocuments[e]):this._documents}},{key:"overrides",value:function(e){return void 0===e?this._overrides:(void 0===this.individualOverrides[e]&&(this.individualOverrides[e]=new Dn(this.name,e,this.apiCall)),this.individualOverrides[e])}},{key:"synonyms",value:function(e){return void 0===e?this._synonyms:(void 0===this.individualSynonyms[e]&&(this.individualSynonyms[e]=new Hn(this.name,e,this.apiCall)),this.individualSynonyms[e])}},{key:"endpointPath",value:function(){return"".concat(bn.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))}}]),e}(),zn="/aliases",Jn=function(){function e(t){o(this,e),this.apiCall=t}var t,n;return c(e,[{key:"upsert",value:(n=P(A().mark((function e(t,n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(t),n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(zn));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(e.RESOURCEPATH,"/").concat(encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return zn}}]),e}(),Wn=function(){function e(t,n){o(this,e),this.name=t,this.apiCall=n}var t,n;return c(e,[{key:"retrieve",value:(n=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Jn.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))}}]),e}(),Gn=n(612),Vn="/keys",Qn=function(){function e(t){o(this,e),this.apiCall=t,this.apiCall=t}var t,n;return c(e,[{key:"create",value:(n=P(A().mark((function t(n){return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.apiCall.post(e.RESOURCEPATH,n));case 1:case"end":return t.stop()}}),t,this)}))),function(e){return n.apply(this,arguments)})},{key:"retrieve",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(Vn));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"generateScopedSearchKey",value:function(e,t){var n=Tn(t),r=JSON.stringify(n),o=Buffer.from((0,Gn.createHmac)("sha256",e).update(r).digest("base64")),i=e.substr(0,4),a="".concat(o).concat(i).concat(r);return Buffer.from(a).toString("base64")}}],[{key:"RESOURCEPATH",get:function(){return Vn}}]),e}(),$n=function(){function e(t,n){o(this,e),this.id=t,this.apiCall=n}var t,n;return c(e,[{key:"retrieve",value:(n=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(Qn.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))}}]),e}(),Xn=function(){function e(t){o(this,e),this.apiCall=t}var t;return c(e,[{key:"retrieve",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get("/debug"));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),Yn=function(){function e(t){o(this,e),this.apiCall=t}var t;return c(e,[{key:"retrieve",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get("/metrics.json"));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),Zn=function(){function e(t){o(this,e),this.apiCall=t}var t;return c(e,[{key:"retrieve",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get("/stats.json"));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),er=function(){function e(t){o(this,e),this.apiCall=t}var t;return c(e,[{key:"retrieve",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get("/health"));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),tr=function(){function e(t){o(this,e),this.apiCall=t}var t;return c(e,[{key:"perform",value:(t=P(A().mark((function e(t){var n,r=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},e.abrupt("return",this.apiCall.post("".concat("/operations","/").concat(t),{},n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();function nr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nr(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var or=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o(this,e),this.apiCall=t,this.configuration=n,this.useTextContentType=r,this.requestWithCache=new Pn}var t;return c(e,[{key:"clearCache",value:function(){this.requestWithCache.clearCache()}},{key:"perform",value:(t=P(A().mark((function e(t){var n,r,o,i,a,s,c,u,l=arguments;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>1&&void 0!==l[1]?l[1]:{},r=(l.length>2&&void 0!==l[2]?l[2]:{}).cacheSearchResultsForSeconds,o=void 0===r?this.configuration.cacheSearchResultsForSeconds:r,i={},this.useTextContentType&&(i["content-type"]="text/plain"),a={},!0===this.configuration.useServerSideSearchCache&&(a.use_cache=!0),s=rr(rr({},n),a),c={searches:t.searches.map(Tn)},u=Tn(s),e.abrupt("return",this.requestWithCache.perform(this.apiCall,this.apiCall.post,["/multi_search",c,u,i],{cacheResponseForSeconds:o}));case 10:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),ir=function(){function e(t){o(this,e),this.apiCall=t}var t,n;return c(e,[{key:"upsert",value:(n=P(A().mark((function e(t,n){var r,o;return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("object"!==i(n.value)||!("searches"in n.value)){e.next=3;break}return r=n.value.searches.map((function(e){return Tn(e)})),e.abrupt("return",this.apiCall.put(this.endpointPath(t),{value:{searches:r}}));case 3:return o=Tn(n.value),e.abrupt("return",this.apiCall.put(this.endpointPath(t),{value:o}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/presets"}}]),e}(),ar=function(){function e(t,n){o(this,e),this.presetId=t,this.apiCall=n}var t,n;return c(e,[{key:"retrieve",value:(n=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(ir.RESOURCEPATH,"/").concat(encodeURIComponent(this.presetId))}}]),e}(),sr=function(){function e(t){o(this,e),this.apiCall=t,this.apiCall=t}var t,n;return c(e,[{key:"upsert",value:(n=P(A().mark((function e(t,n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(t),n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/analytics/rules"}}]),e}(),cr=function(){function e(t,n){o(this,e),this.name=t,this.apiCall=n}var t,n;return c(e,[{key:"retrieve",value:(n=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(sr.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))}}]),e}(),ur=function(){function e(t){o(this,e),this.apiCall=t,this.apiCall=t}var t;return c(e,[{key:"create",value:(t=P(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.post(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/analytics/events"}}]),e}(),lr=function(){function e(t){o(this,e),u(this,"individualAnalyticsRules",{}),this.apiCall=t,this.apiCall=t,this._analyticsRules=new sr(this.apiCall),this._analyticsEvents=new ur(this.apiCall)}return c(e,[{key:"rules",value:function(e){return void 0===e?this._analyticsRules:(void 0===this.individualAnalyticsRules[e]&&(this.individualAnalyticsRules[e]=new cr(e,this.apiCall)),this.individualAnalyticsRules[e])}},{key:"events",value:function(){return this._analyticsEvents}}],[{key:"RESOURCEPATH",get:function(){return"/analytics"}}]),e}(),hr=function(){function e(t){o(this,e),this.apiCall=t}var t,n;return c(e,[{key:"upsert",value:(n=P(A().mark((function e(t,n){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(t),n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"retrieve",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/stopwords"}}]),e}(),pr=function(){function e(t,n){o(this,e),this.stopwordId=t,this.apiCall=n}var t,n;return c(e,[{key:"retrieve",value:(n=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(hr.RESOURCEPATH,"/").concat(encodeURIComponent(this.stopwordId))}}]),e}(),fr=function(){function e(t){o(this,e),this.apiCall=t,this.apiCall=t}var t,n;return c(e,[{key:"create",value:(n=P(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.post(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"retrieve",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(t){return"".concat(e.RESOURCEPATH).concat(void 0===t?"":"/"+encodeURIComponent(t))}}],[{key:"RESOURCEPATH",get:function(){return"/conversations/models"}}]),e}(),dr=function(){function e(t,n){o(this,e),this.id=t,this.apiCall=n}var t,n,r;return c(e,[{key:"update",value:(r=P(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"retrieve",value:(n=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(fr.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))}}]),e}(),yr="/conversations",vr=function(){function e(t){o(this,e),u(this,"individualConversationModels",{}),this.apiCall=t,this.apiCall=t,this._conversationsModels=new fr(this.apiCall)}var t;return c(e,[{key:"retrieve",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(yr));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"models",value:function(e){return void 0===e?this._conversationsModels:(void 0===this.individualConversationModels[e]&&(this.individualConversationModels[e]=new dr(e,this.apiCall)),this.individualConversationModels[e])}}],[{key:"RESOURCEPATH",get:function(){return yr}}]),e}(),mr=function(){function e(t,n){o(this,e),this.id=t,this.apiCall=n}var t,n,r;return c(e,[{key:"retrieve",value:(r=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.get(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"update",value:(n=P(A().mark((function e(t){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.put(this.endpointPath(),t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"delete",value:(t=P(A().mark((function e(){return A().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiCall.delete(this.endpointPath()));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"endpointPath",value:function(){return"".concat(vr.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))}}]),e}(),gr=function(){function e(t){var n;o(this,e),t.sendApiKeyAsQueryParam=null!==(n=t.sendApiKeyAsQueryParam)&&void 0!==n&&n,this.configuration=new S(t),this.apiCall=new gn(this.configuration),this.debug=new Xn(this.apiCall),this.metrics=new Yn(this.apiCall),this.stats=new Zn(this.apiCall),this.health=new er(this.apiCall),this.operations=new tr(this.apiCall),this.multiSearch=new or(this.apiCall,this.configuration),this._collections=new bn(this.apiCall),this.individualCollections={},this._aliases=new Jn(this.apiCall),this.individualAliases={},this._keys=new Qn(this.apiCall),this.individualKeys={},this._presets=new ir(this.apiCall),this.individualPresets={},this._stopwords=new hr(this.apiCall),this.individualStopwords={},this.analytics=new lr(this.apiCall),this._conversations=new vr(this.apiCall),this.individualConversations={}}return c(e,[{key:"collections",value:function(e){return void 0===e?this._collections:(void 0===this.individualCollections[e]&&(this.individualCollections[e]=new Kn(e,this.apiCall,this.configuration)),this.individualCollections[e])}},{key:"aliases",value:function(e){return void 0===e?this._aliases:(void 0===this.individualAliases[e]&&(this.individualAliases[e]=new Wn(e,this.apiCall)),this.individualAliases[e])}},{key:"keys",value:function(e){return void 0===e?this._keys:(void 0===this.individualKeys[e]&&(this.individualKeys[e]=new $n(e,this.apiCall)),this.individualKeys[e])}},{key:"presets",value:function(e){return void 0===e?this._presets:(void 0===this.individualPresets[e]&&(this.individualPresets[e]=new ar(e,this.apiCall)),this.individualPresets[e])}},{key:"stopwords",value:function(e){return void 0===e?this._stopwords:(void 0===this.individualStopwords[e]&&(this.individualStopwords[e]=new pr(e,this.apiCall)),this.individualStopwords[e])}},{key:"conversations",value:function(e){return void 0===e?this._conversations:(void 0===this.individualConversations[e]&&(this.individualConversations[e]=new mr(e,this.apiCall)),this.individualConversations[e])}}]),e}();var wr=function(){function e(t,n,r){o(this,e),this.name=t,this.apiCall=n,this.configuration=r,this._documents=new jn(this.name,this.apiCall,this.configuration)}return c(e,[{key:"documents",value:function(){return this._documents}}]),e}(),br=function(){function e(t){var n;o(this,e),t.sendApiKeyAsQueryParam=null===(n=t.sendApiKeyAsQueryParam)||void 0===n||n,!0===t.sendApiKeyAsQueryParam&&(t.apiKey||"").length>2e3&&(console.warn("[typesense] API Key is longer than 2000 characters which is over the allowed limit, so disabling sending it as a query parameter."),t.sendApiKeyAsQueryParam=!1),this.configuration=new S(t),this.apiCall=new gn(this.configuration),this.multiSearch=new or(this.apiCall,this.configuration,!0),this.individualCollections={}}return c(e,[{key:"clearCache",value:function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEach((function(e){var t,n,r=(n=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,n)||Sn(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());r[0],r[1].documents().clearCache()}))}},{key:"collections",value:function(e){if(e)return void 0===this.individualCollections[e]&&(this.individualCollections[e]=new wr(e,this.apiCall,this.configuration)),this.individualCollections[e];throw new Error("Typesense.SearchClient only supports search operations, so the collectionName that needs to be searched must be specified. Use Typesense.Client if you need to access the collection object.")}}]),e}();const Cr={Client:gr,SearchClient:br,Errors:t}})(),Typesense=r})();
//# sourceMappingURL=typesense.min.js.map