/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/@fleetbase/sdk@1.2.13/dist/cjs/fleetbase.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";function t(t,e){this.v=t,this.k=e}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function n(t){if(Array.isArray(t))return t}function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i(e){var n={},r=!1;function i(n,i){return r=!0,i=new Promise((function(t){t(e[n](i))})),{done:!1,value:new t(i,1)}}return n["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},n.next=function(t){return r?(r=!1,t):i("next",t)},"function"==typeof e.throw&&(n.throw=function(t){if(r)throw r=!1,t;return i("throw",t)}),"function"==typeof e.return&&(n.return=function(t){return r?(r=!1,t):i("return",t)}),n}function o(t){var e,n,r,i=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&null!=(e=t[n]))return e.call(t);if(r&&null!=(e=t[r]))return new a(e.call(t));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function a(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then((function(t){return{value:t,done:e}}))}return a=function(t){this.s=t,this.n=t.next},a.prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var n=this.s.return;return void 0===n?Promise.resolve({value:t,done:!0}):e(n.apply(this.s,arguments))},throw:function(t){var n=this.s.return;return void 0===n?Promise.reject(t):e(n.apply(this.s,arguments))}},new a(t)}function s(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function u(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){s(o,r,i,a,u,"next",t)}function u(t){s(o,r,i,a,u,"throw",t)}a(void 0)}))}}function c(e){return new t(e,0)}function l(t,e,n){return e=y(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return r(t)}(t,m()?Reflect.construct(e,n||[],y(t).constructor):e.apply(t,n))}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e,n){if(m())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&O(i,n.prototype),i}function d(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,j(r.key),r)}}function p(t,e,n){return e&&d(t.prototype,e),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function v(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=_(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function g(t,e,n){return(e=j(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}function b(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&O(t,e)}function m(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(m=function(){return!!t})()}function w(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function k(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function A(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){g(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function E(){E=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),s=new P(r||[]);return i(a,"_invoke",{value:S(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f="suspendedStart",d="suspendedYield",p="executing",v="completed",g={};function y(){}function b(){}function m(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(L([])));x&&x!==n&&r.call(x,a)&&(w=x);var A=m.prototype=y.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function n(i,o,a,s){var u=h(t[i],t,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function S(e,n,r){var i=f;return function(o,a){if(i===p)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=j(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===f)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var c=h(e,n,r);if("normal"===c.type){if(i=r.done?v:d,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=v,r.method="throw",r.arg=c.arg)}}}function j(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.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,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return b.prototype=m,i(A,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:b,configurable:!0}),b.displayName=c(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,c(t,u,"GeneratorFunction")),t.prototype=Object.create(A),t},e.awrap=function(t){return{__await:t}},O(R.prototype),c(R.prototype,s,(function(){return this})),e.AsyncIterator=R,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new R(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(A),c(A,u,"Generator"),c(A,a,(function(){return this})),c(A,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,P.prototype={constructor:P,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(_),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},O(t,e)}function R(t,e){return n(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||_(t,e)||k()}function S(t){return function(t){if(Array.isArray(t))return e(t)}(t)||w(t)||_(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function _(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}function P(t){return function(){return new L(t.apply(this,arguments))}}function L(e){var n,r;function i(n,r){try{var a=e[n](r),s=a.value,u=s instanceof t;Promise.resolve(u?s.v:s).then((function(t){if(u){var r="return"===n?"return":"next";if(!s.k||t.done)return i(r,t);t=e[r](t).value}o(a.done?"return":"normal",t)}),(function(t){i("throw",t)}))}catch(t){o("throw",t)}}function o(t,e){switch(t){case"return":n.resolve({value:e,done:!0});break;case"throw":n.reject(e);break;default:n.resolve({value:e,done:!1})}(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(t,e){return new Promise((function(o,a){var s={key:t,arg:e,resolve:o,reject:a,next:null};r?r=r.next=s:(n=r=s,i(t,e))}))},"function"!=typeof e.return&&(this.return=void 0)}function C(t){var e="function"==typeof Map?new Map:void 0;return C=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return f(t,arguments,y(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),O(n,t)},C(t)}Object.defineProperty(exports,"__esModule",{value:!0}),L.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},L.prototype.next=function(t){return this._invoke("next",t)},L.prototype.throw=function(t){return this._invoke("throw",t)},L.prototype.return=function(t){return this._invoke("return",t)};var N=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];h(this,t),g(this,"uncountableWords",["equipment","information","rice","money","species","series","fish","sheep","moose","deer","news"]),g(this,"pluralRules",[[new RegExp("(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hive)$","gi"),"$1s"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]]),g(this,"singularRules",[[new RegExp("(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hive)s$","gi"),"$1"],[new RegExp("(tive)s$","gi"),"$1"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("s$","gi"),""]]),g(this,"nonTitlecasedWords",["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"]),g(this,"idSuffix",new RegExp("(_ids|_id)$","g")),g(this,"underbar",new RegExp("_","g")),g(this,"spaceOrUnderbar",new RegExp("[ _]","g")),g(this,"uppercase",new RegExp("([A-Z])","g")),g(this,"underbarPrefix",new RegExp("^_")),this.str=e,this.chain=n}return p(t,[{key:"get",value:function(){return this.str}},{key:"applyRules",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i<e.length;i++)if(t.match(e[i][0])){t=t.replace(e[i][0],e[i][1]);break}return this.str=t,!0===this.chain?this:t}},{key:"pluralize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:"singularize",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:"camelize",value:function(t,e){for(var n=(t=t||this.str).split("/"),r=0;r<n.length;r++){for(var i=n[r].split("_"),o=e&&r+1===n.length?1:0;o<i.length;o++)i[o]=i[o].charAt(0).toUpperCase()+i[o].substring(1);n[r]=i.join("")}if(t=n.join("::"),!0===e){var a=t.charAt(0).toLowerCase(),s=t.slice(1);t=a+s}return this.str=t,!0===this.chain?this:t}},{key:"underscore",value:function(t){for(var e=(t=t||this.str).split("::"),n=0;n<e.length;n++)e[n]=e[n].replace(this.uppercase,"_$1"),e[n]=e[n].replace(this.underbarPrefix,"");return t=e.join("/").toLowerCase(),this.str=t,!0===this.chain?this:t}},{key:"humanize",value:function(t,e){return t=(t=(t=(t=t||this.str).toLowerCase()).replace(this.idSuffix,"")).replace(this.underbar," "),e||(t=this.capitalize(t)),this.str=t,!0===this.chain?this:t}},{key:"capitalize",value:function(t){return t=(t=(t=t||this.str).toLowerCase()).substring(0,1).toUpperCase()+t.substring(1),this.str=t,!0===this.chain?this:t}},{key:"dasherize",value:function(t){return t=(t=(t=t||this.str).replace(this.spaceOrUnderbar,"-")).toLowerCase(),this.str=t,!0===this.chain?this:t}},{key:"normify",value:function(t,e){t=t||this.str,!0===e?(t=this.camelize(t),t=this.underscore(t)):t=t.toLowerCase();for(var n=(t=t.replace(this.underbar," ")).split(" "),r=0;r<n.length;r++){for(var i=n[r].split("-"),o=0;o<i.length;o++)this.nonTitlecasedWords.indexOf(i[o].toLowerCase())<0&&(i[o]=this.capitalize(i[o]));n[r]=i.join("-")}return t=(t=n.join(" ")).substring(0,1).toUpperCase()+t.substring(1),this.str=t,!0===this.chain?this:t}},{key:"demodulize",value:function(t){var e=(t=t||this.str).split("::");return t=e[e.length-1],this.str=t,!0===this.chain?this:t}},{key:"tableize",value:function(t){t=t||this.str;var e=this.chain;return this.chain=!1,t=this.pluralize(this.underscore(t)),this.chain=e,this.str=t,!0===this.chain?this:t}},{key:"classify",value:function(t){t=t||this.str,t=(t="".concat(t).trim()).replace(/[\s\-_]+/g,"_");var e=this.chain;return this.chain=!1,t=this.singularize(t),t=this.camelize(t,!1),this.chain=e,this.str=t,this.chain?this:t}},{key:"foreignKey",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?"":"_")+"id",this.str=t,!0===this.chain?this:t}},{key:"ordinalize",value:function(t){for(var e=(t=t||this.str).split(" "),n=0;n<e.length;n++){var r=parseInt(e[n]);if(isNaN(r)){var i=e[n].substring(e[n].length-2),o=e[n].substring(e[n].length-1),a="th";"11"!=i&&"12"!=i&&"13"!=i&&("1"===o?a="st":"2"===o?a="nd":"3"===o&&(a="rd")),e[n]+=a}}return t=e.join(" "),this.str=t,!0===this.chain?this:t}}],[{key:"invoke",value:function(){var e=Object.values(arguments),n=new t(null,!1),r=arguments[0];return e.shift(),"function"==typeof n[r]?n[r].apply(n,e):null}}])}(),F=function(){var t=["pluralize"].concat(Array.prototype.slice.call(arguments));return N.invoke.apply(N,S(t))},D=function(){var t=["singularize"].concat(Array.prototype.slice.call(arguments));return N.invoke.apply(N,S(t))},$=function(){var t=["classify"].concat(Array.prototype.slice.call(arguments));return N.invoke.apply(N,S(t))},U={resources:{},adapters:{},storse:{},actions:{}};function z(t,e,n){var r=F(t);U[r]||(U[r]={}),U[r][e]=n}function B(t,e){var n=F(t);if(!U[n])throw new Error("Unknown type: ".concat(D(t)));if(!U[n][e])throw new Error("No ".concat(D(t)," named '").concat(e,"' registered."));for(var r=U[n][e],i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];return f(r,o)}function q(){return B.apply(void 0,["store","Store"].concat(Array.prototype.slice.call(arguments)))}var I=function(){return p((function t(){return h(this,t),this.lookup.apply(this,arguments)}),[{key:"lookup",value:function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return B.apply(void 0,[t,e].concat(r))}}])}();function M(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return B.apply(void 0,[t,$(e)].concat(r))}function H(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return M.apply(void 0,["resource",$(t)].concat(n))}var J=Array.isArray,W=6e4;function G(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(J(t))if(r.length<=W)t.splice.apply(t,[e,n].concat(S(r)));else{t.splice(e,n);for(var i=0;i<r.length;i+=W){var o=r.slice(i,i+W);t.splice.apply(t,[e+i,0].concat(S(o)))}}else V(t)&&t.replace(e,n,r)}function K(t){return t}function V(t){return t instanceof nt}function X(t,e){return J(t)?t[e]:V(t)?t.objectAt(e):null}function Q(t,e){return 2===arguments.length?function(n){return e===n[t]}:function(e){return Boolean(e[t])}}function Y(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i<r;i++){if(e(X(t,i),i,t))return i}return-1}function Z(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;return n<0&&(n+=i),Y(t,r&&e!=e?function(t){return t!=t}:function(t){return t===e},n)}function tt(t,e,n){return G(t,e,0,[n]),n}function et(){return f(nt,Array.prototype.slice.call(arguments))}var nt=function(){function t(){return h(this,t),r(J(arguments[0])?l(this,t,S(arguments[0])):l(this,t,arguments))}return b(t,C(Array)),p(t,[{key:"notEmpty",get:function(){return this.length>0}},{key:"empty",get:function(){return 0===this.length}},{key:"first",get:function(){return X(this,0)}},{key:"last",get:function(){return X(this,this.length-1)}},{key:"replace",value:function(t,e){return G(this,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]),this}},{key:"objectsAt",value:function(t){var e=this;return t.map((function(t){return X(e,t)}))}},{key:"objectAt",value:function(t){return X(this,t)}},{key:"indexOf",value:function(t,e){return Z(this,t,e,!1)}},{key:"lastIndexOf",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(X(this,r)===t)return r;return-1}},{key:"includes",value:function(t,e){return-1!==Z(this,t,e,!0)}},{key:"findBy",value:function(){return t=this,e=Q.apply(void 0,arguments),-1===(r=Y(t,e.bind(n),0))?void 0:X(t,r);var t,e,n,r}},{key:"findIndexBy",value:function(){return Y(this,Q.apply(void 0,arguments))}},{key:"isEvery",value:function(){return t=this,e=Q.apply(void 0,arguments),r=e.bind(n),-1===Y(t,(function(t,e,n){return!r(t,e,n)}),0);var t,e,n,r}},{key:"isAny",value:function(){return t=this,e=Q.apply(void 0,arguments),-1!==Y(t,e.bind(n),0);var t,e,n}},{key:"invoke",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=[];return this.forEach((function(e){var r;return i.push(null===(r=e[t])||void 0===r?void 0:r.call.apply(r,[e].concat(n)))})),i}},{key:"toArray",value:function(){return this.map((function(t){return t}))}},{key:"compact",value:function(){return this.filter((function(t){return null!=t}))}},{key:"sortBy",value:function(){var t=arguments;return this.sort((function(e,n){var r,i=v(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=e[o],s=n[o],u=compare(a,s);if(u)return u}}catch(t){i.e(t)}finally{i.f()}return 0}))}},{key:"uniqBy",value:function(t){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K,n=[],r=new Set,i="function"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:"without",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:"clear",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:"insertAt",value:function(t,e){return tt(this,t,e),this}},{key:"replaceAt",value:function(t,e){return this.replace(t,1,[e])}},{key:"removeAt",value:function(t,e){return function(t,e){return G(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:"pushObject",value:function(t){return this.insertAt(this.length,t)}},{key:"pushObjects",value:function(t){return this.replace(this.length,0,t),this}},{key:"popObject",value:function(){var t=this.length;if(0===t)return null;var e=X(this,t-1);return this.removeAt(t-1,1),e}},{key:"shiftObject",value:function(){if(0===this.length)return null;var t=X(this,0);return this.removeAt(0),t}},{key:"unshiftObject",value:function(t){return tt(this,0,t)}},{key:"unshiftObjects",value:function(t){return this.replace(0,0,t),this}},{key:"reverseObjects",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:"setObjects",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:"removeObject",value:function(t){for(var e=this.length||0;--e>=0;){X(this,e)===t&&this.removeAt(e)}return this}},{key:"removeObjects",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:"addObject",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:"addObjects",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}])}();function rt(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=T(t);if("object"===n){var r=t.size;if("number"==typeof r)return!r}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var i=t.length;if("number"==typeof i)return!i}return!1}function it(){var t,e,n;return!("undefined"==typeof process||"object"!==T(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(e=e.name)||void 0===e?void 0:e.search(/node|io.js/))||"undefined"!=typeof window&&"ReactNative"!==(null===(n=window)||void 0===n||null===(n=n.navigator)||void 0===n?void 0:n.product))}function ot(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return it()?M("adapter","NodeAdapter",t):M("adapter","BrowserAdapter",t)}var at=function(){return p((function t(e){h(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}),[{key:"parse",value:function(){this.parseComponents(),this.parseProperties()}},{key:"parseComponents",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:"parseProperties",value:function(){var t,e={streetNumber:this.get("street_number"),streetName:this.get("route"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or(["locality","sublocality","sublocality_level_1","neighborhood","administrative_area_level_3","administrative_area_level_2"]),county:this.get("administrative_area_level_2"),stateShort:this.get("administrative_area_level_1",!0),stateLong:this.get("administrative_area_level_1"),countryShort:this.get("country",!0),country:this.get("country",!0),countryLong:this.get("country"),postalCode:this.get("postal_code")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(" "),e}},{key:"all",value:function(){return this.attributes}},{key:"or",value:function(){var t,e=v(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]);try{for(e.s();!(t=e.n()).done;){var n=t.value;if(J(n)){var r=n[0],i=n[1];if(this.has(r))return this.get(r,i)}else if(this.has(n))return this.get(n)}}catch(t){e.e(t)}finally{e.f()}return null}},{key:"has",value:function(t){return t in this.components}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=A(A({},this.attributes),t),this}},{key:"setAttribute",value:function(t,e){return this.attributes[t]=e,this}},{key:"getAttribute",value:function(t){return this.attributes[t]||null}}])}(),st=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;h(this,t),this.type="Point",this.coordinates=[n,e]}return p(t,[{key:"latitude",get:function(){return this.coordinates[1]}},{key:"longitude",get:function(){return this.coordinates[0]}},{key:"lat",value:function(){return this.latitude}},{key:"lng",value:function(){return this.longitude}},{key:"serialize",value:function(){return{type:"Point",coorindates:[this.lat(),this.lng()]}}},{key:"toJson",value:function(){return this.serialize()}},{key:"toString",value:function(){return"(".concat(this.latitude,", ").concat(this.longitude,")")}}],[{key:"fromGeoJson",value:function(e){var n=R(e.coordinates,2),r=n[0];return new t(n[1],r)}}])}();function ut(t,e){var n=t();return Array.isArray(n)||"object"===T(n)?ct(n,e):null}function ct(t,e){var n,r=t,i=T(t),o="object"===i,a="function"===i,s=Array.isArray(t),u="string"===T(e)&&e.includes(".")?e.split("."):[e];if(s||o){for(var c=0;c<u.length;c++){if(r&&void 0===r[u[c]])return null;if(r){if(r=r[u[c]],"object"===T(n=r)&&!rt(null==n?void 0:n.attributes)&&"object"===T(null==n?void 0:n.attributes)&&void 0!==u[c+1]){var l=u.slice(c+1).join(".");return ct(r.attributes,l)}if("function"==typeof r)return ut(r,u.slice(c+1).join("."))}}return r}if(a)return ut(t,e)}function lt(t,e,n){var r=t,i="object"===T(t),o=Array.isArray(t),a="string"===T(e)&&e.includes(".")?e.split("."):[e],s=a.length;if(o||i){for(var u=0;u<s-1;u++)r[a[u]]||(r[a[u]]={}),r=r[a[u]];r[a[s-1]]=n}return n}function ht(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=J(e)?e:[e],!J(e))return e instanceof ft&&e.extend(t),t;var n,r=v(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;t.extendActions(i)}}catch(t){r.e(t)}finally{r.f()}}var ft=function(){return p((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;h(this,t),this.actions=e,this.bind=n}),[{key:"extend",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||this.bind;if(!t)return this;if(null!=this&&this.actions&&"object"===T(this.actions))for(var e in this.actions){var n=this.actions[e];"function"==typeof n?lt(t,e,n.bind(t)):lt(t,e,n)}return this}}])}();function dt(t){return t instanceof pt}var pt=function(){return p((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};h(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||"v1",this.setAdapter(n)}),[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=q(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"id",get:function(){return this.getAttribute("id")}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags(["isLoading","isSaving"]),this.store.create(n).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags(["isLoading","isSaving"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"destroy",value:function(){var t=this;return this.setFlags(["isLoading","isDestroying"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags(["isLoading","isDestroying"],!1),e}))}},{key:"reload",value:function(){var t=this;return this.setFlags(["isLoading","isReloading"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:"setFlags",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=["isLoading","isSaving","isReloading","isDestroying"],r=0;r<t.length;r++){var i=t[r];if("string"!=typeof i||!n.includes(i))throw new Error("".concat(i," is not a valid flag!"));this[i]=e}return this}},{key:"reset",value:function(){return this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isReloading=!1,this}},{key:"empty",value:function(){return this.reset(),this.attribues={},this}},{key:"save",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return rt(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:"saveDirty",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n<t.length;n++){var r=t[n];e[r]=this.getAttribute(r)}return this.update(e)}},{key:"meta",get:function(){return this.getAttribute("meta",{})}},{key:"createdAt",get:function(){return this.isAttributeFilled("created_at")?new Date(this.getAttribute("created_at")):null}},{key:"updatedAt",get:function(){return this.isAttributeFilled("updated_at")?new Date(this.getAttribute("updated_at")):null}},{key:"isLoaded",get:function(){return this.hasAttributes(["created_at","id"])}},{key:"isEmpty",get:function(){return 0===Object.values(null==this?void 0:this.attributes).length}},{key:"isNew",get:function(){return!this.id}},{key:"isSaved",get:function(){return!this.isNew&&this.isLoaded}},{key:"isDeleted",get:function(){return this.hasAttributes(["deleted","time"])}},{key:"eachAttribute",value:function(t){var e,n=this;return"function"!=typeof t||Object.keys(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{}).forEach((function(e){var r=n.getAttribute(e);t.call(n,r,e)})),this}},{key:"changes",value:function(){return this.changes}},{key:"getDirtyAttributes",value:function(){return this.dirtyAttributes}},{key:"isDirty",value:function(t){return t in this.dirtyAttributes}},{key:"hasDirtyAttributes",value:function(){var t;return Object.keys(null!==(t=null==this?void 0:this.dirtyAttributes)&&void 0!==t?t:{}).length>0}},{key:"mutate",value:function(t,e){this.attributes[t]=e}},{key:"setAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&"object"===T(t))return this.setAttributes(t);var r=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return lt(this.attributes,t,n),lt(this.dirtyAttributes,t,r),J(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:r,value:n,changedAt:new Date}),this}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:"getAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=ct(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:"hasAttribute",value:function(t){if(J(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:"hasAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:"isAttributeFilled",value:function(t){var e=this;return J(t)?this.hasAttribute(t)&&t.every((function(t){return!rt(e.getAttribute(t))})):this.hasAttribute(t)&&!rt(this.getAttribute(t))}},{key:"getAttributes",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if("string"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!J(t))throw new Error("No attribute properties provided!");var n,r=v(t);try{for(r.s();!(n=r.n()).done;){var i,o,a=n.value;if("string"==typeof a){var s=this.getAttribute(a);"object"!==T(null===(i=s)||void 0===i?void 0:i.attributes)||J(null===(o=s)||void 0===o?void 0:o.attributes)||(s=s.attributes),e[a]=s}}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"serialize",value:function(){return this.getAttributes()}},{key:"mergeAttributes",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=A(A({},n),e),this.attributes}},{key:"syncAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}])}();z("resource","Resource",pt);var vt=function(){return p((function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};h(this,t),this.resource=e,this.adapter=n||ot(),this.namespace=F(e),this.storage=et(),this.options=r,this.extendActions(r.actions)}),[{key:"extendActions",value:function(){return ht(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:[])}},{key:"deposit",value:function(t){return t}},{key:"serialize",value:function(t){return M("resource",$(this.resource),t,this.adapter)}},{key:"afterFetch",value:function(t){return function(t,e){if("function"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),J(e)){var n,r=[],i=v(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r.push(t.afterFetch(o))}}catch(t){i.e(t)}finally{i.f()}return et.apply(void 0,r)}var a=t.serialize(e);return t.deposit(a)}(this,t)}},{key:"create",value:(a=u(E().mark((function t(){var e,n,r,i=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=4,this.adapter.post("".concat(this.namespace),e,n);case 4:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 6:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"update",value:(o=u(E().mark((function t(e){var n,r,i,o=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=o.length>2&&void 0!==o[2]?o[2]:{},t.next=4,this.adapter.put("".concat(this.namespace,"/").concat(e),n,r);case 4:return i=t.sent,t.abrupt("return",this.afterFetch(i));case 6:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"findRecord",value:(i=u(E().mark((function t(e){var n,r,i=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=3,this.adapter.get("".concat(this.namespace,"/").concat(e),{},n);case 3:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 5:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"findAll",value:(r=u(E().mark((function t(){var e,n,r=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.adapter.get("".concat(this.namespace),{},e);case 3:return n=t.sent,t.abrupt("return",this.afterFetch(n));case 5:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"query",value:(n=u(E().mark((function t(){var e,n,r,i=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=4,this.adapter.get("".concat(this.namespace),e,n);case 4:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"queryRecord",value:(e=u(E().mark((function t(){var e,n,r,i=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},(e=i.length>0&&void 0!==i[0]?i[0]:{}).single=!0,t.next=5,this.adapter.get("".concat(this.namespace),e,n);case 5:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"destroy",value:(t=u(E().mark((function t(e){var n,r,i,o=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=dt(e)?e.getAttribute("id"):e,t.next=4,this.adapter.delete("".concat(this.namespace,"/").concat(r),{},n);case 4:return i=t.sent,t.abrupt("return",this.afterFetch(i));case 6:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})}]);var t,e,n,r,i,o,a}();z("store","Store",vt);var gt=new ft({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/distance-and-time"),e,n)},getNextActivity:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/next-activity"),e,n)},dispatch:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/dispatch"),e,n).then(this.afterFetch.bind(this))},start:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/start"),e,n).then(this.afterFetch.bind(this))},updateActivity:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/update-activity"),e,n).then(this.afterFetch.bind(this))},setDestination:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return dt(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/set-destination/").concat(e),n,r).then(this.afterFetch.bind(this))},captureQrCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return dt(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/capture-qr").concat(e?"/"+e:""),n,r)},captureSignature:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return dt(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/capture-signature").concat(e?"/"+e:""),n,r)},complete:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/complete"),e,n).then(this.afterFetch.bind(this))},cancel:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/cancel"),e,n).then(this.afterFetch.bind(this))}}),yt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"order",A({actions:gt},r)])}return b(t,pt),p(t,[{key:"getDistanceAndTime",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.getDistanceAndTime(this.id,t,e)}},{key:"dispatch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.dispatch(this.id,t,e)}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.start(this.id,t,e)}},{key:"setDestination",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.setDestination(this.id,t,e,n)}},{key:"captureQrCode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.captureQrCode(this.id,t,e,n)}},{key:"captureSignature",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.captureSignature(this.id,t,e,n)}},{key:"getNextActivity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.getNextActivity(this.id,t,e)}},{key:"updateActivity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.updateActivity(this.id,t,e)}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.cancel(this.id,t,e)}},{key:"complete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.complete(this.id,t,e)}},{key:"isDispatched",get:function(){return null!==this.getAttribute("dispatched_at")}},{key:"isNotDispatched",get:function(){return null==this.getAttribute("dispatched_at")}},{key:"isStarted",get:function(){return null!==this.getAttribute("started_at")}},{key:"isNotStarted",get:function(){return null==this.getAttribute("started_at")}},{key:"isCompleted",get:function(){return"completed"==this.getAttribute("status")}},{key:"isCanceled",get:function(){return"canceled"==this.getAttribute("status")}},{key:"isEnroute",get:function(){return"driver_enroute"==this.getAttribute("status")||"enroute"===this.getAttribute("status")}},{key:"isInProgress",get:function(){return this.isStarted&&!this.isCanceled&&!this.isCompleted}},{key:"scheduledAt",get:function(){return this.isAttributeFilled("scheduled_at")?new Date(this.getAttribute("scheduled_at")):null}},{key:"startedAt",get:function(){return this.isAttributeFilled("started_at")?new Date(this.getAttribute("started_at")):null}},{key:"dispatchedAt",get:function(){return this.isAttributeFilled("dispatched_at")?new Date(this.getAttribute("dispatched_at")):null}},{key:"status",get:function(){return this.getAttribute("status")}}])}();z("resource","Order",yt);var bt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"payload",r])}return b(t,pt),p(t,[{key:"attach",value:function(t){}},{key:"entities",get:function(){var t=this;return et(this.entities.map((function(e){return H("Entity",e,t.adapter)})))}},{key:"dropoff",get:function(){return this.dropoff?H("Place",this.dropoff,this.adapter):null}},{key:"pickup",get:function(){return this.pickup?H("Place",this.pickup,this.adapter):null}},{key:"waypoints",get:function(){var t=this;return et(this.waypoints.map((function(e){return H("Waypoint",e,t.adapter)})))}}])}();z("resource","Payload",bt);var mt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"entity",r])}return b(t,pt),p(t)}();z("resource","Entity",mt);var wt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"place",r])}return b(t,pt),p(t,[{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new st))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new st))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"setOwner",value:function(t){return dt(t)&&this.setAttribute("owner",t.id),"string"==typeof t&&this.setAttribute("owner",t),this}}],[{key:"fromGoogleAddress",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=R(e.getAttribute("coordinates"),2),o=i[0],a=i[1];return new t({name:null,address:e.getAttribute("address"),location:new st(o,a),street1:e.getAttribute("address"),street2:null,city:e.getAttribute("city"),province:e.getAttribute("stateLong"),postal_code:e.getAttribute("postalCode"),neighborhood:e.get("neighborhood"),district:e.getAttribute("county"),building:e.get("building"),country:e.getAttribute("countryShort"),phone:null,security_access_code:null},n,r)}}])}();z("resource","Place",wt);var kt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"waypoint",r])}return b(t,wt),p(t)}();z("resource","Waypoint",kt);var xt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"tracking-status",r])}return b(t,pt),p(t)}();z("resource","TrackingStatus",xt);var At=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"vehicle",r])}return b(t,pt),p(t)}();z("resource","Vehicle",At);var Et=new ft({current:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("".concat(this.namespace,"/current"),t,e)}}),Ot=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"organization",A({actions:Et},r)])}return b(t,pt),p(t)}();z("resource","Organization",Ot);var Rt=function(t,e){return J(t)?t.map((function(t){return new Ot(t,e)})):new Ot(t,e)},St=new ft({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("drivers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("drivers/login",A({identity:t,password:e},n)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/verify-code",A({identity:t,code:e},n)).then(this.afterFetch.bind(this))},track:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/track"),e,n).then(this.afterFetch.bind(this))},listOrganizations:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("drivers/".concat(t,"/organizations"),n,r).then((function(t){return Rt(t,e.adapter)}))},switchOrganization:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/switch-organization"),n,r).then((function(t){return Rt(t,e.adapter)}))},currentOrganization:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("drivers/".concat(t,"/current-organization"),n,r).then((function(t){return Rt(t,e.adapter)}))},retrieve:function(t){return this.findRecord(t)},syncDevice:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/register-device"),e,n)}}),jt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"driver",A({actions:St},r)])}return b(t,pt),p(t,[{key:"token",get:function(){return this.getAttribute("token")}},{key:"isOnline",get:function(){return!0===this.getAttribute("online")}},{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new st))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new st))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"track",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.track(this.id,t,e)}},{key:"syncDevice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.syncDevice(this.id,t,e)}},{key:"listOrganizations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.listOrganizations(this.id,t,e)}},{key:"switchOrganization",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.switchOrganization(this.id,{next:t},e)}},{key:"currentOrganization",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.currentOrganization(this.id,t,e)}}])}();z("resource","Driver",jt);var Tt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"vendor",r])}return b(t,pt),p(t)}();z("resource","Vendor",Tt);var _t=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"contact",r])}return b(t,pt),p(t)}();z("resource","Contact",_t);var Pt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"zone",r])}return b(t,pt),p(t)}();z("resource","Zone",Pt);var Lt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"service-area",r])}return b(t,pt),p(t)}();z("resource","ServiceArea",Lt);var Ct=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"service-rate",r])}return b(t,pt),p(t)}();z("resource","ServiceRate",Ct);var Nt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"service-quote",r])}return b(t,pt),p(t,[{key:"fromPreliminary",value:function(){}},{key:"fromPayload",value:function(){}}])}();z("resource","ServiceQuote",Nt);var Ft=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"fleet",r])}return b(t,pt),p(t)}();z("resource","Fleet",Ft);var Dt=p((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h(this,t),this.version=e.version||"v1",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}}));z("adapter","Adapter",Dt);var $t=function(){function t(e){var n;return h(this,t),(n=l(this,t,[e])).setHeaders({Authorization:"Bearer ".concat(e.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;browser"}),n}return b(t,Dt),p(t,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=A(A({},this.headers),t),this}},{key:"parseJSON",value:function(t){return new Promise((function(e,n){t.json().then((function(n){e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error("Oops! Something went wrong when handling your request."))}))}))}},{key:"request",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(o,a){fetch(i.url||"".concat(e.host,"/").concat(e.namespace,"/").concat(t),A({method:n,mode:i.mode||"cors",headers:new Headers(A(A({},e.headers||{}),i.headers||{}))},r)).then(e.parseJSON).then((function(t){if(t.ok)return o(t.json);a(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){a(t)}))}))}},{key:"get",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=rt(e=n)||"string"==typeof e&&!1===/\S/.test(e)?"":new URLSearchParams(n).toString();return this.request("".concat(t).concat(i?"?".concat(i):""),"GET",{},r)}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"POST",{body:JSON.stringify(e)},n)}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PUT",{body:JSON.stringify(e)},n)}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,"DELETE",{},e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PATCH",{body:JSON.stringify(e)},n)}}])}();function Ut(t,e){return function(){return t.apply(e,arguments)}}z("adapter","BrowserAdapter",$t);var zt,Bt=Object.prototype.toString,qt=Object.getPrototypeOf,It=(zt=Object.create(null),function(t){var e=Bt.call(t);return zt[e]||(zt[e]=e.slice(8,-1).toLowerCase())}),Mt=function(t){return t=t.toLowerCase(),function(e){return It(e)===t}},Ht=function(t){return function(e){return T(e)===t}},Jt=Array.isArray,Wt=Ht("undefined");var Gt=Mt("ArrayBuffer");var Kt=Ht("string"),Vt=Ht("function"),Xt=Ht("number"),Qt=function(t){return null!==t&&"object"===T(t)},Yt=function(t){if("object"!==It(t))return!1;var e=qt(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},Zt=Mt("Date"),te=Mt("File"),ee=Mt("Blob"),ne=Mt("FileList"),re=Mt("URLSearchParams"),ie=R(["ReadableStream","Request","Response","Headers"].map(Mt),4),oe=ie[0],ae=ie[1],se=ie[2],ue=ie[3];function ce(t,e){var n,r,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,o=void 0!==i&&i;if(null!=t)if("object"!==T(t)&&(t=[t]),Jt(t))for(n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else{var a,s=o?Object.getOwnPropertyNames(t):Object.keys(t),u=s.length;for(n=0;n<u;n++)a=s[n],e.call(null,t[a],a,t)}}function le(t,e){e=e.toLowerCase();for(var n,r=Object.keys(t),i=r.length;i-- >0;)if(e===(n=r[i]).toLowerCase())return n;return null}var he="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,fe=function(t){return!Wt(t)&&t!==he};var de,pe=(de="undefined"!=typeof Uint8Array&&qt(Uint8Array),function(t){return de&&t instanceof de}),ve=Mt("HTMLFormElement"),ge=function(){var t=Object.prototype.hasOwnProperty;return function(e,n){return t.call(e,n)}}(),ye=Mt("RegExp"),be=function(t,e){var n=Object.getOwnPropertyDescriptors(t),r={};ce(n,(function(n,i){var o;!1!==(o=e(n,i,t))&&(r[i]=o||n)})),Object.defineProperties(t,r)},me="abcdefghijklmnopqrstuvwxyz",we="0123456789",ke={DIGIT:we,ALPHA:me,ALPHA_DIGIT:me+me.toUpperCase()+we};var xe,Ae,Ee,Oe,Re=Mt("AsyncFunction"),Se=(xe="function"==typeof setImmediate,Ae=Vt(he.postMessage),xe?setImmediate:Ae?(Ee="axios@".concat(Math.random()),Oe=[],he.addEventListener("message",(function(t){var e=t.source,n=t.data;e===he&&n===Ee&&Oe.length&&Oe.shift()()}),!1),function(t){Oe.push(t),he.postMessage(Ee,"*")}):function(t){return setTimeout(t)}),je="undefined"!=typeof queueMicrotask?queueMicrotask.bind(he):"undefined"!=typeof process&&process.nextTick||Se,Te={isArray:Jt,isArrayBuffer:Gt,isBuffer:function(t){return null!==t&&!Wt(t)&&null!==t.constructor&&!Wt(t.constructor)&&Vt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:function(t){var e;return t&&("function"==typeof FormData&&t instanceof FormData||Vt(t.append)&&("formdata"===(e=It(t))||"object"===e&&Vt(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&Gt(t.buffer)},isString:Kt,isNumber:Xt,isBoolean:function(t){return!0===t||!1===t},isObject:Qt,isPlainObject:Yt,isReadableStream:oe,isRequest:ae,isResponse:se,isHeaders:ue,isUndefined:Wt,isDate:Zt,isFile:te,isBlob:ee,isRegExp:ye,isFunction:Vt,isStream:function(t){return Qt(t)&&Vt(t.pipe)},isURLSearchParams:re,isTypedArray:pe,isFileList:ne,forEach:ce,merge:function t(){for(var e=(fe(this)&&this||{}).caseless,n={},r=function(r,i){var o=e&&le(n,i)||i;Yt(n[o])&&Yt(r)?n[o]=t(n[o],r):Yt(r)?n[o]=t({},r):Jt(r)?n[o]=r.slice():n[o]=r},i=0,o=arguments.length;i<o;i++)arguments[i]&&ce(arguments[i],r);return n},extend:function(t,e,n){return ce(e,(function(e,r){n&&Vt(e)?t[r]=Ut(e,n):t[r]=e}),{allOwnKeys:(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),t},trim:function(t){return t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,e,n,r){t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:function(t,e,n,r){var i,o,a,s={};if(e=e||{},null==t)return e;do{for(o=(i=Object.getOwnPropertyNames(t)).length;o-- >0;)a=i[o],r&&!r(a,t,e)||s[a]||(e[a]=t[a],s[a]=!0);t=!1!==n&&qt(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:It,kindOfTest:Mt,endsWith:function(t,e,n){t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;var r=t.indexOf(e,n);return-1!==r&&r===n},toArray:function(t){if(!t)return null;if(Jt(t))return t;var e=t.length;if(!Xt(e))return null;for(var n=new Array(e);e-- >0;)n[e]=t[e];return n},forEachEntry:function(t,e){for(var n,r=(t&&t[Symbol.iterator]).call(t);(n=r.next())&&!n.done;){var i=n.value;e.call(t,i[0],i[1])}},matchAll:function(t,e){for(var n,r=[];null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:ve,hasOwnProperty:ge,hasOwnProp:ge,reduceDescriptors:be,freezeMethods:function(t){be(t,(function(e,n){if(Vt(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;var r=t[n];Vt(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(t,e){var n={},r=function(t){t.forEach((function(t){n[t]=!0}))};return Jt(t)?r(t):r(String(t).split(e)),n},toCamelCase:function(t){return t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(t,e){return null!=t&&Number.isFinite(t=+t)?t:e},findKey:le,global:he,isContextDefined:fe,ALPHABET:ke,generateString:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ke.ALPHA_DIGIT,n="",r=e.length;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&Vt(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:function(t){var e=new Array(10),n=function(t,r){if(Qt(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;var i=Jt(t)?[]:{};return ce(t,(function(t,e){var o=n(t,r+1);!Wt(o)&&(i[e]=o)})),e[r]=void 0,i}}return t};return n(t,0)},isAsyncFn:Re,isThenable:function(t){return t&&(Qt(t)||Vt(t))&&Vt(t.then)&&Vt(t.catch)},setImmediate:Se,asap:je};function _e(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Te.inherits(_e,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:Te.toJSONObject(this.config),code:this.code,status:this.status}}});var Pe=_e.prototype,Le={};["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((function(t){Le[t]={value:t}})),Object.defineProperties(_e,Le),Object.defineProperty(Pe,"isAxiosError",{value:!0}),_e.from=function(t,e,n,r,i,o){var a=Object.create(Pe);return Te.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(function(t){return"isAxiosError"!==t})),_e.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,o&&Object.assign(a,o),a};function Ce(t){return Te.isPlainObject(t)||Te.isArray(t)}function Ne(t){return Te.endsWith(t,"[]")?t.slice(0,-2):t}function Fe(t,e,n){return t?t.concat(e).map((function(t,e){return t=Ne(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}var De=Te.toFlatObject(Te,{},null,(function(t){return/^is[A-Z]/.test(t)}));function $e(t,e,n){if(!Te.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;var r=(n=Te.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Te.isUndefined(e[t])}))).metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Te.isSpecCompliantForm(e);if(!Te.isFunction(i))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(Te.isDate(t))return t.toISOString();if(!s&&Te.isBlob(t))throw new _e("Blob is not supported. Use a Buffer instead.");return Te.isArrayBuffer(t)||Te.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,n,i){var s=t;if(t&&!i&&"object"===T(t))if(Te.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(Te.isArray(t)&&function(t){return Te.isArray(t)&&!t.some(Ce)}(t)||(Te.isFileList(t)||Te.endsWith(n,"[]"))&&(s=Te.toArray(t)))return n=Ne(n),s.forEach((function(t,r){!Te.isUndefined(t)&&null!==t&&e.append(!0===a?Fe([n],r,o):null===a?n:n+"[]",u(t))})),!1;return!!Ce(t)||(e.append(Fe(i,n,o),u(t)),!1)}var l=[],h=Object.assign(De,{defaultVisitor:c,convertValue:u,isVisitable:Ce});if(!Te.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!Te.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),Te.forEach(n,(function(n,o){!0===(!(Te.isUndefined(n)||null===n)&&i.call(e,n,Te.isString(o)?o.trim():o,r,h))&&t(n,r?r.concat(o):[o])})),l.pop()}}(t),e}function Ue(t){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function ze(t,e){this._pairs=[],t&&$e(t,this,e)}var Be=ze.prototype;function qe(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ie(t,e,n){if(!e)return t;var r=n&&n.encode||qe;Te.isFunction(n)&&(n={serialize:n});var i,o=n&&n.serialize;if(i=o?o(e,n):Te.isURLSearchParams(e)?e.toString():new ze(e,n).toString(r)){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}Be.append=function(t,e){this._pairs.push([t,e])},Be.toString=function(t){var e=t?function(e){return t.call(this,e,Ue)}:Ue;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var Me=function(){return p((function t(){h(this,t),this.handlers=[]}),[{key:"use",value:function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(t){this.handlers[t]&&(this.handlers[t]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(t){Te.forEach(this.handlers,(function(e){null!==e&&t(e)}))}}])}(),He={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Je={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ze,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},We="undefined"!=typeof window&&"undefined"!=typeof document,Ge="object"===("undefined"==typeof navigator?"undefined":T(navigator))&&navigator||void 0,Ke=We&&(!Ge||["ReactNative","NativeScript","NS"].indexOf(Ge.product)<0),Ve="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Xe=We&&window.location.href||"http://localhost",Qe=A(A({},Object.freeze({__proto__:null,hasBrowserEnv:We,hasStandardBrowserEnv:Ke,hasStandardBrowserWebWorkerEnv:Ve,navigator:Ge,origin:Xe})),Je);function Ye(t){function e(t,n,r,i){var o=t[i++];if("__proto__"===o)return!0;var a=Number.isFinite(+o),s=i>=t.length;return o=!o&&Te.isArray(r)?r.length:o,s?(Te.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&Te.isObject(r[o])||(r[o]=[]),e(t,n,r[o],i)&&Te.isArray(r[o])&&(r[o]=function(t){var e,n,r={},i=Object.keys(t),o=i.length;for(e=0;e<o;e++)r[n=i[e]]=t[n];return r}(r[o])),!a)}if(Te.isFormData(t)&&Te.isFunction(t.entries)){var n={};return Te.forEachEntry(t,(function(t,r){e(function(t){return Te.matchAll(/\w+|\[(\w*)]/g,t).map((function(t){return"[]"===t[0]?"":t[1]||t[0]}))}(t),r,n,0)})),n}return null}var Ze={transitional:He,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){var n,r=e.getContentType()||"",i=r.indexOf("application/json")>-1,o=Te.isObject(t);if(o&&Te.isHTMLForm(t)&&(t=new FormData(t)),Te.isFormData(t))return i?JSON.stringify(Ye(t)):t;if(Te.isArrayBuffer(t)||Te.isBuffer(t)||Te.isStream(t)||Te.isFile(t)||Te.isBlob(t)||Te.isReadableStream(t))return t;if(Te.isArrayBufferView(t))return t.buffer;if(Te.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return $e(t,new Qe.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return Qe.isNode&&Te.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((n=Te.isFileList(t))||r.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return $e(n?{"files[]":t}:t,a&&new a,this.formSerializer)}}return o||i?(e.setContentType("application/json",!1),function(t,e){if(Te.isString(t))try{return(e||JSON.parse)(t),Te.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||Ze.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(Te.isResponse(t)||Te.isReadableStream(t))return t;if(t&&Te.isString(t)&&(n&&!this.responseType||r)){var i=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(i){if("SyntaxError"===t.name)throw _e.from(t,_e.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Qe.classes.FormData,Blob:Qe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Te.forEach(["delete","get","head","post","put","patch"],(function(t){Ze.headers[t]={}}));var tn=Te.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"]),en=Symbol("internals");function nn(t){return t&&String(t).trim().toLowerCase()}function rn(t){return!1===t||null==t?t:Te.isArray(t)?t.map(rn):String(t)}function on(t,e,n,r,i){return Te.isFunction(r)?r.call(this,e,n):(i&&(e=n),Te.isString(e)?Te.isString(r)?-1!==e.indexOf(r):Te.isRegExp(r)?r.test(e):void 0:void 0)}var an=function(){return p((function t(e){h(this,t),e&&this.set(e)}),[{key:"set",value:function(t,e,n){var r=this;function i(t,e,n){var i=nn(e);if(!i)throw new Error("header name must be a non-empty string");var o=Te.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||e]=rn(t))}var o=function(t,e){return Te.forEach(t,(function(t,n){return i(t,n,e)}))};if(Te.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(Te.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))o(function(t){var e,n,r,i={};return t&&t.split("\n").forEach((function(t){r=t.indexOf(":"),e=t.substring(0,r).trim().toLowerCase(),n=t.substring(r+1).trim(),!e||i[e]&&tn[e]||("set-cookie"===e?i[e]?i[e].push(n):i[e]=[n]:i[e]=i[e]?i[e]+", "+n:n)})),i}(t),e);else if(Te.isHeaders(t)){var a,s=v(t.entries());try{for(s.s();!(a=s.n()).done;){var u=R(a.value,2),c=u[0];i(u[1],c,n)}}catch(t){s.e(t)}finally{s.f()}}else null!=t&&i(e,t,n);return this}},{key:"get",value:function(t,e){if(t=nn(t)){var n=Te.findKey(this,t);if(n){var r=this[n];if(!e)return r;if(!0===e)return function(t){for(var e,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;e=r.exec(t);)n[e[1]]=e[2];return n}(r);if(Te.isFunction(e))return e.call(this,r,n);if(Te.isRegExp(e))return e.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(t,e){if(t=nn(t)){var n=Te.findKey(this,t);return!(!n||void 0===this[n]||e&&!on(0,this[n],n,e))}return!1}},{key:"delete",value:function(t,e){var n=this,r=!1;function i(t){if(t=nn(t)){var i=Te.findKey(n,t);!i||e&&!on(0,n[i],i,e)||(delete n[i],r=!0)}}return Te.isArray(t)?t.forEach(i):i(t),r}},{key:"clear",value:function(t){for(var e=Object.keys(this),n=e.length,r=!1;n--;){var i=e[n];t&&!on(0,this[i],i,t,!0)||(delete this[i],r=!0)}return r}},{key:"normalize",value:function(t){var e=this,n={};return Te.forEach(this,(function(r,i){var o=Te.findKey(n,i);if(o)return e[o]=rn(r),void delete e[i];var a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n}))}(i):String(i).trim();a!==i&&delete e[i],e[a]=rn(r),n[a]=!0})),this}},{key:"concat",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=this.constructor).concat.apply(t,[this].concat(n))}},{key:"toJSON",value:function(t){var e=Object.create(null);return Te.forEach(this,(function(n,r){null!=n&&!1!==n&&(e[r]=t&&Te.isArray(n)?n.join(", "):n)})),e}},{key:Symbol.iterator,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map((function(t){var e=R(t,2);return e[0]+": "+e[1]})).join("\n")}},{key:Symbol.toStringTag,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(t){return t instanceof this?t:new this(t)}},{key:"concat",value:function(t){for(var e=new this(t),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach((function(t){return e.set(t)})),e}},{key:"accessor",value:function(t){var e=(this[en]=this[en]={accessors:{}}).accessors,n=this.prototype;function r(t){var r=nn(t);e[r]||(!function(t,e){var n=Te.toCamelCase(" "+e);["get","set","has"].forEach((function(r){Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:!0})}))}(n,t),e[r]=!0)}return Te.isArray(t)?t.forEach(r):r(t),this}}])}();function sn(t,e){var n=this||Ze,r=e||n,i=an.from(r.headers),o=r.data;return Te.forEach(t,(function(t){o=t.call(n,o,i.normalize(),e?e.status:void 0)})),i.normalize(),o}function un(t){return!(!t||!t.__CANCEL__)}function cn(t,e,n){_e.call(this,null==t?"canceled":t,_e.ERR_CANCELED,e,n),this.name="CanceledError"}function ln(t,e,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new _e("Request failed with status code "+n.status,[_e.ERR_BAD_REQUEST,_e.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}an.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Te.reduceDescriptors(an.prototype,(function(t,e){var n=t.value,r=e[0].toUpperCase()+e.slice(1);return{get:function(){return n},set:function(t){this[r]=t}}})),Te.freezeMethods(an),Te.inherits(cn,_e,{__CANCEL__:!0});var hn=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,i=function(t,e){t=t||10;var n,r=new Array(t),i=new Array(t),o=0,a=0;return e=void 0!==e?e:1e3,function(s){var u=Date.now(),c=i[a];n||(n=u),r[o]=s,i[o]=u;for(var l=a,h=0;l!==o;)h+=r[l++],l%=t;if((o=(o+1)%t)===a&&(a=(a+1)%t),!(u-n<e)){var f=c&&u-c;return f?Math.round(1e3*h/f):void 0}}}(50,250);return function(t,e){var n,r,i=0,o=1e3/e,a=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();i=o,n=null,r&&(clearTimeout(r),r=null),t.apply(null,e)};return[function(){for(var t=Date.now(),e=t-i,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];e>=o?a(u,t):(n=u,r||(r=setTimeout((function(){r=null,a(n)}),o-e)))},function(){return n&&a(n)}]}((function(n){var o=n.loaded,a=n.lengthComputable?n.total:void 0,s=o-r,u=i(s);r=o;var c=g({loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&o<=a?(a-o)/u:void 0,event:n,lengthComputable:null!=a},e?"download":"upload",!0);t(c)}),n)},fn=function(t,e){var n=null!=t;return[function(r){return e[0]({lengthComputable:n,total:t,loaded:r})},e[1]]},dn=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Te.asap((function(){return t.apply(void 0,n)}))}},pn=Qe.hasStandardBrowserEnv?function(t,e){return function(n){return n=new URL(n,Qe.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)}}(new URL(Qe.origin),Qe.navigator&&/(msie|trident)/i.test(Qe.navigator.userAgent)):function(){return!0},vn=Qe.hasStandardBrowserEnv?{write:function(t,e,n,r,i,o){var a=[t+"="+encodeURIComponent(e)];Te.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Te.isString(r)&&a.push("path="+r),Te.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function gn(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}var yn=function(t){return t instanceof an?A({},t):t};function bn(t,e){e=e||{};var n={};function r(t,e,n,r){return Te.isPlainObject(t)&&Te.isPlainObject(e)?Te.merge.call({caseless:r},t,e):Te.isPlainObject(e)?Te.merge({},e):Te.isArray(e)?e.slice():e}function i(t,e,n,i){return Te.isUndefined(e)?Te.isUndefined(t)?void 0:r(void 0,t,0,i):r(t,e,0,i)}function o(t,e){if(!Te.isUndefined(e))return r(void 0,e)}function a(t,e){return Te.isUndefined(e)?Te.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function s(n,i,o){return o in e?r(n,i):o in t?r(void 0,n):void 0}var u={url:o,method:o,data:o,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:function(t,e,n){return i(yn(t),yn(e),0,!0)}};return Te.forEach(Object.keys(Object.assign({},t,e)),(function(r){var o=u[r]||i,a=o(t[r],e[r],r);Te.isUndefined(a)&&o!==s||(n[r]=a)})),n}var mn,wn,kn=function(t){var e,r,i=bn({},t),o=i.data,a=i.withXSRFToken,s=i.xsrfHeaderName,u=i.xsrfCookieName,c=i.headers,l=i.auth;if(i.headers=c=an.from(c),i.url=Ie(gn(i.baseURL,i.url),t.params,t.paramsSerializer),l&&c.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),Te.isFormData(o))if(Qe.hasStandardBrowserEnv||Qe.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(!1!==(e=c.getContentType())){var h=e?e.split(";").map((function(t){return t.trim()})).filter(Boolean):[],f=n(r=h)||w(r)||_(r)||k(),d=f[0],p=f.slice(1);c.setContentType([d||"multipart/form-data"].concat(S(p)).join("; "))}if(Qe.hasStandardBrowserEnv&&(a&&Te.isFunction(a)&&(a=a(i)),a||!1!==a&&pn(i.url))){var v=s&&u&&vn.read(u);v&&c.set(s,v)}return i},xn="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){var r,i,o,a,s,u=kn(t),c=u.data,l=an.from(u.headers).normalize(),h=u.responseType,f=u.onUploadProgress,d=u.onDownloadProgress;function p(){a&&a(),s&&s(),u.cancelToken&&u.cancelToken.unsubscribe(r),u.signal&&u.signal.removeEventListener("abort",r)}var v=new XMLHttpRequest;function g(){if(v){var r=an.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders());ln((function(t){e(t),p()}),(function(t){n(t),p()}),{data:h&&"text"!==h&&"json"!==h?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:r,config:t,request:v}),v=null}}if(v.open(u.method.toUpperCase(),u.url,!0),v.timeout=u.timeout,"onloadend"in v?v.onloadend=g:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(g)},v.onabort=function(){v&&(n(new _e("Request aborted",_e.ECONNABORTED,t,v)),v=null)},v.onerror=function(){n(new _e("Network Error",_e.ERR_NETWORK,t,v)),v=null},v.ontimeout=function(){var e=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",r=u.transitional||He;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),n(new _e(e,r.clarifyTimeoutError?_e.ETIMEDOUT:_e.ECONNABORTED,t,v)),v=null},void 0===c&&l.setContentType(null),"setRequestHeader"in v&&Te.forEach(l.toJSON(),(function(t,e){v.setRequestHeader(e,t)})),Te.isUndefined(u.withCredentials)||(v.withCredentials=!!u.withCredentials),h&&"json"!==h&&(v.responseType=u.responseType),d){var y=R(hn(d,!0),2);o=y[0],s=y[1],v.addEventListener("progress",o)}if(f&&v.upload){var b=R(hn(f),2);i=b[0],a=b[1],v.upload.addEventListener("progress",i),v.upload.addEventListener("loadend",a)}(u.cancelToken||u.signal)&&(r=function(e){v&&(n(!e||e.type?new cn(null,t,v):e),v.abort(),v=null)},u.cancelToken&&u.cancelToken.subscribe(r),u.signal&&(u.signal.aborted?r():u.signal.addEventListener("abort",r)));var m,w,k=(m=u.url,(w=/^([-+\w]{1,25})(:?\/\/|:)/.exec(m))&&w[1]||"");k&&-1===Qe.protocols.indexOf(k)?n(new _e("Unsupported protocol "+k+":",_e.ERR_BAD_REQUEST,t)):v.send(c||null)}))},An=function(t,e){var n=(t=t?t.filter(Boolean):[]).length;if(e||n){var r,i=new AbortController,o=function(t){if(!r){r=!0,s();var e=t instanceof Error?t:this.reason;i.abort(e instanceof _e?e:new cn(e instanceof Error?e.message:e))}},a=e&&setTimeout((function(){a=null,o(new _e("timeout ".concat(e," of ms exceeded"),_e.ETIMEDOUT))}),e),s=function(){t&&(a&&clearTimeout(a),a=null,t.forEach((function(t){t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((function(t){return t.addEventListener("abort",o)}));var u=i.signal;return u.unsubscribe=function(){return Te.asap(s)},u}},En=E().mark((function t(e,n){var r,i,o;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.byteLength,n&&!(r<n)){t.next=5;break}return t.next=4,e;case 4:return t.abrupt("return");case 5:i=0;case 6:if(!(i<r)){t.next=13;break}return o=i+n,t.next=10,e.slice(i,o);case 10:i=o,t.next=6;break;case 13:case"end":return t.stop()}}),t)})),On=function(){var t=P(E().mark((function t(e,n){var r,a,s,u,l,h;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=!1,a=!1,t.prev=2,u=o(Rn(e));case 4:return t.next=6,c(u.next());case 6:if(!(r=!(l=t.sent).done)){t.next=12;break}return h=l.value,t.delegateYield(i(o(En(h,n))),"t0",9);case 9:r=!1,t.next=4;break;case 12:t.next=18;break;case 14:t.prev=14,t.t1=t.catch(2),a=!0,s=t.t1;case 18:if(t.prev=18,t.prev=19,!r||null==u.return){t.next=23;break}return t.next=23,c(u.return());case 23:if(t.prev=23,!a){t.next=26;break}throw s;case 26:return t.finish(23);case 27:return t.finish(18);case 28:case"end":return t.stop()}}),t,null,[[2,14,18,28],[19,,23,27]])})));return function(e,n){return t.apply(this,arguments)}}(),Rn=function(){var t=P(E().mark((function t(e){var n,r,a,s;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e[Symbol.asyncIterator]){t.next=3;break}return t.delegateYield(i(o(e)),"t0",2);case 2:return t.abrupt("return");case 3:n=e.getReader(),t.prev=4;case 5:return t.next=7,c(n.read());case 7:if(r=t.sent,a=r.done,s=r.value,!a){t.next=12;break}return t.abrupt("break",16);case 12:return t.next=14,s;case 14:t.next=5;break;case 16:return t.prev=16,t.next=19,c(n.cancel());case 19:return t.finish(16);case 20:case"end":return t.stop()}}),t,null,[[4,,16,20]])})));return function(e){return t.apply(this,arguments)}}(),Sn=function(t,e,n,r){var i,o=On(t,e),a=0,s=function(t){i||(i=!0,r&&r(t))};return new ReadableStream({pull:function(t){return u(E().mark((function e(){var r,i,u,c,l;return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.next();case 3:if(r=e.sent,i=r.done,u=r.value,!i){e.next=10;break}return s(),t.close(),e.abrupt("return");case 10:c=u.byteLength,n&&(l=a+=c,n(l)),t.enqueue(new Uint8Array(u)),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),s(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,null,[[0,15]])})))()},cancel:function(t){return s(t),o.return()}},{highWaterMark:2})},jn="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Tn=jn&&"function"==typeof ReadableStream,_n=jn&&("function"==typeof TextEncoder?(mn=new TextEncoder,function(t){return mn.encode(t)}):function(){var t=u(E().mark((function t(e){return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Uint8Array,t.next=3,new Response(e).arrayBuffer();case 3:return t.t1=t.sent,t.abrupt("return",new t.t0(t.t1));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),Pn=function(t){try{for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!!t.apply(void 0,n)}catch(t){return!1}},Ln=Tn&&Pn((function(){var t=!1,e=new Request(Qe.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),Cn=Tn&&Pn((function(){return Te.isReadableStream(new Response("").body)})),Nn={stream:Cn&&function(t){return t.body}};jn&&(wn=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((function(t){!Nn[t]&&(Nn[t]=Te.isFunction(wn[t])?function(e){return e[t]()}:function(e,n){throw new _e("Response type '".concat(t,"' is not supported"),_e.ERR_NOT_SUPPORT,n)})})));var Fn=function(){var t=u(E().mark((function t(e){var n;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",0);case 2:if(!Te.isBlob(e)){t.next=4;break}return t.abrupt("return",e.size);case 4:if(!Te.isSpecCompliantForm(e)){t.next=9;break}return n=new Request(Qe.origin,{method:"POST",body:e}),t.next=8,n.arrayBuffer();case 8:case 15:return t.abrupt("return",t.sent.byteLength);case 9:if(!Te.isArrayBufferView(e)&&!Te.isArrayBuffer(e)){t.next=11;break}return t.abrupt("return",e.byteLength);case 11:if(Te.isURLSearchParams(e)&&(e+=""),!Te.isString(e)){t.next=16;break}return t.next=15,_n(e);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Dn=function(){var t=u(E().mark((function t(e,n){var r;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Te.toFiniteNumber(e.getContentLength()),t.abrupt("return",null==r?Fn(n):r);case 2:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),$n=jn&&function(){var t=u(E().mark((function t(e){var n,r,i,o,a,s,u,c,l,h,f,d,p,v,g,y,b,m,w,k,x,O,S,j,T,_,P,L,C,N,F,D,$,U;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=kn(e),r=n.url,i=n.method,o=n.data,a=n.signal,s=n.cancelToken,u=n.timeout,c=n.onDownloadProgress,l=n.onUploadProgress,h=n.responseType,f=n.headers,d=n.withCredentials,p=void 0===d?"same-origin":d,v=n.fetchOptions,h=h?(h+"").toLowerCase():"text",g=An([a,s&&s.toAbortSignal()],u),b=g&&g.unsubscribe&&function(){g.unsubscribe()},t.prev=4,t.t0=l&&Ln&&"get"!==i&&"head"!==i,!t.t0){t.next=11;break}return t.next=9,Dn(f,o);case 9:t.t1=m=t.sent,t.t0=0!==t.t1;case 11:if(!t.t0){t.next=15;break}w=new Request(r,{method:"POST",body:o,duplex:"half"}),Te.isFormData(o)&&(k=w.headers.get("content-type"))&&f.setContentType(k),w.body&&(x=fn(m,hn(dn(l))),O=R(x,2),S=O[0],j=O[1],o=Sn(w.body,65536,S,j));case 15:return Te.isString(p)||(p=p?"include":"omit"),T="credentials"in Request.prototype,y=new Request(r,A(A({},v),{},{signal:g,method:i.toUpperCase(),headers:f.normalize().toJSON(),body:o,duplex:"half",credentials:T?p:void 0})),t.next=20,fetch(y);case 20:return _=t.sent,P=Cn&&("stream"===h||"response"===h),Cn&&(c||P&&b)&&(L={},["status","statusText","headers"].forEach((function(t){L[t]=_[t]})),C=Te.toFiniteNumber(_.headers.get("content-length")),N=c&&fn(C,hn(dn(c),!0))||[],F=R(N,2),D=F[0],$=F[1],_=new Response(Sn(_.body,65536,D,(function(){$&&$(),b&&b()})),L)),h=h||"text",t.next=26,Nn[Te.findKey(Nn,h)||"text"](_,e);case 26:return U=t.sent,!P&&b&&b(),t.next=30,new Promise((function(t,n){ln(t,n,{data:U,headers:an.from(_.headers),status:_.status,statusText:_.statusText,config:e,request:y})}));case 30:return t.abrupt("return",t.sent);case 33:if(t.prev=33,t.t2=t.catch(4),b&&b(),!t.t2||"TypeError"!==t.t2.name||!/fetch/i.test(t.t2.message)){t.next=38;break}throw Object.assign(new _e("Network Error",_e.ERR_NETWORK,e,y),{cause:t.t2.cause||t.t2});case 38:throw _e.from(t.t2,t.t2&&t.t2.code,e,y);case 39:case"end":return t.stop()}}),t,null,[[4,33]])})));return function(e){return t.apply(this,arguments)}}(),Un={http:null,xhr:xn,fetch:$n};Te.forEach(Un,(function(t,e){if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));var zn=function(t){return"- ".concat(t)},Bn=function(t){return Te.isFunction(t)||null===t||!1===t},qn=function(t){for(var e,n,r=(t=Te.isArray(t)?t:[t]).length,i={},o=0;o<r;o++){var a=void 0;if(n=e=t[o],!Bn(e)&&void 0===(n=Un[(a=String(e)).toLowerCase()]))throw new _e("Unknown adapter '".concat(a,"'"));if(n)break;i[a||"#"+o]=n}if(!n){var s=Object.entries(i).map((function(t){var e=R(t,2),n=e[0],r=e[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")}));throw new _e("There is no suitable adapter to dispatch the request "+(r?s.length>1?"since :\n"+s.map(zn).join("\n"):" "+zn(s[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function In(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new cn(null,t)}function Mn(t){return In(t),t.headers=an.from(t.headers),t.data=sn.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),qn(t.adapter||Ze.adapter)(t).then((function(e){return In(t),e.data=sn.call(t,t.transformResponse,e),e.headers=an.from(e.headers),e}),(function(e){return un(e)||(In(t),e&&e.response&&(e.response.data=sn.call(t,t.transformResponse,e.response),e.response.headers=an.from(e.response.headers))),Promise.reject(e)}))}var Hn="1.7.9",Jn={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Jn[t]=function(n){return T(n)===t||"a"+(e<1?"n ":" ")+t}}));var Wn={};Jn.transitional=function(t,e,n){function r(t,e){return"[Axios v1.7.9] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,i,o){if(!1===t)throw new _e(r(i," has been removed"+(e?" in "+e:"")),_e.ERR_DEPRECATED);return e&&!Wn[i]&&(Wn[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,o)}},Jn.spelling=function(t){return function(e,n){return console.warn("".concat(n," is likely a misspelling of ").concat(t)),!0}};var Gn={assertOptions:function(t,e,n){if("object"!==T(t))throw new _e("options must be an object",_e.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(t),i=r.length;i-- >0;){var o=r[i],a=e[o];if(a){var s=t[o],u=void 0===s||a(s,o,t);if(!0!==u)throw new _e("option "+o+" must be "+u,_e.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new _e("Unknown option "+o,_e.ERR_BAD_OPTION)}},validators:Jn},Kn=Gn.validators,Vn=function(){return p((function t(e){h(this,t),this.defaults=e,this.interceptors={request:new Me,response:new Me}}),[{key:"request",value:(t=u(E().mark((function t(e,n){var r,i;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._request(e,n);case 3:return t.abrupt("return",t.sent);case 6:if(t.prev=6,t.t0=t.catch(0),t.t0 instanceof Error){r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,i=r.stack?r.stack.replace(/^.+\n/,""):"";try{t.t0.stack?i&&!String(t.t0.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(t.t0.stack+="\n"+i):t.t0.stack=i}catch(t){}}throw t.t0;case 10:case"end":return t.stop()}}),t,this,[[0,6]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_request",value:function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{};var n=e=bn(this.defaults,e),r=n.transitional,i=n.paramsSerializer,o=n.headers;void 0!==r&&Gn.assertOptions(r,{silentJSONParsing:Kn.transitional(Kn.boolean),forcedJSONParsing:Kn.transitional(Kn.boolean),clarifyTimeoutError:Kn.transitional(Kn.boolean)},!1),null!=i&&(Te.isFunction(i)?e.paramsSerializer={serialize:i}:Gn.assertOptions(i,{encode:Kn.function,serialize:Kn.function},!0)),Gn.assertOptions(e,{baseUrl:Kn.spelling("baseURL"),withXsrfToken:Kn.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();var a=o&&Te.merge(o.common,o[e.method]);o&&Te.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete o[t]})),e.headers=an.concat(a,o);var s=[],u=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(u=u&&t.synchronous,s.unshift(t.fulfilled,t.rejected))}));var c,l=[];this.interceptors.response.forEach((function(t){l.push(t.fulfilled,t.rejected)}));var h,f=0;if(!u){var d=[Mn.bind(this),void 0];for(d.unshift.apply(d,s),d.push.apply(d,l),h=d.length,c=Promise.resolve(e);f<h;)c=c.then(d[f++],d[f++]);return c}h=s.length;var p=e;for(f=0;f<h;){var v=s[f++],g=s[f++];try{p=v(p)}catch(t){g.call(this,t);break}}try{c=Mn.call(this,p)}catch(t){return Promise.reject(t)}for(f=0,h=l.length;f<h;)c=c.then(l[f++],l[f++]);return c}},{key:"getUri",value:function(t){return Ie(gn((t=bn(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}]);var t}();Te.forEach(["delete","get","head","options"],(function(t){Vn.prototype[t]=function(e,n){return this.request(bn(n||{},{method:t,url:e,data:(n||{}).data}))}})),Te.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,i){return this.request(bn(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Vn.prototype[t]=e(),Vn.prototype[t+"Form"]=e(!0)}));var Xn=function(){function t(e){if(h(this,t),"function"!=typeof e)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(t){n=t}));var r=this;this.promise.then((function(t){if(r._listeners){for(var e=r._listeners.length;e-- >0;)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},e((function(t,e,i){r.reason||(r.reason=new cn(t,e,i),n(r.reason))}))}return p(t,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}},{key:"unsubscribe",value:function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}}},{key:"toAbortSignal",value:function(){var t=this,e=new AbortController,n=function(t){e.abort(t)};return this.subscribe(n),e.signal.unsubscribe=function(){return t.unsubscribe(n)},e.signal}}],[{key:"source",value:function(){var e;return{token:new t((function(t){e=t})),cancel:e}}}])}();var Qn={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(Qn).forEach((function(t){var e=R(t,2),n=e[0],r=e[1];Qn[r]=n}));var Yn=function t(e){var n=new Vn(e),r=Ut(Vn.prototype.request,n);return Te.extend(r,Vn.prototype,n,{allOwnKeys:!0}),Te.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(bn(e,n))},r}(Ze);Yn.Axios=Vn,Yn.CanceledError=cn,Yn.CancelToken=Xn,Yn.isCancel=un,Yn.VERSION=Hn,Yn.toFormData=$e,Yn.AxiosError=_e,Yn.Cancel=Yn.CanceledError,Yn.all=function(t){return Promise.all(t)},Yn.spread=function(t){return function(e){return t.apply(null,e)}},Yn.isAxiosError=function(t){return Te.isObject(t)&&!0===t.isAxiosError},Yn.mergeConfig=bn,Yn.AxiosHeaders=an,Yn.formToJSON=function(t){return Ye(Te.isHTMLForm(t)?new FormData(t):t)},Yn.getAdapter=qn,Yn.HttpStatusCode=Qn,Yn.default=Yn,Yn.Axios,Yn.AxiosError,Yn.CanceledError,Yn.isCancel,Yn.CancelToken,Yn.VERSION,Yn.all,Yn.Cancel,Yn.isAxiosError,Yn.spread,Yn.toFormData,Yn.AxiosHeaders,Yn.HttpStatusCode,Yn.formToJSON,Yn.getAdapter,Yn.mergeConfig;var Zn=function(){function t(e){var n;return h(this,t),(n=l(this,t,[e])).axiosInstance=Yn.create({baseURL:"".concat(n.host,"/").concat(n.namespace),headers:{Authorization:"Bearer ".concat(e.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;node"}}),n.axiosInstance.interceptors.response.use((function(t){return t.data}),(function(t){if(t.response){var e=t.response.data;if(J(e.errors)&&e.errors.length)throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t})),n}return b(t,Dt),p(t,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.axiosInstance.defaults.headers.common=A(A({},this.axiosInstance.defaults.headers.common),t),this}},{key:"request",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axiosInstance.request(A({method:t,url:e},n))}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("GET",t,A({params:e},n))}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("POST",t,A({data:e},n))}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PUT",t,A({data:e},n))}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("DELETE",t,e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PATCH",t,A({data:e},n))}}])}();z("adapter","NodeAdapter",Zn);var tr=function(){function t(){return h(this,t),l(this,t,arguments)}return b(t,Dt),p(t)}();z("adapter","EmberJsAdapter",tr);var er=function(){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(h(this,t),this.version=null!==(n=o.version)&&void 0!==n?n:"v1",this.options={version:this.version,host:null!==(r=o.host)&&void 0!==r?r:"https://api.fleetbase.io",namespace:null!==(i=o.namespace)&&void 0!==i?i:this.version,debug:a,publicKey:e},"string"!=typeof e||0===e.length)throw new Error("⚠️ Invalid public key given to Fleetbase SDK");if(!it()&&e.toLowerCase().startsWith("$"))throw new Error("Secret key provided. You must use a public key with Fleetbase Javascript SDK!");this.adapter=o.adapter||ot(this.options),this.orders=new vt("order",this.adapter).extendActions(gt),this.entities=new vt("entity",this.adapter),this.places=new vt("place",this.adapter),this.drivers=new vt("driver",this.adapter).extendActions(St),this.vehicles=new vt("vehicle",this.adapter),this.vendors=new vt("vendor",this.adapter),this.contacts=new vt("contact",this.adapter),this.serviceAreas=new vt("service-area",this.adapter),this.zones=new vt("zone",this.adapter),this.fleets=new vt("fleet",this.adapter),this.organizations=new vt("organization",this.adapter).extendActions(Et)}return p(t,[{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return f(t,Array.prototype.slice.call(arguments))}}])}();exports.Adapter=Dt,exports.BrowserAdapter=$t,exports.Collection=nt,exports.Contact=_t,exports.Driver=jt,exports.EmberJsAdapter=tr,exports.Entity=mt,exports.Fleet=Ft,exports.GoogleAddress=at,exports.NodeAdapter=Zn,exports.Order=yt,exports.Organization=Ot,exports.Payload=bt,exports.Place=wt,exports.Point=st,exports.Resolver=I,exports.Resource=pt,exports.ServiceArea=Lt,exports.ServiceQuote=Nt,exports.ServiceRate=Ct,exports.Store=vt,exports.StoreActions=ft,exports.TrackingStatus=xt,exports.Vehicle=At,exports.Vendor=Tt,exports.Waypoint=kt,exports.Zone=Pt,exports.camelize=function(){var t=["camelize"].concat(Array.prototype.slice.call(arguments));return N.invoke.apply(N,S(t))},exports.classify=$,exports.createCollection=et,exports.createResource=function(){return B.apply(void 0,["resource","Resource"].concat(Array.prototype.slice.call(arguments)))},exports.createStore=q,exports.createStoreActions=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=f(ft,n);return z("action",t,i),i},exports.dasherize=function(){var t=["dasherize"].concat(Array.prototype.slice.call(arguments));return N.invoke.apply(N,S(t))},exports.default=er,exports.detectAdapter=ot,exports.extendStoreActions=ht,exports.isLatitude=function(t){return isFinite(t)&&Math.abs(t)<=90},exports.isLongitude=function(t){return isFinite(t)&&Math.abs(t)<=180&&Math.abs(t)>=90},exports.isNodeEnvironment=it,exports.isResource=dt,exports.lookup=M,exports.pluralize=F,exports.register=z,exports.resolve=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return B.apply(void 0,[t,$(e)].concat(r))},exports.resolveResource=H,exports.singularize=D;
//# sourceMappingURL=fleetbase.js.map
