PluginProbe ʕ •ᴥ•ʔ
Conditional Fields for Contact Form 7 / 2.2
Conditional Fields for Contact Form 7 v2.2
2.7.8 2.7.7 2.7.6 2.7.5 2.7.4 2.7.3 2.7.2 0.2.4 0.2.5 0.2.6 0.2.7 0.2.8 0.2.9 1.0 1.1 1.2 1.2.1 1.2.2 1.2.3 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.4 1.4.1 1.4.2 1.4.3 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.6.1 1.6.2 1.6.3 1.6.5 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.8 1.7.9 1.8 1.8.1 1.8.2 1.8.3 1.8.5 1.8.6 1.8.7 1.9 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.14 1.9.15 1.9.16 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2 2.2.1 2.2.10 2.2.11 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3 2.3.1 2.3.10 2.3.11 2.3.12 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.7 2.7.1 trunk 0.1 0.1.1 0.1.2 0.1.3 0.1.4 0.1.5 0.1.6 0.1.7 0.2 0.2.1 0.2.2 0.2.3
cf7-conditional-fields / js / scripts.js
cf7-conditional-fields / js Last commit date
scripts.js 4 years ago scripts.js.map 4 years ago scripts_admin copy.js 4 years ago scripts_admin.js 4 years ago scripts_admin_all_pages.js 5 years ago scripts_es6.js 4 years ago temp.js 4 years ago
scripts.js
4063 lines
1 /******/ (function(modules) { // webpackBootstrap
2 /******/ // The module cache
3 /******/ var installedModules = {};
4 /******/
5 /******/ // The require function
6 /******/ function __webpack_require__(moduleId) {
7 /******/
8 /******/ // Check if module is in cache
9 /******/ if(installedModules[moduleId]) {
10 /******/ return installedModules[moduleId].exports;
11 /******/ }
12 /******/ // Create a new module (and put it into the cache)
13 /******/ var module = installedModules[moduleId] = {
14 /******/ i: moduleId,
15 /******/ l: false,
16 /******/ exports: {}
17 /******/ };
18 /******/
19 /******/ // Execute the module function
20 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21 /******/
22 /******/ // Flag the module as loaded
23 /******/ module.l = true;
24 /******/
25 /******/ // Return the exports of the module
26 /******/ return module.exports;
27 /******/ }
28 /******/
29 /******/
30 /******/ // expose the modules object (__webpack_modules__)
31 /******/ __webpack_require__.m = modules;
32 /******/
33 /******/ // expose the module cache
34 /******/ __webpack_require__.c = installedModules;
35 /******/
36 /******/ // define getter function for harmony exports
37 /******/ __webpack_require__.d = function(exports, name, getter) {
38 /******/ if(!__webpack_require__.o(exports, name)) {
39 /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
40 /******/ }
41 /******/ };
42 /******/
43 /******/ // define __esModule on exports
44 /******/ __webpack_require__.r = function(exports) {
45 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
46 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
47 /******/ }
48 /******/ Object.defineProperty(exports, '__esModule', { value: true });
49 /******/ };
50 /******/
51 /******/ // create a fake namespace object
52 /******/ // mode & 1: value is a module id, require it
53 /******/ // mode & 2: merge all properties of value into the ns
54 /******/ // mode & 4: return value when already ns object
55 /******/ // mode & 8|1: behave like require
56 /******/ __webpack_require__.t = function(value, mode) {
57 /******/ if(mode & 1) value = __webpack_require__(value);
58 /******/ if(mode & 8) return value;
59 /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
60 /******/ var ns = Object.create(null);
61 /******/ __webpack_require__.r(ns);
62 /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
63 /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
64 /******/ return ns;
65 /******/ };
66 /******/
67 /******/ // getDefaultExport function for compatibility with non-harmony modules
68 /******/ __webpack_require__.n = function(module) {
69 /******/ var getter = module && module.__esModule ?
70 /******/ function getDefault() { return module['default']; } :
71 /******/ function getModuleExports() { return module; };
72 /******/ __webpack_require__.d(getter, 'a', getter);
73 /******/ return getter;
74 /******/ };
75 /******/
76 /******/ // Object.prototype.hasOwnProperty.call
77 /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
78 /******/
79 /******/ // __webpack_public_path__
80 /******/ __webpack_require__.p = "";
81 /******/
82 /******/
83 /******/ // Load entry module and return exports
84 /******/ return __webpack_require__(__webpack_require__.s = 0);
85 /******/ })
86 /************************************************************************/
87 /******/ ({
88
89 /***/ "./js/scripts_es6.js":
90 /*!***************************!*\
91 !*** ./js/scripts_es6.js ***!
92 \***************************/
93 /*! no exports provided */
94 /***/ (function(module, __webpack_exports__, __webpack_require__) {
95
96 "use strict";
97 __webpack_require__.r(__webpack_exports__);
98 /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
99 /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
100 /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js");
101 /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__);
102 /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
103 /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__);
104 /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
105 /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);
106 /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
107 /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4__);
108 // disable client side validation introduced in CF7 5.6 for now
109
110
111
112
113
114
115
116 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
117
118 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
119
120 if (typeof wpcf7 !== 'undefined') {
121 wpcf7.validate = function (a, b) {
122 return null;
123 };
124 }
125
126 var cf7signature_resized = 0; // for compatibility with contact-form-7-signature-addon
127
128 var wpcf7cf_timeout;
129 var wpcf7cf_change_time_ms = 100;
130
131 if (window.wpcf7 && !wpcf7.setStatus) {
132 wpcf7.setStatus = function (form, status) {
133 form = form.length ? form[0] : form; // if form is a jQuery object, only grab te html-element
134
135 var defaultStatuses = new Map([// 0: Status in API response, 1: Status in HTML class
136 ['init', 'init'], ['validation_failed', 'invalid'], ['acceptance_missing', 'unaccepted'], ['spam', 'spam'], ['aborted', 'aborted'], ['mail_sent', 'sent'], ['mail_failed', 'failed'], ['submitting', 'submitting'], ['resetting', 'resetting']]);
137
138 if (defaultStatuses.has(status)) {
139 status = defaultStatuses.get(status);
140 }
141
142 if (!Array.from(defaultStatuses.values()).includes(status)) {
143 status = status.replace(/[^0-9a-z]+/i, ' ').trim();
144 status = status.replace(/\s+/, '-');
145 status = "custom-".concat(status);
146 }
147
148 var prevStatus = form.getAttribute('data-status');
149 form.wpcf7.status = status;
150 form.setAttribute('data-status', status);
151 form.classList.add(status);
152
153 if (prevStatus && prevStatus !== status) {
154 form.classList.remove(prevStatus);
155 }
156
157 return status;
158 };
159 }
160
161 if (window.wpcf7cf_running_tests) {
162 jQuery('input[name="_wpcf7cf_options"]').each(function (e) {
163 var $input = jQuery(this);
164 var opt = JSON.parse($input.val());
165 opt.settings.animation_intime = 0;
166 opt.settings.animation_outtime = 0;
167 $input.val(JSON.stringify(opt));
168 });
169 wpcf7cf_change_time_ms = 0;
170 }
171
172 var wpcf7cf_show_animation = {
173 "height": "show",
174 "marginTop": "show",
175 "marginBottom": "show",
176 "paddingTop": "show",
177 "paddingBottom": "show"
178 };
179 var wpcf7cf_hide_animation = {
180 "height": "hide",
181 "marginTop": "hide",
182 "marginBottom": "hide",
183 "paddingTop": "hide",
184 "paddingBottom": "hide"
185 };
186 var wpcf7cf_show_step_animation = {
187 "opacity": "show"
188 };
189 var wpcf7cf_hide_step_animation = {
190 "opacity": "hide"
191 };
192 var wpcf7cf_change_events = 'input.wpcf7cf paste.wpcf7cf change.wpcf7cf click.wpcf7cf propertychange.wpcf7cf changedisabledprop.wpcf7cf';
193 var wpcf7cf_forms = [];
194 window.wpcf7cf_dom = {};
195
196 var wpcf7cf_reload_dom = function wpcf7cf_reload_dom($form) {
197 wpcf7cf_dom = wpcf7cf.get_simplified_dom_model($form[0]);
198 };
199
200 var wpcf7cf_getFieldsByOriginalName = function wpcf7cf_getFieldsByOriginalName(originalName) {
201 return Object.values(wpcf7cf_dom).filter(function (inputField) {
202 return inputField.original_name === originalName || inputField.original_name === originalName + '[]';
203 });
204 };
205
206 var wpcf7cf_getFieldByName = function wpcf7cf_getFieldByName(name) {
207 return wpcf7cf_dom[name] || wpcf7cf_dom[name + '[]'];
208 }; // endsWith polyfill
209
210
211 if (!String.prototype.endsWith) {
212 String.prototype.endsWith = function (search, this_len) {
213 if (this_len === undefined || this_len > this.length) {
214 this_len = this.length;
215 }
216
217 return this.substring(this_len - search.length, this_len) === search;
218 };
219 } // Object.values polyfill
220
221
222 if (!Object.values) Object.values = function (o) {
223 return Object.keys(o).map(function (k) {
224 return o[k];
225 });
226 }; // Array.from polyfill
227
228 if (!Array.from) {
229 Array.from = function () {
230 var toStr = Object.prototype.toString;
231
232 var isCallable = function isCallable(fn) {
233 return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
234 };
235
236 var toInteger = function toInteger(value) {
237 var number = Number(value);
238
239 if (isNaN(number)) {
240 return 0;
241 }
242
243 if (number === 0 || !isFinite(number)) {
244 return number;
245 }
246
247 return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
248 };
249
250 var maxSafeInteger = Math.pow(2, 53) - 1;
251
252 var toLength = function toLength(value) {
253 var len = toInteger(value);
254 return Math.min(Math.max(len, 0), maxSafeInteger);
255 }; // The length property of the from method is 1.
256
257
258 return function from(arrayLike
259 /*, mapFn, thisArg */
260 ) {
261 // 1. Let C be the this value.
262 var C = this; // 2. Let items be ToObject(arrayLike).
263
264 var items = Object(arrayLike); // 3. ReturnIfAbrupt(items).
265
266 if (arrayLike == null) {
267 throw new TypeError("Array.from requires an array-like object - not null or undefined");
268 } // 4. If mapfn is undefined, then let mapping be false.
269
270
271 var mapFn = arguments.length > 1 ? arguments[1] : void undefined;
272 var T;
273
274 if (typeof mapFn !== 'undefined') {
275 // 5. else
276 // 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
277 if (!isCallable(mapFn)) {
278 throw new TypeError('Array.from: when provided, the second argument must be a function');
279 } // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.
280
281
282 if (arguments.length > 2) {
283 T = arguments[2];
284 }
285 } // 10. Let lenValue be Get(items, "length").
286 // 11. Let len be ToLength(lenValue).
287
288
289 var len = toLength(items.length); // 13. If IsConstructor(C) is true, then
290 // 13. a. Let A be the result of calling the [[Construct]] internal method of C with an argument list containing the single item len.
291 // 14. a. Else, Let A be ArrayCreate(len).
292
293 var A = isCallable(C) ? Object(new C(len)) : new Array(len); // 16. Let k be 0.
294
295 var k = 0; // 17. Repeat, while k < len… (also steps a - h)
296
297 var kValue;
298
299 while (k < len) {
300 kValue = items[k];
301
302 if (mapFn) {
303 A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);
304 } else {
305 A[k] = kValue;
306 }
307
308 k += 1;
309 } // 18. Let putStatus be Put(A, "length", len, true).
310
311
312 A.length = len; // 20. Return A.
313
314 return A;
315 };
316 }();
317 }
318
319 var Wpcf7cfForm = function Wpcf7cfForm($form) {
320 var options_element = $form.find('input[name="_wpcf7cf_options"]').eq(0);
321
322 if (!options_element.length || !options_element.val()) {
323 // doesn't look like a CF7 form created with conditional fields plugin enabled.
324 return false;
325 }
326
327 var form = this;
328 var form_options = JSON.parse(options_element.val());
329 form.$form = $form;
330 form.$input_hidden_group_fields = $form.find('[name="_wpcf7cf_hidden_group_fields"]');
331 form.$input_hidden_groups = $form.find('[name="_wpcf7cf_hidden_groups"]');
332 form.$input_visible_groups = $form.find('[name="_wpcf7cf_visible_groups"]');
333 form.$input_repeaters = $form.find('[name="_wpcf7cf_repeaters"]');
334 form.$input_steps = $form.find('[name="_wpcf7cf_steps"]');
335 form.unit_tag = $form.closest('.wpcf7').attr('id');
336 form.conditions = form_options['conditions']; // Wrapper around jQuery(selector, form.$form)
337
338 form.get = function (selector) {
339 // TODO: implement some caching here.
340 return jQuery(selector, form.$form);
341 }; // compatibility with conditional forms created with older versions of the plugin ( < 1.4 )
342
343
344 for (var i = 0; i < form.conditions.length; i++) {
345 var condition = form.conditions[i];
346
347 if (!('and_rules' in condition)) {
348 condition.and_rules = [{
349 'if_field': condition.if_field,
350 'if_value': condition.if_value,
351 'operator': condition.operator
352 }];
353 }
354 }
355
356 form.initial_conditions = form.conditions;
357 form.settings = form_options['settings'];
358 form.$groups = jQuery(); // empty jQuery set
359
360 form.repeaters = [];
361 form.multistep = null;
362 form.fields = [];
363 form.settings.animation_intime = parseInt(form.settings.animation_intime);
364 form.settings.animation_outtime = parseInt(form.settings.animation_outtime);
365
366 if (form.settings.animation === 'no') {
367 form.settings.animation_intime = 0;
368 form.settings.animation_outtime = 0;
369 }
370
371 form.updateGroups();
372 form.updateEventListeners();
373 form.displayFields(); // bring form in initial state if the reset event is fired on it.
374 // (CF7 triggers the 'reset' event by default on each successfully submitted form)
375
376 form.$form.on('reset.wpcf7cf', form, function (e) {
377 var form = e.data;
378 setTimeout(function () {
379 form.displayFields();
380 form.resetRepeaters();
381
382 if (form.multistep != null) {
383 form.multistep.moveToStep(1, false);
384 }
385
386 setTimeout(function () {
387 if (form.$form.hasClass('sent')) {
388 jQuery('.wpcf7-response-output', form.$form)[0].scrollIntoView({
389 behavior: "smooth",
390 block: "nearest",
391 inline: "nearest"
392 });
393 }
394 }, 400);
395 }, 200);
396 }); // PRO ONLY
397
398 form.get('.wpcf7cf_repeater:not(.wpcf7cf_repeater .wpcf7cf_repeater)').each(function () {
399 form.repeaters.push(new Wpcf7cfRepeater(jQuery(this), form));
400 });
401 form.$input_repeaters.val(JSON.stringify(form.repeaters.map(function (item) {
402 return item.params.$repeater.id;
403 })));
404 var $multistep = form.get('.wpcf7cf_multistep');
405
406 if ($multistep.length) {
407 form.multistep = new Wpcf7cfMultistep($multistep, form); // window.wpcf7cf.updateMultistepState(form.multistep);
408 } // END PRO ONLY
409
410 };
411 /**
412 * reset initial number of subs for each repeater.
413 * (does not clear values)
414 */
415
416
417 Wpcf7cfForm.prototype.resetRepeaters = function () {
418 var form = this;
419 form.repeaters.forEach(function (repeater) {
420 repeater.updateSubs(repeater.params.$repeater.initial_subs);
421 });
422 };
423
424 Wpcf7cfForm.prototype.displayFields = function () {
425 var form = this;
426 var wpcf7cf_conditions = this.conditions;
427 var wpcf7cf_settings = this.settings; //for compatibility with contact-form-7-signature-addon
428
429 if (cf7signature_resized === 0 && typeof signatures !== 'undefined' && signatures.constructor === Array && signatures.length > 0) {
430 for (var i = 0; i < signatures.length; i++) {
431 if (signatures[i].canvas.width === 0) {
432 var $sig_canvas = jQuery(".wpcf7-form-control-signature-body>canvas");
433 var $sig_wrap = jQuery(".wpcf7-form-control-signature-wrap");
434 $sig_canvas.eq(i).attr('width', $sig_wrap.width());
435 $sig_canvas.eq(i).attr('height', $sig_wrap.height());
436 cf7signature_resized = 1;
437 }
438 }
439 }
440
441 form.$groups.addClass('wpcf7cf-hidden');
442 wpcf7cf_reload_dom(form.$form);
443
444 for (var i = 0; i < wpcf7cf_conditions.length; i++) {
445 var condition = wpcf7cf_conditions[i];
446 var show_group = window.wpcf7cf.should_group_be_shown(condition, form);
447
448 if (show_group) {
449 form.get('[data-id="' + condition.then_field + '"]').removeClass('wpcf7cf-hidden');
450 }
451 }
452
453 var animation_intime = wpcf7cf_settings.animation_intime;
454 var animation_outtime = wpcf7cf_settings.animation_outtime;
455 form.$groups.each(function (index) {
456 var $group = jQuery(this);
457
458 if ($group.is(':animated')) {
459 $group.finish(); // stop any current animations on the group
460 }
461
462 if ($group.css('display') === 'none' && !$group.hasClass('wpcf7cf-hidden')) {
463 if ($group.prop('tagName') === 'SPAN') {
464 $group.show().trigger('wpcf7cf_show_group'); // show instantly
465 } else {
466 $group.animate(wpcf7cf_show_animation, animation_intime).trigger('wpcf7cf_show_group'); // show with animation
467 }
468
469 if ($group.attr('data-disable_on_hide') !== undefined) {
470 $group.find(':input').prop('disabled', false).trigger('changedisabledprop.wpcf7cf');
471 $group.find('.wpcf7-form-control-wrap').removeClass('wpcf7cf-disabled');
472 }
473 } else if ($group.css('display') !== 'none' && $group.hasClass('wpcf7cf-hidden')) {
474 if ($group.attr('data-clear_on_hide') !== undefined) {
475 var $inputs = jQuery(':input', $group).not(':button, :submit, :reset, :hidden');
476 $inputs.each(function () {
477 var $this = jQuery(this);
478 $this.val(this.defaultValue);
479 $this.prop('checked', this.defaultChecked);
480 });
481 jQuery('option', $group).each(function () {
482 this.selected = this.defaultSelected;
483 });
484 jQuery('select', $group).each(function () {
485 var $select = jQuery(this);
486
487 if ($select.val() === null) {
488 $select.val(jQuery("option:first", $select).val());
489 }
490 });
491 $inputs.each(function () {
492 this.dispatchEvent(new Event("change", {
493 "bubbles": true
494 }));
495 });
496 }
497
498 if ($group.prop('tagName') === 'SPAN') {
499 $group.hide().trigger('wpcf7cf_hide_group');
500 } else {
501 $group.animate(wpcf7cf_hide_animation, animation_outtime).trigger('wpcf7cf_hide_group'); // hide
502 }
503 }
504 });
505 form.updateHiddenFields();
506 form.updateSummaryFields();
507 };
508
509 Wpcf7cfForm.prototype.updateSummaryFields = function () {
510 var form = this;
511 var $summary = form.get('.wpcf7cf-summary');
512 if ($summary.length == 0 || !$summary.is(':visible')) return;
513 var fd = new FormData();
514 var formdata = form.$form.serializeArray();
515 jQuery.each(formdata, function (key, input) {
516 fd.append(input.name, input.value);
517 }); // Make sure to add file fields to FormData
518
519 jQuery.each(form.$form.find('input[type="file"]'), function (index, el) {
520 if (!el.files.length) return true; // continue
521
522 var fieldName = el.name;
523 fd.append(fieldName, new Blob(), Array.from(el.files).map(function (file) {
524 return file.name;
525 }).join(', '));
526 }); // add file fields to form-data
527
528 jQuery.ajax({
529 url: wpcf7cf_global_settings.ajaxurl + '?action=wpcf7cf_get_summary',
530 type: 'POST',
531 data: fd,
532 processData: false,
533 contentType: false,
534 dataType: 'json',
535 success: function success(json) {
536 $summary.html(json.summaryHtml);
537 }
538 });
539 };
540
541 Wpcf7cfForm.prototype.updateHiddenFields = function () {
542 var form = this;
543 var hidden_fields = [];
544 var hidden_groups = [];
545 var visible_groups = [];
546 var disabled_fields = [];
547 form.$groups.each(function () {
548 var $group = jQuery(this);
549
550 if ($group.hasClass('wpcf7cf-hidden')) {
551 hidden_groups.push($group.attr('data-id'));
552
553 if ($group.attr('data-disable_on_hide') !== undefined) {
554 // fields inside hidden disable_on_hide group
555 $group.find('input,select,textarea').each(function () {
556 var $this = jQuery(this);
557
558 if (!$this.prop('disabled')) {
559 $this.prop('disabled', true).trigger('changedisabledprop.wpcf7cf');
560 } // if there's no other field with the same name visible in the form
561 // then push this field to hidden_fields
562
563
564 if (form.$form.find("[data-class=\"wpcf7cf_group\"]:not(.wpcf7cf-hidden) [name='".concat($this.attr('name'), "']")).length === 0) {
565 hidden_fields.push($this.attr('name'));
566 }
567 });
568 $group.find('.wpcf7-form-control-wrap').addClass('wpcf7cf-disabled');
569 } else {
570 // fields inside regular hidden group are all pushed to hidden_fields
571 $group.find('input,select,textarea').each(function () {
572 hidden_fields.push(jQuery(this).attr('name'));
573 });
574 }
575 } else {
576 visible_groups.push($group.attr('data-id'));
577 }
578 });
579 form.hidden_fields = hidden_fields;
580 form.hidden_groups = hidden_groups;
581 form.visible_groups = visible_groups;
582 form.$input_hidden_group_fields.val(JSON.stringify(hidden_fields));
583 form.$input_hidden_groups.val(JSON.stringify(hidden_groups));
584 form.$input_visible_groups.val(JSON.stringify(visible_groups));
585 return true;
586 };
587
588 Wpcf7cfForm.prototype.updateGroups = function () {
589 var form = this;
590 form.$groups = form.$form.find('[data-class="wpcf7cf_group"]');
591 form.$groups.height('auto');
592 form.conditions = window.wpcf7cf.get_nested_conditions(form.initial_conditions, form.$form);
593 };
594
595 Wpcf7cfForm.prototype.updateEventListeners = function () {
596 var form = this; // monitor input changes, and call displayFields() if something has changed
597
598 form.get('input, select, textarea, button').not('.wpcf7cf_add, .wpcf7cf_remove').off(wpcf7cf_change_events).on(wpcf7cf_change_events, form, function (e) {
599 var form = e.data;
600 clearTimeout(wpcf7cf_timeout);
601 wpcf7cf_timeout = setTimeout(function () {
602 window.wpcf7cf.updateMultistepState(form.multistep);
603 form.displayFields();
604 }, wpcf7cf_change_time_ms);
605 }); // PRO ONLY
606
607 form.get('.wpcf7cf-togglebutton').off('click.toggle_wpcf7cf').on('click.toggle_wpcf7cf', function () {
608 var $this = jQuery(this);
609
610 if ($this.text() === $this.attr('data-val-1')) {
611 $this.text($this.attr('data-val-2'));
612 $this.val($this.attr('data-val-2'));
613 } else {
614 $this.text($this.attr('data-val-1'));
615 $this.val($this.attr('data-val-1'));
616 }
617 }); // END PRO ONLY
618 }; // PRO ONLY
619
620
621 function Wpcf7cfRepeater($repeater, form) {
622 var $ = jQuery;
623 var repeater = this;
624 var wpcf7cf_settings = form.settings;
625 repeater.form = form;
626 $repeater.parentRepeaters = Array.from($repeater.parents('.wpcf7cf_repeater').map(function () {
627 return this.getAttribute('data-id');
628 })).reverse();
629 $repeater.num_subs = 0;
630 $repeater.id = $repeater.attr('data-id');
631 $repeater.orig_id = $repeater.attr('data-orig_data_id');
632 $repeater.min = typeof $repeater.attr('data-min') !== 'undefined' ? parseInt($repeater.attr('data-min')) : 1;
633 $repeater.max = typeof $repeater.attr('data-max') !== 'undefined' ? parseInt($repeater.attr('data-max')) : 200;
634 $repeater.initial_subs = typeof $repeater.attr('data-initial') !== 'undefined' ? parseInt($repeater.attr('data-initial')) : $repeater.min;
635 if ($repeater.initial_subs > $repeater.max) $repeater.initial_subs = $repeater.max;
636 var $repeater_sub = $repeater.children('.wpcf7cf_repeater_sub').eq(0);
637 var $repeater_controls = $repeater.children('.wpcf7cf_repeater_controls').eq(0);
638 var $repeater_sub_clone = $repeater_sub.clone();
639 $repeater_sub_clone.find('.wpcf7cf_repeater_sub').addBack('.wpcf7cf_repeater_sub').each(function () {
640 var $this = jQuery(this);
641 var prev_suffix = $this.attr('data-repeater_sub_suffix');
642 var new_suffix = prev_suffix + '__{{repeater_sub_suffix}}';
643 $this.attr('data-repeater_sub_suffix', new_suffix);
644 });
645 $repeater_sub_clone.find('[name]').each(function () {
646 var $this = jQuery(this);
647 var prev_name = $this.attr('name');
648 var new_name = repeater.getNewName(prev_name);
649 var orig_name = $this.attr('data-orig_name') != null ? $this.attr('data-orig_name') : prev_name;
650 $this.attr('name', new_name);
651 $this.attr('data-orig_name', orig_name);
652 $this.closest('.wpcf7-form-control-wrap').attr('data-name', new_name.replace('[]', ''));
653 });
654 $repeater_sub_clone.find('.wpcf7cf_repeater,[data-class="wpcf7cf_group"]').each(function () {
655 var $this = jQuery(this);
656 var prev_data_id = $this.attr('data-id');
657 var orig_data_id = $this.attr('data-orig_data_id') != null ? $this.attr('data-orig_data_id') : prev_data_id;
658 var new_data_id = repeater.getNewName(prev_data_id);
659
660 if (prev_data_id.endsWith('_count')) {
661 new_data_id = prev_data_id.replace('_count', '__{{repeater_sub_suffix}}_count');
662 }
663
664 $this.attr('data-id', new_data_id);
665 $this.attr('data-orig_data_id', orig_data_id);
666 });
667 $repeater_sub_clone.find('[id]').each(function () {
668 var $this = jQuery(this);
669 var prev_id = $this.attr('id');
670 var orig_id = $this.attr('data-orig_id') != null ? $this.attr('data-orig_id') : prev_id;
671 var new_id = repeater.getNewName(prev_id);
672 $this.attr('id', new_id);
673 $this.attr('data-orig_id', orig_id);
674 });
675 $repeater_sub_clone.find('[for]').each(function () {
676 var $this = jQuery(this);
677 var prev_for = $this.attr('for');
678 var orig_for = $this.attr('data-orig_for') != null ? $this.attr('data-orig_for') : prev_for;
679 var new_for = repeater.getNewName(prev_for);
680 $this.attr('for', new_for);
681 $this.attr('data-orig_for', orig_for);
682 });
683 var repeater_sub_html = $repeater_sub_clone[0].outerHTML;
684 var $repeater_count_field = $repeater.find('[name=' + $repeater.id + '_count]').eq(0);
685 var $button_add = $repeater_controls.find('.wpcf7cf_add').eq(0);
686 var $button_remove = $repeater_controls.find('.wpcf7cf_remove').eq(0);
687 var params = {
688 $repeater: $repeater,
689 $repeater_count_field: $repeater_count_field,
690 repeater_sub_html: repeater_sub_html,
691 $repeater_controls: $repeater_controls,
692 $button_add: $button_add,
693 $button_remove: $button_remove,
694 wpcf7cf_settings: wpcf7cf_settings
695 };
696 this.params = params;
697 $button_add.on('click', null, repeater, function (e) {
698 var repeater = e.data;
699 repeater.updateSubs(params.$repeater.num_subs + 1);
700 });
701 $button_remove.on('click', null, repeater, function (e) {
702 var repeater = e.data;
703 repeater.updateSubs(params.$repeater.num_subs - 1);
704 });
705 jQuery('> .wpcf7cf_repeater_sub', params.$repeater).eq(0).remove(); // remove the first sub, it's just a template.
706
707 repeater.updateSubs($repeater.initial_subs);
708 repeater.updateButtons();
709 }
710
711 Wpcf7cfRepeater.prototype.getNewName = function (previousName) {
712 var prev_parts = previousName.split('[');
713 previousName = prev_parts[0];
714 var prev_suff = prev_parts.length > 1 ? '[' + prev_parts.splice(1).join('[') : '';
715 var newName = previousName + '__{{repeater_sub_suffix}}' + prev_suff;
716
717 if (previousName.endsWith('_count')) {
718 newName = previousName.replace('_count', '__{{repeater_sub_suffix}}_count');
719 }
720
721 return newName;
722 };
723
724 Wpcf7cfRepeater.prototype.updateButtons = function () {
725 var repeater = this;
726 var params = repeater.params;
727 var num_subs = params.$repeater.num_subs;
728 var showButtonRemove = false;
729 var showButtonAdd = false;
730
731 if (params.$repeater.num_subs < params.$repeater.max) {
732 showButtonAdd = true;
733 }
734
735 if (params.$repeater.num_subs > params.$repeater.min) {
736 showButtonRemove = true;
737 }
738
739 if (showButtonAdd) {
740 params.$button_add.show();
741 } else {
742 params.$button_add.hide();
743 }
744
745 if (showButtonRemove) {
746 params.$button_remove.show();
747 } else {
748 params.$button_remove.hide();
749 }
750
751 params.$repeater_count_field.val(num_subs);
752 };
753
754 Wpcf7cfRepeater.prototype.updateSubs = function (subs_to_show) {
755 var repeater = this;
756 var params = repeater.params; // make sure subs_to_show is a valid number
757
758 subs_to_show = subs_to_show < params.$repeater.min ? params.$repeater.min : subs_to_show;
759 subs_to_show = subs_to_show > params.$repeater.max ? params.$repeater.max : subs_to_show;
760 var subs_to_add = subs_to_show - params.$repeater.num_subs;
761
762 if (subs_to_add < 0) {
763 repeater.removeSubs(-subs_to_add);
764 } else if (subs_to_add > 0) {
765 repeater.addSubs(subs_to_add);
766 }
767 };
768 /**
769 * add Subs to repeater
770 * @param {Number} subs_to_add
771 * @param {Number} index - zero-based. leave blank (or null) to append at the end
772 */
773
774
775 Wpcf7cfRepeater.prototype.addSubs = function (subs_to_add) {
776 var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
777 var $ = jQuery;
778 var params = this.params;
779 var repeater = this;
780 var form = repeater.form;
781 var $repeater = params.$repeater;
782 var $repeater_controls = params.$repeater_controls;
783
784 if (subs_to_add + $repeater.num_subs > $repeater.max) {
785 subs_to_add = $repeater.max - $repeater.num_subs;
786 }
787
788 var html_str = '';
789
790 for (var i = 1; i <= subs_to_add; i++) {
791 var sub_suffix = $repeater.num_subs + i;
792 html_str += params.repeater_sub_html.replace(/\{\{repeater_sub_suffix\}\}/g, sub_suffix).replace(new RegExp('\{\{' + $repeater.orig_id + '_index\}\}', 'g'), '<span class="wpcf7cf-index wpcf7cf__' + $repeater.orig_id + '">' + sub_suffix + '</span>');
793 }
794
795 var $html = jQuery(html_str);
796 jQuery('> .wpcf7cf_repeater_sub', $repeater).finish(); // finish any currently running animations immediately.
797 // Add the newly created fields to the form
798
799 if (index === null) {
800 $html.hide().insertBefore($repeater_controls).animate(wpcf7cf_show_animation, params.wpcf7cf_settings.animation_intime).trigger('wpcf7cf_repeater_added');
801 } else {
802 $html.hide().insertBefore(jQuery('> .wpcf7cf_repeater_sub', $repeater).eq(index)).animate(wpcf7cf_show_animation, params.wpcf7cf_settings.animation_intime).trigger('wpcf7cf_repeater_added');
803 } // enable all new fields
804
805
806 $html.find('.wpcf7cf-disabled :input').prop('disabled', false).trigger('changedisabledprop.wpcf7cf');
807 $html.find('.wpcf7-form-control-wrap').removeClass('wpcf7cf-disabled');
808 jQuery('.wpcf7cf_repeater', $html).each(function () {
809 form.repeaters.push(new Wpcf7cfRepeater(jQuery(this), form));
810 });
811 form.$input_repeaters.val(JSON.stringify(form.repeaters.map(function (item) {
812 return item.params.$repeater.id;
813 })));
814 $repeater.num_subs += subs_to_add;
815
816 if (index !== null) {
817 repeater.updateSuffixes();
818 }
819
820 window.wpcf7cf.updateMultistepState(form.multistep);
821 form.updateGroups();
822 form.updateEventListeners();
823 form.displayFields();
824 repeater.updateButtons(); // Exclusive Checkbox
825
826 $html.on('click', '.wpcf7-exclusive-checkbox input:checkbox', function () {
827 var name = $(this).attr('name');
828 $html.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false);
829 }); //basic compatibility with material-design-for-contact-form-7
830
831 if (typeof window.cf7mdInit === "function") {
832 window.cf7mdInit();
833 }
834
835 return false;
836 };
837 /** TODO: implement this */
838
839
840 Wpcf7cfRepeater.prototype.updateSuffixes = function () {
841 // Loop trough all subs
842 // -- 1. update all fields, groups and repeaters names, id's, for's, ...
843 // -- 2. loop trough all repeaters
844 // -- update sub_html template for nested repeater
845 // -- call updateSuffixes() for nested repeater
846 var $repeater = this.params.$repeater;
847 var num_subs = this.params.$repeater.num_subs;
848 var form = this.form;
849 var orig_id = $repeater.attr('data-orig_data_id');
850 var repeater_id = $repeater.attr('data-id');
851 var repeater_suffix = repeater_id.replace(orig_id, '');
852 var simplifiedDomArray = Object.values(wpcf7cf.get_simplified_dom_model(form.$form[0]));
853
854 var _loop = function _loop(i) {
855 var $sub = jQuery('> .wpcf7cf_repeater_sub', $repeater).eq(i);
856 var newIndex = i + 1;
857 var currentSuffix = $sub.attr('data-repeater_sub_suffix');
858 var newSuffix = repeater_suffix + '__' + newIndex;
859 $sub.attr('data-repeater_sub_suffix', newSuffix); // update sub attr
860
861 $sub.find('.wpcf7cf__' + orig_id).html(newIndex); // update {{r_index}} parts
862
863 simplifiedDomArray.forEach(function (el) {
864 if (el.suffix !== currentSuffix) return; // TODO: may need an extra check to verify that the element is inside the current repeater
865 // (orig_id) . Otherwise problems may occur if there are repeaters on the same level.
866
867 var newName = el.name.replace(currentSuffix, newSuffix);
868 var pureElName = el.name.replace('[]', '');
869 var pureNewName = newName.replace('[]', '');
870 jQuery('[name="' + el.name + '"]', $sub).attr('name', newName);
871 jQuery('[id="' + el.name + '"]', $sub).attr('id', newName);
872 jQuery('label[for="' + el.name + '"]', $sub).attr('for', newName);
873 var $nested_repeater = jQuery('[data-id="' + el.name + '"]', $sub);
874 $nested_repeater.attr('data-id', newName);
875 jQuery(".wpcf7-form-control-wrap[data-name=\"".concat(pureElName, "\"]"), $sub).attr('data-name', pureNewName);
876
877 if (el.type === 'repeater') {
878 var nested_repeater = form.repeaters.find(function (repeater) {
879 return repeater.params.$repeater.get(0) === $nested_repeater.get(0);
880 });
881 if (!nested_repeater) return;
882 nested_repeater.params.repeater_sub_html = wpcf7cf.updateRepeaterSubHTML(nested_repeater.params.repeater_sub_html, currentSuffix, newSuffix, nested_repeater.params.$repeater.parentRepeaters);
883 nested_repeater.updateSuffixes();
884 }
885 });
886 };
887
888 for (var i = 0; i < num_subs; i++) {
889 _loop(i);
890 }
891 };
892 /**
893 * Return the parent repeaters, order is not guaranteed.
894 */
895
896
897 Wpcf7cfRepeater.prototype.getParentRepeaters = function () {
898 var simplifiedDomArray = Object.values(wpcf7cf.get_simplified_dom_model(form.$form[0]));
899 form.repeaters.map(function (repeater) {});
900 };
901
902 Wpcf7cfRepeater.prototype.removeSubs = function (subs_to_remove) {
903 var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
904 var $ = jQuery;
905 var repeater = this;
906 var params = repeater.params;
907 var form = repeater.form;
908 var $repeater = params.$repeater;
909
910 if ($repeater.num_subs - subs_to_remove < $repeater.min) {
911 subs_to_remove = $repeater.num_subs - $repeater.min;
912 }
913
914 if (index === null) {
915 index = $repeater.num_subs - subs_to_remove;
916 }
917
918 $repeater.num_subs -= subs_to_remove;
919 jQuery('> .wpcf7cf_repeater_sub', $repeater).finish(); // finish any currently running animations immediately.
920
921 jQuery('> .wpcf7cf_repeater_sub', $repeater).slice(index, index + subs_to_remove).animate(wpcf7cf_hide_animation, {
922 duration: params.wpcf7cf_settings.animation_intime,
923 done: function done() {
924 var $this = jQuery(this); //remove the actual fields from the form
925
926 $this.remove();
927 params.$repeater.trigger('wpcf7cf_repeater_removed');
928 window.wpcf7cf.updateMultistepState(form.multistep);
929 form.updateGroups();
930 form.updateEventListeners();
931 form.displayFields();
932 repeater.updateButtons();
933
934 if (index !== null) {
935 repeater.updateSuffixes();
936 }
937 }
938 });
939 return false;
940 };
941
942 function Wpcf7cfMultistep($multistep, form) {
943 var multistep = this;
944 multistep.$multistep = $multistep;
945 multistep.form = form;
946 multistep.$steps = $multistep.find('.wpcf7cf_step');
947 multistep.$btn_next = $multistep.find('.wpcf7cf_next');
948 multistep.$btn_prev = $multistep.find('.wpcf7cf_prev');
949 multistep.$dots = $multistep.find('.wpcf7cf_steps-dots');
950 multistep.currentStep = 0;
951 multistep.numSteps = multistep.$steps.length;
952 multistep.$dots.html('');
953
954 for (var i = 1; i <= multistep.numSteps; i++) {
955 multistep.$dots.append("\n <div class=\"dot\" data-step=\"".concat(i, "\">\n <div class=\"step-index\">").concat(i, "</div>\n <div class=\"step-title\">").concat(multistep.$steps.eq(i - 1).attr('data-title'), "</div>\n </div>\n "));
956 }
957
958 multistep.$btn_next.on('click.wpcf7cf_step', /*#__PURE__*/_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.mark(function _callee() {
959 var result;
960 return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.wrap(function _callee$(_context) {
961 while (1) {
962 switch (_context.prev = _context.next) {
963 case 0:
964 multistep.$btn_next.addClass('disabled').attr('disabled', true);
965 multistep.form.$form.addClass('submitting');
966 _context.next = 4;
967 return multistep.validateStep(multistep.currentStep);
968
969 case 4:
970 result = _context.sent;
971 multistep.form.$form.removeClass('submitting');
972
973 if (result === 'success') {
974 multistep.moveToStep(multistep.currentStep + 1);
975 }
976
977 case 7:
978 case "end":
979 return _context.stop();
980 }
981 }
982 }, _callee);
983 }))); // If form is submitted (by pressing Enter for example), and if we are not on the last step,
984 // then trigger click event on the $btn_next button instead.
985
986 multistep.form.$form.on('submit.wpcf7cf_step', function (e) {
987 if (multistep.currentStep !== multistep.numSteps) {
988 multistep.$btn_next.trigger('click.wpcf7cf_step');
989 e.stopImmediatePropagation();
990 return false;
991 }
992 });
993 multistep.$btn_prev.on('click', function () {
994 multistep.moveToStep(multistep.currentStep - 1);
995 });
996 multistep.moveToStep(1);
997 }
998
999 Wpcf7cfMultistep.prototype.validateStep = function (step_index) {
1000 var multistep = this;
1001 var $multistep = multistep.$multistep;
1002 var $form = multistep.form.$form;
1003 var form = multistep.form;
1004 $form.find('.wpcf7-response-output').addClass('wpcf7-display-none');
1005 return new Promise(function (resolve) {
1006 var fd = new FormData(); // Make sure to add file fields to FormData
1007
1008 jQuery.each($form.find('[data-id="step-' + step_index + '"] input[type="file"]'), function (index, el) {
1009 if (!el.files.length) return true; // = continue
1010
1011 var file = el.files[0];
1012 var fieldName = el.name;
1013 fd.append(fieldName, file);
1014 });
1015 var formdata = $form.serializeArray();
1016 jQuery.each(formdata, function (key, input) {
1017 fd.append(input.name, input.value);
1018 });
1019 jQuery.ajax({
1020 url: wpcf7cf_global_settings.ajaxurl + '?action=wpcf7cf_validate_step',
1021 type: 'POST',
1022 data: fd,
1023 processData: false,
1024 contentType: false,
1025 dataType: 'json'
1026 }).done(function (json) {
1027 $multistep.find('.wpcf7-form-control-wrap .wpcf7-not-valid-tip').remove();
1028 $multistep.find('.wpcf7-not-valid').removeClass('wpcf7-not-valid');
1029 $multistep.find('.wpcf7-response-output').remove();
1030 $multistep.find('.wpcf7-response-output.wpcf7-validation-errors').removeClass('wpcf7-validation-errors');
1031 multistep.$btn_next.removeClass('disabled').attr('disabled', false);
1032
1033 if (!json.success) {
1034 var checkError = 0;
1035 jQuery.each(json.invalid_fields, function (index, el) {
1036 if ($multistep.find('input[name="' + index + '"]').length || $multistep.find('input[name="' + index + '[]"]').length || $multistep.find('select[name="' + index + '"]').length || $multistep.find('select[name="' + index + '[]"]').length || $multistep.find('textarea[name="' + index + '"]').length || $multistep.find('textarea[name="' + index + '[]"]').length) {
1037 checkError = checkError + 1;
1038 var controlWrap = form.get(".wpcf7-form-control-wrap[data-name=\"".concat(index, "\"]"));
1039 controlWrap.find('.wpcf7-form-control').addClass('wpcf7-not-valid');
1040 controlWrap.find('span.wpcf7-not-valid-tip').remove();
1041 controlWrap.append('<span role="alert" class="wpcf7-not-valid-tip">' + el.reason + '</span>');
1042 }
1043 });
1044 resolve('failed');
1045 $multistep.parent().find('.wpcf7-response-output').removeClass('wpcf7-display-none').html(json.message);
1046 wpcf7.setStatus($form, 'invalid');
1047 multistep.$steps.trigger('wpcf7cf_step_invalid'); // wpcf7.triggerEvent( data.into, 'invalid', detail );
1048 } else if (json.success) {
1049 wpcf7.setStatus($form, 'init');
1050 resolve('success');
1051 return false;
1052 }
1053 }).fail(function () {
1054 resolve('error');
1055 }).always(function () {// do nothing
1056 });
1057 });
1058 };
1059
1060 Wpcf7cfMultistep.prototype.moveToStep = function (step_index) {
1061 var scrollToTop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1062 var multistep = this;
1063 var previousStep = multistep.currentStep;
1064 multistep.currentStep = step_index > multistep.numSteps ? multistep.numSteps : step_index < 1 ? 1 : step_index; // ANIMATION DISABLED FOR NOW cause it's ugly
1065 // multistep.$steps.animate(wpcf7cf_hide_step_animation, multistep.form.settings.animation_outtime);
1066 // multistep.$steps.eq(multistep.currentStep-1).animate(wpcf7cf_show_step_animation, multistep.form.settings.animation_intime);
1067
1068 multistep.$multistep.attr('data-current_step', multistep.currentStep);
1069 multistep.$steps.hide();
1070 multistep.$steps.eq(multistep.currentStep - 1).show().trigger('wpcf7cf_change_step', [previousStep, multistep.currentStep]);
1071
1072 if (scrollToTop) {
1073 var formEl = multistep.form.$form[0];
1074 var topOffset = formEl.getBoundingClientRect().top;
1075
1076 if (topOffset < 0 && previousStep > 0) {
1077 formEl.scrollIntoView({
1078 behavior: "smooth"
1079 });
1080 }
1081 }
1082
1083 multistep.form.updateSummaryFields();
1084 window.wpcf7cf.updateMultistepState(multistep);
1085 };
1086
1087 Wpcf7cfMultistep.prototype.getFieldsInStep = function (step_index) {
1088 wpcf7cf_reload_dom(this.form.$form);
1089 var inStep = false;
1090 return Object.values(wpcf7cf_dom).filter(function (item, i) {
1091 if (item.type == 'step') {
1092 inStep = item.val == step_index + '';
1093 }
1094
1095 return inStep && item.type == 'input';
1096 }).map(function (item) {
1097 return item.name;
1098 });
1099 }; // END PRO ONLY
1100
1101 /**
1102 * @global
1103 * @namespace wpcf7cf
1104 */
1105
1106
1107 window.wpcf7cf = {
1108 hideGroup: function hideGroup($group, animate) {},
1109 showGroup: function showGroup($group, animate) {},
1110 updateRepeaterSubHTML: function updateRepeaterSubHTML(html, oldSuffix, newSuffix, parentRepeaters) {
1111 var oldIndexes = oldSuffix.split('__');
1112 oldIndexes.shift(); // remove first empty element
1113
1114 var newIndexes = newSuffix.split('__');
1115 newIndexes.shift(); // remove first empty element
1116
1117 var returnHtml = html;
1118
1119 if (oldIndexes && newIndexes && oldIndexes.length === parentRepeaters.length && newIndexes.length === parentRepeaters.length) {
1120 var parentRepeatersInfo = parentRepeaters.map(function (repeaterId, i) {
1121 return _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default()({}, repeaterId.split('__')[0], [oldIndexes[i], newIndexes[i]]);
1122 });
1123 var length = parentRepeatersInfo.length;
1124 var replacements = oldIndexes.map(function (oldIndex, i) {
1125 return ['__' + oldIndexes.slice(0, length - i).join('__'), '__' + newIndexes.slice(0, length - i).join('__')];
1126 });
1127
1128 for (var i = 0; i < length; i++) {
1129 var id = Object.keys(parentRepeatersInfo[i])[0];
1130 var find = parentRepeatersInfo[i][id][0];
1131 var repl = parentRepeatersInfo[i][id][1];
1132 replacements.push(["<span class=\"wpcf7cf-index wpcf7cf__".concat(id, "\">").concat(find, "<\\/span>"), "<span class=\"wpcf7cf-index wpcf7cf__".concat(id, "\">").concat(repl, "</span>")]);
1133 }
1134
1135 replacements.forEach(function (_ref3) {
1136 var _ref4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_ref3, 2),
1137 oldSuffix = _ref4[0],
1138 newSuffix = _ref4[1];
1139
1140 returnHtml = returnHtml.replace(new RegExp(oldSuffix, 'g'), newSuffix);
1141 });
1142 }
1143
1144 return returnHtml;
1145 },
1146 // keep this for backwards compatibility
1147 initForm: function initForm($forms) {
1148 $forms.each(function () {
1149 var $form = jQuery(this); // only add form is its class is "wpcf7-form" and if the form was not previously added
1150
1151 if ($form.hasClass('wpcf7-form') && !wpcf7cf_forms.some(function (form) {
1152 return form.$form.get(0) === $form.get(0);
1153 })) {
1154 wpcf7cf_forms.push(new Wpcf7cfForm($form));
1155 }
1156 });
1157 },
1158 getWpcf7cfForm: function getWpcf7cfForm($form) {
1159 var matched_forms = wpcf7cf_forms.filter(function (form) {
1160 var f1 = form.$form.get(0);
1161 var f2 = $form.get(0);
1162 return form.$form.get(0) === $form.get(0);
1163 });
1164
1165 if (matched_forms.length) {
1166 return matched_forms[0];
1167 }
1168
1169 return false;
1170 },
1171 get_nested_conditions: function get_nested_conditions(conditions, $current_form) {
1172 //loop trough conditions. Then loop trough the dom, and each repeater we pass we should update all sub_values we encounter with __index
1173 wpcf7cf_reload_dom($current_form);
1174 var groups = Object.values(wpcf7cf_dom).filter(function (item, i) {
1175 return item.type === 'group';
1176 });
1177 var sub_conditions = [];
1178
1179 for (var i = 0; i < groups.length; i++) {
1180 var g = groups[i];
1181 var relevant_conditions = conditions.filter(function (condition, i) {
1182 return condition.then_field === g.original_name;
1183 });
1184 var relevant_conditions = relevant_conditions.map(function (item, i) {
1185 return {
1186 then_field: g.name,
1187 and_rules: item.and_rules.map(function (and_rule, i) {
1188 return {
1189 if_field: and_rule.if_field + g.suffix,
1190 if_value: and_rule.if_value,
1191 operator: and_rule.operator
1192 };
1193 })
1194 };
1195 });
1196 sub_conditions = sub_conditions.concat(relevant_conditions);
1197 }
1198
1199 return sub_conditions;
1200 },
1201 get_simplified_dom_model: function get_simplified_dom_model(currentNode) {
1202 var simplified_dom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1203 var parentGroups = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
1204 var parentRepeaters = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
1205 var type = currentNode.classList && currentNode.classList.contains('wpcf7cf_repeater') ? 'repeater' : currentNode.dataset["class"] == 'wpcf7cf_group' ? 'group' : currentNode.className == 'wpcf7cf_step' ? 'step' : currentNode.hasAttribute('name') && !currentNode.disabled ? 'input' : false;
1206
1207 var newParentRepeaters = _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(parentRepeaters);
1208
1209 var newParentGroups = _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(parentGroups);
1210
1211 if (type) {
1212 var name = type === 'input' ? currentNode.getAttribute('name') : currentNode.dataset.id;
1213
1214 if (type === 'repeater') {
1215 newParentRepeaters.push(name);
1216 }
1217
1218 if (type === 'group') {
1219 newParentGroups.push(name);
1220 } // skip _wpcf7 hidden fields
1221
1222
1223 if (name.substring(0, 6) === '_wpcf7') return {};
1224 var original_name = type === 'repeater' || type === 'group' ? currentNode.dataset.orig_data_id : type === 'input' ? currentNode.getAttribute('data-orig_name') || name : name;
1225 var nameWithoutBrackets = name.replace('[]', '');
1226 var originalNameWithoutBrackets = original_name.replace('[]', '');
1227 var val = type === 'step' ? [currentNode.dataset.id.substring(5)] : [];
1228 var suffix = nameWithoutBrackets.replace(originalNameWithoutBrackets, '');
1229
1230 if (!simplified_dom[name]) {
1231 // init entry
1232 simplified_dom[name] = {
1233 name: name,
1234 type: type,
1235 original_name: original_name,
1236 suffix: suffix,
1237 val: val,
1238 parentGroups: parentGroups,
1239 parentRepeaters: parentRepeaters
1240 };
1241 }
1242
1243 if (type === 'input') {
1244 // skip unchecked checkboxes and radiobuttons
1245 if ((currentNode.type === 'checkbox' || currentNode.type === 'radio') && !currentNode.checked) return {}; // if multiselect, make sure to add all the values
1246
1247 if (currentNode.multiple && currentNode.options) {
1248 simplified_dom[name].val = Object.values(currentNode.options).filter(function (o) {
1249 return o.selected;
1250 }).map(function (o) {
1251 return o.value;
1252 });
1253 } else {
1254 simplified_dom[name].val.push(currentNode.value);
1255 }
1256 }
1257 } // can't use currentNode.children (because then field name cannot be "children")
1258
1259
1260 var getter = Object.getOwnPropertyDescriptor(Element.prototype, "children").get;
1261 var children = getter.call(currentNode);
1262 Array.from(children).forEach(function (childNode) {
1263 var dom = wpcf7cf.get_simplified_dom_model(childNode, simplified_dom, newParentGroups, newParentRepeaters);
1264 simplified_dom = _objectSpread(_objectSpread({}, dom), simplified_dom);
1265 });
1266 return simplified_dom;
1267 },
1268 updateMultistepState: function updateMultistepState(multistep) {
1269 if (multistep == null) return; // update hidden input field
1270
1271 var stepsData = {
1272 currentStep: multistep.currentStep,
1273 numSteps: multistep.numSteps,
1274 fieldsInCurrentStep: multistep.getFieldsInStep(multistep.currentStep)
1275 };
1276 multistep.form.$input_steps.val(JSON.stringify(stepsData)); // update Buttons
1277
1278 multistep.$btn_prev.removeClass('disabled').attr('disabled', false);
1279 multistep.$btn_next.removeClass('disabled').attr('disabled', false);
1280
1281 if (multistep.currentStep == multistep.numSteps) {
1282 multistep.$btn_next.addClass('disabled').attr('disabled', true);
1283 }
1284
1285 if (multistep.currentStep == 1) {
1286 multistep.$btn_prev.addClass('disabled').attr('disabled', true);
1287 } // replace next button with submit button on last step.
1288 // TODO: make this depend on a setting
1289
1290
1291 var $submit_button = multistep.form.$form.find('input[type="submit"]:last').eq(0);
1292 var $ajax_loader = multistep.form.$form.find('.wpcf7-spinner').eq(0);
1293 $submit_button.detach().prependTo(multistep.$btn_next.parent());
1294 $ajax_loader.detach().prependTo(multistep.$btn_next.parent());
1295
1296 if (multistep.currentStep == multistep.numSteps) {
1297 multistep.$btn_next.hide();
1298 $submit_button.show();
1299 } else {
1300 $submit_button.hide();
1301 multistep.$btn_next.show();
1302 } // update dots
1303
1304
1305 var $dots = multistep.$dots.find('.dot');
1306 $dots.removeClass('active').removeClass('completed');
1307
1308 for (var step = 1; step <= multistep.numSteps; step++) {
1309 if (step < multistep.currentStep) {
1310 $dots.eq(step - 1).addClass('completed');
1311 } else if (step == multistep.currentStep) {
1312 $dots.eq(step - 1).addClass('active');
1313 }
1314 }
1315 },
1316 should_group_be_shown: function should_group_be_shown(condition) {
1317 var show_group = true;
1318
1319 for (var and_rule_i = 0; and_rule_i < condition.and_rules.length; and_rule_i++) {
1320 var condition_ok = false;
1321 var condition_and_rule = condition.and_rules[and_rule_i];
1322 var inputField = wpcf7cf_getFieldByName(condition_and_rule.if_field);
1323 if (!inputField) continue; // field not found
1324
1325 var if_val = condition_and_rule.if_value;
1326 var operator = condition_and_rule.operator; //backwards compat
1327
1328 operator = operator === '' ? 'less than or equals' : operator;
1329 operator = operator === '' ? 'greater than or equals' : operator;
1330 operator = operator === '>' ? 'greater than' : operator;
1331 operator = operator === '<' ? 'less than' : operator;
1332 var $field = operator === 'function' && jQuery("[name=\"".concat(inputField.name, "\"]")).eq(0);
1333 condition_ok = this.isConditionTrue(inputField.val, operator, if_val, $field);
1334 show_group = show_group && condition_ok;
1335 }
1336
1337 return show_group;
1338 },
1339 isConditionTrue: function isConditionTrue(values, operator) {
1340 var testValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
1341 var $field = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : jQuery();
1342
1343 if (!Array.isArray(values)) {
1344 values = [values];
1345 }
1346
1347 var condition_ok = false; // start by assuming that the condition is not met
1348 // Considered EMPTY: [] [''] [null] ['',null] [,,'']
1349 // Considered NOT EMPTY: [0] ['ab','c'] ['',0,null]
1350
1351 var valuesAreEmpty = values.length === 0 || values.every(function (v) {
1352 return !v && v !== 0;
1353 }); // 0 is not considered empty
1354 // special cases: [] equals '' => TRUE; [] not equals '' => FALSE
1355
1356 if (operator === 'equals' && testValue === '' && valuesAreEmpty) {
1357 return true;
1358 }
1359
1360 if (operator === 'not equals' && testValue === '' && valuesAreEmpty) {
1361 return false;
1362 }
1363
1364 if (valuesAreEmpty) {
1365 if (operator === 'is empty') {
1366 condition_ok = true;
1367 }
1368 } else {
1369 if (operator === 'not empty') {
1370 condition_ok = true;
1371 }
1372 }
1373
1374 var testValueNumber = isFinite(parseFloat(testValue)) ? parseFloat(testValue) : NaN;
1375
1376 if (operator === 'not equals' || operator === 'not equals (regex)') {
1377 // start by assuming that the condition is met
1378 condition_ok = true;
1379 }
1380
1381 if (operator === 'function' && typeof window[testValue] == 'function' && window[testValue]($field) // here we call the actual user defined function
1382 ) {
1383 condition_ok = true;
1384 }
1385
1386 var regex_patt = /.*/i; // fallback regex pattern
1387
1388 var isValidRegex = true;
1389
1390 if (operator === 'equals (regex)' || operator === 'not equals (regex)') {
1391 try {
1392 regex_patt = new RegExp(testValue, 'i');
1393 } catch (e) {
1394 isValidRegex = false;
1395 }
1396 }
1397
1398 for (var i = 0; i < values.length; i++) {
1399 var value = values[i];
1400 var valueNumber = isFinite(parseFloat(value)) ? parseFloat(value) : NaN;
1401 var valsAreNumbers = !isNaN(valueNumber) && !isNaN(testValueNumber);
1402
1403 if (operator === 'equals' && value === testValue || operator === 'equals (regex)' && regex_patt.test(value) || operator === 'greater than' && valsAreNumbers && valueNumber > testValueNumber || operator === 'less than' && valsAreNumbers && valueNumber < testValueNumber || operator === 'greater than or equals' && valsAreNumbers && valueNumber >= testValueNumber || operator === 'less than or equals' && valsAreNumbers && valueNumber <= testValueNumber) {
1404 condition_ok = true;
1405 break;
1406 } else if (operator === 'not equals' && value === testValue || operator === 'not equals (regex)' && regex_patt.test(value)) {
1407 condition_ok = false;
1408 break;
1409 }
1410 }
1411
1412 return condition_ok;
1413 },
1414 getFormObj: function getFormObj($form) {
1415 if (typeof $form === 'string') {
1416 $form = jQuery($form).eq(0);
1417 }
1418
1419 return wpcf7cf.getWpcf7cfForm($form);
1420 },
1421 getRepeaterObj: function getRepeaterObj($form, repeaterDataId) {
1422 var form = wpcf7cf.getFormObj($form);
1423 var repeater = form.repeaters.find(function (repeater) {
1424 return repeater.params.$repeater.attr('data-id') === repeaterDataId;
1425 });
1426 return repeater;
1427 },
1428 getMultiStepObj: function getMultiStepObj($form) {
1429 var form = wpcf7cf.getFormObj($form);
1430 return form.multistep;
1431 },
1432
1433 /**
1434 * Append a new sub-entry to the repeater with the name `repeaterDataId` inside the form `$form`
1435 * @memberof wpcf7cf
1436 * @function wpcf7cf.repeaterAddSub
1437 * @link
1438 * @param {String|JQuery} $form - JQuery object or css-selector representing the form
1439 * @param {String} repeaterDataId - *data-id* attribute of the repeater. Normally this is simply the name of the repeater. However, in case of a nested repeater you need to append the name with the correct suffix. For example `my-nested-repeater__1__3`. Hint (check the `data-id` attribute in the HTML code to find the correct suffix)
1440 */
1441 repeaterAddSub: function repeaterAddSub($form, repeaterDataId) {
1442 var repeater = wpcf7cf.getRepeaterObj($form, repeaterDataId);
1443 repeater.updateSubs(repeater.params.$repeater.num_subs + 1);
1444 },
1445
1446 /**
1447 * Insert a new sub-entry at the given `index` of the repeater with the name `repeaterDataId` inside the form `$form`
1448 * @memberof wpcf7cf
1449 * @param {String|JQuery} $form - JQuery object or css-selector representing the form
1450 * @param {String} repeaterDataId - *data-id* attribute of the repeater.
1451 * @param {Number} index - position where to insert the new sub-entry within the repeater
1452 */
1453 repeaterAddSubAtIndex: function repeaterAddSubAtIndex($form, repeaterDataId, index) {
1454 var repeater = wpcf7cf.getRepeaterObj($form, repeaterDataId);
1455 repeater.addSubs(1, index);
1456 },
1457
1458 /**
1459 * Remove the sub-entry at the given `index` of the repeater with the *data-id* attribute of `repeaterDataId` inside the form `$form`
1460 * @memberof wpcf7cf
1461 * @param {String|JQuery} $form - JQuery object or css-selector representing the form
1462 * @param {String} repeaterDataId - *data-id* attribute of the repeater.
1463 * @param {Number} index - position where to insert the new sub-entry within the repeater
1464 */
1465 repeaterRemoveSubAtIndex: function repeaterRemoveSubAtIndex($form, repeaterDataId, index) {
1466 var repeater = wpcf7cf.getRepeaterObj($form, repeaterDataId);
1467 repeater.removeSubs(1, index);
1468 },
1469
1470 /**
1471 * Remove the last sub-entry from the repeater with the *data-id* attribute of `repeaterDataId` inside the form `$form`
1472 * @memberof wpcf7cf
1473 * @param {String|JQuery} $form - JQuery object or css-selector representing the form
1474 * @param {String} repeaterDataId - *data-id* attribute of the repeater.
1475 * @param {Number} index - position where to insert the new sub-entry within the repeater
1476 */
1477 repeaterRemoveSub: function repeaterRemoveSub($form, repeaterDataId) {
1478 var repeater = wpcf7cf.getRepeaterObj($form, repeaterDataId);
1479 repeater.updateSubs(repeater.params.$repeater.num_subs - 1);
1480 },
1481
1482 /**
1483 * Set the number of subs for the repeater with the *data-id* attribute of `repeaterDataId` inside the form `$form`.
1484 * Subs are either appended to or removed from the end of the repeater.
1485 * @memberof wpcf7cf
1486 * @param {String|JQuery} $form - JQuery object or css-selector representing the form
1487 * @param {String} repeaterDataId - *data-id* attribute of the repeater.
1488 * @param {Number} numberOfSubs - position where to insert the new sub-entry within the repeater
1489 */
1490 repeaterSetNumberOfSubs: function repeaterSetNumberOfSubs($form, repeaterDataId, numberOfSubs) {
1491 var repeater = wpcf7cf.getRepeaterObj($form, repeaterDataId);
1492 repeater.updateSubs(numberOfSubs);
1493 },
1494
1495 /**
1496 * Move to step number `step`, ignoring any validation.
1497 * @memberof wpcf7cf
1498 * @param {String|JQuery} $form - JQuery object or css-selector representing the form
1499 * @param {*} step
1500 */
1501 multistepMoveToStep: function multistepMoveToStep($form, step) {
1502 var multistep = wpcf7cf.getMultiStepObj($form);
1503 multistep.moveToStep(step);
1504 },
1505
1506 /**
1507 * Validate the current step, and move to step number `step` if validation passes.
1508 * @memberof wpcf7cf
1509 * @param {String|JQuery} $form - JQuery object or css-selector representing the form
1510 * @param {Number} step
1511 */
1512 multistepMoveToStepWithValidation: function multistepMoveToStepWithValidation($form, step) {
1513 return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.mark(function _callee2() {
1514 var multistep, result;
1515 return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.wrap(function _callee2$(_context2) {
1516 while (1) {
1517 switch (_context2.prev = _context2.next) {
1518 case 0:
1519 multistep = wpcf7cf.getMultiStepObj($form);
1520 _context2.next = 3;
1521 return multistep.validateStep(multistep.currentStep);
1522
1523 case 3:
1524 result = _context2.sent;
1525
1526 if (result === 'success') {
1527 multistep.moveToStep(step);
1528 }
1529
1530 case 5:
1531 case "end":
1532 return _context2.stop();
1533 }
1534 }
1535 }, _callee2);
1536 }))();
1537 }
1538 };
1539 jQuery('.wpcf7-form').each(function () {
1540 wpcf7cf_forms.push(new Wpcf7cfForm(jQuery(this)));
1541 }); // Call displayFields again on all forms
1542 // Necessary in case some theme or plugin changed a form value by the time the entire page is fully loaded.
1543
1544 jQuery('document').on('ready', function () {
1545 wpcf7cf_forms.forEach(function (f) {
1546 f.displayFields();
1547 });
1548 }); // fix for exclusive checkboxes in IE (this will call the change-event again after all other checkboxes are unchecked, triggering the display_fields() function)
1549
1550 var old_wpcf7ExclusiveCheckbox = jQuery.fn.wpcf7ExclusiveCheckbox;
1551
1552 jQuery.fn.wpcf7ExclusiveCheckbox = function () {
1553 return this.find('input:checkbox').on('click', function () {
1554 var name = jQuery(this).attr('name');
1555 jQuery(this).closest('form').find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false).eq(0).change();
1556 });
1557 };
1558
1559 /***/ }),
1560
1561 /***/ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
1562 /*!*****************************************************************!*\
1563 !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
1564 \*****************************************************************/
1565 /*! no static exports found */
1566 /***/ (function(module, exports) {
1567
1568 function _arrayLikeToArray(arr, len) {
1569 if (len == null || len > arr.length) len = arr.length;
1570
1571 for (var i = 0, arr2 = new Array(len); i < len; i++) {
1572 arr2[i] = arr[i];
1573 }
1574
1575 return arr2;
1576 }
1577
1578 module.exports = _arrayLikeToArray;
1579
1580 /***/ }),
1581
1582 /***/ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js":
1583 /*!***************************************************************!*\
1584 !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
1585 \***************************************************************/
1586 /*! no static exports found */
1587 /***/ (function(module, exports) {
1588
1589 function _arrayWithHoles(arr) {
1590 if (Array.isArray(arr)) return arr;
1591 }
1592
1593 module.exports = _arrayWithHoles;
1594
1595 /***/ }),
1596
1597 /***/ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js":
1598 /*!******************************************************************!*\
1599 !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
1600 \******************************************************************/
1601 /*! no static exports found */
1602 /***/ (function(module, exports, __webpack_require__) {
1603
1604 var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray */ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
1605
1606 function _arrayWithoutHoles(arr) {
1607 if (Array.isArray(arr)) return arrayLikeToArray(arr);
1608 }
1609
1610 module.exports = _arrayWithoutHoles;
1611
1612 /***/ }),
1613
1614 /***/ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js":
1615 /*!*****************************************************************!*\
1616 !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
1617 \*****************************************************************/
1618 /*! no static exports found */
1619 /***/ (function(module, exports) {
1620
1621 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
1622 try {
1623 var info = gen[key](arg);
1624 var value = info.value;
1625 } catch (error) {
1626 reject(error);
1627 return;
1628 }
1629
1630 if (info.done) {
1631 resolve(value);
1632 } else {
1633 Promise.resolve(value).then(_next, _throw);
1634 }
1635 }
1636
1637 function _asyncToGenerator(fn) {
1638 return function () {
1639 var self = this,
1640 args = arguments;
1641 return new Promise(function (resolve, reject) {
1642 var gen = fn.apply(self, args);
1643
1644 function _next(value) {
1645 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
1646 }
1647
1648 function _throw(err) {
1649 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
1650 }
1651
1652 _next(undefined);
1653 });
1654 };
1655 }
1656
1657 module.exports = _asyncToGenerator;
1658
1659 /***/ }),
1660
1661 /***/ "./node_modules/@babel/runtime/helpers/defineProperty.js":
1662 /*!***************************************************************!*\
1663 !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
1664 \***************************************************************/
1665 /*! no static exports found */
1666 /***/ (function(module, exports) {
1667
1668 function _defineProperty(obj, key, value) {
1669 if (key in obj) {
1670 Object.defineProperty(obj, key, {
1671 value: value,
1672 enumerable: true,
1673 configurable: true,
1674 writable: true
1675 });
1676 } else {
1677 obj[key] = value;
1678 }
1679
1680 return obj;
1681 }
1682
1683 module.exports = _defineProperty;
1684
1685 /***/ }),
1686
1687 /***/ "./node_modules/@babel/runtime/helpers/iterableToArray.js":
1688 /*!****************************************************************!*\
1689 !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
1690 \****************************************************************/
1691 /*! no static exports found */
1692 /***/ (function(module, exports) {
1693
1694 function _iterableToArray(iter) {
1695 if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
1696 }
1697
1698 module.exports = _iterableToArray;
1699
1700 /***/ }),
1701
1702 /***/ "./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
1703 /*!*********************************************************************!*\
1704 !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
1705 \*********************************************************************/
1706 /*! no static exports found */
1707 /***/ (function(module, exports) {
1708
1709 function _iterableToArrayLimit(arr, i) {
1710 if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
1711 var _arr = [];
1712 var _n = true;
1713 var _d = false;
1714 var _e = undefined;
1715
1716 try {
1717 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
1718 _arr.push(_s.value);
1719
1720 if (i && _arr.length === i) break;
1721 }
1722 } catch (err) {
1723 _d = true;
1724 _e = err;
1725 } finally {
1726 try {
1727 if (!_n && _i["return"] != null) _i["return"]();
1728 } finally {
1729 if (_d) throw _e;
1730 }
1731 }
1732
1733 return _arr;
1734 }
1735
1736 module.exports = _iterableToArrayLimit;
1737
1738 /***/ }),
1739
1740 /***/ "./node_modules/@babel/runtime/helpers/nonIterableRest.js":
1741 /*!****************************************************************!*\
1742 !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
1743 \****************************************************************/
1744 /*! no static exports found */
1745 /***/ (function(module, exports) {
1746
1747 function _nonIterableRest() {
1748 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1749 }
1750
1751 module.exports = _nonIterableRest;
1752
1753 /***/ }),
1754
1755 /***/ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js":
1756 /*!******************************************************************!*\
1757 !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
1758 \******************************************************************/
1759 /*! no static exports found */
1760 /***/ (function(module, exports) {
1761
1762 function _nonIterableSpread() {
1763 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1764 }
1765
1766 module.exports = _nonIterableSpread;
1767
1768 /***/ }),
1769
1770 /***/ "./node_modules/@babel/runtime/helpers/slicedToArray.js":
1771 /*!**************************************************************!*\
1772 !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
1773 \**************************************************************/
1774 /*! no static exports found */
1775 /***/ (function(module, exports, __webpack_require__) {
1776
1777 var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles */ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js");
1778
1779 var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit */ "./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
1780
1781 var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray */ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
1782
1783 var nonIterableRest = __webpack_require__(/*! ./nonIterableRest */ "./node_modules/@babel/runtime/helpers/nonIterableRest.js");
1784
1785 function _slicedToArray(arr, i) {
1786 return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
1787 }
1788
1789 module.exports = _slicedToArray;
1790
1791 /***/ }),
1792
1793 /***/ "./node_modules/@babel/runtime/helpers/toConsumableArray.js":
1794 /*!******************************************************************!*\
1795 !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
1796 \******************************************************************/
1797 /*! no static exports found */
1798 /***/ (function(module, exports, __webpack_require__) {
1799
1800 var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles */ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js");
1801
1802 var iterableToArray = __webpack_require__(/*! ./iterableToArray */ "./node_modules/@babel/runtime/helpers/iterableToArray.js");
1803
1804 var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray */ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
1805
1806 var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread */ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js");
1807
1808 function _toConsumableArray(arr) {
1809 return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
1810 }
1811
1812 module.exports = _toConsumableArray;
1813
1814 /***/ }),
1815
1816 /***/ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
1817 /*!***************************************************************************!*\
1818 !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
1819 \***************************************************************************/
1820 /*! no static exports found */
1821 /***/ (function(module, exports, __webpack_require__) {
1822
1823 var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray */ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
1824
1825 function _unsupportedIterableToArray(o, minLen) {
1826 if (!o) return;
1827 if (typeof o === "string") return arrayLikeToArray(o, minLen);
1828 var n = Object.prototype.toString.call(o).slice(8, -1);
1829 if (n === "Object" && o.constructor) n = o.constructor.name;
1830 if (n === "Map" || n === "Set") return Array.from(o);
1831 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
1832 }
1833
1834 module.exports = _unsupportedIterableToArray;
1835
1836 /***/ }),
1837
1838 /***/ "./node_modules/@babel/runtime/regenerator/index.js":
1839 /*!**********************************************************!*\
1840 !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
1841 \**********************************************************/
1842 /*! no static exports found */
1843 /***/ (function(module, exports, __webpack_require__) {
1844
1845 module.exports = __webpack_require__(/*! regenerator-runtime */ "./node_modules/regenerator-runtime/runtime.js");
1846
1847 /***/ }),
1848
1849 /***/ "./node_modules/es6-promise-promise/index.js":
1850 /*!***************************************************!*\
1851 !*** ./node_modules/es6-promise-promise/index.js ***!
1852 \***************************************************/
1853 /*! no static exports found */
1854 /***/ (function(module, exports, __webpack_require__) {
1855
1856 module.exports = __webpack_require__(/*! es6-promise */ "./node_modules/es6-promise/dist/es6-promise.js").Promise;
1857
1858 /***/ }),
1859
1860 /***/ "./node_modules/es6-promise/dist/es6-promise.js":
1861 /*!******************************************************!*\
1862 !*** ./node_modules/es6-promise/dist/es6-promise.js ***!
1863 \******************************************************/
1864 /*! no static exports found */
1865 /***/ (function(module, exports, __webpack_require__) {
1866
1867 /* WEBPACK VAR INJECTION */(function(process, global) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;var require;function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1868
1869 /*!
1870 * @overview es6-promise - a tiny implementation of Promises/A+.
1871 * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
1872 * @license Licensed under MIT license
1873 * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
1874 * @version 3.3.1
1875 */
1876 (function (global, factory) {
1877 ( false ? undefined : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
1878 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
1879 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
1880 __WEBPACK_AMD_DEFINE_FACTORY__),
1881 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : undefined;
1882 })(this, function () {
1883 'use strict';
1884
1885 function objectOrFunction(x) {
1886 return typeof x === 'function' || _typeof(x) === 'object' && x !== null;
1887 }
1888
1889 function isFunction(x) {
1890 return typeof x === 'function';
1891 }
1892
1893 var _isArray = undefined;
1894
1895 if (!Array.isArray) {
1896 _isArray = function _isArray(x) {
1897 return Object.prototype.toString.call(x) === '[object Array]';
1898 };
1899 } else {
1900 _isArray = Array.isArray;
1901 }
1902
1903 var isArray = _isArray;
1904 var len = 0;
1905 var vertxNext = undefined;
1906 var customSchedulerFn = undefined;
1907
1908 var asap = function asap(callback, arg) {
1909 queue[len] = callback;
1910 queue[len + 1] = arg;
1911 len += 2;
1912
1913 if (len === 2) {
1914 // If len is 2, that means that we need to schedule an async flush.
1915 // If additional callbacks are queued before the queue is flushed, they
1916 // will be processed by this flush that we are scheduling.
1917 if (customSchedulerFn) {
1918 customSchedulerFn(flush);
1919 } else {
1920 scheduleFlush();
1921 }
1922 }
1923 };
1924
1925 function setScheduler(scheduleFn) {
1926 customSchedulerFn = scheduleFn;
1927 }
1928
1929 function setAsap(asapFn) {
1930 asap = asapFn;
1931 }
1932
1933 var browserWindow = typeof window !== 'undefined' ? window : undefined;
1934 var browserGlobal = browserWindow || {};
1935 var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
1936 var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; // test for web worker but not in IE10
1937
1938 var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; // node
1939
1940 function useNextTick() {
1941 // node version 0.10.x displays a deprecation warning when nextTick is used recursively
1942 // see https://github.com/cujojs/when/issues/410 for details
1943 return function () {
1944 return process.nextTick(flush);
1945 };
1946 } // vertx
1947
1948
1949 function useVertxTimer() {
1950 return function () {
1951 vertxNext(flush);
1952 };
1953 }
1954
1955 function useMutationObserver() {
1956 var iterations = 0;
1957 var observer = new BrowserMutationObserver(flush);
1958 var node = document.createTextNode('');
1959 observer.observe(node, {
1960 characterData: true
1961 });
1962 return function () {
1963 node.data = iterations = ++iterations % 2;
1964 };
1965 } // web worker
1966
1967
1968 function useMessageChannel() {
1969 var channel = new MessageChannel();
1970 channel.port1.onmessage = flush;
1971 return function () {
1972 return channel.port2.postMessage(0);
1973 };
1974 }
1975
1976 function useSetTimeout() {
1977 // Store setTimeout reference so es6-promise will be unaffected by
1978 // other code modifying setTimeout (like sinon.useFakeTimers())
1979 var globalSetTimeout = setTimeout;
1980 return function () {
1981 return globalSetTimeout(flush, 1);
1982 };
1983 }
1984
1985 var queue = new Array(1000);
1986
1987 function flush() {
1988 for (var i = 0; i < len; i += 2) {
1989 var callback = queue[i];
1990 var arg = queue[i + 1];
1991 callback(arg);
1992 queue[i] = undefined;
1993 queue[i + 1] = undefined;
1994 }
1995
1996 len = 0;
1997 }
1998
1999 function attemptVertx() {
2000 try {
2001 var r = require;
2002 var vertx = __webpack_require__(/*! vertx */ 1);
2003 vertxNext = vertx.runOnLoop || vertx.runOnContext;
2004 return useVertxTimer();
2005 } catch (e) {
2006 return useSetTimeout();
2007 }
2008 }
2009
2010 var scheduleFlush = undefined; // Decide what async method to use to triggering processing of queued callbacks:
2011
2012 if (isNode) {
2013 scheduleFlush = useNextTick();
2014 } else if (BrowserMutationObserver) {
2015 scheduleFlush = useMutationObserver();
2016 } else if (isWorker) {
2017 scheduleFlush = useMessageChannel();
2018 } else if (browserWindow === undefined && "function" === 'function') {
2019 scheduleFlush = attemptVertx();
2020 } else {
2021 scheduleFlush = useSetTimeout();
2022 }
2023
2024 function then(onFulfillment, onRejection) {
2025 var _arguments = arguments;
2026 var parent = this;
2027 var child = new this.constructor(noop);
2028
2029 if (child[PROMISE_ID] === undefined) {
2030 makePromise(child);
2031 }
2032
2033 var _state = parent._state;
2034
2035 if (_state) {
2036 (function () {
2037 var callback = _arguments[_state - 1];
2038 asap(function () {
2039 return invokeCallback(_state, child, callback, parent._result);
2040 });
2041 })();
2042 } else {
2043 subscribe(parent, child, onFulfillment, onRejection);
2044 }
2045
2046 return child;
2047 }
2048 /**
2049 `Promise.resolve` returns a promise that will become resolved with the
2050 passed `value`. It is shorthand for the following:
2051
2052 ```javascript
2053 let promise = new Promise(function(resolve, reject){
2054 resolve(1);
2055 });
2056
2057 promise.then(function(value){
2058 // value === 1
2059 });
2060 ```
2061
2062 Instead of writing the above, your code now simply becomes the following:
2063
2064 ```javascript
2065 let promise = Promise.resolve(1);
2066
2067 promise.then(function(value){
2068 // value === 1
2069 });
2070 ```
2071
2072 @method resolve
2073 @static
2074 @param {Any} value value that the returned promise will be resolved with
2075 Useful for tooling.
2076 @return {Promise} a promise that will become fulfilled with the given
2077 `value`
2078 */
2079
2080
2081 function resolve(object) {
2082 /*jshint validthis:true */
2083 var Constructor = this;
2084
2085 if (object && _typeof(object) === 'object' && object.constructor === Constructor) {
2086 return object;
2087 }
2088
2089 var promise = new Constructor(noop);
2090
2091 _resolve(promise, object);
2092
2093 return promise;
2094 }
2095
2096 var PROMISE_ID = Math.random().toString(36).substring(16);
2097
2098 function noop() {}
2099
2100 var PENDING = void 0;
2101 var FULFILLED = 1;
2102 var REJECTED = 2;
2103 var GET_THEN_ERROR = new ErrorObject();
2104
2105 function selfFulfillment() {
2106 return new TypeError("You cannot resolve a promise with itself");
2107 }
2108
2109 function cannotReturnOwn() {
2110 return new TypeError('A promises callback cannot return that same promise.');
2111 }
2112
2113 function getThen(promise) {
2114 try {
2115 return promise.then;
2116 } catch (error) {
2117 GET_THEN_ERROR.error = error;
2118 return GET_THEN_ERROR;
2119 }
2120 }
2121
2122 function tryThen(then, value, fulfillmentHandler, rejectionHandler) {
2123 try {
2124 then.call(value, fulfillmentHandler, rejectionHandler);
2125 } catch (e) {
2126 return e;
2127 }
2128 }
2129
2130 function handleForeignThenable(promise, thenable, then) {
2131 asap(function (promise) {
2132 var sealed = false;
2133 var error = tryThen(then, thenable, function (value) {
2134 if (sealed) {
2135 return;
2136 }
2137
2138 sealed = true;
2139
2140 if (thenable !== value) {
2141 _resolve(promise, value);
2142 } else {
2143 fulfill(promise, value);
2144 }
2145 }, function (reason) {
2146 if (sealed) {
2147 return;
2148 }
2149
2150 sealed = true;
2151
2152 _reject(promise, reason);
2153 }, 'Settle: ' + (promise._label || ' unknown promise'));
2154
2155 if (!sealed && error) {
2156 sealed = true;
2157
2158 _reject(promise, error);
2159 }
2160 }, promise);
2161 }
2162
2163 function handleOwnThenable(promise, thenable) {
2164 if (thenable._state === FULFILLED) {
2165 fulfill(promise, thenable._result);
2166 } else if (thenable._state === REJECTED) {
2167 _reject(promise, thenable._result);
2168 } else {
2169 subscribe(thenable, undefined, function (value) {
2170 return _resolve(promise, value);
2171 }, function (reason) {
2172 return _reject(promise, reason);
2173 });
2174 }
2175 }
2176
2177 function handleMaybeThenable(promise, maybeThenable, then$$) {
2178 if (maybeThenable.constructor === promise.constructor && then$$ === then && maybeThenable.constructor.resolve === resolve) {
2179 handleOwnThenable(promise, maybeThenable);
2180 } else {
2181 if (then$$ === GET_THEN_ERROR) {
2182 _reject(promise, GET_THEN_ERROR.error);
2183 } else if (then$$ === undefined) {
2184 fulfill(promise, maybeThenable);
2185 } else if (isFunction(then$$)) {
2186 handleForeignThenable(promise, maybeThenable, then$$);
2187 } else {
2188 fulfill(promise, maybeThenable);
2189 }
2190 }
2191 }
2192
2193 function _resolve(promise, value) {
2194 if (promise === value) {
2195 _reject(promise, selfFulfillment());
2196 } else if (objectOrFunction(value)) {
2197 handleMaybeThenable(promise, value, getThen(value));
2198 } else {
2199 fulfill(promise, value);
2200 }
2201 }
2202
2203 function publishRejection(promise) {
2204 if (promise._onerror) {
2205 promise._onerror(promise._result);
2206 }
2207
2208 publish(promise);
2209 }
2210
2211 function fulfill(promise, value) {
2212 if (promise._state !== PENDING) {
2213 return;
2214 }
2215
2216 promise._result = value;
2217 promise._state = FULFILLED;
2218
2219 if (promise._subscribers.length !== 0) {
2220 asap(publish, promise);
2221 }
2222 }
2223
2224 function _reject(promise, reason) {
2225 if (promise._state !== PENDING) {
2226 return;
2227 }
2228
2229 promise._state = REJECTED;
2230 promise._result = reason;
2231 asap(publishRejection, promise);
2232 }
2233
2234 function subscribe(parent, child, onFulfillment, onRejection) {
2235 var _subscribers = parent._subscribers;
2236 var length = _subscribers.length;
2237 parent._onerror = null;
2238 _subscribers[length] = child;
2239 _subscribers[length + FULFILLED] = onFulfillment;
2240 _subscribers[length + REJECTED] = onRejection;
2241
2242 if (length === 0 && parent._state) {
2243 asap(publish, parent);
2244 }
2245 }
2246
2247 function publish(promise) {
2248 var subscribers = promise._subscribers;
2249 var settled = promise._state;
2250
2251 if (subscribers.length === 0) {
2252 return;
2253 }
2254
2255 var child = undefined,
2256 callback = undefined,
2257 detail = promise._result;
2258
2259 for (var i = 0; i < subscribers.length; i += 3) {
2260 child = subscribers[i];
2261 callback = subscribers[i + settled];
2262
2263 if (child) {
2264 invokeCallback(settled, child, callback, detail);
2265 } else {
2266 callback(detail);
2267 }
2268 }
2269
2270 promise._subscribers.length = 0;
2271 }
2272
2273 function ErrorObject() {
2274 this.error = null;
2275 }
2276
2277 var TRY_CATCH_ERROR = new ErrorObject();
2278
2279 function tryCatch(callback, detail) {
2280 try {
2281 return callback(detail);
2282 } catch (e) {
2283 TRY_CATCH_ERROR.error = e;
2284 return TRY_CATCH_ERROR;
2285 }
2286 }
2287
2288 function invokeCallback(settled, promise, callback, detail) {
2289 var hasCallback = isFunction(callback),
2290 value = undefined,
2291 error = undefined,
2292 succeeded = undefined,
2293 failed = undefined;
2294
2295 if (hasCallback) {
2296 value = tryCatch(callback, detail);
2297
2298 if (value === TRY_CATCH_ERROR) {
2299 failed = true;
2300 error = value.error;
2301 value = null;
2302 } else {
2303 succeeded = true;
2304 }
2305
2306 if (promise === value) {
2307 _reject(promise, cannotReturnOwn());
2308
2309 return;
2310 }
2311 } else {
2312 value = detail;
2313 succeeded = true;
2314 }
2315
2316 if (promise._state !== PENDING) {// noop
2317 } else if (hasCallback && succeeded) {
2318 _resolve(promise, value);
2319 } else if (failed) {
2320 _reject(promise, error);
2321 } else if (settled === FULFILLED) {
2322 fulfill(promise, value);
2323 } else if (settled === REJECTED) {
2324 _reject(promise, value);
2325 }
2326 }
2327
2328 function initializePromise(promise, resolver) {
2329 try {
2330 resolver(function resolvePromise(value) {
2331 _resolve(promise, value);
2332 }, function rejectPromise(reason) {
2333 _reject(promise, reason);
2334 });
2335 } catch (e) {
2336 _reject(promise, e);
2337 }
2338 }
2339
2340 var id = 0;
2341
2342 function nextId() {
2343 return id++;
2344 }
2345
2346 function makePromise(promise) {
2347 promise[PROMISE_ID] = id++;
2348 promise._state = undefined;
2349 promise._result = undefined;
2350 promise._subscribers = [];
2351 }
2352
2353 function Enumerator(Constructor, input) {
2354 this._instanceConstructor = Constructor;
2355 this.promise = new Constructor(noop);
2356
2357 if (!this.promise[PROMISE_ID]) {
2358 makePromise(this.promise);
2359 }
2360
2361 if (isArray(input)) {
2362 this._input = input;
2363 this.length = input.length;
2364 this._remaining = input.length;
2365 this._result = new Array(this.length);
2366
2367 if (this.length === 0) {
2368 fulfill(this.promise, this._result);
2369 } else {
2370 this.length = this.length || 0;
2371
2372 this._enumerate();
2373
2374 if (this._remaining === 0) {
2375 fulfill(this.promise, this._result);
2376 }
2377 }
2378 } else {
2379 _reject(this.promise, validationError());
2380 }
2381 }
2382
2383 function validationError() {
2384 return new Error('Array Methods must be provided an Array');
2385 }
2386
2387 ;
2388
2389 Enumerator.prototype._enumerate = function () {
2390 var length = this.length;
2391 var _input = this._input;
2392
2393 for (var i = 0; this._state === PENDING && i < length; i++) {
2394 this._eachEntry(_input[i], i);
2395 }
2396 };
2397
2398 Enumerator.prototype._eachEntry = function (entry, i) {
2399 var c = this._instanceConstructor;
2400 var resolve$$ = c.resolve;
2401
2402 if (resolve$$ === resolve) {
2403 var _then = getThen(entry);
2404
2405 if (_then === then && entry._state !== PENDING) {
2406 this._settledAt(entry._state, i, entry._result);
2407 } else if (typeof _then !== 'function') {
2408 this._remaining--;
2409 this._result[i] = entry;
2410 } else if (c === Promise) {
2411 var promise = new c(noop);
2412 handleMaybeThenable(promise, entry, _then);
2413
2414 this._willSettleAt(promise, i);
2415 } else {
2416 this._willSettleAt(new c(function (resolve$$) {
2417 return resolve$$(entry);
2418 }), i);
2419 }
2420 } else {
2421 this._willSettleAt(resolve$$(entry), i);
2422 }
2423 };
2424
2425 Enumerator.prototype._settledAt = function (state, i, value) {
2426 var promise = this.promise;
2427
2428 if (promise._state === PENDING) {
2429 this._remaining--;
2430
2431 if (state === REJECTED) {
2432 _reject(promise, value);
2433 } else {
2434 this._result[i] = value;
2435 }
2436 }
2437
2438 if (this._remaining === 0) {
2439 fulfill(promise, this._result);
2440 }
2441 };
2442
2443 Enumerator.prototype._willSettleAt = function (promise, i) {
2444 var enumerator = this;
2445 subscribe(promise, undefined, function (value) {
2446 return enumerator._settledAt(FULFILLED, i, value);
2447 }, function (reason) {
2448 return enumerator._settledAt(REJECTED, i, reason);
2449 });
2450 };
2451 /**
2452 `Promise.all` accepts an array of promises, and returns a new promise which
2453 is fulfilled with an array of fulfillment values for the passed promises, or
2454 rejected with the reason of the first passed promise to be rejected. It casts all
2455 elements of the passed iterable to promises as it runs this algorithm.
2456
2457 Example:
2458
2459 ```javascript
2460 let promise1 = resolve(1);
2461 let promise2 = resolve(2);
2462 let promise3 = resolve(3);
2463 let promises = [ promise1, promise2, promise3 ];
2464
2465 Promise.all(promises).then(function(array){
2466 // The array here would be [ 1, 2, 3 ];
2467 });
2468 ```
2469
2470 If any of the `promises` given to `all` are rejected, the first promise
2471 that is rejected will be given as an argument to the returned promises's
2472 rejection handler. For example:
2473
2474 Example:
2475
2476 ```javascript
2477 let promise1 = resolve(1);
2478 let promise2 = reject(new Error("2"));
2479 let promise3 = reject(new Error("3"));
2480 let promises = [ promise1, promise2, promise3 ];
2481
2482 Promise.all(promises).then(function(array){
2483 // Code here never runs because there are rejected promises!
2484 }, function(error) {
2485 // error.message === "2"
2486 });
2487 ```
2488
2489 @method all
2490 @static
2491 @param {Array} entries array of promises
2492 @param {String} label optional string for labeling the promise.
2493 Useful for tooling.
2494 @return {Promise} promise that is fulfilled when all `promises` have been
2495 fulfilled, or rejected if any of them become rejected.
2496 @static
2497 */
2498
2499
2500 function all(entries) {
2501 return new Enumerator(this, entries).promise;
2502 }
2503 /**
2504 `Promise.race` returns a new promise which is settled in the same way as the
2505 first passed promise to settle.
2506
2507 Example:
2508
2509 ```javascript
2510 let promise1 = new Promise(function(resolve, reject){
2511 setTimeout(function(){
2512 resolve('promise 1');
2513 }, 200);
2514 });
2515
2516 let promise2 = new Promise(function(resolve, reject){
2517 setTimeout(function(){
2518 resolve('promise 2');
2519 }, 100);
2520 });
2521
2522 Promise.race([promise1, promise2]).then(function(result){
2523 // result === 'promise 2' because it was resolved before promise1
2524 // was resolved.
2525 });
2526 ```
2527
2528 `Promise.race` is deterministic in that only the state of the first
2529 settled promise matters. For example, even if other promises given to the
2530 `promises` array argument are resolved, but the first settled promise has
2531 become rejected before the other promises became fulfilled, the returned
2532 promise will become rejected:
2533
2534 ```javascript
2535 let promise1 = new Promise(function(resolve, reject){
2536 setTimeout(function(){
2537 resolve('promise 1');
2538 }, 200);
2539 });
2540
2541 let promise2 = new Promise(function(resolve, reject){
2542 setTimeout(function(){
2543 reject(new Error('promise 2'));
2544 }, 100);
2545 });
2546
2547 Promise.race([promise1, promise2]).then(function(result){
2548 // Code here never runs
2549 }, function(reason){
2550 // reason.message === 'promise 2' because promise 2 became rejected before
2551 // promise 1 became fulfilled
2552 });
2553 ```
2554
2555 An example real-world use case is implementing timeouts:
2556
2557 ```javascript
2558 Promise.race([ajax('foo.json'), timeout(5000)])
2559 ```
2560
2561 @method race
2562 @static
2563 @param {Array} promises array of promises to observe
2564 Useful for tooling.
2565 @return {Promise} a promise which settles in the same way as the first passed
2566 promise to settle.
2567 */
2568
2569
2570 function race(entries) {
2571 /*jshint validthis:true */
2572 var Constructor = this;
2573
2574 if (!isArray(entries)) {
2575 return new Constructor(function (_, reject) {
2576 return reject(new TypeError('You must pass an array to race.'));
2577 });
2578 } else {
2579 return new Constructor(function (resolve, reject) {
2580 var length = entries.length;
2581
2582 for (var i = 0; i < length; i++) {
2583 Constructor.resolve(entries[i]).then(resolve, reject);
2584 }
2585 });
2586 }
2587 }
2588 /**
2589 `Promise.reject` returns a promise rejected with the passed `reason`.
2590 It is shorthand for the following:
2591
2592 ```javascript
2593 let promise = new Promise(function(resolve, reject){
2594 reject(new Error('WHOOPS'));
2595 });
2596
2597 promise.then(function(value){
2598 // Code here doesn't run because the promise is rejected!
2599 }, function(reason){
2600 // reason.message === 'WHOOPS'
2601 });
2602 ```
2603
2604 Instead of writing the above, your code now simply becomes the following:
2605
2606 ```javascript
2607 let promise = Promise.reject(new Error('WHOOPS'));
2608
2609 promise.then(function(value){
2610 // Code here doesn't run because the promise is rejected!
2611 }, function(reason){
2612 // reason.message === 'WHOOPS'
2613 });
2614 ```
2615
2616 @method reject
2617 @static
2618 @param {Any} reason value that the returned promise will be rejected with.
2619 Useful for tooling.
2620 @return {Promise} a promise rejected with the given `reason`.
2621 */
2622
2623
2624 function reject(reason) {
2625 /*jshint validthis:true */
2626 var Constructor = this;
2627 var promise = new Constructor(noop);
2628
2629 _reject(promise, reason);
2630
2631 return promise;
2632 }
2633
2634 function needsResolver() {
2635 throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
2636 }
2637
2638 function needsNew() {
2639 throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
2640 }
2641 /**
2642 Promise objects represent the eventual result of an asynchronous operation. The
2643 primary way of interacting with a promise is through its `then` method, which
2644 registers callbacks to receive either a promise's eventual value or the reason
2645 why the promise cannot be fulfilled.
2646
2647 Terminology
2648 -----------
2649
2650 - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
2651 - `thenable` is an object or function that defines a `then` method.
2652 - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
2653 - `exception` is a value that is thrown using the throw statement.
2654 - `reason` is a value that indicates why a promise was rejected.
2655 - `settled` the final resting state of a promise, fulfilled or rejected.
2656
2657 A promise can be in one of three states: pending, fulfilled, or rejected.
2658
2659 Promises that are fulfilled have a fulfillment value and are in the fulfilled
2660 state. Promises that are rejected have a rejection reason and are in the
2661 rejected state. A fulfillment value is never a thenable.
2662
2663 Promises can also be said to *resolve* a value. If this value is also a
2664 promise, then the original promise's settled state will match the value's
2665 settled state. So a promise that *resolves* a promise that rejects will
2666 itself reject, and a promise that *resolves* a promise that fulfills will
2667 itself fulfill.
2668
2669
2670 Basic Usage:
2671 ------------
2672
2673 ```js
2674 let promise = new Promise(function(resolve, reject) {
2675 // on success
2676 resolve(value);
2677
2678 // on failure
2679 reject(reason);
2680 });
2681
2682 promise.then(function(value) {
2683 // on fulfillment
2684 }, function(reason) {
2685 // on rejection
2686 });
2687 ```
2688
2689 Advanced Usage:
2690 ---------------
2691
2692 Promises shine when abstracting away asynchronous interactions such as
2693 `XMLHttpRequest`s.
2694
2695 ```js
2696 function getJSON(url) {
2697 return new Promise(function(resolve, reject){
2698 let xhr = new XMLHttpRequest();
2699
2700 xhr.open('GET', url);
2701 xhr.onreadystatechange = handler;
2702 xhr.responseType = 'json';
2703 xhr.setRequestHeader('Accept', 'application/json');
2704 xhr.send();
2705
2706 function handler() {
2707 if (this.readyState === this.DONE) {
2708 if (this.status === 200) {
2709 resolve(this.response);
2710 } else {
2711 reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
2712 }
2713 }
2714 };
2715 });
2716 }
2717
2718 getJSON('/posts.json').then(function(json) {
2719 // on fulfillment
2720 }, function(reason) {
2721 // on rejection
2722 });
2723 ```
2724
2725 Unlike callbacks, promises are great composable primitives.
2726
2727 ```js
2728 Promise.all([
2729 getJSON('/posts'),
2730 getJSON('/comments')
2731 ]).then(function(values){
2732 values[0] // => postsJSON
2733 values[1] // => commentsJSON
2734
2735 return values;
2736 });
2737 ```
2738
2739 @class Promise
2740 @param {function} resolver
2741 Useful for tooling.
2742 @constructor
2743 */
2744
2745
2746 function Promise(resolver) {
2747 this[PROMISE_ID] = nextId();
2748 this._result = this._state = undefined;
2749 this._subscribers = [];
2750
2751 if (noop !== resolver) {
2752 typeof resolver !== 'function' && needsResolver();
2753 this instanceof Promise ? initializePromise(this, resolver) : needsNew();
2754 }
2755 }
2756
2757 Promise.all = all;
2758 Promise.race = race;
2759 Promise.resolve = resolve;
2760 Promise.reject = reject;
2761 Promise._setScheduler = setScheduler;
2762 Promise._setAsap = setAsap;
2763 Promise._asap = asap;
2764 Promise.prototype = {
2765 constructor: Promise,
2766
2767 /**
2768 The primary way of interacting with a promise is through its `then` method,
2769 which registers callbacks to receive either a promise's eventual value or the
2770 reason why the promise cannot be fulfilled.
2771
2772 ```js
2773 findUser().then(function(user){
2774 // user is available
2775 }, function(reason){
2776 // user is unavailable, and you are given the reason why
2777 });
2778 ```
2779
2780 Chaining
2781 --------
2782
2783 The return value of `then` is itself a promise. This second, 'downstream'
2784 promise is resolved with the return value of the first promise's fulfillment
2785 or rejection handler, or rejected if the handler throws an exception.
2786
2787 ```js
2788 findUser().then(function (user) {
2789 return user.name;
2790 }, function (reason) {
2791 return 'default name';
2792 }).then(function (userName) {
2793 // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
2794 // will be `'default name'`
2795 });
2796
2797 findUser().then(function (user) {
2798 throw new Error('Found user, but still unhappy');
2799 }, function (reason) {
2800 throw new Error('`findUser` rejected and we're unhappy');
2801 }).then(function (value) {
2802 // never reached
2803 }, function (reason) {
2804 // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
2805 // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
2806 });
2807 ```
2808 If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
2809
2810 ```js
2811 findUser().then(function (user) {
2812 throw new PedagogicalException('Upstream error');
2813 }).then(function (value) {
2814 // never reached
2815 }).then(function (value) {
2816 // never reached
2817 }, function (reason) {
2818 // The `PedgagocialException` is propagated all the way down to here
2819 });
2820 ```
2821
2822 Assimilation
2823 ------------
2824
2825 Sometimes the value you want to propagate to a downstream promise can only be
2826 retrieved asynchronously. This can be achieved by returning a promise in the
2827 fulfillment or rejection handler. The downstream promise will then be pending
2828 until the returned promise is settled. This is called *assimilation*.
2829
2830 ```js
2831 findUser().then(function (user) {
2832 return findCommentsByAuthor(user);
2833 }).then(function (comments) {
2834 // The user's comments are now available
2835 });
2836 ```
2837
2838 If the assimliated promise rejects, then the downstream promise will also reject.
2839
2840 ```js
2841 findUser().then(function (user) {
2842 return findCommentsByAuthor(user);
2843 }).then(function (comments) {
2844 // If `findCommentsByAuthor` fulfills, we'll have the value here
2845 }, function (reason) {
2846 // If `findCommentsByAuthor` rejects, we'll have the reason here
2847 });
2848 ```
2849
2850 Simple Example
2851 --------------
2852
2853 Synchronous Example
2854
2855 ```javascript
2856 let result;
2857
2858 try {
2859 result = findResult();
2860 // success
2861 } catch(reason) {
2862 // failure
2863 }
2864 ```
2865
2866 Errback Example
2867
2868 ```js
2869 findResult(function(result, err){
2870 if (err) {
2871 // failure
2872 } else {
2873 // success
2874 }
2875 });
2876 ```
2877
2878 Promise Example;
2879
2880 ```javascript
2881 findResult().then(function(result){
2882 // success
2883 }, function(reason){
2884 // failure
2885 });
2886 ```
2887
2888 Advanced Example
2889 --------------
2890
2891 Synchronous Example
2892
2893 ```javascript
2894 let author, books;
2895
2896 try {
2897 author = findAuthor();
2898 books = findBooksByAuthor(author);
2899 // success
2900 } catch(reason) {
2901 // failure
2902 }
2903 ```
2904
2905 Errback Example
2906
2907 ```js
2908
2909 function foundBooks(books) {
2910
2911 }
2912
2913 function failure(reason) {
2914
2915 }
2916
2917 findAuthor(function(author, err){
2918 if (err) {
2919 failure(err);
2920 // failure
2921 } else {
2922 try {
2923 findBoooksByAuthor(author, function(books, err) {
2924 if (err) {
2925 failure(err);
2926 } else {
2927 try {
2928 foundBooks(books);
2929 } catch(reason) {
2930 failure(reason);
2931 }
2932 }
2933 });
2934 } catch(error) {
2935 failure(err);
2936 }
2937 // success
2938 }
2939 });
2940 ```
2941
2942 Promise Example;
2943
2944 ```javascript
2945 findAuthor().
2946 then(findBooksByAuthor).
2947 then(function(books){
2948 // found books
2949 }).catch(function(reason){
2950 // something went wrong
2951 });
2952 ```
2953
2954 @method then
2955 @param {Function} onFulfilled
2956 @param {Function} onRejected
2957 Useful for tooling.
2958 @return {Promise}
2959 */
2960 then: then,
2961
2962 /**
2963 `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
2964 as the catch block of a try/catch statement.
2965
2966 ```js
2967 function findAuthor(){
2968 throw new Error('couldn't find that author');
2969 }
2970
2971 // synchronous
2972 try {
2973 findAuthor();
2974 } catch(reason) {
2975 // something went wrong
2976 }
2977
2978 // async with promises
2979 findAuthor().catch(function(reason){
2980 // something went wrong
2981 });
2982 ```
2983
2984 @method catch
2985 @param {Function} onRejection
2986 Useful for tooling.
2987 @return {Promise}
2988 */
2989 'catch': function _catch(onRejection) {
2990 return this.then(null, onRejection);
2991 }
2992 };
2993
2994 function polyfill() {
2995 var local = undefined;
2996
2997 if (typeof global !== 'undefined') {
2998 local = global;
2999 } else if (typeof self !== 'undefined') {
3000 local = self;
3001 } else {
3002 try {
3003 local = Function('return this')();
3004 } catch (e) {
3005 throw new Error('polyfill failed because global object is unavailable in this environment');
3006 }
3007 }
3008
3009 var P = local.Promise;
3010
3011 if (P) {
3012 var promiseToString = null;
3013
3014 try {
3015 promiseToString = Object.prototype.toString.call(P.resolve());
3016 } catch (e) {// silently ignored
3017 }
3018
3019 if (promiseToString === '[object Promise]' && !P.cast) {
3020 return;
3021 }
3022 }
3023
3024 local.Promise = Promise;
3025 }
3026
3027 polyfill(); // Strange compat..
3028
3029 Promise.polyfill = polyfill;
3030 Promise.Promise = Promise;
3031 return Promise;
3032 });
3033 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
3034
3035 /***/ }),
3036
3037 /***/ "./node_modules/process/browser.js":
3038 /*!*****************************************!*\
3039 !*** ./node_modules/process/browser.js ***!
3040 \*****************************************/
3041 /*! no static exports found */
3042 /***/ (function(module, exports) {
3043
3044 // shim for using process in browser
3045 var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it
3046 // don't break things. But we need to wrap it in a try catch in case it is
3047 // wrapped in strict mode code which doesn't define any globals. It's inside a
3048 // function because try/catches deoptimize in certain engines.
3049
3050 var cachedSetTimeout;
3051 var cachedClearTimeout;
3052
3053 function defaultSetTimout() {
3054 throw new Error('setTimeout has not been defined');
3055 }
3056
3057 function defaultClearTimeout() {
3058 throw new Error('clearTimeout has not been defined');
3059 }
3060
3061 (function () {
3062 try {
3063 if (typeof setTimeout === 'function') {
3064 cachedSetTimeout = setTimeout;
3065 } else {
3066 cachedSetTimeout = defaultSetTimout;
3067 }
3068 } catch (e) {
3069 cachedSetTimeout = defaultSetTimout;
3070 }
3071
3072 try {
3073 if (typeof clearTimeout === 'function') {
3074 cachedClearTimeout = clearTimeout;
3075 } else {
3076 cachedClearTimeout = defaultClearTimeout;
3077 }
3078 } catch (e) {
3079 cachedClearTimeout = defaultClearTimeout;
3080 }
3081 })();
3082
3083 function runTimeout(fun) {
3084 if (cachedSetTimeout === setTimeout) {
3085 //normal enviroments in sane situations
3086 return setTimeout(fun, 0);
3087 } // if setTimeout wasn't available but was latter defined
3088
3089
3090 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
3091 cachedSetTimeout = setTimeout;
3092 return setTimeout(fun, 0);
3093 }
3094
3095 try {
3096 // when when somebody has screwed with setTimeout but no I.E. maddness
3097 return cachedSetTimeout(fun, 0);
3098 } catch (e) {
3099 try {
3100 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
3101 return cachedSetTimeout.call(null, fun, 0);
3102 } catch (e) {
3103 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
3104 return cachedSetTimeout.call(this, fun, 0);
3105 }
3106 }
3107 }
3108
3109 function runClearTimeout(marker) {
3110 if (cachedClearTimeout === clearTimeout) {
3111 //normal enviroments in sane situations
3112 return clearTimeout(marker);
3113 } // if clearTimeout wasn't available but was latter defined
3114
3115
3116 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
3117 cachedClearTimeout = clearTimeout;
3118 return clearTimeout(marker);
3119 }
3120
3121 try {
3122 // when when somebody has screwed with setTimeout but no I.E. maddness
3123 return cachedClearTimeout(marker);
3124 } catch (e) {
3125 try {
3126 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
3127 return cachedClearTimeout.call(null, marker);
3128 } catch (e) {
3129 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
3130 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
3131 return cachedClearTimeout.call(this, marker);
3132 }
3133 }
3134 }
3135
3136 var queue = [];
3137 var draining = false;
3138 var currentQueue;
3139 var queueIndex = -1;
3140
3141 function cleanUpNextTick() {
3142 if (!draining || !currentQueue) {
3143 return;
3144 }
3145
3146 draining = false;
3147
3148 if (currentQueue.length) {
3149 queue = currentQueue.concat(queue);
3150 } else {
3151 queueIndex = -1;
3152 }
3153
3154 if (queue.length) {
3155 drainQueue();
3156 }
3157 }
3158
3159 function drainQueue() {
3160 if (draining) {
3161 return;
3162 }
3163
3164 var timeout = runTimeout(cleanUpNextTick);
3165 draining = true;
3166 var len = queue.length;
3167
3168 while (len) {
3169 currentQueue = queue;
3170 queue = [];
3171
3172 while (++queueIndex < len) {
3173 if (currentQueue) {
3174 currentQueue[queueIndex].run();
3175 }
3176 }
3177
3178 queueIndex = -1;
3179 len = queue.length;
3180 }
3181
3182 currentQueue = null;
3183 draining = false;
3184 runClearTimeout(timeout);
3185 }
3186
3187 process.nextTick = function (fun) {
3188 var args = new Array(arguments.length - 1);
3189
3190 if (arguments.length > 1) {
3191 for (var i = 1; i < arguments.length; i++) {
3192 args[i - 1] = arguments[i];
3193 }
3194 }
3195
3196 queue.push(new Item(fun, args));
3197
3198 if (queue.length === 1 && !draining) {
3199 runTimeout(drainQueue);
3200 }
3201 }; // v8 likes predictible objects
3202
3203
3204 function Item(fun, array) {
3205 this.fun = fun;
3206 this.array = array;
3207 }
3208
3209 Item.prototype.run = function () {
3210 this.fun.apply(null, this.array);
3211 };
3212
3213 process.title = 'browser';
3214 process.browser = true;
3215 process.env = {};
3216 process.argv = [];
3217 process.version = ''; // empty string to avoid regexp issues
3218
3219 process.versions = {};
3220
3221 function noop() {}
3222
3223 process.on = noop;
3224 process.addListener = noop;
3225 process.once = noop;
3226 process.off = noop;
3227 process.removeListener = noop;
3228 process.removeAllListeners = noop;
3229 process.emit = noop;
3230 process.prependListener = noop;
3231 process.prependOnceListener = noop;
3232
3233 process.listeners = function (name) {
3234 return [];
3235 };
3236
3237 process.binding = function (name) {
3238 throw new Error('process.binding is not supported');
3239 };
3240
3241 process.cwd = function () {
3242 return '/';
3243 };
3244
3245 process.chdir = function (dir) {
3246 throw new Error('process.chdir is not supported');
3247 };
3248
3249 process.umask = function () {
3250 return 0;
3251 };
3252
3253 /***/ }),
3254
3255 /***/ "./node_modules/regenerator-runtime/runtime.js":
3256 /*!*****************************************************!*\
3257 !*** ./node_modules/regenerator-runtime/runtime.js ***!
3258 \*****************************************************/
3259 /*! no static exports found */
3260 /***/ (function(module, exports, __webpack_require__) {
3261
3262 /* WEBPACK VAR INJECTION */(function(module) {function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3263
3264 /**
3265 * Copyright (c) 2014-present, Facebook, Inc.
3266 *
3267 * This source code is licensed under the MIT license found in the
3268 * LICENSE file in the root directory of this source tree.
3269 */
3270 var runtime = function (exports) {
3271 "use strict";
3272
3273 var Op = Object.prototype;
3274 var hasOwn = Op.hasOwnProperty;
3275 var undefined; // More compressible than void 0.
3276
3277 var $Symbol = typeof Symbol === "function" ? Symbol : {};
3278 var iteratorSymbol = $Symbol.iterator || "@@iterator";
3279 var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
3280 var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
3281
3282 function wrap(innerFn, outerFn, self, tryLocsList) {
3283 // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
3284 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
3285 var generator = Object.create(protoGenerator.prototype);
3286 var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
3287 // .throw, and .return methods.
3288
3289 generator._invoke = makeInvokeMethod(innerFn, self, context);
3290 return generator;
3291 }
3292
3293 exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
3294 // record like context.tryEntries[i].completion. This interface could
3295 // have been (and was previously) designed to take a closure to be
3296 // invoked without arguments, but in all the cases we care about we
3297 // already have an existing method we want to call, so there's no need
3298 // to create a new function object. We can even get away with assuming
3299 // the method takes exactly one argument, since that happens to be true
3300 // in every case, so we don't have to touch the arguments object. The
3301 // only additional allocation required is the completion record, which
3302 // has a stable shape and so hopefully should be cheap to allocate.
3303
3304 function tryCatch(fn, obj, arg) {
3305 try {
3306 return {
3307 type: "normal",
3308 arg: fn.call(obj, arg)
3309 };
3310 } catch (err) {
3311 return {
3312 type: "throw",
3313 arg: err
3314 };
3315 }
3316 }
3317
3318 var GenStateSuspendedStart = "suspendedStart";
3319 var GenStateSuspendedYield = "suspendedYield";
3320 var GenStateExecuting = "executing";
3321 var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
3322 // breaking out of the dispatch switch statement.
3323
3324 var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
3325 // .constructor.prototype properties for functions that return Generator
3326 // objects. For full spec compliance, you may wish to configure your
3327 // minifier not to mangle the names of these two functions.
3328
3329 function Generator() {}
3330
3331 function GeneratorFunction() {}
3332
3333 function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
3334 // don't natively support it.
3335
3336
3337 var IteratorPrototype = {};
3338
3339 IteratorPrototype[iteratorSymbol] = function () {
3340 return this;
3341 };
3342
3343 var getProto = Object.getPrototypeOf;
3344 var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
3345
3346 if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
3347 // This environment has a native %IteratorPrototype%; use it instead
3348 // of the polyfill.
3349 IteratorPrototype = NativeIteratorPrototype;
3350 }
3351
3352 var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
3353 GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
3354 GeneratorFunctionPrototype.constructor = GeneratorFunction;
3355 GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; // Helper for defining the .next, .throw, and .return methods of the
3356 // Iterator interface in terms of a single ._invoke method.
3357
3358 function defineIteratorMethods(prototype) {
3359 ["next", "throw", "return"].forEach(function (method) {
3360 prototype[method] = function (arg) {
3361 return this._invoke(method, arg);
3362 };
3363 });
3364 }
3365
3366 exports.isGeneratorFunction = function (genFun) {
3367 var ctor = typeof genFun === "function" && genFun.constructor;
3368 return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
3369 // do is to check its .name property.
3370 (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
3371 };
3372
3373 exports.mark = function (genFun) {
3374 if (Object.setPrototypeOf) {
3375 Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
3376 } else {
3377 genFun.__proto__ = GeneratorFunctionPrototype;
3378
3379 if (!(toStringTagSymbol in genFun)) {
3380 genFun[toStringTagSymbol] = "GeneratorFunction";
3381 }
3382 }
3383
3384 genFun.prototype = Object.create(Gp);
3385 return genFun;
3386 }; // Within the body of any async function, `await x` is transformed to
3387 // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
3388 // `hasOwn.call(value, "__await")` to determine if the yielded value is
3389 // meant to be awaited.
3390
3391
3392 exports.awrap = function (arg) {
3393 return {
3394 __await: arg
3395 };
3396 };
3397
3398 function AsyncIterator(generator, PromiseImpl) {
3399 function invoke(method, arg, resolve, reject) {
3400 var record = tryCatch(generator[method], generator, arg);
3401
3402 if (record.type === "throw") {
3403 reject(record.arg);
3404 } else {
3405 var result = record.arg;
3406 var value = result.value;
3407
3408 if (value && _typeof(value) === "object" && hasOwn.call(value, "__await")) {
3409 return PromiseImpl.resolve(value.__await).then(function (value) {
3410 invoke("next", value, resolve, reject);
3411 }, function (err) {
3412 invoke("throw", err, resolve, reject);
3413 });
3414 }
3415
3416 return PromiseImpl.resolve(value).then(function (unwrapped) {
3417 // When a yielded Promise is resolved, its final value becomes
3418 // the .value of the Promise<{value,done}> result for the
3419 // current iteration.
3420 result.value = unwrapped;
3421 resolve(result);
3422 }, function (error) {
3423 // If a rejected Promise was yielded, throw the rejection back
3424 // into the async generator function so it can be handled there.
3425 return invoke("throw", error, resolve, reject);
3426 });
3427 }
3428 }
3429
3430 var previousPromise;
3431
3432 function enqueue(method, arg) {
3433 function callInvokeWithMethodAndArg() {
3434 return new PromiseImpl(function (resolve, reject) {
3435 invoke(method, arg, resolve, reject);
3436 });
3437 }
3438
3439 return previousPromise = // If enqueue has been called before, then we want to wait until
3440 // all previous Promises have been resolved before calling invoke,
3441 // so that results are always delivered in the correct order. If
3442 // enqueue has not been called before, then it is important to
3443 // call invoke immediately, without waiting on a callback to fire,
3444 // so that the async generator function has the opportunity to do
3445 // any necessary setup in a predictable way. This predictability
3446 // is why the Promise constructor synchronously invokes its
3447 // executor callback, and why async functions synchronously
3448 // execute code before the first await. Since we implement simple
3449 // async functions in terms of async generators, it is especially
3450 // important to get this right, even though it requires care.
3451 previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
3452 // invocations of the iterator.
3453 callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
3454 } // Define the unified helper method that is used to implement .next,
3455 // .throw, and .return (see defineIteratorMethods).
3456
3457
3458 this._invoke = enqueue;
3459 }
3460
3461 defineIteratorMethods(AsyncIterator.prototype);
3462
3463 AsyncIterator.prototype[asyncIteratorSymbol] = function () {
3464 return this;
3465 };
3466
3467 exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
3468 // AsyncIterator objects; they just return a Promise for the value of
3469 // the final result produced by the iterator.
3470
3471 exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
3472 if (PromiseImpl === void 0) PromiseImpl = Promise;
3473 var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
3474 return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
3475 : iter.next().then(function (result) {
3476 return result.done ? result.value : iter.next();
3477 });
3478 };
3479
3480 function makeInvokeMethod(innerFn, self, context) {
3481 var state = GenStateSuspendedStart;
3482 return function invoke(method, arg) {
3483 if (state === GenStateExecuting) {
3484 throw new Error("Generator is already running");
3485 }
3486
3487 if (state === GenStateCompleted) {
3488 if (method === "throw") {
3489 throw arg;
3490 } // Be forgiving, per 25.3.3.3.3 of the spec:
3491 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
3492
3493
3494 return doneResult();
3495 }
3496
3497 context.method = method;
3498 context.arg = arg;
3499
3500 while (true) {
3501 var delegate = context.delegate;
3502
3503 if (delegate) {
3504 var delegateResult = maybeInvokeDelegate(delegate, context);
3505
3506 if (delegateResult) {
3507 if (delegateResult === ContinueSentinel) continue;
3508 return delegateResult;
3509 }
3510 }
3511
3512 if (context.method === "next") {
3513 // Setting context._sent for legacy support of Babel's
3514 // function.sent implementation.
3515 context.sent = context._sent = context.arg;
3516 } else if (context.method === "throw") {
3517 if (state === GenStateSuspendedStart) {
3518 state = GenStateCompleted;
3519 throw context.arg;
3520 }
3521
3522 context.dispatchException(context.arg);
3523 } else if (context.method === "return") {
3524 context.abrupt("return", context.arg);
3525 }
3526
3527 state = GenStateExecuting;
3528 var record = tryCatch(innerFn, self, context);
3529
3530 if (record.type === "normal") {
3531 // If an exception is thrown from innerFn, we leave state ===
3532 // GenStateExecuting and loop back for another invocation.
3533 state = context.done ? GenStateCompleted : GenStateSuspendedYield;
3534
3535 if (record.arg === ContinueSentinel) {
3536 continue;
3537 }
3538
3539 return {
3540 value: record.arg,
3541 done: context.done
3542 };
3543 } else if (record.type === "throw") {
3544 state = GenStateCompleted; // Dispatch the exception by looping back around to the
3545 // context.dispatchException(context.arg) call above.
3546
3547 context.method = "throw";
3548 context.arg = record.arg;
3549 }
3550 }
3551 };
3552 } // Call delegate.iterator[context.method](context.arg) and handle the
3553 // result, either by returning a { value, done } result from the
3554 // delegate iterator, or by modifying context.method and context.arg,
3555 // setting context.delegate to null, and returning the ContinueSentinel.
3556
3557
3558 function maybeInvokeDelegate(delegate, context) {
3559 var method = delegate.iterator[context.method];
3560
3561 if (method === undefined) {
3562 // A .throw or .return when the delegate iterator has no .throw
3563 // method always terminates the yield* loop.
3564 context.delegate = null;
3565
3566 if (context.method === "throw") {
3567 // Note: ["return"] must be used for ES3 parsing compatibility.
3568 if (delegate.iterator["return"]) {
3569 // If the delegate iterator has a return method, give it a
3570 // chance to clean up.
3571 context.method = "return";
3572 context.arg = undefined;
3573 maybeInvokeDelegate(delegate, context);
3574
3575 if (context.method === "throw") {
3576 // If maybeInvokeDelegate(context) changed context.method from
3577 // "return" to "throw", let that override the TypeError below.
3578 return ContinueSentinel;
3579 }
3580 }
3581
3582 context.method = "throw";
3583 context.arg = new TypeError("The iterator does not provide a 'throw' method");
3584 }
3585
3586 return ContinueSentinel;
3587 }
3588
3589 var record = tryCatch(method, delegate.iterator, context.arg);
3590
3591 if (record.type === "throw") {
3592 context.method = "throw";
3593 context.arg = record.arg;
3594 context.delegate = null;
3595 return ContinueSentinel;
3596 }
3597
3598 var info = record.arg;
3599
3600 if (!info) {
3601 context.method = "throw";
3602 context.arg = new TypeError("iterator result is not an object");
3603 context.delegate = null;
3604 return ContinueSentinel;
3605 }
3606
3607 if (info.done) {
3608 // Assign the result of the finished delegate to the temporary
3609 // variable specified by delegate.resultName (see delegateYield).
3610 context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
3611
3612 context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
3613 // exception, let the outer generator proceed normally. If
3614 // context.method was "next", forget context.arg since it has been
3615 // "consumed" by the delegate iterator. If context.method was
3616 // "return", allow the original .return call to continue in the
3617 // outer generator.
3618
3619 if (context.method !== "return") {
3620 context.method = "next";
3621 context.arg = undefined;
3622 }
3623 } else {
3624 // Re-yield the result returned by the delegate method.
3625 return info;
3626 } // The delegate iterator is finished, so forget it and continue with
3627 // the outer generator.
3628
3629
3630 context.delegate = null;
3631 return ContinueSentinel;
3632 } // Define Generator.prototype.{next,throw,return} in terms of the
3633 // unified ._invoke helper method.
3634
3635
3636 defineIteratorMethods(Gp);
3637 Gp[toStringTagSymbol] = "Generator"; // A Generator should always return itself as the iterator object when the
3638 // @@iterator function is called on it. Some browsers' implementations of the
3639 // iterator prototype chain incorrectly implement this, causing the Generator
3640 // object to not be returned from this call. This ensures that doesn't happen.
3641 // See https://github.com/facebook/regenerator/issues/274 for more details.
3642
3643 Gp[iteratorSymbol] = function () {
3644 return this;
3645 };
3646
3647 Gp.toString = function () {
3648 return "[object Generator]";
3649 };
3650
3651 function pushTryEntry(locs) {
3652 var entry = {
3653 tryLoc: locs[0]
3654 };
3655
3656 if (1 in locs) {
3657 entry.catchLoc = locs[1];
3658 }
3659
3660 if (2 in locs) {
3661 entry.finallyLoc = locs[2];
3662 entry.afterLoc = locs[3];
3663 }
3664
3665 this.tryEntries.push(entry);
3666 }
3667
3668 function resetTryEntry(entry) {
3669 var record = entry.completion || {};
3670 record.type = "normal";
3671 delete record.arg;
3672 entry.completion = record;
3673 }
3674
3675 function Context(tryLocsList) {
3676 // The root entry object (effectively a try statement without a catch
3677 // or a finally block) gives us a place to store values thrown from
3678 // locations where there is no enclosing try statement.
3679 this.tryEntries = [{
3680 tryLoc: "root"
3681 }];
3682 tryLocsList.forEach(pushTryEntry, this);
3683 this.reset(true);
3684 }
3685
3686 exports.keys = function (object) {
3687 var keys = [];
3688
3689 for (var key in object) {
3690 keys.push(key);
3691 }
3692
3693 keys.reverse(); // Rather than returning an object with a next method, we keep
3694 // things simple and return the next function itself.
3695
3696 return function next() {
3697 while (keys.length) {
3698 var key = keys.pop();
3699
3700 if (key in object) {
3701 next.value = key;
3702 next.done = false;
3703 return next;
3704 }
3705 } // To avoid creating an additional object, we just hang the .value
3706 // and .done properties off the next function object itself. This
3707 // also ensures that the minifier will not anonymize the function.
3708
3709
3710 next.done = true;
3711 return next;
3712 };
3713 };
3714
3715 function values(iterable) {
3716 if (iterable) {
3717 var iteratorMethod = iterable[iteratorSymbol];
3718
3719 if (iteratorMethod) {
3720 return iteratorMethod.call(iterable);
3721 }
3722
3723 if (typeof iterable.next === "function") {
3724 return iterable;
3725 }
3726
3727 if (!isNaN(iterable.length)) {
3728 var i = -1,
3729 next = function next() {
3730 while (++i < iterable.length) {
3731 if (hasOwn.call(iterable, i)) {
3732 next.value = iterable[i];
3733 next.done = false;
3734 return next;
3735 }
3736 }
3737
3738 next.value = undefined;
3739 next.done = true;
3740 return next;
3741 };
3742
3743 return next.next = next;
3744 }
3745 } // Return an iterator with no values.
3746
3747
3748 return {
3749 next: doneResult
3750 };
3751 }
3752
3753 exports.values = values;
3754
3755 function doneResult() {
3756 return {
3757 value: undefined,
3758 done: true
3759 };
3760 }
3761
3762 Context.prototype = {
3763 constructor: Context,
3764 reset: function reset(skipTempReset) {
3765 this.prev = 0;
3766 this.next = 0; // Resetting context._sent for legacy support of Babel's
3767 // function.sent implementation.
3768
3769 this.sent = this._sent = undefined;
3770 this.done = false;
3771 this.delegate = null;
3772 this.method = "next";
3773 this.arg = undefined;
3774 this.tryEntries.forEach(resetTryEntry);
3775
3776 if (!skipTempReset) {
3777 for (var name in this) {
3778 // Not sure about the optimal order of these conditions:
3779 if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
3780 this[name] = undefined;
3781 }
3782 }
3783 }
3784 },
3785 stop: function stop() {
3786 this.done = true;
3787 var rootEntry = this.tryEntries[0];
3788 var rootRecord = rootEntry.completion;
3789
3790 if (rootRecord.type === "throw") {
3791 throw rootRecord.arg;
3792 }
3793
3794 return this.rval;
3795 },
3796 dispatchException: function dispatchException(exception) {
3797 if (this.done) {
3798 throw exception;
3799 }
3800
3801 var context = this;
3802
3803 function handle(loc, caught) {
3804 record.type = "throw";
3805 record.arg = exception;
3806 context.next = loc;
3807
3808 if (caught) {
3809 // If the dispatched exception was caught by a catch block,
3810 // then let that catch block handle the exception normally.
3811 context.method = "next";
3812 context.arg = undefined;
3813 }
3814
3815 return !!caught;
3816 }
3817
3818 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3819 var entry = this.tryEntries[i];
3820 var record = entry.completion;
3821
3822 if (entry.tryLoc === "root") {
3823 // Exception thrown outside of any try block that could handle
3824 // it, so set the completion value of the entire function to
3825 // throw the exception.
3826 return handle("end");
3827 }
3828
3829 if (entry.tryLoc <= this.prev) {
3830 var hasCatch = hasOwn.call(entry, "catchLoc");
3831 var hasFinally = hasOwn.call(entry, "finallyLoc");
3832
3833 if (hasCatch && hasFinally) {
3834 if (this.prev < entry.catchLoc) {
3835 return handle(entry.catchLoc, true);
3836 } else if (this.prev < entry.finallyLoc) {
3837 return handle(entry.finallyLoc);
3838 }
3839 } else if (hasCatch) {
3840 if (this.prev < entry.catchLoc) {
3841 return handle(entry.catchLoc, true);
3842 }
3843 } else if (hasFinally) {
3844 if (this.prev < entry.finallyLoc) {
3845 return handle(entry.finallyLoc);
3846 }
3847 } else {
3848 throw new Error("try statement without catch or finally");
3849 }
3850 }
3851 }
3852 },
3853 abrupt: function abrupt(type, arg) {
3854 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3855 var entry = this.tryEntries[i];
3856
3857 if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
3858 var finallyEntry = entry;
3859 break;
3860 }
3861 }
3862
3863 if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
3864 // Ignore the finally entry if control is not jumping to a
3865 // location outside the try/catch block.
3866 finallyEntry = null;
3867 }
3868
3869 var record = finallyEntry ? finallyEntry.completion : {};
3870 record.type = type;
3871 record.arg = arg;
3872
3873 if (finallyEntry) {
3874 this.method = "next";
3875 this.next = finallyEntry.finallyLoc;
3876 return ContinueSentinel;
3877 }
3878
3879 return this.complete(record);
3880 },
3881 complete: function complete(record, afterLoc) {
3882 if (record.type === "throw") {
3883 throw record.arg;
3884 }
3885
3886 if (record.type === "break" || record.type === "continue") {
3887 this.next = record.arg;
3888 } else if (record.type === "return") {
3889 this.rval = this.arg = record.arg;
3890 this.method = "return";
3891 this.next = "end";
3892 } else if (record.type === "normal" && afterLoc) {
3893 this.next = afterLoc;
3894 }
3895
3896 return ContinueSentinel;
3897 },
3898 finish: function finish(finallyLoc) {
3899 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3900 var entry = this.tryEntries[i];
3901
3902 if (entry.finallyLoc === finallyLoc) {
3903 this.complete(entry.completion, entry.afterLoc);
3904 resetTryEntry(entry);
3905 return ContinueSentinel;
3906 }
3907 }
3908 },
3909 "catch": function _catch(tryLoc) {
3910 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3911 var entry = this.tryEntries[i];
3912
3913 if (entry.tryLoc === tryLoc) {
3914 var record = entry.completion;
3915
3916 if (record.type === "throw") {
3917 var thrown = record.arg;
3918 resetTryEntry(entry);
3919 }
3920
3921 return thrown;
3922 }
3923 } // The context.catch method must only be called with a location
3924 // argument that corresponds to a known catch block.
3925
3926
3927 throw new Error("illegal catch attempt");
3928 },
3929 delegateYield: function delegateYield(iterable, resultName, nextLoc) {
3930 this.delegate = {
3931 iterator: values(iterable),
3932 resultName: resultName,
3933 nextLoc: nextLoc
3934 };
3935
3936 if (this.method === "next") {
3937 // Deliberately forget the last sent value so that we don't
3938 // accidentally pass it on to the delegate.
3939 this.arg = undefined;
3940 }
3941
3942 return ContinueSentinel;
3943 }
3944 }; // Regardless of whether this script is executing as a CommonJS module
3945 // or not, return the runtime object so that we can declare the variable
3946 // regeneratorRuntime in the outer scope, which allows this module to be
3947 // injected easily by `bin/regenerator --include-runtime script.js`.
3948
3949 return exports;
3950 }( // If this script is executing as a CommonJS module, use module.exports
3951 // as the regeneratorRuntime namespace. Otherwise create a new empty
3952 // object. Either way, the resulting object will be used to initialize
3953 // the regeneratorRuntime variable at the top of this file.
3954 ( false ? undefined : _typeof(module)) === "object" ? module.exports : {});
3955
3956 try {
3957 regeneratorRuntime = runtime;
3958 } catch (accidentalStrictMode) {
3959 // This module should not be running in strict mode, so the above
3960 // assignment should always work unless something is misconfigured. Just
3961 // in case runtime.js accidentally runs in strict mode, we can escape
3962 // strict mode using a global Function call. This could conceivably fail
3963 // if a Content Security Policy forbids using Function, but in that case
3964 // the proper solution is to fix the accidental strict mode problem. If
3965 // you've misconfigured your bundler to force strict mode and applied a
3966 // CSP to forbid Function, and you're not willing to fix either of those
3967 // problems, please detail your unique predicament in a GitHub issue.
3968 Function("r", "regeneratorRuntime = r")(runtime);
3969 }
3970 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
3971
3972 /***/ }),
3973
3974 /***/ "./node_modules/webpack/buildin/global.js":
3975 /*!***********************************!*\
3976 !*** (webpack)/buildin/global.js ***!
3977 \***********************************/
3978 /*! no static exports found */
3979 /***/ (function(module, exports) {
3980
3981 function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3982
3983 var g; // This works in non-strict mode
3984
3985 g = function () {
3986 return this;
3987 }();
3988
3989 try {
3990 // This works if eval is allowed (see CSP)
3991 g = g || new Function("return this")();
3992 } catch (e) {
3993 // This works if the window reference is available
3994 if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window;
3995 } // g can still be undefined, but nothing to do about it...
3996 // We return undefined, instead of nothing here, so it's
3997 // easier to handle this case. if(!global) { ...}
3998
3999
4000 module.exports = g;
4001
4002 /***/ }),
4003
4004 /***/ "./node_modules/webpack/buildin/module.js":
4005 /*!***********************************!*\
4006 !*** (webpack)/buildin/module.js ***!
4007 \***********************************/
4008 /*! no static exports found */
4009 /***/ (function(module, exports) {
4010
4011 module.exports = function (module) {
4012 if (!module.webpackPolyfill) {
4013 module.deprecate = function () {};
4014
4015 module.paths = []; // module.parent = undefined by default
4016
4017 if (!module.children) module.children = [];
4018 Object.defineProperty(module, "loaded", {
4019 enumerable: true,
4020 get: function get() {
4021 return module.l;
4022 }
4023 });
4024 Object.defineProperty(module, "id", {
4025 enumerable: true,
4026 get: function get() {
4027 return module.i;
4028 }
4029 });
4030 module.webpackPolyfill = 1;
4031 }
4032
4033 return module;
4034 };
4035
4036 /***/ }),
4037
4038 /***/ 0:
4039 /*!*****************************************************!*\
4040 !*** multi es6-promise-promise ./js/scripts_es6.js ***!
4041 \*****************************************************/
4042 /*! no static exports found */
4043 /***/ (function(module, exports, __webpack_require__) {
4044
4045 __webpack_require__(/*! es6-promise-promise */"./node_modules/es6-promise-promise/index.js");
4046 module.exports = __webpack_require__(/*! ./js/scripts_es6.js */"./js/scripts_es6.js");
4047
4048
4049 /***/ }),
4050
4051 /***/ 1:
4052 /*!***********************!*\
4053 !*** vertx (ignored) ***!
4054 \***********************/
4055 /*! no static exports found */
4056 /***/ (function(module, exports) {
4057
4058 /* (ignored) */
4059
4060 /***/ })
4061
4062 /******/ });
4063 //# sourceMappingURL=scripts.js.map