xianniu-ui 0.5.2-beta.0 → 0.5.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/static/css/chunk-elementUI.0b417c2d.css +1 -0
- package/lib/static/fonts/element-icons.535877f5.woff +0 -0
- package/lib/static/fonts/element-icons.732389de.ttf +0 -0
- package/lib/xianniu-ui.common.chunk-elementUI.js +77 -67837
- package/lib/xianniu-ui.common.chunk-libs~253ae210.js +0 -1222
- package/lib/xianniu-ui.common.chunk-libs~31ecd969.js +1055 -1072
- package/lib/xianniu-ui.common.chunk-libs~93acefaf.js +1 -1
- package/lib/xianniu-ui.common.chunk-libs~af0f4b76.js +1 -1
- package/lib/xianniu-ui.common.chunk-libs~d939e436.js +42 -106
- package/lib/xianniu-ui.common.chunk-libs~dfe5688e.js +1 -1
- package/lib/xianniu-ui.common.js +1 -1
- package/lib/xianniu-ui.common.xianniu-ui.common.js +36 -27
- package/lib/xianniu-ui.umd.chunk-elementUI.js +77 -67837
- package/lib/xianniu-ui.umd.chunk-libs~253ae210.js +0 -1222
- package/lib/xianniu-ui.umd.chunk-libs~31ecd969.js +1055 -1072
- package/lib/xianniu-ui.umd.chunk-libs~93acefaf.js +1 -1
- package/lib/xianniu-ui.umd.chunk-libs~af0f4b76.js +1 -1
- package/lib/xianniu-ui.umd.chunk-libs~d939e436.js +42 -106
- package/lib/xianniu-ui.umd.chunk-libs~dfe5688e.js +1 -1
- package/lib/xianniu-ui.umd.js +1 -1
- package/lib/xianniu-ui.umd.min.chunk-elementUI.js +1 -9
- package/lib/xianniu-ui.umd.min.chunk-libs~253ae210.js +1 -1
- package/lib/xianniu-ui.umd.min.chunk-libs~31ecd969.js +1 -1
- package/lib/xianniu-ui.umd.min.chunk-libs~93acefaf.js +1 -1
- package/lib/xianniu-ui.umd.min.chunk-libs~af0f4b76.js +1 -1
- package/lib/xianniu-ui.umd.min.chunk-libs~d939e436.js +1 -1
- package/lib/xianniu-ui.umd.min.chunk-libs~dfe5688e.js +1 -1
- package/lib/xianniu-ui.umd.min.js +1 -1
- package/lib/xianniu-ui.umd.min.xianniu-ui.umd.min.js +1 -1
- package/lib/xianniu-ui.umd.xianniu-ui.umd.js +36 -27
- package/package.json +1 -1
- package/lib/xianniu-ui.common.chunk-libs~6cb95173.js +0 -1594
- package/lib/xianniu-ui.common.chunk-libs~b58f7129.js +0 -1723
- package/lib/xianniu-ui.umd.chunk-libs~6cb95173.js +0 -1594
- package/lib/xianniu-ui.umd.chunk-libs~b58f7129.js +0 -1723
- package/lib/xianniu-ui.umd.min.chunk-libs~6cb95173.js +0 -1
- package/lib/xianniu-ui.umd.min.chunk-libs~b58f7129.js +0 -16
|
@@ -1,146 +1,10 @@
|
|
|
1
1
|
((typeof self !== 'undefined' ? self : this)["webpackJsonpxianniu_ui"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpxianniu_ui"] || []).push([[2],{
|
|
2
2
|
|
|
3
|
-
/***/ "0e15":
|
|
4
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
5
|
-
|
|
6
|
-
/* eslint-disable no-undefined */
|
|
7
|
-
|
|
8
|
-
var throttle = __webpack_require__("597f");
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Debounce execution of a function. Debouncing, unlike throttling,
|
|
12
|
-
* guarantees that a function is only executed a single time, either at the
|
|
13
|
-
* very beginning of a series of calls, or at the very end.
|
|
14
|
-
*
|
|
15
|
-
* @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
|
|
16
|
-
* @param {Boolean} [atBegin] Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
|
|
17
|
-
* after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
|
|
18
|
-
* (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
|
|
19
|
-
* @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
|
|
20
|
-
* to `callback` when the debounced-function is executed.
|
|
21
|
-
*
|
|
22
|
-
* @return {Function} A new, debounced function.
|
|
23
|
-
*/
|
|
24
|
-
module.exports = function ( delay, atBegin, callback ) {
|
|
25
|
-
return callback === undefined ? throttle(delay, atBegin, false) : throttle(delay, callback, atBegin !== false);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/***/ }),
|
|
30
|
-
|
|
31
|
-
/***/ "3c35":
|
|
32
|
-
/***/ (function(module, exports) {
|
|
33
|
-
|
|
34
|
-
/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */
|
|
35
|
-
module.exports = __webpack_amd_options__;
|
|
36
|
-
|
|
37
|
-
/* WEBPACK VAR INJECTION */}.call(this, {}))
|
|
38
|
-
|
|
39
|
-
/***/ }),
|
|
40
|
-
|
|
41
3
|
/***/ "3dd2":
|
|
42
4
|
/***/ (function(module, exports, __webpack_require__) {
|
|
43
5
|
|
|
44
6
|
!function(t,e){ true?module.exports=e():undefined}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=v;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),l=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(h){case c:return r?l(1,0):l(31,11);case f:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),l=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,l=this;r=Number(r);var $=O.p(h),y=function(t){var e=w(l);return O.w(e.date(e.date()+Math.round(t*r)),l)};if($===f)return this.set(f,this.$M+r);if($===c)return this.set(c,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},$={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||$[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,v=this-M,g=O.m(this,M);return g=($={},$[c]=g/12,$[f]=g,$[h]=g/3,$[o]=(v-m)/6048e5,$[a]=(v-m)/864e5,$[u]=v/n,$[s]=v/e,$[i]=v/t,$)[y]||v,l?g:O.a(g)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[g],w.Ls=D,w.p={},w}));
|
|
45
7
|
|
|
46
|
-
/***/ }),
|
|
47
|
-
|
|
48
|
-
/***/ "597f":
|
|
49
|
-
/***/ (function(module, exports) {
|
|
50
|
-
|
|
51
|
-
/* eslint-disable no-undefined,no-param-reassign,no-shadow */
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Throttle execution of a function. Especially useful for rate limiting
|
|
55
|
-
* execution of handlers on events like resize and scroll.
|
|
56
|
-
*
|
|
57
|
-
* @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
|
|
58
|
-
* @param {Boolean} [noTrailing] Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the
|
|
59
|
-
* throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time
|
|
60
|
-
* after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds,
|
|
61
|
-
* the internal counter is reset)
|
|
62
|
-
* @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
|
|
63
|
-
* to `callback` when the throttled-function is executed.
|
|
64
|
-
* @param {Boolean} [debounceMode] If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end),
|
|
65
|
-
* schedule `callback` to execute after `delay` ms.
|
|
66
|
-
*
|
|
67
|
-
* @return {Function} A new, throttled, function.
|
|
68
|
-
*/
|
|
69
|
-
module.exports = function ( delay, noTrailing, callback, debounceMode ) {
|
|
70
|
-
|
|
71
|
-
// After wrapper has stopped being called, this timeout ensures that
|
|
72
|
-
// `callback` is executed at the proper times in `throttle` and `end`
|
|
73
|
-
// debounce modes.
|
|
74
|
-
var timeoutID;
|
|
75
|
-
|
|
76
|
-
// Keep track of the last time `callback` was executed.
|
|
77
|
-
var lastExec = 0;
|
|
78
|
-
|
|
79
|
-
// `noTrailing` defaults to falsy.
|
|
80
|
-
if ( typeof noTrailing !== 'boolean' ) {
|
|
81
|
-
debounceMode = callback;
|
|
82
|
-
callback = noTrailing;
|
|
83
|
-
noTrailing = undefined;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// The `wrapper` function encapsulates all of the throttling / debouncing
|
|
87
|
-
// functionality and when executed will limit the rate at which `callback`
|
|
88
|
-
// is executed.
|
|
89
|
-
function wrapper () {
|
|
90
|
-
|
|
91
|
-
var self = this;
|
|
92
|
-
var elapsed = Number(new Date()) - lastExec;
|
|
93
|
-
var args = arguments;
|
|
94
|
-
|
|
95
|
-
// Execute `callback` and update the `lastExec` timestamp.
|
|
96
|
-
function exec () {
|
|
97
|
-
lastExec = Number(new Date());
|
|
98
|
-
callback.apply(self, args);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// If `debounceMode` is true (at begin) this is used to clear the flag
|
|
102
|
-
// to allow future `callback` executions.
|
|
103
|
-
function clear () {
|
|
104
|
-
timeoutID = undefined;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if ( debounceMode && !timeoutID ) {
|
|
108
|
-
// Since `wrapper` is being called for the first time and
|
|
109
|
-
// `debounceMode` is true (at begin), execute `callback`.
|
|
110
|
-
exec();
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Clear any existing timeout.
|
|
114
|
-
if ( timeoutID ) {
|
|
115
|
-
clearTimeout(timeoutID);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if ( debounceMode === undefined && elapsed > delay ) {
|
|
119
|
-
// In throttle mode, if `delay` time has been exceeded, execute
|
|
120
|
-
// `callback`.
|
|
121
|
-
exec();
|
|
122
|
-
|
|
123
|
-
} else if ( noTrailing !== true ) {
|
|
124
|
-
// In trailing throttle mode, since `delay` time has not been
|
|
125
|
-
// exceeded, schedule `callback` to execute `delay` ms after most
|
|
126
|
-
// recent execution.
|
|
127
|
-
//
|
|
128
|
-
// If `debounceMode` is true (at begin), schedule `clear` to execute
|
|
129
|
-
// after `delay` ms.
|
|
130
|
-
//
|
|
131
|
-
// If `debounceMode` is false (at end), schedule `callback` to
|
|
132
|
-
// execute after `delay` ms.
|
|
133
|
-
timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Return the wrapper function.
|
|
139
|
-
return wrapper;
|
|
140
|
-
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
|
|
144
8
|
/***/ }),
|
|
145
9
|
|
|
146
10
|
/***/ "62e4":
|
|
@@ -172,954 +36,763 @@ module.exports = function(module) {
|
|
|
172
36
|
|
|
173
37
|
/***/ }),
|
|
174
38
|
|
|
175
|
-
/***/ "
|
|
176
|
-
/***/ (function(module,
|
|
39
|
+
/***/ "96cf":
|
|
40
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
177
41
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
|
|
184
|
-
* modules as they cover only a limited range of use cases.
|
|
185
|
-
*/
|
|
186
|
-
/* eslint-disable require-jsdoc, valid-jsdoc */
|
|
187
|
-
var MapShim = (function () {
|
|
188
|
-
if (typeof Map !== 'undefined') {
|
|
189
|
-
return Map;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Returns index in provided array that matches the specified key.
|
|
193
|
-
*
|
|
194
|
-
* @param {Array<Array>} arr
|
|
195
|
-
* @param {*} key
|
|
196
|
-
* @returns {number}
|
|
197
|
-
*/
|
|
198
|
-
function getIndex(arr, key) {
|
|
199
|
-
var result = -1;
|
|
200
|
-
arr.some(function (entry, index) {
|
|
201
|
-
if (entry[0] === key) {
|
|
202
|
-
result = index;
|
|
203
|
-
return true;
|
|
204
|
-
}
|
|
205
|
-
return false;
|
|
206
|
-
});
|
|
207
|
-
return result;
|
|
208
|
-
}
|
|
209
|
-
return /** @class */ (function () {
|
|
210
|
-
function class_1() {
|
|
211
|
-
this.__entries__ = [];
|
|
212
|
-
}
|
|
213
|
-
Object.defineProperty(class_1.prototype, "size", {
|
|
214
|
-
/**
|
|
215
|
-
* @returns {boolean}
|
|
216
|
-
*/
|
|
217
|
-
get: function () {
|
|
218
|
-
return this.__entries__.length;
|
|
219
|
-
},
|
|
220
|
-
enumerable: true,
|
|
221
|
-
configurable: true
|
|
222
|
-
});
|
|
223
|
-
/**
|
|
224
|
-
* @param {*} key
|
|
225
|
-
* @returns {*}
|
|
226
|
-
*/
|
|
227
|
-
class_1.prototype.get = function (key) {
|
|
228
|
-
var index = getIndex(this.__entries__, key);
|
|
229
|
-
var entry = this.__entries__[index];
|
|
230
|
-
return entry && entry[1];
|
|
231
|
-
};
|
|
232
|
-
/**
|
|
233
|
-
* @param {*} key
|
|
234
|
-
* @param {*} value
|
|
235
|
-
* @returns {void}
|
|
236
|
-
*/
|
|
237
|
-
class_1.prototype.set = function (key, value) {
|
|
238
|
-
var index = getIndex(this.__entries__, key);
|
|
239
|
-
if (~index) {
|
|
240
|
-
this.__entries__[index][1] = value;
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
this.__entries__.push([key, value]);
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
/**
|
|
247
|
-
* @param {*} key
|
|
248
|
-
* @returns {void}
|
|
249
|
-
*/
|
|
250
|
-
class_1.prototype.delete = function (key) {
|
|
251
|
-
var entries = this.__entries__;
|
|
252
|
-
var index = getIndex(entries, key);
|
|
253
|
-
if (~index) {
|
|
254
|
-
entries.splice(index, 1);
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
/**
|
|
258
|
-
* @param {*} key
|
|
259
|
-
* @returns {void}
|
|
260
|
-
*/
|
|
261
|
-
class_1.prototype.has = function (key) {
|
|
262
|
-
return !!~getIndex(this.__entries__, key);
|
|
263
|
-
};
|
|
264
|
-
/**
|
|
265
|
-
* @returns {void}
|
|
266
|
-
*/
|
|
267
|
-
class_1.prototype.clear = function () {
|
|
268
|
-
this.__entries__.splice(0);
|
|
269
|
-
};
|
|
270
|
-
/**
|
|
271
|
-
* @param {Function} callback
|
|
272
|
-
* @param {*} [ctx=null]
|
|
273
|
-
* @returns {void}
|
|
274
|
-
*/
|
|
275
|
-
class_1.prototype.forEach = function (callback, ctx) {
|
|
276
|
-
if (ctx === void 0) { ctx = null; }
|
|
277
|
-
for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
|
|
278
|
-
var entry = _a[_i];
|
|
279
|
-
callback.call(ctx, entry[1], entry[0]);
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
return class_1;
|
|
283
|
-
}());
|
|
284
|
-
})();
|
|
42
|
+
/**
|
|
43
|
+
* Copyright (c) 2014-present, Facebook, Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE file in the root directory of this source tree.
|
|
47
|
+
*/
|
|
285
48
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
var
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
var
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
49
|
+
var runtime = (function (exports) {
|
|
50
|
+
"use strict";
|
|
51
|
+
|
|
52
|
+
var Op = Object.prototype;
|
|
53
|
+
var hasOwn = Op.hasOwnProperty;
|
|
54
|
+
var undefined; // More compressible than void 0.
|
|
55
|
+
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
56
|
+
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
57
|
+
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
58
|
+
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
59
|
+
|
|
60
|
+
function define(obj, key, value) {
|
|
61
|
+
Object.defineProperty(obj, key, {
|
|
62
|
+
value: value,
|
|
63
|
+
enumerable: true,
|
|
64
|
+
configurable: true,
|
|
65
|
+
writable: true
|
|
66
|
+
});
|
|
67
|
+
return obj[key];
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
71
|
+
define({}, "");
|
|
72
|
+
} catch (err) {
|
|
73
|
+
define = function(obj, key, value) {
|
|
74
|
+
return obj[key] = value;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
305
77
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
*/
|
|
312
|
-
var requestAnimationFrame$1 = (function () {
|
|
313
|
-
if (typeof requestAnimationFrame === 'function') {
|
|
314
|
-
// It's required to use a bounded function because IE sometimes throws
|
|
315
|
-
// an "Invalid calling object" error if rAF is invoked without the global
|
|
316
|
-
// object on the left hand side.
|
|
317
|
-
return requestAnimationFrame.bind(global$1);
|
|
318
|
-
}
|
|
319
|
-
return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
|
|
320
|
-
})();
|
|
78
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
79
|
+
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
80
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
81
|
+
var generator = Object.create(protoGenerator.prototype);
|
|
82
|
+
var context = new Context(tryLocsList || []);
|
|
321
83
|
|
|
322
|
-
//
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
* Creates a wrapper function which ensures that provided callback will be
|
|
326
|
-
* invoked only once during the specified delay period.
|
|
327
|
-
*
|
|
328
|
-
* @param {Function} callback - Function to be invoked after the delay period.
|
|
329
|
-
* @param {number} delay - Delay after which to invoke callback.
|
|
330
|
-
* @returns {Function}
|
|
331
|
-
*/
|
|
332
|
-
function throttle (callback, delay) {
|
|
333
|
-
var leadingCall = false, trailingCall = false, lastCallTime = 0;
|
|
334
|
-
/**
|
|
335
|
-
* Invokes the original callback function and schedules new invocation if
|
|
336
|
-
* the "proxy" was called during current request.
|
|
337
|
-
*
|
|
338
|
-
* @returns {void}
|
|
339
|
-
*/
|
|
340
|
-
function resolvePending() {
|
|
341
|
-
if (leadingCall) {
|
|
342
|
-
leadingCall = false;
|
|
343
|
-
callback();
|
|
344
|
-
}
|
|
345
|
-
if (trailingCall) {
|
|
346
|
-
proxy();
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* Callback invoked after the specified delay. It will further postpone
|
|
351
|
-
* invocation of the original function delegating it to the
|
|
352
|
-
* requestAnimationFrame.
|
|
353
|
-
*
|
|
354
|
-
* @returns {void}
|
|
355
|
-
*/
|
|
356
|
-
function timeoutCallback() {
|
|
357
|
-
requestAnimationFrame$1(resolvePending);
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Schedules invocation of the original function.
|
|
361
|
-
*
|
|
362
|
-
* @returns {void}
|
|
363
|
-
*/
|
|
364
|
-
function proxy() {
|
|
365
|
-
var timeStamp = Date.now();
|
|
366
|
-
if (leadingCall) {
|
|
367
|
-
// Reject immediately following calls.
|
|
368
|
-
if (timeStamp - lastCallTime < trailingTimeout) {
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
// Schedule new call to be in invoked when the pending one is resolved.
|
|
372
|
-
// This is important for "transitions" which never actually start
|
|
373
|
-
// immediately so there is a chance that we might miss one if change
|
|
374
|
-
// happens amids the pending invocation.
|
|
375
|
-
trailingCall = true;
|
|
376
|
-
}
|
|
377
|
-
else {
|
|
378
|
-
leadingCall = true;
|
|
379
|
-
trailingCall = false;
|
|
380
|
-
setTimeout(timeoutCallback, delay);
|
|
381
|
-
}
|
|
382
|
-
lastCallTime = timeStamp;
|
|
383
|
-
}
|
|
384
|
-
return proxy;
|
|
385
|
-
}
|
|
84
|
+
// The ._invoke method unifies the implementations of the .next,
|
|
85
|
+
// .throw, and .return methods.
|
|
86
|
+
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
386
87
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
//
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
*/
|
|
409
|
-
this.connected_ = false;
|
|
410
|
-
/**
|
|
411
|
-
* Tells that controller has subscribed for Mutation Events.
|
|
412
|
-
*
|
|
413
|
-
* @private {boolean}
|
|
414
|
-
*/
|
|
415
|
-
this.mutationEventsAdded_ = false;
|
|
416
|
-
/**
|
|
417
|
-
* Keeps reference to the instance of MutationObserver.
|
|
418
|
-
*
|
|
419
|
-
* @private {MutationObserver}
|
|
420
|
-
*/
|
|
421
|
-
this.mutationsObserver_ = null;
|
|
422
|
-
/**
|
|
423
|
-
* A list of connected observers.
|
|
424
|
-
*
|
|
425
|
-
* @private {Array<ResizeObserverSPI>}
|
|
426
|
-
*/
|
|
427
|
-
this.observers_ = [];
|
|
428
|
-
this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
|
|
429
|
-
this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* Adds observer to observers list.
|
|
433
|
-
*
|
|
434
|
-
* @param {ResizeObserverSPI} observer - Observer to be added.
|
|
435
|
-
* @returns {void}
|
|
436
|
-
*/
|
|
437
|
-
ResizeObserverController.prototype.addObserver = function (observer) {
|
|
438
|
-
if (!~this.observers_.indexOf(observer)) {
|
|
439
|
-
this.observers_.push(observer);
|
|
440
|
-
}
|
|
441
|
-
// Add listeners if they haven't been added yet.
|
|
442
|
-
if (!this.connected_) {
|
|
443
|
-
this.connect_();
|
|
444
|
-
}
|
|
445
|
-
};
|
|
446
|
-
/**
|
|
447
|
-
* Removes observer from observers list.
|
|
448
|
-
*
|
|
449
|
-
* @param {ResizeObserverSPI} observer - Observer to be removed.
|
|
450
|
-
* @returns {void}
|
|
451
|
-
*/
|
|
452
|
-
ResizeObserverController.prototype.removeObserver = function (observer) {
|
|
453
|
-
var observers = this.observers_;
|
|
454
|
-
var index = observers.indexOf(observer);
|
|
455
|
-
// Remove observer if it's present in registry.
|
|
456
|
-
if (~index) {
|
|
457
|
-
observers.splice(index, 1);
|
|
458
|
-
}
|
|
459
|
-
// Remove listeners if controller has no connected observers.
|
|
460
|
-
if (!observers.length && this.connected_) {
|
|
461
|
-
this.disconnect_();
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
|
-
/**
|
|
465
|
-
* Invokes the update of observers. It will continue running updates insofar
|
|
466
|
-
* it detects changes.
|
|
467
|
-
*
|
|
468
|
-
* @returns {void}
|
|
469
|
-
*/
|
|
470
|
-
ResizeObserverController.prototype.refresh = function () {
|
|
471
|
-
var changesDetected = this.updateObservers_();
|
|
472
|
-
// Continue running updates if changes have been detected as there might
|
|
473
|
-
// be future ones caused by CSS transitions.
|
|
474
|
-
if (changesDetected) {
|
|
475
|
-
this.refresh();
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
/**
|
|
479
|
-
* Updates every observer from observers list and notifies them of queued
|
|
480
|
-
* entries.
|
|
481
|
-
*
|
|
482
|
-
* @private
|
|
483
|
-
* @returns {boolean} Returns "true" if any observer has detected changes in
|
|
484
|
-
* dimensions of it's elements.
|
|
485
|
-
*/
|
|
486
|
-
ResizeObserverController.prototype.updateObservers_ = function () {
|
|
487
|
-
// Collect observers that have active observations.
|
|
488
|
-
var activeObservers = this.observers_.filter(function (observer) {
|
|
489
|
-
return observer.gatherActive(), observer.hasActive();
|
|
490
|
-
});
|
|
491
|
-
// Deliver notifications in a separate cycle in order to avoid any
|
|
492
|
-
// collisions between observers, e.g. when multiple instances of
|
|
493
|
-
// ResizeObserver are tracking the same element and the callback of one
|
|
494
|
-
// of them changes content dimensions of the observed target. Sometimes
|
|
495
|
-
// this may result in notifications being blocked for the rest of observers.
|
|
496
|
-
activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
|
|
497
|
-
return activeObservers.length > 0;
|
|
498
|
-
};
|
|
499
|
-
/**
|
|
500
|
-
* Initializes DOM listeners.
|
|
501
|
-
*
|
|
502
|
-
* @private
|
|
503
|
-
* @returns {void}
|
|
504
|
-
*/
|
|
505
|
-
ResizeObserverController.prototype.connect_ = function () {
|
|
506
|
-
// Do nothing if running in a non-browser environment or if listeners
|
|
507
|
-
// have been already added.
|
|
508
|
-
if (!isBrowser || this.connected_) {
|
|
509
|
-
return;
|
|
510
|
-
}
|
|
511
|
-
// Subscription to the "Transitionend" event is used as a workaround for
|
|
512
|
-
// delayed transitions. This way it's possible to capture at least the
|
|
513
|
-
// final state of an element.
|
|
514
|
-
document.addEventListener('transitionend', this.onTransitionEnd_);
|
|
515
|
-
window.addEventListener('resize', this.refresh);
|
|
516
|
-
if (mutationObserverSupported) {
|
|
517
|
-
this.mutationsObserver_ = new MutationObserver(this.refresh);
|
|
518
|
-
this.mutationsObserver_.observe(document, {
|
|
519
|
-
attributes: true,
|
|
520
|
-
childList: true,
|
|
521
|
-
characterData: true,
|
|
522
|
-
subtree: true
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
else {
|
|
526
|
-
document.addEventListener('DOMSubtreeModified', this.refresh);
|
|
527
|
-
this.mutationEventsAdded_ = true;
|
|
528
|
-
}
|
|
529
|
-
this.connected_ = true;
|
|
530
|
-
};
|
|
531
|
-
/**
|
|
532
|
-
* Removes DOM listeners.
|
|
533
|
-
*
|
|
534
|
-
* @private
|
|
535
|
-
* @returns {void}
|
|
536
|
-
*/
|
|
537
|
-
ResizeObserverController.prototype.disconnect_ = function () {
|
|
538
|
-
// Do nothing if running in a non-browser environment or if listeners
|
|
539
|
-
// have been already removed.
|
|
540
|
-
if (!isBrowser || !this.connected_) {
|
|
541
|
-
return;
|
|
542
|
-
}
|
|
543
|
-
document.removeEventListener('transitionend', this.onTransitionEnd_);
|
|
544
|
-
window.removeEventListener('resize', this.refresh);
|
|
545
|
-
if (this.mutationsObserver_) {
|
|
546
|
-
this.mutationsObserver_.disconnect();
|
|
547
|
-
}
|
|
548
|
-
if (this.mutationEventsAdded_) {
|
|
549
|
-
document.removeEventListener('DOMSubtreeModified', this.refresh);
|
|
550
|
-
}
|
|
551
|
-
this.mutationsObserver_ = null;
|
|
552
|
-
this.mutationEventsAdded_ = false;
|
|
553
|
-
this.connected_ = false;
|
|
554
|
-
};
|
|
555
|
-
/**
|
|
556
|
-
* "Transitionend" event handler.
|
|
557
|
-
*
|
|
558
|
-
* @private
|
|
559
|
-
* @param {TransitionEvent} event
|
|
560
|
-
* @returns {void}
|
|
561
|
-
*/
|
|
562
|
-
ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
|
|
563
|
-
var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
|
|
564
|
-
// Detect whether transition may affect dimensions of an element.
|
|
565
|
-
var isReflowProperty = transitionKeys.some(function (key) {
|
|
566
|
-
return !!~propertyName.indexOf(key);
|
|
567
|
-
});
|
|
568
|
-
if (isReflowProperty) {
|
|
569
|
-
this.refresh();
|
|
570
|
-
}
|
|
571
|
-
};
|
|
572
|
-
/**
|
|
573
|
-
* Returns instance of the ResizeObserverController.
|
|
574
|
-
*
|
|
575
|
-
* @returns {ResizeObserverController}
|
|
576
|
-
*/
|
|
577
|
-
ResizeObserverController.getInstance = function () {
|
|
578
|
-
if (!this.instance_) {
|
|
579
|
-
this.instance_ = new ResizeObserverController();
|
|
580
|
-
}
|
|
581
|
-
return this.instance_;
|
|
582
|
-
};
|
|
583
|
-
/**
|
|
584
|
-
* Holds reference to the controller's instance.
|
|
585
|
-
*
|
|
586
|
-
* @private {ResizeObserverController}
|
|
587
|
-
*/
|
|
588
|
-
ResizeObserverController.instance_ = null;
|
|
589
|
-
return ResizeObserverController;
|
|
590
|
-
}());
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* Defines non-writable/enumerable properties of the provided target object.
|
|
594
|
-
*
|
|
595
|
-
* @param {Object} target - Object for which to define properties.
|
|
596
|
-
* @param {Object} props - Properties to be defined.
|
|
597
|
-
* @returns {Object} Target object.
|
|
598
|
-
*/
|
|
599
|
-
var defineConfigurable = (function (target, props) {
|
|
600
|
-
for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
|
|
601
|
-
var key = _a[_i];
|
|
602
|
-
Object.defineProperty(target, key, {
|
|
603
|
-
value: props[key],
|
|
604
|
-
enumerable: false,
|
|
605
|
-
writable: false,
|
|
606
|
-
configurable: true
|
|
607
|
-
});
|
|
608
|
-
}
|
|
609
|
-
return target;
|
|
610
|
-
});
|
|
611
|
-
|
|
612
|
-
/**
|
|
613
|
-
* Returns the global object associated with provided element.
|
|
614
|
-
*
|
|
615
|
-
* @param {Object} target
|
|
616
|
-
* @returns {Object}
|
|
617
|
-
*/
|
|
618
|
-
var getWindowOf = (function (target) {
|
|
619
|
-
// Assume that the element is an instance of Node, which means that it
|
|
620
|
-
// has the "ownerDocument" property from which we can retrieve a
|
|
621
|
-
// corresponding global object.
|
|
622
|
-
var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
|
|
623
|
-
// Return the local global object if it's not possible extract one from
|
|
624
|
-
// provided element.
|
|
625
|
-
return ownerGlobal || global$1;
|
|
626
|
-
});
|
|
627
|
-
|
|
628
|
-
// Placeholder of an empty content rectangle.
|
|
629
|
-
var emptyRect = createRectInit(0, 0, 0, 0);
|
|
630
|
-
/**
|
|
631
|
-
* Converts provided string to a number.
|
|
632
|
-
*
|
|
633
|
-
* @param {number|string} value
|
|
634
|
-
* @returns {number}
|
|
635
|
-
*/
|
|
636
|
-
function toFloat(value) {
|
|
637
|
-
return parseFloat(value) || 0;
|
|
638
|
-
}
|
|
639
|
-
/**
|
|
640
|
-
* Extracts borders size from provided styles.
|
|
641
|
-
*
|
|
642
|
-
* @param {CSSStyleDeclaration} styles
|
|
643
|
-
* @param {...string} positions - Borders positions (top, right, ...)
|
|
644
|
-
* @returns {number}
|
|
645
|
-
*/
|
|
646
|
-
function getBordersSize(styles) {
|
|
647
|
-
var positions = [];
|
|
648
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
649
|
-
positions[_i - 1] = arguments[_i];
|
|
650
|
-
}
|
|
651
|
-
return positions.reduce(function (size, position) {
|
|
652
|
-
var value = styles['border-' + position + '-width'];
|
|
653
|
-
return size + toFloat(value);
|
|
654
|
-
}, 0);
|
|
655
|
-
}
|
|
656
|
-
/**
|
|
657
|
-
* Extracts paddings sizes from provided styles.
|
|
658
|
-
*
|
|
659
|
-
* @param {CSSStyleDeclaration} styles
|
|
660
|
-
* @returns {Object} Paddings box.
|
|
661
|
-
*/
|
|
662
|
-
function getPaddings(styles) {
|
|
663
|
-
var positions = ['top', 'right', 'bottom', 'left'];
|
|
664
|
-
var paddings = {};
|
|
665
|
-
for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
|
|
666
|
-
var position = positions_1[_i];
|
|
667
|
-
var value = styles['padding-' + position];
|
|
668
|
-
paddings[position] = toFloat(value);
|
|
669
|
-
}
|
|
670
|
-
return paddings;
|
|
671
|
-
}
|
|
672
|
-
/**
|
|
673
|
-
* Calculates content rectangle of provided SVG element.
|
|
674
|
-
*
|
|
675
|
-
* @param {SVGGraphicsElement} target - Element content rectangle of which needs
|
|
676
|
-
* to be calculated.
|
|
677
|
-
* @returns {DOMRectInit}
|
|
678
|
-
*/
|
|
679
|
-
function getSVGContentRect(target) {
|
|
680
|
-
var bbox = target.getBBox();
|
|
681
|
-
return createRectInit(0, 0, bbox.width, bbox.height);
|
|
682
|
-
}
|
|
683
|
-
/**
|
|
684
|
-
* Calculates content rectangle of provided HTMLElement.
|
|
685
|
-
*
|
|
686
|
-
* @param {HTMLElement} target - Element for which to calculate the content rectangle.
|
|
687
|
-
* @returns {DOMRectInit}
|
|
688
|
-
*/
|
|
689
|
-
function getHTMLElementContentRect(target) {
|
|
690
|
-
// Client width & height properties can't be
|
|
691
|
-
// used exclusively as they provide rounded values.
|
|
692
|
-
var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
|
|
693
|
-
// By this condition we can catch all non-replaced inline, hidden and
|
|
694
|
-
// detached elements. Though elements with width & height properties less
|
|
695
|
-
// than 0.5 will be discarded as well.
|
|
696
|
-
//
|
|
697
|
-
// Without it we would need to implement separate methods for each of
|
|
698
|
-
// those cases and it's not possible to perform a precise and performance
|
|
699
|
-
// effective test for hidden elements. E.g. even jQuery's ':visible' filter
|
|
700
|
-
// gives wrong results for elements with width & height less than 0.5.
|
|
701
|
-
if (!clientWidth && !clientHeight) {
|
|
702
|
-
return emptyRect;
|
|
703
|
-
}
|
|
704
|
-
var styles = getWindowOf(target).getComputedStyle(target);
|
|
705
|
-
var paddings = getPaddings(styles);
|
|
706
|
-
var horizPad = paddings.left + paddings.right;
|
|
707
|
-
var vertPad = paddings.top + paddings.bottom;
|
|
708
|
-
// Computed styles of width & height are being used because they are the
|
|
709
|
-
// only dimensions available to JS that contain non-rounded values. It could
|
|
710
|
-
// be possible to utilize the getBoundingClientRect if only it's data wasn't
|
|
711
|
-
// affected by CSS transformations let alone paddings, borders and scroll bars.
|
|
712
|
-
var width = toFloat(styles.width), height = toFloat(styles.height);
|
|
713
|
-
// Width & height include paddings and borders when the 'border-box' box
|
|
714
|
-
// model is applied (except for IE).
|
|
715
|
-
if (styles.boxSizing === 'border-box') {
|
|
716
|
-
// Following conditions are required to handle Internet Explorer which
|
|
717
|
-
// doesn't include paddings and borders to computed CSS dimensions.
|
|
718
|
-
//
|
|
719
|
-
// We can say that if CSS dimensions + paddings are equal to the "client"
|
|
720
|
-
// properties then it's either IE, and thus we don't need to subtract
|
|
721
|
-
// anything, or an element merely doesn't have paddings/borders styles.
|
|
722
|
-
if (Math.round(width + horizPad) !== clientWidth) {
|
|
723
|
-
width -= getBordersSize(styles, 'left', 'right') + horizPad;
|
|
724
|
-
}
|
|
725
|
-
if (Math.round(height + vertPad) !== clientHeight) {
|
|
726
|
-
height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
// Following steps can't be applied to the document's root element as its
|
|
730
|
-
// client[Width/Height] properties represent viewport area of the window.
|
|
731
|
-
// Besides, it's as well not necessary as the <html> itself neither has
|
|
732
|
-
// rendered scroll bars nor it can be clipped.
|
|
733
|
-
if (!isDocumentElement(target)) {
|
|
734
|
-
// In some browsers (only in Firefox, actually) CSS width & height
|
|
735
|
-
// include scroll bars size which can be removed at this step as scroll
|
|
736
|
-
// bars are the only difference between rounded dimensions + paddings
|
|
737
|
-
// and "client" properties, though that is not always true in Chrome.
|
|
738
|
-
var vertScrollbar = Math.round(width + horizPad) - clientWidth;
|
|
739
|
-
var horizScrollbar = Math.round(height + vertPad) - clientHeight;
|
|
740
|
-
// Chrome has a rather weird rounding of "client" properties.
|
|
741
|
-
// E.g. for an element with content width of 314.2px it sometimes gives
|
|
742
|
-
// the client width of 315px and for the width of 314.7px it may give
|
|
743
|
-
// 314px. And it doesn't happen all the time. So just ignore this delta
|
|
744
|
-
// as a non-relevant.
|
|
745
|
-
if (Math.abs(vertScrollbar) !== 1) {
|
|
746
|
-
width -= vertScrollbar;
|
|
747
|
-
}
|
|
748
|
-
if (Math.abs(horizScrollbar) !== 1) {
|
|
749
|
-
height -= horizScrollbar;
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
return createRectInit(paddings.left, paddings.top, width, height);
|
|
753
|
-
}
|
|
754
|
-
/**
|
|
755
|
-
* Checks whether provided element is an instance of the SVGGraphicsElement.
|
|
756
|
-
*
|
|
757
|
-
* @param {Element} target - Element to be checked.
|
|
758
|
-
* @returns {boolean}
|
|
759
|
-
*/
|
|
760
|
-
var isSVGGraphicsElement = (function () {
|
|
761
|
-
// Some browsers, namely IE and Edge, don't have the SVGGraphicsElement
|
|
762
|
-
// interface.
|
|
763
|
-
if (typeof SVGGraphicsElement !== 'undefined') {
|
|
764
|
-
return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
|
|
765
|
-
}
|
|
766
|
-
// If it's so, then check that element is at least an instance of the
|
|
767
|
-
// SVGElement and that it has the "getBBox" method.
|
|
768
|
-
// eslint-disable-next-line no-extra-parens
|
|
769
|
-
return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
|
|
770
|
-
typeof target.getBBox === 'function'); };
|
|
771
|
-
})();
|
|
772
|
-
/**
|
|
773
|
-
* Checks whether provided element is a document element (<html>).
|
|
774
|
-
*
|
|
775
|
-
* @param {Element} target - Element to be checked.
|
|
776
|
-
* @returns {boolean}
|
|
777
|
-
*/
|
|
778
|
-
function isDocumentElement(target) {
|
|
779
|
-
return target === getWindowOf(target).document.documentElement;
|
|
780
|
-
}
|
|
781
|
-
/**
|
|
782
|
-
* Calculates an appropriate content rectangle for provided html or svg element.
|
|
783
|
-
*
|
|
784
|
-
* @param {Element} target - Element content rectangle of which needs to be calculated.
|
|
785
|
-
* @returns {DOMRectInit}
|
|
786
|
-
*/
|
|
787
|
-
function getContentRect(target) {
|
|
788
|
-
if (!isBrowser) {
|
|
789
|
-
return emptyRect;
|
|
790
|
-
}
|
|
791
|
-
if (isSVGGraphicsElement(target)) {
|
|
792
|
-
return getSVGContentRect(target);
|
|
793
|
-
}
|
|
794
|
-
return getHTMLElementContentRect(target);
|
|
795
|
-
}
|
|
796
|
-
/**
|
|
797
|
-
* Creates rectangle with an interface of the DOMRectReadOnly.
|
|
798
|
-
* Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
|
|
799
|
-
*
|
|
800
|
-
* @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
|
|
801
|
-
* @returns {DOMRectReadOnly}
|
|
802
|
-
*/
|
|
803
|
-
function createReadOnlyRect(_a) {
|
|
804
|
-
var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
|
|
805
|
-
// If DOMRectReadOnly is available use it as a prototype for the rectangle.
|
|
806
|
-
var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
|
|
807
|
-
var rect = Object.create(Constr.prototype);
|
|
808
|
-
// Rectangle's properties are not writable and non-enumerable.
|
|
809
|
-
defineConfigurable(rect, {
|
|
810
|
-
x: x, y: y, width: width, height: height,
|
|
811
|
-
top: y,
|
|
812
|
-
right: x + width,
|
|
813
|
-
bottom: height + y,
|
|
814
|
-
left: x
|
|
815
|
-
});
|
|
816
|
-
return rect;
|
|
817
|
-
}
|
|
818
|
-
/**
|
|
819
|
-
* Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
|
|
820
|
-
* Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
|
|
821
|
-
*
|
|
822
|
-
* @param {number} x - X coordinate.
|
|
823
|
-
* @param {number} y - Y coordinate.
|
|
824
|
-
* @param {number} width - Rectangle's width.
|
|
825
|
-
* @param {number} height - Rectangle's height.
|
|
826
|
-
* @returns {DOMRectInit}
|
|
827
|
-
*/
|
|
828
|
-
function createRectInit(x, y, width, height) {
|
|
829
|
-
return { x: x, y: y, width: width, height: height };
|
|
830
|
-
}
|
|
88
|
+
return generator;
|
|
89
|
+
}
|
|
90
|
+
exports.wrap = wrap;
|
|
91
|
+
|
|
92
|
+
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
93
|
+
// record like context.tryEntries[i].completion. This interface could
|
|
94
|
+
// have been (and was previously) designed to take a closure to be
|
|
95
|
+
// invoked without arguments, but in all the cases we care about we
|
|
96
|
+
// already have an existing method we want to call, so there's no need
|
|
97
|
+
// to create a new function object. We can even get away with assuming
|
|
98
|
+
// the method takes exactly one argument, since that happens to be true
|
|
99
|
+
// in every case, so we don't have to touch the arguments object. The
|
|
100
|
+
// only additional allocation required is the completion record, which
|
|
101
|
+
// has a stable shape and so hopefully should be cheap to allocate.
|
|
102
|
+
function tryCatch(fn, obj, arg) {
|
|
103
|
+
try {
|
|
104
|
+
return { type: "normal", arg: fn.call(obj, arg) };
|
|
105
|
+
} catch (err) {
|
|
106
|
+
return { type: "throw", arg: err };
|
|
107
|
+
}
|
|
108
|
+
}
|
|
831
109
|
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
* have changed since the last broadcast.
|
|
866
|
-
*
|
|
867
|
-
* @returns {boolean}
|
|
868
|
-
*/
|
|
869
|
-
ResizeObservation.prototype.isActive = function () {
|
|
870
|
-
var rect = getContentRect(this.target);
|
|
871
|
-
this.contentRect_ = rect;
|
|
872
|
-
return (rect.width !== this.broadcastWidth ||
|
|
873
|
-
rect.height !== this.broadcastHeight);
|
|
874
|
-
};
|
|
875
|
-
/**
|
|
876
|
-
* Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
|
|
877
|
-
* from the corresponding properties of the last observed content rectangle.
|
|
878
|
-
*
|
|
879
|
-
* @returns {DOMRectInit} Last observed content rectangle.
|
|
880
|
-
*/
|
|
881
|
-
ResizeObservation.prototype.broadcastRect = function () {
|
|
882
|
-
var rect = this.contentRect_;
|
|
883
|
-
this.broadcastWidth = rect.width;
|
|
884
|
-
this.broadcastHeight = rect.height;
|
|
885
|
-
return rect;
|
|
886
|
-
};
|
|
887
|
-
return ResizeObservation;
|
|
888
|
-
}());
|
|
889
|
-
|
|
890
|
-
var ResizeObserverEntry = /** @class */ (function () {
|
|
891
|
-
/**
|
|
892
|
-
* Creates an instance of ResizeObserverEntry.
|
|
893
|
-
*
|
|
894
|
-
* @param {Element} target - Element that is being observed.
|
|
895
|
-
* @param {DOMRectInit} rectInit - Data of the element's content rectangle.
|
|
896
|
-
*/
|
|
897
|
-
function ResizeObserverEntry(target, rectInit) {
|
|
898
|
-
var contentRect = createReadOnlyRect(rectInit);
|
|
899
|
-
// According to the specification following properties are not writable
|
|
900
|
-
// and are also not enumerable in the native implementation.
|
|
901
|
-
//
|
|
902
|
-
// Property accessors are not being used as they'd require to define a
|
|
903
|
-
// private WeakMap storage which may cause memory leaks in browsers that
|
|
904
|
-
// don't support this type of collections.
|
|
905
|
-
defineConfigurable(this, { target: target, contentRect: contentRect });
|
|
906
|
-
}
|
|
907
|
-
return ResizeObserverEntry;
|
|
908
|
-
}());
|
|
909
|
-
|
|
910
|
-
var ResizeObserverSPI = /** @class */ (function () {
|
|
911
|
-
/**
|
|
912
|
-
* Creates a new instance of ResizeObserver.
|
|
913
|
-
*
|
|
914
|
-
* @param {ResizeObserverCallback} callback - Callback function that is invoked
|
|
915
|
-
* when one of the observed elements changes it's content dimensions.
|
|
916
|
-
* @param {ResizeObserverController} controller - Controller instance which
|
|
917
|
-
* is responsible for the updates of observer.
|
|
918
|
-
* @param {ResizeObserver} callbackCtx - Reference to the public
|
|
919
|
-
* ResizeObserver instance which will be passed to callback function.
|
|
920
|
-
*/
|
|
921
|
-
function ResizeObserverSPI(callback, controller, callbackCtx) {
|
|
922
|
-
/**
|
|
923
|
-
* Collection of resize observations that have detected changes in dimensions
|
|
924
|
-
* of elements.
|
|
925
|
-
*
|
|
926
|
-
* @private {Array<ResizeObservation>}
|
|
927
|
-
*/
|
|
928
|
-
this.activeObservations_ = [];
|
|
929
|
-
/**
|
|
930
|
-
* Registry of the ResizeObservation instances.
|
|
931
|
-
*
|
|
932
|
-
* @private {Map<Element, ResizeObservation>}
|
|
933
|
-
*/
|
|
934
|
-
this.observations_ = new MapShim();
|
|
935
|
-
if (typeof callback !== 'function') {
|
|
936
|
-
throw new TypeError('The callback provided as parameter 1 is not a function.');
|
|
937
|
-
}
|
|
938
|
-
this.callback_ = callback;
|
|
939
|
-
this.controller_ = controller;
|
|
940
|
-
this.callbackCtx_ = callbackCtx;
|
|
941
|
-
}
|
|
942
|
-
/**
|
|
943
|
-
* Starts observing provided element.
|
|
944
|
-
*
|
|
945
|
-
* @param {Element} target - Element to be observed.
|
|
946
|
-
* @returns {void}
|
|
947
|
-
*/
|
|
948
|
-
ResizeObserverSPI.prototype.observe = function (target) {
|
|
949
|
-
if (!arguments.length) {
|
|
950
|
-
throw new TypeError('1 argument required, but only 0 present.');
|
|
951
|
-
}
|
|
952
|
-
// Do nothing if current environment doesn't have the Element interface.
|
|
953
|
-
if (typeof Element === 'undefined' || !(Element instanceof Object)) {
|
|
954
|
-
return;
|
|
955
|
-
}
|
|
956
|
-
if (!(target instanceof getWindowOf(target).Element)) {
|
|
957
|
-
throw new TypeError('parameter 1 is not of type "Element".');
|
|
958
|
-
}
|
|
959
|
-
var observations = this.observations_;
|
|
960
|
-
// Do nothing if element is already being observed.
|
|
961
|
-
if (observations.has(target)) {
|
|
962
|
-
return;
|
|
963
|
-
}
|
|
964
|
-
observations.set(target, new ResizeObservation(target));
|
|
965
|
-
this.controller_.addObserver(this);
|
|
966
|
-
// Force the update of observations.
|
|
967
|
-
this.controller_.refresh();
|
|
968
|
-
};
|
|
969
|
-
/**
|
|
970
|
-
* Stops observing provided element.
|
|
971
|
-
*
|
|
972
|
-
* @param {Element} target - Element to stop observing.
|
|
973
|
-
* @returns {void}
|
|
974
|
-
*/
|
|
975
|
-
ResizeObserverSPI.prototype.unobserve = function (target) {
|
|
976
|
-
if (!arguments.length) {
|
|
977
|
-
throw new TypeError('1 argument required, but only 0 present.');
|
|
978
|
-
}
|
|
979
|
-
// Do nothing if current environment doesn't have the Element interface.
|
|
980
|
-
if (typeof Element === 'undefined' || !(Element instanceof Object)) {
|
|
981
|
-
return;
|
|
982
|
-
}
|
|
983
|
-
if (!(target instanceof getWindowOf(target).Element)) {
|
|
984
|
-
throw new TypeError('parameter 1 is not of type "Element".');
|
|
985
|
-
}
|
|
986
|
-
var observations = this.observations_;
|
|
987
|
-
// Do nothing if element is not being observed.
|
|
988
|
-
if (!observations.has(target)) {
|
|
989
|
-
return;
|
|
990
|
-
}
|
|
991
|
-
observations.delete(target);
|
|
992
|
-
if (!observations.size) {
|
|
993
|
-
this.controller_.removeObserver(this);
|
|
994
|
-
}
|
|
995
|
-
};
|
|
996
|
-
/**
|
|
997
|
-
* Stops observing all elements.
|
|
998
|
-
*
|
|
999
|
-
* @returns {void}
|
|
1000
|
-
*/
|
|
1001
|
-
ResizeObserverSPI.prototype.disconnect = function () {
|
|
1002
|
-
this.clearActive();
|
|
1003
|
-
this.observations_.clear();
|
|
1004
|
-
this.controller_.removeObserver(this);
|
|
1005
|
-
};
|
|
1006
|
-
/**
|
|
1007
|
-
* Collects observation instances the associated element of which has changed
|
|
1008
|
-
* it's content rectangle.
|
|
1009
|
-
*
|
|
1010
|
-
* @returns {void}
|
|
1011
|
-
*/
|
|
1012
|
-
ResizeObserverSPI.prototype.gatherActive = function () {
|
|
1013
|
-
var _this = this;
|
|
1014
|
-
this.clearActive();
|
|
1015
|
-
this.observations_.forEach(function (observation) {
|
|
1016
|
-
if (observation.isActive()) {
|
|
1017
|
-
_this.activeObservations_.push(observation);
|
|
1018
|
-
}
|
|
1019
|
-
});
|
|
1020
|
-
};
|
|
1021
|
-
/**
|
|
1022
|
-
* Invokes initial callback function with a list of ResizeObserverEntry
|
|
1023
|
-
* instances collected from active resize observations.
|
|
1024
|
-
*
|
|
1025
|
-
* @returns {void}
|
|
1026
|
-
*/
|
|
1027
|
-
ResizeObserverSPI.prototype.broadcastActive = function () {
|
|
1028
|
-
// Do nothing if observer doesn't have active observations.
|
|
1029
|
-
if (!this.hasActive()) {
|
|
1030
|
-
return;
|
|
1031
|
-
}
|
|
1032
|
-
var ctx = this.callbackCtx_;
|
|
1033
|
-
// Create ResizeObserverEntry instance for every active observation.
|
|
1034
|
-
var entries = this.activeObservations_.map(function (observation) {
|
|
1035
|
-
return new ResizeObserverEntry(observation.target, observation.broadcastRect());
|
|
1036
|
-
});
|
|
1037
|
-
this.callback_.call(ctx, entries, ctx);
|
|
1038
|
-
this.clearActive();
|
|
1039
|
-
};
|
|
1040
|
-
/**
|
|
1041
|
-
* Clears the collection of active observations.
|
|
1042
|
-
*
|
|
1043
|
-
* @returns {void}
|
|
1044
|
-
*/
|
|
1045
|
-
ResizeObserverSPI.prototype.clearActive = function () {
|
|
1046
|
-
this.activeObservations_.splice(0);
|
|
1047
|
-
};
|
|
1048
|
-
/**
|
|
1049
|
-
* Tells whether observer has active observations.
|
|
1050
|
-
*
|
|
1051
|
-
* @returns {boolean}
|
|
1052
|
-
*/
|
|
1053
|
-
ResizeObserverSPI.prototype.hasActive = function () {
|
|
1054
|
-
return this.activeObservations_.length > 0;
|
|
1055
|
-
};
|
|
1056
|
-
return ResizeObserverSPI;
|
|
1057
|
-
}());
|
|
1058
|
-
|
|
1059
|
-
// Registry of internal observers. If WeakMap is not available use current shim
|
|
1060
|
-
// for the Map collection as it has all required methods and because WeakMap
|
|
1061
|
-
// can't be fully polyfilled anyway.
|
|
1062
|
-
var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
|
|
1063
|
-
/**
|
|
1064
|
-
* ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
|
|
1065
|
-
* exposing only those methods and properties that are defined in the spec.
|
|
1066
|
-
*/
|
|
1067
|
-
var ResizeObserver = /** @class */ (function () {
|
|
1068
|
-
/**
|
|
1069
|
-
* Creates a new instance of ResizeObserver.
|
|
1070
|
-
*
|
|
1071
|
-
* @param {ResizeObserverCallback} callback - Callback that is invoked when
|
|
1072
|
-
* dimensions of the observed elements change.
|
|
1073
|
-
*/
|
|
1074
|
-
function ResizeObserver(callback) {
|
|
1075
|
-
if (!(this instanceof ResizeObserver)) {
|
|
1076
|
-
throw new TypeError('Cannot call a class as a function.');
|
|
1077
|
-
}
|
|
1078
|
-
if (!arguments.length) {
|
|
1079
|
-
throw new TypeError('1 argument required, but only 0 present.');
|
|
1080
|
-
}
|
|
1081
|
-
var controller = ResizeObserverController.getInstance();
|
|
1082
|
-
var observer = new ResizeObserverSPI(callback, controller, this);
|
|
1083
|
-
observers.set(this, observer);
|
|
1084
|
-
}
|
|
1085
|
-
return ResizeObserver;
|
|
1086
|
-
}());
|
|
1087
|
-
// Expose public methods of ResizeObserver.
|
|
1088
|
-
[
|
|
1089
|
-
'observe',
|
|
1090
|
-
'unobserve',
|
|
1091
|
-
'disconnect'
|
|
1092
|
-
].forEach(function (method) {
|
|
1093
|
-
ResizeObserver.prototype[method] = function () {
|
|
1094
|
-
var _a;
|
|
1095
|
-
return (_a = observers.get(this))[method].apply(_a, arguments);
|
|
1096
|
-
};
|
|
1097
|
-
});
|
|
1098
|
-
|
|
1099
|
-
var index = (function () {
|
|
1100
|
-
// Export existing implementation if available.
|
|
1101
|
-
if (typeof global$1.ResizeObserver !== 'undefined') {
|
|
1102
|
-
return global$1.ResizeObserver;
|
|
1103
|
-
}
|
|
1104
|
-
return ResizeObserver;
|
|
1105
|
-
})();
|
|
110
|
+
var GenStateSuspendedStart = "suspendedStart";
|
|
111
|
+
var GenStateSuspendedYield = "suspendedYield";
|
|
112
|
+
var GenStateExecuting = "executing";
|
|
113
|
+
var GenStateCompleted = "completed";
|
|
114
|
+
|
|
115
|
+
// Returning this object from the innerFn has the same effect as
|
|
116
|
+
// breaking out of the dispatch switch statement.
|
|
117
|
+
var ContinueSentinel = {};
|
|
118
|
+
|
|
119
|
+
// Dummy constructor functions that we use as the .constructor and
|
|
120
|
+
// .constructor.prototype properties for functions that return Generator
|
|
121
|
+
// objects. For full spec compliance, you may wish to configure your
|
|
122
|
+
// minifier not to mangle the names of these two functions.
|
|
123
|
+
function Generator() {}
|
|
124
|
+
function GeneratorFunction() {}
|
|
125
|
+
function GeneratorFunctionPrototype() {}
|
|
126
|
+
|
|
127
|
+
// This is a polyfill for %IteratorPrototype% for environments that
|
|
128
|
+
// don't natively support it.
|
|
129
|
+
var IteratorPrototype = {};
|
|
130
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
131
|
+
return this;
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
var getProto = Object.getPrototypeOf;
|
|
135
|
+
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
136
|
+
if (NativeIteratorPrototype &&
|
|
137
|
+
NativeIteratorPrototype !== Op &&
|
|
138
|
+
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
139
|
+
// This environment has a native %IteratorPrototype%; use it instead
|
|
140
|
+
// of the polyfill.
|
|
141
|
+
IteratorPrototype = NativeIteratorPrototype;
|
|
142
|
+
}
|
|
1106
143
|
|
|
1107
|
-
|
|
144
|
+
var Gp = GeneratorFunctionPrototype.prototype =
|
|
145
|
+
Generator.prototype = Object.create(IteratorPrototype);
|
|
146
|
+
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
147
|
+
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
148
|
+
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
149
|
+
GeneratorFunction.displayName = define(
|
|
150
|
+
GeneratorFunctionPrototype,
|
|
151
|
+
toStringTagSymbol,
|
|
152
|
+
"GeneratorFunction"
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
// Helper for defining the .next, .throw, and .return methods of the
|
|
156
|
+
// Iterator interface in terms of a single ._invoke method.
|
|
157
|
+
function defineIteratorMethods(prototype) {
|
|
158
|
+
["next", "throw", "return"].forEach(function(method) {
|
|
159
|
+
define(prototype, method, function(arg) {
|
|
160
|
+
return this._invoke(method, arg);
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
}
|
|
1108
164
|
|
|
1109
|
-
|
|
165
|
+
exports.isGeneratorFunction = function(genFun) {
|
|
166
|
+
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
167
|
+
return ctor
|
|
168
|
+
? ctor === GeneratorFunction ||
|
|
169
|
+
// For the native GeneratorFunction constructor, the best we can
|
|
170
|
+
// do is to check its .name property.
|
|
171
|
+
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
172
|
+
: false;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
exports.mark = function(genFun) {
|
|
176
|
+
if (Object.setPrototypeOf) {
|
|
177
|
+
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
178
|
+
} else {
|
|
179
|
+
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
180
|
+
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
181
|
+
}
|
|
182
|
+
genFun.prototype = Object.create(Gp);
|
|
183
|
+
return genFun;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
// Within the body of any async function, `await x` is transformed to
|
|
187
|
+
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
188
|
+
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
189
|
+
// meant to be awaited.
|
|
190
|
+
exports.awrap = function(arg) {
|
|
191
|
+
return { __await: arg };
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
195
|
+
function invoke(method, arg, resolve, reject) {
|
|
196
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
197
|
+
if (record.type === "throw") {
|
|
198
|
+
reject(record.arg);
|
|
199
|
+
} else {
|
|
200
|
+
var result = record.arg;
|
|
201
|
+
var value = result.value;
|
|
202
|
+
if (value &&
|
|
203
|
+
typeof value === "object" &&
|
|
204
|
+
hasOwn.call(value, "__await")) {
|
|
205
|
+
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
206
|
+
invoke("next", value, resolve, reject);
|
|
207
|
+
}, function(err) {
|
|
208
|
+
invoke("throw", err, resolve, reject);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
213
|
+
// When a yielded Promise is resolved, its final value becomes
|
|
214
|
+
// the .value of the Promise<{value,done}> result for the
|
|
215
|
+
// current iteration.
|
|
216
|
+
result.value = unwrapped;
|
|
217
|
+
resolve(result);
|
|
218
|
+
}, function(error) {
|
|
219
|
+
// If a rejected Promise was yielded, throw the rejection back
|
|
220
|
+
// into the async generator function so it can be handled there.
|
|
221
|
+
return invoke("throw", error, resolve, reject);
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
1110
225
|
|
|
1111
|
-
|
|
226
|
+
var previousPromise;
|
|
227
|
+
|
|
228
|
+
function enqueue(method, arg) {
|
|
229
|
+
function callInvokeWithMethodAndArg() {
|
|
230
|
+
return new PromiseImpl(function(resolve, reject) {
|
|
231
|
+
invoke(method, arg, resolve, reject);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return previousPromise =
|
|
236
|
+
// If enqueue has been called before, then we want to wait until
|
|
237
|
+
// all previous Promises have been resolved before calling invoke,
|
|
238
|
+
// so that results are always delivered in the correct order. If
|
|
239
|
+
// enqueue has not been called before, then it is important to
|
|
240
|
+
// call invoke immediately, without waiting on a callback to fire,
|
|
241
|
+
// so that the async generator function has the opportunity to do
|
|
242
|
+
// any necessary setup in a predictable way. This predictability
|
|
243
|
+
// is why the Promise constructor synchronously invokes its
|
|
244
|
+
// executor callback, and why async functions synchronously
|
|
245
|
+
// execute code before the first await. Since we implement simple
|
|
246
|
+
// async functions in terms of async generators, it is especially
|
|
247
|
+
// important to get this right, even though it requires care.
|
|
248
|
+
previousPromise ? previousPromise.then(
|
|
249
|
+
callInvokeWithMethodAndArg,
|
|
250
|
+
// Avoid propagating failures to Promises returned by later
|
|
251
|
+
// invocations of the iterator.
|
|
252
|
+
callInvokeWithMethodAndArg
|
|
253
|
+
) : callInvokeWithMethodAndArg();
|
|
254
|
+
}
|
|
1112
255
|
|
|
1113
|
-
|
|
1114
|
-
|
|
256
|
+
// Define the unified helper method that is used to implement .next,
|
|
257
|
+
// .throw, and .return (see defineIteratorMethods).
|
|
258
|
+
this._invoke = enqueue;
|
|
259
|
+
}
|
|
1115
260
|
|
|
1116
|
-
|
|
1117
|
-
|
|
261
|
+
defineIteratorMethods(AsyncIterator.prototype);
|
|
262
|
+
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
263
|
+
return this;
|
|
264
|
+
});
|
|
265
|
+
exports.AsyncIterator = AsyncIterator;
|
|
266
|
+
|
|
267
|
+
// Note that simple async functions are implemented on top of
|
|
268
|
+
// AsyncIterator objects; they just return a Promise for the value of
|
|
269
|
+
// the final result produced by the iterator.
|
|
270
|
+
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
271
|
+
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
272
|
+
|
|
273
|
+
var iter = new AsyncIterator(
|
|
274
|
+
wrap(innerFn, outerFn, self, tryLocsList),
|
|
275
|
+
PromiseImpl
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
return exports.isGeneratorFunction(outerFn)
|
|
279
|
+
? iter // If outerFn is a generator, return the full iterator.
|
|
280
|
+
: iter.next().then(function(result) {
|
|
281
|
+
return result.done ? result.value : iter.next();
|
|
282
|
+
});
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
286
|
+
var state = GenStateSuspendedStart;
|
|
287
|
+
|
|
288
|
+
return function invoke(method, arg) {
|
|
289
|
+
if (state === GenStateExecuting) {
|
|
290
|
+
throw new Error("Generator is already running");
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (state === GenStateCompleted) {
|
|
294
|
+
if (method === "throw") {
|
|
295
|
+
throw arg;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
299
|
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
300
|
+
return doneResult();
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
context.method = method;
|
|
304
|
+
context.arg = arg;
|
|
305
|
+
|
|
306
|
+
while (true) {
|
|
307
|
+
var delegate = context.delegate;
|
|
308
|
+
if (delegate) {
|
|
309
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
310
|
+
if (delegateResult) {
|
|
311
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
312
|
+
return delegateResult;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
if (context.method === "next") {
|
|
317
|
+
// Setting context._sent for legacy support of Babel's
|
|
318
|
+
// function.sent implementation.
|
|
319
|
+
context.sent = context._sent = context.arg;
|
|
320
|
+
|
|
321
|
+
} else if (context.method === "throw") {
|
|
322
|
+
if (state === GenStateSuspendedStart) {
|
|
323
|
+
state = GenStateCompleted;
|
|
324
|
+
throw context.arg;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
context.dispatchException(context.arg);
|
|
328
|
+
|
|
329
|
+
} else if (context.method === "return") {
|
|
330
|
+
context.abrupt("return", context.arg);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
state = GenStateExecuting;
|
|
334
|
+
|
|
335
|
+
var record = tryCatch(innerFn, self, context);
|
|
336
|
+
if (record.type === "normal") {
|
|
337
|
+
// If an exception is thrown from innerFn, we leave state ===
|
|
338
|
+
// GenStateExecuting and loop back for another invocation.
|
|
339
|
+
state = context.done
|
|
340
|
+
? GenStateCompleted
|
|
341
|
+
: GenStateSuspendedYield;
|
|
342
|
+
|
|
343
|
+
if (record.arg === ContinueSentinel) {
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
return {
|
|
348
|
+
value: record.arg,
|
|
349
|
+
done: context.done
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
} else if (record.type === "throw") {
|
|
353
|
+
state = GenStateCompleted;
|
|
354
|
+
// Dispatch the exception by looping back around to the
|
|
355
|
+
// context.dispatchException(context.arg) call above.
|
|
356
|
+
context.method = "throw";
|
|
357
|
+
context.arg = record.arg;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
}
|
|
1118
362
|
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
363
|
+
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
364
|
+
// result, either by returning a { value, done } result from the
|
|
365
|
+
// delegate iterator, or by modifying context.method and context.arg,
|
|
366
|
+
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
367
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
368
|
+
var method = delegate.iterator[context.method];
|
|
369
|
+
if (method === undefined) {
|
|
370
|
+
// A .throw or .return when the delegate iterator has no .throw
|
|
371
|
+
// method always terminates the yield* loop.
|
|
372
|
+
context.delegate = null;
|
|
373
|
+
|
|
374
|
+
if (context.method === "throw") {
|
|
375
|
+
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
376
|
+
if (delegate.iterator["return"]) {
|
|
377
|
+
// If the delegate iterator has a return method, give it a
|
|
378
|
+
// chance to clean up.
|
|
379
|
+
context.method = "return";
|
|
380
|
+
context.arg = undefined;
|
|
381
|
+
maybeInvokeDelegate(delegate, context);
|
|
382
|
+
|
|
383
|
+
if (context.method === "throw") {
|
|
384
|
+
// If maybeInvokeDelegate(context) changed context.method from
|
|
385
|
+
// "return" to "throw", let that override the TypeError below.
|
|
386
|
+
return ContinueSentinel;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
context.method = "throw";
|
|
391
|
+
context.arg = new TypeError(
|
|
392
|
+
"The iterator does not provide a 'throw' method");
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
return ContinueSentinel;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
399
|
+
|
|
400
|
+
if (record.type === "throw") {
|
|
401
|
+
context.method = "throw";
|
|
402
|
+
context.arg = record.arg;
|
|
403
|
+
context.delegate = null;
|
|
404
|
+
return ContinueSentinel;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
var info = record.arg;
|
|
408
|
+
|
|
409
|
+
if (! info) {
|
|
410
|
+
context.method = "throw";
|
|
411
|
+
context.arg = new TypeError("iterator result is not an object");
|
|
412
|
+
context.delegate = null;
|
|
413
|
+
return ContinueSentinel;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
if (info.done) {
|
|
417
|
+
// Assign the result of the finished delegate to the temporary
|
|
418
|
+
// variable specified by delegate.resultName (see delegateYield).
|
|
419
|
+
context[delegate.resultName] = info.value;
|
|
420
|
+
|
|
421
|
+
// Resume execution at the desired location (see delegateYield).
|
|
422
|
+
context.next = delegate.nextLoc;
|
|
423
|
+
|
|
424
|
+
// If context.method was "throw" but the delegate handled the
|
|
425
|
+
// exception, let the outer generator proceed normally. If
|
|
426
|
+
// context.method was "next", forget context.arg since it has been
|
|
427
|
+
// "consumed" by the delegate iterator. If context.method was
|
|
428
|
+
// "return", allow the original .return call to continue in the
|
|
429
|
+
// outer generator.
|
|
430
|
+
if (context.method !== "return") {
|
|
431
|
+
context.method = "next";
|
|
432
|
+
context.arg = undefined;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
} else {
|
|
436
|
+
// Re-yield the result returned by the delegate method.
|
|
437
|
+
return info;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// The delegate iterator is finished, so forget it and continue with
|
|
441
|
+
// the outer generator.
|
|
442
|
+
context.delegate = null;
|
|
443
|
+
return ContinueSentinel;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
447
|
+
// unified ._invoke helper method.
|
|
448
|
+
defineIteratorMethods(Gp);
|
|
449
|
+
|
|
450
|
+
define(Gp, toStringTagSymbol, "Generator");
|
|
451
|
+
|
|
452
|
+
// A Generator should always return itself as the iterator object when the
|
|
453
|
+
// @@iterator function is called on it. Some browsers' implementations of the
|
|
454
|
+
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
455
|
+
// object to not be returned from this call. This ensures that doesn't happen.
|
|
456
|
+
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
457
|
+
define(Gp, iteratorSymbol, function() {
|
|
458
|
+
return this;
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
define(Gp, "toString", function() {
|
|
462
|
+
return "[object Generator]";
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
function pushTryEntry(locs) {
|
|
466
|
+
var entry = { tryLoc: locs[0] };
|
|
467
|
+
|
|
468
|
+
if (1 in locs) {
|
|
469
|
+
entry.catchLoc = locs[1];
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
if (2 in locs) {
|
|
473
|
+
entry.finallyLoc = locs[2];
|
|
474
|
+
entry.afterLoc = locs[3];
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
this.tryEntries.push(entry);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
function resetTryEntry(entry) {
|
|
481
|
+
var record = entry.completion || {};
|
|
482
|
+
record.type = "normal";
|
|
483
|
+
delete record.arg;
|
|
484
|
+
entry.completion = record;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
function Context(tryLocsList) {
|
|
488
|
+
// The root entry object (effectively a try statement without a catch
|
|
489
|
+
// or a finally block) gives us a place to store values thrown from
|
|
490
|
+
// locations where there is no enclosing try statement.
|
|
491
|
+
this.tryEntries = [{ tryLoc: "root" }];
|
|
492
|
+
tryLocsList.forEach(pushTryEntry, this);
|
|
493
|
+
this.reset(true);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
exports.keys = function(object) {
|
|
497
|
+
var keys = [];
|
|
498
|
+
for (var key in object) {
|
|
499
|
+
keys.push(key);
|
|
500
|
+
}
|
|
501
|
+
keys.reverse();
|
|
502
|
+
|
|
503
|
+
// Rather than returning an object with a next method, we keep
|
|
504
|
+
// things simple and return the next function itself.
|
|
505
|
+
return function next() {
|
|
506
|
+
while (keys.length) {
|
|
507
|
+
var key = keys.pop();
|
|
508
|
+
if (key in object) {
|
|
509
|
+
next.value = key;
|
|
510
|
+
next.done = false;
|
|
511
|
+
return next;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
// To avoid creating an additional object, we just hang the .value
|
|
516
|
+
// and .done properties off the next function object itself. This
|
|
517
|
+
// also ensures that the minifier will not anonymize the function.
|
|
518
|
+
next.done = true;
|
|
519
|
+
return next;
|
|
520
|
+
};
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
function values(iterable) {
|
|
524
|
+
if (iterable) {
|
|
525
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
526
|
+
if (iteratorMethod) {
|
|
527
|
+
return iteratorMethod.call(iterable);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
if (typeof iterable.next === "function") {
|
|
531
|
+
return iterable;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
if (!isNaN(iterable.length)) {
|
|
535
|
+
var i = -1, next = function next() {
|
|
536
|
+
while (++i < iterable.length) {
|
|
537
|
+
if (hasOwn.call(iterable, i)) {
|
|
538
|
+
next.value = iterable[i];
|
|
539
|
+
next.done = false;
|
|
540
|
+
return next;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
next.value = undefined;
|
|
545
|
+
next.done = true;
|
|
546
|
+
|
|
547
|
+
return next;
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
return next.next = next;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
// Return an iterator with no values.
|
|
555
|
+
return { next: doneResult };
|
|
556
|
+
}
|
|
557
|
+
exports.values = values;
|
|
558
|
+
|
|
559
|
+
function doneResult() {
|
|
560
|
+
return { value: undefined, done: true };
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
Context.prototype = {
|
|
564
|
+
constructor: Context,
|
|
565
|
+
|
|
566
|
+
reset: function(skipTempReset) {
|
|
567
|
+
this.prev = 0;
|
|
568
|
+
this.next = 0;
|
|
569
|
+
// Resetting context._sent for legacy support of Babel's
|
|
570
|
+
// function.sent implementation.
|
|
571
|
+
this.sent = this._sent = undefined;
|
|
572
|
+
this.done = false;
|
|
573
|
+
this.delegate = null;
|
|
574
|
+
|
|
575
|
+
this.method = "next";
|
|
576
|
+
this.arg = undefined;
|
|
577
|
+
|
|
578
|
+
this.tryEntries.forEach(resetTryEntry);
|
|
579
|
+
|
|
580
|
+
if (!skipTempReset) {
|
|
581
|
+
for (var name in this) {
|
|
582
|
+
// Not sure about the optimal order of these conditions:
|
|
583
|
+
if (name.charAt(0) === "t" &&
|
|
584
|
+
hasOwn.call(this, name) &&
|
|
585
|
+
!isNaN(+name.slice(1))) {
|
|
586
|
+
this[name] = undefined;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
|
|
592
|
+
stop: function() {
|
|
593
|
+
this.done = true;
|
|
594
|
+
|
|
595
|
+
var rootEntry = this.tryEntries[0];
|
|
596
|
+
var rootRecord = rootEntry.completion;
|
|
597
|
+
if (rootRecord.type === "throw") {
|
|
598
|
+
throw rootRecord.arg;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
return this.rval;
|
|
602
|
+
},
|
|
603
|
+
|
|
604
|
+
dispatchException: function(exception) {
|
|
605
|
+
if (this.done) {
|
|
606
|
+
throw exception;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
var context = this;
|
|
610
|
+
function handle(loc, caught) {
|
|
611
|
+
record.type = "throw";
|
|
612
|
+
record.arg = exception;
|
|
613
|
+
context.next = loc;
|
|
614
|
+
|
|
615
|
+
if (caught) {
|
|
616
|
+
// If the dispatched exception was caught by a catch block,
|
|
617
|
+
// then let that catch block handle the exception normally.
|
|
618
|
+
context.method = "next";
|
|
619
|
+
context.arg = undefined;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
return !! caught;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
626
|
+
var entry = this.tryEntries[i];
|
|
627
|
+
var record = entry.completion;
|
|
628
|
+
|
|
629
|
+
if (entry.tryLoc === "root") {
|
|
630
|
+
// Exception thrown outside of any try block that could handle
|
|
631
|
+
// it, so set the completion value of the entire function to
|
|
632
|
+
// throw the exception.
|
|
633
|
+
return handle("end");
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
if (entry.tryLoc <= this.prev) {
|
|
637
|
+
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
638
|
+
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
639
|
+
|
|
640
|
+
if (hasCatch && hasFinally) {
|
|
641
|
+
if (this.prev < entry.catchLoc) {
|
|
642
|
+
return handle(entry.catchLoc, true);
|
|
643
|
+
} else if (this.prev < entry.finallyLoc) {
|
|
644
|
+
return handle(entry.finallyLoc);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
} else if (hasCatch) {
|
|
648
|
+
if (this.prev < entry.catchLoc) {
|
|
649
|
+
return handle(entry.catchLoc, true);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
} else if (hasFinally) {
|
|
653
|
+
if (this.prev < entry.finallyLoc) {
|
|
654
|
+
return handle(entry.finallyLoc);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
} else {
|
|
658
|
+
throw new Error("try statement without catch or finally");
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
|
|
664
|
+
abrupt: function(type, arg) {
|
|
665
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
666
|
+
var entry = this.tryEntries[i];
|
|
667
|
+
if (entry.tryLoc <= this.prev &&
|
|
668
|
+
hasOwn.call(entry, "finallyLoc") &&
|
|
669
|
+
this.prev < entry.finallyLoc) {
|
|
670
|
+
var finallyEntry = entry;
|
|
671
|
+
break;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
if (finallyEntry &&
|
|
676
|
+
(type === "break" ||
|
|
677
|
+
type === "continue") &&
|
|
678
|
+
finallyEntry.tryLoc <= arg &&
|
|
679
|
+
arg <= finallyEntry.finallyLoc) {
|
|
680
|
+
// Ignore the finally entry if control is not jumping to a
|
|
681
|
+
// location outside the try/catch block.
|
|
682
|
+
finallyEntry = null;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
686
|
+
record.type = type;
|
|
687
|
+
record.arg = arg;
|
|
688
|
+
|
|
689
|
+
if (finallyEntry) {
|
|
690
|
+
this.method = "next";
|
|
691
|
+
this.next = finallyEntry.finallyLoc;
|
|
692
|
+
return ContinueSentinel;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
return this.complete(record);
|
|
696
|
+
},
|
|
697
|
+
|
|
698
|
+
complete: function(record, afterLoc) {
|
|
699
|
+
if (record.type === "throw") {
|
|
700
|
+
throw record.arg;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
if (record.type === "break" ||
|
|
704
|
+
record.type === "continue") {
|
|
705
|
+
this.next = record.arg;
|
|
706
|
+
} else if (record.type === "return") {
|
|
707
|
+
this.rval = this.arg = record.arg;
|
|
708
|
+
this.method = "return";
|
|
709
|
+
this.next = "end";
|
|
710
|
+
} else if (record.type === "normal" && afterLoc) {
|
|
711
|
+
this.next = afterLoc;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
return ContinueSentinel;
|
|
715
|
+
},
|
|
716
|
+
|
|
717
|
+
finish: function(finallyLoc) {
|
|
718
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
719
|
+
var entry = this.tryEntries[i];
|
|
720
|
+
if (entry.finallyLoc === finallyLoc) {
|
|
721
|
+
this.complete(entry.completion, entry.afterLoc);
|
|
722
|
+
resetTryEntry(entry);
|
|
723
|
+
return ContinueSentinel;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
},
|
|
727
|
+
|
|
728
|
+
"catch": function(tryLoc) {
|
|
729
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
730
|
+
var entry = this.tryEntries[i];
|
|
731
|
+
if (entry.tryLoc === tryLoc) {
|
|
732
|
+
var record = entry.completion;
|
|
733
|
+
if (record.type === "throw") {
|
|
734
|
+
var thrown = record.arg;
|
|
735
|
+
resetTryEntry(entry);
|
|
736
|
+
}
|
|
737
|
+
return thrown;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
// The context.catch method must only be called with a location
|
|
742
|
+
// argument that corresponds to a known catch block.
|
|
743
|
+
throw new Error("illegal catch attempt");
|
|
744
|
+
},
|
|
745
|
+
|
|
746
|
+
delegateYield: function(iterable, resultName, nextLoc) {
|
|
747
|
+
this.delegate = {
|
|
748
|
+
iterator: values(iterable),
|
|
749
|
+
resultName: resultName,
|
|
750
|
+
nextLoc: nextLoc
|
|
751
|
+
};
|
|
752
|
+
|
|
753
|
+
if (this.method === "next") {
|
|
754
|
+
// Deliberately forget the last sent value so that we don't
|
|
755
|
+
// accidentally pass it on to the delegate.
|
|
756
|
+
this.arg = undefined;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
return ContinueSentinel;
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
// Regardless of whether this script is executing as a CommonJS module
|
|
764
|
+
// or not, return the runtime object so that we can declare the variable
|
|
765
|
+
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
766
|
+
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
767
|
+
return exports;
|
|
768
|
+
|
|
769
|
+
}(
|
|
770
|
+
// If this script is executing as a CommonJS module, use module.exports
|
|
771
|
+
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
772
|
+
// object. Either way, the resulting object will be used to initialize
|
|
773
|
+
// the regeneratorRuntime variable at the top of this file.
|
|
774
|
+
true ? module.exports : undefined
|
|
775
|
+
));
|
|
776
|
+
|
|
777
|
+
try {
|
|
778
|
+
regeneratorRuntime = runtime;
|
|
779
|
+
} catch (accidentalStrictMode) {
|
|
780
|
+
// This module should not be running in strict mode, so the above
|
|
781
|
+
// assignment should always work unless something is misconfigured. Just
|
|
782
|
+
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
783
|
+
// we can explicitly access globalThis. In older engines we can escape
|
|
784
|
+
// strict mode using a global Function call. This could conceivably fail
|
|
785
|
+
// if a Content Security Policy forbids using Function, but in that case
|
|
786
|
+
// the proper solution is to fix the accidental strict mode problem. If
|
|
787
|
+
// you've misconfigured your bundler to force strict mode and applied a
|
|
788
|
+
// CSP to forbid Function, and you're not willing to fix either of those
|
|
789
|
+
// problems, please detail your unique predicament in a GitHub issue.
|
|
790
|
+
if (typeof globalThis === "object") {
|
|
791
|
+
globalThis.regeneratorRuntime = runtime;
|
|
792
|
+
} else {
|
|
793
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
1123
796
|
|
|
1124
797
|
|
|
1125
798
|
/***/ }),
|
|
@@ -1262,6 +935,316 @@ try {
|
|
|
1262
935
|
module.exports = g;
|
|
1263
936
|
|
|
1264
937
|
|
|
938
|
+
/***/ }),
|
|
939
|
+
|
|
940
|
+
/***/ "df7c":
|
|
941
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
942
|
+
|
|
943
|
+
/* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
|
|
944
|
+
// backported and transplited with Babel, with backwards-compat fixes
|
|
945
|
+
|
|
946
|
+
// Copyright Joyent, Inc. and other Node contributors.
|
|
947
|
+
//
|
|
948
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
949
|
+
// copy of this software and associated documentation files (the
|
|
950
|
+
// "Software"), to deal in the Software without restriction, including
|
|
951
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
952
|
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
953
|
+
// persons to whom the Software is furnished to do so, subject to the
|
|
954
|
+
// following conditions:
|
|
955
|
+
//
|
|
956
|
+
// The above copyright notice and this permission notice shall be included
|
|
957
|
+
// in all copies or substantial portions of the Software.
|
|
958
|
+
//
|
|
959
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
960
|
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
961
|
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
962
|
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
963
|
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
964
|
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
965
|
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
966
|
+
|
|
967
|
+
// resolves . and .. elements in a path array with directory names there
|
|
968
|
+
// must be no slashes, empty elements, or device names (c:\) in the array
|
|
969
|
+
// (so also no leading and trailing slashes - it does not distinguish
|
|
970
|
+
// relative and absolute paths)
|
|
971
|
+
function normalizeArray(parts, allowAboveRoot) {
|
|
972
|
+
// if the path tries to go above the root, `up` ends up > 0
|
|
973
|
+
var up = 0;
|
|
974
|
+
for (var i = parts.length - 1; i >= 0; i--) {
|
|
975
|
+
var last = parts[i];
|
|
976
|
+
if (last === '.') {
|
|
977
|
+
parts.splice(i, 1);
|
|
978
|
+
} else if (last === '..') {
|
|
979
|
+
parts.splice(i, 1);
|
|
980
|
+
up++;
|
|
981
|
+
} else if (up) {
|
|
982
|
+
parts.splice(i, 1);
|
|
983
|
+
up--;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
// if the path is allowed to go above the root, restore leading ..s
|
|
988
|
+
if (allowAboveRoot) {
|
|
989
|
+
for (; up--; up) {
|
|
990
|
+
parts.unshift('..');
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
return parts;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
// path.resolve([from ...], to)
|
|
998
|
+
// posix version
|
|
999
|
+
exports.resolve = function() {
|
|
1000
|
+
var resolvedPath = '',
|
|
1001
|
+
resolvedAbsolute = false;
|
|
1002
|
+
|
|
1003
|
+
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
1004
|
+
var path = (i >= 0) ? arguments[i] : process.cwd();
|
|
1005
|
+
|
|
1006
|
+
// Skip empty and invalid entries
|
|
1007
|
+
if (typeof path !== 'string') {
|
|
1008
|
+
throw new TypeError('Arguments to path.resolve must be strings');
|
|
1009
|
+
} else if (!path) {
|
|
1010
|
+
continue;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
resolvedPath = path + '/' + resolvedPath;
|
|
1014
|
+
resolvedAbsolute = path.charAt(0) === '/';
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
// At this point the path should be resolved to a full absolute path, but
|
|
1018
|
+
// handle relative paths to be safe (might happen when process.cwd() fails)
|
|
1019
|
+
|
|
1020
|
+
// Normalize the path
|
|
1021
|
+
resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
|
|
1022
|
+
return !!p;
|
|
1023
|
+
}), !resolvedAbsolute).join('/');
|
|
1024
|
+
|
|
1025
|
+
return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
|
|
1026
|
+
};
|
|
1027
|
+
|
|
1028
|
+
// path.normalize(path)
|
|
1029
|
+
// posix version
|
|
1030
|
+
exports.normalize = function(path) {
|
|
1031
|
+
var isAbsolute = exports.isAbsolute(path),
|
|
1032
|
+
trailingSlash = substr(path, -1) === '/';
|
|
1033
|
+
|
|
1034
|
+
// Normalize the path
|
|
1035
|
+
path = normalizeArray(filter(path.split('/'), function(p) {
|
|
1036
|
+
return !!p;
|
|
1037
|
+
}), !isAbsolute).join('/');
|
|
1038
|
+
|
|
1039
|
+
if (!path && !isAbsolute) {
|
|
1040
|
+
path = '.';
|
|
1041
|
+
}
|
|
1042
|
+
if (path && trailingSlash) {
|
|
1043
|
+
path += '/';
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
return (isAbsolute ? '/' : '') + path;
|
|
1047
|
+
};
|
|
1048
|
+
|
|
1049
|
+
// posix version
|
|
1050
|
+
exports.isAbsolute = function(path) {
|
|
1051
|
+
return path.charAt(0) === '/';
|
|
1052
|
+
};
|
|
1053
|
+
|
|
1054
|
+
// posix version
|
|
1055
|
+
exports.join = function() {
|
|
1056
|
+
var paths = Array.prototype.slice.call(arguments, 0);
|
|
1057
|
+
return exports.normalize(filter(paths, function(p, index) {
|
|
1058
|
+
if (typeof p !== 'string') {
|
|
1059
|
+
throw new TypeError('Arguments to path.join must be strings');
|
|
1060
|
+
}
|
|
1061
|
+
return p;
|
|
1062
|
+
}).join('/'));
|
|
1063
|
+
};
|
|
1064
|
+
|
|
1065
|
+
|
|
1066
|
+
// path.relative(from, to)
|
|
1067
|
+
// posix version
|
|
1068
|
+
exports.relative = function(from, to) {
|
|
1069
|
+
from = exports.resolve(from).substr(1);
|
|
1070
|
+
to = exports.resolve(to).substr(1);
|
|
1071
|
+
|
|
1072
|
+
function trim(arr) {
|
|
1073
|
+
var start = 0;
|
|
1074
|
+
for (; start < arr.length; start++) {
|
|
1075
|
+
if (arr[start] !== '') break;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
var end = arr.length - 1;
|
|
1079
|
+
for (; end >= 0; end--) {
|
|
1080
|
+
if (arr[end] !== '') break;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
if (start > end) return [];
|
|
1084
|
+
return arr.slice(start, end - start + 1);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
var fromParts = trim(from.split('/'));
|
|
1088
|
+
var toParts = trim(to.split('/'));
|
|
1089
|
+
|
|
1090
|
+
var length = Math.min(fromParts.length, toParts.length);
|
|
1091
|
+
var samePartsLength = length;
|
|
1092
|
+
for (var i = 0; i < length; i++) {
|
|
1093
|
+
if (fromParts[i] !== toParts[i]) {
|
|
1094
|
+
samePartsLength = i;
|
|
1095
|
+
break;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
var outputParts = [];
|
|
1100
|
+
for (var i = samePartsLength; i < fromParts.length; i++) {
|
|
1101
|
+
outputParts.push('..');
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
outputParts = outputParts.concat(toParts.slice(samePartsLength));
|
|
1105
|
+
|
|
1106
|
+
return outputParts.join('/');
|
|
1107
|
+
};
|
|
1108
|
+
|
|
1109
|
+
exports.sep = '/';
|
|
1110
|
+
exports.delimiter = ':';
|
|
1111
|
+
|
|
1112
|
+
exports.dirname = function (path) {
|
|
1113
|
+
if (typeof path !== 'string') path = path + '';
|
|
1114
|
+
if (path.length === 0) return '.';
|
|
1115
|
+
var code = path.charCodeAt(0);
|
|
1116
|
+
var hasRoot = code === 47 /*/*/;
|
|
1117
|
+
var end = -1;
|
|
1118
|
+
var matchedSlash = true;
|
|
1119
|
+
for (var i = path.length - 1; i >= 1; --i) {
|
|
1120
|
+
code = path.charCodeAt(i);
|
|
1121
|
+
if (code === 47 /*/*/) {
|
|
1122
|
+
if (!matchedSlash) {
|
|
1123
|
+
end = i;
|
|
1124
|
+
break;
|
|
1125
|
+
}
|
|
1126
|
+
} else {
|
|
1127
|
+
// We saw the first non-path separator
|
|
1128
|
+
matchedSlash = false;
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
if (end === -1) return hasRoot ? '/' : '.';
|
|
1133
|
+
if (hasRoot && end === 1) {
|
|
1134
|
+
// return '//';
|
|
1135
|
+
// Backwards-compat fix:
|
|
1136
|
+
return '/';
|
|
1137
|
+
}
|
|
1138
|
+
return path.slice(0, end);
|
|
1139
|
+
};
|
|
1140
|
+
|
|
1141
|
+
function basename(path) {
|
|
1142
|
+
if (typeof path !== 'string') path = path + '';
|
|
1143
|
+
|
|
1144
|
+
var start = 0;
|
|
1145
|
+
var end = -1;
|
|
1146
|
+
var matchedSlash = true;
|
|
1147
|
+
var i;
|
|
1148
|
+
|
|
1149
|
+
for (i = path.length - 1; i >= 0; --i) {
|
|
1150
|
+
if (path.charCodeAt(i) === 47 /*/*/) {
|
|
1151
|
+
// If we reached a path separator that was not part of a set of path
|
|
1152
|
+
// separators at the end of the string, stop now
|
|
1153
|
+
if (!matchedSlash) {
|
|
1154
|
+
start = i + 1;
|
|
1155
|
+
break;
|
|
1156
|
+
}
|
|
1157
|
+
} else if (end === -1) {
|
|
1158
|
+
// We saw the first non-path separator, mark this as the end of our
|
|
1159
|
+
// path component
|
|
1160
|
+
matchedSlash = false;
|
|
1161
|
+
end = i + 1;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
if (end === -1) return '';
|
|
1166
|
+
return path.slice(start, end);
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
// Uses a mixed approach for backwards-compatibility, as ext behavior changed
|
|
1170
|
+
// in new Node.js versions, so only basename() above is backported here
|
|
1171
|
+
exports.basename = function (path, ext) {
|
|
1172
|
+
var f = basename(path);
|
|
1173
|
+
if (ext && f.substr(-1 * ext.length) === ext) {
|
|
1174
|
+
f = f.substr(0, f.length - ext.length);
|
|
1175
|
+
}
|
|
1176
|
+
return f;
|
|
1177
|
+
};
|
|
1178
|
+
|
|
1179
|
+
exports.extname = function (path) {
|
|
1180
|
+
if (typeof path !== 'string') path = path + '';
|
|
1181
|
+
var startDot = -1;
|
|
1182
|
+
var startPart = 0;
|
|
1183
|
+
var end = -1;
|
|
1184
|
+
var matchedSlash = true;
|
|
1185
|
+
// Track the state of characters (if any) we see before our first dot and
|
|
1186
|
+
// after any path separator we find
|
|
1187
|
+
var preDotState = 0;
|
|
1188
|
+
for (var i = path.length - 1; i >= 0; --i) {
|
|
1189
|
+
var code = path.charCodeAt(i);
|
|
1190
|
+
if (code === 47 /*/*/) {
|
|
1191
|
+
// If we reached a path separator that was not part of a set of path
|
|
1192
|
+
// separators at the end of the string, stop now
|
|
1193
|
+
if (!matchedSlash) {
|
|
1194
|
+
startPart = i + 1;
|
|
1195
|
+
break;
|
|
1196
|
+
}
|
|
1197
|
+
continue;
|
|
1198
|
+
}
|
|
1199
|
+
if (end === -1) {
|
|
1200
|
+
// We saw the first non-path separator, mark this as the end of our
|
|
1201
|
+
// extension
|
|
1202
|
+
matchedSlash = false;
|
|
1203
|
+
end = i + 1;
|
|
1204
|
+
}
|
|
1205
|
+
if (code === 46 /*.*/) {
|
|
1206
|
+
// If this is our first dot, mark it as the start of our extension
|
|
1207
|
+
if (startDot === -1)
|
|
1208
|
+
startDot = i;
|
|
1209
|
+
else if (preDotState !== 1)
|
|
1210
|
+
preDotState = 1;
|
|
1211
|
+
} else if (startDot !== -1) {
|
|
1212
|
+
// We saw a non-dot and non-path separator before our dot, so we should
|
|
1213
|
+
// have a good chance at having a non-empty extension
|
|
1214
|
+
preDotState = -1;
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
if (startDot === -1 || end === -1 ||
|
|
1219
|
+
// We saw a non-dot character immediately before the dot
|
|
1220
|
+
preDotState === 0 ||
|
|
1221
|
+
// The (right-most) trimmed path component is exactly '..'
|
|
1222
|
+
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
1223
|
+
return '';
|
|
1224
|
+
}
|
|
1225
|
+
return path.slice(startDot, end);
|
|
1226
|
+
};
|
|
1227
|
+
|
|
1228
|
+
function filter (xs, f) {
|
|
1229
|
+
if (xs.filter) return xs.filter(f);
|
|
1230
|
+
var res = [];
|
|
1231
|
+
for (var i = 0; i < xs.length; i++) {
|
|
1232
|
+
if (f(xs[i], i, xs)) res.push(xs[i]);
|
|
1233
|
+
}
|
|
1234
|
+
return res;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
// String.prototype.substr - negative index don't work in IE8
|
|
1238
|
+
var substr = 'ab'.substr(-1) === 'b'
|
|
1239
|
+
? function (str, start, len) { return str.substr(start, len) }
|
|
1240
|
+
: function (str, start, len) {
|
|
1241
|
+
if (start < 0) start = str.length + start;
|
|
1242
|
+
return str.substr(start, len);
|
|
1243
|
+
}
|
|
1244
|
+
;
|
|
1245
|
+
|
|
1246
|
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("4362")))
|
|
1247
|
+
|
|
1265
1248
|
/***/ })
|
|
1266
1249
|
|
|
1267
1250
|
}]);
|