main.js 82 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008
  1. /******/ (() => { // webpackBootstrap
  2. /******/ var __webpack_modules__ = ({
  3. /***/ "./node_modules/axios/index.js":
  4. /*!*************************************!*\
  5. !*** ./node_modules/axios/index.js ***!
  6. \*************************************/
  7. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  8. module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js");
  9. /***/ }),
  10. /***/ "./node_modules/axios/lib/adapters/xhr.js":
  11. /*!************************************************!*\
  12. !*** ./node_modules/axios/lib/adapters/xhr.js ***!
  13. \************************************************/
  14. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  15. "use strict";
  16. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  17. var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js");
  18. var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js");
  19. var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
  20. var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js");
  21. var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js");
  22. var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js");
  23. var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js");
  24. var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js");
  25. var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
  26. module.exports = function xhrAdapter(config) {
  27. return new Promise(function dispatchXhrRequest(resolve, reject) {
  28. var requestData = config.data;
  29. var requestHeaders = config.headers;
  30. var responseType = config.responseType;
  31. var onCanceled;
  32. function done() {
  33. if (config.cancelToken) {
  34. config.cancelToken.unsubscribe(onCanceled);
  35. }
  36. if (config.signal) {
  37. config.signal.removeEventListener('abort', onCanceled);
  38. }
  39. }
  40. if (utils.isFormData(requestData)) {
  41. delete requestHeaders['Content-Type']; // Let the browser set it
  42. }
  43. var request = new XMLHttpRequest();
  44. // HTTP basic authentication
  45. if (config.auth) {
  46. var username = config.auth.username || '';
  47. var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
  48. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  49. }
  50. var fullPath = buildFullPath(config.baseURL, config.url);
  51. request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
  52. // Set the request timeout in MS
  53. request.timeout = config.timeout;
  54. function onloadend() {
  55. if (!request) {
  56. return;
  57. }
  58. // Prepare the response
  59. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  60. var responseData = !responseType || responseType === 'text' || responseType === 'json' ?
  61. request.responseText : request.response;
  62. var response = {
  63. data: responseData,
  64. status: request.status,
  65. statusText: request.statusText,
  66. headers: responseHeaders,
  67. config: config,
  68. request: request
  69. };
  70. settle(function _resolve(value) {
  71. resolve(value);
  72. done();
  73. }, function _reject(err) {
  74. reject(err);
  75. done();
  76. }, response);
  77. // Clean up request
  78. request = null;
  79. }
  80. if ('onloadend' in request) {
  81. // Use onloadend if available
  82. request.onloadend = onloadend;
  83. } else {
  84. // Listen for ready state to emulate onloadend
  85. request.onreadystatechange = function handleLoad() {
  86. if (!request || request.readyState !== 4) {
  87. return;
  88. }
  89. // The request errored out and we didn't get a response, this will be
  90. // handled by onerror instead
  91. // With one exception: request that using file: protocol, most browsers
  92. // will return status as 0 even though it's a successful request
  93. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  94. return;
  95. }
  96. // readystate handler is calling before onerror or ontimeout handlers,
  97. // so we should call onloadend on the next 'tick'
  98. setTimeout(onloadend);
  99. };
  100. }
  101. // Handle browser request cancellation (as opposed to a manual cancellation)
  102. request.onabort = function handleAbort() {
  103. if (!request) {
  104. return;
  105. }
  106. reject(createError('Request aborted', config, 'ECONNABORTED', request));
  107. // Clean up request
  108. request = null;
  109. };
  110. // Handle low level network errors
  111. request.onerror = function handleError() {
  112. // Real errors are hidden from us by the browser
  113. // onerror should only fire if it's a network error
  114. reject(createError('Network Error', config, null, request));
  115. // Clean up request
  116. request = null;
  117. };
  118. // Handle timeout
  119. request.ontimeout = function handleTimeout() {
  120. var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
  121. var transitional = config.transitional || defaults.transitional;
  122. if (config.timeoutErrorMessage) {
  123. timeoutErrorMessage = config.timeoutErrorMessage;
  124. }
  125. reject(createError(
  126. timeoutErrorMessage,
  127. config,
  128. transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
  129. request));
  130. // Clean up request
  131. request = null;
  132. };
  133. // Add xsrf header
  134. // This is only done if running in a standard browser environment.
  135. // Specifically not if we're in a web worker, or react-native.
  136. if (utils.isStandardBrowserEnv()) {
  137. // Add xsrf header
  138. var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
  139. cookies.read(config.xsrfCookieName) :
  140. undefined;
  141. if (xsrfValue) {
  142. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  143. }
  144. }
  145. // Add headers to the request
  146. if ('setRequestHeader' in request) {
  147. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  148. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  149. // Remove Content-Type if data is undefined
  150. delete requestHeaders[key];
  151. } else {
  152. // Otherwise add header to the request
  153. request.setRequestHeader(key, val);
  154. }
  155. });
  156. }
  157. // Add withCredentials to request if needed
  158. if (!utils.isUndefined(config.withCredentials)) {
  159. request.withCredentials = !!config.withCredentials;
  160. }
  161. // Add responseType to request if needed
  162. if (responseType && responseType !== 'json') {
  163. request.responseType = config.responseType;
  164. }
  165. // Handle progress if needed
  166. if (typeof config.onDownloadProgress === 'function') {
  167. request.addEventListener('progress', config.onDownloadProgress);
  168. }
  169. // Not all browsers support upload events
  170. if (typeof config.onUploadProgress === 'function' && request.upload) {
  171. request.upload.addEventListener('progress', config.onUploadProgress);
  172. }
  173. if (config.cancelToken || config.signal) {
  174. // Handle cancellation
  175. // eslint-disable-next-line func-names
  176. onCanceled = function(cancel) {
  177. if (!request) {
  178. return;
  179. }
  180. reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);
  181. request.abort();
  182. request = null;
  183. };
  184. config.cancelToken && config.cancelToken.subscribe(onCanceled);
  185. if (config.signal) {
  186. config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
  187. }
  188. }
  189. if (!requestData) {
  190. requestData = null;
  191. }
  192. // Send the request
  193. request.send(requestData);
  194. });
  195. };
  196. /***/ }),
  197. /***/ "./node_modules/axios/lib/axios.js":
  198. /*!*****************************************!*\
  199. !*** ./node_modules/axios/lib/axios.js ***!
  200. \*****************************************/
  201. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  202. "use strict";
  203. var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
  204. var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
  205. var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js");
  206. var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
  207. var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js");
  208. /**
  209. * Create an instance of Axios
  210. *
  211. * @param {Object} defaultConfig The default config for the instance
  212. * @return {Axios} A new instance of Axios
  213. */
  214. function createInstance(defaultConfig) {
  215. var context = new Axios(defaultConfig);
  216. var instance = bind(Axios.prototype.request, context);
  217. // Copy axios.prototype to instance
  218. utils.extend(instance, Axios.prototype, context);
  219. // Copy context to instance
  220. utils.extend(instance, context);
  221. // Factory for creating new instances
  222. instance.create = function create(instanceConfig) {
  223. return createInstance(mergeConfig(defaultConfig, instanceConfig));
  224. };
  225. return instance;
  226. }
  227. // Create the default instance to be exported
  228. var axios = createInstance(defaults);
  229. // Expose Axios class to allow class inheritance
  230. axios.Axios = Axios;
  231. // Expose Cancel & CancelToken
  232. axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
  233. axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js");
  234. axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
  235. axios.VERSION = (__webpack_require__(/*! ./env/data */ "./node_modules/axios/lib/env/data.js").version);
  236. // Expose all/spread
  237. axios.all = function all(promises) {
  238. return Promise.all(promises);
  239. };
  240. axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js");
  241. // Expose isAxiosError
  242. axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./node_modules/axios/lib/helpers/isAxiosError.js");
  243. module.exports = axios;
  244. // Allow use of default import syntax in TypeScript
  245. module.exports["default"] = axios;
  246. /***/ }),
  247. /***/ "./node_modules/axios/lib/cancel/Cancel.js":
  248. /*!*************************************************!*\
  249. !*** ./node_modules/axios/lib/cancel/Cancel.js ***!
  250. \*************************************************/
  251. /***/ ((module) => {
  252. "use strict";
  253. /**
  254. * A `Cancel` is an object that is thrown when an operation is canceled.
  255. *
  256. * @class
  257. * @param {string=} message The message.
  258. */
  259. function Cancel(message) {
  260. this.message = message;
  261. }
  262. Cancel.prototype.toString = function toString() {
  263. return 'Cancel' + (this.message ? ': ' + this.message : '');
  264. };
  265. Cancel.prototype.__CANCEL__ = true;
  266. module.exports = Cancel;
  267. /***/ }),
  268. /***/ "./node_modules/axios/lib/cancel/CancelToken.js":
  269. /*!******************************************************!*\
  270. !*** ./node_modules/axios/lib/cancel/CancelToken.js ***!
  271. \******************************************************/
  272. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  273. "use strict";
  274. var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
  275. /**
  276. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  277. *
  278. * @class
  279. * @param {Function} executor The executor function.
  280. */
  281. function CancelToken(executor) {
  282. if (typeof executor !== 'function') {
  283. throw new TypeError('executor must be a function.');
  284. }
  285. var resolvePromise;
  286. this.promise = new Promise(function promiseExecutor(resolve) {
  287. resolvePromise = resolve;
  288. });
  289. var token = this;
  290. // eslint-disable-next-line func-names
  291. this.promise.then(function(cancel) {
  292. if (!token._listeners) return;
  293. var i;
  294. var l = token._listeners.length;
  295. for (i = 0; i < l; i++) {
  296. token._listeners[i](cancel);
  297. }
  298. token._listeners = null;
  299. });
  300. // eslint-disable-next-line func-names
  301. this.promise.then = function(onfulfilled) {
  302. var _resolve;
  303. // eslint-disable-next-line func-names
  304. var promise = new Promise(function(resolve) {
  305. token.subscribe(resolve);
  306. _resolve = resolve;
  307. }).then(onfulfilled);
  308. promise.cancel = function reject() {
  309. token.unsubscribe(_resolve);
  310. };
  311. return promise;
  312. };
  313. executor(function cancel(message) {
  314. if (token.reason) {
  315. // Cancellation has already been requested
  316. return;
  317. }
  318. token.reason = new Cancel(message);
  319. resolvePromise(token.reason);
  320. });
  321. }
  322. /**
  323. * Throws a `Cancel` if cancellation has been requested.
  324. */
  325. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  326. if (this.reason) {
  327. throw this.reason;
  328. }
  329. };
  330. /**
  331. * Subscribe to the cancel signal
  332. */
  333. CancelToken.prototype.subscribe = function subscribe(listener) {
  334. if (this.reason) {
  335. listener(this.reason);
  336. return;
  337. }
  338. if (this._listeners) {
  339. this._listeners.push(listener);
  340. } else {
  341. this._listeners = [listener];
  342. }
  343. };
  344. /**
  345. * Unsubscribe from the cancel signal
  346. */
  347. CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
  348. if (!this._listeners) {
  349. return;
  350. }
  351. var index = this._listeners.indexOf(listener);
  352. if (index !== -1) {
  353. this._listeners.splice(index, 1);
  354. }
  355. };
  356. /**
  357. * Returns an object that contains a new `CancelToken` and a function that, when called,
  358. * cancels the `CancelToken`.
  359. */
  360. CancelToken.source = function source() {
  361. var cancel;
  362. var token = new CancelToken(function executor(c) {
  363. cancel = c;
  364. });
  365. return {
  366. token: token,
  367. cancel: cancel
  368. };
  369. };
  370. module.exports = CancelToken;
  371. /***/ }),
  372. /***/ "./node_modules/axios/lib/cancel/isCancel.js":
  373. /*!***************************************************!*\
  374. !*** ./node_modules/axios/lib/cancel/isCancel.js ***!
  375. \***************************************************/
  376. /***/ ((module) => {
  377. "use strict";
  378. module.exports = function isCancel(value) {
  379. return !!(value && value.__CANCEL__);
  380. };
  381. /***/ }),
  382. /***/ "./node_modules/axios/lib/core/Axios.js":
  383. /*!**********************************************!*\
  384. !*** ./node_modules/axios/lib/core/Axios.js ***!
  385. \**********************************************/
  386. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  387. "use strict";
  388. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  389. var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
  390. var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js");
  391. var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js");
  392. var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
  393. var validator = __webpack_require__(/*! ../helpers/validator */ "./node_modules/axios/lib/helpers/validator.js");
  394. var validators = validator.validators;
  395. /**
  396. * Create a new instance of Axios
  397. *
  398. * @param {Object} instanceConfig The default config for the instance
  399. */
  400. function Axios(instanceConfig) {
  401. this.defaults = instanceConfig;
  402. this.interceptors = {
  403. request: new InterceptorManager(),
  404. response: new InterceptorManager()
  405. };
  406. }
  407. /**
  408. * Dispatch a request
  409. *
  410. * @param {Object} config The config specific for this request (merged with this.defaults)
  411. */
  412. Axios.prototype.request = function request(config) {
  413. /*eslint no-param-reassign:0*/
  414. // Allow for axios('example/url'[, config]) a la fetch API
  415. if (typeof config === 'string') {
  416. config = arguments[1] || {};
  417. config.url = arguments[0];
  418. } else {
  419. config = config || {};
  420. }
  421. config = mergeConfig(this.defaults, config);
  422. // Set config.method
  423. if (config.method) {
  424. config.method = config.method.toLowerCase();
  425. } else if (this.defaults.method) {
  426. config.method = this.defaults.method.toLowerCase();
  427. } else {
  428. config.method = 'get';
  429. }
  430. var transitional = config.transitional;
  431. if (transitional !== undefined) {
  432. validator.assertOptions(transitional, {
  433. silentJSONParsing: validators.transitional(validators.boolean),
  434. forcedJSONParsing: validators.transitional(validators.boolean),
  435. clarifyTimeoutError: validators.transitional(validators.boolean)
  436. }, false);
  437. }
  438. // filter out skipped interceptors
  439. var requestInterceptorChain = [];
  440. var synchronousRequestInterceptors = true;
  441. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  442. if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
  443. return;
  444. }
  445. synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
  446. requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
  447. });
  448. var responseInterceptorChain = [];
  449. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  450. responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
  451. });
  452. var promise;
  453. if (!synchronousRequestInterceptors) {
  454. var chain = [dispatchRequest, undefined];
  455. Array.prototype.unshift.apply(chain, requestInterceptorChain);
  456. chain = chain.concat(responseInterceptorChain);
  457. promise = Promise.resolve(config);
  458. while (chain.length) {
  459. promise = promise.then(chain.shift(), chain.shift());
  460. }
  461. return promise;
  462. }
  463. var newConfig = config;
  464. while (requestInterceptorChain.length) {
  465. var onFulfilled = requestInterceptorChain.shift();
  466. var onRejected = requestInterceptorChain.shift();
  467. try {
  468. newConfig = onFulfilled(newConfig);
  469. } catch (error) {
  470. onRejected(error);
  471. break;
  472. }
  473. }
  474. try {
  475. promise = dispatchRequest(newConfig);
  476. } catch (error) {
  477. return Promise.reject(error);
  478. }
  479. while (responseInterceptorChain.length) {
  480. promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
  481. }
  482. return promise;
  483. };
  484. Axios.prototype.getUri = function getUri(config) {
  485. config = mergeConfig(this.defaults, config);
  486. return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
  487. };
  488. // Provide aliases for supported request methods
  489. utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  490. /*eslint func-names:0*/
  491. Axios.prototype[method] = function(url, config) {
  492. return this.request(mergeConfig(config || {}, {
  493. method: method,
  494. url: url,
  495. data: (config || {}).data
  496. }));
  497. };
  498. });
  499. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  500. /*eslint func-names:0*/
  501. Axios.prototype[method] = function(url, data, config) {
  502. return this.request(mergeConfig(config || {}, {
  503. method: method,
  504. url: url,
  505. data: data
  506. }));
  507. };
  508. });
  509. module.exports = Axios;
  510. /***/ }),
  511. /***/ "./node_modules/axios/lib/core/InterceptorManager.js":
  512. /*!***********************************************************!*\
  513. !*** ./node_modules/axios/lib/core/InterceptorManager.js ***!
  514. \***********************************************************/
  515. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  516. "use strict";
  517. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  518. function InterceptorManager() {
  519. this.handlers = [];
  520. }
  521. /**
  522. * Add a new interceptor to the stack
  523. *
  524. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  525. * @param {Function} rejected The function to handle `reject` for a `Promise`
  526. *
  527. * @return {Number} An ID used to remove interceptor later
  528. */
  529. InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
  530. this.handlers.push({
  531. fulfilled: fulfilled,
  532. rejected: rejected,
  533. synchronous: options ? options.synchronous : false,
  534. runWhen: options ? options.runWhen : null
  535. });
  536. return this.handlers.length - 1;
  537. };
  538. /**
  539. * Remove an interceptor from the stack
  540. *
  541. * @param {Number} id The ID that was returned by `use`
  542. */
  543. InterceptorManager.prototype.eject = function eject(id) {
  544. if (this.handlers[id]) {
  545. this.handlers[id] = null;
  546. }
  547. };
  548. /**
  549. * Iterate over all the registered interceptors
  550. *
  551. * This method is particularly useful for skipping over any
  552. * interceptors that may have become `null` calling `eject`.
  553. *
  554. * @param {Function} fn The function to call for each interceptor
  555. */
  556. InterceptorManager.prototype.forEach = function forEach(fn) {
  557. utils.forEach(this.handlers, function forEachHandler(h) {
  558. if (h !== null) {
  559. fn(h);
  560. }
  561. });
  562. };
  563. module.exports = InterceptorManager;
  564. /***/ }),
  565. /***/ "./node_modules/axios/lib/core/buildFullPath.js":
  566. /*!******************************************************!*\
  567. !*** ./node_modules/axios/lib/core/buildFullPath.js ***!
  568. \******************************************************/
  569. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  570. "use strict";
  571. var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js");
  572. var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js");
  573. /**
  574. * Creates a new URL by combining the baseURL with the requestedURL,
  575. * only when the requestedURL is not already an absolute URL.
  576. * If the requestURL is absolute, this function returns the requestedURL untouched.
  577. *
  578. * @param {string} baseURL The base URL
  579. * @param {string} requestedURL Absolute or relative URL to combine
  580. * @returns {string} The combined full path
  581. */
  582. module.exports = function buildFullPath(baseURL, requestedURL) {
  583. if (baseURL && !isAbsoluteURL(requestedURL)) {
  584. return combineURLs(baseURL, requestedURL);
  585. }
  586. return requestedURL;
  587. };
  588. /***/ }),
  589. /***/ "./node_modules/axios/lib/core/createError.js":
  590. /*!****************************************************!*\
  591. !*** ./node_modules/axios/lib/core/createError.js ***!
  592. \****************************************************/
  593. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  594. "use strict";
  595. var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");
  596. /**
  597. * Create an Error with the specified message, config, error code, request and response.
  598. *
  599. * @param {string} message The error message.
  600. * @param {Object} config The config.
  601. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  602. * @param {Object} [request] The request.
  603. * @param {Object} [response] The response.
  604. * @returns {Error} The created error.
  605. */
  606. module.exports = function createError(message, config, code, request, response) {
  607. var error = new Error(message);
  608. return enhanceError(error, config, code, request, response);
  609. };
  610. /***/ }),
  611. /***/ "./node_modules/axios/lib/core/dispatchRequest.js":
  612. /*!********************************************************!*\
  613. !*** ./node_modules/axios/lib/core/dispatchRequest.js ***!
  614. \********************************************************/
  615. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  616. "use strict";
  617. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  618. var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js");
  619. var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
  620. var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js");
  621. var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
  622. /**
  623. * Throws a `Cancel` if cancellation has been requested.
  624. */
  625. function throwIfCancellationRequested(config) {
  626. if (config.cancelToken) {
  627. config.cancelToken.throwIfRequested();
  628. }
  629. if (config.signal && config.signal.aborted) {
  630. throw new Cancel('canceled');
  631. }
  632. }
  633. /**
  634. * Dispatch a request to the server using the configured adapter.
  635. *
  636. * @param {object} config The config that is to be used for the request
  637. * @returns {Promise} The Promise to be fulfilled
  638. */
  639. module.exports = function dispatchRequest(config) {
  640. throwIfCancellationRequested(config);
  641. // Ensure headers exist
  642. config.headers = config.headers || {};
  643. // Transform request data
  644. config.data = transformData.call(
  645. config,
  646. config.data,
  647. config.headers,
  648. config.transformRequest
  649. );
  650. // Flatten headers
  651. config.headers = utils.merge(
  652. config.headers.common || {},
  653. config.headers[config.method] || {},
  654. config.headers
  655. );
  656. utils.forEach(
  657. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  658. function cleanHeaderConfig(method) {
  659. delete config.headers[method];
  660. }
  661. );
  662. var adapter = config.adapter || defaults.adapter;
  663. return adapter(config).then(function onAdapterResolution(response) {
  664. throwIfCancellationRequested(config);
  665. // Transform response data
  666. response.data = transformData.call(
  667. config,
  668. response.data,
  669. response.headers,
  670. config.transformResponse
  671. );
  672. return response;
  673. }, function onAdapterRejection(reason) {
  674. if (!isCancel(reason)) {
  675. throwIfCancellationRequested(config);
  676. // Transform response data
  677. if (reason && reason.response) {
  678. reason.response.data = transformData.call(
  679. config,
  680. reason.response.data,
  681. reason.response.headers,
  682. config.transformResponse
  683. );
  684. }
  685. }
  686. return Promise.reject(reason);
  687. });
  688. };
  689. /***/ }),
  690. /***/ "./node_modules/axios/lib/core/enhanceError.js":
  691. /*!*****************************************************!*\
  692. !*** ./node_modules/axios/lib/core/enhanceError.js ***!
  693. \*****************************************************/
  694. /***/ ((module) => {
  695. "use strict";
  696. /**
  697. * Update an Error with the specified config, error code, and response.
  698. *
  699. * @param {Error} error The error to update.
  700. * @param {Object} config The config.
  701. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  702. * @param {Object} [request] The request.
  703. * @param {Object} [response] The response.
  704. * @returns {Error} The error.
  705. */
  706. module.exports = function enhanceError(error, config, code, request, response) {
  707. error.config = config;
  708. if (code) {
  709. error.code = code;
  710. }
  711. error.request = request;
  712. error.response = response;
  713. error.isAxiosError = true;
  714. error.toJSON = function toJSON() {
  715. return {
  716. // Standard
  717. message: this.message,
  718. name: this.name,
  719. // Microsoft
  720. description: this.description,
  721. number: this.number,
  722. // Mozilla
  723. fileName: this.fileName,
  724. lineNumber: this.lineNumber,
  725. columnNumber: this.columnNumber,
  726. stack: this.stack,
  727. // Axios
  728. config: this.config,
  729. code: this.code,
  730. status: this.response && this.response.status ? this.response.status : null
  731. };
  732. };
  733. return error;
  734. };
  735. /***/ }),
  736. /***/ "./node_modules/axios/lib/core/mergeConfig.js":
  737. /*!****************************************************!*\
  738. !*** ./node_modules/axios/lib/core/mergeConfig.js ***!
  739. \****************************************************/
  740. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  741. "use strict";
  742. var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
  743. /**
  744. * Config-specific merge-function which creates a new config-object
  745. * by merging two configuration objects together.
  746. *
  747. * @param {Object} config1
  748. * @param {Object} config2
  749. * @returns {Object} New object resulting from merging config2 to config1
  750. */
  751. module.exports = function mergeConfig(config1, config2) {
  752. // eslint-disable-next-line no-param-reassign
  753. config2 = config2 || {};
  754. var config = {};
  755. function getMergedValue(target, source) {
  756. if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
  757. return utils.merge(target, source);
  758. } else if (utils.isPlainObject(source)) {
  759. return utils.merge({}, source);
  760. } else if (utils.isArray(source)) {
  761. return source.slice();
  762. }
  763. return source;
  764. }
  765. // eslint-disable-next-line consistent-return
  766. function mergeDeepProperties(prop) {
  767. if (!utils.isUndefined(config2[prop])) {
  768. return getMergedValue(config1[prop], config2[prop]);
  769. } else if (!utils.isUndefined(config1[prop])) {
  770. return getMergedValue(undefined, config1[prop]);
  771. }
  772. }
  773. // eslint-disable-next-line consistent-return
  774. function valueFromConfig2(prop) {
  775. if (!utils.isUndefined(config2[prop])) {
  776. return getMergedValue(undefined, config2[prop]);
  777. }
  778. }
  779. // eslint-disable-next-line consistent-return
  780. function defaultToConfig2(prop) {
  781. if (!utils.isUndefined(config2[prop])) {
  782. return getMergedValue(undefined, config2[prop]);
  783. } else if (!utils.isUndefined(config1[prop])) {
  784. return getMergedValue(undefined, config1[prop]);
  785. }
  786. }
  787. // eslint-disable-next-line consistent-return
  788. function mergeDirectKeys(prop) {
  789. if (prop in config2) {
  790. return getMergedValue(config1[prop], config2[prop]);
  791. } else if (prop in config1) {
  792. return getMergedValue(undefined, config1[prop]);
  793. }
  794. }
  795. var mergeMap = {
  796. 'url': valueFromConfig2,
  797. 'method': valueFromConfig2,
  798. 'data': valueFromConfig2,
  799. 'baseURL': defaultToConfig2,
  800. 'transformRequest': defaultToConfig2,
  801. 'transformResponse': defaultToConfig2,
  802. 'paramsSerializer': defaultToConfig2,
  803. 'timeout': defaultToConfig2,
  804. 'timeoutMessage': defaultToConfig2,
  805. 'withCredentials': defaultToConfig2,
  806. 'adapter': defaultToConfig2,
  807. 'responseType': defaultToConfig2,
  808. 'xsrfCookieName': defaultToConfig2,
  809. 'xsrfHeaderName': defaultToConfig2,
  810. 'onUploadProgress': defaultToConfig2,
  811. 'onDownloadProgress': defaultToConfig2,
  812. 'decompress': defaultToConfig2,
  813. 'maxContentLength': defaultToConfig2,
  814. 'maxBodyLength': defaultToConfig2,
  815. 'transport': defaultToConfig2,
  816. 'httpAgent': defaultToConfig2,
  817. 'httpsAgent': defaultToConfig2,
  818. 'cancelToken': defaultToConfig2,
  819. 'socketPath': defaultToConfig2,
  820. 'responseEncoding': defaultToConfig2,
  821. 'validateStatus': mergeDirectKeys
  822. };
  823. utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
  824. var merge = mergeMap[prop] || mergeDeepProperties;
  825. var configValue = merge(prop);
  826. (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
  827. });
  828. return config;
  829. };
  830. /***/ }),
  831. /***/ "./node_modules/axios/lib/core/settle.js":
  832. /*!***********************************************!*\
  833. !*** ./node_modules/axios/lib/core/settle.js ***!
  834. \***********************************************/
  835. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  836. "use strict";
  837. var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js");
  838. /**
  839. * Resolve or reject a Promise based on response status.
  840. *
  841. * @param {Function} resolve A function that resolves the promise.
  842. * @param {Function} reject A function that rejects the promise.
  843. * @param {object} response The response.
  844. */
  845. module.exports = function settle(resolve, reject, response) {
  846. var validateStatus = response.config.validateStatus;
  847. if (!response.status || !validateStatus || validateStatus(response.status)) {
  848. resolve(response);
  849. } else {
  850. reject(createError(
  851. 'Request failed with status code ' + response.status,
  852. response.config,
  853. null,
  854. response.request,
  855. response
  856. ));
  857. }
  858. };
  859. /***/ }),
  860. /***/ "./node_modules/axios/lib/core/transformData.js":
  861. /*!******************************************************!*\
  862. !*** ./node_modules/axios/lib/core/transformData.js ***!
  863. \******************************************************/
  864. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  865. "use strict";
  866. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  867. var defaults = __webpack_require__(/*! ./../defaults */ "./node_modules/axios/lib/defaults.js");
  868. /**
  869. * Transform the data for a request or a response
  870. *
  871. * @param {Object|String} data The data to be transformed
  872. * @param {Array} headers The headers for the request or response
  873. * @param {Array|Function} fns A single function or Array of functions
  874. * @returns {*} The resulting transformed data
  875. */
  876. module.exports = function transformData(data, headers, fns) {
  877. var context = this || defaults;
  878. /*eslint no-param-reassign:0*/
  879. utils.forEach(fns, function transform(fn) {
  880. data = fn.call(context, data, headers);
  881. });
  882. return data;
  883. };
  884. /***/ }),
  885. /***/ "./node_modules/axios/lib/defaults.js":
  886. /*!********************************************!*\
  887. !*** ./node_modules/axios/lib/defaults.js ***!
  888. \********************************************/
  889. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  890. "use strict";
  891. var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
  892. var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js");
  893. var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");
  894. var DEFAULT_CONTENT_TYPE = {
  895. 'Content-Type': 'application/x-www-form-urlencoded'
  896. };
  897. function setContentTypeIfUnset(headers, value) {
  898. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  899. headers['Content-Type'] = value;
  900. }
  901. }
  902. function getDefaultAdapter() {
  903. var adapter;
  904. if (typeof XMLHttpRequest !== 'undefined') {
  905. // For browsers use XHR adapter
  906. adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js");
  907. } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
  908. // For node use HTTP adapter
  909. adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js");
  910. }
  911. return adapter;
  912. }
  913. function stringifySafely(rawValue, parser, encoder) {
  914. if (utils.isString(rawValue)) {
  915. try {
  916. (parser || JSON.parse)(rawValue);
  917. return utils.trim(rawValue);
  918. } catch (e) {
  919. if (e.name !== 'SyntaxError') {
  920. throw e;
  921. }
  922. }
  923. }
  924. return (encoder || JSON.stringify)(rawValue);
  925. }
  926. var defaults = {
  927. transitional: {
  928. silentJSONParsing: true,
  929. forcedJSONParsing: true,
  930. clarifyTimeoutError: false
  931. },
  932. adapter: getDefaultAdapter(),
  933. transformRequest: [function transformRequest(data, headers) {
  934. normalizeHeaderName(headers, 'Accept');
  935. normalizeHeaderName(headers, 'Content-Type');
  936. if (utils.isFormData(data) ||
  937. utils.isArrayBuffer(data) ||
  938. utils.isBuffer(data) ||
  939. utils.isStream(data) ||
  940. utils.isFile(data) ||
  941. utils.isBlob(data)
  942. ) {
  943. return data;
  944. }
  945. if (utils.isArrayBufferView(data)) {
  946. return data.buffer;
  947. }
  948. if (utils.isURLSearchParams(data)) {
  949. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  950. return data.toString();
  951. }
  952. if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {
  953. setContentTypeIfUnset(headers, 'application/json');
  954. return stringifySafely(data);
  955. }
  956. return data;
  957. }],
  958. transformResponse: [function transformResponse(data) {
  959. var transitional = this.transitional || defaults.transitional;
  960. var silentJSONParsing = transitional && transitional.silentJSONParsing;
  961. var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
  962. var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
  963. if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
  964. try {
  965. return JSON.parse(data);
  966. } catch (e) {
  967. if (strictJSONParsing) {
  968. if (e.name === 'SyntaxError') {
  969. throw enhanceError(e, this, 'E_JSON_PARSE');
  970. }
  971. throw e;
  972. }
  973. }
  974. }
  975. return data;
  976. }],
  977. /**
  978. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  979. * timeout is not created.
  980. */
  981. timeout: 0,
  982. xsrfCookieName: 'XSRF-TOKEN',
  983. xsrfHeaderName: 'X-XSRF-TOKEN',
  984. maxContentLength: -1,
  985. maxBodyLength: -1,
  986. validateStatus: function validateStatus(status) {
  987. return status >= 200 && status < 300;
  988. },
  989. headers: {
  990. common: {
  991. 'Accept': 'application/json, text/plain, */*'
  992. }
  993. }
  994. };
  995. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  996. defaults.headers[method] = {};
  997. });
  998. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  999. defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
  1000. });
  1001. module.exports = defaults;
  1002. /***/ }),
  1003. /***/ "./node_modules/axios/lib/env/data.js":
  1004. /*!********************************************!*\
  1005. !*** ./node_modules/axios/lib/env/data.js ***!
  1006. \********************************************/
  1007. /***/ ((module) => {
  1008. module.exports = {
  1009. "version": "0.24.0"
  1010. };
  1011. /***/ }),
  1012. /***/ "./node_modules/axios/lib/helpers/bind.js":
  1013. /*!************************************************!*\
  1014. !*** ./node_modules/axios/lib/helpers/bind.js ***!
  1015. \************************************************/
  1016. /***/ ((module) => {
  1017. "use strict";
  1018. module.exports = function bind(fn, thisArg) {
  1019. return function wrap() {
  1020. var args = new Array(arguments.length);
  1021. for (var i = 0; i < args.length; i++) {
  1022. args[i] = arguments[i];
  1023. }
  1024. return fn.apply(thisArg, args);
  1025. };
  1026. };
  1027. /***/ }),
  1028. /***/ "./node_modules/axios/lib/helpers/buildURL.js":
  1029. /*!****************************************************!*\
  1030. !*** ./node_modules/axios/lib/helpers/buildURL.js ***!
  1031. \****************************************************/
  1032. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1033. "use strict";
  1034. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  1035. function encode(val) {
  1036. return encodeURIComponent(val).
  1037. replace(/%3A/gi, ':').
  1038. replace(/%24/g, '$').
  1039. replace(/%2C/gi, ',').
  1040. replace(/%20/g, '+').
  1041. replace(/%5B/gi, '[').
  1042. replace(/%5D/gi, ']');
  1043. }
  1044. /**
  1045. * Build a URL by appending params to the end
  1046. *
  1047. * @param {string} url The base of the url (e.g., http://www.google.com)
  1048. * @param {object} [params] The params to be appended
  1049. * @returns {string} The formatted url
  1050. */
  1051. module.exports = function buildURL(url, params, paramsSerializer) {
  1052. /*eslint no-param-reassign:0*/
  1053. if (!params) {
  1054. return url;
  1055. }
  1056. var serializedParams;
  1057. if (paramsSerializer) {
  1058. serializedParams = paramsSerializer(params);
  1059. } else if (utils.isURLSearchParams(params)) {
  1060. serializedParams = params.toString();
  1061. } else {
  1062. var parts = [];
  1063. utils.forEach(params, function serialize(val, key) {
  1064. if (val === null || typeof val === 'undefined') {
  1065. return;
  1066. }
  1067. if (utils.isArray(val)) {
  1068. key = key + '[]';
  1069. } else {
  1070. val = [val];
  1071. }
  1072. utils.forEach(val, function parseValue(v) {
  1073. if (utils.isDate(v)) {
  1074. v = v.toISOString();
  1075. } else if (utils.isObject(v)) {
  1076. v = JSON.stringify(v);
  1077. }
  1078. parts.push(encode(key) + '=' + encode(v));
  1079. });
  1080. });
  1081. serializedParams = parts.join('&');
  1082. }
  1083. if (serializedParams) {
  1084. var hashmarkIndex = url.indexOf('#');
  1085. if (hashmarkIndex !== -1) {
  1086. url = url.slice(0, hashmarkIndex);
  1087. }
  1088. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  1089. }
  1090. return url;
  1091. };
  1092. /***/ }),
  1093. /***/ "./node_modules/axios/lib/helpers/combineURLs.js":
  1094. /*!*******************************************************!*\
  1095. !*** ./node_modules/axios/lib/helpers/combineURLs.js ***!
  1096. \*******************************************************/
  1097. /***/ ((module) => {
  1098. "use strict";
  1099. /**
  1100. * Creates a new URL by combining the specified URLs
  1101. *
  1102. * @param {string} baseURL The base URL
  1103. * @param {string} relativeURL The relative URL
  1104. * @returns {string} The combined URL
  1105. */
  1106. module.exports = function combineURLs(baseURL, relativeURL) {
  1107. return relativeURL
  1108. ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
  1109. : baseURL;
  1110. };
  1111. /***/ }),
  1112. /***/ "./node_modules/axios/lib/helpers/cookies.js":
  1113. /*!***************************************************!*\
  1114. !*** ./node_modules/axios/lib/helpers/cookies.js ***!
  1115. \***************************************************/
  1116. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1117. "use strict";
  1118. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  1119. module.exports = (
  1120. utils.isStandardBrowserEnv() ?
  1121. // Standard browser envs support document.cookie
  1122. (function standardBrowserEnv() {
  1123. return {
  1124. write: function write(name, value, expires, path, domain, secure) {
  1125. var cookie = [];
  1126. cookie.push(name + '=' + encodeURIComponent(value));
  1127. if (utils.isNumber(expires)) {
  1128. cookie.push('expires=' + new Date(expires).toGMTString());
  1129. }
  1130. if (utils.isString(path)) {
  1131. cookie.push('path=' + path);
  1132. }
  1133. if (utils.isString(domain)) {
  1134. cookie.push('domain=' + domain);
  1135. }
  1136. if (secure === true) {
  1137. cookie.push('secure');
  1138. }
  1139. document.cookie = cookie.join('; ');
  1140. },
  1141. read: function read(name) {
  1142. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  1143. return (match ? decodeURIComponent(match[3]) : null);
  1144. },
  1145. remove: function remove(name) {
  1146. this.write(name, '', Date.now() - 86400000);
  1147. }
  1148. };
  1149. })() :
  1150. // Non standard browser env (web workers, react-native) lack needed support.
  1151. (function nonStandardBrowserEnv() {
  1152. return {
  1153. write: function write() {},
  1154. read: function read() { return null; },
  1155. remove: function remove() {}
  1156. };
  1157. })()
  1158. );
  1159. /***/ }),
  1160. /***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js":
  1161. /*!*********************************************************!*\
  1162. !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***!
  1163. \*********************************************************/
  1164. /***/ ((module) => {
  1165. "use strict";
  1166. /**
  1167. * Determines whether the specified URL is absolute
  1168. *
  1169. * @param {string} url The URL to test
  1170. * @returns {boolean} True if the specified URL is absolute, otherwise false
  1171. */
  1172. module.exports = function isAbsoluteURL(url) {
  1173. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  1174. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  1175. // by any combination of letters, digits, plus, period, or hyphen.
  1176. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  1177. };
  1178. /***/ }),
  1179. /***/ "./node_modules/axios/lib/helpers/isAxiosError.js":
  1180. /*!********************************************************!*\
  1181. !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***!
  1182. \********************************************************/
  1183. /***/ ((module) => {
  1184. "use strict";
  1185. /**
  1186. * Determines whether the payload is an error thrown by Axios
  1187. *
  1188. * @param {*} payload The value to test
  1189. * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
  1190. */
  1191. module.exports = function isAxiosError(payload) {
  1192. return (typeof payload === 'object') && (payload.isAxiosError === true);
  1193. };
  1194. /***/ }),
  1195. /***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js":
  1196. /*!***********************************************************!*\
  1197. !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***!
  1198. \***********************************************************/
  1199. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1200. "use strict";
  1201. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  1202. module.exports = (
  1203. utils.isStandardBrowserEnv() ?
  1204. // Standard browser envs have full support of the APIs needed to test
  1205. // whether the request URL is of the same origin as current location.
  1206. (function standardBrowserEnv() {
  1207. var msie = /(msie|trident)/i.test(navigator.userAgent);
  1208. var urlParsingNode = document.createElement('a');
  1209. var originURL;
  1210. /**
  1211. * Parse a URL to discover it's components
  1212. *
  1213. * @param {String} url The URL to be parsed
  1214. * @returns {Object}
  1215. */
  1216. function resolveURL(url) {
  1217. var href = url;
  1218. if (msie) {
  1219. // IE needs attribute set twice to normalize properties
  1220. urlParsingNode.setAttribute('href', href);
  1221. href = urlParsingNode.href;
  1222. }
  1223. urlParsingNode.setAttribute('href', href);
  1224. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  1225. return {
  1226. href: urlParsingNode.href,
  1227. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  1228. host: urlParsingNode.host,
  1229. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  1230. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  1231. hostname: urlParsingNode.hostname,
  1232. port: urlParsingNode.port,
  1233. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  1234. urlParsingNode.pathname :
  1235. '/' + urlParsingNode.pathname
  1236. };
  1237. }
  1238. originURL = resolveURL(window.location.href);
  1239. /**
  1240. * Determine if a URL shares the same origin as the current location
  1241. *
  1242. * @param {String} requestURL The URL to test
  1243. * @returns {boolean} True if URL shares the same origin, otherwise false
  1244. */
  1245. return function isURLSameOrigin(requestURL) {
  1246. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  1247. return (parsed.protocol === originURL.protocol &&
  1248. parsed.host === originURL.host);
  1249. };
  1250. })() :
  1251. // Non standard browser envs (web workers, react-native) lack needed support.
  1252. (function nonStandardBrowserEnv() {
  1253. return function isURLSameOrigin() {
  1254. return true;
  1255. };
  1256. })()
  1257. );
  1258. /***/ }),
  1259. /***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js":
  1260. /*!***************************************************************!*\
  1261. !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***!
  1262. \***************************************************************/
  1263. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1264. "use strict";
  1265. var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
  1266. module.exports = function normalizeHeaderName(headers, normalizedName) {
  1267. utils.forEach(headers, function processHeader(value, name) {
  1268. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  1269. headers[normalizedName] = value;
  1270. delete headers[name];
  1271. }
  1272. });
  1273. };
  1274. /***/ }),
  1275. /***/ "./node_modules/axios/lib/helpers/parseHeaders.js":
  1276. /*!********************************************************!*\
  1277. !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***!
  1278. \********************************************************/
  1279. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1280. "use strict";
  1281. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  1282. // Headers whose duplicates are ignored by node
  1283. // c.f. https://nodejs.org/api/http.html#http_message_headers
  1284. var ignoreDuplicateOf = [
  1285. 'age', 'authorization', 'content-length', 'content-type', 'etag',
  1286. 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
  1287. 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
  1288. 'referer', 'retry-after', 'user-agent'
  1289. ];
  1290. /**
  1291. * Parse headers into an object
  1292. *
  1293. * ```
  1294. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  1295. * Content-Type: application/json
  1296. * Connection: keep-alive
  1297. * Transfer-Encoding: chunked
  1298. * ```
  1299. *
  1300. * @param {String} headers Headers needing to be parsed
  1301. * @returns {Object} Headers parsed into an object
  1302. */
  1303. module.exports = function parseHeaders(headers) {
  1304. var parsed = {};
  1305. var key;
  1306. var val;
  1307. var i;
  1308. if (!headers) { return parsed; }
  1309. utils.forEach(headers.split('\n'), function parser(line) {
  1310. i = line.indexOf(':');
  1311. key = utils.trim(line.substr(0, i)).toLowerCase();
  1312. val = utils.trim(line.substr(i + 1));
  1313. if (key) {
  1314. if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
  1315. return;
  1316. }
  1317. if (key === 'set-cookie') {
  1318. parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
  1319. } else {
  1320. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  1321. }
  1322. }
  1323. });
  1324. return parsed;
  1325. };
  1326. /***/ }),
  1327. /***/ "./node_modules/axios/lib/helpers/spread.js":
  1328. /*!**************************************************!*\
  1329. !*** ./node_modules/axios/lib/helpers/spread.js ***!
  1330. \**************************************************/
  1331. /***/ ((module) => {
  1332. "use strict";
  1333. /**
  1334. * Syntactic sugar for invoking a function and expanding an array for arguments.
  1335. *
  1336. * Common use case would be to use `Function.prototype.apply`.
  1337. *
  1338. * ```js
  1339. * function f(x, y, z) {}
  1340. * var args = [1, 2, 3];
  1341. * f.apply(null, args);
  1342. * ```
  1343. *
  1344. * With `spread` this example can be re-written.
  1345. *
  1346. * ```js
  1347. * spread(function(x, y, z) {})([1, 2, 3]);
  1348. * ```
  1349. *
  1350. * @param {Function} callback
  1351. * @returns {Function}
  1352. */
  1353. module.exports = function spread(callback) {
  1354. return function wrap(arr) {
  1355. return callback.apply(null, arr);
  1356. };
  1357. };
  1358. /***/ }),
  1359. /***/ "./node_modules/axios/lib/helpers/validator.js":
  1360. /*!*****************************************************!*\
  1361. !*** ./node_modules/axios/lib/helpers/validator.js ***!
  1362. \*****************************************************/
  1363. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1364. "use strict";
  1365. var VERSION = (__webpack_require__(/*! ../env/data */ "./node_modules/axios/lib/env/data.js").version);
  1366. var validators = {};
  1367. // eslint-disable-next-line func-names
  1368. ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {
  1369. validators[type] = function validator(thing) {
  1370. return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
  1371. };
  1372. });
  1373. var deprecatedWarnings = {};
  1374. /**
  1375. * Transitional option validator
  1376. * @param {function|boolean?} validator - set to false if the transitional option has been removed
  1377. * @param {string?} version - deprecated version / removed since version
  1378. * @param {string?} message - some message with additional info
  1379. * @returns {function}
  1380. */
  1381. validators.transitional = function transitional(validator, version, message) {
  1382. function formatMessage(opt, desc) {
  1383. return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
  1384. }
  1385. // eslint-disable-next-line func-names
  1386. return function(value, opt, opts) {
  1387. if (validator === false) {
  1388. throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));
  1389. }
  1390. if (version && !deprecatedWarnings[opt]) {
  1391. deprecatedWarnings[opt] = true;
  1392. // eslint-disable-next-line no-console
  1393. console.warn(
  1394. formatMessage(
  1395. opt,
  1396. ' has been deprecated since v' + version + ' and will be removed in the near future'
  1397. )
  1398. );
  1399. }
  1400. return validator ? validator(value, opt, opts) : true;
  1401. };
  1402. };
  1403. /**
  1404. * Assert object's properties type
  1405. * @param {object} options
  1406. * @param {object} schema
  1407. * @param {boolean?} allowUnknown
  1408. */
  1409. function assertOptions(options, schema, allowUnknown) {
  1410. if (typeof options !== 'object') {
  1411. throw new TypeError('options must be an object');
  1412. }
  1413. var keys = Object.keys(options);
  1414. var i = keys.length;
  1415. while (i-- > 0) {
  1416. var opt = keys[i];
  1417. var validator = schema[opt];
  1418. if (validator) {
  1419. var value = options[opt];
  1420. var result = value === undefined || validator(value, opt, options);
  1421. if (result !== true) {
  1422. throw new TypeError('option ' + opt + ' must be ' + result);
  1423. }
  1424. continue;
  1425. }
  1426. if (allowUnknown !== true) {
  1427. throw Error('Unknown option ' + opt);
  1428. }
  1429. }
  1430. }
  1431. module.exports = {
  1432. assertOptions: assertOptions,
  1433. validators: validators
  1434. };
  1435. /***/ }),
  1436. /***/ "./node_modules/axios/lib/utils.js":
  1437. /*!*****************************************!*\
  1438. !*** ./node_modules/axios/lib/utils.js ***!
  1439. \*****************************************/
  1440. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1441. "use strict";
  1442. var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
  1443. // utils is a library of generic helper functions non-specific to axios
  1444. var toString = Object.prototype.toString;
  1445. /**
  1446. * Determine if a value is an Array
  1447. *
  1448. * @param {Object} val The value to test
  1449. * @returns {boolean} True if value is an Array, otherwise false
  1450. */
  1451. function isArray(val) {
  1452. return toString.call(val) === '[object Array]';
  1453. }
  1454. /**
  1455. * Determine if a value is undefined
  1456. *
  1457. * @param {Object} val The value to test
  1458. * @returns {boolean} True if the value is undefined, otherwise false
  1459. */
  1460. function isUndefined(val) {
  1461. return typeof val === 'undefined';
  1462. }
  1463. /**
  1464. * Determine if a value is a Buffer
  1465. *
  1466. * @param {Object} val The value to test
  1467. * @returns {boolean} True if value is a Buffer, otherwise false
  1468. */
  1469. function isBuffer(val) {
  1470. return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
  1471. && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
  1472. }
  1473. /**
  1474. * Determine if a value is an ArrayBuffer
  1475. *
  1476. * @param {Object} val The value to test
  1477. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  1478. */
  1479. function isArrayBuffer(val) {
  1480. return toString.call(val) === '[object ArrayBuffer]';
  1481. }
  1482. /**
  1483. * Determine if a value is a FormData
  1484. *
  1485. * @param {Object} val The value to test
  1486. * @returns {boolean} True if value is an FormData, otherwise false
  1487. */
  1488. function isFormData(val) {
  1489. return (typeof FormData !== 'undefined') && (val instanceof FormData);
  1490. }
  1491. /**
  1492. * Determine if a value is a view on an ArrayBuffer
  1493. *
  1494. * @param {Object} val The value to test
  1495. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  1496. */
  1497. function isArrayBufferView(val) {
  1498. var result;
  1499. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  1500. result = ArrayBuffer.isView(val);
  1501. } else {
  1502. result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
  1503. }
  1504. return result;
  1505. }
  1506. /**
  1507. * Determine if a value is a String
  1508. *
  1509. * @param {Object} val The value to test
  1510. * @returns {boolean} True if value is a String, otherwise false
  1511. */
  1512. function isString(val) {
  1513. return typeof val === 'string';
  1514. }
  1515. /**
  1516. * Determine if a value is a Number
  1517. *
  1518. * @param {Object} val The value to test
  1519. * @returns {boolean} True if value is a Number, otherwise false
  1520. */
  1521. function isNumber(val) {
  1522. return typeof val === 'number';
  1523. }
  1524. /**
  1525. * Determine if a value is an Object
  1526. *
  1527. * @param {Object} val The value to test
  1528. * @returns {boolean} True if value is an Object, otherwise false
  1529. */
  1530. function isObject(val) {
  1531. return val !== null && typeof val === 'object';
  1532. }
  1533. /**
  1534. * Determine if a value is a plain Object
  1535. *
  1536. * @param {Object} val The value to test
  1537. * @return {boolean} True if value is a plain Object, otherwise false
  1538. */
  1539. function isPlainObject(val) {
  1540. if (toString.call(val) !== '[object Object]') {
  1541. return false;
  1542. }
  1543. var prototype = Object.getPrototypeOf(val);
  1544. return prototype === null || prototype === Object.prototype;
  1545. }
  1546. /**
  1547. * Determine if a value is a Date
  1548. *
  1549. * @param {Object} val The value to test
  1550. * @returns {boolean} True if value is a Date, otherwise false
  1551. */
  1552. function isDate(val) {
  1553. return toString.call(val) === '[object Date]';
  1554. }
  1555. /**
  1556. * Determine if a value is a File
  1557. *
  1558. * @param {Object} val The value to test
  1559. * @returns {boolean} True if value is a File, otherwise false
  1560. */
  1561. function isFile(val) {
  1562. return toString.call(val) === '[object File]';
  1563. }
  1564. /**
  1565. * Determine if a value is a Blob
  1566. *
  1567. * @param {Object} val The value to test
  1568. * @returns {boolean} True if value is a Blob, otherwise false
  1569. */
  1570. function isBlob(val) {
  1571. return toString.call(val) === '[object Blob]';
  1572. }
  1573. /**
  1574. * Determine if a value is a Function
  1575. *
  1576. * @param {Object} val The value to test
  1577. * @returns {boolean} True if value is a Function, otherwise false
  1578. */
  1579. function isFunction(val) {
  1580. return toString.call(val) === '[object Function]';
  1581. }
  1582. /**
  1583. * Determine if a value is a Stream
  1584. *
  1585. * @param {Object} val The value to test
  1586. * @returns {boolean} True if value is a Stream, otherwise false
  1587. */
  1588. function isStream(val) {
  1589. return isObject(val) && isFunction(val.pipe);
  1590. }
  1591. /**
  1592. * Determine if a value is a URLSearchParams object
  1593. *
  1594. * @param {Object} val The value to test
  1595. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  1596. */
  1597. function isURLSearchParams(val) {
  1598. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  1599. }
  1600. /**
  1601. * Trim excess whitespace off the beginning and end of a string
  1602. *
  1603. * @param {String} str The String to trim
  1604. * @returns {String} The String freed of excess whitespace
  1605. */
  1606. function trim(str) {
  1607. return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
  1608. }
  1609. /**
  1610. * Determine if we're running in a standard browser environment
  1611. *
  1612. * This allows axios to run in a web worker, and react-native.
  1613. * Both environments support XMLHttpRequest, but not fully standard globals.
  1614. *
  1615. * web workers:
  1616. * typeof window -> undefined
  1617. * typeof document -> undefined
  1618. *
  1619. * react-native:
  1620. * navigator.product -> 'ReactNative'
  1621. * nativescript
  1622. * navigator.product -> 'NativeScript' or 'NS'
  1623. */
  1624. function isStandardBrowserEnv() {
  1625. if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
  1626. navigator.product === 'NativeScript' ||
  1627. navigator.product === 'NS')) {
  1628. return false;
  1629. }
  1630. return (
  1631. typeof window !== 'undefined' &&
  1632. typeof document !== 'undefined'
  1633. );
  1634. }
  1635. /**
  1636. * Iterate over an Array or an Object invoking a function for each item.
  1637. *
  1638. * If `obj` is an Array callback will be called passing
  1639. * the value, index, and complete array for each item.
  1640. *
  1641. * If 'obj' is an Object callback will be called passing
  1642. * the value, key, and complete object for each property.
  1643. *
  1644. * @param {Object|Array} obj The object to iterate
  1645. * @param {Function} fn The callback to invoke for each item
  1646. */
  1647. function forEach(obj, fn) {
  1648. // Don't bother if no value provided
  1649. if (obj === null || typeof obj === 'undefined') {
  1650. return;
  1651. }
  1652. // Force an array if not already something iterable
  1653. if (typeof obj !== 'object') {
  1654. /*eslint no-param-reassign:0*/
  1655. obj = [obj];
  1656. }
  1657. if (isArray(obj)) {
  1658. // Iterate over array values
  1659. for (var i = 0, l = obj.length; i < l; i++) {
  1660. fn.call(null, obj[i], i, obj);
  1661. }
  1662. } else {
  1663. // Iterate over object keys
  1664. for (var key in obj) {
  1665. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  1666. fn.call(null, obj[key], key, obj);
  1667. }
  1668. }
  1669. }
  1670. }
  1671. /**
  1672. * Accepts varargs expecting each argument to be an object, then
  1673. * immutably merges the properties of each object and returns result.
  1674. *
  1675. * When multiple objects contain the same key the later object in
  1676. * the arguments list will take precedence.
  1677. *
  1678. * Example:
  1679. *
  1680. * ```js
  1681. * var result = merge({foo: 123}, {foo: 456});
  1682. * console.log(result.foo); // outputs 456
  1683. * ```
  1684. *
  1685. * @param {Object} obj1 Object to merge
  1686. * @returns {Object} Result of all merge properties
  1687. */
  1688. function merge(/* obj1, obj2, obj3, ... */) {
  1689. var result = {};
  1690. function assignValue(val, key) {
  1691. if (isPlainObject(result[key]) && isPlainObject(val)) {
  1692. result[key] = merge(result[key], val);
  1693. } else if (isPlainObject(val)) {
  1694. result[key] = merge({}, val);
  1695. } else if (isArray(val)) {
  1696. result[key] = val.slice();
  1697. } else {
  1698. result[key] = val;
  1699. }
  1700. }
  1701. for (var i = 0, l = arguments.length; i < l; i++) {
  1702. forEach(arguments[i], assignValue);
  1703. }
  1704. return result;
  1705. }
  1706. /**
  1707. * Extends object a by mutably adding to it the properties of object b.
  1708. *
  1709. * @param {Object} a The object to be extended
  1710. * @param {Object} b The object to copy properties from
  1711. * @param {Object} thisArg The object to bind function to
  1712. * @return {Object} The resulting value of object a
  1713. */
  1714. function extend(a, b, thisArg) {
  1715. forEach(b, function assignValue(val, key) {
  1716. if (thisArg && typeof val === 'function') {
  1717. a[key] = bind(val, thisArg);
  1718. } else {
  1719. a[key] = val;
  1720. }
  1721. });
  1722. return a;
  1723. }
  1724. /**
  1725. * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
  1726. *
  1727. * @param {string} content with BOM
  1728. * @return {string} content value without BOM
  1729. */
  1730. function stripBOM(content) {
  1731. if (content.charCodeAt(0) === 0xFEFF) {
  1732. content = content.slice(1);
  1733. }
  1734. return content;
  1735. }
  1736. module.exports = {
  1737. isArray: isArray,
  1738. isArrayBuffer: isArrayBuffer,
  1739. isBuffer: isBuffer,
  1740. isFormData: isFormData,
  1741. isArrayBufferView: isArrayBufferView,
  1742. isString: isString,
  1743. isNumber: isNumber,
  1744. isObject: isObject,
  1745. isPlainObject: isPlainObject,
  1746. isUndefined: isUndefined,
  1747. isDate: isDate,
  1748. isFile: isFile,
  1749. isBlob: isBlob,
  1750. isFunction: isFunction,
  1751. isStream: isStream,
  1752. isURLSearchParams: isURLSearchParams,
  1753. isStandardBrowserEnv: isStandardBrowserEnv,
  1754. forEach: forEach,
  1755. merge: merge,
  1756. extend: extend,
  1757. trim: trim,
  1758. stripBOM: stripBOM
  1759. };
  1760. /***/ }),
  1761. /***/ "./node_modules/json-query/index.js":
  1762. /*!******************************************!*\
  1763. !*** ./node_modules/json-query/index.js ***!
  1764. \******************************************/
  1765. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1766. var State = __webpack_require__(/*! ./lib/state */ "./node_modules/json-query/lib/state.js")
  1767. var tokenize = __webpack_require__(/*! ./lib/tokenize */ "./node_modules/json-query/lib/tokenize.js")
  1768. var tokenizedCache = {}
  1769. module.exports = function jsonQuery (query, options) {
  1770. // extract params for ['test[param=?]', 'value'] type queries
  1771. var params = options && options.params || null
  1772. if (Array.isArray(query)) {
  1773. params = query.slice(1)
  1774. query = query[0]
  1775. }
  1776. if (!tokenizedCache[query]) {
  1777. tokenizedCache[query] = tokenize(query, true)
  1778. }
  1779. return handleQuery(tokenizedCache[query], options, params)
  1780. }
  1781. module.exports.lastParent = function (query) {
  1782. var last = query.parents[query.parents.length - 1]
  1783. if (last) {
  1784. return last.value
  1785. } else {
  1786. return null
  1787. }
  1788. }
  1789. function handleQuery (tokens, options, params) {
  1790. var state = new State(options, params, handleQuery)
  1791. for (var i = 0; i < tokens.length; i++) {
  1792. if (handleToken(tokens[i], state)) {
  1793. break
  1794. }
  1795. }
  1796. // flush
  1797. handleToken(null, state)
  1798. // set databind hooks
  1799. if (state.currentItem instanceof Object) {
  1800. state.addReference(state.currentItem)
  1801. } else {
  1802. var parentObject = getLastParentObject(state.currentParents)
  1803. if (parentObject) {
  1804. state.addReference(parentObject)
  1805. }
  1806. }
  1807. return {
  1808. value: state.currentItem,
  1809. key: state.currentKey,
  1810. references: state.currentReferences,
  1811. parents: state.currentParents
  1812. }
  1813. }
  1814. function handleToken (token, state) {
  1815. // state: setCurrent, getValue, getValues, resetCurrent, deepQuery, rootContext, currentItem, currentKey, options, filters
  1816. if (token == null) {
  1817. // process end of query
  1818. if (!state.currentItem && state.options.force) {
  1819. state.force(state.options.force)
  1820. }
  1821. } else if (token.values) {
  1822. if (state.currentItem) {
  1823. var keys = Object.keys(state.currentItem)
  1824. var values = []
  1825. keys.forEach(function (key) {
  1826. if (token.deep && Array.isArray(state.currentItem[key])) {
  1827. state.currentItem[key].forEach(function (item) {
  1828. values.push(item)
  1829. })
  1830. } else {
  1831. values.push(state.currentItem[key])
  1832. }
  1833. })
  1834. state.setCurrent(keys, values)
  1835. } else {
  1836. state.setCurrent(keys, [])
  1837. }
  1838. } else if (token.get) {
  1839. var key = state.getValue(token.get)
  1840. if (shouldOverride(state, key)) {
  1841. state.setCurrent(key, state.override[key])
  1842. } else {
  1843. if (state.currentItem || (state.options.force && state.force({}))) {
  1844. if (isDeepAccessor(state.currentItem, key) || token.multiple) {
  1845. var values = state.currentItem.map(function (item) {
  1846. return item[key]
  1847. }).filter(isDefined)
  1848. values = Array.prototype.concat.apply([], values) // flatten
  1849. state.setCurrent(key, values)
  1850. } else {
  1851. state.setCurrent(key, state.currentItem[key])
  1852. }
  1853. } else {
  1854. state.setCurrent(key, null)
  1855. }
  1856. }
  1857. } else if (token.select) {
  1858. if (Array.isArray(state.currentItem) || (state.options.force && state.force([]))) {
  1859. var match = (token.boolean ? token.select : [token]).map(function (part) {
  1860. if (part.op === ':') {
  1861. var key = state.getValue(part.select[0])
  1862. return {
  1863. func: function (item) {
  1864. if (key) {
  1865. item = item[key]
  1866. }
  1867. return state.getValueFrom(part.select[1], item)
  1868. },
  1869. negate: part.negate,
  1870. booleanOp: part.booleanOp
  1871. }
  1872. } else {
  1873. var selector = state.getValues(part.select)
  1874. if (!state.options.allowRegexp && part.op === '~' && selector[1] instanceof RegExp) throw new Error('options.allowRegexp is not enabled.')
  1875. return {
  1876. key: selector[0],
  1877. value: selector[1],
  1878. negate: part.negate,
  1879. booleanOp: part.booleanOp,
  1880. op: part.op
  1881. }
  1882. }
  1883. })
  1884. if (token.multiple) {
  1885. var keys = []
  1886. var value = []
  1887. state.currentItem.forEach(function (item, i) {
  1888. if (matches(item, match)) {
  1889. keys.push(i)
  1890. value.push(item)
  1891. }
  1892. })
  1893. state.setCurrent(keys, value)
  1894. } else {
  1895. if (!state.currentItem.some(function (item, i) {
  1896. if (matches(item, match)) {
  1897. state.setCurrent(i, item)
  1898. return true
  1899. }
  1900. })) {
  1901. state.setCurrent(null, null)
  1902. }
  1903. }
  1904. } else {
  1905. state.setCurrent(null, null)
  1906. }
  1907. } else if (token.root) {
  1908. state.resetCurrent()
  1909. if (token.args && token.args.length) {
  1910. state.setCurrent(null, state.getValue(token.args[0]))
  1911. } else {
  1912. state.setCurrent(null, state.rootContext)
  1913. }
  1914. } else if (token.parent) {
  1915. state.resetCurrent()
  1916. state.setCurrent(null, state.options.parent)
  1917. } else if (token.or) {
  1918. if (state.currentItem) {
  1919. return true
  1920. } else {
  1921. state.resetCurrent()
  1922. state.setCurrent(null, state.context)
  1923. }
  1924. } else if (token.filter) {
  1925. var helper = state.getLocal(token.filter) || state.getGlobal(token.filter)
  1926. if (typeof helper === 'function') {
  1927. // function(input, args...)
  1928. var values = state.getValues(token.args || [])
  1929. var result = helper.apply(state.options, [state.currentItem].concat(values))
  1930. state.setCurrent(null, result)
  1931. } else {
  1932. // fallback to old filters
  1933. var filter = state.getFilter(token.filter)
  1934. if (typeof filter === 'function') {
  1935. var values = state.getValues(token.args || [])
  1936. var result = filter.call(state.options, state.currentItem, {args: values, state: state, data: state.rootContext})
  1937. state.setCurrent(null, result)
  1938. }
  1939. }
  1940. } else if (token.deep) {
  1941. if (state.currentItem) {
  1942. if (token.deep.length === 0) {
  1943. return
  1944. }
  1945. var result = state.deepQuery(state.currentItem, token.deep, state.options)
  1946. if (result) {
  1947. state.setCurrent(result.key, result.value)
  1948. for (var i = 0; i < result.parents.length; i++) {
  1949. state.currentParents.push(result.parents[i])
  1950. }
  1951. } else {
  1952. state.setCurrent(null, null)
  1953. }
  1954. } else {
  1955. state.currentItem = null
  1956. }
  1957. }
  1958. }
  1959. function matches (item, parts) {
  1960. var result = false
  1961. for (var i = 0; i < parts.length; i++) {
  1962. var opts = parts[i]
  1963. var r = false
  1964. if (opts.func) {
  1965. r = opts.func(item)
  1966. } else if (opts.op === '~') {
  1967. if (opts.value instanceof RegExp) {
  1968. r = item[opts.key] && !!item[opts.key].match(opts.value)
  1969. } else {
  1970. r = item[opts.key] && !!~item[opts.key].indexOf(opts.value)
  1971. }
  1972. } else if (opts.op === '=') {
  1973. if ((item[opts.key] === true && opts.value === 'true') || (item[opts.key] === false && opts.value === 'false')) {
  1974. r = true
  1975. } else {
  1976. r = item[opts.key] == opts.value
  1977. }
  1978. } else if (opts.op === '>') {
  1979. r = item[opts.key] > opts.value
  1980. } else if (opts.op === '<') {
  1981. r = item[opts.key] < opts.value
  1982. } else if (opts.op === '>=') {
  1983. r = item[opts.key] >= opts.value
  1984. } else if (opts.op === '<=') {
  1985. r = item[opts.key] <= opts.value
  1986. }
  1987. if (opts.negate) {
  1988. r = !r
  1989. }
  1990. if (opts.booleanOp === '&') {
  1991. result = result && r
  1992. } else if (opts.booleanOp === '|') {
  1993. result = result || r
  1994. } else {
  1995. result = r
  1996. }
  1997. }
  1998. return result
  1999. }
  2000. function isDefined(value) {
  2001. return typeof value !== 'undefined'
  2002. }
  2003. function shouldOverride (state, key) {
  2004. return state.override && state.currentItem === state.rootContext && state.override[key] !== undefined
  2005. }
  2006. function isDeepAccessor (currentItem, key) {
  2007. return currentItem instanceof Array && parseInt(key) != key
  2008. }
  2009. function getLastParentObject (parents) {
  2010. for (var i = 0; i < parents.length; i++) {
  2011. if (!(parents[i + 1]) || !(parents[i + 1].value instanceof Object)) {
  2012. return parents[i].value
  2013. }
  2014. }
  2015. }
  2016. /***/ }),
  2017. /***/ "./node_modules/json-query/lib/depth-split.js":
  2018. /*!****************************************************!*\
  2019. !*** ./node_modules/json-query/lib/depth-split.js ***!
  2020. \****************************************************/
  2021. /***/ ((module) => {
  2022. module.exports = depthSplit
  2023. function depthSplit (text, delimiter, opts) {
  2024. var max = opts && opts.max || Infinity
  2025. var includeDelimiters = opts && opts.includeDelimiters || false
  2026. var depth = 0
  2027. var start = 0
  2028. var result = []
  2029. var zones = []
  2030. text.replace(/([\[\(\{])|([\]\)\}])/g, function (current, open, close, offset) {
  2031. if (open) {
  2032. if (depth === 0) {
  2033. zones.push([start, offset])
  2034. }
  2035. depth += 1
  2036. } else if (close) {
  2037. depth -= 1
  2038. if (depth === 0) {
  2039. start = offset + current.length
  2040. }
  2041. }
  2042. })
  2043. if (depth === 0 && start < text.length) {
  2044. zones.push([start, text.length])
  2045. }
  2046. start = 0
  2047. for (var i = 0; i < zones.length && max > 0; i++) {
  2048. for (
  2049. var pos = zones[i][0], match = delimiter.exec(text.slice(pos, zones[i][1]));
  2050. match && max > 1;
  2051. pos += match.index + match[0].length, start = pos, match = delimiter.exec(text.slice(pos, zones[i][1]))
  2052. ) {
  2053. result.push(text.slice(start, match.index + pos))
  2054. if (includeDelimiters) {
  2055. result.push(match[0])
  2056. }
  2057. max -= 1
  2058. }
  2059. }
  2060. if (start < text.length) {
  2061. result.push(text.slice(start))
  2062. }
  2063. return result
  2064. }
  2065. /***/ }),
  2066. /***/ "./node_modules/json-query/lib/state.js":
  2067. /*!**********************************************!*\
  2068. !*** ./node_modules/json-query/lib/state.js ***!
  2069. \**********************************************/
  2070. /***/ ((module) => {
  2071. module.exports = State
  2072. function State(options, params, handleQuery){
  2073. options = options || {}
  2074. //this.options = options
  2075. this.handleQuery = handleQuery
  2076. this.options = options
  2077. this.locals = this.options.locals || {}
  2078. this.globals = this.options.globals || {}
  2079. this.rootContext = firstNonNull(options.data, options.rootContext, options.context, options.source)
  2080. this.parent = options.parent
  2081. this.override = options.override
  2082. this.filters = options.filters || {}
  2083. this.params = params || options.params || []
  2084. this.context = firstNonNull(options.currentItem, options.context, options.source)
  2085. this.currentItem = firstNonNull(this.context, options.rootContext, options.data)
  2086. this.currentKey = null
  2087. this.currentReferences = []
  2088. this.currentParents = []
  2089. }
  2090. State.prototype = {
  2091. // current manipulation
  2092. setCurrent: function(key, value){
  2093. if (this.currentItem || this.currentKey || this.currentParents.length>0){
  2094. this.currentParents.push({key: this.currentKey, value: this.currentItem})
  2095. }
  2096. this.currentItem = value
  2097. this.currentKey = key
  2098. },
  2099. resetCurrent: function(){
  2100. this.currentItem = null
  2101. this.currentKey = null
  2102. this.currentParents = []
  2103. },
  2104. force: function(def){
  2105. var parent = this.currentParents[this.currentParents.length-1]
  2106. if (!this.currentItem && parent && (this.currentKey != null)){
  2107. this.currentItem = def || {}
  2108. parent.value[this.currentKey] = this.currentItem
  2109. }
  2110. return !!this.currentItem
  2111. },
  2112. getLocal: function(localName){
  2113. if (~localName.indexOf('/')){
  2114. var result = null
  2115. var parts = localName.split('/')
  2116. for (var i=0;i<parts.length;i++){
  2117. var part = parts[i]
  2118. if (i == 0){
  2119. result = this.locals[part]
  2120. } else if (result && result[part]){
  2121. result = result[part]
  2122. }
  2123. }
  2124. return result
  2125. } else {
  2126. return this.locals[localName]
  2127. }
  2128. },
  2129. getGlobal: function(globalName){
  2130. if (~globalName.indexOf('/')){
  2131. var result = null
  2132. var parts = globalName.split('/')
  2133. for (var i=0;i<parts.length;i++){
  2134. var part = parts[i]
  2135. if (i == 0){
  2136. result = this.globals[part]
  2137. } else if (result && result[part]){
  2138. result = result[part]
  2139. }
  2140. }
  2141. return result
  2142. } else {
  2143. return this.globals[globalName]
  2144. }
  2145. },
  2146. getFilter: function(filterName){
  2147. if (~filterName.indexOf('/')){
  2148. var result = null
  2149. var filterParts = filterName.split('/')
  2150. for (var i=0;i<filterParts.length;i++){
  2151. var part = filterParts[i]
  2152. if (i == 0){
  2153. result = this.filters[part]
  2154. } else if (result && result[part]){
  2155. result = result[part]
  2156. }
  2157. }
  2158. return result
  2159. } else {
  2160. return this.filters[filterName]
  2161. }
  2162. },
  2163. addReferences: function(references){
  2164. if (references){
  2165. references.forEach(this.addReference, this)
  2166. }
  2167. },
  2168. addReference: function(ref){
  2169. if (ref instanceof Object && !~this.currentReferences.indexOf(ref)){
  2170. this.currentReferences.push(ref)
  2171. }
  2172. },
  2173. // helper functions
  2174. getValues: function(values, callback){
  2175. return values.map(this.getValue, this)
  2176. },
  2177. getValue: function (value) {
  2178. return this.getValueFrom(value, null)
  2179. },
  2180. getValueFrom: function (value, item) {
  2181. if (value._param != null){
  2182. return this.params[value._param]
  2183. } else if (value._sub){
  2184. var options = copy(this.options)
  2185. options.force = null
  2186. options.currentItem = item
  2187. var result = this.handleQuery(value._sub, options, this.params)
  2188. this.addReferences(result.references)
  2189. return result.value
  2190. } else {
  2191. return value
  2192. }
  2193. },
  2194. deepQuery: function(source, tokens, options, callback){
  2195. var keys = Object.keys(source)
  2196. for (var key in source){
  2197. if (key in source){
  2198. var options = copy(this.options)
  2199. options.currentItem = source[key]
  2200. var result = this.handleQuery(tokens, options, this.params)
  2201. if (result.value){
  2202. return result
  2203. }
  2204. }
  2205. }
  2206. return null
  2207. }
  2208. }
  2209. function firstNonNull(args){
  2210. for (var i=0;i<arguments.length;i++){
  2211. if (arguments[i] != null){
  2212. return arguments[i]
  2213. }
  2214. }
  2215. }
  2216. function copy(obj){
  2217. var result = {}
  2218. if (obj){
  2219. for (var key in obj){
  2220. if (key in obj){
  2221. result[key] = obj[key]
  2222. }
  2223. }
  2224. }
  2225. return result
  2226. }
  2227. /***/ }),
  2228. /***/ "./node_modules/json-query/lib/tokenize.js":
  2229. /*!*************************************************!*\
  2230. !*** ./node_modules/json-query/lib/tokenize.js ***!
  2231. \*************************************************/
  2232. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2233. // todo: syntax checking
  2234. // todo: test handle args
  2235. var depthSplit = __webpack_require__(/*! ./depth-split */ "./node_modules/json-query/lib/depth-split.js")
  2236. module.exports = function(query, shouldAssignParamIds){
  2237. if (!query) return []
  2238. var result = []
  2239. , prevChar, char
  2240. , nextChar = query.charAt(0)
  2241. , bStart = 0
  2242. , bEnd = 0
  2243. , partOffset = 0
  2244. , pos = 0
  2245. , depth = 0
  2246. , mode = 'get'
  2247. , deepQuery = null
  2248. // if query contains params then number them
  2249. if (shouldAssignParamIds){
  2250. query = assignParamIds(query)
  2251. }
  2252. var tokens = {
  2253. '.': {mode: 'get'},
  2254. ':': {mode: 'filter'},
  2255. '|': {handle: 'or'},
  2256. '[': {open: 'select'},
  2257. ']': {close: 'select'},
  2258. '{': {open: 'meta'},
  2259. '}': {close: 'meta'},
  2260. '(': {open: 'args'},
  2261. ')': {close: 'args'}
  2262. }
  2263. function push(item){
  2264. if (deepQuery){
  2265. deepQuery.push(item)
  2266. } else {
  2267. result.push(item)
  2268. }
  2269. }
  2270. var handlers = {
  2271. get: function(buffer){
  2272. var trimmed = typeof buffer === 'string' ? buffer.trim() : null
  2273. if (trimmed){
  2274. push({get:trimmed})
  2275. }
  2276. },
  2277. select: function(buffer){
  2278. if (buffer){
  2279. push(tokenizeSelect(buffer))
  2280. } else {
  2281. // deep query override
  2282. var x = {deep: []}
  2283. result.push(x)
  2284. deepQuery = x.deep
  2285. }
  2286. },
  2287. filter: function(buffer){
  2288. if (buffer){
  2289. push({filter:buffer.trim()})
  2290. }
  2291. },
  2292. or: function(){
  2293. deepQuery = null
  2294. result.push({or:true})
  2295. partOffset = i + 1
  2296. },
  2297. args: function(buffer){
  2298. var args = tokenizeArgs(buffer)
  2299. result[result.length-1].args = args
  2300. }
  2301. }
  2302. function handleBuffer(){
  2303. var buffer = query.slice(bStart, bEnd)
  2304. if (handlers[mode]){
  2305. handlers[mode](buffer)
  2306. }
  2307. mode = 'get'
  2308. bStart = bEnd + 1
  2309. }
  2310. for (var i = 0;i < query.length;i++){
  2311. // update char values
  2312. prevChar = char; char = nextChar; nextChar = query.charAt(i + 1);
  2313. pos = i - partOffset
  2314. // root query check
  2315. if (pos === 0 && (char !== ':' && char !== '.')){
  2316. result.push({root:true})
  2317. }
  2318. // parent query check
  2319. if (pos === 0 && (char === '.' && nextChar === '.')){
  2320. result.push({parent:true})
  2321. }
  2322. var token = tokens[char]
  2323. if (token){
  2324. // set mode
  2325. if (depth === 0 && (token.mode || token.open)){
  2326. handleBuffer()
  2327. mode = token.mode || token.open
  2328. }
  2329. if (depth === 0 && token.handle){
  2330. handleBuffer()
  2331. handlers[token.handle]()
  2332. }
  2333. if (token.open){
  2334. depth += 1
  2335. } else if (token.close){
  2336. depth -= 1
  2337. }
  2338. // reset mode to get
  2339. if (depth === 0 && token.close){
  2340. handleBuffer()
  2341. }
  2342. }
  2343. bEnd = i + 1
  2344. }
  2345. handleBuffer()
  2346. return result
  2347. }
  2348. function tokenizeArgs(argsQuery){
  2349. if (argsQuery === ',') return [',']
  2350. return depthSplit(argsQuery, /,/).map(function(s){
  2351. return handleSelectPart(s.trim())
  2352. })
  2353. }
  2354. function tokenizeSelect (selectQuery) {
  2355. if (selectQuery === '*') {
  2356. return {
  2357. values: true
  2358. }
  2359. } else if (selectQuery === '**') {
  2360. return {
  2361. values: true,
  2362. deep: true
  2363. }
  2364. }
  2365. var multiple = false
  2366. if (selectQuery.charAt(0) === '*') {
  2367. multiple = true
  2368. selectQuery = selectQuery.slice(1)
  2369. }
  2370. var booleanParts = depthSplit(selectQuery, /&|\|/, { includeDelimiters: true })
  2371. if (booleanParts.length > 1) {
  2372. var result = [
  2373. getSelectPart(booleanParts[0].trim())
  2374. ]
  2375. for (var i = 1; i < booleanParts.length; i += 2) {
  2376. var part = getSelectPart(booleanParts[i + 1].trim())
  2377. if (part) {
  2378. part.booleanOp = booleanParts[i]
  2379. result.push(part)
  2380. }
  2381. }
  2382. return {
  2383. multiple: multiple,
  2384. boolean: true,
  2385. select: result
  2386. }
  2387. } else {
  2388. var result = getSelectPart(selectQuery.trim())
  2389. if (!result) {
  2390. return {
  2391. get: handleSelectPart(selectQuery.trim())
  2392. }
  2393. } else {
  2394. if (multiple) {
  2395. result.multiple = true
  2396. }
  2397. return result
  2398. }
  2399. }
  2400. }
  2401. function getSelectPart (selectQuery) {
  2402. var parts = depthSplit(selectQuery, /(!)?(=|~|\:|<=|>=|<|>)/, { max: 2, includeDelimiters: true })
  2403. if (parts.length === 3) {
  2404. var negate = parts[1].charAt(0) === '!'
  2405. var key = handleSelectPart(parts[0].trim())
  2406. var result = {
  2407. negate: negate,
  2408. op: negate ? parts[1].slice(1) : parts[1]
  2409. }
  2410. if (result.op === ':') {
  2411. result.select = [key, {_sub: module.exports(':' + parts[2].trim())}]
  2412. } else if (result.op === '~') {
  2413. var value = handleSelectPart(parts[2].trim())
  2414. if (typeof value === 'string') {
  2415. var reDef = parts[2].trim().match(/^\/(.*)\/([a-z]?)$/)
  2416. if (reDef) {
  2417. result.select = [key, new RegExp(reDef[1], reDef[2])]
  2418. } else {
  2419. result.select = [key, value]
  2420. }
  2421. } else {
  2422. result.select = [key, value]
  2423. }
  2424. } else {
  2425. result.select = [key, handleSelectPart(parts[2].trim())]
  2426. }
  2427. return result
  2428. }
  2429. }
  2430. function isInnerQuery (text) {
  2431. return text.charAt(0) === '{' && text.charAt(text.length-1) === '}'
  2432. }
  2433. function handleSelectPart(part){
  2434. if (isInnerQuery(part)){
  2435. var innerQuery = part.slice(1, -1)
  2436. return {_sub: module.exports(innerQuery)}
  2437. } else {
  2438. return paramToken(part)
  2439. }
  2440. }
  2441. function paramToken(text){
  2442. if (text.charAt(0) === '?'){
  2443. var num = parseInt(text.slice(1))
  2444. if (!isNaN(num)){
  2445. return {_param: num}
  2446. } else {
  2447. return text
  2448. }
  2449. } else {
  2450. return text
  2451. }
  2452. }
  2453. function assignParamIds(query){
  2454. var index = 0
  2455. return query.replace(/\?/g, function(match){
  2456. return match + (index++)
  2457. })
  2458. }
  2459. function last (array) {
  2460. return array[array.length - 1]
  2461. }
  2462. /***/ })
  2463. /******/ });
  2464. /************************************************************************/
  2465. /******/ // The module cache
  2466. /******/ var __webpack_module_cache__ = {};
  2467. /******/
  2468. /******/ // The require function
  2469. /******/ function __webpack_require__(moduleId) {
  2470. /******/ // Check if module is in cache
  2471. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  2472. /******/ if (cachedModule !== undefined) {
  2473. /******/ return cachedModule.exports;
  2474. /******/ }
  2475. /******/ // Create a new module (and put it into the cache)
  2476. /******/ var module = __webpack_module_cache__[moduleId] = {
  2477. /******/ // no module.id needed
  2478. /******/ // no module.loaded needed
  2479. /******/ exports: {}
  2480. /******/ };
  2481. /******/
  2482. /******/ // Execute the module function
  2483. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  2484. /******/
  2485. /******/ // Return the exports of the module
  2486. /******/ return module.exports;
  2487. /******/ }
  2488. /******/
  2489. /************************************************************************/
  2490. var __webpack_exports__ = {};
  2491. // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
  2492. (() => {
  2493. /*!**********************!*\
  2494. !*** ./src/index.js ***!
  2495. \**********************/
  2496. // var jsonQuery = require('json-query');
  2497. window["jsonQuery"] = __webpack_require__(/*! json-query */ "./node_modules/json-query/index.js");
  2498. window["axios"] = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
  2499. })();
  2500. /******/ })()
  2501. ;
  2502. //# sourceMappingURL=main.js.map