bootstrap-table-rails 1.13.4 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +208 -91
- data/lib/bootstrap-table-rails/version.rb +1 -1
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-locale-all.js +5988 -2758
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.esm.js +2281 -0
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-vue.js +2289 -0
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.css +172 -58
- data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.js +7429 -3853
- data/vendor/assets/javascripts/bootstrap-table/extensions/accent-neutralise/bootstrap-table-accent-neutralise.js +2667 -276
- data/vendor/assets/javascripts/bootstrap-table/extensions/addrbar/bootstrap-table-addrbar.js +1650 -270
- data/vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.js +1092 -92
- data/vendor/assets/javascripts/bootstrap-table/extensions/cookie/bootstrap-table-cookie.js +2984 -549
- data/vendor/assets/javascripts/bootstrap-table/extensions/copy-rows/bootstrap-table-copy-rows.js +1114 -120
- data/vendor/assets/javascripts/bootstrap-table/extensions/custom-view/bootstrap-table-custom-view.js +1587 -0
- data/vendor/assets/javascripts/bootstrap-table/extensions/defer-url/bootstrap-table-defer-url.js +819 -48
- data/vendor/assets/javascripts/bootstrap-table/extensions/editable/bootstrap-table-editable.js +2461 -259
- data/vendor/assets/javascripts/bootstrap-table/extensions/export/bootstrap-table-export.js +2692 -335
- data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.css +4 -4
- data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.js +2956 -910
- data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/utils.js +2361 -0
- data/vendor/assets/javascripts/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns.css +25 -0
- data/vendor/assets/javascripts/bootstrap-table/extensions/fixed-columns/bootstrap-table-fixed-columns.js +1544 -0
- data/vendor/assets/javascripts/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.css +2 -6
- data/vendor/assets/javascripts/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.js +1864 -233
- data/vendor/assets/javascripts/bootstrap-table/extensions/i18n-enhance/bootstrap-table-i18n-enhance.js +112 -37
- data/vendor/assets/javascripts/bootstrap-table/extensions/key-events/bootstrap-table-key-events.js +1386 -101
- data/vendor/assets/javascripts/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js +1238 -151
- data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-sort/bootstrap-table-multiple-sort.js +2140 -424
- data/vendor/assets/javascripts/bootstrap-table/extensions/page-jump-to/bootstrap-table-page-jump-to.css +11 -8
- data/vendor/assets/javascripts/bootstrap-table/extensions/page-jump-to/bootstrap-table-page-jump-to.js +1042 -57
- data/vendor/assets/javascripts/bootstrap-table/extensions/pipeline/bootstrap-table-pipeline.js +1172 -340
- data/vendor/assets/javascripts/bootstrap-table/extensions/print/bootstrap-table-print.js +2199 -144
- data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder-columns.js +1402 -196
- data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.css +10 -10
- data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js +985 -131
- data/vendor/assets/javascripts/bootstrap-table/extensions/resizable/bootstrap-table-resizable.js +715 -85
- data/vendor/assets/javascripts/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.css +1 -2
- data/vendor/assets/javascripts/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.js +1151 -193
- data/vendor/assets/javascripts/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js +2584 -372
- data/vendor/assets/javascripts/bootstrap-table/extensions/treegrid/bootstrap-table-treegrid.js +1922 -118
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-af-ZA.js +770 -52
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ar-SA.js +771 -53
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-bg-BG.js +771 -0
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ca-ES.js +771 -56
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-cs-CZ.js +771 -56
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-da-DK.js +770 -64
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-de-DE.js +770 -64
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-el-GR.js +770 -40
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-en-US.js +770 -61
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-AR.js +771 -43
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CL.js +771 -56
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CR.js +770 -52
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-ES.js +770 -107
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-MX.js +772 -63
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-NI.js +770 -52
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-SP.js +770 -52
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-et-EE.js +770 -55
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-eu-EU.js +770 -55
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fa-IR.js +770 -55
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fi-FI.js +770 -61
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-BE.js +771 -40
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-CH.js +771 -0
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-FR.js +772 -107
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-LU.js +771 -0
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-he-IL.js +770 -55
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hr-HR.js +771 -56
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hu-HU.js +770 -55
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-id-ID.js +770 -61
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-it-IT.js +772 -63
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ja-JP.js +770 -55
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ka-GE.js +770 -52
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ko-KR.js +770 -49
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ms-MY.js +770 -55
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nb-NO.js +770 -49
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-BE.js +771 -0
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-NL.js +771 -64
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pl-PL.js +770 -49
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-BR.js +773 -53
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-PT.js +770 -55
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ro-RO.js +770 -55
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ru-RU.js +770 -85
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sk-SK.js +770 -61
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Cyrl-RS.js +771 -0
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sr-Latn-RS.js +771 -0
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sv-SE.js +770 -49
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-th-TH.js +770 -49
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-tr-TR.js +771 -53
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uk-UA.js +770 -85
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ur-PK.js +770 -49
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uz-Latn-UZ.js +770 -61
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-vi-VN.js +770 -40
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-CN.js +770 -58
- data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-TW.js +770 -52
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/bootstrap-table.css +768 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/bootstrap-table.js +1049 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.eot +0 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.svg +28 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.ttf +0 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bootstrap-table/fonts/bootstrap-table.woff +0 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.css +420 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/bulma/bootstrap-table-bulma.js +1041 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.css +394 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/foundation/bootstrap-table-foundation.js +1051 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.css +390 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/materialize/bootstrap-table-materialize.js +1044 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.css +402 -0
- data/vendor/assets/javascripts/bootstrap-table/themes/semantic/bootstrap-table-semantic.js +1018 -0
- metadata +32 -18
- data/vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.css +0 -3
- data/vendor/assets/javascripts/bootstrap-table/extensions/group-by/bootstrap-table-group-by.css +0 -53
- data/vendor/assets/javascripts/bootstrap-table/extensions/group-by/bootstrap-table-group-by.js +0 -257
- data/vendor/assets/javascripts/bootstrap-table/extensions/multi-column-toggle/bootstrap-table-multi-toggle.js +0 -105
- data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-search/bootstrap-table-multiple-search.js +0 -85
- data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-selection-row/bootstrap-table-multiple-selection-row.css +0 -17
- data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-selection-row/bootstrap-table-multiple-selection-row.js +0 -143
- data/vendor/assets/javascripts/bootstrap-table/extensions/natural-sorting/bootstrap-table-natural-sorting.js +0 -83
- data/vendor/assets/javascripts/bootstrap-table/extensions/select2-filter/bootstrap-table-select2-filter.js +0 -341
- data/vendor/assets/javascripts/bootstrap-table/extensions/tree-column/bootstrap-table-tree-column.css +0 -1
- data/vendor/assets/javascripts/bootstrap-table/extensions/tree-column/bootstrap-table-tree-column.js +0 -142
data/vendor/assets/javascripts/bootstrap-table/extensions/addrbar/bootstrap-table-addrbar.js
CHANGED
@@ -1,271 +1,1651 @@
|
|
1
1
|
(function (global, factory) {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
}
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
}
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
|
3
|
+
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
4
|
+
(global = global || self, factory(global.jQuery));
|
5
|
+
}(this, (function ($) { 'use strict';
|
6
|
+
|
7
|
+
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
|
8
|
+
|
9
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
10
|
+
|
11
|
+
function createCommonjsModule(fn, module) {
|
12
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
13
|
+
}
|
14
|
+
|
15
|
+
var check = function (it) {
|
16
|
+
return it && it.Math == Math && it;
|
17
|
+
};
|
18
|
+
|
19
|
+
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
20
|
+
var global_1 =
|
21
|
+
// eslint-disable-next-line no-undef
|
22
|
+
check(typeof globalThis == 'object' && globalThis) ||
|
23
|
+
check(typeof window == 'object' && window) ||
|
24
|
+
check(typeof self == 'object' && self) ||
|
25
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
26
|
+
// eslint-disable-next-line no-new-func
|
27
|
+
Function('return this')();
|
28
|
+
|
29
|
+
var fails = function (exec) {
|
30
|
+
try {
|
31
|
+
return !!exec();
|
32
|
+
} catch (error) {
|
33
|
+
return true;
|
34
|
+
}
|
35
|
+
};
|
36
|
+
|
37
|
+
// Thank's IE8 for his funny defineProperty
|
38
|
+
var descriptors = !fails(function () {
|
39
|
+
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
40
|
+
});
|
41
|
+
|
42
|
+
var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
|
43
|
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
44
|
+
|
45
|
+
// Nashorn ~ JDK8 bug
|
46
|
+
var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
|
47
|
+
|
48
|
+
// `Object.prototype.propertyIsEnumerable` method implementation
|
49
|
+
// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
|
50
|
+
var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
51
|
+
var descriptor = getOwnPropertyDescriptor(this, V);
|
52
|
+
return !!descriptor && descriptor.enumerable;
|
53
|
+
} : nativePropertyIsEnumerable;
|
54
|
+
|
55
|
+
var objectPropertyIsEnumerable = {
|
56
|
+
f: f
|
57
|
+
};
|
58
|
+
|
59
|
+
var createPropertyDescriptor = function (bitmap, value) {
|
60
|
+
return {
|
61
|
+
enumerable: !(bitmap & 1),
|
62
|
+
configurable: !(bitmap & 2),
|
63
|
+
writable: !(bitmap & 4),
|
64
|
+
value: value
|
65
|
+
};
|
66
|
+
};
|
67
|
+
|
68
|
+
var toString = {}.toString;
|
69
|
+
|
70
|
+
var classofRaw = function (it) {
|
71
|
+
return toString.call(it).slice(8, -1);
|
72
|
+
};
|
73
|
+
|
74
|
+
var split = ''.split;
|
75
|
+
|
76
|
+
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
77
|
+
var indexedObject = fails(function () {
|
78
|
+
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
79
|
+
// eslint-disable-next-line no-prototype-builtins
|
80
|
+
return !Object('z').propertyIsEnumerable(0);
|
81
|
+
}) ? function (it) {
|
82
|
+
return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
|
83
|
+
} : Object;
|
84
|
+
|
85
|
+
// `RequireObjectCoercible` abstract operation
|
86
|
+
// https://tc39.github.io/ecma262/#sec-requireobjectcoercible
|
87
|
+
var requireObjectCoercible = function (it) {
|
88
|
+
if (it == undefined) throw TypeError("Can't call method on " + it);
|
89
|
+
return it;
|
90
|
+
};
|
91
|
+
|
92
|
+
// toObject with fallback for non-array-like ES3 strings
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
var toIndexedObject = function (it) {
|
97
|
+
return indexedObject(requireObjectCoercible(it));
|
98
|
+
};
|
99
|
+
|
100
|
+
var isObject = function (it) {
|
101
|
+
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
102
|
+
};
|
103
|
+
|
104
|
+
// `ToPrimitive` abstract operation
|
105
|
+
// https://tc39.github.io/ecma262/#sec-toprimitive
|
106
|
+
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
|
107
|
+
// and the second argument - flag - preferred type is a string
|
108
|
+
var toPrimitive = function (input, PREFERRED_STRING) {
|
109
|
+
if (!isObject(input)) return input;
|
110
|
+
var fn, val;
|
111
|
+
if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
112
|
+
if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
|
113
|
+
if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
114
|
+
throw TypeError("Can't convert object to primitive value");
|
115
|
+
};
|
116
|
+
|
117
|
+
var hasOwnProperty = {}.hasOwnProperty;
|
118
|
+
|
119
|
+
var has = function (it, key) {
|
120
|
+
return hasOwnProperty.call(it, key);
|
121
|
+
};
|
122
|
+
|
123
|
+
var document = global_1.document;
|
124
|
+
// typeof document.createElement is 'object' in old IE
|
125
|
+
var EXISTS = isObject(document) && isObject(document.createElement);
|
126
|
+
|
127
|
+
var documentCreateElement = function (it) {
|
128
|
+
return EXISTS ? document.createElement(it) : {};
|
129
|
+
};
|
130
|
+
|
131
|
+
// Thank's IE8 for his funny defineProperty
|
132
|
+
var ie8DomDefine = !descriptors && !fails(function () {
|
133
|
+
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
134
|
+
get: function () { return 7; }
|
135
|
+
}).a != 7;
|
136
|
+
});
|
137
|
+
|
138
|
+
var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
139
|
+
|
140
|
+
// `Object.getOwnPropertyDescriptor` method
|
141
|
+
// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
|
142
|
+
var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
143
|
+
O = toIndexedObject(O);
|
144
|
+
P = toPrimitive(P, true);
|
145
|
+
if (ie8DomDefine) try {
|
146
|
+
return nativeGetOwnPropertyDescriptor(O, P);
|
147
|
+
} catch (error) { /* empty */ }
|
148
|
+
if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
|
149
|
+
};
|
150
|
+
|
151
|
+
var objectGetOwnPropertyDescriptor = {
|
152
|
+
f: f$1
|
153
|
+
};
|
154
|
+
|
155
|
+
var anObject = function (it) {
|
156
|
+
if (!isObject(it)) {
|
157
|
+
throw TypeError(String(it) + ' is not an object');
|
158
|
+
} return it;
|
159
|
+
};
|
160
|
+
|
161
|
+
var nativeDefineProperty = Object.defineProperty;
|
162
|
+
|
163
|
+
// `Object.defineProperty` method
|
164
|
+
// https://tc39.github.io/ecma262/#sec-object.defineproperty
|
165
|
+
var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
|
166
|
+
anObject(O);
|
167
|
+
P = toPrimitive(P, true);
|
168
|
+
anObject(Attributes);
|
169
|
+
if (ie8DomDefine) try {
|
170
|
+
return nativeDefineProperty(O, P, Attributes);
|
171
|
+
} catch (error) { /* empty */ }
|
172
|
+
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
173
|
+
if ('value' in Attributes) O[P] = Attributes.value;
|
174
|
+
return O;
|
175
|
+
};
|
176
|
+
|
177
|
+
var objectDefineProperty = {
|
178
|
+
f: f$2
|
179
|
+
};
|
180
|
+
|
181
|
+
var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
182
|
+
return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
183
|
+
} : function (object, key, value) {
|
184
|
+
object[key] = value;
|
185
|
+
return object;
|
186
|
+
};
|
187
|
+
|
188
|
+
var setGlobal = function (key, value) {
|
189
|
+
try {
|
190
|
+
createNonEnumerableProperty(global_1, key, value);
|
191
|
+
} catch (error) {
|
192
|
+
global_1[key] = value;
|
193
|
+
} return value;
|
194
|
+
};
|
195
|
+
|
196
|
+
var SHARED = '__core-js_shared__';
|
197
|
+
var store = global_1[SHARED] || setGlobal(SHARED, {});
|
198
|
+
|
199
|
+
var sharedStore = store;
|
200
|
+
|
201
|
+
var functionToString = Function.toString;
|
202
|
+
|
203
|
+
// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
|
204
|
+
if (typeof sharedStore.inspectSource != 'function') {
|
205
|
+
sharedStore.inspectSource = function (it) {
|
206
|
+
return functionToString.call(it);
|
207
|
+
};
|
208
|
+
}
|
209
|
+
|
210
|
+
var inspectSource = sharedStore.inspectSource;
|
211
|
+
|
212
|
+
var WeakMap = global_1.WeakMap;
|
213
|
+
|
214
|
+
var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
|
215
|
+
|
216
|
+
var shared = createCommonjsModule(function (module) {
|
217
|
+
(module.exports = function (key, value) {
|
218
|
+
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
219
|
+
})('versions', []).push({
|
220
|
+
version: '3.6.0',
|
221
|
+
mode: 'global',
|
222
|
+
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
223
|
+
});
|
224
|
+
});
|
225
|
+
|
226
|
+
var id = 0;
|
227
|
+
var postfix = Math.random();
|
228
|
+
|
229
|
+
var uid = function (key) {
|
230
|
+
return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
231
|
+
};
|
232
|
+
|
233
|
+
var keys = shared('keys');
|
234
|
+
|
235
|
+
var sharedKey = function (key) {
|
236
|
+
return keys[key] || (keys[key] = uid(key));
|
237
|
+
};
|
238
|
+
|
239
|
+
var hiddenKeys = {};
|
240
|
+
|
241
|
+
var WeakMap$1 = global_1.WeakMap;
|
242
|
+
var set, get, has$1;
|
243
|
+
|
244
|
+
var enforce = function (it) {
|
245
|
+
return has$1(it) ? get(it) : set(it, {});
|
246
|
+
};
|
247
|
+
|
248
|
+
var getterFor = function (TYPE) {
|
249
|
+
return function (it) {
|
250
|
+
var state;
|
251
|
+
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
252
|
+
throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
253
|
+
} return state;
|
254
|
+
};
|
255
|
+
};
|
256
|
+
|
257
|
+
if (nativeWeakMap) {
|
258
|
+
var store$1 = new WeakMap$1();
|
259
|
+
var wmget = store$1.get;
|
260
|
+
var wmhas = store$1.has;
|
261
|
+
var wmset = store$1.set;
|
262
|
+
set = function (it, metadata) {
|
263
|
+
wmset.call(store$1, it, metadata);
|
264
|
+
return metadata;
|
265
|
+
};
|
266
|
+
get = function (it) {
|
267
|
+
return wmget.call(store$1, it) || {};
|
268
|
+
};
|
269
|
+
has$1 = function (it) {
|
270
|
+
return wmhas.call(store$1, it);
|
271
|
+
};
|
272
|
+
} else {
|
273
|
+
var STATE = sharedKey('state');
|
274
|
+
hiddenKeys[STATE] = true;
|
275
|
+
set = function (it, metadata) {
|
276
|
+
createNonEnumerableProperty(it, STATE, metadata);
|
277
|
+
return metadata;
|
278
|
+
};
|
279
|
+
get = function (it) {
|
280
|
+
return has(it, STATE) ? it[STATE] : {};
|
281
|
+
};
|
282
|
+
has$1 = function (it) {
|
283
|
+
return has(it, STATE);
|
284
|
+
};
|
285
|
+
}
|
286
|
+
|
287
|
+
var internalState = {
|
288
|
+
set: set,
|
289
|
+
get: get,
|
290
|
+
has: has$1,
|
291
|
+
enforce: enforce,
|
292
|
+
getterFor: getterFor
|
293
|
+
};
|
294
|
+
|
295
|
+
var redefine = createCommonjsModule(function (module) {
|
296
|
+
var getInternalState = internalState.get;
|
297
|
+
var enforceInternalState = internalState.enforce;
|
298
|
+
var TEMPLATE = String(String).split('String');
|
299
|
+
|
300
|
+
(module.exports = function (O, key, value, options) {
|
301
|
+
var unsafe = options ? !!options.unsafe : false;
|
302
|
+
var simple = options ? !!options.enumerable : false;
|
303
|
+
var noTargetGet = options ? !!options.noTargetGet : false;
|
304
|
+
if (typeof value == 'function') {
|
305
|
+
if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
|
306
|
+
enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
307
|
+
}
|
308
|
+
if (O === global_1) {
|
309
|
+
if (simple) O[key] = value;
|
310
|
+
else setGlobal(key, value);
|
311
|
+
return;
|
312
|
+
} else if (!unsafe) {
|
313
|
+
delete O[key];
|
314
|
+
} else if (!noTargetGet && O[key]) {
|
315
|
+
simple = true;
|
316
|
+
}
|
317
|
+
if (simple) O[key] = value;
|
318
|
+
else createNonEnumerableProperty(O, key, value);
|
319
|
+
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
320
|
+
})(Function.prototype, 'toString', function toString() {
|
321
|
+
return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
|
322
|
+
});
|
323
|
+
});
|
324
|
+
|
325
|
+
var path = global_1;
|
326
|
+
|
327
|
+
var aFunction = function (variable) {
|
328
|
+
return typeof variable == 'function' ? variable : undefined;
|
329
|
+
};
|
330
|
+
|
331
|
+
var getBuiltIn = function (namespace, method) {
|
332
|
+
return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
|
333
|
+
: path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
|
334
|
+
};
|
335
|
+
|
336
|
+
var ceil = Math.ceil;
|
337
|
+
var floor = Math.floor;
|
338
|
+
|
339
|
+
// `ToInteger` abstract operation
|
340
|
+
// https://tc39.github.io/ecma262/#sec-tointeger
|
341
|
+
var toInteger = function (argument) {
|
342
|
+
return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
|
343
|
+
};
|
344
|
+
|
345
|
+
var min = Math.min;
|
346
|
+
|
347
|
+
// `ToLength` abstract operation
|
348
|
+
// https://tc39.github.io/ecma262/#sec-tolength
|
349
|
+
var toLength = function (argument) {
|
350
|
+
return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
351
|
+
};
|
352
|
+
|
353
|
+
var max = Math.max;
|
354
|
+
var min$1 = Math.min;
|
355
|
+
|
356
|
+
// Helper for a popular repeating case of the spec:
|
357
|
+
// Let integer be ? ToInteger(index).
|
358
|
+
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
359
|
+
var toAbsoluteIndex = function (index, length) {
|
360
|
+
var integer = toInteger(index);
|
361
|
+
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
362
|
+
};
|
363
|
+
|
364
|
+
// `Array.prototype.{ indexOf, includes }` methods implementation
|
365
|
+
var createMethod = function (IS_INCLUDES) {
|
366
|
+
return function ($this, el, fromIndex) {
|
367
|
+
var O = toIndexedObject($this);
|
368
|
+
var length = toLength(O.length);
|
369
|
+
var index = toAbsoluteIndex(fromIndex, length);
|
370
|
+
var value;
|
371
|
+
// Array#includes uses SameValueZero equality algorithm
|
372
|
+
// eslint-disable-next-line no-self-compare
|
373
|
+
if (IS_INCLUDES && el != el) while (length > index) {
|
374
|
+
value = O[index++];
|
375
|
+
// eslint-disable-next-line no-self-compare
|
376
|
+
if (value != value) return true;
|
377
|
+
// Array#indexOf ignores holes, Array#includes - not
|
378
|
+
} else for (;length > index; index++) {
|
379
|
+
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
380
|
+
} return !IS_INCLUDES && -1;
|
381
|
+
};
|
382
|
+
};
|
383
|
+
|
384
|
+
var arrayIncludes = {
|
385
|
+
// `Array.prototype.includes` method
|
386
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.includes
|
387
|
+
includes: createMethod(true),
|
388
|
+
// `Array.prototype.indexOf` method
|
389
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.indexof
|
390
|
+
indexOf: createMethod(false)
|
391
|
+
};
|
392
|
+
|
393
|
+
var indexOf = arrayIncludes.indexOf;
|
394
|
+
|
395
|
+
|
396
|
+
var objectKeysInternal = function (object, names) {
|
397
|
+
var O = toIndexedObject(object);
|
398
|
+
var i = 0;
|
399
|
+
var result = [];
|
400
|
+
var key;
|
401
|
+
for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
|
402
|
+
// Don't enum bug & hidden keys
|
403
|
+
while (names.length > i) if (has(O, key = names[i++])) {
|
404
|
+
~indexOf(result, key) || result.push(key);
|
405
|
+
}
|
406
|
+
return result;
|
407
|
+
};
|
408
|
+
|
409
|
+
// IE8- don't enum bug keys
|
410
|
+
var enumBugKeys = [
|
411
|
+
'constructor',
|
412
|
+
'hasOwnProperty',
|
413
|
+
'isPrototypeOf',
|
414
|
+
'propertyIsEnumerable',
|
415
|
+
'toLocaleString',
|
416
|
+
'toString',
|
417
|
+
'valueOf'
|
418
|
+
];
|
419
|
+
|
420
|
+
var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
421
|
+
|
422
|
+
// `Object.getOwnPropertyNames` method
|
423
|
+
// https://tc39.github.io/ecma262/#sec-object.getownpropertynames
|
424
|
+
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
425
|
+
return objectKeysInternal(O, hiddenKeys$1);
|
426
|
+
};
|
427
|
+
|
428
|
+
var objectGetOwnPropertyNames = {
|
429
|
+
f: f$3
|
430
|
+
};
|
431
|
+
|
432
|
+
var f$4 = Object.getOwnPropertySymbols;
|
433
|
+
|
434
|
+
var objectGetOwnPropertySymbols = {
|
435
|
+
f: f$4
|
436
|
+
};
|
437
|
+
|
438
|
+
// all object keys, includes non-enumerable and symbols
|
439
|
+
var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
440
|
+
var keys = objectGetOwnPropertyNames.f(anObject(it));
|
441
|
+
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
442
|
+
return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
|
443
|
+
};
|
444
|
+
|
445
|
+
var copyConstructorProperties = function (target, source) {
|
446
|
+
var keys = ownKeys(source);
|
447
|
+
var defineProperty = objectDefineProperty.f;
|
448
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
449
|
+
for (var i = 0; i < keys.length; i++) {
|
450
|
+
var key = keys[i];
|
451
|
+
if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
452
|
+
}
|
453
|
+
};
|
454
|
+
|
455
|
+
var replacement = /#|\.prototype\./;
|
456
|
+
|
457
|
+
var isForced = function (feature, detection) {
|
458
|
+
var value = data[normalize(feature)];
|
459
|
+
return value == POLYFILL ? true
|
460
|
+
: value == NATIVE ? false
|
461
|
+
: typeof detection == 'function' ? fails(detection)
|
462
|
+
: !!detection;
|
463
|
+
};
|
464
|
+
|
465
|
+
var normalize = isForced.normalize = function (string) {
|
466
|
+
return String(string).replace(replacement, '.').toLowerCase();
|
467
|
+
};
|
468
|
+
|
469
|
+
var data = isForced.data = {};
|
470
|
+
var NATIVE = isForced.NATIVE = 'N';
|
471
|
+
var POLYFILL = isForced.POLYFILL = 'P';
|
472
|
+
|
473
|
+
var isForced_1 = isForced;
|
474
|
+
|
475
|
+
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
/*
|
483
|
+
options.target - name of the target object
|
484
|
+
options.global - target is the global object
|
485
|
+
options.stat - export as static methods of target
|
486
|
+
options.proto - export as prototype methods of target
|
487
|
+
options.real - real prototype method for the `pure` version
|
488
|
+
options.forced - export even if the native feature is available
|
489
|
+
options.bind - bind methods to the target, required for the `pure` version
|
490
|
+
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
491
|
+
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
492
|
+
options.sham - add a flag to not completely full polyfills
|
493
|
+
options.enumerable - export as enumerable property
|
494
|
+
options.noTargetGet - prevent calling a getter on target
|
495
|
+
*/
|
496
|
+
var _export = function (options, source) {
|
497
|
+
var TARGET = options.target;
|
498
|
+
var GLOBAL = options.global;
|
499
|
+
var STATIC = options.stat;
|
500
|
+
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
501
|
+
if (GLOBAL) {
|
502
|
+
target = global_1;
|
503
|
+
} else if (STATIC) {
|
504
|
+
target = global_1[TARGET] || setGlobal(TARGET, {});
|
505
|
+
} else {
|
506
|
+
target = (global_1[TARGET] || {}).prototype;
|
507
|
+
}
|
508
|
+
if (target) for (key in source) {
|
509
|
+
sourceProperty = source[key];
|
510
|
+
if (options.noTargetGet) {
|
511
|
+
descriptor = getOwnPropertyDescriptor$1(target, key);
|
512
|
+
targetProperty = descriptor && descriptor.value;
|
513
|
+
} else targetProperty = target[key];
|
514
|
+
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
515
|
+
// contained in target
|
516
|
+
if (!FORCED && targetProperty !== undefined) {
|
517
|
+
if (typeof sourceProperty === typeof targetProperty) continue;
|
518
|
+
copyConstructorProperties(sourceProperty, targetProperty);
|
519
|
+
}
|
520
|
+
// add a flag to not completely full polyfills
|
521
|
+
if (options.sham || (targetProperty && targetProperty.sham)) {
|
522
|
+
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
523
|
+
}
|
524
|
+
// extend global
|
525
|
+
redefine(target, key, sourceProperty, options);
|
526
|
+
}
|
527
|
+
};
|
528
|
+
|
529
|
+
// `IsArray` abstract operation
|
530
|
+
// https://tc39.github.io/ecma262/#sec-isarray
|
531
|
+
var isArray = Array.isArray || function isArray(arg) {
|
532
|
+
return classofRaw(arg) == 'Array';
|
533
|
+
};
|
534
|
+
|
535
|
+
// `ToObject` abstract operation
|
536
|
+
// https://tc39.github.io/ecma262/#sec-toobject
|
537
|
+
var toObject = function (argument) {
|
538
|
+
return Object(requireObjectCoercible(argument));
|
539
|
+
};
|
540
|
+
|
541
|
+
var createProperty = function (object, key, value) {
|
542
|
+
var propertyKey = toPrimitive(key);
|
543
|
+
if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
|
544
|
+
else object[propertyKey] = value;
|
545
|
+
};
|
546
|
+
|
547
|
+
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
548
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
549
|
+
// eslint-disable-next-line no-undef
|
550
|
+
return !String(Symbol());
|
551
|
+
});
|
552
|
+
|
553
|
+
var useSymbolAsUid = nativeSymbol
|
554
|
+
// eslint-disable-next-line no-undef
|
555
|
+
&& !Symbol.sham
|
556
|
+
// eslint-disable-next-line no-undef
|
557
|
+
&& typeof Symbol() == 'symbol';
|
558
|
+
|
559
|
+
var WellKnownSymbolsStore = shared('wks');
|
560
|
+
var Symbol$1 = global_1.Symbol;
|
561
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : uid;
|
562
|
+
|
563
|
+
var wellKnownSymbol = function (name) {
|
564
|
+
if (!has(WellKnownSymbolsStore, name)) {
|
565
|
+
if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
|
566
|
+
else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
567
|
+
} return WellKnownSymbolsStore[name];
|
568
|
+
};
|
569
|
+
|
570
|
+
var SPECIES = wellKnownSymbol('species');
|
571
|
+
|
572
|
+
// `ArraySpeciesCreate` abstract operation
|
573
|
+
// https://tc39.github.io/ecma262/#sec-arrayspeciescreate
|
574
|
+
var arraySpeciesCreate = function (originalArray, length) {
|
575
|
+
var C;
|
576
|
+
if (isArray(originalArray)) {
|
577
|
+
C = originalArray.constructor;
|
578
|
+
// cross-realm fallback
|
579
|
+
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
|
580
|
+
else if (isObject(C)) {
|
581
|
+
C = C[SPECIES];
|
582
|
+
if (C === null) C = undefined;
|
583
|
+
}
|
584
|
+
} return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
585
|
+
};
|
586
|
+
|
587
|
+
var userAgent = getBuiltIn('navigator', 'userAgent') || '';
|
588
|
+
|
589
|
+
var process = global_1.process;
|
590
|
+
var versions = process && process.versions;
|
591
|
+
var v8 = versions && versions.v8;
|
592
|
+
var match, version;
|
593
|
+
|
594
|
+
if (v8) {
|
595
|
+
match = v8.split('.');
|
596
|
+
version = match[0] + match[1];
|
597
|
+
} else if (userAgent) {
|
598
|
+
match = userAgent.match(/Edge\/(\d+)/);
|
599
|
+
if (!match || match[1] >= 74) {
|
600
|
+
match = userAgent.match(/Chrome\/(\d+)/);
|
601
|
+
if (match) version = match[1];
|
602
|
+
}
|
603
|
+
}
|
604
|
+
|
605
|
+
var v8Version = version && +version;
|
606
|
+
|
607
|
+
var SPECIES$1 = wellKnownSymbol('species');
|
608
|
+
|
609
|
+
var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
|
610
|
+
// We can't use this feature detection in V8 since it causes
|
611
|
+
// deoptimization and serious performance degradation
|
612
|
+
// https://github.com/zloirock/core-js/issues/677
|
613
|
+
return v8Version >= 51 || !fails(function () {
|
614
|
+
var array = [];
|
615
|
+
var constructor = array.constructor = {};
|
616
|
+
constructor[SPECIES$1] = function () {
|
617
|
+
return { foo: 1 };
|
618
|
+
};
|
619
|
+
return array[METHOD_NAME](Boolean).foo !== 1;
|
620
|
+
});
|
621
|
+
};
|
622
|
+
|
623
|
+
var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
624
|
+
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
625
|
+
var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
626
|
+
|
627
|
+
// We can't use this feature detection in V8 since it causes
|
628
|
+
// deoptimization and serious performance degradation
|
629
|
+
// https://github.com/zloirock/core-js/issues/679
|
630
|
+
var IS_CONCAT_SPREADABLE_SUPPORT = v8Version >= 51 || !fails(function () {
|
631
|
+
var array = [];
|
632
|
+
array[IS_CONCAT_SPREADABLE] = false;
|
633
|
+
return array.concat()[0] !== array;
|
634
|
+
});
|
635
|
+
|
636
|
+
var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
|
637
|
+
|
638
|
+
var isConcatSpreadable = function (O) {
|
639
|
+
if (!isObject(O)) return false;
|
640
|
+
var spreadable = O[IS_CONCAT_SPREADABLE];
|
641
|
+
return spreadable !== undefined ? !!spreadable : isArray(O);
|
642
|
+
};
|
643
|
+
|
644
|
+
var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
645
|
+
|
646
|
+
// `Array.prototype.concat` method
|
647
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.concat
|
648
|
+
// with adding support of @@isConcatSpreadable and @@species
|
649
|
+
_export({ target: 'Array', proto: true, forced: FORCED }, {
|
650
|
+
concat: function concat(arg) { // eslint-disable-line no-unused-vars
|
651
|
+
var O = toObject(this);
|
652
|
+
var A = arraySpeciesCreate(O, 0);
|
653
|
+
var n = 0;
|
654
|
+
var i, k, length, len, E;
|
655
|
+
for (i = -1, length = arguments.length; i < length; i++) {
|
656
|
+
E = i === -1 ? O : arguments[i];
|
657
|
+
if (isConcatSpreadable(E)) {
|
658
|
+
len = toLength(E.length);
|
659
|
+
if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
660
|
+
for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
661
|
+
} else {
|
662
|
+
if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
663
|
+
createProperty(A, n++, E);
|
664
|
+
}
|
665
|
+
}
|
666
|
+
A.length = n;
|
667
|
+
return A;
|
668
|
+
}
|
669
|
+
});
|
670
|
+
|
671
|
+
// `Object.keys` method
|
672
|
+
// https://tc39.github.io/ecma262/#sec-object.keys
|
673
|
+
var objectKeys = Object.keys || function keys(O) {
|
674
|
+
return objectKeysInternal(O, enumBugKeys);
|
675
|
+
};
|
676
|
+
|
677
|
+
var propertyIsEnumerable = objectPropertyIsEnumerable.f;
|
678
|
+
|
679
|
+
// `Object.{ entries, values }` methods implementation
|
680
|
+
var createMethod$1 = function (TO_ENTRIES) {
|
681
|
+
return function (it) {
|
682
|
+
var O = toIndexedObject(it);
|
683
|
+
var keys = objectKeys(O);
|
684
|
+
var length = keys.length;
|
685
|
+
var i = 0;
|
686
|
+
var result = [];
|
687
|
+
var key;
|
688
|
+
while (length > i) {
|
689
|
+
key = keys[i++];
|
690
|
+
if (!descriptors || propertyIsEnumerable.call(O, key)) {
|
691
|
+
result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
|
692
|
+
}
|
693
|
+
}
|
694
|
+
return result;
|
695
|
+
};
|
696
|
+
};
|
697
|
+
|
698
|
+
var objectToArray = {
|
699
|
+
// `Object.entries` method
|
700
|
+
// https://tc39.github.io/ecma262/#sec-object.entries
|
701
|
+
entries: createMethod$1(true),
|
702
|
+
// `Object.values` method
|
703
|
+
// https://tc39.github.io/ecma262/#sec-object.values
|
704
|
+
values: createMethod$1(false)
|
705
|
+
};
|
706
|
+
|
707
|
+
var $entries = objectToArray.entries;
|
708
|
+
|
709
|
+
// `Object.entries` method
|
710
|
+
// https://tc39.github.io/ecma262/#sec-object.entries
|
711
|
+
_export({ target: 'Object', stat: true }, {
|
712
|
+
entries: function entries(O) {
|
713
|
+
return $entries(O);
|
714
|
+
}
|
715
|
+
});
|
716
|
+
|
717
|
+
var aPossiblePrototype = function (it) {
|
718
|
+
if (!isObject(it) && it !== null) {
|
719
|
+
throw TypeError("Can't set " + String(it) + ' as a prototype');
|
720
|
+
} return it;
|
721
|
+
};
|
722
|
+
|
723
|
+
// `Object.setPrototypeOf` method
|
724
|
+
// https://tc39.github.io/ecma262/#sec-object.setprototypeof
|
725
|
+
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
726
|
+
/* eslint-disable no-proto */
|
727
|
+
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
728
|
+
var CORRECT_SETTER = false;
|
729
|
+
var test = {};
|
730
|
+
var setter;
|
731
|
+
try {
|
732
|
+
setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
|
733
|
+
setter.call(test, []);
|
734
|
+
CORRECT_SETTER = test instanceof Array;
|
735
|
+
} catch (error) { /* empty */ }
|
736
|
+
return function setPrototypeOf(O, proto) {
|
737
|
+
anObject(O);
|
738
|
+
aPossiblePrototype(proto);
|
739
|
+
if (CORRECT_SETTER) setter.call(O, proto);
|
740
|
+
else O.__proto__ = proto;
|
741
|
+
return O;
|
742
|
+
};
|
743
|
+
}() : undefined);
|
744
|
+
|
745
|
+
// makes subclassing work correct for wrapped built-ins
|
746
|
+
var inheritIfRequired = function ($this, dummy, Wrapper) {
|
747
|
+
var NewTarget, NewTargetPrototype;
|
748
|
+
if (
|
749
|
+
// it can work only with native `setPrototypeOf`
|
750
|
+
objectSetPrototypeOf &&
|
751
|
+
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this
|
752
|
+
typeof (NewTarget = dummy.constructor) == 'function' &&
|
753
|
+
NewTarget !== Wrapper &&
|
754
|
+
isObject(NewTargetPrototype = NewTarget.prototype) &&
|
755
|
+
NewTargetPrototype !== Wrapper.prototype
|
756
|
+
) objectSetPrototypeOf($this, NewTargetPrototype);
|
757
|
+
return $this;
|
758
|
+
};
|
759
|
+
|
760
|
+
var MATCH = wellKnownSymbol('match');
|
761
|
+
|
762
|
+
// `IsRegExp` abstract operation
|
763
|
+
// https://tc39.github.io/ecma262/#sec-isregexp
|
764
|
+
var isRegexp = function (it) {
|
765
|
+
var isRegExp;
|
766
|
+
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
|
767
|
+
};
|
768
|
+
|
769
|
+
// `RegExp.prototype.flags` getter implementation
|
770
|
+
// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
|
771
|
+
var regexpFlags = function () {
|
772
|
+
var that = anObject(this);
|
773
|
+
var result = '';
|
774
|
+
if (that.global) result += 'g';
|
775
|
+
if (that.ignoreCase) result += 'i';
|
776
|
+
if (that.multiline) result += 'm';
|
777
|
+
if (that.dotAll) result += 's';
|
778
|
+
if (that.unicode) result += 'u';
|
779
|
+
if (that.sticky) result += 'y';
|
780
|
+
return result;
|
781
|
+
};
|
782
|
+
|
783
|
+
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
|
784
|
+
// so we use an intermediate function.
|
785
|
+
function RE(s, f) {
|
786
|
+
return RegExp(s, f);
|
787
|
+
}
|
788
|
+
|
789
|
+
var UNSUPPORTED_Y = fails(function () {
|
790
|
+
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
791
|
+
var re = RE('a', 'y');
|
792
|
+
re.lastIndex = 2;
|
793
|
+
return re.exec('abcd') != null;
|
794
|
+
});
|
795
|
+
|
796
|
+
var BROKEN_CARET = fails(function () {
|
797
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
798
|
+
var re = RE('^r', 'gy');
|
799
|
+
re.lastIndex = 2;
|
800
|
+
return re.exec('str') != null;
|
801
|
+
});
|
802
|
+
|
803
|
+
var regexpStickyHelpers = {
|
804
|
+
UNSUPPORTED_Y: UNSUPPORTED_Y,
|
805
|
+
BROKEN_CARET: BROKEN_CARET
|
806
|
+
};
|
807
|
+
|
808
|
+
var SPECIES$2 = wellKnownSymbol('species');
|
809
|
+
|
810
|
+
var setSpecies = function (CONSTRUCTOR_NAME) {
|
811
|
+
var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
|
812
|
+
var defineProperty = objectDefineProperty.f;
|
813
|
+
|
814
|
+
if (descriptors && Constructor && !Constructor[SPECIES$2]) {
|
815
|
+
defineProperty(Constructor, SPECIES$2, {
|
816
|
+
configurable: true,
|
817
|
+
get: function () { return this; }
|
818
|
+
});
|
819
|
+
}
|
820
|
+
};
|
821
|
+
|
822
|
+
var defineProperty = objectDefineProperty.f;
|
823
|
+
var getOwnPropertyNames = objectGetOwnPropertyNames.f;
|
824
|
+
|
825
|
+
|
826
|
+
|
827
|
+
|
828
|
+
|
829
|
+
var setInternalState = internalState.set;
|
830
|
+
|
831
|
+
|
832
|
+
|
833
|
+
var MATCH$1 = wellKnownSymbol('match');
|
834
|
+
var NativeRegExp = global_1.RegExp;
|
835
|
+
var RegExpPrototype = NativeRegExp.prototype;
|
836
|
+
var re1 = /a/g;
|
837
|
+
var re2 = /a/g;
|
838
|
+
|
839
|
+
// "new" should create a new object, old webkit bug
|
840
|
+
var CORRECT_NEW = new NativeRegExp(re1) !== re1;
|
841
|
+
|
842
|
+
var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y;
|
843
|
+
|
844
|
+
var FORCED$1 = descriptors && isForced_1('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y$1 || fails(function () {
|
845
|
+
re2[MATCH$1] = false;
|
846
|
+
// RegExp constructor can alter flags and IsRegExp works correct with @@match
|
847
|
+
return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
|
848
|
+
})));
|
849
|
+
|
850
|
+
// `RegExp` constructor
|
851
|
+
// https://tc39.github.io/ecma262/#sec-regexp-constructor
|
852
|
+
if (FORCED$1) {
|
853
|
+
var RegExpWrapper = function RegExp(pattern, flags) {
|
854
|
+
var thisIsRegExp = this instanceof RegExpWrapper;
|
855
|
+
var patternIsRegExp = isRegexp(pattern);
|
856
|
+
var flagsAreUndefined = flags === undefined;
|
857
|
+
var sticky;
|
858
|
+
|
859
|
+
if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
|
860
|
+
return pattern;
|
861
|
+
}
|
862
|
+
|
863
|
+
if (CORRECT_NEW) {
|
864
|
+
if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
|
865
|
+
} else if (pattern instanceof RegExpWrapper) {
|
866
|
+
if (flagsAreUndefined) flags = regexpFlags.call(pattern);
|
867
|
+
pattern = pattern.source;
|
868
|
+
}
|
869
|
+
|
870
|
+
if (UNSUPPORTED_Y$1) {
|
871
|
+
sticky = !!flags && flags.indexOf('y') > -1;
|
872
|
+
if (sticky) flags = flags.replace(/y/g, '');
|
873
|
+
}
|
874
|
+
|
875
|
+
var result = inheritIfRequired(
|
876
|
+
CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
|
877
|
+
thisIsRegExp ? this : RegExpPrototype,
|
878
|
+
RegExpWrapper
|
879
|
+
);
|
880
|
+
|
881
|
+
if (UNSUPPORTED_Y$1 && sticky) setInternalState(result, { sticky: sticky });
|
882
|
+
|
883
|
+
return result;
|
884
|
+
};
|
885
|
+
var proxy = function (key) {
|
886
|
+
key in RegExpWrapper || defineProperty(RegExpWrapper, key, {
|
887
|
+
configurable: true,
|
888
|
+
get: function () { return NativeRegExp[key]; },
|
889
|
+
set: function (it) { NativeRegExp[key] = it; }
|
890
|
+
});
|
891
|
+
};
|
892
|
+
var keys$1 = getOwnPropertyNames(NativeRegExp);
|
893
|
+
var index = 0;
|
894
|
+
while (keys$1.length > index) proxy(keys$1[index++]);
|
895
|
+
RegExpPrototype.constructor = RegExpWrapper;
|
896
|
+
RegExpWrapper.prototype = RegExpPrototype;
|
897
|
+
redefine(global_1, 'RegExp', RegExpWrapper);
|
898
|
+
}
|
899
|
+
|
900
|
+
// https://tc39.github.io/ecma262/#sec-get-regexp-@@species
|
901
|
+
setSpecies('RegExp');
|
902
|
+
|
903
|
+
var nativeExec = RegExp.prototype.exec;
|
904
|
+
// This always refers to the native implementation, because the
|
905
|
+
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
|
906
|
+
// which loads this file before patching the method.
|
907
|
+
var nativeReplace = String.prototype.replace;
|
908
|
+
|
909
|
+
var patchedExec = nativeExec;
|
910
|
+
|
911
|
+
var UPDATES_LAST_INDEX_WRONG = (function () {
|
912
|
+
var re1 = /a/;
|
913
|
+
var re2 = /b*/g;
|
914
|
+
nativeExec.call(re1, 'a');
|
915
|
+
nativeExec.call(re2, 'a');
|
916
|
+
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
917
|
+
})();
|
918
|
+
|
919
|
+
var UNSUPPORTED_Y$2 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
|
920
|
+
|
921
|
+
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
922
|
+
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
923
|
+
|
924
|
+
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$2;
|
925
|
+
|
926
|
+
if (PATCH) {
|
927
|
+
patchedExec = function exec(str) {
|
928
|
+
var re = this;
|
929
|
+
var lastIndex, reCopy, match, i;
|
930
|
+
var sticky = UNSUPPORTED_Y$2 && re.sticky;
|
931
|
+
var flags = regexpFlags.call(re);
|
932
|
+
var source = re.source;
|
933
|
+
var charsAdded = 0;
|
934
|
+
var strCopy = str;
|
935
|
+
|
936
|
+
if (sticky) {
|
937
|
+
flags = flags.replace('y', '');
|
938
|
+
if (flags.indexOf('g') === -1) {
|
939
|
+
flags += 'g';
|
940
|
+
}
|
941
|
+
|
942
|
+
strCopy = String(str).slice(re.lastIndex);
|
943
|
+
// Support anchored sticky behavior.
|
944
|
+
if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
|
945
|
+
source = '(?: ' + source + ')';
|
946
|
+
strCopy = ' ' + strCopy;
|
947
|
+
charsAdded++;
|
948
|
+
}
|
949
|
+
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
950
|
+
// simulate the 'y' flag.
|
951
|
+
reCopy = new RegExp('^(?:' + source + ')', flags);
|
952
|
+
}
|
953
|
+
|
954
|
+
if (NPCG_INCLUDED) {
|
955
|
+
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
956
|
+
}
|
957
|
+
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
958
|
+
|
959
|
+
match = nativeExec.call(sticky ? reCopy : re, strCopy);
|
960
|
+
|
961
|
+
if (sticky) {
|
962
|
+
if (match) {
|
963
|
+
match.input = match.input.slice(charsAdded);
|
964
|
+
match[0] = match[0].slice(charsAdded);
|
965
|
+
match.index = re.lastIndex;
|
966
|
+
re.lastIndex += match[0].length;
|
967
|
+
} else re.lastIndex = 0;
|
968
|
+
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
969
|
+
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
970
|
+
}
|
971
|
+
if (NPCG_INCLUDED && match && match.length > 1) {
|
972
|
+
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
973
|
+
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
|
974
|
+
nativeReplace.call(match[0], reCopy, function () {
|
975
|
+
for (i = 1; i < arguments.length - 2; i++) {
|
976
|
+
if (arguments[i] === undefined) match[i] = undefined;
|
977
|
+
}
|
978
|
+
});
|
979
|
+
}
|
980
|
+
|
981
|
+
return match;
|
982
|
+
};
|
983
|
+
}
|
984
|
+
|
985
|
+
var regexpExec = patchedExec;
|
986
|
+
|
987
|
+
_export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
|
988
|
+
exec: regexpExec
|
989
|
+
});
|
990
|
+
|
991
|
+
var TO_STRING = 'toString';
|
992
|
+
var RegExpPrototype$1 = RegExp.prototype;
|
993
|
+
var nativeToString = RegExpPrototype$1[TO_STRING];
|
994
|
+
|
995
|
+
var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
|
996
|
+
// FF44- RegExp#toString has a wrong name
|
997
|
+
var INCORRECT_NAME = nativeToString.name != TO_STRING;
|
998
|
+
|
999
|
+
// `RegExp.prototype.toString` method
|
1000
|
+
// https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
|
1001
|
+
if (NOT_GENERIC || INCORRECT_NAME) {
|
1002
|
+
redefine(RegExp.prototype, TO_STRING, function toString() {
|
1003
|
+
var R = anObject(this);
|
1004
|
+
var p = String(R.source);
|
1005
|
+
var rf = R.flags;
|
1006
|
+
var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype$1) ? regexpFlags.call(R) : rf);
|
1007
|
+
return '/' + p + '/' + f;
|
1008
|
+
}, { unsafe: true });
|
1009
|
+
}
|
1010
|
+
|
1011
|
+
var SPECIES$3 = wellKnownSymbol('species');
|
1012
|
+
|
1013
|
+
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
1014
|
+
// #replace needs built-in support for named groups.
|
1015
|
+
// #match works fine because it just return the exec results, even if it has
|
1016
|
+
// a "grops" property.
|
1017
|
+
var re = /./;
|
1018
|
+
re.exec = function () {
|
1019
|
+
var result = [];
|
1020
|
+
result.groups = { a: '7' };
|
1021
|
+
return result;
|
1022
|
+
};
|
1023
|
+
return ''.replace(re, '$<a>') !== '7';
|
1024
|
+
});
|
1025
|
+
|
1026
|
+
// IE <= 11 replaces $0 with the whole match, as if it was $&
|
1027
|
+
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
|
1028
|
+
var REPLACE_KEEPS_$0 = (function () {
|
1029
|
+
return 'a'.replace(/./, '$0') === '$0';
|
1030
|
+
})();
|
1031
|
+
|
1032
|
+
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
|
1033
|
+
// Weex JS has frozen built-in prototypes, so use try / catch wrapper
|
1034
|
+
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
|
1035
|
+
var re = /(?:)/;
|
1036
|
+
var originalExec = re.exec;
|
1037
|
+
re.exec = function () { return originalExec.apply(this, arguments); };
|
1038
|
+
var result = 'ab'.split(re);
|
1039
|
+
return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
|
1040
|
+
});
|
1041
|
+
|
1042
|
+
var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
|
1043
|
+
var SYMBOL = wellKnownSymbol(KEY);
|
1044
|
+
|
1045
|
+
var DELEGATES_TO_SYMBOL = !fails(function () {
|
1046
|
+
// String methods call symbol-named RegEp methods
|
1047
|
+
var O = {};
|
1048
|
+
O[SYMBOL] = function () { return 7; };
|
1049
|
+
return ''[KEY](O) != 7;
|
1050
|
+
});
|
1051
|
+
|
1052
|
+
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
|
1053
|
+
// Symbol-named RegExp methods call .exec
|
1054
|
+
var execCalled = false;
|
1055
|
+
var re = /a/;
|
1056
|
+
|
1057
|
+
if (KEY === 'split') {
|
1058
|
+
// We can't use real regex here since it causes deoptimization
|
1059
|
+
// and serious performance degradation in V8
|
1060
|
+
// https://github.com/zloirock/core-js/issues/306
|
1061
|
+
re = {};
|
1062
|
+
// RegExp[@@split] doesn't call the regex's exec method, but first creates
|
1063
|
+
// a new one. We need to return the patched regex when creating the new one.
|
1064
|
+
re.constructor = {};
|
1065
|
+
re.constructor[SPECIES$3] = function () { return re; };
|
1066
|
+
re.flags = '';
|
1067
|
+
re[SYMBOL] = /./[SYMBOL];
|
1068
|
+
}
|
1069
|
+
|
1070
|
+
re.exec = function () { execCalled = true; return null; };
|
1071
|
+
|
1072
|
+
re[SYMBOL]('');
|
1073
|
+
return !execCalled;
|
1074
|
+
});
|
1075
|
+
|
1076
|
+
if (
|
1077
|
+
!DELEGATES_TO_SYMBOL ||
|
1078
|
+
!DELEGATES_TO_EXEC ||
|
1079
|
+
(KEY === 'replace' && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0)) ||
|
1080
|
+
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
|
1081
|
+
) {
|
1082
|
+
var nativeRegExpMethod = /./[SYMBOL];
|
1083
|
+
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
1084
|
+
if (regexp.exec === regexpExec) {
|
1085
|
+
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
1086
|
+
// The native String method already delegates to @@method (this
|
1087
|
+
// polyfilled function), leasing to infinite recursion.
|
1088
|
+
// We avoid it by directly calling the native @@method method.
|
1089
|
+
return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
|
1090
|
+
}
|
1091
|
+
return { done: true, value: nativeMethod.call(str, regexp, arg2) };
|
1092
|
+
}
|
1093
|
+
return { done: false };
|
1094
|
+
}, { REPLACE_KEEPS_$0: REPLACE_KEEPS_$0 });
|
1095
|
+
var stringMethod = methods[0];
|
1096
|
+
var regexMethod = methods[1];
|
1097
|
+
|
1098
|
+
redefine(String.prototype, KEY, stringMethod);
|
1099
|
+
redefine(RegExp.prototype, SYMBOL, length == 2
|
1100
|
+
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
|
1101
|
+
// 21.2.5.11 RegExp.prototype[@@split](string, limit)
|
1102
|
+
? function (string, arg) { return regexMethod.call(string, this, arg); }
|
1103
|
+
// 21.2.5.6 RegExp.prototype[@@match](string)
|
1104
|
+
// 21.2.5.9 RegExp.prototype[@@search](string)
|
1105
|
+
: function (string) { return regexMethod.call(string, this); }
|
1106
|
+
);
|
1107
|
+
}
|
1108
|
+
|
1109
|
+
if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
|
1110
|
+
};
|
1111
|
+
|
1112
|
+
// `String.prototype.{ codePointAt, at }` methods implementation
|
1113
|
+
var createMethod$2 = function (CONVERT_TO_STRING) {
|
1114
|
+
return function ($this, pos) {
|
1115
|
+
var S = String(requireObjectCoercible($this));
|
1116
|
+
var position = toInteger(pos);
|
1117
|
+
var size = S.length;
|
1118
|
+
var first, second;
|
1119
|
+
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
1120
|
+
first = S.charCodeAt(position);
|
1121
|
+
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
1122
|
+
|| (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
|
1123
|
+
? CONVERT_TO_STRING ? S.charAt(position) : first
|
1124
|
+
: CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
1125
|
+
};
|
1126
|
+
};
|
1127
|
+
|
1128
|
+
var stringMultibyte = {
|
1129
|
+
// `String.prototype.codePointAt` method
|
1130
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
|
1131
|
+
codeAt: createMethod$2(false),
|
1132
|
+
// `String.prototype.at` method
|
1133
|
+
// https://github.com/mathiasbynens/String.prototype.at
|
1134
|
+
charAt: createMethod$2(true)
|
1135
|
+
};
|
1136
|
+
|
1137
|
+
var charAt = stringMultibyte.charAt;
|
1138
|
+
|
1139
|
+
// `AdvanceStringIndex` abstract operation
|
1140
|
+
// https://tc39.github.io/ecma262/#sec-advancestringindex
|
1141
|
+
var advanceStringIndex = function (S, index, unicode) {
|
1142
|
+
return index + (unicode ? charAt(S, index).length : 1);
|
1143
|
+
};
|
1144
|
+
|
1145
|
+
// `RegExpExec` abstract operation
|
1146
|
+
// https://tc39.github.io/ecma262/#sec-regexpexec
|
1147
|
+
var regexpExecAbstract = function (R, S) {
|
1148
|
+
var exec = R.exec;
|
1149
|
+
if (typeof exec === 'function') {
|
1150
|
+
var result = exec.call(R, S);
|
1151
|
+
if (typeof result !== 'object') {
|
1152
|
+
throw TypeError('RegExp exec method returned something other than an Object or null');
|
1153
|
+
}
|
1154
|
+
return result;
|
1155
|
+
}
|
1156
|
+
|
1157
|
+
if (classofRaw(R) !== 'RegExp') {
|
1158
|
+
throw TypeError('RegExp#exec called on incompatible receiver');
|
1159
|
+
}
|
1160
|
+
|
1161
|
+
return regexpExec.call(R, S);
|
1162
|
+
};
|
1163
|
+
|
1164
|
+
// @@match logic
|
1165
|
+
fixRegexpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
|
1166
|
+
return [
|
1167
|
+
// `String.prototype.match` method
|
1168
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.match
|
1169
|
+
function match(regexp) {
|
1170
|
+
var O = requireObjectCoercible(this);
|
1171
|
+
var matcher = regexp == undefined ? undefined : regexp[MATCH];
|
1172
|
+
return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
|
1173
|
+
},
|
1174
|
+
// `RegExp.prototype[@@match]` method
|
1175
|
+
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
|
1176
|
+
function (regexp) {
|
1177
|
+
var res = maybeCallNative(nativeMatch, regexp, this);
|
1178
|
+
if (res.done) return res.value;
|
1179
|
+
|
1180
|
+
var rx = anObject(regexp);
|
1181
|
+
var S = String(this);
|
1182
|
+
|
1183
|
+
if (!rx.global) return regexpExecAbstract(rx, S);
|
1184
|
+
|
1185
|
+
var fullUnicode = rx.unicode;
|
1186
|
+
rx.lastIndex = 0;
|
1187
|
+
var A = [];
|
1188
|
+
var n = 0;
|
1189
|
+
var result;
|
1190
|
+
while ((result = regexpExecAbstract(rx, S)) !== null) {
|
1191
|
+
var matchStr = String(result[0]);
|
1192
|
+
A[n] = matchStr;
|
1193
|
+
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
1194
|
+
n++;
|
1195
|
+
}
|
1196
|
+
return n === 0 ? null : A;
|
1197
|
+
}
|
1198
|
+
];
|
1199
|
+
});
|
1200
|
+
|
1201
|
+
var max$1 = Math.max;
|
1202
|
+
var min$2 = Math.min;
|
1203
|
+
var floor$1 = Math.floor;
|
1204
|
+
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
|
1205
|
+
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
|
1206
|
+
|
1207
|
+
var maybeToString = function (it) {
|
1208
|
+
return it === undefined ? it : String(it);
|
1209
|
+
};
|
1210
|
+
|
1211
|
+
// @@replace logic
|
1212
|
+
fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
|
1213
|
+
return [
|
1214
|
+
// `String.prototype.replace` method
|
1215
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.replace
|
1216
|
+
function replace(searchValue, replaceValue) {
|
1217
|
+
var O = requireObjectCoercible(this);
|
1218
|
+
var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
|
1219
|
+
return replacer !== undefined
|
1220
|
+
? replacer.call(searchValue, O, replaceValue)
|
1221
|
+
: nativeReplace.call(String(O), searchValue, replaceValue);
|
1222
|
+
},
|
1223
|
+
// `RegExp.prototype[@@replace]` method
|
1224
|
+
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
|
1225
|
+
function (regexp, replaceValue) {
|
1226
|
+
if (reason.REPLACE_KEEPS_$0 || (typeof replaceValue === 'string' && replaceValue.indexOf('$0') === -1)) {
|
1227
|
+
var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
|
1228
|
+
if (res.done) return res.value;
|
1229
|
+
}
|
1230
|
+
|
1231
|
+
var rx = anObject(regexp);
|
1232
|
+
var S = String(this);
|
1233
|
+
|
1234
|
+
var functionalReplace = typeof replaceValue === 'function';
|
1235
|
+
if (!functionalReplace) replaceValue = String(replaceValue);
|
1236
|
+
|
1237
|
+
var global = rx.global;
|
1238
|
+
if (global) {
|
1239
|
+
var fullUnicode = rx.unicode;
|
1240
|
+
rx.lastIndex = 0;
|
1241
|
+
}
|
1242
|
+
var results = [];
|
1243
|
+
while (true) {
|
1244
|
+
var result = regexpExecAbstract(rx, S);
|
1245
|
+
if (result === null) break;
|
1246
|
+
|
1247
|
+
results.push(result);
|
1248
|
+
if (!global) break;
|
1249
|
+
|
1250
|
+
var matchStr = String(result[0]);
|
1251
|
+
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
1252
|
+
}
|
1253
|
+
|
1254
|
+
var accumulatedResult = '';
|
1255
|
+
var nextSourcePosition = 0;
|
1256
|
+
for (var i = 0; i < results.length; i++) {
|
1257
|
+
result = results[i];
|
1258
|
+
|
1259
|
+
var matched = String(result[0]);
|
1260
|
+
var position = max$1(min$2(toInteger(result.index), S.length), 0);
|
1261
|
+
var captures = [];
|
1262
|
+
// NOTE: This is equivalent to
|
1263
|
+
// captures = result.slice(1).map(maybeToString)
|
1264
|
+
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
|
1265
|
+
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
|
1266
|
+
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
|
1267
|
+
for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
|
1268
|
+
var namedCaptures = result.groups;
|
1269
|
+
if (functionalReplace) {
|
1270
|
+
var replacerArgs = [matched].concat(captures, position, S);
|
1271
|
+
if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
|
1272
|
+
var replacement = String(replaceValue.apply(undefined, replacerArgs));
|
1273
|
+
} else {
|
1274
|
+
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
1275
|
+
}
|
1276
|
+
if (position >= nextSourcePosition) {
|
1277
|
+
accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
|
1278
|
+
nextSourcePosition = position + matched.length;
|
1279
|
+
}
|
1280
|
+
}
|
1281
|
+
return accumulatedResult + S.slice(nextSourcePosition);
|
1282
|
+
}
|
1283
|
+
];
|
1284
|
+
|
1285
|
+
// https://tc39.github.io/ecma262/#sec-getsubstitution
|
1286
|
+
function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
|
1287
|
+
var tailPos = position + matched.length;
|
1288
|
+
var m = captures.length;
|
1289
|
+
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
1290
|
+
if (namedCaptures !== undefined) {
|
1291
|
+
namedCaptures = toObject(namedCaptures);
|
1292
|
+
symbols = SUBSTITUTION_SYMBOLS;
|
1293
|
+
}
|
1294
|
+
return nativeReplace.call(replacement, symbols, function (match, ch) {
|
1295
|
+
var capture;
|
1296
|
+
switch (ch.charAt(0)) {
|
1297
|
+
case '$': return '$';
|
1298
|
+
case '&': return matched;
|
1299
|
+
case '`': return str.slice(0, position);
|
1300
|
+
case "'": return str.slice(tailPos);
|
1301
|
+
case '<':
|
1302
|
+
capture = namedCaptures[ch.slice(1, -1)];
|
1303
|
+
break;
|
1304
|
+
default: // \d\d?
|
1305
|
+
var n = +ch;
|
1306
|
+
if (n === 0) return match;
|
1307
|
+
if (n > m) {
|
1308
|
+
var f = floor$1(n / 10);
|
1309
|
+
if (f === 0) return match;
|
1310
|
+
if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
|
1311
|
+
return match;
|
1312
|
+
}
|
1313
|
+
capture = captures[n - 1];
|
1314
|
+
}
|
1315
|
+
return capture === undefined ? '' : capture;
|
1316
|
+
});
|
1317
|
+
}
|
1318
|
+
});
|
1319
|
+
|
1320
|
+
// `SameValue` abstract operation
|
1321
|
+
// https://tc39.github.io/ecma262/#sec-samevalue
|
1322
|
+
var sameValue = Object.is || function is(x, y) {
|
1323
|
+
// eslint-disable-next-line no-self-compare
|
1324
|
+
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
1325
|
+
};
|
1326
|
+
|
1327
|
+
// @@search logic
|
1328
|
+
fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
|
1329
|
+
return [
|
1330
|
+
// `String.prototype.search` method
|
1331
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.search
|
1332
|
+
function search(regexp) {
|
1333
|
+
var O = requireObjectCoercible(this);
|
1334
|
+
var searcher = regexp == undefined ? undefined : regexp[SEARCH];
|
1335
|
+
return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
|
1336
|
+
},
|
1337
|
+
// `RegExp.prototype[@@search]` method
|
1338
|
+
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
|
1339
|
+
function (regexp) {
|
1340
|
+
var res = maybeCallNative(nativeSearch, regexp, this);
|
1341
|
+
if (res.done) return res.value;
|
1342
|
+
|
1343
|
+
var rx = anObject(regexp);
|
1344
|
+
var S = String(this);
|
1345
|
+
|
1346
|
+
var previousLastIndex = rx.lastIndex;
|
1347
|
+
if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
|
1348
|
+
var result = regexpExecAbstract(rx, S);
|
1349
|
+
if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
1350
|
+
return result === null ? -1 : result.index;
|
1351
|
+
}
|
1352
|
+
];
|
1353
|
+
});
|
1354
|
+
|
1355
|
+
function _classCallCheck(instance, Constructor) {
|
1356
|
+
if (!(instance instanceof Constructor)) {
|
1357
|
+
throw new TypeError("Cannot call a class as a function");
|
1358
|
+
}
|
1359
|
+
}
|
1360
|
+
|
1361
|
+
function _defineProperties(target, props) {
|
1362
|
+
for (var i = 0; i < props.length; i++) {
|
1363
|
+
var descriptor = props[i];
|
1364
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
1365
|
+
descriptor.configurable = true;
|
1366
|
+
if ("value" in descriptor) descriptor.writable = true;
|
1367
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
1368
|
+
}
|
1369
|
+
}
|
1370
|
+
|
1371
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
1372
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
1373
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
1374
|
+
return Constructor;
|
1375
|
+
}
|
1376
|
+
|
1377
|
+
function _inherits(subClass, superClass) {
|
1378
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
1379
|
+
throw new TypeError("Super expression must either be null or a function");
|
1380
|
+
}
|
1381
|
+
|
1382
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
1383
|
+
constructor: {
|
1384
|
+
value: subClass,
|
1385
|
+
writable: true,
|
1386
|
+
configurable: true
|
1387
|
+
}
|
1388
|
+
});
|
1389
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
1390
|
+
}
|
1391
|
+
|
1392
|
+
function _getPrototypeOf(o) {
|
1393
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
1394
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
1395
|
+
};
|
1396
|
+
return _getPrototypeOf(o);
|
1397
|
+
}
|
1398
|
+
|
1399
|
+
function _setPrototypeOf(o, p) {
|
1400
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
1401
|
+
o.__proto__ = p;
|
1402
|
+
return o;
|
1403
|
+
};
|
1404
|
+
|
1405
|
+
return _setPrototypeOf(o, p);
|
1406
|
+
}
|
1407
|
+
|
1408
|
+
function _assertThisInitialized(self) {
|
1409
|
+
if (self === void 0) {
|
1410
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
1411
|
+
}
|
1412
|
+
|
1413
|
+
return self;
|
1414
|
+
}
|
1415
|
+
|
1416
|
+
function _possibleConstructorReturn(self, call) {
|
1417
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
1418
|
+
return call;
|
1419
|
+
}
|
1420
|
+
|
1421
|
+
return _assertThisInitialized(self);
|
1422
|
+
}
|
1423
|
+
|
1424
|
+
function _superPropBase(object, property) {
|
1425
|
+
while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
1426
|
+
object = _getPrototypeOf(object);
|
1427
|
+
if (object === null) break;
|
1428
|
+
}
|
1429
|
+
|
1430
|
+
return object;
|
1431
|
+
}
|
1432
|
+
|
1433
|
+
function _get(target, property, receiver) {
|
1434
|
+
if (typeof Reflect !== "undefined" && Reflect.get) {
|
1435
|
+
_get = Reflect.get;
|
1436
|
+
} else {
|
1437
|
+
_get = function _get(target, property, receiver) {
|
1438
|
+
var base = _superPropBase(target, property);
|
1439
|
+
|
1440
|
+
if (!base) return;
|
1441
|
+
var desc = Object.getOwnPropertyDescriptor(base, property);
|
1442
|
+
|
1443
|
+
if (desc.get) {
|
1444
|
+
return desc.get.call(receiver);
|
1445
|
+
}
|
1446
|
+
|
1447
|
+
return desc.value;
|
1448
|
+
};
|
1449
|
+
}
|
1450
|
+
|
1451
|
+
return _get(target, property, receiver || target);
|
1452
|
+
}
|
1453
|
+
|
1454
|
+
function _slicedToArray(arr, i) {
|
1455
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
1456
|
+
}
|
1457
|
+
|
1458
|
+
function _arrayWithHoles(arr) {
|
1459
|
+
if (Array.isArray(arr)) return arr;
|
1460
|
+
}
|
1461
|
+
|
1462
|
+
function _iterableToArrayLimit(arr, i) {
|
1463
|
+
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
|
1464
|
+
return;
|
1465
|
+
}
|
1466
|
+
|
1467
|
+
var _arr = [];
|
1468
|
+
var _n = true;
|
1469
|
+
var _d = false;
|
1470
|
+
var _e = undefined;
|
1471
|
+
|
1472
|
+
try {
|
1473
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
1474
|
+
_arr.push(_s.value);
|
1475
|
+
|
1476
|
+
if (i && _arr.length === i) break;
|
1477
|
+
}
|
1478
|
+
} catch (err) {
|
1479
|
+
_d = true;
|
1480
|
+
_e = err;
|
1481
|
+
} finally {
|
1482
|
+
try {
|
1483
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
1484
|
+
} finally {
|
1485
|
+
if (_d) throw _e;
|
1486
|
+
}
|
1487
|
+
}
|
1488
|
+
|
1489
|
+
return _arr;
|
1490
|
+
}
|
1491
|
+
|
1492
|
+
function _nonIterableRest() {
|
1493
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
1494
|
+
}
|
1495
|
+
|
1496
|
+
/**
|
1497
|
+
* @author: general
|
1498
|
+
* @website: note.generals.space
|
1499
|
+
* @email: generals.space@gmail.com
|
1500
|
+
* @github: https://github.com/generals-space/bootstrap-table-addrbar
|
1501
|
+
* @update: zhixin wen <wenzhixin2010@gmail.com>
|
1502
|
+
*/
|
1503
|
+
|
1504
|
+
/*
|
1505
|
+
* function: 获取浏览器地址栏中的指定参数.
|
1506
|
+
* key: 参数名
|
1507
|
+
* url: 默认为当前地址栏
|
1508
|
+
*/
|
1509
|
+
|
1510
|
+
function _GET(key) {
|
1511
|
+
var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.search;
|
1512
|
+
|
1513
|
+
/*
|
1514
|
+
* 注意这里正则表达式的书写方法
|
1515
|
+
* (^|&)key匹配: 直接以key开始或以&key开始的字符串
|
1516
|
+
* 同理(&|$)表示以&结束或是直接结束的字符串
|
1517
|
+
* ...当然, 我并不知道这种用法.
|
1518
|
+
*/
|
1519
|
+
var reg = new RegExp("(^|&)".concat(key, "=([^&]*)(&|$)"));
|
1520
|
+
var result = url.substr(1).match(reg);
|
1521
|
+
|
1522
|
+
if (result) {
|
1523
|
+
return decodeURIComponent(result[2]);
|
1524
|
+
}
|
1525
|
+
|
1526
|
+
return null;
|
1527
|
+
}
|
1528
|
+
/*
|
1529
|
+
* function: 根据给定参数生成url地址
|
1530
|
+
* var dic = {name: 'genreal', age: 24}
|
1531
|
+
* var url = 'https://www.baidu.com?age=22';
|
1532
|
+
* _buildUrl(dic, url);
|
1533
|
+
* 将得到"https://www.baidu.com?age=24&name=genreal"
|
1534
|
+
* 哦, 忽略先后顺序吧...
|
1535
|
+
*
|
1536
|
+
* 补充: 可以参考浏览器URLSearchParams对象, 更加方便和强大.
|
1537
|
+
* 考虑到兼容性, 暂时不使用这个工具.
|
1538
|
+
*/
|
1539
|
+
|
1540
|
+
|
1541
|
+
function _buildUrl(dict) {
|
1542
|
+
var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.search;
|
1543
|
+
|
1544
|
+
for (var _i = 0, _Object$entries = Object.entries(dict); _i < _Object$entries.length; _i++) {
|
1545
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
1546
|
+
key = _Object$entries$_i[0],
|
1547
|
+
val = _Object$entries$_i[1];
|
1548
|
+
|
1549
|
+
// 搜索name=general这种形式的字符串(&是分隔符)
|
1550
|
+
var pattern = "".concat(key, "=([^&]*)");
|
1551
|
+
var targetStr = "".concat(key, "=").concat(val);
|
1552
|
+
/*
|
1553
|
+
* 如果目标url中包含了key键, 我们需要将它替换成我们自己的val
|
1554
|
+
* 不然就直接添加好了.
|
1555
|
+
*/
|
1556
|
+
|
1557
|
+
if (url.match(pattern)) {
|
1558
|
+
var tmp = new RegExp("(".concat(key, "=)([^&]*)"), 'gi');
|
1559
|
+
url = url.replace(tmp, targetStr);
|
1560
|
+
} else {
|
1561
|
+
var seperator = url.match('[?]') ? '&' : '?';
|
1562
|
+
url = url + seperator + targetStr;
|
1563
|
+
}
|
1564
|
+
}
|
1565
|
+
|
1566
|
+
if (location.hash) {
|
1567
|
+
url += location.hash;
|
1568
|
+
}
|
1569
|
+
|
1570
|
+
return url;
|
1571
|
+
}
|
1572
|
+
|
1573
|
+
$.extend($.fn.bootstrapTable.defaults, {
|
1574
|
+
addrbar: false,
|
1575
|
+
addrPrefix: ''
|
1576
|
+
});
|
1577
|
+
|
1578
|
+
$.BootstrapTable =
|
1579
|
+
/*#__PURE__*/
|
1580
|
+
function (_$$BootstrapTable) {
|
1581
|
+
_inherits(_class, _$$BootstrapTable);
|
1582
|
+
|
1583
|
+
function _class() {
|
1584
|
+
_classCallCheck(this, _class);
|
1585
|
+
|
1586
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(_class).apply(this, arguments));
|
1587
|
+
}
|
1588
|
+
|
1589
|
+
_createClass(_class, [{
|
1590
|
+
key: "init",
|
1591
|
+
value: function init() {
|
1592
|
+
var _this = this,
|
1593
|
+
_get2;
|
1594
|
+
|
1595
|
+
if (this.options.pagination && this.options.sidePagination === 'server' && this.options.addrbar) {
|
1596
|
+
// 标志位, 初始加载后关闭
|
1597
|
+
this.addrbarInit = true;
|
1598
|
+
this.options.pageNumber = +this.getDefaultOptionValue('pageNumber', 'page');
|
1599
|
+
this.options.pageSize = +this.getDefaultOptionValue('pageSize', 'size');
|
1600
|
+
this.options.sortOrder = this.getDefaultOptionValue('sortOrder', 'order');
|
1601
|
+
this.options.sortName = this.getDefaultOptionValue('sortName', 'sort');
|
1602
|
+
this.options.searchText = this.getDefaultOptionValue('searchText', 'search');
|
1603
|
+
|
1604
|
+
var _prefix = this.options.addrPrefix || '';
|
1605
|
+
|
1606
|
+
var _onLoadSuccess = this.options.onLoadSuccess;
|
1607
|
+
|
1608
|
+
this.options.onLoadSuccess = function (data) {
|
1609
|
+
if (_this.addrbarInit) {
|
1610
|
+
_this.addrbarInit = false;
|
1611
|
+
} else {
|
1612
|
+
var params = {};
|
1613
|
+
params["".concat(_prefix, "page")] = _this.options.pageNumber, params["".concat(_prefix, "size")] = _this.options.pageSize, params["".concat(_prefix, "order")] = _this.options.sortOrder, params["".concat(_prefix, "sort")] = _this.options.sortName, params["".concat(_prefix, "search")] = _this.options.searchText; // h5提供的修改浏览器地址栏的方法
|
1614
|
+
|
1615
|
+
window.history.pushState({}, '', _buildUrl(params));
|
1616
|
+
}
|
1617
|
+
|
1618
|
+
if (_onLoadSuccess) {
|
1619
|
+
_onLoadSuccess.call(_this, data);
|
1620
|
+
}
|
1621
|
+
};
|
1622
|
+
}
|
1623
|
+
|
1624
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
1625
|
+
args[_key] = arguments[_key];
|
1626
|
+
}
|
1627
|
+
|
1628
|
+
(_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
|
1629
|
+
}
|
1630
|
+
/*
|
1631
|
+
* Priority order:
|
1632
|
+
* The value specified by the user has the highest priority.
|
1633
|
+
* If it is not specified, it will be obtained from the address bar.
|
1634
|
+
* If it is not obtained, the default value will be used.
|
1635
|
+
*/
|
1636
|
+
|
1637
|
+
}, {
|
1638
|
+
key: "getDefaultOptionValue",
|
1639
|
+
value: function getDefaultOptionValue(optionName, prefixName) {
|
1640
|
+
if (this.options[optionName] !== $.BootstrapTable.DEFAULTS[optionName]) {
|
1641
|
+
return this.options[optionName];
|
1642
|
+
}
|
1643
|
+
|
1644
|
+
return _GET("".concat(this.options.addrPrefix || '').concat(prefixName)) || $.BootstrapTable.DEFAULTS[optionName];
|
1645
|
+
}
|
1646
|
+
}]);
|
1647
|
+
|
1648
|
+
return _class;
|
1649
|
+
}($.BootstrapTable);
|
1650
|
+
|
1651
|
+
})));
|