infopark_fiona_connector 7.0.1.5.2.4.rc2 → 7.0.1.5.2.7.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,240 +1,2138 @@
1
- var inline_editing = (function() {
2
-
3
- /********************************************************************************************/
4
- /* Global vars */
5
- var prevElement = false;
6
- var actionMarkerVisible = true;
7
- var actionMarkerArray;
8
- var rememberBackgroundColor;
9
- var rememberZoom;
10
- var editMarkerDefinitions;
11
- var parentWindow = parent;
12
-
13
- /********************************************************************************************/
14
- /* Global Functions */
15
-
16
- var findInfoFromClassName = function(element, regexp) {
17
- var info;
18
- var matches = (jQuery(element).attr("class") || "").match(regexp);
19
- if (matches && matches.length > 1) {
20
- return matches[1];
21
- }
22
- };
23
-
24
- /****************************************/
25
- /* Hilfsfunktionen für die Hervorhebung */
26
-
27
- var stashStyle = function(element)
28
- {
29
- var nps_style_stash = {};
30
- jQuery.each(['backgroundColor', 'zoom', 'color'], function(i, property) {
31
- nps_style_stash[property] = element.css(property);
32
- });
33
- element.data('nps_style_stash', nps_style_stash);
34
- };
35
-
36
- var highlight = function(element)
37
- {
38
- // setting the zoom works around incomplete redraws on ie6
39
- element.css({
40
- backgroundColor: '#ffffaa',
41
- zoom: 1,
42
- color: '#000000'
43
- });
44
- };
45
-
46
- var unstashStyle = function(element)
47
- {
48
- if (element.data('nps_style_stash')) {
49
- element.css(element.data('nps_style_stash'));
50
- element.removeData('nps_style_stash');
51
- }
52
- };
53
-
54
- /********************************************************************************************/
55
- /* Marker Definitions */
56
-
57
- /********************************************************************************************/
58
- /* Marker Permission Checking */
59
-
60
- var that = {
61
- setParentWindow: function(new_parent) {
62
- parentWindow = new_parent;
63
- },
64
-
65
- attachMarkerMenu: function(marker_menu_target){
66
- var id = findInfoFromClassName(marker_menu_target, /nps_marker_menu_target_([0-9]+)/);
67
- var marker_menu = jQuery("#nps_marker_menu_"+id);
68
- if (marker_menu.length) {
69
- var definition = that.findMarkerDefinitionForElement(marker_menu);
70
- var target_pos = marker_menu_target.offset();
71
- var parent_pos = marker_menu.offsetParent().offset();
72
-
73
- marker_menu.css({
74
- position: 'absolute',
75
- left: target_pos.left + definition.offset_left - parent_pos.left,
76
- top: target_pos.top + definition.offset_top - parent_pos.top
77
- });
78
-
79
- jQuery(marker_menu).unbind('mouseenter');
80
- jQuery(marker_menu).mouseenter(function(){
81
- stashStyle(marker_menu_target);
82
- highlight(marker_menu_target);
83
- });
84
- jQuery(marker_menu).unbind('mouseleave');
85
- jQuery(marker_menu).mouseleave(function(){
86
- unstashStyle(marker_menu_target);
87
- });
88
- }
89
- },
90
-
91
- initMarkerMenus: function() {
92
- var visible = false;
93
- jQuery('.nps_marker_menu_button').click(function() {
94
- if (visible) {
95
- jQuery(this).next().slideUp(200);
96
- visible = false;
97
- } else {
98
- jQuery(this).next().slideDown(200);
99
- visible = true;
100
- }
101
- return false;
102
- });
103
- },
104
-
105
- attachMarkerMenus: function() {
106
- jQuery('.nps_marker_menu_target').each(function() {
107
- that.attachMarkerMenu(jQuery(this));
108
- });
109
- },
110
-
111
- initActionMarker: function() {
112
- jQuery('.nps_action_marker').each(function(ignore, marker_element) {
113
- if (!that.hasRequiredPermissionsForMarkerElement(marker_element)) {
114
- jQuery(marker_element).hide();
115
- }
116
- });
117
- },
118
-
119
- bindEditMarkerEvents: function(marker, target){
120
- marker.unbind();
121
- marker.mouseenter(function() {
122
- target.find("*").each(function() { stashStyle(jQuery(this)); });
123
- target.find("*").each(function() { highlight(jQuery(this)); });
124
- stashStyle(target);
125
- highlight(target);
126
- });
127
- marker.mouseleave(function() {
128
- target.find("*").each(function() { unstashStyle(jQuery(this)); });
129
- unstashStyle(target);
130
- });
131
- marker.click(function() { return that.startEditing(this); });
132
- },
133
-
134
- initEditMarker: function() {
135
- // add functions and behaviour to all edit marker elements
136
- jQuery(".nps_edit_marker").each(function(i, marker) {
137
- marker = jQuery(marker);
138
- if (that.hasRequiredPermissionsForMarkerElement(marker)) {
139
- var id = findInfoFromClassName(marker, /nps_marker_id_([0-9]+)/);
140
- var target = jQuery("#nps_marker_id_" + id);
141
- if (target.length) {
142
- var pos = target.offset();
143
- var parent_pos = marker.offsetParent().offset();
144
- that.bindEditMarkerEvents(marker, target);
145
- marker.css({
146
- left: pos.left - parent_pos.left,
147
- top: pos.top - parent_pos.top,
148
- position: "absolute",
149
- display: "inline"
150
- });
151
- } else {
152
- marker.hide();
153
- }
154
- }
155
- else {
156
- marker.hide();
157
- }
158
- });
159
- },
160
-
161
- openEditDialog: function(obj_id, attribute, context_id, size, target) {
162
- // pass control to Fiona GUI
163
- parentWindow.openEditDialog(obj_id, attribute, context_id, size, target);
164
- },
165
-
166
- initMarker: function() {
167
- that.initEditMarker();
168
- that.initActionMarker();
169
- that.initMarkerMenus();
170
- that.attachMarkerMenus();
171
- },
172
-
173
- init: function() {
174
- jQuery(document).ready(that.initMarker);
175
- jQuery(window).load(that.initMarker);
176
- jQuery(window).resize(that.initMarker);
177
- },
178
-
179
- storeMarkerDefinitions: function(definitions) {
180
- editMarkerDefinitions = editMarkerDefinitions || {};
181
- jQuery.extend(editMarkerDefinitions, definitions);
182
- },
183
-
184
- markerDefinition: function(id) {
185
- return editMarkerDefinitions[id];
186
- },
187
-
188
- findMarkerDefinitionForElement: function(element) {
189
- return that.markerDefinition(findInfoFromClassName(element, /nps_marker_id_([0-9]+)/));
190
- },
191
-
192
- currentUserHasGlobalPermission: function(perm) {
193
- if (parentWindow.currentUserIsMemberOf) {
194
- return parentWindow.currentUserHasGlobalPermission(perm);
195
- }
196
- else {
197
- return true;
198
- }
199
- },
200
-
201
- currentUserIsMemberOf: function(groups) {
202
- if (parentWindow.currentUserIsMemberOf) {
203
- return parentWindow.currentUserIsMemberOf(groups);
204
- }
205
- else {
206
- return true;
207
- }
208
- },
209
-
210
- hasRequiredPermissionsForMarkerElement: function(element) {
211
- if (that.currentUserHasGlobalPermission("permissionGlobalRoot")) { return true; }
212
-
213
- var definition = that.findMarkerDefinitionForElement(element);
214
- var member_in_group = 0;
215
- jQuery.each(definition.memberships, function() {
216
- if (that.currentUserIsMemberOf(this)) {
217
- member_in_group += 1;
218
- return true;
219
- }
220
- return false;
221
- });
222
- return member_in_group === definition.memberships.length;
223
- },
224
-
225
- startEditing: function(element) {
226
- var definition = that.findMarkerDefinitionForElement(element);
227
-
228
- // pass control to Fiona GUI
229
- that.openEditDialog(
230
- definition.obj_id, definition.attribute, definition.context_id,
231
- definition.size, definition.target
232
- );
233
- return false;
234
- }
235
-
236
- };
237
-
238
- return that;
1
+ var inline_editing = (function () {
2
+ 'use strict';
3
+
4
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
5
+
6
+ function createCommonjsModule(fn, basedir, module) {
7
+ return module = {
8
+ path: basedir,
9
+ exports: {},
10
+ require: function (path, base) {
11
+ return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
12
+ }
13
+ }, fn(module, module.exports), module.exports;
14
+ }
15
+
16
+ function commonjsRequire () {
17
+ throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
18
+ }
19
+
20
+ var check = function (it) {
21
+ return it && it.Math == Math && it;
22
+ };
23
+
24
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
25
+ var global_1 =
26
+ // eslint-disable-next-line no-undef
27
+ check(typeof globalThis == 'object' && globalThis) ||
28
+ check(typeof window == 'object' && window) ||
29
+ check(typeof self == 'object' && self) ||
30
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
31
+ // eslint-disable-next-line no-new-func
32
+ Function('return this')();
33
+
34
+ var fails = function (exec) {
35
+ try {
36
+ return !!exec();
37
+ } catch (error) {
38
+ return true;
39
+ }
40
+ };
41
+
42
+ // Thank's IE8 for his funny defineProperty
43
+ var descriptors = !fails(function () {
44
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
45
+ });
46
+
47
+ var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
48
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
49
+
50
+ // Nashorn ~ JDK8 bug
51
+ var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
52
+
53
+ // `Object.prototype.propertyIsEnumerable` method implementation
54
+ // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
55
+ var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
56
+ var descriptor = getOwnPropertyDescriptor(this, V);
57
+ return !!descriptor && descriptor.enumerable;
58
+ } : nativePropertyIsEnumerable;
59
+
60
+ var objectPropertyIsEnumerable = {
61
+ f: f
62
+ };
63
+
64
+ var createPropertyDescriptor = function (bitmap, value) {
65
+ return {
66
+ enumerable: !(bitmap & 1),
67
+ configurable: !(bitmap & 2),
68
+ writable: !(bitmap & 4),
69
+ value: value
70
+ };
71
+ };
72
+
73
+ var toString = {}.toString;
74
+
75
+ var classofRaw = function (it) {
76
+ return toString.call(it).slice(8, -1);
77
+ };
78
+
79
+ var split = ''.split;
80
+
81
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
82
+ var indexedObject = fails(function () {
83
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
84
+ // eslint-disable-next-line no-prototype-builtins
85
+ return !Object('z').propertyIsEnumerable(0);
86
+ }) ? function (it) {
87
+ return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
88
+ } : Object;
89
+
90
+ // `RequireObjectCoercible` abstract operation
91
+ // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
92
+ var requireObjectCoercible = function (it) {
93
+ if (it == undefined) throw TypeError("Can't call method on " + it);
94
+ return it;
95
+ };
96
+
97
+ // toObject with fallback for non-array-like ES3 strings
98
+
99
+
100
+
101
+ var toIndexedObject = function (it) {
102
+ return indexedObject(requireObjectCoercible(it));
103
+ };
104
+
105
+ var isObject = function (it) {
106
+ return typeof it === 'object' ? it !== null : typeof it === 'function';
107
+ };
108
+
109
+ // `ToPrimitive` abstract operation
110
+ // https://tc39.github.io/ecma262/#sec-toprimitive
111
+ // instead of the ES6 spec version, we didn't implement @@toPrimitive case
112
+ // and the second argument - flag - preferred type is a string
113
+ var toPrimitive = function (input, PREFERRED_STRING) {
114
+ if (!isObject(input)) return input;
115
+ var fn, val;
116
+ if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
117
+ if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
118
+ if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
119
+ throw TypeError("Can't convert object to primitive value");
120
+ };
121
+
122
+ var hasOwnProperty = {}.hasOwnProperty;
123
+
124
+ var has = function (it, key) {
125
+ return hasOwnProperty.call(it, key);
126
+ };
127
+
128
+ var document$1 = global_1.document;
129
+ // typeof document.createElement is 'object' in old IE
130
+ var EXISTS = isObject(document$1) && isObject(document$1.createElement);
131
+
132
+ var documentCreateElement = function (it) {
133
+ return EXISTS ? document$1.createElement(it) : {};
134
+ };
135
+
136
+ // Thank's IE8 for his funny defineProperty
137
+ var ie8DomDefine = !descriptors && !fails(function () {
138
+ return Object.defineProperty(documentCreateElement('div'), 'a', {
139
+ get: function () { return 7; }
140
+ }).a != 7;
141
+ });
142
+
143
+ var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
144
+
145
+ // `Object.getOwnPropertyDescriptor` method
146
+ // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
147
+ var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
148
+ O = toIndexedObject(O);
149
+ P = toPrimitive(P, true);
150
+ if (ie8DomDefine) try {
151
+ return nativeGetOwnPropertyDescriptor(O, P);
152
+ } catch (error) { /* empty */ }
153
+ if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
154
+ };
155
+
156
+ var objectGetOwnPropertyDescriptor = {
157
+ f: f$1
158
+ };
159
+
160
+ var anObject = function (it) {
161
+ if (!isObject(it)) {
162
+ throw TypeError(String(it) + ' is not an object');
163
+ } return it;
164
+ };
165
+
166
+ var nativeDefineProperty = Object.defineProperty;
167
+
168
+ // `Object.defineProperty` method
169
+ // https://tc39.github.io/ecma262/#sec-object.defineproperty
170
+ var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
171
+ anObject(O);
172
+ P = toPrimitive(P, true);
173
+ anObject(Attributes);
174
+ if (ie8DomDefine) try {
175
+ return nativeDefineProperty(O, P, Attributes);
176
+ } catch (error) { /* empty */ }
177
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
178
+ if ('value' in Attributes) O[P] = Attributes.value;
179
+ return O;
180
+ };
181
+
182
+ var objectDefineProperty = {
183
+ f: f$2
184
+ };
185
+
186
+ var createNonEnumerableProperty = descriptors ? function (object, key, value) {
187
+ return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
188
+ } : function (object, key, value) {
189
+ object[key] = value;
190
+ return object;
191
+ };
192
+
193
+ var setGlobal = function (key, value) {
194
+ try {
195
+ createNonEnumerableProperty(global_1, key, value);
196
+ } catch (error) {
197
+ global_1[key] = value;
198
+ } return value;
199
+ };
200
+
201
+ var SHARED = '__core-js_shared__';
202
+ var store = global_1[SHARED] || setGlobal(SHARED, {});
203
+
204
+ var sharedStore = store;
205
+
206
+ var functionToString = Function.toString;
207
+
208
+ // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
209
+ if (typeof sharedStore.inspectSource != 'function') {
210
+ sharedStore.inspectSource = function (it) {
211
+ return functionToString.call(it);
212
+ };
213
+ }
214
+
215
+ var inspectSource = sharedStore.inspectSource;
216
+
217
+ var WeakMap = global_1.WeakMap;
218
+
219
+ var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
220
+
221
+ var shared = createCommonjsModule(function (module) {
222
+ (module.exports = function (key, value) {
223
+ return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
224
+ })('versions', []).push({
225
+ version: '3.6.5',
226
+ mode: 'global',
227
+ copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
228
+ });
229
+ });
230
+
231
+ var id = 0;
232
+ var postfix = Math.random();
233
+
234
+ var uid = function (key) {
235
+ return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
236
+ };
237
+
238
+ var keys = shared('keys');
239
+
240
+ var sharedKey = function (key) {
241
+ return keys[key] || (keys[key] = uid(key));
242
+ };
243
+
244
+ var hiddenKeys = {};
245
+
246
+ var WeakMap$1 = global_1.WeakMap;
247
+ var set, get, has$1;
248
+
249
+ var enforce = function (it) {
250
+ return has$1(it) ? get(it) : set(it, {});
251
+ };
252
+
253
+ var getterFor = function (TYPE) {
254
+ return function (it) {
255
+ var state;
256
+ if (!isObject(it) || (state = get(it)).type !== TYPE) {
257
+ throw TypeError('Incompatible receiver, ' + TYPE + ' required');
258
+ } return state;
259
+ };
260
+ };
261
+
262
+ if (nativeWeakMap) {
263
+ var store$1 = new WeakMap$1();
264
+ var wmget = store$1.get;
265
+ var wmhas = store$1.has;
266
+ var wmset = store$1.set;
267
+ set = function (it, metadata) {
268
+ wmset.call(store$1, it, metadata);
269
+ return metadata;
270
+ };
271
+ get = function (it) {
272
+ return wmget.call(store$1, it) || {};
273
+ };
274
+ has$1 = function (it) {
275
+ return wmhas.call(store$1, it);
276
+ };
277
+ } else {
278
+ var STATE = sharedKey('state');
279
+ hiddenKeys[STATE] = true;
280
+ set = function (it, metadata) {
281
+ createNonEnumerableProperty(it, STATE, metadata);
282
+ return metadata;
283
+ };
284
+ get = function (it) {
285
+ return has(it, STATE) ? it[STATE] : {};
286
+ };
287
+ has$1 = function (it) {
288
+ return has(it, STATE);
289
+ };
290
+ }
291
+
292
+ var internalState = {
293
+ set: set,
294
+ get: get,
295
+ has: has$1,
296
+ enforce: enforce,
297
+ getterFor: getterFor
298
+ };
299
+
300
+ var redefine = createCommonjsModule(function (module) {
301
+ var getInternalState = internalState.get;
302
+ var enforceInternalState = internalState.enforce;
303
+ var TEMPLATE = String(String).split('String');
304
+
305
+ (module.exports = function (O, key, value, options) {
306
+ var unsafe = options ? !!options.unsafe : false;
307
+ var simple = options ? !!options.enumerable : false;
308
+ var noTargetGet = options ? !!options.noTargetGet : false;
309
+ if (typeof value == 'function') {
310
+ if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
311
+ enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
312
+ }
313
+ if (O === global_1) {
314
+ if (simple) O[key] = value;
315
+ else setGlobal(key, value);
316
+ return;
317
+ } else if (!unsafe) {
318
+ delete O[key];
319
+ } else if (!noTargetGet && O[key]) {
320
+ simple = true;
321
+ }
322
+ if (simple) O[key] = value;
323
+ else createNonEnumerableProperty(O, key, value);
324
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
325
+ })(Function.prototype, 'toString', function toString() {
326
+ return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
327
+ });
328
+ });
329
+
330
+ var path = global_1;
331
+
332
+ var aFunction = function (variable) {
333
+ return typeof variable == 'function' ? variable : undefined;
334
+ };
335
+
336
+ var getBuiltIn = function (namespace, method) {
337
+ return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
338
+ : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
339
+ };
340
+
341
+ var ceil = Math.ceil;
342
+ var floor = Math.floor;
343
+
344
+ // `ToInteger` abstract operation
345
+ // https://tc39.github.io/ecma262/#sec-tointeger
346
+ var toInteger = function (argument) {
347
+ return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
348
+ };
349
+
350
+ var min = Math.min;
351
+
352
+ // `ToLength` abstract operation
353
+ // https://tc39.github.io/ecma262/#sec-tolength
354
+ var toLength = function (argument) {
355
+ return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
356
+ };
357
+
358
+ var max = Math.max;
359
+ var min$1 = Math.min;
360
+
361
+ // Helper for a popular repeating case of the spec:
362
+ // Let integer be ? ToInteger(index).
363
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
364
+ var toAbsoluteIndex = function (index, length) {
365
+ var integer = toInteger(index);
366
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
367
+ };
368
+
369
+ // `Array.prototype.{ indexOf, includes }` methods implementation
370
+ var createMethod = function (IS_INCLUDES) {
371
+ return function ($this, el, fromIndex) {
372
+ var O = toIndexedObject($this);
373
+ var length = toLength(O.length);
374
+ var index = toAbsoluteIndex(fromIndex, length);
375
+ var value;
376
+ // Array#includes uses SameValueZero equality algorithm
377
+ // eslint-disable-next-line no-self-compare
378
+ if (IS_INCLUDES && el != el) while (length > index) {
379
+ value = O[index++];
380
+ // eslint-disable-next-line no-self-compare
381
+ if (value != value) return true;
382
+ // Array#indexOf ignores holes, Array#includes - not
383
+ } else for (;length > index; index++) {
384
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
385
+ } return !IS_INCLUDES && -1;
386
+ };
387
+ };
388
+
389
+ var arrayIncludes = {
390
+ // `Array.prototype.includes` method
391
+ // https://tc39.github.io/ecma262/#sec-array.prototype.includes
392
+ includes: createMethod(true),
393
+ // `Array.prototype.indexOf` method
394
+ // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
395
+ indexOf: createMethod(false)
396
+ };
397
+
398
+ var indexOf = arrayIncludes.indexOf;
399
+
400
+
401
+ var objectKeysInternal = function (object, names) {
402
+ var O = toIndexedObject(object);
403
+ var i = 0;
404
+ var result = [];
405
+ var key;
406
+ for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
407
+ // Don't enum bug & hidden keys
408
+ while (names.length > i) if (has(O, key = names[i++])) {
409
+ ~indexOf(result, key) || result.push(key);
410
+ }
411
+ return result;
412
+ };
413
+
414
+ // IE8- don't enum bug keys
415
+ var enumBugKeys = [
416
+ 'constructor',
417
+ 'hasOwnProperty',
418
+ 'isPrototypeOf',
419
+ 'propertyIsEnumerable',
420
+ 'toLocaleString',
421
+ 'toString',
422
+ 'valueOf'
423
+ ];
424
+
425
+ var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
426
+
427
+ // `Object.getOwnPropertyNames` method
428
+ // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
429
+ var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
430
+ return objectKeysInternal(O, hiddenKeys$1);
431
+ };
432
+
433
+ var objectGetOwnPropertyNames = {
434
+ f: f$3
435
+ };
436
+
437
+ var f$4 = Object.getOwnPropertySymbols;
438
+
439
+ var objectGetOwnPropertySymbols = {
440
+ f: f$4
441
+ };
442
+
443
+ // all object keys, includes non-enumerable and symbols
444
+ var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
445
+ var keys = objectGetOwnPropertyNames.f(anObject(it));
446
+ var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
447
+ return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
448
+ };
449
+
450
+ var copyConstructorProperties = function (target, source) {
451
+ var keys = ownKeys(source);
452
+ var defineProperty = objectDefineProperty.f;
453
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
454
+ for (var i = 0; i < keys.length; i++) {
455
+ var key = keys[i];
456
+ if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
457
+ }
458
+ };
459
+
460
+ var replacement = /#|\.prototype\./;
461
+
462
+ var isForced = function (feature, detection) {
463
+ var value = data[normalize(feature)];
464
+ return value == POLYFILL ? true
465
+ : value == NATIVE ? false
466
+ : typeof detection == 'function' ? fails(detection)
467
+ : !!detection;
468
+ };
469
+
470
+ var normalize = isForced.normalize = function (string) {
471
+ return String(string).replace(replacement, '.').toLowerCase();
472
+ };
473
+
474
+ var data = isForced.data = {};
475
+ var NATIVE = isForced.NATIVE = 'N';
476
+ var POLYFILL = isForced.POLYFILL = 'P';
477
+
478
+ var isForced_1 = isForced;
479
+
480
+ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
481
+
482
+
483
+
484
+
485
+
486
+
487
+ /*
488
+ options.target - name of the target object
489
+ options.global - target is the global object
490
+ options.stat - export as static methods of target
491
+ options.proto - export as prototype methods of target
492
+ options.real - real prototype method for the `pure` version
493
+ options.forced - export even if the native feature is available
494
+ options.bind - bind methods to the target, required for the `pure` version
495
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
496
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
497
+ options.sham - add a flag to not completely full polyfills
498
+ options.enumerable - export as enumerable property
499
+ options.noTargetGet - prevent calling a getter on target
500
+ */
501
+ var _export = function (options, source) {
502
+ var TARGET = options.target;
503
+ var GLOBAL = options.global;
504
+ var STATIC = options.stat;
505
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
506
+ if (GLOBAL) {
507
+ target = global_1;
508
+ } else if (STATIC) {
509
+ target = global_1[TARGET] || setGlobal(TARGET, {});
510
+ } else {
511
+ target = (global_1[TARGET] || {}).prototype;
512
+ }
513
+ if (target) for (key in source) {
514
+ sourceProperty = source[key];
515
+ if (options.noTargetGet) {
516
+ descriptor = getOwnPropertyDescriptor$1(target, key);
517
+ targetProperty = descriptor && descriptor.value;
518
+ } else targetProperty = target[key];
519
+ FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
520
+ // contained in target
521
+ if (!FORCED && targetProperty !== undefined) {
522
+ if (typeof sourceProperty === typeof targetProperty) continue;
523
+ copyConstructorProperties(sourceProperty, targetProperty);
524
+ }
525
+ // add a flag to not completely full polyfills
526
+ if (options.sham || (targetProperty && targetProperty.sham)) {
527
+ createNonEnumerableProperty(sourceProperty, 'sham', true);
528
+ }
529
+ // extend global
530
+ redefine(target, key, sourceProperty, options);
531
+ }
532
+ };
533
+
534
+ var aFunction$1 = function (it) {
535
+ if (typeof it != 'function') {
536
+ throw TypeError(String(it) + ' is not a function');
537
+ } return it;
538
+ };
539
+
540
+ // optional / simple context binding
541
+ var functionBindContext = function (fn, that, length) {
542
+ aFunction$1(fn);
543
+ if (that === undefined) return fn;
544
+ switch (length) {
545
+ case 0: return function () {
546
+ return fn.call(that);
547
+ };
548
+ case 1: return function (a) {
549
+ return fn.call(that, a);
550
+ };
551
+ case 2: return function (a, b) {
552
+ return fn.call(that, a, b);
553
+ };
554
+ case 3: return function (a, b, c) {
555
+ return fn.call(that, a, b, c);
556
+ };
557
+ }
558
+ return function (/* ...args */) {
559
+ return fn.apply(that, arguments);
560
+ };
561
+ };
562
+
563
+ // `ToObject` abstract operation
564
+ // https://tc39.github.io/ecma262/#sec-toobject
565
+ var toObject = function (argument) {
566
+ return Object(requireObjectCoercible(argument));
567
+ };
568
+
569
+ // `IsArray` abstract operation
570
+ // https://tc39.github.io/ecma262/#sec-isarray
571
+ var isArray = Array.isArray || function isArray(arg) {
572
+ return classofRaw(arg) == 'Array';
573
+ };
574
+
575
+ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
576
+ // Chrome 38 Symbol has incorrect toString conversion
577
+ // eslint-disable-next-line no-undef
578
+ return !String(Symbol());
579
+ });
580
+
581
+ var useSymbolAsUid = nativeSymbol
582
+ // eslint-disable-next-line no-undef
583
+ && !Symbol.sham
584
+ // eslint-disable-next-line no-undef
585
+ && typeof Symbol.iterator == 'symbol';
586
+
587
+ var WellKnownSymbolsStore = shared('wks');
588
+ var Symbol$1 = global_1.Symbol;
589
+ var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
590
+
591
+ var wellKnownSymbol = function (name) {
592
+ if (!has(WellKnownSymbolsStore, name)) {
593
+ if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
594
+ else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
595
+ } return WellKnownSymbolsStore[name];
596
+ };
597
+
598
+ var SPECIES = wellKnownSymbol('species');
599
+
600
+ // `ArraySpeciesCreate` abstract operation
601
+ // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
602
+ var arraySpeciesCreate = function (originalArray, length) {
603
+ var C;
604
+ if (isArray(originalArray)) {
605
+ C = originalArray.constructor;
606
+ // cross-realm fallback
607
+ if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
608
+ else if (isObject(C)) {
609
+ C = C[SPECIES];
610
+ if (C === null) C = undefined;
611
+ }
612
+ } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
613
+ };
614
+
615
+ var push = [].push;
616
+
617
+ // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
618
+ var createMethod$1 = function (TYPE) {
619
+ var IS_MAP = TYPE == 1;
620
+ var IS_FILTER = TYPE == 2;
621
+ var IS_SOME = TYPE == 3;
622
+ var IS_EVERY = TYPE == 4;
623
+ var IS_FIND_INDEX = TYPE == 6;
624
+ var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
625
+ return function ($this, callbackfn, that, specificCreate) {
626
+ var O = toObject($this);
627
+ var self = indexedObject(O);
628
+ var boundFunction = functionBindContext(callbackfn, that, 3);
629
+ var length = toLength(self.length);
630
+ var index = 0;
631
+ var create = specificCreate || arraySpeciesCreate;
632
+ var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
633
+ var value, result;
634
+ for (;length > index; index++) if (NO_HOLES || index in self) {
635
+ value = self[index];
636
+ result = boundFunction(value, index, O);
637
+ if (TYPE) {
638
+ if (IS_MAP) target[index] = result; // map
639
+ else if (result) switch (TYPE) {
640
+ case 3: return true; // some
641
+ case 5: return value; // find
642
+ case 6: return index; // findIndex
643
+ case 2: push.call(target, value); // filter
644
+ } else if (IS_EVERY) return false; // every
645
+ }
646
+ }
647
+ return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
648
+ };
649
+ };
650
+
651
+ var arrayIteration = {
652
+ // `Array.prototype.forEach` method
653
+ // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
654
+ forEach: createMethod$1(0),
655
+ // `Array.prototype.map` method
656
+ // https://tc39.github.io/ecma262/#sec-array.prototype.map
657
+ map: createMethod$1(1),
658
+ // `Array.prototype.filter` method
659
+ // https://tc39.github.io/ecma262/#sec-array.prototype.filter
660
+ filter: createMethod$1(2),
661
+ // `Array.prototype.some` method
662
+ // https://tc39.github.io/ecma262/#sec-array.prototype.some
663
+ some: createMethod$1(3),
664
+ // `Array.prototype.every` method
665
+ // https://tc39.github.io/ecma262/#sec-array.prototype.every
666
+ every: createMethod$1(4),
667
+ // `Array.prototype.find` method
668
+ // https://tc39.github.io/ecma262/#sec-array.prototype.find
669
+ find: createMethod$1(5),
670
+ // `Array.prototype.findIndex` method
671
+ // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
672
+ findIndex: createMethod$1(6)
673
+ };
674
+
675
+ var arrayMethodIsStrict = function (METHOD_NAME, argument) {
676
+ var method = [][METHOD_NAME];
677
+ return !!method && fails(function () {
678
+ // eslint-disable-next-line no-useless-call,no-throw-literal
679
+ method.call(null, argument || function () { throw 1; }, 1);
680
+ });
681
+ };
682
+
683
+ var defineProperty = Object.defineProperty;
684
+ var cache = {};
685
+
686
+ var thrower = function (it) { throw it; };
687
+
688
+ var arrayMethodUsesToLength = function (METHOD_NAME, options) {
689
+ if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
690
+ if (!options) options = {};
691
+ var method = [][METHOD_NAME];
692
+ var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
693
+ var argument0 = has(options, 0) ? options[0] : thrower;
694
+ var argument1 = has(options, 1) ? options[1] : undefined;
695
+
696
+ return cache[METHOD_NAME] = !!method && !fails(function () {
697
+ if (ACCESSORS && !descriptors) return true;
698
+ var O = { length: -1 };
699
+
700
+ if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
701
+ else O[1] = 1;
702
+
703
+ method.call(O, argument0, argument1);
704
+ });
705
+ };
706
+
707
+ var $forEach = arrayIteration.forEach;
708
+
709
+
710
+
711
+ var STRICT_METHOD = arrayMethodIsStrict('forEach');
712
+ var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
713
+
714
+ // `Array.prototype.forEach` method implementation
715
+ // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
716
+ var arrayForEach = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
717
+ return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
718
+ } : [].forEach;
719
+
720
+ // `Array.prototype.forEach` method
721
+ // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
722
+ _export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, {
723
+ forEach: arrayForEach
724
+ });
725
+
726
+ // `Object.keys` method
727
+ // https://tc39.github.io/ecma262/#sec-object.keys
728
+ var objectKeys = Object.keys || function keys(O) {
729
+ return objectKeysInternal(O, enumBugKeys);
730
+ };
731
+
732
+ // `Object.defineProperties` method
733
+ // https://tc39.github.io/ecma262/#sec-object.defineproperties
734
+ var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
735
+ anObject(O);
736
+ var keys = objectKeys(Properties);
737
+ var length = keys.length;
738
+ var index = 0;
739
+ var key;
740
+ while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
741
+ return O;
742
+ };
743
+
744
+ var html = getBuiltIn('document', 'documentElement');
745
+
746
+ var GT = '>';
747
+ var LT = '<';
748
+ var PROTOTYPE = 'prototype';
749
+ var SCRIPT = 'script';
750
+ var IE_PROTO = sharedKey('IE_PROTO');
751
+
752
+ var EmptyConstructor = function () { /* empty */ };
753
+
754
+ var scriptTag = function (content) {
755
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
756
+ };
757
+
758
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
759
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
760
+ activeXDocument.write(scriptTag(''));
761
+ activeXDocument.close();
762
+ var temp = activeXDocument.parentWindow.Object;
763
+ activeXDocument = null; // avoid memory leak
764
+ return temp;
765
+ };
766
+
767
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
768
+ var NullProtoObjectViaIFrame = function () {
769
+ // Thrash, waste and sodomy: IE GC bug
770
+ var iframe = documentCreateElement('iframe');
771
+ var JS = 'java' + SCRIPT + ':';
772
+ var iframeDocument;
773
+ iframe.style.display = 'none';
774
+ html.appendChild(iframe);
775
+ // https://github.com/zloirock/core-js/issues/475
776
+ iframe.src = String(JS);
777
+ iframeDocument = iframe.contentWindow.document;
778
+ iframeDocument.open();
779
+ iframeDocument.write(scriptTag('document.F=Object'));
780
+ iframeDocument.close();
781
+ return iframeDocument.F;
782
+ };
783
+
784
+ // Check for document.domain and active x support
785
+ // No need to use active x approach when document.domain is not set
786
+ // see https://github.com/es-shims/es5-shim/issues/150
787
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
788
+ // avoid IE GC bug
789
+ var activeXDocument;
790
+ var NullProtoObject = function () {
791
+ try {
792
+ /* global ActiveXObject */
793
+ activeXDocument = document.domain && new ActiveXObject('htmlfile');
794
+ } catch (error) { /* ignore */ }
795
+ NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
796
+ var length = enumBugKeys.length;
797
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
798
+ return NullProtoObject();
799
+ };
800
+
801
+ hiddenKeys[IE_PROTO] = true;
802
+
803
+ // `Object.create` method
804
+ // https://tc39.github.io/ecma262/#sec-object.create
805
+ var objectCreate = Object.create || function create(O, Properties) {
806
+ var result;
807
+ if (O !== null) {
808
+ EmptyConstructor[PROTOTYPE] = anObject(O);
809
+ result = new EmptyConstructor();
810
+ EmptyConstructor[PROTOTYPE] = null;
811
+ // add "__proto__" for Object.getPrototypeOf polyfill
812
+ result[IE_PROTO] = O;
813
+ } else result = NullProtoObject();
814
+ return Properties === undefined ? result : objectDefineProperties(result, Properties);
815
+ };
816
+
817
+ var UNSCOPABLES = wellKnownSymbol('unscopables');
818
+ var ArrayPrototype = Array.prototype;
819
+
820
+ // Array.prototype[@@unscopables]
821
+ // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
822
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
823
+ objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
824
+ configurable: true,
825
+ value: objectCreate(null)
826
+ });
827
+ }
828
+
829
+ // add a key to Array.prototype[@@unscopables]
830
+ var addToUnscopables = function (key) {
831
+ ArrayPrototype[UNSCOPABLES][key] = true;
832
+ };
833
+
834
+ var iterators = {};
835
+
836
+ var correctPrototypeGetter = !fails(function () {
837
+ function F() { /* empty */ }
838
+ F.prototype.constructor = null;
839
+ return Object.getPrototypeOf(new F()) !== F.prototype;
840
+ });
841
+
842
+ var IE_PROTO$1 = sharedKey('IE_PROTO');
843
+ var ObjectPrototype = Object.prototype;
844
+
845
+ // `Object.getPrototypeOf` method
846
+ // https://tc39.github.io/ecma262/#sec-object.getprototypeof
847
+ var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
848
+ O = toObject(O);
849
+ if (has(O, IE_PROTO$1)) return O[IE_PROTO$1];
850
+ if (typeof O.constructor == 'function' && O instanceof O.constructor) {
851
+ return O.constructor.prototype;
852
+ } return O instanceof Object ? ObjectPrototype : null;
853
+ };
854
+
855
+ var ITERATOR = wellKnownSymbol('iterator');
856
+ var BUGGY_SAFARI_ITERATORS = false;
857
+
858
+ var returnThis = function () { return this; };
859
+
860
+ // `%IteratorPrototype%` object
861
+ // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
862
+ var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
863
+
864
+ if ([].keys) {
865
+ arrayIterator = [].keys();
866
+ // Safari 8 has buggy iterators w/o `next`
867
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
868
+ else {
869
+ PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
870
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
871
+ }
872
+ }
873
+
874
+ if (IteratorPrototype == undefined) IteratorPrototype = {};
875
+
876
+ // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
877
+ if ( !has(IteratorPrototype, ITERATOR)) {
878
+ createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
879
+ }
880
+
881
+ var iteratorsCore = {
882
+ IteratorPrototype: IteratorPrototype,
883
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
884
+ };
885
+
886
+ var defineProperty$1 = objectDefineProperty.f;
887
+
888
+
889
+
890
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
891
+
892
+ var setToStringTag = function (it, TAG, STATIC) {
893
+ if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
894
+ defineProperty$1(it, TO_STRING_TAG, { configurable: true, value: TAG });
895
+ }
896
+ };
897
+
898
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
899
+
900
+
901
+
902
+
903
+
904
+ var returnThis$1 = function () { return this; };
905
+
906
+ var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
907
+ var TO_STRING_TAG = NAME + ' Iterator';
908
+ IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(1, next) });
909
+ setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
910
+ iterators[TO_STRING_TAG] = returnThis$1;
911
+ return IteratorConstructor;
912
+ };
913
+
914
+ var aPossiblePrototype = function (it) {
915
+ if (!isObject(it) && it !== null) {
916
+ throw TypeError("Can't set " + String(it) + ' as a prototype');
917
+ } return it;
918
+ };
919
+
920
+ // `Object.setPrototypeOf` method
921
+ // https://tc39.github.io/ecma262/#sec-object.setprototypeof
922
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
923
+ /* eslint-disable no-proto */
924
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
925
+ var CORRECT_SETTER = false;
926
+ var test = {};
927
+ var setter;
928
+ try {
929
+ setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
930
+ setter.call(test, []);
931
+ CORRECT_SETTER = test instanceof Array;
932
+ } catch (error) { /* empty */ }
933
+ return function setPrototypeOf(O, proto) {
934
+ anObject(O);
935
+ aPossiblePrototype(proto);
936
+ if (CORRECT_SETTER) setter.call(O, proto);
937
+ else O.__proto__ = proto;
938
+ return O;
939
+ };
940
+ }() : undefined);
941
+
942
+ var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
943
+ var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS;
944
+ var ITERATOR$1 = wellKnownSymbol('iterator');
945
+ var KEYS = 'keys';
946
+ var VALUES = 'values';
947
+ var ENTRIES = 'entries';
948
+
949
+ var returnThis$2 = function () { return this; };
950
+
951
+ var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
952
+ createIteratorConstructor(IteratorConstructor, NAME, next);
953
+
954
+ var getIterationMethod = function (KIND) {
955
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
956
+ if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) return IterablePrototype[KIND];
957
+ switch (KIND) {
958
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
959
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
960
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
961
+ } return function () { return new IteratorConstructor(this); };
962
+ };
963
+
964
+ var TO_STRING_TAG = NAME + ' Iterator';
965
+ var INCORRECT_VALUES_NAME = false;
966
+ var IterablePrototype = Iterable.prototype;
967
+ var nativeIterator = IterablePrototype[ITERATOR$1]
968
+ || IterablePrototype['@@iterator']
969
+ || DEFAULT && IterablePrototype[DEFAULT];
970
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT);
971
+ var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
972
+ var CurrentIteratorPrototype, methods, KEY;
973
+
974
+ // fix native
975
+ if (anyNativeIterator) {
976
+ CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
977
+ if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) {
978
+ if ( objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) {
979
+ if (objectSetPrototypeOf) {
980
+ objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
981
+ } else if (typeof CurrentIteratorPrototype[ITERATOR$1] != 'function') {
982
+ createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR$1, returnThis$2);
983
+ }
984
+ }
985
+ // Set @@toStringTag to native iterators
986
+ setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
987
+ }
988
+ }
989
+
990
+ // fix Array#{values, @@iterator}.name in V8 / FF
991
+ if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
992
+ INCORRECT_VALUES_NAME = true;
993
+ defaultIterator = function values() { return nativeIterator.call(this); };
994
+ }
995
+
996
+ // define iterator
997
+ if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
998
+ createNonEnumerableProperty(IterablePrototype, ITERATOR$1, defaultIterator);
999
+ }
1000
+ iterators[NAME] = defaultIterator;
1001
+
1002
+ // export additional methods
1003
+ if (DEFAULT) {
1004
+ methods = {
1005
+ values: getIterationMethod(VALUES),
1006
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1007
+ entries: getIterationMethod(ENTRIES)
1008
+ };
1009
+ if (FORCED) for (KEY in methods) {
1010
+ if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1011
+ redefine(IterablePrototype, KEY, methods[KEY]);
1012
+ }
1013
+ } else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME }, methods);
1014
+ }
1015
+
1016
+ return methods;
1017
+ };
1018
+
1019
+ var ARRAY_ITERATOR = 'Array Iterator';
1020
+ var setInternalState = internalState.set;
1021
+ var getInternalState = internalState.getterFor(ARRAY_ITERATOR);
1022
+
1023
+ // `Array.prototype.entries` method
1024
+ // https://tc39.github.io/ecma262/#sec-array.prototype.entries
1025
+ // `Array.prototype.keys` method
1026
+ // https://tc39.github.io/ecma262/#sec-array.prototype.keys
1027
+ // `Array.prototype.values` method
1028
+ // https://tc39.github.io/ecma262/#sec-array.prototype.values
1029
+ // `Array.prototype[@@iterator]` method
1030
+ // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
1031
+ // `CreateArrayIterator` internal method
1032
+ // https://tc39.github.io/ecma262/#sec-createarrayiterator
1033
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1034
+ setInternalState(this, {
1035
+ type: ARRAY_ITERATOR,
1036
+ target: toIndexedObject(iterated), // target
1037
+ index: 0, // next index
1038
+ kind: kind // kind
1039
+ });
1040
+ // `%ArrayIteratorPrototype%.next` method
1041
+ // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
1042
+ }, function () {
1043
+ var state = getInternalState(this);
1044
+ var target = state.target;
1045
+ var kind = state.kind;
1046
+ var index = state.index++;
1047
+ if (!target || index >= target.length) {
1048
+ state.target = undefined;
1049
+ return { value: undefined, done: true };
1050
+ }
1051
+ if (kind == 'keys') return { value: index, done: false };
1052
+ if (kind == 'values') return { value: target[index], done: false };
1053
+ return { value: [index, target[index]], done: false };
1054
+ }, 'values');
1055
+
1056
+ // argumentsList[@@iterator] is %ArrayProto_values%
1057
+ // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject
1058
+ // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject
1059
+ iterators.Arguments = iterators.Array;
1060
+
1061
+ // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
1062
+ addToUnscopables('keys');
1063
+ addToUnscopables('values');
1064
+ addToUnscopables('entries');
1065
+
1066
+ var freezing = !fails(function () {
1067
+ return Object.isExtensible(Object.preventExtensions({}));
1068
+ });
1069
+
1070
+ var internalMetadata = createCommonjsModule(function (module) {
1071
+ var defineProperty = objectDefineProperty.f;
1072
+
1073
+
1074
+
1075
+ var METADATA = uid('meta');
1076
+ var id = 0;
1077
+
1078
+ var isExtensible = Object.isExtensible || function () {
1079
+ return true;
1080
+ };
1081
+
1082
+ var setMetadata = function (it) {
1083
+ defineProperty(it, METADATA, { value: {
1084
+ objectID: 'O' + ++id, // object ID
1085
+ weakData: {} // weak collections IDs
1086
+ } });
1087
+ };
1088
+
1089
+ var fastKey = function (it, create) {
1090
+ // return a primitive with prefix
1091
+ if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
1092
+ if (!has(it, METADATA)) {
1093
+ // can't set metadata to uncaught frozen object
1094
+ if (!isExtensible(it)) return 'F';
1095
+ // not necessary to add metadata
1096
+ if (!create) return 'E';
1097
+ // add missing metadata
1098
+ setMetadata(it);
1099
+ // return object ID
1100
+ } return it[METADATA].objectID;
1101
+ };
1102
+
1103
+ var getWeakData = function (it, create) {
1104
+ if (!has(it, METADATA)) {
1105
+ // can't set metadata to uncaught frozen object
1106
+ if (!isExtensible(it)) return true;
1107
+ // not necessary to add metadata
1108
+ if (!create) return false;
1109
+ // add missing metadata
1110
+ setMetadata(it);
1111
+ // return the store of weak collections IDs
1112
+ } return it[METADATA].weakData;
1113
+ };
1114
+
1115
+ // add metadata on freeze-family methods calling
1116
+ var onFreeze = function (it) {
1117
+ if (freezing && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);
1118
+ return it;
1119
+ };
1120
+
1121
+ var meta = module.exports = {
1122
+ REQUIRED: false,
1123
+ fastKey: fastKey,
1124
+ getWeakData: getWeakData,
1125
+ onFreeze: onFreeze
1126
+ };
1127
+
1128
+ hiddenKeys[METADATA] = true;
1129
+ });
1130
+
1131
+ var ITERATOR$2 = wellKnownSymbol('iterator');
1132
+ var ArrayPrototype$1 = Array.prototype;
1133
+
1134
+ // check on default Array iterator
1135
+ var isArrayIteratorMethod = function (it) {
1136
+ return it !== undefined && (iterators.Array === it || ArrayPrototype$1[ITERATOR$2] === it);
1137
+ };
1138
+
1139
+ var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
1140
+ var test = {};
1141
+
1142
+ test[TO_STRING_TAG$1] = 'z';
1143
+
1144
+ var toStringTagSupport = String(test) === '[object z]';
1145
+
1146
+ var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
1147
+ // ES3 wrong here
1148
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1149
+
1150
+ // fallback for IE11 Script Access Denied error
1151
+ var tryGet = function (it, key) {
1152
+ try {
1153
+ return it[key];
1154
+ } catch (error) { /* empty */ }
1155
+ };
1156
+
1157
+ // getting tag from ES6+ `Object.prototype.toString`
1158
+ var classof = toStringTagSupport ? classofRaw : function (it) {
1159
+ var O, tag, result;
1160
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1161
+ // @@toStringTag case
1162
+ : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$2)) == 'string' ? tag
1163
+ // builtinTag case
1164
+ : CORRECT_ARGUMENTS ? classofRaw(O)
1165
+ // ES3 arguments fallback
1166
+ : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
1167
+ };
1168
+
1169
+ var ITERATOR$3 = wellKnownSymbol('iterator');
1170
+
1171
+ var getIteratorMethod = function (it) {
1172
+ if (it != undefined) return it[ITERATOR$3]
1173
+ || it['@@iterator']
1174
+ || iterators[classof(it)];
1175
+ };
1176
+
1177
+ // call something on iterator step with safe closing on error
1178
+ var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
1179
+ try {
1180
+ return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
1181
+ // 7.4.6 IteratorClose(iterator, completion)
1182
+ } catch (error) {
1183
+ var returnMethod = iterator['return'];
1184
+ if (returnMethod !== undefined) anObject(returnMethod.call(iterator));
1185
+ throw error;
1186
+ }
1187
+ };
1188
+
1189
+ var iterate_1 = createCommonjsModule(function (module) {
1190
+ var Result = function (stopped, result) {
1191
+ this.stopped = stopped;
1192
+ this.result = result;
1193
+ };
1194
+
1195
+ var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
1196
+ var boundFunction = functionBindContext(fn, that, AS_ENTRIES ? 2 : 1);
1197
+ var iterator, iterFn, index, length, result, next, step;
1198
+
1199
+ if (IS_ITERATOR) {
1200
+ iterator = iterable;
1201
+ } else {
1202
+ iterFn = getIteratorMethod(iterable);
1203
+ if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
1204
+ // optimisation for array iterators
1205
+ if (isArrayIteratorMethod(iterFn)) {
1206
+ for (index = 0, length = toLength(iterable.length); length > index; index++) {
1207
+ result = AS_ENTRIES
1208
+ ? boundFunction(anObject(step = iterable[index])[0], step[1])
1209
+ : boundFunction(iterable[index]);
1210
+ if (result && result instanceof Result) return result;
1211
+ } return new Result(false);
1212
+ }
1213
+ iterator = iterFn.call(iterable);
1214
+ }
1215
+
1216
+ next = iterator.next;
1217
+ while (!(step = next.call(iterator)).done) {
1218
+ result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);
1219
+ if (typeof result == 'object' && result && result instanceof Result) return result;
1220
+ } return new Result(false);
1221
+ };
1222
+
1223
+ iterate.stop = function (result) {
1224
+ return new Result(true, result);
1225
+ };
1226
+ });
1227
+
1228
+ var anInstance = function (it, Constructor, name) {
1229
+ if (!(it instanceof Constructor)) {
1230
+ throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
1231
+ } return it;
1232
+ };
1233
+
1234
+ var ITERATOR$4 = wellKnownSymbol('iterator');
1235
+ var SAFE_CLOSING = false;
1236
+
1237
+ try {
1238
+ var called = 0;
1239
+ var iteratorWithReturn = {
1240
+ next: function () {
1241
+ return { done: !!called++ };
1242
+ },
1243
+ 'return': function () {
1244
+ SAFE_CLOSING = true;
1245
+ }
1246
+ };
1247
+ iteratorWithReturn[ITERATOR$4] = function () {
1248
+ return this;
1249
+ };
1250
+ // eslint-disable-next-line no-throw-literal
1251
+ Array.from(iteratorWithReturn, function () { throw 2; });
1252
+ } catch (error) { /* empty */ }
1253
+
1254
+ var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
1255
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
1256
+ var ITERATION_SUPPORT = false;
1257
+ try {
1258
+ var object = {};
1259
+ object[ITERATOR$4] = function () {
1260
+ return {
1261
+ next: function () {
1262
+ return { done: ITERATION_SUPPORT = true };
1263
+ }
1264
+ };
1265
+ };
1266
+ exec(object);
1267
+ } catch (error) { /* empty */ }
1268
+ return ITERATION_SUPPORT;
1269
+ };
1270
+
1271
+ // makes subclassing work correct for wrapped built-ins
1272
+ var inheritIfRequired = function ($this, dummy, Wrapper) {
1273
+ var NewTarget, NewTargetPrototype;
1274
+ if (
1275
+ // it can work only with native `setPrototypeOf`
1276
+ objectSetPrototypeOf &&
1277
+ // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
1278
+ typeof (NewTarget = dummy.constructor) == 'function' &&
1279
+ NewTarget !== Wrapper &&
1280
+ isObject(NewTargetPrototype = NewTarget.prototype) &&
1281
+ NewTargetPrototype !== Wrapper.prototype
1282
+ ) objectSetPrototypeOf($this, NewTargetPrototype);
1283
+ return $this;
1284
+ };
1285
+
1286
+ var collection = function (CONSTRUCTOR_NAME, wrapper, common) {
1287
+ var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
1288
+ var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
1289
+ var ADDER = IS_MAP ? 'set' : 'add';
1290
+ var NativeConstructor = global_1[CONSTRUCTOR_NAME];
1291
+ var NativePrototype = NativeConstructor && NativeConstructor.prototype;
1292
+ var Constructor = NativeConstructor;
1293
+ var exported = {};
1294
+
1295
+ var fixMethod = function (KEY) {
1296
+ var nativeMethod = NativePrototype[KEY];
1297
+ redefine(NativePrototype, KEY,
1298
+ KEY == 'add' ? function add(value) {
1299
+ nativeMethod.call(this, value === 0 ? 0 : value);
1300
+ return this;
1301
+ } : KEY == 'delete' ? function (key) {
1302
+ return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
1303
+ } : KEY == 'get' ? function get(key) {
1304
+ return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
1305
+ } : KEY == 'has' ? function has(key) {
1306
+ return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
1307
+ } : function set(key, value) {
1308
+ nativeMethod.call(this, key === 0 ? 0 : key, value);
1309
+ return this;
1310
+ }
1311
+ );
1312
+ };
1313
+
1314
+ // eslint-disable-next-line max-len
1315
+ if (isForced_1(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
1316
+ new NativeConstructor().entries().next();
1317
+ })))) {
1318
+ // create collection constructor
1319
+ Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
1320
+ internalMetadata.REQUIRED = true;
1321
+ } else if (isForced_1(CONSTRUCTOR_NAME, true)) {
1322
+ var instance = new Constructor();
1323
+ // early implementations not supports chaining
1324
+ var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
1325
+ // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
1326
+ var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
1327
+ // most early implementations doesn't supports iterables, most modern - not close it correctly
1328
+ // eslint-disable-next-line no-new
1329
+ var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
1330
+ // for early implementations -0 and +0 not the same
1331
+ var BUGGY_ZERO = !IS_WEAK && fails(function () {
1332
+ // V8 ~ Chromium 42- fails only with 5+ elements
1333
+ var $instance = new NativeConstructor();
1334
+ var index = 5;
1335
+ while (index--) $instance[ADDER](index, index);
1336
+ return !$instance.has(-0);
1337
+ });
1338
+
1339
+ if (!ACCEPT_ITERABLES) {
1340
+ Constructor = wrapper(function (dummy, iterable) {
1341
+ anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
1342
+ var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
1343
+ if (iterable != undefined) iterate_1(iterable, that[ADDER], that, IS_MAP);
1344
+ return that;
1345
+ });
1346
+ Constructor.prototype = NativePrototype;
1347
+ NativePrototype.constructor = Constructor;
1348
+ }
1349
+
1350
+ if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
1351
+ fixMethod('delete');
1352
+ fixMethod('has');
1353
+ IS_MAP && fixMethod('get');
1354
+ }
1355
+
1356
+ if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
1357
+
1358
+ // weak collections should not contains .clear method
1359
+ if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
1360
+ }
1361
+
1362
+ exported[CONSTRUCTOR_NAME] = Constructor;
1363
+ _export({ global: true, forced: Constructor != NativeConstructor }, exported);
1364
+
1365
+ setToStringTag(Constructor, CONSTRUCTOR_NAME);
1366
+
1367
+ if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
1368
+
1369
+ return Constructor;
1370
+ };
1371
+
1372
+ var redefineAll = function (target, src, options) {
1373
+ for (var key in src) redefine(target, key, src[key], options);
1374
+ return target;
1375
+ };
1376
+
1377
+ var SPECIES$1 = wellKnownSymbol('species');
1378
+
1379
+ var setSpecies = function (CONSTRUCTOR_NAME) {
1380
+ var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
1381
+ var defineProperty = objectDefineProperty.f;
1382
+
1383
+ if (descriptors && Constructor && !Constructor[SPECIES$1]) {
1384
+ defineProperty(Constructor, SPECIES$1, {
1385
+ configurable: true,
1386
+ get: function () { return this; }
1387
+ });
1388
+ }
1389
+ };
1390
+
1391
+ var defineProperty$2 = objectDefineProperty.f;
1392
+
1393
+
1394
+
1395
+
1396
+
1397
+
1398
+
1399
+
1400
+ var fastKey = internalMetadata.fastKey;
1401
+
1402
+
1403
+ var setInternalState$1 = internalState.set;
1404
+ var internalStateGetterFor = internalState.getterFor;
1405
+
1406
+ var collectionStrong = {
1407
+ getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
1408
+ var C = wrapper(function (that, iterable) {
1409
+ anInstance(that, C, CONSTRUCTOR_NAME);
1410
+ setInternalState$1(that, {
1411
+ type: CONSTRUCTOR_NAME,
1412
+ index: objectCreate(null),
1413
+ first: undefined,
1414
+ last: undefined,
1415
+ size: 0
1416
+ });
1417
+ if (!descriptors) that.size = 0;
1418
+ if (iterable != undefined) iterate_1(iterable, that[ADDER], that, IS_MAP);
1419
+ });
1420
+
1421
+ var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
1422
+
1423
+ var define = function (that, key, value) {
1424
+ var state = getInternalState(that);
1425
+ var entry = getEntry(that, key);
1426
+ var previous, index;
1427
+ // change existing entry
1428
+ if (entry) {
1429
+ entry.value = value;
1430
+ // create new entry
1431
+ } else {
1432
+ state.last = entry = {
1433
+ index: index = fastKey(key, true),
1434
+ key: key,
1435
+ value: value,
1436
+ previous: previous = state.last,
1437
+ next: undefined,
1438
+ removed: false
1439
+ };
1440
+ if (!state.first) state.first = entry;
1441
+ if (previous) previous.next = entry;
1442
+ if (descriptors) state.size++;
1443
+ else that.size++;
1444
+ // add to index
1445
+ if (index !== 'F') state.index[index] = entry;
1446
+ } return that;
1447
+ };
1448
+
1449
+ var getEntry = function (that, key) {
1450
+ var state = getInternalState(that);
1451
+ // fast case
1452
+ var index = fastKey(key);
1453
+ var entry;
1454
+ if (index !== 'F') return state.index[index];
1455
+ // frozen object case
1456
+ for (entry = state.first; entry; entry = entry.next) {
1457
+ if (entry.key == key) return entry;
1458
+ }
1459
+ };
1460
+
1461
+ redefineAll(C.prototype, {
1462
+ // 23.1.3.1 Map.prototype.clear()
1463
+ // 23.2.3.2 Set.prototype.clear()
1464
+ clear: function clear() {
1465
+ var that = this;
1466
+ var state = getInternalState(that);
1467
+ var data = state.index;
1468
+ var entry = state.first;
1469
+ while (entry) {
1470
+ entry.removed = true;
1471
+ if (entry.previous) entry.previous = entry.previous.next = undefined;
1472
+ delete data[entry.index];
1473
+ entry = entry.next;
1474
+ }
1475
+ state.first = state.last = undefined;
1476
+ if (descriptors) state.size = 0;
1477
+ else that.size = 0;
1478
+ },
1479
+ // 23.1.3.3 Map.prototype.delete(key)
1480
+ // 23.2.3.4 Set.prototype.delete(value)
1481
+ 'delete': function (key) {
1482
+ var that = this;
1483
+ var state = getInternalState(that);
1484
+ var entry = getEntry(that, key);
1485
+ if (entry) {
1486
+ var next = entry.next;
1487
+ var prev = entry.previous;
1488
+ delete state.index[entry.index];
1489
+ entry.removed = true;
1490
+ if (prev) prev.next = next;
1491
+ if (next) next.previous = prev;
1492
+ if (state.first == entry) state.first = next;
1493
+ if (state.last == entry) state.last = prev;
1494
+ if (descriptors) state.size--;
1495
+ else that.size--;
1496
+ } return !!entry;
1497
+ },
1498
+ // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
1499
+ // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
1500
+ forEach: function forEach(callbackfn /* , that = undefined */) {
1501
+ var state = getInternalState(this);
1502
+ var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
1503
+ var entry;
1504
+ while (entry = entry ? entry.next : state.first) {
1505
+ boundFunction(entry.value, entry.key, this);
1506
+ // revert to the last existing entry
1507
+ while (entry && entry.removed) entry = entry.previous;
1508
+ }
1509
+ },
1510
+ // 23.1.3.7 Map.prototype.has(key)
1511
+ // 23.2.3.7 Set.prototype.has(value)
1512
+ has: function has(key) {
1513
+ return !!getEntry(this, key);
1514
+ }
1515
+ });
1516
+
1517
+ redefineAll(C.prototype, IS_MAP ? {
1518
+ // 23.1.3.6 Map.prototype.get(key)
1519
+ get: function get(key) {
1520
+ var entry = getEntry(this, key);
1521
+ return entry && entry.value;
1522
+ },
1523
+ // 23.1.3.9 Map.prototype.set(key, value)
1524
+ set: function set(key, value) {
1525
+ return define(this, key === 0 ? 0 : key, value);
1526
+ }
1527
+ } : {
1528
+ // 23.2.3.1 Set.prototype.add(value)
1529
+ add: function add(value) {
1530
+ return define(this, value = value === 0 ? 0 : value, value);
1531
+ }
1532
+ });
1533
+ if (descriptors) defineProperty$2(C.prototype, 'size', {
1534
+ get: function () {
1535
+ return getInternalState(this).size;
1536
+ }
1537
+ });
1538
+ return C;
1539
+ },
1540
+ setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {
1541
+ var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
1542
+ var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
1543
+ var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
1544
+ // add .keys, .values, .entries, [@@iterator]
1545
+ // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
1546
+ defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {
1547
+ setInternalState$1(this, {
1548
+ type: ITERATOR_NAME,
1549
+ target: iterated,
1550
+ state: getInternalCollectionState(iterated),
1551
+ kind: kind,
1552
+ last: undefined
1553
+ });
1554
+ }, function () {
1555
+ var state = getInternalIteratorState(this);
1556
+ var kind = state.kind;
1557
+ var entry = state.last;
1558
+ // revert to the last existing entry
1559
+ while (entry && entry.removed) entry = entry.previous;
1560
+ // get next entry
1561
+ if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
1562
+ // or finish the iteration
1563
+ state.target = undefined;
1564
+ return { value: undefined, done: true };
1565
+ }
1566
+ // return step by kind
1567
+ if (kind == 'keys') return { value: entry.key, done: false };
1568
+ if (kind == 'values') return { value: entry.value, done: false };
1569
+ return { value: [entry.key, entry.value], done: false };
1570
+ }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
1571
+
1572
+ // add [@@species], 23.1.2.2, 23.2.2.2
1573
+ setSpecies(CONSTRUCTOR_NAME);
1574
+ }
1575
+ };
1576
+
1577
+ // `Map` constructor
1578
+ // https://tc39.github.io/ecma262/#sec-map-objects
1579
+ var es_map = collection('Map', function (init) {
1580
+ return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
1581
+ }, collectionStrong);
1582
+
1583
+ var nativeAssign = Object.assign;
1584
+ var defineProperty$3 = Object.defineProperty;
1585
+
1586
+ // `Object.assign` method
1587
+ // https://tc39.github.io/ecma262/#sec-object.assign
1588
+ var objectAssign = !nativeAssign || fails(function () {
1589
+ // should have correct order of operations (Edge bug)
1590
+ if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$3({}, 'a', {
1591
+ enumerable: true,
1592
+ get: function () {
1593
+ defineProperty$3(this, 'b', {
1594
+ value: 3,
1595
+ enumerable: false
1596
+ });
1597
+ }
1598
+ }), { b: 2 })).b !== 1) return true;
1599
+ // should work with symbols and should have deterministic property order (V8 bug)
1600
+ var A = {};
1601
+ var B = {};
1602
+ // eslint-disable-next-line no-undef
1603
+ var symbol = Symbol();
1604
+ var alphabet = 'abcdefghijklmnopqrst';
1605
+ A[symbol] = 7;
1606
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1607
+ return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
1608
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
1609
+ var T = toObject(target);
1610
+ var argumentsLength = arguments.length;
1611
+ var index = 1;
1612
+ var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
1613
+ var propertyIsEnumerable = objectPropertyIsEnumerable.f;
1614
+ while (argumentsLength > index) {
1615
+ var S = indexedObject(arguments[index++]);
1616
+ var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
1617
+ var length = keys.length;
1618
+ var j = 0;
1619
+ var key;
1620
+ while (length > j) {
1621
+ key = keys[j++];
1622
+ if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
1623
+ }
1624
+ } return T;
1625
+ } : nativeAssign;
1626
+
1627
+ // `Object.assign` method
1628
+ // https://tc39.github.io/ecma262/#sec-object.assign
1629
+ _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
1630
+ assign: objectAssign
1631
+ });
1632
+
1633
+ // `Object.prototype.toString` method implementation
1634
+ // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
1635
+ var objectToString = toStringTagSupport ? {}.toString : function toString() {
1636
+ return '[object ' + classof(this) + ']';
1637
+ };
1638
+
1639
+ // `Object.prototype.toString` method
1640
+ // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
1641
+ if (!toStringTagSupport) {
1642
+ redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
1643
+ }
1644
+
1645
+ // `String.prototype.{ codePointAt, at }` methods implementation
1646
+ var createMethod$2 = function (CONVERT_TO_STRING) {
1647
+ return function ($this, pos) {
1648
+ var S = String(requireObjectCoercible($this));
1649
+ var position = toInteger(pos);
1650
+ var size = S.length;
1651
+ var first, second;
1652
+ if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1653
+ first = S.charCodeAt(position);
1654
+ return first < 0xD800 || first > 0xDBFF || position + 1 === size
1655
+ || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
1656
+ ? CONVERT_TO_STRING ? S.charAt(position) : first
1657
+ : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1658
+ };
1659
+ };
1660
+
1661
+ var stringMultibyte = {
1662
+ // `String.prototype.codePointAt` method
1663
+ // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
1664
+ codeAt: createMethod$2(false),
1665
+ // `String.prototype.at` method
1666
+ // https://github.com/mathiasbynens/String.prototype.at
1667
+ charAt: createMethod$2(true)
1668
+ };
1669
+
1670
+ var charAt = stringMultibyte.charAt;
1671
+
1672
+
1673
+
1674
+ var STRING_ITERATOR = 'String Iterator';
1675
+ var setInternalState$2 = internalState.set;
1676
+ var getInternalState$1 = internalState.getterFor(STRING_ITERATOR);
1677
+
1678
+ // `String.prototype[@@iterator]` method
1679
+ // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
1680
+ defineIterator(String, 'String', function (iterated) {
1681
+ setInternalState$2(this, {
1682
+ type: STRING_ITERATOR,
1683
+ string: String(iterated),
1684
+ index: 0
1685
+ });
1686
+ // `%StringIteratorPrototype%.next` method
1687
+ // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
1688
+ }, function next() {
1689
+ var state = getInternalState$1(this);
1690
+ var string = state.string;
1691
+ var index = state.index;
1692
+ var point;
1693
+ if (index >= string.length) return { value: undefined, done: true };
1694
+ point = charAt(string, index);
1695
+ state.index += point.length;
1696
+ return { value: point, done: false };
1697
+ });
1698
+
1699
+ // iterable DOM collections
1700
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1701
+ var domIterables = {
1702
+ CSSRuleList: 0,
1703
+ CSSStyleDeclaration: 0,
1704
+ CSSValueList: 0,
1705
+ ClientRectList: 0,
1706
+ DOMRectList: 0,
1707
+ DOMStringList: 0,
1708
+ DOMTokenList: 1,
1709
+ DataTransferItemList: 0,
1710
+ FileList: 0,
1711
+ HTMLAllCollection: 0,
1712
+ HTMLCollection: 0,
1713
+ HTMLFormElement: 0,
1714
+ HTMLSelectElement: 0,
1715
+ MediaList: 0,
1716
+ MimeTypeArray: 0,
1717
+ NamedNodeMap: 0,
1718
+ NodeList: 1,
1719
+ PaintRequestList: 0,
1720
+ Plugin: 0,
1721
+ PluginArray: 0,
1722
+ SVGLengthList: 0,
1723
+ SVGNumberList: 0,
1724
+ SVGPathSegList: 0,
1725
+ SVGPointList: 0,
1726
+ SVGStringList: 0,
1727
+ SVGTransformList: 0,
1728
+ SourceBufferList: 0,
1729
+ StyleSheetList: 0,
1730
+ TextTrackCueList: 0,
1731
+ TextTrackList: 0,
1732
+ TouchList: 0
1733
+ };
1734
+
1735
+ for (var COLLECTION_NAME in domIterables) {
1736
+ var Collection = global_1[COLLECTION_NAME];
1737
+ var CollectionPrototype = Collection && Collection.prototype;
1738
+ // some Chrome versions have non-configurable methods on DOMTokenList
1739
+ if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
1740
+ createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
1741
+ } catch (error) {
1742
+ CollectionPrototype.forEach = arrayForEach;
1743
+ }
1744
+ }
1745
+
1746
+ var ITERATOR$5 = wellKnownSymbol('iterator');
1747
+ var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag');
1748
+ var ArrayValues = es_array_iterator.values;
1749
+
1750
+ for (var COLLECTION_NAME$1 in domIterables) {
1751
+ var Collection$1 = global_1[COLLECTION_NAME$1];
1752
+ var CollectionPrototype$1 = Collection$1 && Collection$1.prototype;
1753
+ if (CollectionPrototype$1) {
1754
+ // some Chrome versions have non-configurable methods on DOMTokenList
1755
+ if (CollectionPrototype$1[ITERATOR$5] !== ArrayValues) try {
1756
+ createNonEnumerableProperty(CollectionPrototype$1, ITERATOR$5, ArrayValues);
1757
+ } catch (error) {
1758
+ CollectionPrototype$1[ITERATOR$5] = ArrayValues;
1759
+ }
1760
+ if (!CollectionPrototype$1[TO_STRING_TAG$3]) {
1761
+ createNonEnumerableProperty(CollectionPrototype$1, TO_STRING_TAG$3, COLLECTION_NAME$1);
1762
+ }
1763
+ if (domIterables[COLLECTION_NAME$1]) for (var METHOD_NAME in es_array_iterator) {
1764
+ // some Chrome versions have non-configurable methods on DOMTokenList
1765
+ if (CollectionPrototype$1[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try {
1766
+ createNonEnumerableProperty(CollectionPrototype$1, METHOD_NAME, es_array_iterator[METHOD_NAME]);
1767
+ } catch (error) {
1768
+ CollectionPrototype$1[METHOD_NAME] = es_array_iterator[METHOD_NAME];
1769
+ }
1770
+ }
1771
+ }
1772
+ }
1773
+
1774
+ function _unsupportedIterableToArray(o, minLen) {
1775
+ if (!o) return;
1776
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1777
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1778
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1779
+ if (n === "Map" || n === "Set") return Array.from(o);
1780
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1781
+ }
1782
+
1783
+ function _arrayLikeToArray(arr, len) {
1784
+ if (len == null || len > arr.length) len = arr.length;
1785
+
1786
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
1787
+
1788
+ return arr2;
1789
+ }
1790
+
1791
+ function _createForOfIteratorHelper(o, allowArrayLike) {
1792
+ var it;
1793
+
1794
+ if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
1795
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
1796
+ if (it) o = it;
1797
+ var i = 0;
1798
+
1799
+ var F = function () {};
1800
+
1801
+ return {
1802
+ s: F,
1803
+ n: function () {
1804
+ if (i >= o.length) return {
1805
+ done: true
1806
+ };
1807
+ return {
1808
+ done: false,
1809
+ value: o[i++]
1810
+ };
1811
+ },
1812
+ e: function (e) {
1813
+ throw e;
1814
+ },
1815
+ f: F
1816
+ };
1817
+ }
1818
+
1819
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1820
+ }
1821
+
1822
+ var normalCompletion = true,
1823
+ didErr = false,
1824
+ err;
1825
+ return {
1826
+ s: function () {
1827
+ it = o[Symbol.iterator]();
1828
+ },
1829
+ n: function () {
1830
+ var step = it.next();
1831
+ normalCompletion = step.done;
1832
+ return step;
1833
+ },
1834
+ e: function (e) {
1835
+ didErr = true;
1836
+ err = e;
1837
+ },
1838
+ f: function () {
1839
+ try {
1840
+ if (!normalCompletion && it.return != null) it.return();
1841
+ } finally {
1842
+ if (didErr) throw err;
1843
+ }
1844
+ }
1845
+ };
1846
+ }
1847
+
1848
+ var editMarkerDefinitions;
1849
+ var parentWindow = parent;
1850
+ /********************************************************************************************/
1851
+
1852
+ /* Helper Functions */
1853
+
1854
+ function getOffset(element) {
1855
+ var offset = {
1856
+ left: 0,
1857
+ top: 0
1858
+ };
1859
+
1860
+ do {
1861
+ if (!isNaN(element.offsetLeft)) {
1862
+ offset.left += element.offsetLeft;
1863
+ offset.top += element.offsetTop;
1864
+ }
1865
+ } while (element = element.offsetParent);
1866
+
1867
+ return offset;
1868
+ }
1869
+
1870
+ var eventListenerHash = new Map();
1871
+
1872
+ function unbindAllEventListeners(element) {
1873
+ if (eventListenerHash.has(element)) {
1874
+ var elementListenerHash = eventListenerHash.get(element);
1875
+ elementListenerHash.forEach(function (listener, eventName) {
1876
+ element.removeEventListener(eventName, listener);
1877
+ });
1878
+ elementListenerHash.clear();
1879
+ }
1880
+ }
1881
+
1882
+ function addEventListener(element, eventName, listener) {
1883
+ if (eventListenerHash.has(element)) {
1884
+ var _elementListenerHash = eventListenerHash.get(element);
1885
+
1886
+ var eventListenerFunction = _elementListenerHash.get(eventName);
1887
+
1888
+ if (eventListenerFunction) {
1889
+ element.removeEventListener(eventName, eventListenerFunction);
1890
+
1891
+ _elementListenerHash.delete(eventName);
1892
+ }
1893
+ }
1894
+
1895
+ element.addEventListener(eventName, listener);
1896
+
1897
+ if (!eventListenerHash.has(element)) {
1898
+ eventListenerHash.set(element, new Map());
1899
+ }
1900
+
1901
+ var elementListenerHash = eventListenerHash.get(element);
1902
+ elementListenerHash.set(eventName, listener);
1903
+ }
1904
+ /********************************************************************************************/
1905
+
1906
+ /* Global Functions */
1907
+
1908
+
1909
+ function findInfoFromClassName(element, regexp) {
1910
+ var _a;
1911
+ var matches = ((_a = element === null || element === void 0 ? void 0 : element.getAttribute("class")) !== null && _a !== void 0 ? _a : "").match(regexp);
1912
+
1913
+ if (matches && matches.length > 1) {
1914
+ return matches[1];
1915
+ }
1916
+ }
1917
+ /****************************************/
1918
+
1919
+ /* Hilfsfunktionen für die Hervorhebung */
1920
+
1921
+ function stashStyle(element) {
1922
+ var nps_style_stash = {};
1923
+ var elementComputedStyles = window.getComputedStyle(element);
1924
+
1925
+ for (var _i = 0, _arr = ["backgroundColor", "zoom", "color"]; _i < _arr.length; _i++) {
1926
+ var property = _arr[_i];
1927
+ nps_style_stash[property] = elementComputedStyles[property];
1928
+ }
1929
+
1930
+ element.dataset["nps_style_stash"] = JSON.stringify(nps_style_stash);
1931
+ }
1932
+
1933
+ function highlight(element) {
1934
+ element.style.backgroundColor = "#FFFFAA"; //element.style.zoom = "1";
1935
+
1936
+ element.style.color = "#000000";
1937
+ }
1938
+
1939
+ function unstashStyle(element) {
1940
+ var nps_style_hash_source = element.dataset["nps_style_stash"];
1941
+
1942
+ if (nps_style_hash_source) {
1943
+ var styleObject = JSON.parse(nps_style_hash_source);
1944
+
1945
+ for (var property in styleObject) {
1946
+ element.style[property] = styleObject[property];
1947
+ }
1948
+
1949
+ delete element.dataset["nps_style_stash"];
1950
+ }
1951
+ }
1952
+
1953
+ var publicInterface = {
1954
+ setParentWindow: function setParentWindow(new_parent) {
1955
+ parentWindow = new_parent;
1956
+ },
1957
+ attachMarkerMenu: function attachMarkerMenu(marker_menu_target) {
1958
+ var id = findInfoFromClassName(marker_menu_target, /nps_marker_menu_target_([0-9]+)/);
1959
+ var marker_menu = document.getElementById("nps_marker_menu_" + id);
1960
+
1961
+ if (marker_menu && marker_menu instanceof HTMLElement) {
1962
+ var definition = publicInterface.findMarkerDefinitionForElement(marker_menu);
1963
+ var target_pos = getOffset(marker_menu_target);
1964
+ var parent_pos = getOffset(marker_menu.offsetParent);
1965
+ marker_menu.style.position = "absolute";
1966
+ marker_menu.style.left = target_pos.left + definition.offset_left - parent_pos.left + "px";
1967
+ marker_menu.style.top = target_pos.top + definition.offset_top - parent_pos.top + "px";
1968
+ addEventListener(marker_menu, "mouseenter", function () {
1969
+ stashStyle(marker_menu_target);
1970
+ highlight(marker_menu_target);
1971
+ });
1972
+ addEventListener(marker_menu, "mouseleave", function () {
1973
+ unstashStyle(marker_menu_target);
1974
+ });
1975
+ }
1976
+ },
1977
+ initMarkerMenus: function initMarkerMenus() {
1978
+ var visible = false;
1979
+
1980
+ var click_handler = function click_handler(event) {
1981
+ if (visible) {
1982
+ // jQuery(this).next().slideUp(200);
1983
+ event.target.nextElementSibling.style.display = "none";
1984
+ visible = false;
1985
+ } else {
1986
+ // jQuery(this).next().slideDown(200);
1987
+ event.target.nextElementSibling.style.removeProperty("display");
1988
+ visible = true;
1989
+ }
1990
+
1991
+ event.stopPropagation();
1992
+ event.preventDefault();
1993
+ };
1994
+
1995
+ document.querySelectorAll(".nps_marker_menu_button").forEach(function (element) {
1996
+ addEventListener(element, "click", click_handler);
1997
+ });
1998
+ },
1999
+ attachMarkerMenus: function attachMarkerMenus() {
2000
+ document.querySelectorAll(".nps_marker_menu_target").forEach(function (element) {
2001
+ publicInterface.attachMarkerMenu(element);
2002
+ });
2003
+ },
2004
+ initActionMarker: function initActionMarker() {
2005
+ document.querySelectorAll(".nps_action_marker").forEach(function (marker_element) {
2006
+ if (!publicInterface.hasRequiredPermissionsForMarkerElement(marker_element)) {
2007
+ marker_element.style.display = "none";
2008
+ }
2009
+ });
2010
+ },
2011
+ bindEditMarkerEvents: function bindEditMarkerEvents(marker, target) {
2012
+ unbindAllEventListeners(marker);
2013
+ addEventListener(marker, "mouseover", function () {
2014
+ target.querySelectorAll("*").forEach(function (element) {
2015
+ stashStyle(element);
2016
+ });
2017
+ target.querySelectorAll("*").forEach(function (element) {
2018
+ highlight(element);
2019
+ });
2020
+ stashStyle(target);
2021
+ highlight(target);
2022
+ });
2023
+ addEventListener(marker, "mouseout", function () {
2024
+ target.querySelectorAll("*").forEach(function (element) {
2025
+ unstashStyle(element);
2026
+ });
2027
+ unstashStyle(target);
2028
+ });
2029
+ addEventListener(marker, "click", function (event) {
2030
+ var stopEvent = publicInterface.startEditing(event.target);
2031
+
2032
+ if (stopEvent) {
2033
+ event.stopPropagation();
2034
+ event.preventDefault();
2035
+ }
2036
+ });
2037
+ },
2038
+ initEditMarker: function initEditMarker() {
2039
+ // add functions and behaviour to all edit marker elements
2040
+ document.querySelectorAll(".nps_edit_marker").forEach(function (marker, i) {
2041
+ if (publicInterface.hasRequiredPermissionsForMarkerElement(marker)) {
2042
+ var id = findInfoFromClassName(marker, /nps_marker_id_([0-9]+)/);
2043
+ var target = document.getElementById("nps_marker_id_" + id);
2044
+
2045
+ if (target && target instanceof HTMLElement) {
2046
+ var pos = getOffset(target);
2047
+ var parent_pos = getOffset(marker.offsetParent || document.body);
2048
+ publicInterface.bindEditMarkerEvents(marker, target);
2049
+ marker.style.left = pos.left - parent_pos.left + "px";
2050
+ marker.style.top = pos.top - parent_pos.top + "px";
2051
+ marker.style.position = "absolute";
2052
+ marker.style.display = "inline";
2053
+ } else {
2054
+ marker.style.display = "none";
2055
+ }
2056
+ } else {
2057
+ marker.style.display = "none";
2058
+ }
2059
+ });
2060
+ },
2061
+ openEditDialog: function openEditDialog(obj_id, attribute, context_id, size, target) {
2062
+ parentWindow.openEditDialog(obj_id, attribute, context_id, size, target);
2063
+ },
2064
+ initMarker: function initMarker() {
2065
+ publicInterface.initEditMarker();
2066
+ publicInterface.initActionMarker();
2067
+ publicInterface.initMarkerMenus();
2068
+ publicInterface.attachMarkerMenus();
2069
+ },
2070
+ init: function init() {
2071
+ document.addEventListener("DOMContentLoaded", publicInterface.initMarker);
2072
+ if (document.readyState !== "loading") publicInterface.initMarker();
2073
+ window.addEventListener("load", publicInterface.initMarker);
2074
+ window.addEventListener("resize", publicInterface.initMarker);
2075
+ },
2076
+ storeMarkerDefinitions: function storeMarkerDefinitions(definitions) {
2077
+ editMarkerDefinitions = Object.assign(Object.assign({}, editMarkerDefinitions), definitions) || definitions;
2078
+ },
2079
+ markerDefinition: function markerDefinition(id) {
2080
+ return editMarkerDefinitions[id];
2081
+ },
2082
+ findMarkerDefinitionForElement: function findMarkerDefinitionForElement(element) {
2083
+ return publicInterface.markerDefinition(findInfoFromClassName(element, /nps_marker_id_([0-9]+)/));
2084
+ },
2085
+ currentUserHasGlobalPermission: function currentUserHasGlobalPermission(perm) {
2086
+ if (parentWindow.currentUserIsMemberOf) {
2087
+ return parentWindow.currentUserHasGlobalPermission(perm);
2088
+ } else {
2089
+ return true;
2090
+ }
2091
+ },
2092
+ currentUserIsMemberOf: function currentUserIsMemberOf(groups) {
2093
+ if (parentWindow.currentUserIsMemberOf) {
2094
+ return parentWindow.currentUserIsMemberOf(groups);
2095
+ } else {
2096
+ return true;
2097
+ }
2098
+ },
2099
+ hasRequiredPermissionsForMarkerElement: function hasRequiredPermissionsForMarkerElement(element) {
2100
+ if (publicInterface.currentUserHasGlobalPermission("permissionGlobalRoot")) {
2101
+ return true;
2102
+ }
2103
+
2104
+ var definition = publicInterface.findMarkerDefinitionForElement(element);
2105
+ var member_in_group = 0;
2106
+
2107
+ var _iterator = _createForOfIteratorHelper(definition.memberships),
2108
+ _step;
2109
+
2110
+ try {
2111
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
2112
+ var membership = _step.value;
2113
+
2114
+ if (publicInterface.currentUserIsMemberOf(membership)) {
2115
+ member_in_group += 1;
2116
+ } else {
2117
+ break;
2118
+ }
2119
+ }
2120
+ } catch (err) {
2121
+ _iterator.e(err);
2122
+ } finally {
2123
+ _iterator.f();
2124
+ }
2125
+
2126
+ return member_in_group === definition.memberships.length;
2127
+ },
2128
+ startEditing: function startEditing(element) {
2129
+ var definition = publicInterface.findMarkerDefinitionForElement(element); // pass control to Fiona GUI
2130
+
2131
+ publicInterface.openEditDialog(definition.obj_id, definition.attribute, definition.context_id, definition.size, definition.target);
2132
+ return false;
2133
+ }
2134
+ };
2135
+
2136
+ return publicInterface;
239
2137
 
240
2138
  }());