@eva/plugin-a11y 1.2.7-fix.1 → 1.2.7-fix.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/EVA.plugin.a11y.js +730 -3568
- package/dist/EVA.plugin.a11y.min.js +1 -1
- package/dist/miniprogram.js +631 -0
- package/dist/plugin-a11y.d.ts +7 -4
- package/package.json +3 -3
package/dist/EVA.plugin.a11y.js
CHANGED
|
@@ -1,3715 +1,877 @@
|
|
|
1
|
-
(function (
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@eva/eva.js'), require('pixi.js')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@eva/eva.js', 'pixi.js'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.EVA = global.EVA || {}, global.EVA.plugin = global.EVA.plugin || {}, global.EVA.plugin.a11y = {}), global.EVA, global.PIXI));
|
|
5
|
-
}(this, (function (exports, eva_js, pixi_js) { 'use strict';
|
|
6
|
-
|
|
7
|
-
/*! *****************************************************************************
|
|
8
|
-
Copyright (c) Microsoft Corporation.
|
|
9
|
-
|
|
10
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
-
purpose with or without fee is hereby granted.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
-
***************************************************************************** */
|
|
21
|
-
/* global Reflect, Promise */
|
|
22
|
-
|
|
23
|
-
var extendStatics$2 = function(d, b) {
|
|
24
|
-
extendStatics$2 = Object.setPrototypeOf ||
|
|
25
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
26
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
27
|
-
return extendStatics$2(d, b);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
function __extends$2(d, b) {
|
|
31
|
-
extendStatics$2(d, b);
|
|
32
|
-
function __() { this.constructor = d; }
|
|
33
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
var __assign$1 = function() {
|
|
37
|
-
__assign$1 = Object.assign || function __assign(t) {
|
|
38
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
39
|
-
s = arguments[i];
|
|
40
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
41
|
-
}
|
|
42
|
-
return t;
|
|
43
|
-
};
|
|
44
|
-
return __assign$1.apply(this, arguments);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
function __decorate$1(decorators, target, key, desc) {
|
|
48
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
49
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
50
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
51
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
55
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
56
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
57
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
58
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
59
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
60
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function __generator(thisArg, body) {
|
|
65
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
66
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
67
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
68
|
-
function step(op) {
|
|
69
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
70
|
-
while (_) try {
|
|
71
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
72
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
73
|
-
switch (op[0]) {
|
|
74
|
-
case 0: case 1: t = op; break;
|
|
75
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
76
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
77
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
78
|
-
default:
|
|
79
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
80
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
81
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
82
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
83
|
-
if (t[2]) _.ops.pop();
|
|
84
|
-
_.trys.pop(); continue;
|
|
85
|
-
}
|
|
86
|
-
op = body.call(thisArg, _);
|
|
87
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
88
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function __values$1(o) {
|
|
93
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
94
|
-
if (m) return m.call(o);
|
|
95
|
-
if (o && typeof o.length === "number") return {
|
|
96
|
-
next: function () {
|
|
97
|
-
if (o && i >= o.length) o = void 0;
|
|
98
|
-
return { value: o && o[i++], done: !o };
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/*! *****************************************************************************
|
|
105
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
106
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
107
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
108
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
109
|
-
|
|
110
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
111
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
112
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
113
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
114
|
-
|
|
115
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
116
|
-
and limitations under the License.
|
|
117
|
-
***************************************************************************** */
|
|
118
|
-
/* global Reflect, Promise */
|
|
119
|
-
|
|
120
|
-
var extendStatics$1 = function(d, b) {
|
|
121
|
-
extendStatics$1 = Object.setPrototypeOf ||
|
|
122
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
123
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
124
|
-
return extendStatics$1(d, b);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
function __extends$1(d, b) {
|
|
128
|
-
extendStatics$1(d, b);
|
|
129
|
-
function __() { this.constructor = d; }
|
|
130
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
var Application = (function (_super) {
|
|
134
|
-
__extends$1(Application, _super);
|
|
135
|
-
function Application(params) {
|
|
136
|
-
var _this = this;
|
|
137
|
-
params.autoStart = false;
|
|
138
|
-
_this = _super.call(this, params) || this;
|
|
139
|
-
return _this;
|
|
140
|
-
}
|
|
141
|
-
return Application;
|
|
142
|
-
}(pixi_js.Application));
|
|
143
|
-
var Application$1 = Application;
|
|
144
|
-
|
|
145
|
-
var Container = (function (_super) {
|
|
146
|
-
__extends$1(Container, _super);
|
|
147
|
-
function Container() {
|
|
148
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
149
|
-
}
|
|
150
|
-
return Container;
|
|
151
|
-
}(pixi_js.Container));
|
|
152
|
-
var Container$1 = Container;
|
|
153
|
-
|
|
154
|
-
((function (_super) {
|
|
155
|
-
__extends$1(Graphics, _super);
|
|
156
|
-
function Graphics() {
|
|
157
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
158
|
-
}
|
|
159
|
-
return Graphics;
|
|
160
|
-
})(pixi_js.Graphics));
|
|
161
|
-
|
|
162
|
-
((function (_super) {
|
|
163
|
-
__extends$1(NinePatch, _super);
|
|
164
|
-
function NinePatch(img, leftWidth, topHeight, rightWidth, bottomHeight) {
|
|
165
|
-
var _this = this;
|
|
166
|
-
var texture;
|
|
167
|
-
if (img === 'string') {
|
|
168
|
-
texture = pixi_js.Texture.fromFrame(img);
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
texture = pixi_js.Texture.from(img);
|
|
172
|
-
}
|
|
173
|
-
_this = _super.call(this, texture, leftWidth, topHeight, rightWidth, bottomHeight) || this;
|
|
174
|
-
return _this;
|
|
175
|
-
}
|
|
176
|
-
return NinePatch;
|
|
177
|
-
})(pixi_js.mesh.NineSlicePlane));
|
|
178
|
-
|
|
179
|
-
((function () {
|
|
180
|
-
function Sprite(image) {
|
|
181
|
-
this._image = null;
|
|
182
|
-
this._image = image;
|
|
183
|
-
if (image) {
|
|
184
|
-
if (image instanceof HTMLImageElement) {
|
|
185
|
-
this.sprite = pixi_js.Sprite.from(image);
|
|
186
|
-
}
|
|
187
|
-
else if (image instanceof pixi_js.Texture) {
|
|
188
|
-
this.sprite = new pixi_js.Sprite(image);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
this.sprite = new pixi_js.Sprite();
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
Object.defineProperty(Sprite.prototype, "image", {
|
|
196
|
-
get: function () {
|
|
197
|
-
return this._image;
|
|
198
|
-
},
|
|
199
|
-
set: function (val) {
|
|
200
|
-
if (this._image === val) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
if (val instanceof HTMLImageElement) {
|
|
204
|
-
this.sprite.texture && this.sprite.texture.destroy(false);
|
|
205
|
-
this.sprite.texture = pixi_js.Texture.from(val);
|
|
206
|
-
}
|
|
207
|
-
else if (val instanceof pixi_js.Texture) {
|
|
208
|
-
this.sprite.texture = val;
|
|
209
|
-
}
|
|
210
|
-
this._image = val;
|
|
211
|
-
},
|
|
212
|
-
enumerable: false,
|
|
213
|
-
configurable: true
|
|
214
|
-
});
|
|
215
|
-
return Sprite;
|
|
216
|
-
})());
|
|
217
|
-
|
|
218
|
-
((function () {
|
|
219
|
-
function SpriteAnimation(_a) {
|
|
220
|
-
var frames = _a.frames;
|
|
221
|
-
this.animatedSprite = new pixi_js.extras.AnimatedSprite(frames);
|
|
222
|
-
}
|
|
223
|
-
SpriteAnimation.prototype.play = function () {
|
|
224
|
-
this.animatedSprite.play();
|
|
225
|
-
};
|
|
226
|
-
SpriteAnimation.prototype.stop = function () {
|
|
227
|
-
this.animatedSprite.stop();
|
|
228
|
-
};
|
|
229
|
-
SpriteAnimation.prototype.gotoAndPlay = function (frameNumber) {
|
|
230
|
-
this.animatedSprite.gotoAndPlay(frameNumber);
|
|
231
|
-
};
|
|
232
|
-
SpriteAnimation.prototype.gotoAndStop = function (frameNumber) {
|
|
233
|
-
this.animatedSprite.gotoAndStop(frameNumber);
|
|
234
|
-
};
|
|
235
|
-
Object.defineProperty(SpriteAnimation.prototype, "speed", {
|
|
236
|
-
get: function () {
|
|
237
|
-
return this.animatedSprite.animationSpeed;
|
|
238
|
-
},
|
|
239
|
-
set: function (val) {
|
|
240
|
-
this.animatedSprite.animationSpeed = val;
|
|
241
|
-
},
|
|
242
|
-
enumerable: false,
|
|
243
|
-
configurable: true
|
|
244
|
-
});
|
|
245
|
-
return SpriteAnimation;
|
|
246
|
-
})());
|
|
247
|
-
|
|
248
|
-
((function (_super) {
|
|
249
|
-
__extends$1(Text, _super);
|
|
250
|
-
function Text(text, style) {
|
|
251
|
-
return _super.call(this, text, style) || this;
|
|
252
|
-
}
|
|
253
|
-
return Text;
|
|
254
|
-
})(pixi_js.Text));
|
|
255
|
-
|
|
256
|
-
var PIXITilingSprite = pixi_js.extras.TilingSprite;
|
|
257
|
-
((function () {
|
|
258
|
-
function TilingSprite(image) {
|
|
259
|
-
this._image = null;
|
|
260
|
-
this._image = image;
|
|
261
|
-
if (image) {
|
|
262
|
-
if (image instanceof HTMLImageElement) {
|
|
263
|
-
this.tilingSprite = new PIXITilingSprite(pixi_js.Texture.from(image));
|
|
264
|
-
}
|
|
265
|
-
else if (image instanceof pixi_js.Texture) {
|
|
266
|
-
this.tilingSprite = new PIXITilingSprite(image);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
else {
|
|
270
|
-
this.tilingSprite = new PIXITilingSprite(pixi_js.Texture.EMPTY);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
Object.defineProperty(TilingSprite.prototype, "image", {
|
|
274
|
-
get: function () {
|
|
275
|
-
return this._image;
|
|
276
|
-
},
|
|
277
|
-
set: function (val) {
|
|
278
|
-
if (this._image === val) {
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
if (val instanceof HTMLImageElement) {
|
|
282
|
-
this.tilingSprite.texture = pixi_js.Texture.from(val);
|
|
283
|
-
}
|
|
284
|
-
else if (val instanceof pixi_js.Texture) {
|
|
285
|
-
this.tilingSprite.texture = val;
|
|
286
|
-
}
|
|
287
|
-
this._image = val;
|
|
288
|
-
},
|
|
289
|
-
enumerable: false,
|
|
290
|
-
configurable: true
|
|
291
|
-
});
|
|
292
|
-
return TilingSprite;
|
|
293
|
-
})());
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* Removes all key-value entries from the list cache.
|
|
297
|
-
*
|
|
298
|
-
* @private
|
|
299
|
-
* @name clear
|
|
300
|
-
* @memberOf ListCache
|
|
301
|
-
*/
|
|
302
|
-
function listCacheClear() {
|
|
303
|
-
this.__data__ = [];
|
|
304
|
-
this.size = 0;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Performs a
|
|
309
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
310
|
-
* comparison between two values to determine if they are equivalent.
|
|
311
|
-
*
|
|
312
|
-
* @static
|
|
313
|
-
* @memberOf _
|
|
314
|
-
* @since 4.0.0
|
|
315
|
-
* @category Lang
|
|
316
|
-
* @param {*} value The value to compare.
|
|
317
|
-
* @param {*} other The other value to compare.
|
|
318
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
319
|
-
* @example
|
|
320
|
-
*
|
|
321
|
-
* var object = { 'a': 1 };
|
|
322
|
-
* var other = { 'a': 1 };
|
|
323
|
-
*
|
|
324
|
-
* _.eq(object, object);
|
|
325
|
-
* // => true
|
|
326
|
-
*
|
|
327
|
-
* _.eq(object, other);
|
|
328
|
-
* // => false
|
|
329
|
-
*
|
|
330
|
-
* _.eq('a', 'a');
|
|
331
|
-
* // => true
|
|
332
|
-
*
|
|
333
|
-
* _.eq('a', Object('a'));
|
|
334
|
-
* // => false
|
|
335
|
-
*
|
|
336
|
-
* _.eq(NaN, NaN);
|
|
337
|
-
* // => true
|
|
338
|
-
*/
|
|
339
|
-
function eq(value, other) {
|
|
340
|
-
return value === other || (value !== value && other !== other);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
345
|
-
*
|
|
346
|
-
* @private
|
|
347
|
-
* @param {Array} array The array to inspect.
|
|
348
|
-
* @param {*} key The key to search for.
|
|
349
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
350
|
-
*/
|
|
351
|
-
function assocIndexOf(array, key) {
|
|
352
|
-
var length = array.length;
|
|
353
|
-
while (length--) {
|
|
354
|
-
if (eq(array[length][0], key)) {
|
|
355
|
-
return length;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
return -1;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
/** Used for built-in method references. */
|
|
362
|
-
var arrayProto = Array.prototype;
|
|
363
|
-
|
|
364
|
-
/** Built-in value references. */
|
|
365
|
-
var splice = arrayProto.splice;
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* Removes `key` and its value from the list cache.
|
|
369
|
-
*
|
|
370
|
-
* @private
|
|
371
|
-
* @name delete
|
|
372
|
-
* @memberOf ListCache
|
|
373
|
-
* @param {string} key The key of the value to remove.
|
|
374
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
375
|
-
*/
|
|
376
|
-
function listCacheDelete(key) {
|
|
377
|
-
var data = this.__data__,
|
|
378
|
-
index = assocIndexOf(data, key);
|
|
379
|
-
|
|
380
|
-
if (index < 0) {
|
|
381
|
-
return false;
|
|
382
|
-
}
|
|
383
|
-
var lastIndex = data.length - 1;
|
|
384
|
-
if (index == lastIndex) {
|
|
385
|
-
data.pop();
|
|
386
|
-
} else {
|
|
387
|
-
splice.call(data, index, 1);
|
|
388
|
-
}
|
|
389
|
-
--this.size;
|
|
390
|
-
return true;
|
|
391
|
-
}
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
392
2
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
*
|
|
396
|
-
* @private
|
|
397
|
-
* @name get
|
|
398
|
-
* @memberOf ListCache
|
|
399
|
-
* @param {string} key The key of the value to get.
|
|
400
|
-
* @returns {*} Returns the entry value.
|
|
401
|
-
*/
|
|
402
|
-
function listCacheGet(key) {
|
|
403
|
-
var data = this.__data__,
|
|
404
|
-
index = assocIndexOf(data, key);
|
|
405
|
-
|
|
406
|
-
return index < 0 ? undefined : data[index][1];
|
|
407
|
-
}
|
|
3
|
+
window.EVA = window.EVA || {};
|
|
4
|
+
window.EVA.plugin = window.EVA.plugin || {};
|
|
408
5
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
*
|
|
412
|
-
* @private
|
|
413
|
-
* @name has
|
|
414
|
-
* @memberOf ListCache
|
|
415
|
-
* @param {string} key The key of the entry to check.
|
|
416
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
417
|
-
*/
|
|
418
|
-
function listCacheHas(key) {
|
|
419
|
-
return assocIndexOf(this.__data__, key) > -1;
|
|
420
|
-
}
|
|
6
|
+
var _EVA_IIFE_a11y = function (exports, eva_js, pluginRenderer) {
|
|
7
|
+
'use strict';
|
|
421
8
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
* @returns {Object} Returns the list cache instance.
|
|
431
|
-
*/
|
|
432
|
-
function listCacheSet(key, value) {
|
|
433
|
-
var data = this.__data__,
|
|
434
|
-
index = assocIndexOf(data, key);
|
|
435
|
-
|
|
436
|
-
if (index < 0) {
|
|
437
|
-
++this.size;
|
|
438
|
-
data.push([key, value]);
|
|
439
|
-
} else {
|
|
440
|
-
data[index][1] = value;
|
|
9
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
10
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
11
|
+
__proto__: []
|
|
12
|
+
} instanceof Array && function (d, b) {
|
|
13
|
+
d.__proto__ = b;
|
|
14
|
+
} || function (d, b) {
|
|
15
|
+
for (var p in b) {
|
|
16
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
441
17
|
}
|
|
442
|
-
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* Creates an list cache object.
|
|
447
|
-
*
|
|
448
|
-
* @private
|
|
449
|
-
* @constructor
|
|
450
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
451
|
-
*/
|
|
452
|
-
function ListCache(entries) {
|
|
453
|
-
var index = -1,
|
|
454
|
-
length = entries == null ? 0 : entries.length;
|
|
455
|
-
|
|
456
|
-
this.clear();
|
|
457
|
-
while (++index < length) {
|
|
458
|
-
var entry = entries[index];
|
|
459
|
-
this.set(entry[0], entry[1]);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
// Add methods to `ListCache`.
|
|
464
|
-
ListCache.prototype.clear = listCacheClear;
|
|
465
|
-
ListCache.prototype['delete'] = listCacheDelete;
|
|
466
|
-
ListCache.prototype.get = listCacheGet;
|
|
467
|
-
ListCache.prototype.has = listCacheHas;
|
|
468
|
-
ListCache.prototype.set = listCacheSet;
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* Removes all key-value entries from the stack.
|
|
472
|
-
*
|
|
473
|
-
* @private
|
|
474
|
-
* @name clear
|
|
475
|
-
* @memberOf Stack
|
|
476
|
-
*/
|
|
477
|
-
function stackClear() {
|
|
478
|
-
this.__data__ = new ListCache;
|
|
479
|
-
this.size = 0;
|
|
480
|
-
}
|
|
18
|
+
};
|
|
481
19
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
*
|
|
485
|
-
* @private
|
|
486
|
-
* @name delete
|
|
487
|
-
* @memberOf Stack
|
|
488
|
-
* @param {string} key The key of the value to remove.
|
|
489
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
490
|
-
*/
|
|
491
|
-
function stackDelete(key) {
|
|
492
|
-
var data = this.__data__,
|
|
493
|
-
result = data['delete'](key);
|
|
494
|
-
|
|
495
|
-
this.size = data.size;
|
|
496
|
-
return result;
|
|
497
|
-
}
|
|
20
|
+
return _extendStatics(d, b);
|
|
21
|
+
};
|
|
498
22
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
*
|
|
502
|
-
* @private
|
|
503
|
-
* @name get
|
|
504
|
-
* @memberOf Stack
|
|
505
|
-
* @param {string} key The key of the value to get.
|
|
506
|
-
* @returns {*} Returns the entry value.
|
|
507
|
-
*/
|
|
508
|
-
function stackGet(key) {
|
|
509
|
-
return this.__data__.get(key);
|
|
510
|
-
}
|
|
23
|
+
function __extends(d, b) {
|
|
24
|
+
_extendStatics(d, b);
|
|
511
25
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
*
|
|
515
|
-
* @private
|
|
516
|
-
* @name has
|
|
517
|
-
* @memberOf Stack
|
|
518
|
-
* @param {string} key The key of the entry to check.
|
|
519
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
520
|
-
*/
|
|
521
|
-
function stackHas(key) {
|
|
522
|
-
return this.__data__.has(key);
|
|
26
|
+
function __() {
|
|
27
|
+
this.constructor = d;
|
|
523
28
|
}
|
|
524
29
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
var freeGlobal$1 = freeGlobal;
|
|
529
|
-
|
|
530
|
-
/** Detect free variable `self`. */
|
|
531
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
532
|
-
|
|
533
|
-
/** Used as a reference to the global object. */
|
|
534
|
-
var root = freeGlobal$1 || freeSelf || Function('return this')();
|
|
535
|
-
|
|
536
|
-
var root$1 = root;
|
|
30
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
31
|
+
}
|
|
537
32
|
|
|
538
|
-
|
|
539
|
-
|
|
33
|
+
var _assign = function __assign() {
|
|
34
|
+
_assign = Object.assign || function __assign(t) {
|
|
35
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
36
|
+
s = arguments[i];
|
|
540
37
|
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
/** Used for built-in method references. */
|
|
544
|
-
var objectProto$b = Object.prototype;
|
|
545
|
-
|
|
546
|
-
/** Used to check objects for own properties. */
|
|
547
|
-
var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
* Used to resolve the
|
|
551
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
552
|
-
* of values.
|
|
553
|
-
*/
|
|
554
|
-
var nativeObjectToString$1 = objectProto$b.toString;
|
|
555
|
-
|
|
556
|
-
/** Built-in value references. */
|
|
557
|
-
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
558
|
-
|
|
559
|
-
/**
|
|
560
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
561
|
-
*
|
|
562
|
-
* @private
|
|
563
|
-
* @param {*} value The value to query.
|
|
564
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
565
|
-
*/
|
|
566
|
-
function getRawTag(value) {
|
|
567
|
-
var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
|
|
568
|
-
tag = value[symToStringTag$1];
|
|
569
|
-
|
|
570
|
-
try {
|
|
571
|
-
value[symToStringTag$1] = undefined;
|
|
572
|
-
var unmasked = true;
|
|
573
|
-
} catch (e) {}
|
|
574
|
-
|
|
575
|
-
var result = nativeObjectToString$1.call(value);
|
|
576
|
-
if (unmasked) {
|
|
577
|
-
if (isOwn) {
|
|
578
|
-
value[symToStringTag$1] = tag;
|
|
579
|
-
} else {
|
|
580
|
-
delete value[symToStringTag$1];
|
|
38
|
+
for (var p in s) {
|
|
39
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
581
40
|
}
|
|
582
41
|
}
|
|
583
|
-
return result;
|
|
584
|
-
}
|
|
585
42
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
/**
|
|
590
|
-
* Used to resolve the
|
|
591
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
592
|
-
* of values.
|
|
593
|
-
*/
|
|
594
|
-
var nativeObjectToString = objectProto$a.toString;
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
598
|
-
*
|
|
599
|
-
* @private
|
|
600
|
-
* @param {*} value The value to convert.
|
|
601
|
-
* @returns {string} Returns the converted string.
|
|
602
|
-
*/
|
|
603
|
-
function objectToString(value) {
|
|
604
|
-
return nativeObjectToString.call(value);
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
/** `Object#toString` result references. */
|
|
608
|
-
var nullTag = '[object Null]',
|
|
609
|
-
undefinedTag = '[object Undefined]';
|
|
610
|
-
|
|
611
|
-
/** Built-in value references. */
|
|
612
|
-
var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
616
|
-
*
|
|
617
|
-
* @private
|
|
618
|
-
* @param {*} value The value to query.
|
|
619
|
-
* @returns {string} Returns the `toStringTag`.
|
|
620
|
-
*/
|
|
621
|
-
function baseGetTag(value) {
|
|
622
|
-
if (value == null) {
|
|
623
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
624
|
-
}
|
|
625
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
626
|
-
? getRawTag(value)
|
|
627
|
-
: objectToString(value);
|
|
628
|
-
}
|
|
43
|
+
return t;
|
|
44
|
+
};
|
|
629
45
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
633
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
634
|
-
*
|
|
635
|
-
* @static
|
|
636
|
-
* @memberOf _
|
|
637
|
-
* @since 0.1.0
|
|
638
|
-
* @category Lang
|
|
639
|
-
* @param {*} value The value to check.
|
|
640
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
641
|
-
* @example
|
|
642
|
-
*
|
|
643
|
-
* _.isObject({});
|
|
644
|
-
* // => true
|
|
645
|
-
*
|
|
646
|
-
* _.isObject([1, 2, 3]);
|
|
647
|
-
* // => true
|
|
648
|
-
*
|
|
649
|
-
* _.isObject(_.noop);
|
|
650
|
-
* // => true
|
|
651
|
-
*
|
|
652
|
-
* _.isObject(null);
|
|
653
|
-
* // => false
|
|
654
|
-
*/
|
|
655
|
-
function isObject(value) {
|
|
656
|
-
var type = typeof value;
|
|
657
|
-
return value != null && (type == 'object' || type == 'function');
|
|
658
|
-
}
|
|
46
|
+
return _assign.apply(this, arguments);
|
|
47
|
+
};
|
|
659
48
|
|
|
660
|
-
|
|
661
|
-
var
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
/**
|
|
667
|
-
* Checks if `value` is classified as a `Function` object.
|
|
668
|
-
*
|
|
669
|
-
* @static
|
|
670
|
-
* @memberOf _
|
|
671
|
-
* @since 0.1.0
|
|
672
|
-
* @category Lang
|
|
673
|
-
* @param {*} value The value to check.
|
|
674
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
675
|
-
* @example
|
|
676
|
-
*
|
|
677
|
-
* _.isFunction(_);
|
|
678
|
-
* // => true
|
|
679
|
-
*
|
|
680
|
-
* _.isFunction(/abc/);
|
|
681
|
-
* // => false
|
|
682
|
-
*/
|
|
683
|
-
function isFunction(value) {
|
|
684
|
-
if (!isObject(value)) {
|
|
685
|
-
return false;
|
|
686
|
-
}
|
|
687
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
688
|
-
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
689
|
-
var tag = baseGetTag(value);
|
|
690
|
-
return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
49
|
+
function __decorate(decorators, target, key, desc) {
|
|
50
|
+
var c = arguments.length,
|
|
51
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
52
|
+
d;
|
|
53
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
|
|
54
|
+
if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
691
55
|
}
|
|
56
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
57
|
+
}
|
|
692
58
|
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
/** Used to detect methods masquerading as native. */
|
|
699
|
-
var maskSrcKey = (function() {
|
|
700
|
-
var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || '');
|
|
701
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
702
|
-
}());
|
|
703
|
-
|
|
704
|
-
/**
|
|
705
|
-
* Checks if `func` has its source masked.
|
|
706
|
-
*
|
|
707
|
-
* @private
|
|
708
|
-
* @param {Function} func The function to check.
|
|
709
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
710
|
-
*/
|
|
711
|
-
function isMasked(func) {
|
|
712
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
59
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
60
|
+
function adopt(value) {
|
|
61
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
62
|
+
resolve(value);
|
|
63
|
+
});
|
|
713
64
|
}
|
|
714
65
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
/** Used to resolve the decompiled source of functions. */
|
|
719
|
-
var funcToString$1 = funcProto$1.toString;
|
|
720
|
-
|
|
721
|
-
/**
|
|
722
|
-
* Converts `func` to its source code.
|
|
723
|
-
*
|
|
724
|
-
* @private
|
|
725
|
-
* @param {Function} func The function to convert.
|
|
726
|
-
* @returns {string} Returns the source code.
|
|
727
|
-
*/
|
|
728
|
-
function toSource(func) {
|
|
729
|
-
if (func != null) {
|
|
66
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
67
|
+
function fulfilled(value) {
|
|
730
68
|
try {
|
|
731
|
-
|
|
732
|
-
} catch (e) {
|
|
69
|
+
step(generator.next(value));
|
|
70
|
+
} catch (e) {
|
|
71
|
+
reject(e);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function rejected(value) {
|
|
733
76
|
try {
|
|
734
|
-
|
|
735
|
-
} catch (e) {
|
|
77
|
+
step(generator["throw"](value));
|
|
78
|
+
} catch (e) {
|
|
79
|
+
reject(e);
|
|
80
|
+
}
|
|
736
81
|
}
|
|
737
|
-
return '';
|
|
738
|
-
}
|
|
739
82
|
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
743
|
-
*/
|
|
744
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
745
|
-
|
|
746
|
-
/** Used to detect host constructors (Safari). */
|
|
747
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
748
|
-
|
|
749
|
-
/** Used for built-in method references. */
|
|
750
|
-
var funcProto = Function.prototype,
|
|
751
|
-
objectProto$9 = Object.prototype;
|
|
752
|
-
|
|
753
|
-
/** Used to resolve the decompiled source of functions. */
|
|
754
|
-
var funcToString = funcProto.toString;
|
|
755
|
-
|
|
756
|
-
/** Used to check objects for own properties. */
|
|
757
|
-
var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
|
|
758
|
-
|
|
759
|
-
/** Used to detect if a method is native. */
|
|
760
|
-
var reIsNative = RegExp('^' +
|
|
761
|
-
funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
|
|
762
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
763
|
-
);
|
|
764
|
-
|
|
765
|
-
/**
|
|
766
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
767
|
-
*
|
|
768
|
-
* @private
|
|
769
|
-
* @param {*} value The value to check.
|
|
770
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
771
|
-
* else `false`.
|
|
772
|
-
*/
|
|
773
|
-
function baseIsNative(value) {
|
|
774
|
-
if (!isObject(value) || isMasked(value)) {
|
|
775
|
-
return false;
|
|
83
|
+
function step(result) {
|
|
84
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
776
85
|
}
|
|
777
|
-
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
778
|
-
return pattern.test(toSource(value));
|
|
779
|
-
}
|
|
780
86
|
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
87
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function __generator(thisArg, body) {
|
|
92
|
+
var _ = {
|
|
93
|
+
label: 0,
|
|
94
|
+
sent: function sent() {
|
|
95
|
+
if (t[0] & 1) throw t[1];
|
|
96
|
+
return t[1];
|
|
97
|
+
},
|
|
98
|
+
trys: [],
|
|
99
|
+
ops: []
|
|
100
|
+
},
|
|
101
|
+
f,
|
|
102
|
+
y,
|
|
103
|
+
t,
|
|
104
|
+
g;
|
|
105
|
+
return g = {
|
|
106
|
+
next: verb(0),
|
|
107
|
+
"throw": verb(1),
|
|
108
|
+
"return": verb(2)
|
|
109
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
110
|
+
return this;
|
|
111
|
+
}), g;
|
|
792
112
|
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
* @param {Object} object The object to query.
|
|
798
|
-
* @param {string} key The key of the method to get.
|
|
799
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
800
|
-
*/
|
|
801
|
-
function getNative(object, key) {
|
|
802
|
-
var value = getValue(object, key);
|
|
803
|
-
return baseIsNative(value) ? value : undefined;
|
|
113
|
+
function verb(n) {
|
|
114
|
+
return function (v) {
|
|
115
|
+
return step([n, v]);
|
|
116
|
+
};
|
|
804
117
|
}
|
|
805
118
|
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
var Map$2 = Map$1;
|
|
119
|
+
function step(op) {
|
|
120
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
810
121
|
|
|
811
|
-
|
|
812
|
-
|
|
122
|
+
while (_) {
|
|
123
|
+
try {
|
|
124
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
125
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
813
126
|
|
|
814
|
-
|
|
127
|
+
switch (op[0]) {
|
|
128
|
+
case 0:
|
|
129
|
+
case 1:
|
|
130
|
+
t = op;
|
|
131
|
+
break;
|
|
815
132
|
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
*/
|
|
823
|
-
function hashClear() {
|
|
824
|
-
this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
|
|
825
|
-
this.size = 0;
|
|
826
|
-
}
|
|
133
|
+
case 4:
|
|
134
|
+
_.label++;
|
|
135
|
+
return {
|
|
136
|
+
value: op[1],
|
|
137
|
+
done: false
|
|
138
|
+
};
|
|
827
139
|
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
* @memberOf Hash
|
|
834
|
-
* @param {Object} hash The hash to modify.
|
|
835
|
-
* @param {string} key The key of the value to remove.
|
|
836
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
837
|
-
*/
|
|
838
|
-
function hashDelete(key) {
|
|
839
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
840
|
-
this.size -= result ? 1 : 0;
|
|
841
|
-
return result;
|
|
842
|
-
}
|
|
140
|
+
case 5:
|
|
141
|
+
_.label++;
|
|
142
|
+
y = op[1];
|
|
143
|
+
op = [0];
|
|
144
|
+
continue;
|
|
843
145
|
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
/** Used for built-in method references. */
|
|
848
|
-
var objectProto$8 = Object.prototype;
|
|
849
|
-
|
|
850
|
-
/** Used to check objects for own properties. */
|
|
851
|
-
var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
|
852
|
-
|
|
853
|
-
/**
|
|
854
|
-
* Gets the hash value for `key`.
|
|
855
|
-
*
|
|
856
|
-
* @private
|
|
857
|
-
* @name get
|
|
858
|
-
* @memberOf Hash
|
|
859
|
-
* @param {string} key The key of the value to get.
|
|
860
|
-
* @returns {*} Returns the entry value.
|
|
861
|
-
*/
|
|
862
|
-
function hashGet(key) {
|
|
863
|
-
var data = this.__data__;
|
|
864
|
-
if (nativeCreate$1) {
|
|
865
|
-
var result = data[key];
|
|
866
|
-
return result === HASH_UNDEFINED$2 ? undefined : result;
|
|
867
|
-
}
|
|
868
|
-
return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
|
|
869
|
-
}
|
|
146
|
+
case 7:
|
|
147
|
+
op = _.ops.pop();
|
|
870
148
|
|
|
871
|
-
|
|
872
|
-
var objectProto$7 = Object.prototype;
|
|
873
|
-
|
|
874
|
-
/** Used to check objects for own properties. */
|
|
875
|
-
var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
|
|
876
|
-
|
|
877
|
-
/**
|
|
878
|
-
* Checks if a hash value for `key` exists.
|
|
879
|
-
*
|
|
880
|
-
* @private
|
|
881
|
-
* @name has
|
|
882
|
-
* @memberOf Hash
|
|
883
|
-
* @param {string} key The key of the entry to check.
|
|
884
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
885
|
-
*/
|
|
886
|
-
function hashHas(key) {
|
|
887
|
-
var data = this.__data__;
|
|
888
|
-
return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty$5.call(data, key);
|
|
889
|
-
}
|
|
149
|
+
_.trys.pop();
|
|
890
150
|
|
|
891
|
-
|
|
892
|
-
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
893
|
-
|
|
894
|
-
/**
|
|
895
|
-
* Sets the hash `key` to `value`.
|
|
896
|
-
*
|
|
897
|
-
* @private
|
|
898
|
-
* @name set
|
|
899
|
-
* @memberOf Hash
|
|
900
|
-
* @param {string} key The key of the value to set.
|
|
901
|
-
* @param {*} value The value to set.
|
|
902
|
-
* @returns {Object} Returns the hash instance.
|
|
903
|
-
*/
|
|
904
|
-
function hashSet(key, value) {
|
|
905
|
-
var data = this.__data__;
|
|
906
|
-
this.size += this.has(key) ? 0 : 1;
|
|
907
|
-
data[key] = (nativeCreate$1 && value === undefined) ? HASH_UNDEFINED$1 : value;
|
|
908
|
-
return this;
|
|
909
|
-
}
|
|
151
|
+
continue;
|
|
910
152
|
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
917
|
-
*/
|
|
918
|
-
function Hash(entries) {
|
|
919
|
-
var index = -1,
|
|
920
|
-
length = entries == null ? 0 : entries.length;
|
|
921
|
-
|
|
922
|
-
this.clear();
|
|
923
|
-
while (++index < length) {
|
|
924
|
-
var entry = entries[index];
|
|
925
|
-
this.set(entry[0], entry[1]);
|
|
926
|
-
}
|
|
927
|
-
}
|
|
153
|
+
default:
|
|
154
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
155
|
+
_ = 0;
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
928
158
|
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
Hash.prototype.has = hashHas;
|
|
934
|
-
Hash.prototype.set = hashSet;
|
|
935
|
-
|
|
936
|
-
/**
|
|
937
|
-
* Removes all key-value entries from the map.
|
|
938
|
-
*
|
|
939
|
-
* @private
|
|
940
|
-
* @name clear
|
|
941
|
-
* @memberOf MapCache
|
|
942
|
-
*/
|
|
943
|
-
function mapCacheClear() {
|
|
944
|
-
this.size = 0;
|
|
945
|
-
this.__data__ = {
|
|
946
|
-
'hash': new Hash,
|
|
947
|
-
'map': new (Map$2 || ListCache),
|
|
948
|
-
'string': new Hash
|
|
949
|
-
};
|
|
950
|
-
}
|
|
159
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
160
|
+
_.label = op[1];
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
951
163
|
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
958
|
-
*/
|
|
959
|
-
function isKeyable(value) {
|
|
960
|
-
var type = typeof value;
|
|
961
|
-
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
962
|
-
? (value !== '__proto__')
|
|
963
|
-
: (value === null);
|
|
964
|
-
}
|
|
164
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
165
|
+
_.label = t[1];
|
|
166
|
+
t = op;
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
965
169
|
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
*
|
|
969
|
-
* @private
|
|
970
|
-
* @param {Object} map The map to query.
|
|
971
|
-
* @param {string} key The reference key.
|
|
972
|
-
* @returns {*} Returns the map data.
|
|
973
|
-
*/
|
|
974
|
-
function getMapData(map, key) {
|
|
975
|
-
var data = map.__data__;
|
|
976
|
-
return isKeyable(key)
|
|
977
|
-
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
978
|
-
: data.map;
|
|
979
|
-
}
|
|
170
|
+
if (t && _.label < t[2]) {
|
|
171
|
+
_.label = t[2];
|
|
980
172
|
|
|
981
|
-
|
|
982
|
-
* Removes `key` and its value from the map.
|
|
983
|
-
*
|
|
984
|
-
* @private
|
|
985
|
-
* @name delete
|
|
986
|
-
* @memberOf MapCache
|
|
987
|
-
* @param {string} key The key of the value to remove.
|
|
988
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
989
|
-
*/
|
|
990
|
-
function mapCacheDelete(key) {
|
|
991
|
-
var result = getMapData(this, key)['delete'](key);
|
|
992
|
-
this.size -= result ? 1 : 0;
|
|
993
|
-
return result;
|
|
994
|
-
}
|
|
173
|
+
_.ops.push(op);
|
|
995
174
|
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
*
|
|
999
|
-
* @private
|
|
1000
|
-
* @name get
|
|
1001
|
-
* @memberOf MapCache
|
|
1002
|
-
* @param {string} key The key of the value to get.
|
|
1003
|
-
* @returns {*} Returns the entry value.
|
|
1004
|
-
*/
|
|
1005
|
-
function mapCacheGet(key) {
|
|
1006
|
-
return getMapData(this, key).get(key);
|
|
1007
|
-
}
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
1008
177
|
|
|
1009
|
-
|
|
1010
|
-
* Checks if a map value for `key` exists.
|
|
1011
|
-
*
|
|
1012
|
-
* @private
|
|
1013
|
-
* @name has
|
|
1014
|
-
* @memberOf MapCache
|
|
1015
|
-
* @param {string} key The key of the entry to check.
|
|
1016
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1017
|
-
*/
|
|
1018
|
-
function mapCacheHas(key) {
|
|
1019
|
-
return getMapData(this, key).has(key);
|
|
1020
|
-
}
|
|
178
|
+
if (t[2]) _.ops.pop();
|
|
1021
179
|
|
|
1022
|
-
|
|
1023
|
-
* Sets the map `key` to `value`.
|
|
1024
|
-
*
|
|
1025
|
-
* @private
|
|
1026
|
-
* @name set
|
|
1027
|
-
* @memberOf MapCache
|
|
1028
|
-
* @param {string} key The key of the value to set.
|
|
1029
|
-
* @param {*} value The value to set.
|
|
1030
|
-
* @returns {Object} Returns the map cache instance.
|
|
1031
|
-
*/
|
|
1032
|
-
function mapCacheSet(key, value) {
|
|
1033
|
-
var data = getMapData(this, key),
|
|
1034
|
-
size = data.size;
|
|
1035
|
-
|
|
1036
|
-
data.set(key, value);
|
|
1037
|
-
this.size += data.size == size ? 0 : 1;
|
|
1038
|
-
return this;
|
|
1039
|
-
}
|
|
180
|
+
_.trys.pop();
|
|
1040
181
|
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
*
|
|
1044
|
-
* @private
|
|
1045
|
-
* @constructor
|
|
1046
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1047
|
-
*/
|
|
1048
|
-
function MapCache(entries) {
|
|
1049
|
-
var index = -1,
|
|
1050
|
-
length = entries == null ? 0 : entries.length;
|
|
1051
|
-
|
|
1052
|
-
this.clear();
|
|
1053
|
-
while (++index < length) {
|
|
1054
|
-
var entry = entries[index];
|
|
1055
|
-
this.set(entry[0], entry[1]);
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
1058
184
|
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
/** Used as the size to enable large array optimizations. */
|
|
1067
|
-
var LARGE_ARRAY_SIZE = 200;
|
|
1068
|
-
|
|
1069
|
-
/**
|
|
1070
|
-
* Sets the stack `key` to `value`.
|
|
1071
|
-
*
|
|
1072
|
-
* @private
|
|
1073
|
-
* @name set
|
|
1074
|
-
* @memberOf Stack
|
|
1075
|
-
* @param {string} key The key of the value to set.
|
|
1076
|
-
* @param {*} value The value to set.
|
|
1077
|
-
* @returns {Object} Returns the stack cache instance.
|
|
1078
|
-
*/
|
|
1079
|
-
function stackSet(key, value) {
|
|
1080
|
-
var data = this.__data__;
|
|
1081
|
-
if (data instanceof ListCache) {
|
|
1082
|
-
var pairs = data.__data__;
|
|
1083
|
-
if (!Map$2 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
|
1084
|
-
pairs.push([key, value]);
|
|
1085
|
-
this.size = ++data.size;
|
|
1086
|
-
return this;
|
|
185
|
+
op = body.call(thisArg, _);
|
|
186
|
+
} catch (e) {
|
|
187
|
+
op = [6, e];
|
|
188
|
+
y = 0;
|
|
189
|
+
} finally {
|
|
190
|
+
f = t = 0;
|
|
1087
191
|
}
|
|
1088
|
-
data = this.__data__ = new MapCache(pairs);
|
|
1089
192
|
}
|
|
1090
|
-
data.set(key, value);
|
|
1091
|
-
this.size = data.size;
|
|
1092
|
-
return this;
|
|
1093
|
-
}
|
|
1094
193
|
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1101
|
-
*/
|
|
1102
|
-
function Stack(entries) {
|
|
1103
|
-
var data = this.__data__ = new ListCache(entries);
|
|
1104
|
-
this.size = data.size;
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
// Add methods to `Stack`.
|
|
1108
|
-
Stack.prototype.clear = stackClear;
|
|
1109
|
-
Stack.prototype['delete'] = stackDelete;
|
|
1110
|
-
Stack.prototype.get = stackGet;
|
|
1111
|
-
Stack.prototype.has = stackHas;
|
|
1112
|
-
Stack.prototype.set = stackSet;
|
|
1113
|
-
|
|
1114
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
1115
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
1116
|
-
|
|
1117
|
-
/**
|
|
1118
|
-
* Adds `value` to the array cache.
|
|
1119
|
-
*
|
|
1120
|
-
* @private
|
|
1121
|
-
* @name add
|
|
1122
|
-
* @memberOf SetCache
|
|
1123
|
-
* @alias push
|
|
1124
|
-
* @param {*} value The value to cache.
|
|
1125
|
-
* @returns {Object} Returns the cache instance.
|
|
1126
|
-
*/
|
|
1127
|
-
function setCacheAdd(value) {
|
|
1128
|
-
this.__data__.set(value, HASH_UNDEFINED);
|
|
1129
|
-
return this;
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
/**
|
|
1133
|
-
* Checks if `value` is in the array cache.
|
|
1134
|
-
*
|
|
1135
|
-
* @private
|
|
1136
|
-
* @name has
|
|
1137
|
-
* @memberOf SetCache
|
|
1138
|
-
* @param {*} value The value to search for.
|
|
1139
|
-
* @returns {number} Returns `true` if `value` is found, else `false`.
|
|
1140
|
-
*/
|
|
1141
|
-
function setCacheHas(value) {
|
|
1142
|
-
return this.__data__.has(value);
|
|
194
|
+
if (op[0] & 5) throw op[1];
|
|
195
|
+
return {
|
|
196
|
+
value: op[0] ? op[1] : void 0,
|
|
197
|
+
done: true
|
|
198
|
+
};
|
|
1143
199
|
}
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
while (++index < length) {
|
|
1159
|
-
this.add(values[index]);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function __values(o) {
|
|
203
|
+
var s = typeof Symbol === "function" && Symbol.iterator,
|
|
204
|
+
m = s && o[s],
|
|
205
|
+
i = 0;
|
|
206
|
+
if (m) return m.call(o);
|
|
207
|
+
if (o && typeof o.length === "number") return {
|
|
208
|
+
next: function next() {
|
|
209
|
+
if (o && i >= o.length) o = void 0;
|
|
210
|
+
return {
|
|
211
|
+
value: o && o[i++],
|
|
212
|
+
done: !o
|
|
213
|
+
};
|
|
1160
214
|
}
|
|
1161
|
-
}
|
|
215
|
+
};
|
|
216
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
217
|
+
}
|
|
1162
218
|
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
/**
|
|
1168
|
-
* A specialized version of `_.some` for arrays without support for iteratee
|
|
1169
|
-
* shorthands.
|
|
1170
|
-
*
|
|
1171
|
-
* @private
|
|
1172
|
-
* @param {Array} [array] The array to iterate over.
|
|
1173
|
-
* @param {Function} predicate The function invoked per iteration.
|
|
1174
|
-
* @returns {boolean} Returns `true` if any element passes the predicate check,
|
|
1175
|
-
* else `false`.
|
|
1176
|
-
*/
|
|
1177
|
-
function arraySome(array, predicate) {
|
|
1178
|
-
var index = -1,
|
|
1179
|
-
length = array == null ? 0 : array.length;
|
|
1180
|
-
|
|
1181
|
-
while (++index < length) {
|
|
1182
|
-
if (predicate(array[index], index, array)) {
|
|
1183
|
-
return true;
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
return false;
|
|
219
|
+
function getIDEPropsPropertyObj(target, propertyKey) {
|
|
220
|
+
if (!target.constructor.IDEProps) {
|
|
221
|
+
target.constructor.IDEProps = {};
|
|
1187
222
|
}
|
|
1188
223
|
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
*
|
|
1192
|
-
* @private
|
|
1193
|
-
* @param {Object} cache The cache to query.
|
|
1194
|
-
* @param {string} key The key of the entry to check.
|
|
1195
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1196
|
-
*/
|
|
1197
|
-
function cacheHas(cache, key) {
|
|
1198
|
-
return cache.has(key);
|
|
224
|
+
if (!target.constructor.IDEProps[propertyKey]) {
|
|
225
|
+
target.constructor.IDEProps[propertyKey] = {};
|
|
1199
226
|
}
|
|
1200
227
|
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
/**
|
|
1206
|
-
* A specialized version of `baseIsEqualDeep` for arrays with support for
|
|
1207
|
-
* partial deep comparisons.
|
|
1208
|
-
*
|
|
1209
|
-
* @private
|
|
1210
|
-
* @param {Array} array The array to compare.
|
|
1211
|
-
* @param {Array} other The other array to compare.
|
|
1212
|
-
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
1213
|
-
* @param {Function} customizer The function to customize comparisons.
|
|
1214
|
-
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
1215
|
-
* @param {Object} stack Tracks traversed `array` and `other` objects.
|
|
1216
|
-
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
|
|
1217
|
-
*/
|
|
1218
|
-
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
1219
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
|
|
1220
|
-
arrLength = array.length,
|
|
1221
|
-
othLength = other.length;
|
|
1222
|
-
|
|
1223
|
-
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
1224
|
-
return false;
|
|
1225
|
-
}
|
|
1226
|
-
// Check that cyclic values are equal.
|
|
1227
|
-
var arrStacked = stack.get(array);
|
|
1228
|
-
var othStacked = stack.get(other);
|
|
1229
|
-
if (arrStacked && othStacked) {
|
|
1230
|
-
return arrStacked == other && othStacked == array;
|
|
1231
|
-
}
|
|
1232
|
-
var index = -1,
|
|
1233
|
-
result = true,
|
|
1234
|
-
seen = (bitmask & COMPARE_UNORDERED_FLAG$1) ? new SetCache : undefined;
|
|
1235
|
-
|
|
1236
|
-
stack.set(array, other);
|
|
1237
|
-
stack.set(other, array);
|
|
1238
|
-
|
|
1239
|
-
// Ignore non-index properties.
|
|
1240
|
-
while (++index < arrLength) {
|
|
1241
|
-
var arrValue = array[index],
|
|
1242
|
-
othValue = other[index];
|
|
1243
|
-
|
|
1244
|
-
if (customizer) {
|
|
1245
|
-
var compared = isPartial
|
|
1246
|
-
? customizer(othValue, arrValue, index, other, array, stack)
|
|
1247
|
-
: customizer(arrValue, othValue, index, array, other, stack);
|
|
1248
|
-
}
|
|
1249
|
-
if (compared !== undefined) {
|
|
1250
|
-
if (compared) {
|
|
1251
|
-
continue;
|
|
1252
|
-
}
|
|
1253
|
-
result = false;
|
|
1254
|
-
break;
|
|
1255
|
-
}
|
|
1256
|
-
// Recursively compare arrays (susceptible to call stack limits).
|
|
1257
|
-
if (seen) {
|
|
1258
|
-
if (!arraySome(other, function(othValue, othIndex) {
|
|
1259
|
-
if (!cacheHas(seen, othIndex) &&
|
|
1260
|
-
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
1261
|
-
return seen.push(othIndex);
|
|
1262
|
-
}
|
|
1263
|
-
})) {
|
|
1264
|
-
result = false;
|
|
1265
|
-
break;
|
|
1266
|
-
}
|
|
1267
|
-
} else if (!(
|
|
1268
|
-
arrValue === othValue ||
|
|
1269
|
-
equalFunc(arrValue, othValue, bitmask, customizer, stack)
|
|
1270
|
-
)) {
|
|
1271
|
-
result = false;
|
|
1272
|
-
break;
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
stack['delete'](array);
|
|
1276
|
-
stack['delete'](other);
|
|
1277
|
-
return result;
|
|
1278
|
-
}
|
|
228
|
+
var propertyObj = target.constructor.IDEProps[propertyKey];
|
|
229
|
+
return propertyObj;
|
|
230
|
+
}
|
|
1279
231
|
|
|
1280
|
-
|
|
1281
|
-
|
|
232
|
+
function type(type) {
|
|
233
|
+
return function (target, propertyKey) {
|
|
234
|
+
var prop = getIDEPropsPropertyObj(target, propertyKey);
|
|
235
|
+
prop.key = propertyKey;
|
|
236
|
+
prop.type = type;
|
|
237
|
+
};
|
|
238
|
+
}
|
|
1282
239
|
|
|
1283
|
-
|
|
240
|
+
function step(step) {
|
|
241
|
+
return function (target, propertyKey) {
|
|
242
|
+
var prop = getIDEPropsPropertyObj(target, propertyKey);
|
|
243
|
+
prop.step = step;
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function uuid(len) {
|
|
248
|
+
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
|
|
249
|
+
var uuid = [];
|
|
250
|
+
var radix = chars.length;
|
|
251
|
+
|
|
252
|
+
for (var i = 0; i < len; i++) {
|
|
253
|
+
uuid[i] = chars[0 | Math.random() * radix];
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return uuid.join('');
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
var setStyle = function setStyle(element, style) {
|
|
260
|
+
var width = style.width,
|
|
261
|
+
height = style.height,
|
|
262
|
+
position = style.position,
|
|
263
|
+
_a = style.left,
|
|
264
|
+
left = _a === void 0 ? 0 : _a,
|
|
265
|
+
_b = style.top,
|
|
266
|
+
top = _b === void 0 ? 0 : _b,
|
|
267
|
+
zIndex = style.zIndex,
|
|
268
|
+
pointerEvents = style.pointerEvents,
|
|
269
|
+
background = style.background;
|
|
270
|
+
element.style.width = width + "px";
|
|
271
|
+
element.style.height = height + "px";
|
|
272
|
+
element.style.position = position;
|
|
273
|
+
element.style.left = "" + left;
|
|
274
|
+
element.style.top = "" + top;
|
|
275
|
+
element.style.zIndex = "" + zIndex;
|
|
276
|
+
element.style.pointerEvents = pointerEvents;
|
|
277
|
+
element.style.background = background;
|
|
278
|
+
element.style.border = 'none';
|
|
279
|
+
element.style.overflow = 'hidden';
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
var setTransform = function setTransform(element, transform, ratioX, ratioY) {
|
|
283
|
+
var worldTransform = transform.worldTransform;
|
|
284
|
+
var a = worldTransform.a,
|
|
285
|
+
b = worldTransform.b,
|
|
286
|
+
c = worldTransform.c,
|
|
287
|
+
d = worldTransform.d,
|
|
288
|
+
tx = worldTransform.tx,
|
|
289
|
+
ty = worldTransform.ty;
|
|
290
|
+
var matrix = "matrix(" + a + ", " + b + ", " + c + ", " + d + ", " + tx * ratioX + ", " + ty * ratioY + ")";
|
|
291
|
+
element.style.transform = "" + matrix;
|
|
292
|
+
element.style.webkitTransform = "" + matrix;
|
|
293
|
+
element.style.transformOrigin = 'left top';
|
|
294
|
+
element.style.webkitTransformOrigin = 'left top';
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
var A11y = function (_super) {
|
|
298
|
+
__extends(A11y, _super);
|
|
299
|
+
|
|
300
|
+
function A11y(param) {
|
|
301
|
+
var _this = _super.call(this) || this;
|
|
302
|
+
|
|
303
|
+
_extends(_this, param);
|
|
304
|
+
|
|
305
|
+
var _a = param.hint,
|
|
306
|
+
hint = _a === void 0 ? '' : _a,
|
|
307
|
+
event = param.event,
|
|
308
|
+
_b = param.delay,
|
|
309
|
+
delay = _b === void 0 ? 0 : _b,
|
|
310
|
+
_c = param.attr,
|
|
311
|
+
attr = _c === void 0 ? {} : _c,
|
|
312
|
+
_d = param.role,
|
|
313
|
+
role = _d === void 0 ? '' : _d,
|
|
314
|
+
_e = param.props,
|
|
315
|
+
props = _e === void 0 ? {} : _e,
|
|
316
|
+
_f = param.state,
|
|
317
|
+
state = _f === void 0 ? {} : _f;
|
|
318
|
+
_this.hint = hint;
|
|
319
|
+
_this.event = event;
|
|
320
|
+
_this.delay = delay;
|
|
321
|
+
_this.attr = attr;
|
|
322
|
+
_this.role = role;
|
|
323
|
+
_this.props = props;
|
|
324
|
+
_this.state = state;
|
|
325
|
+
_this.a11yId = "_" + uuid(6);
|
|
326
|
+
return _this;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
A11y.componentName = 'A11y';
|
|
330
|
+
|
|
331
|
+
__decorate([type('boolean')], A11y.prototype, "interactive", void 0);
|
|
332
|
+
|
|
333
|
+
__decorate([type('string')], A11y.prototype, "hint", void 0);
|
|
334
|
+
|
|
335
|
+
__decorate([type('number'), step(1)], A11y.prototype, "delay", void 0);
|
|
336
|
+
|
|
337
|
+
__decorate([type('string')], A11y.prototype, "role", void 0);
|
|
338
|
+
|
|
339
|
+
__decorate([type('string')], A11y.prototype, "a11yId", void 0);
|
|
340
|
+
|
|
341
|
+
return A11y;
|
|
342
|
+
}(eva_js.Component);
|
|
343
|
+
|
|
344
|
+
var A11y$1 = A11y;
|
|
345
|
+
var POSITION = 'absolute';
|
|
346
|
+
var ZINDEX = 3;
|
|
347
|
+
exports.A11yActivate = void 0;
|
|
348
|
+
|
|
349
|
+
(function (A11yActivate) {
|
|
350
|
+
A11yActivate[A11yActivate["ENABLE"] = 0] = "ENABLE";
|
|
351
|
+
A11yActivate[A11yActivate["DISABLE"] = 1] = "DISABLE";
|
|
352
|
+
A11yActivate[A11yActivate["CHECK"] = 2] = "CHECK";
|
|
353
|
+
})(exports.A11yActivate || (exports.A11yActivate = {}));
|
|
354
|
+
|
|
355
|
+
var PointerEvents;
|
|
356
|
+
|
|
357
|
+
(function (PointerEvents) {
|
|
358
|
+
PointerEvents["NONE"] = "none";
|
|
359
|
+
PointerEvents["AUTO"] = "auto";
|
|
360
|
+
})(PointerEvents || (PointerEvents = {}));
|
|
361
|
+
|
|
362
|
+
var MaskBackground;
|
|
363
|
+
|
|
364
|
+
(function (MaskBackground) {
|
|
365
|
+
MaskBackground["DEBUG"] = "rgba(255,0,0,0.5)";
|
|
366
|
+
MaskBackground["NONE"] = "transparent";
|
|
367
|
+
})(MaskBackground || (MaskBackground = {}));
|
|
368
|
+
|
|
369
|
+
var ElementType;
|
|
370
|
+
|
|
371
|
+
(function (ElementType) {
|
|
372
|
+
ElementType["BUTTON"] = "button";
|
|
373
|
+
ElementType["DIV"] = "div";
|
|
374
|
+
})(ElementType || (ElementType = {}));
|
|
375
|
+
|
|
376
|
+
var notAttr = ['hint', 'event', 'delay', 'attr', 'role', 'props', 'state', 'a11yId', 'name'];
|
|
377
|
+
|
|
378
|
+
var getEventFunc = function getEventFunc(event, gameObject, e) {
|
|
379
|
+
var _this = this;
|
|
380
|
+
|
|
381
|
+
['touchstart', 'touchend', 'tap'].forEach(function (name) {
|
|
382
|
+
event.emit(name, {
|
|
383
|
+
stopPropagation: function stopPropagation() {
|
|
384
|
+
return e.stopPropagation();
|
|
385
|
+
},
|
|
386
|
+
data: {
|
|
387
|
+
position: _this.eventPosition
|
|
388
|
+
},
|
|
389
|
+
gameObject: gameObject
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
};
|
|
1284
393
|
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
*
|
|
1288
|
-
* @private
|
|
1289
|
-
* @param {Object} map The map to convert.
|
|
1290
|
-
* @returns {Array} Returns the key-value pairs.
|
|
1291
|
-
*/
|
|
1292
|
-
function mapToArray(map) {
|
|
1293
|
-
var index = -1,
|
|
1294
|
-
result = Array(map.size);
|
|
394
|
+
var A11ySystem = function (_super) {
|
|
395
|
+
__extends(A11ySystem, _super);
|
|
1295
396
|
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
});
|
|
1299
|
-
return result;
|
|
1300
|
-
}
|
|
397
|
+
function A11ySystem(opt) {
|
|
398
|
+
var _this = _super.call(this, opt) || this;
|
|
1301
399
|
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
* @param {Object} set The set to convert.
|
|
1307
|
-
* @returns {Array} Returns the values.
|
|
1308
|
-
*/
|
|
1309
|
-
function setToArray(set) {
|
|
1310
|
-
var index = -1,
|
|
1311
|
-
result = Array(set.size);
|
|
1312
|
-
|
|
1313
|
-
set.forEach(function(value) {
|
|
1314
|
-
result[++index] = value;
|
|
1315
|
-
});
|
|
1316
|
-
return result;
|
|
400
|
+
_this.cache = new Map();
|
|
401
|
+
_this.eventCache = new Map();
|
|
402
|
+
_this.zIndex = ZINDEX;
|
|
403
|
+
return _this;
|
|
1317
404
|
}
|
|
1318
405
|
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
dateTag$1 = '[object Date]',
|
|
1326
|
-
errorTag$1 = '[object Error]',
|
|
1327
|
-
mapTag$2 = '[object Map]',
|
|
1328
|
-
numberTag$1 = '[object Number]',
|
|
1329
|
-
regexpTag$1 = '[object RegExp]',
|
|
1330
|
-
setTag$2 = '[object Set]',
|
|
1331
|
-
stringTag$1 = '[object String]',
|
|
1332
|
-
symbolTag = '[object Symbol]';
|
|
1333
|
-
|
|
1334
|
-
var arrayBufferTag$1 = '[object ArrayBuffer]',
|
|
1335
|
-
dataViewTag$2 = '[object DataView]';
|
|
1336
|
-
|
|
1337
|
-
/** Used to convert symbols to primitives and strings. */
|
|
1338
|
-
var symbolProto = Symbol$2 ? Symbol$2.prototype : undefined,
|
|
1339
|
-
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
|
1340
|
-
|
|
1341
|
-
/**
|
|
1342
|
-
* A specialized version of `baseIsEqualDeep` for comparing objects of
|
|
1343
|
-
* the same `toStringTag`.
|
|
1344
|
-
*
|
|
1345
|
-
* **Note:** This function only supports comparing values with tags of
|
|
1346
|
-
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
|
|
1347
|
-
*
|
|
1348
|
-
* @private
|
|
1349
|
-
* @param {Object} object The object to compare.
|
|
1350
|
-
* @param {Object} other The other object to compare.
|
|
1351
|
-
* @param {string} tag The `toStringTag` of the objects to compare.
|
|
1352
|
-
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
1353
|
-
* @param {Function} customizer The function to customize comparisons.
|
|
1354
|
-
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
1355
|
-
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
|
1356
|
-
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
1357
|
-
*/
|
|
1358
|
-
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
1359
|
-
switch (tag) {
|
|
1360
|
-
case dataViewTag$2:
|
|
1361
|
-
if ((object.byteLength != other.byteLength) ||
|
|
1362
|
-
(object.byteOffset != other.byteOffset)) {
|
|
1363
|
-
return false;
|
|
1364
|
-
}
|
|
1365
|
-
object = object.buffer;
|
|
1366
|
-
other = other.buffer;
|
|
406
|
+
Object.defineProperty(A11ySystem.prototype, "ratioX", {
|
|
407
|
+
get: function get() {
|
|
408
|
+
if (this._ratioX) {
|
|
409
|
+
return this._ratioX;
|
|
410
|
+
} else {
|
|
411
|
+
var success = this.setRatio();
|
|
1367
412
|
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
return
|
|
1372
|
-
}
|
|
1373
|
-
return true;
|
|
1374
|
-
|
|
1375
|
-
case boolTag$1:
|
|
1376
|
-
case dateTag$1:
|
|
1377
|
-
case numberTag$1:
|
|
1378
|
-
// Coerce booleans to `1` or `0` and dates to milliseconds.
|
|
1379
|
-
// Invalid dates are coerced to `NaN`.
|
|
1380
|
-
return eq(+object, +other);
|
|
1381
|
-
|
|
1382
|
-
case errorTag$1:
|
|
1383
|
-
return object.name == other.name && object.message == other.message;
|
|
1384
|
-
|
|
1385
|
-
case regexpTag$1:
|
|
1386
|
-
case stringTag$1:
|
|
1387
|
-
// Coerce regexes to strings and treat strings, primitives and objects,
|
|
1388
|
-
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
|
|
1389
|
-
// for more details.
|
|
1390
|
-
return object == (other + '');
|
|
1391
|
-
|
|
1392
|
-
case mapTag$2:
|
|
1393
|
-
var convert = mapToArray;
|
|
1394
|
-
|
|
1395
|
-
case setTag$2:
|
|
1396
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
|
|
1397
|
-
convert || (convert = setToArray);
|
|
1398
|
-
|
|
1399
|
-
if (object.size != other.size && !isPartial) {
|
|
1400
|
-
return false;
|
|
413
|
+
if (success) {
|
|
414
|
+
return this._ratioX;
|
|
415
|
+
} else {
|
|
416
|
+
return 0;
|
|
1401
417
|
}
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
return result;
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
enumerable: false,
|
|
421
|
+
configurable: true
|
|
422
|
+
});
|
|
423
|
+
Object.defineProperty(A11ySystem.prototype, "ratioY", {
|
|
424
|
+
get: function get() {
|
|
425
|
+
if (this._ratioY) {
|
|
426
|
+
return this._ratioY;
|
|
427
|
+
} else {
|
|
428
|
+
var success = this.setRatio();
|
|
1414
429
|
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
430
|
+
if (success) {
|
|
431
|
+
return this._ratioY;
|
|
432
|
+
} else {
|
|
433
|
+
return 0;
|
|
1418
434
|
}
|
|
1419
|
-
}
|
|
1420
|
-
return false;
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
|
-
/**
|
|
1424
|
-
* Appends the elements of `values` to `array`.
|
|
1425
|
-
*
|
|
1426
|
-
* @private
|
|
1427
|
-
* @param {Array} array The array to modify.
|
|
1428
|
-
* @param {Array} values The values to append.
|
|
1429
|
-
* @returns {Array} Returns `array`.
|
|
1430
|
-
*/
|
|
1431
|
-
function arrayPush(array, values) {
|
|
1432
|
-
var index = -1,
|
|
1433
|
-
length = values.length,
|
|
1434
|
-
offset = array.length;
|
|
1435
|
-
|
|
1436
|
-
while (++index < length) {
|
|
1437
|
-
array[offset + index] = values[index];
|
|
1438
|
-
}
|
|
1439
|
-
return array;
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
/**
|
|
1443
|
-
* Checks if `value` is classified as an `Array` object.
|
|
1444
|
-
*
|
|
1445
|
-
* @static
|
|
1446
|
-
* @memberOf _
|
|
1447
|
-
* @since 0.1.0
|
|
1448
|
-
* @category Lang
|
|
1449
|
-
* @param {*} value The value to check.
|
|
1450
|
-
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
1451
|
-
* @example
|
|
1452
|
-
*
|
|
1453
|
-
* _.isArray([1, 2, 3]);
|
|
1454
|
-
* // => true
|
|
1455
|
-
*
|
|
1456
|
-
* _.isArray(document.body.children);
|
|
1457
|
-
* // => false
|
|
1458
|
-
*
|
|
1459
|
-
* _.isArray('abc');
|
|
1460
|
-
* // => false
|
|
1461
|
-
*
|
|
1462
|
-
* _.isArray(_.noop);
|
|
1463
|
-
* // => false
|
|
1464
|
-
*/
|
|
1465
|
-
var isArray = Array.isArray;
|
|
1466
|
-
|
|
1467
|
-
var isArray$1 = isArray;
|
|
1468
|
-
|
|
1469
|
-
/**
|
|
1470
|
-
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
|
|
1471
|
-
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
|
|
1472
|
-
* symbols of `object`.
|
|
1473
|
-
*
|
|
1474
|
-
* @private
|
|
1475
|
-
* @param {Object} object The object to query.
|
|
1476
|
-
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
1477
|
-
* @param {Function} symbolsFunc The function to get the symbols of `object`.
|
|
1478
|
-
* @returns {Array} Returns the array of property names and symbols.
|
|
1479
|
-
*/
|
|
1480
|
-
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
1481
|
-
var result = keysFunc(object);
|
|
1482
|
-
return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
1483
|
-
}
|
|
1484
|
-
|
|
1485
|
-
/**
|
|
1486
|
-
* A specialized version of `_.filter` for arrays without support for
|
|
1487
|
-
* iteratee shorthands.
|
|
1488
|
-
*
|
|
1489
|
-
* @private
|
|
1490
|
-
* @param {Array} [array] The array to iterate over.
|
|
1491
|
-
* @param {Function} predicate The function invoked per iteration.
|
|
1492
|
-
* @returns {Array} Returns the new filtered array.
|
|
1493
|
-
*/
|
|
1494
|
-
function arrayFilter(array, predicate) {
|
|
1495
|
-
var index = -1,
|
|
1496
|
-
length = array == null ? 0 : array.length,
|
|
1497
|
-
resIndex = 0,
|
|
1498
|
-
result = [];
|
|
1499
|
-
|
|
1500
|
-
while (++index < length) {
|
|
1501
|
-
var value = array[index];
|
|
1502
|
-
if (predicate(value, index, array)) {
|
|
1503
|
-
result[resIndex++] = value;
|
|
1504
435
|
}
|
|
1505
|
-
}
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
/**
|
|
1510
|
-
* This method returns a new empty array.
|
|
1511
|
-
*
|
|
1512
|
-
* @static
|
|
1513
|
-
* @memberOf _
|
|
1514
|
-
* @since 4.13.0
|
|
1515
|
-
* @category Util
|
|
1516
|
-
* @returns {Array} Returns the new empty array.
|
|
1517
|
-
* @example
|
|
1518
|
-
*
|
|
1519
|
-
* var arrays = _.times(2, _.stubArray);
|
|
1520
|
-
*
|
|
1521
|
-
* console.log(arrays);
|
|
1522
|
-
* // => [[], []]
|
|
1523
|
-
*
|
|
1524
|
-
* console.log(arrays[0] === arrays[1]);
|
|
1525
|
-
* // => false
|
|
1526
|
-
*/
|
|
1527
|
-
function stubArray() {
|
|
1528
|
-
return [];
|
|
1529
|
-
}
|
|
1530
|
-
|
|
1531
|
-
/** Used for built-in method references. */
|
|
1532
|
-
var objectProto$6 = Object.prototype;
|
|
1533
|
-
|
|
1534
|
-
/** Built-in value references. */
|
|
1535
|
-
var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
|
|
1536
|
-
|
|
1537
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
1538
|
-
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
1539
|
-
|
|
1540
|
-
/**
|
|
1541
|
-
* Creates an array of the own enumerable symbols of `object`.
|
|
1542
|
-
*
|
|
1543
|
-
* @private
|
|
1544
|
-
* @param {Object} object The object to query.
|
|
1545
|
-
* @returns {Array} Returns the array of symbols.
|
|
1546
|
-
*/
|
|
1547
|
-
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
|
|
1548
|
-
if (object == null) {
|
|
1549
|
-
return [];
|
|
1550
|
-
}
|
|
1551
|
-
object = Object(object);
|
|
1552
|
-
return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
1553
|
-
return propertyIsEnumerable$1.call(object, symbol);
|
|
1554
|
-
});
|
|
1555
|
-
};
|
|
436
|
+
},
|
|
437
|
+
enumerable: false,
|
|
438
|
+
configurable: true
|
|
439
|
+
});
|
|
1556
440
|
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
* The base implementation of `_.times` without support for iteratee shorthands
|
|
1561
|
-
* or max array length checks.
|
|
1562
|
-
*
|
|
1563
|
-
* @private
|
|
1564
|
-
* @param {number} n The number of times to invoke `iteratee`.
|
|
1565
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
1566
|
-
* @returns {Array} Returns the array of results.
|
|
1567
|
-
*/
|
|
1568
|
-
function baseTimes(n, iteratee) {
|
|
1569
|
-
var index = -1,
|
|
1570
|
-
result = Array(n);
|
|
1571
|
-
|
|
1572
|
-
while (++index < n) {
|
|
1573
|
-
result[index] = iteratee(index);
|
|
441
|
+
A11ySystem.prototype.init = function (opt) {
|
|
442
|
+
if (opt === void 0) {
|
|
443
|
+
opt = {};
|
|
1574
444
|
}
|
|
1575
|
-
return result;
|
|
1576
|
-
}
|
|
1577
|
-
|
|
1578
|
-
/**
|
|
1579
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
1580
|
-
* and has a `typeof` result of "object".
|
|
1581
|
-
*
|
|
1582
|
-
* @static
|
|
1583
|
-
* @memberOf _
|
|
1584
|
-
* @since 4.0.0
|
|
1585
|
-
* @category Lang
|
|
1586
|
-
* @param {*} value The value to check.
|
|
1587
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
1588
|
-
* @example
|
|
1589
|
-
*
|
|
1590
|
-
* _.isObjectLike({});
|
|
1591
|
-
* // => true
|
|
1592
|
-
*
|
|
1593
|
-
* _.isObjectLike([1, 2, 3]);
|
|
1594
|
-
* // => true
|
|
1595
|
-
*
|
|
1596
|
-
* _.isObjectLike(_.noop);
|
|
1597
|
-
* // => false
|
|
1598
|
-
*
|
|
1599
|
-
* _.isObjectLike(null);
|
|
1600
|
-
* // => false
|
|
1601
|
-
*/
|
|
1602
|
-
function isObjectLike(value) {
|
|
1603
|
-
return value != null && typeof value == 'object';
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
/** `Object#toString` result references. */
|
|
1607
|
-
var argsTag$2 = '[object Arguments]';
|
|
1608
|
-
|
|
1609
|
-
/**
|
|
1610
|
-
* The base implementation of `_.isArguments`.
|
|
1611
|
-
*
|
|
1612
|
-
* @private
|
|
1613
|
-
* @param {*} value The value to check.
|
|
1614
|
-
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
1615
|
-
*/
|
|
1616
|
-
function baseIsArguments(value) {
|
|
1617
|
-
return isObjectLike(value) && baseGetTag(value) == argsTag$2;
|
|
1618
|
-
}
|
|
1619
|
-
|
|
1620
|
-
/** Used for built-in method references. */
|
|
1621
|
-
var objectProto$5 = Object.prototype;
|
|
1622
|
-
|
|
1623
|
-
/** Used to check objects for own properties. */
|
|
1624
|
-
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
|
1625
|
-
|
|
1626
|
-
/** Built-in value references. */
|
|
1627
|
-
var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
|
|
1628
|
-
|
|
1629
|
-
/**
|
|
1630
|
-
* Checks if `value` is likely an `arguments` object.
|
|
1631
|
-
*
|
|
1632
|
-
* @static
|
|
1633
|
-
* @memberOf _
|
|
1634
|
-
* @since 0.1.0
|
|
1635
|
-
* @category Lang
|
|
1636
|
-
* @param {*} value The value to check.
|
|
1637
|
-
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
1638
|
-
* else `false`.
|
|
1639
|
-
* @example
|
|
1640
|
-
*
|
|
1641
|
-
* _.isArguments(function() { return arguments; }());
|
|
1642
|
-
* // => true
|
|
1643
|
-
*
|
|
1644
|
-
* _.isArguments([1, 2, 3]);
|
|
1645
|
-
* // => false
|
|
1646
|
-
*/
|
|
1647
|
-
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
|
1648
|
-
return isObjectLike(value) && hasOwnProperty$4.call(value, 'callee') &&
|
|
1649
|
-
!propertyIsEnumerable.call(value, 'callee');
|
|
1650
|
-
};
|
|
1651
445
|
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
/**
|
|
1655
|
-
* This method returns `false`.
|
|
1656
|
-
*
|
|
1657
|
-
* @static
|
|
1658
|
-
* @memberOf _
|
|
1659
|
-
* @since 4.13.0
|
|
1660
|
-
* @category Util
|
|
1661
|
-
* @returns {boolean} Returns `false`.
|
|
1662
|
-
* @example
|
|
1663
|
-
*
|
|
1664
|
-
* _.times(2, _.stubFalse);
|
|
1665
|
-
* // => [false, false]
|
|
1666
|
-
*/
|
|
1667
|
-
function stubFalse() {
|
|
1668
|
-
return false;
|
|
1669
|
-
}
|
|
446
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
447
|
+
var _a, activate, _b, delay, _c, checkA11yOpen, zIndex, _d, _e, div;
|
|
1670
448
|
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
/** Built-in value references. */
|
|
1681
|
-
var Buffer = moduleExports$1 ? root$1.Buffer : undefined;
|
|
1682
|
-
|
|
1683
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
1684
|
-
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
1685
|
-
|
|
1686
|
-
/**
|
|
1687
|
-
* Checks if `value` is a buffer.
|
|
1688
|
-
*
|
|
1689
|
-
* @static
|
|
1690
|
-
* @memberOf _
|
|
1691
|
-
* @since 4.3.0
|
|
1692
|
-
* @category Lang
|
|
1693
|
-
* @param {*} value The value to check.
|
|
1694
|
-
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
1695
|
-
* @example
|
|
1696
|
-
*
|
|
1697
|
-
* _.isBuffer(new Buffer(2));
|
|
1698
|
-
* // => true
|
|
1699
|
-
*
|
|
1700
|
-
* _.isBuffer(new Uint8Array(2));
|
|
1701
|
-
* // => false
|
|
1702
|
-
*/
|
|
1703
|
-
var isBuffer = nativeIsBuffer || stubFalse;
|
|
1704
|
-
|
|
1705
|
-
var isBuffer$1 = isBuffer;
|
|
1706
|
-
|
|
1707
|
-
/** Used as references for various `Number` constants. */
|
|
1708
|
-
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
1709
|
-
|
|
1710
|
-
/** Used to detect unsigned integer values. */
|
|
1711
|
-
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
1712
|
-
|
|
1713
|
-
/**
|
|
1714
|
-
* Checks if `value` is a valid array-like index.
|
|
1715
|
-
*
|
|
1716
|
-
* @private
|
|
1717
|
-
* @param {*} value The value to check.
|
|
1718
|
-
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
1719
|
-
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
1720
|
-
*/
|
|
1721
|
-
function isIndex(value, length) {
|
|
1722
|
-
var type = typeof value;
|
|
1723
|
-
length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
|
1724
|
-
|
|
1725
|
-
return !!length &&
|
|
1726
|
-
(type == 'number' ||
|
|
1727
|
-
(type != 'symbol' && reIsUint.test(value))) &&
|
|
1728
|
-
(value > -1 && value % 1 == 0 && value < length);
|
|
1729
|
-
}
|
|
449
|
+
return __generator(this, function (_f) {
|
|
450
|
+
switch (_f.label) {
|
|
451
|
+
case 0:
|
|
452
|
+
_a = opt.activate, activate = _a === void 0 ? exports.A11yActivate.CHECK : _a, _b = opt.delay, delay = _b === void 0 ? 100 : _b, _c = opt.checkA11yOpen, checkA11yOpen = _c === void 0 ? function () {
|
|
453
|
+
return Promise.resolve(false);
|
|
454
|
+
} : _c, zIndex = opt.zIndex;
|
|
455
|
+
this.delay = delay;
|
|
456
|
+
this.zIndex = zIndex || this.zIndex;
|
|
457
|
+
_d = activate;
|
|
1730
458
|
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
/**
|
|
1735
|
-
* Checks if `value` is a valid array-like length.
|
|
1736
|
-
*
|
|
1737
|
-
* **Note:** This method is loosely based on
|
|
1738
|
-
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
1739
|
-
*
|
|
1740
|
-
* @static
|
|
1741
|
-
* @memberOf _
|
|
1742
|
-
* @since 4.0.0
|
|
1743
|
-
* @category Lang
|
|
1744
|
-
* @param {*} value The value to check.
|
|
1745
|
-
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
1746
|
-
* @example
|
|
1747
|
-
*
|
|
1748
|
-
* _.isLength(3);
|
|
1749
|
-
* // => true
|
|
1750
|
-
*
|
|
1751
|
-
* _.isLength(Number.MIN_VALUE);
|
|
1752
|
-
* // => false
|
|
1753
|
-
*
|
|
1754
|
-
* _.isLength(Infinity);
|
|
1755
|
-
* // => false
|
|
1756
|
-
*
|
|
1757
|
-
* _.isLength('3');
|
|
1758
|
-
* // => false
|
|
1759
|
-
*/
|
|
1760
|
-
function isLength(value) {
|
|
1761
|
-
return typeof value == 'number' &&
|
|
1762
|
-
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
1763
|
-
}
|
|
459
|
+
switch (_d) {
|
|
460
|
+
case exports.A11yActivate.CHECK:
|
|
461
|
+
return [3, 1];
|
|
1764
462
|
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
arrayTag$1 = '[object Array]',
|
|
1768
|
-
boolTag = '[object Boolean]',
|
|
1769
|
-
dateTag = '[object Date]',
|
|
1770
|
-
errorTag = '[object Error]',
|
|
1771
|
-
funcTag = '[object Function]',
|
|
1772
|
-
mapTag$1 = '[object Map]',
|
|
1773
|
-
numberTag = '[object Number]',
|
|
1774
|
-
objectTag$2 = '[object Object]',
|
|
1775
|
-
regexpTag = '[object RegExp]',
|
|
1776
|
-
setTag$1 = '[object Set]',
|
|
1777
|
-
stringTag = '[object String]',
|
|
1778
|
-
weakMapTag$1 = '[object WeakMap]';
|
|
1779
|
-
|
|
1780
|
-
var arrayBufferTag = '[object ArrayBuffer]',
|
|
1781
|
-
dataViewTag$1 = '[object DataView]',
|
|
1782
|
-
float32Tag = '[object Float32Array]',
|
|
1783
|
-
float64Tag = '[object Float64Array]',
|
|
1784
|
-
int8Tag = '[object Int8Array]',
|
|
1785
|
-
int16Tag = '[object Int16Array]',
|
|
1786
|
-
int32Tag = '[object Int32Array]',
|
|
1787
|
-
uint8Tag = '[object Uint8Array]',
|
|
1788
|
-
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
1789
|
-
uint16Tag = '[object Uint16Array]',
|
|
1790
|
-
uint32Tag = '[object Uint32Array]';
|
|
1791
|
-
|
|
1792
|
-
/** Used to identify `toStringTag` values of typed arrays. */
|
|
1793
|
-
var typedArrayTags = {};
|
|
1794
|
-
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
|
1795
|
-
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
|
1796
|
-
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
|
1797
|
-
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
|
1798
|
-
typedArrayTags[uint32Tag] = true;
|
|
1799
|
-
typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
|
|
1800
|
-
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
|
1801
|
-
typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] =
|
|
1802
|
-
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
|
1803
|
-
typedArrayTags[mapTag$1] = typedArrayTags[numberTag] =
|
|
1804
|
-
typedArrayTags[objectTag$2] = typedArrayTags[regexpTag] =
|
|
1805
|
-
typedArrayTags[setTag$1] = typedArrayTags[stringTag] =
|
|
1806
|
-
typedArrayTags[weakMapTag$1] = false;
|
|
1807
|
-
|
|
1808
|
-
/**
|
|
1809
|
-
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
1810
|
-
*
|
|
1811
|
-
* @private
|
|
1812
|
-
* @param {*} value The value to check.
|
|
1813
|
-
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
1814
|
-
*/
|
|
1815
|
-
function baseIsTypedArray(value) {
|
|
1816
|
-
return isObjectLike(value) &&
|
|
1817
|
-
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
1818
|
-
}
|
|
463
|
+
case exports.A11yActivate.DISABLE:
|
|
464
|
+
return [3, 5];
|
|
1819
465
|
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
* @private
|
|
1824
|
-
* @param {Function} func The function to cap arguments for.
|
|
1825
|
-
* @returns {Function} Returns the new capped function.
|
|
1826
|
-
*/
|
|
1827
|
-
function baseUnary(func) {
|
|
1828
|
-
return function(value) {
|
|
1829
|
-
return func(value);
|
|
1830
|
-
};
|
|
1831
|
-
}
|
|
466
|
+
case exports.A11yActivate.ENABLE:
|
|
467
|
+
return [3, 6];
|
|
468
|
+
}
|
|
1832
469
|
|
|
1833
|
-
|
|
1834
|
-
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
|
470
|
+
return [3, 7];
|
|
1835
471
|
|
|
1836
|
-
|
|
1837
|
-
|
|
472
|
+
case 1:
|
|
473
|
+
_f.trys.push([1, 3,, 4]);
|
|
1838
474
|
|
|
1839
|
-
|
|
1840
|
-
|
|
475
|
+
_e = this;
|
|
476
|
+
return [4, checkA11yOpen()];
|
|
1841
477
|
|
|
1842
|
-
|
|
1843
|
-
|
|
478
|
+
case 2:
|
|
479
|
+
_e.activate = _f.sent();
|
|
480
|
+
return [3, 4];
|
|
1844
481
|
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
try {
|
|
1848
|
-
// Use `util.types` for Node.js 10+.
|
|
1849
|
-
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
482
|
+
case 3:
|
|
483
|
+
_f.sent();
|
|
1850
484
|
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
}
|
|
485
|
+
this.activate = false;
|
|
486
|
+
return [3, 4];
|
|
1854
487
|
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
} catch (e) {}
|
|
1858
|
-
}());
|
|
1859
|
-
|
|
1860
|
-
var nodeUtil$1 = nodeUtil;
|
|
1861
|
-
|
|
1862
|
-
/* Node.js helper references. */
|
|
1863
|
-
var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
|
|
1864
|
-
|
|
1865
|
-
/**
|
|
1866
|
-
* Checks if `value` is classified as a typed array.
|
|
1867
|
-
*
|
|
1868
|
-
* @static
|
|
1869
|
-
* @memberOf _
|
|
1870
|
-
* @since 3.0.0
|
|
1871
|
-
* @category Lang
|
|
1872
|
-
* @param {*} value The value to check.
|
|
1873
|
-
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
1874
|
-
* @example
|
|
1875
|
-
*
|
|
1876
|
-
* _.isTypedArray(new Uint8Array);
|
|
1877
|
-
* // => true
|
|
1878
|
-
*
|
|
1879
|
-
* _.isTypedArray([]);
|
|
1880
|
-
* // => false
|
|
1881
|
-
*/
|
|
1882
|
-
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
1883
|
-
|
|
1884
|
-
var isTypedArray$1 = isTypedArray;
|
|
1885
|
-
|
|
1886
|
-
/** Used for built-in method references. */
|
|
1887
|
-
var objectProto$4 = Object.prototype;
|
|
1888
|
-
|
|
1889
|
-
/** Used to check objects for own properties. */
|
|
1890
|
-
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
1891
|
-
|
|
1892
|
-
/**
|
|
1893
|
-
* Creates an array of the enumerable property names of the array-like `value`.
|
|
1894
|
-
*
|
|
1895
|
-
* @private
|
|
1896
|
-
* @param {*} value The value to query.
|
|
1897
|
-
* @param {boolean} inherited Specify returning inherited property names.
|
|
1898
|
-
* @returns {Array} Returns the array of property names.
|
|
1899
|
-
*/
|
|
1900
|
-
function arrayLikeKeys(value, inherited) {
|
|
1901
|
-
var isArr = isArray$1(value),
|
|
1902
|
-
isArg = !isArr && isArguments$1(value),
|
|
1903
|
-
isBuff = !isArr && !isArg && isBuffer$1(value),
|
|
1904
|
-
isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
|
|
1905
|
-
skipIndexes = isArr || isArg || isBuff || isType,
|
|
1906
|
-
result = skipIndexes ? baseTimes(value.length, String) : [],
|
|
1907
|
-
length = result.length;
|
|
1908
|
-
|
|
1909
|
-
for (var key in value) {
|
|
1910
|
-
if ((inherited || hasOwnProperty$3.call(value, key)) &&
|
|
1911
|
-
!(skipIndexes && (
|
|
1912
|
-
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1913
|
-
key == 'length' ||
|
|
1914
|
-
// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1915
|
-
(isBuff && (key == 'offset' || key == 'parent')) ||
|
|
1916
|
-
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1917
|
-
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
|
1918
|
-
// Skip index properties.
|
|
1919
|
-
isIndex(key, length)
|
|
1920
|
-
))) {
|
|
1921
|
-
result.push(key);
|
|
1922
|
-
}
|
|
1923
|
-
}
|
|
1924
|
-
return result;
|
|
1925
|
-
}
|
|
488
|
+
case 4:
|
|
489
|
+
return [3, 7];
|
|
1926
490
|
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
/**
|
|
1931
|
-
* Checks if `value` is likely a prototype object.
|
|
1932
|
-
*
|
|
1933
|
-
* @private
|
|
1934
|
-
* @param {*} value The value to check.
|
|
1935
|
-
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
1936
|
-
*/
|
|
1937
|
-
function isPrototype(value) {
|
|
1938
|
-
var Ctor = value && value.constructor,
|
|
1939
|
-
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$3;
|
|
1940
|
-
|
|
1941
|
-
return value === proto;
|
|
1942
|
-
}
|
|
491
|
+
case 5:
|
|
492
|
+
this.activate = false;
|
|
493
|
+
return [3, 7];
|
|
1943
494
|
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
* @private
|
|
1948
|
-
* @param {Function} func The function to wrap.
|
|
1949
|
-
* @param {Function} transform The argument transform.
|
|
1950
|
-
* @returns {Function} Returns the new function.
|
|
1951
|
-
*/
|
|
1952
|
-
function overArg(func, transform) {
|
|
1953
|
-
return function(arg) {
|
|
1954
|
-
return func(transform(arg));
|
|
1955
|
-
};
|
|
1956
|
-
}
|
|
495
|
+
case 6:
|
|
496
|
+
this.activate = true;
|
|
497
|
+
return [3, 7];
|
|
1957
498
|
|
|
1958
|
-
|
|
1959
|
-
|
|
499
|
+
case 7:
|
|
500
|
+
this.debug = opt.debug || false;
|
|
1960
501
|
|
|
1961
|
-
|
|
502
|
+
if (this.debug) {
|
|
503
|
+
this.activate = true;
|
|
504
|
+
}
|
|
1962
505
|
|
|
1963
|
-
|
|
1964
|
-
|
|
506
|
+
if (!this.activate) return [2];
|
|
507
|
+
div = document.createElement('div');
|
|
508
|
+
this.div = div;
|
|
1965
509
|
|
|
1966
|
-
|
|
1967
|
-
|
|
510
|
+
if (this.game.canvas.parentNode) {
|
|
511
|
+
this.game.canvas.parentNode.insertBefore(this.div, this.game.canvas);
|
|
512
|
+
}
|
|
1968
513
|
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
* @returns {Array} Returns the array of property names.
|
|
1975
|
-
*/
|
|
1976
|
-
function baseKeys(object) {
|
|
1977
|
-
if (!isPrototype(object)) {
|
|
1978
|
-
return nativeKeys$1(object);
|
|
1979
|
-
}
|
|
1980
|
-
var result = [];
|
|
1981
|
-
for (var key in Object(object)) {
|
|
1982
|
-
if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
|
|
1983
|
-
result.push(key);
|
|
1984
|
-
}
|
|
1985
|
-
}
|
|
1986
|
-
return result;
|
|
1987
|
-
}
|
|
514
|
+
return [2];
|
|
515
|
+
}
|
|
516
|
+
});
|
|
517
|
+
});
|
|
518
|
+
};
|
|
1988
519
|
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
*
|
|
1994
|
-
* @static
|
|
1995
|
-
* @memberOf _
|
|
1996
|
-
* @since 4.0.0
|
|
1997
|
-
* @category Lang
|
|
1998
|
-
* @param {*} value The value to check.
|
|
1999
|
-
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
2000
|
-
* @example
|
|
2001
|
-
*
|
|
2002
|
-
* _.isArrayLike([1, 2, 3]);
|
|
2003
|
-
* // => true
|
|
2004
|
-
*
|
|
2005
|
-
* _.isArrayLike(document.body.children);
|
|
2006
|
-
* // => true
|
|
2007
|
-
*
|
|
2008
|
-
* _.isArrayLike('abc');
|
|
2009
|
-
* // => true
|
|
2010
|
-
*
|
|
2011
|
-
* _.isArrayLike(_.noop);
|
|
2012
|
-
* // => false
|
|
2013
|
-
*/
|
|
2014
|
-
function isArrayLike(value) {
|
|
2015
|
-
return value != null && isLength(value.length) && !isFunction(value);
|
|
2016
|
-
}
|
|
520
|
+
A11ySystem.prototype.setRatio = function () {
|
|
521
|
+
var _a = this.getCanvasBoundingClientRect(),
|
|
522
|
+
width = _a.width,
|
|
523
|
+
height = _a.height;
|
|
2017
524
|
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
* **Note:** Non-object values are coerced to objects. See the
|
|
2022
|
-
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
2023
|
-
* for more details.
|
|
2024
|
-
*
|
|
2025
|
-
* @static
|
|
2026
|
-
* @since 0.1.0
|
|
2027
|
-
* @memberOf _
|
|
2028
|
-
* @category Object
|
|
2029
|
-
* @param {Object} object The object to query.
|
|
2030
|
-
* @returns {Array} Returns the array of property names.
|
|
2031
|
-
* @example
|
|
2032
|
-
*
|
|
2033
|
-
* function Foo() {
|
|
2034
|
-
* this.a = 1;
|
|
2035
|
-
* this.b = 2;
|
|
2036
|
-
* }
|
|
2037
|
-
*
|
|
2038
|
-
* Foo.prototype.c = 3;
|
|
2039
|
-
*
|
|
2040
|
-
* _.keys(new Foo);
|
|
2041
|
-
* // => ['a', 'b'] (iteration order is not guaranteed)
|
|
2042
|
-
*
|
|
2043
|
-
* _.keys('hi');
|
|
2044
|
-
* // => ['0', '1']
|
|
2045
|
-
*/
|
|
2046
|
-
function keys(object) {
|
|
2047
|
-
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
2048
|
-
}
|
|
525
|
+
var _b = this.getRenderRect(),
|
|
526
|
+
renderWidth = _b.renderWidth,
|
|
527
|
+
renderHeight = _b.renderHeight;
|
|
2049
528
|
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
*
|
|
2053
|
-
* @private
|
|
2054
|
-
* @param {Object} object The object to query.
|
|
2055
|
-
* @returns {Array} Returns the array of property names and symbols.
|
|
2056
|
-
*/
|
|
2057
|
-
function getAllKeys(object) {
|
|
2058
|
-
return baseGetAllKeys(object, keys, getSymbols$1);
|
|
2059
|
-
}
|
|
529
|
+
this._ratioX = width / renderWidth;
|
|
530
|
+
this._ratioY = height / renderHeight;
|
|
2060
531
|
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
var objectProto$1 = Object.prototype;
|
|
2066
|
-
|
|
2067
|
-
/** Used to check objects for own properties. */
|
|
2068
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
2069
|
-
|
|
2070
|
-
/**
|
|
2071
|
-
* A specialized version of `baseIsEqualDeep` for objects with support for
|
|
2072
|
-
* partial deep comparisons.
|
|
2073
|
-
*
|
|
2074
|
-
* @private
|
|
2075
|
-
* @param {Object} object The object to compare.
|
|
2076
|
-
* @param {Object} other The other object to compare.
|
|
2077
|
-
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
2078
|
-
* @param {Function} customizer The function to customize comparisons.
|
|
2079
|
-
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
2080
|
-
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
|
2081
|
-
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
2082
|
-
*/
|
|
2083
|
-
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
2084
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1,
|
|
2085
|
-
objProps = getAllKeys(object),
|
|
2086
|
-
objLength = objProps.length,
|
|
2087
|
-
othProps = getAllKeys(other),
|
|
2088
|
-
othLength = othProps.length;
|
|
2089
|
-
|
|
2090
|
-
if (objLength != othLength && !isPartial) {
|
|
532
|
+
if (width || height) {
|
|
533
|
+
this.initDiv();
|
|
534
|
+
return true;
|
|
535
|
+
} else {
|
|
2091
536
|
return false;
|
|
2092
537
|
}
|
|
2093
|
-
|
|
2094
|
-
while (index--) {
|
|
2095
|
-
var key = objProps[index];
|
|
2096
|
-
if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
|
|
2097
|
-
return false;
|
|
2098
|
-
}
|
|
2099
|
-
}
|
|
2100
|
-
// Check that cyclic values are equal.
|
|
2101
|
-
var objStacked = stack.get(object);
|
|
2102
|
-
var othStacked = stack.get(other);
|
|
2103
|
-
if (objStacked && othStacked) {
|
|
2104
|
-
return objStacked == other && othStacked == object;
|
|
2105
|
-
}
|
|
2106
|
-
var result = true;
|
|
2107
|
-
stack.set(object, other);
|
|
2108
|
-
stack.set(other, object);
|
|
2109
|
-
|
|
2110
|
-
var skipCtor = isPartial;
|
|
2111
|
-
while (++index < objLength) {
|
|
2112
|
-
key = objProps[index];
|
|
2113
|
-
var objValue = object[key],
|
|
2114
|
-
othValue = other[key];
|
|
2115
|
-
|
|
2116
|
-
if (customizer) {
|
|
2117
|
-
var compared = isPartial
|
|
2118
|
-
? customizer(othValue, objValue, key, other, object, stack)
|
|
2119
|
-
: customizer(objValue, othValue, key, object, other, stack);
|
|
2120
|
-
}
|
|
2121
|
-
// Recursively compare objects (susceptible to call stack limits).
|
|
2122
|
-
if (!(compared === undefined
|
|
2123
|
-
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
|
|
2124
|
-
: compared
|
|
2125
|
-
)) {
|
|
2126
|
-
result = false;
|
|
2127
|
-
break;
|
|
2128
|
-
}
|
|
2129
|
-
skipCtor || (skipCtor = key == 'constructor');
|
|
2130
|
-
}
|
|
2131
|
-
if (result && !skipCtor) {
|
|
2132
|
-
var objCtor = object.constructor,
|
|
2133
|
-
othCtor = other.constructor;
|
|
2134
|
-
|
|
2135
|
-
// Non `Object` object instances with different constructors are not equal.
|
|
2136
|
-
if (objCtor != othCtor &&
|
|
2137
|
-
('constructor' in object && 'constructor' in other) &&
|
|
2138
|
-
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
|
|
2139
|
-
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
|
|
2140
|
-
result = false;
|
|
2141
|
-
}
|
|
2142
|
-
}
|
|
2143
|
-
stack['delete'](object);
|
|
2144
|
-
stack['delete'](other);
|
|
2145
|
-
return result;
|
|
2146
|
-
}
|
|
538
|
+
};
|
|
2147
539
|
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
var Set = getNative(root$1, 'Set');
|
|
2160
|
-
|
|
2161
|
-
var Set$1 = Set;
|
|
2162
|
-
|
|
2163
|
-
/* Built-in method references that are verified to be native. */
|
|
2164
|
-
var WeakMap = getNative(root$1, 'WeakMap');
|
|
2165
|
-
|
|
2166
|
-
var WeakMap$1 = WeakMap;
|
|
2167
|
-
|
|
2168
|
-
/** `Object#toString` result references. */
|
|
2169
|
-
var mapTag = '[object Map]',
|
|
2170
|
-
objectTag$1 = '[object Object]',
|
|
2171
|
-
promiseTag = '[object Promise]',
|
|
2172
|
-
setTag = '[object Set]',
|
|
2173
|
-
weakMapTag = '[object WeakMap]';
|
|
2174
|
-
|
|
2175
|
-
var dataViewTag = '[object DataView]';
|
|
2176
|
-
|
|
2177
|
-
/** Used to detect maps, sets, and weakmaps. */
|
|
2178
|
-
var dataViewCtorString = toSource(DataView$1),
|
|
2179
|
-
mapCtorString = toSource(Map$2),
|
|
2180
|
-
promiseCtorString = toSource(Promise$2),
|
|
2181
|
-
setCtorString = toSource(Set$1),
|
|
2182
|
-
weakMapCtorString = toSource(WeakMap$1);
|
|
2183
|
-
|
|
2184
|
-
/**
|
|
2185
|
-
* Gets the `toStringTag` of `value`.
|
|
2186
|
-
*
|
|
2187
|
-
* @private
|
|
2188
|
-
* @param {*} value The value to query.
|
|
2189
|
-
* @returns {string} Returns the `toStringTag`.
|
|
2190
|
-
*/
|
|
2191
|
-
var getTag = baseGetTag;
|
|
2192
|
-
|
|
2193
|
-
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
|
2194
|
-
if ((DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag) ||
|
|
2195
|
-
(Map$2 && getTag(new Map$2) != mapTag) ||
|
|
2196
|
-
(Promise$2 && getTag(Promise$2.resolve()) != promiseTag) ||
|
|
2197
|
-
(Set$1 && getTag(new Set$1) != setTag) ||
|
|
2198
|
-
(WeakMap$1 && getTag(new WeakMap$1) != weakMapTag)) {
|
|
2199
|
-
getTag = function(value) {
|
|
2200
|
-
var result = baseGetTag(value),
|
|
2201
|
-
Ctor = result == objectTag$1 ? value.constructor : undefined,
|
|
2202
|
-
ctorString = Ctor ? toSource(Ctor) : '';
|
|
2203
|
-
|
|
2204
|
-
if (ctorString) {
|
|
2205
|
-
switch (ctorString) {
|
|
2206
|
-
case dataViewCtorString: return dataViewTag;
|
|
2207
|
-
case mapCtorString: return mapTag;
|
|
2208
|
-
case promiseCtorString: return promiseTag;
|
|
2209
|
-
case setCtorString: return setTag;
|
|
2210
|
-
case weakMapCtorString: return weakMapTag;
|
|
2211
|
-
}
|
|
2212
|
-
}
|
|
2213
|
-
return result;
|
|
540
|
+
A11ySystem.prototype.getRenderRect = function () {
|
|
541
|
+
var _a = this.game.getSystem(pluginRenderer.RendererSystem).params,
|
|
542
|
+
params = _a === void 0 ? {
|
|
543
|
+
width: 300,
|
|
544
|
+
height: 300
|
|
545
|
+
} : _a;
|
|
546
|
+
var renderHeight = params.height,
|
|
547
|
+
renderWidth = params.width;
|
|
548
|
+
return {
|
|
549
|
+
renderWidth: renderWidth,
|
|
550
|
+
renderHeight: renderHeight
|
|
2214
551
|
};
|
|
2215
|
-
}
|
|
2216
|
-
|
|
2217
|
-
var getTag$1 = getTag;
|
|
2218
|
-
|
|
2219
|
-
/** Used to compose bitmasks for value comparisons. */
|
|
2220
|
-
var COMPARE_PARTIAL_FLAG = 1;
|
|
2221
|
-
|
|
2222
|
-
/** `Object#toString` result references. */
|
|
2223
|
-
var argsTag = '[object Arguments]',
|
|
2224
|
-
arrayTag = '[object Array]',
|
|
2225
|
-
objectTag = '[object Object]';
|
|
2226
|
-
|
|
2227
|
-
/** Used for built-in method references. */
|
|
2228
|
-
var objectProto = Object.prototype;
|
|
2229
|
-
|
|
2230
|
-
/** Used to check objects for own properties. */
|
|
2231
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2232
|
-
|
|
2233
|
-
/**
|
|
2234
|
-
* A specialized version of `baseIsEqual` for arrays and objects which performs
|
|
2235
|
-
* deep comparisons and tracks traversed objects enabling objects with circular
|
|
2236
|
-
* references to be compared.
|
|
2237
|
-
*
|
|
2238
|
-
* @private
|
|
2239
|
-
* @param {Object} object The object to compare.
|
|
2240
|
-
* @param {Object} other The other object to compare.
|
|
2241
|
-
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
2242
|
-
* @param {Function} customizer The function to customize comparisons.
|
|
2243
|
-
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
2244
|
-
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
|
|
2245
|
-
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
2246
|
-
*/
|
|
2247
|
-
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
2248
|
-
var objIsArr = isArray$1(object),
|
|
2249
|
-
othIsArr = isArray$1(other),
|
|
2250
|
-
objTag = objIsArr ? arrayTag : getTag$1(object),
|
|
2251
|
-
othTag = othIsArr ? arrayTag : getTag$1(other);
|
|
2252
|
-
|
|
2253
|
-
objTag = objTag == argsTag ? objectTag : objTag;
|
|
2254
|
-
othTag = othTag == argsTag ? objectTag : othTag;
|
|
2255
|
-
|
|
2256
|
-
var objIsObj = objTag == objectTag,
|
|
2257
|
-
othIsObj = othTag == objectTag,
|
|
2258
|
-
isSameTag = objTag == othTag;
|
|
2259
|
-
|
|
2260
|
-
if (isSameTag && isBuffer$1(object)) {
|
|
2261
|
-
if (!isBuffer$1(other)) {
|
|
2262
|
-
return false;
|
|
2263
|
-
}
|
|
2264
|
-
objIsArr = true;
|
|
2265
|
-
objIsObj = false;
|
|
2266
|
-
}
|
|
2267
|
-
if (isSameTag && !objIsObj) {
|
|
2268
|
-
stack || (stack = new Stack);
|
|
2269
|
-
return (objIsArr || isTypedArray$1(object))
|
|
2270
|
-
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
|
|
2271
|
-
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
2272
|
-
}
|
|
2273
|
-
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
2274
|
-
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
|
|
2275
|
-
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
|
|
2276
|
-
|
|
2277
|
-
if (objIsWrapped || othIsWrapped) {
|
|
2278
|
-
var objUnwrapped = objIsWrapped ? object.value() : object,
|
|
2279
|
-
othUnwrapped = othIsWrapped ? other.value() : other;
|
|
2280
|
-
|
|
2281
|
-
stack || (stack = new Stack);
|
|
2282
|
-
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
2283
|
-
}
|
|
2284
|
-
}
|
|
2285
|
-
if (!isSameTag) {
|
|
2286
|
-
return false;
|
|
2287
|
-
}
|
|
2288
|
-
stack || (stack = new Stack);
|
|
2289
|
-
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
2290
|
-
}
|
|
552
|
+
};
|
|
2291
553
|
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
2307
|
-
if (value === other) {
|
|
2308
|
-
return true;
|
|
2309
|
-
}
|
|
2310
|
-
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
|
|
2311
|
-
return value !== value && other !== other;
|
|
2312
|
-
}
|
|
2313
|
-
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
2314
|
-
}
|
|
554
|
+
A11ySystem.prototype.getCanvasBoundingClientRect = function () {
|
|
555
|
+
var _a = this.game.canvas.getBoundingClientRect(),
|
|
556
|
+
width = _a.width,
|
|
557
|
+
height = _a.height,
|
|
558
|
+
left = _a.left,
|
|
559
|
+
top = _a.top;
|
|
560
|
+
|
|
561
|
+
return {
|
|
562
|
+
width: width,
|
|
563
|
+
height: height,
|
|
564
|
+
left: left,
|
|
565
|
+
top: top
|
|
566
|
+
};
|
|
567
|
+
};
|
|
2315
568
|
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
569
|
+
A11ySystem.prototype.initDiv = function () {
|
|
570
|
+
var _this = this;
|
|
571
|
+
|
|
572
|
+
var pageXOffset = window.pageXOffset,
|
|
573
|
+
pageYOffset = window.pageYOffset;
|
|
574
|
+
|
|
575
|
+
var _a = this.getCanvasBoundingClientRect(),
|
|
576
|
+
width = _a.width,
|
|
577
|
+
height = _a.height,
|
|
578
|
+
left = _a.left,
|
|
579
|
+
top = _a.top;
|
|
580
|
+
|
|
581
|
+
var style = {
|
|
582
|
+
width: width,
|
|
583
|
+
height: height,
|
|
584
|
+
left: left + pageXOffset + "px",
|
|
585
|
+
top: top + pageYOffset + "px",
|
|
586
|
+
position: POSITION,
|
|
587
|
+
zIndex: this.zIndex,
|
|
588
|
+
pointerEvents: PointerEvents.NONE,
|
|
589
|
+
background: MaskBackground.NONE
|
|
590
|
+
};
|
|
591
|
+
setStyle(this.div, style);
|
|
592
|
+
this.div.addEventListener('click', function (e) {
|
|
593
|
+
var currentTarget = e.currentTarget;
|
|
594
|
+
|
|
595
|
+
var _a = currentTarget.getBoundingClientRect(),
|
|
596
|
+
left = _a.left,
|
|
597
|
+
top = _a.top;
|
|
598
|
+
|
|
599
|
+
var x = (e.pageX - left) / _this.ratioX;
|
|
600
|
+
var y = (e.pageY - top) / _this.ratioY;
|
|
601
|
+
_this.eventPosition = {
|
|
602
|
+
x: x,
|
|
603
|
+
y: y
|
|
604
|
+
};
|
|
605
|
+
}, true);
|
|
606
|
+
};
|
|
2347
607
|
|
|
2348
|
-
function
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
}
|
|
608
|
+
A11ySystem.prototype.update = function () {
|
|
609
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
610
|
+
var changes, changes_1, changes_1_1, changed;
|
|
2352
611
|
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
var has = Object.prototype.hasOwnProperty
|
|
2356
|
-
, prefix = '~';
|
|
2357
|
-
|
|
2358
|
-
/**
|
|
2359
|
-
* Constructor to create a storage for our `EE` objects.
|
|
2360
|
-
* An `Events` instance is a plain object whose properties are event names.
|
|
2361
|
-
*
|
|
2362
|
-
* @constructor
|
|
2363
|
-
* @private
|
|
2364
|
-
*/
|
|
2365
|
-
function Events() {}
|
|
2366
|
-
|
|
2367
|
-
//
|
|
2368
|
-
// We try to not inherit from `Object.prototype`. In some engines creating an
|
|
2369
|
-
// instance in this way is faster than calling `Object.create(null)` directly.
|
|
2370
|
-
// If `Object.create(null)` is not supported we prefix the event names with a
|
|
2371
|
-
// character to make sure that the built-in object properties are not
|
|
2372
|
-
// overridden or used as an attack vector.
|
|
2373
|
-
//
|
|
2374
|
-
if (Object.create) {
|
|
2375
|
-
Events.prototype = Object.create(null);
|
|
2376
|
-
|
|
2377
|
-
//
|
|
2378
|
-
// This hack is needed because the `__proto__` property is still inherited in
|
|
2379
|
-
// some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
|
|
2380
|
-
//
|
|
2381
|
-
if (!new Events().__proto__) prefix = false;
|
|
2382
|
-
}
|
|
612
|
+
var e_1, _a;
|
|
2383
613
|
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
*
|
|
2387
|
-
* @param {Function} fn The listener function.
|
|
2388
|
-
* @param {*} context The context to invoke the listener with.
|
|
2389
|
-
* @param {Boolean} [once=false] Specify if the listener is a one-time listener.
|
|
2390
|
-
* @constructor
|
|
2391
|
-
* @private
|
|
2392
|
-
*/
|
|
2393
|
-
function EE(fn, context, once) {
|
|
2394
|
-
this.fn = fn;
|
|
2395
|
-
this.context = context;
|
|
2396
|
-
this.once = once || false;
|
|
2397
|
-
}
|
|
614
|
+
return __generator(this, function (_b) {
|
|
615
|
+
changes = this.componentObserver.clear();
|
|
2398
616
|
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
* @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
|
|
2403
|
-
* @param {(String|Symbol)} event The event name.
|
|
2404
|
-
* @param {Function} fn The listener function.
|
|
2405
|
-
* @param {*} context The context to invoke the listener with.
|
|
2406
|
-
* @param {Boolean} once Specify if the listener is a one-time listener.
|
|
2407
|
-
* @returns {EventEmitter}
|
|
2408
|
-
* @private
|
|
2409
|
-
*/
|
|
2410
|
-
function addListener(emitter, event, fn, context, once) {
|
|
2411
|
-
if (typeof fn !== 'function') {
|
|
2412
|
-
throw new TypeError('The listener must be a function');
|
|
2413
|
-
}
|
|
617
|
+
if (!this.activate) {
|
|
618
|
+
return [2];
|
|
619
|
+
}
|
|
2414
620
|
|
|
2415
|
-
|
|
2416
|
-
|
|
621
|
+
try {
|
|
622
|
+
for (changes_1 = __values(changes), changes_1_1 = changes_1.next(); !changes_1_1.done; changes_1_1 = changes_1.next()) {
|
|
623
|
+
changed = changes_1_1.value;
|
|
2417
624
|
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
625
|
+
switch (changed.type) {
|
|
626
|
+
case eva_js.OBSERVER_TYPE.ADD:
|
|
627
|
+
changed.componentName === 'Event' && this.addEvent(changed.gameObject);
|
|
628
|
+
changed.componentName === 'A11y' && this.add(changed);
|
|
629
|
+
break;
|
|
2421
630
|
|
|
2422
|
-
|
|
2423
|
-
|
|
631
|
+
case eva_js.OBSERVER_TYPE.CHANGE:
|
|
632
|
+
changed.componentName === 'Transform' && this.transformChange(changed);
|
|
633
|
+
changed.componentName === 'A11y' && this.change(changed);
|
|
634
|
+
break;
|
|
2424
635
|
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
636
|
+
case eva_js.OBSERVER_TYPE.REMOVE:
|
|
637
|
+
changed.componentName === 'Event' && this.removeEvent(changed);
|
|
638
|
+
changed.componentName === 'A11y' && this.remove(changed);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
} catch (e_1_1) {
|
|
642
|
+
e_1 = {
|
|
643
|
+
error: e_1_1
|
|
644
|
+
};
|
|
645
|
+
} finally {
|
|
646
|
+
try {
|
|
647
|
+
if (changes_1_1 && !changes_1_1.done && (_a = changes_1.return)) _a.call(changes_1);
|
|
648
|
+
} finally {
|
|
649
|
+
if (e_1) throw e_1.error;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
2436
652
|
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
* @constructor
|
|
2442
|
-
* @public
|
|
2443
|
-
*/
|
|
2444
|
-
function EventEmitter() {
|
|
2445
|
-
this._events = new Events();
|
|
2446
|
-
this._eventsCount = 0;
|
|
2447
|
-
}
|
|
653
|
+
return [2];
|
|
654
|
+
});
|
|
655
|
+
});
|
|
656
|
+
};
|
|
2448
657
|
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
* listeners.
|
|
2452
|
-
*
|
|
2453
|
-
* @returns {Array}
|
|
2454
|
-
* @public
|
|
2455
|
-
*/
|
|
2456
|
-
EventEmitter.prototype.eventNames = function eventNames() {
|
|
2457
|
-
var names = []
|
|
2458
|
-
, events
|
|
2459
|
-
, name;
|
|
2460
|
-
|
|
2461
|
-
if (this._eventsCount === 0) return names;
|
|
2462
|
-
|
|
2463
|
-
for (name in (events = this._events)) {
|
|
2464
|
-
if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
|
|
2465
|
-
}
|
|
658
|
+
A11ySystem.prototype.change = function (changed) {
|
|
659
|
+
var component = changed.component;
|
|
2466
660
|
|
|
2467
|
-
if (
|
|
2468
|
-
|
|
661
|
+
if (changed.prop.prop[0] === 'hint') {
|
|
662
|
+
var dom = this.cache.get(component.a11yId);
|
|
663
|
+
dom === null || dom === void 0 ? void 0 : dom.setAttribute('aria-label', component.hint);
|
|
664
|
+
dom && this.setPosition(dom, changed.gameObject.transform);
|
|
2469
665
|
}
|
|
666
|
+
};
|
|
2470
667
|
|
|
2471
|
-
|
|
668
|
+
A11ySystem.prototype.remove = function (changed) {
|
|
669
|
+
var component = changed.component;
|
|
670
|
+
if (!component) return;
|
|
671
|
+
var a11yId = component.a11yId;
|
|
672
|
+
var element = this.div.querySelector("#" + a11yId);
|
|
673
|
+
element && this.div.removeChild(element);
|
|
674
|
+
this.cache.delete(a11yId);
|
|
2472
675
|
};
|
|
2473
676
|
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
var
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
if (!
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
677
|
+
A11ySystem.prototype.add = function (changed) {
|
|
678
|
+
var _this = this;
|
|
679
|
+
|
|
680
|
+
if (!this.activate) return;
|
|
681
|
+
var component = changed.component;
|
|
682
|
+
var gameObject = changed.gameObject;
|
|
683
|
+
var delay = component.delay,
|
|
684
|
+
id = component.a11yId;
|
|
685
|
+
var event = component.event;
|
|
686
|
+
if (!gameObject) return;
|
|
687
|
+
var transform = gameObject.transform;
|
|
688
|
+
if (!transform) return;
|
|
689
|
+
var element = document.createElement('div');
|
|
690
|
+
this.cache.set(id, element);
|
|
691
|
+
|
|
692
|
+
if (!event) {
|
|
693
|
+
event = gameObject.getComponent('Event');
|
|
2490
694
|
}
|
|
2491
695
|
|
|
2492
|
-
|
|
2493
|
-
|
|
696
|
+
setTimeout(function () {
|
|
697
|
+
_this.setPosition(element, transform);
|
|
2494
698
|
|
|
2495
|
-
|
|
2496
|
-
* Return the number of listeners listening to a given event.
|
|
2497
|
-
*
|
|
2498
|
-
* @param {(String|Symbol)} event The event name.
|
|
2499
|
-
* @returns {Number} The number of listeners.
|
|
2500
|
-
* @public
|
|
2501
|
-
*/
|
|
2502
|
-
EventEmitter.prototype.listenerCount = function listenerCount(event) {
|
|
2503
|
-
var evt = prefix ? prefix + event : event
|
|
2504
|
-
, listeners = this._events[evt];
|
|
2505
|
-
|
|
2506
|
-
if (!listeners) return 0;
|
|
2507
|
-
if (listeners.fn) return 1;
|
|
2508
|
-
return listeners.length;
|
|
2509
|
-
};
|
|
699
|
+
_this.setA11yAttr(element, component);
|
|
2510
700
|
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
*
|
|
2514
|
-
* @param {(String|Symbol)} event The event name.
|
|
2515
|
-
* @returns {Boolean} `true` if the event had listeners, else `false`.
|
|
2516
|
-
* @public
|
|
2517
|
-
*/
|
|
2518
|
-
EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
|
2519
|
-
var evt = prefix ? prefix + event : event;
|
|
2520
|
-
|
|
2521
|
-
if (!this._events[evt]) return false;
|
|
2522
|
-
|
|
2523
|
-
var listeners = this._events[evt]
|
|
2524
|
-
, len = arguments.length
|
|
2525
|
-
, args
|
|
2526
|
-
, i;
|
|
2527
|
-
|
|
2528
|
-
if (listeners.fn) {
|
|
2529
|
-
if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
|
|
2530
|
-
|
|
2531
|
-
switch (len) {
|
|
2532
|
-
case 1: return listeners.fn.call(listeners.context), true;
|
|
2533
|
-
case 2: return listeners.fn.call(listeners.context, a1), true;
|
|
2534
|
-
case 3: return listeners.fn.call(listeners.context, a1, a2), true;
|
|
2535
|
-
case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
|
|
2536
|
-
case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
|
2537
|
-
case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
|
701
|
+
if (event) {
|
|
702
|
+
_this.addEvent(gameObject);
|
|
2538
703
|
}
|
|
2539
704
|
|
|
2540
|
-
|
|
2541
|
-
|
|
705
|
+
if (gameObject.scene) {
|
|
706
|
+
_this.div.appendChild(element);
|
|
2542
707
|
}
|
|
708
|
+
}, delay || this.delay);
|
|
709
|
+
};
|
|
2543
710
|
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
|
|
711
|
+
A11ySystem.prototype.transformChange = function (changed) {
|
|
712
|
+
var component = changed.component;
|
|
713
|
+
var gameObject = changed.gameObject;
|
|
714
|
+
var a11yComponent = gameObject.getComponent(A11y$1);
|
|
715
|
+
if (!a11yComponent) return;
|
|
716
|
+
var a11yId = a11yComponent.a11yId;
|
|
2551
717
|
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
args[j - 1] = arguments[j];
|
|
2560
|
-
}
|
|
2561
|
-
|
|
2562
|
-
listeners[i].fn.apply(listeners[i].context, args);
|
|
2563
|
-
}
|
|
718
|
+
if (!component.inScene) {
|
|
719
|
+
var dom = this.div.querySelector("#" + a11yId);
|
|
720
|
+
dom && this.div.removeChild(dom);
|
|
721
|
+
} else {
|
|
722
|
+
if (this.cache.has(a11yId)) {
|
|
723
|
+
var addDom = this.cache.get(a11yId);
|
|
724
|
+
addDom && this.div.appendChild(addDom);
|
|
2564
725
|
}
|
|
2565
726
|
}
|
|
727
|
+
};
|
|
2566
728
|
|
|
2567
|
-
|
|
729
|
+
A11ySystem.prototype.setEvent = function (element, event, gameObject, id) {
|
|
730
|
+
if (!event) {
|
|
731
|
+
return;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
var func = getEventFunc.bind(this, event, gameObject);
|
|
735
|
+
this.eventCache.set(id, func);
|
|
736
|
+
element.addEventListener('click', func);
|
|
2568
737
|
};
|
|
2569
738
|
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
* @public
|
|
2578
|
-
*/
|
|
2579
|
-
EventEmitter.prototype.on = function on(event, fn, context) {
|
|
2580
|
-
return addListener(this, event, fn, context, false);
|
|
739
|
+
A11ySystem.prototype.addEvent = function (gameObject) {
|
|
740
|
+
var a11y = gameObject.getComponent(A11y$1);
|
|
741
|
+
if (!a11y) return;
|
|
742
|
+
var event = gameObject.getComponent('Event');
|
|
743
|
+
if (!event) return;
|
|
744
|
+
var element = this.cache.get(a11y.a11yId);
|
|
745
|
+
element && this.setEvent(element, event, gameObject, a11y.a11yId);
|
|
2581
746
|
};
|
|
2582
747
|
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
return addListener(this, event, fn, context, true);
|
|
748
|
+
A11ySystem.prototype.removeEvent = function (changed) {
|
|
749
|
+
var gameObject = changed.gameObject;
|
|
750
|
+
var a11y = gameObject.getComponent(A11y$1);
|
|
751
|
+
if (!a11y) return;
|
|
752
|
+
var event = changed.component;
|
|
753
|
+
if (!event) return;
|
|
754
|
+
var a11yId = a11y.a11yId;
|
|
755
|
+
var func = this.eventCache.get(a11yId);
|
|
756
|
+
var element = this.cache.get(a11yId);
|
|
757
|
+
element && element.removeEventListener('click', func);
|
|
2594
758
|
};
|
|
2595
759
|
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
760
|
+
A11ySystem.prototype.setA11yAttr = function (element, component) {
|
|
761
|
+
var e_2, _a, e_3, _b, e_4, _c;
|
|
762
|
+
|
|
763
|
+
var hint = component.hint,
|
|
764
|
+
_d = component.props,
|
|
765
|
+
props = _d === void 0 ? {} : _d,
|
|
766
|
+
_e = component.state,
|
|
767
|
+
state = _e === void 0 ? {} : _e,
|
|
768
|
+
role = component.role,
|
|
769
|
+
id = component.a11yId;
|
|
770
|
+
var realRole = role || 'text';
|
|
771
|
+
element.setAttribute('role', realRole);
|
|
772
|
+
element.setAttribute('aria-label', hint);
|
|
773
|
+
element.id = id;
|
|
774
|
+
var ariaProps = Object.keys(props);
|
|
775
|
+
|
|
776
|
+
try {
|
|
777
|
+
for (var ariaProps_1 = __values(ariaProps), ariaProps_1_1 = ariaProps_1.next(); !ariaProps_1_1.done; ariaProps_1_1 = ariaProps_1.next()) {
|
|
778
|
+
var key = ariaProps_1_1.value;
|
|
779
|
+
element.setAttribute(key, props[key]);
|
|
780
|
+
}
|
|
781
|
+
} catch (e_2_1) {
|
|
782
|
+
e_2 = {
|
|
783
|
+
error: e_2_1
|
|
784
|
+
};
|
|
785
|
+
} finally {
|
|
786
|
+
try {
|
|
787
|
+
if (ariaProps_1_1 && !ariaProps_1_1.done && (_a = ariaProps_1.return)) _a.call(ariaProps_1);
|
|
788
|
+
} finally {
|
|
789
|
+
if (e_2) throw e_2.error;
|
|
790
|
+
}
|
|
2613
791
|
}
|
|
2614
792
|
|
|
2615
|
-
var
|
|
793
|
+
var ariaState = Object.keys(state);
|
|
2616
794
|
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
(
|
|
2621
|
-
(!context || listeners.context === context)
|
|
2622
|
-
) {
|
|
2623
|
-
clearEvent(this, evt);
|
|
795
|
+
try {
|
|
796
|
+
for (var ariaState_1 = __values(ariaState), ariaState_1_1 = ariaState_1.next(); !ariaState_1_1.done; ariaState_1_1 = ariaState_1.next()) {
|
|
797
|
+
var key = ariaState_1_1.value;
|
|
798
|
+
element.setAttribute(key, state[key]);
|
|
2624
799
|
}
|
|
2625
|
-
}
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
)
|
|
2632
|
-
|
|
2633
|
-
|
|
800
|
+
} catch (e_3_1) {
|
|
801
|
+
e_3 = {
|
|
802
|
+
error: e_3_1
|
|
803
|
+
};
|
|
804
|
+
} finally {
|
|
805
|
+
try {
|
|
806
|
+
if (ariaState_1_1 && !ariaState_1_1.done && (_b = ariaState_1.return)) _b.call(ariaState_1);
|
|
807
|
+
} finally {
|
|
808
|
+
if (e_3) throw e_3.error;
|
|
2634
809
|
}
|
|
2635
|
-
|
|
2636
|
-
//
|
|
2637
|
-
// Reset the array, or remove it completely if we have no more listeners.
|
|
2638
|
-
//
|
|
2639
|
-
if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
|
|
2640
|
-
else clearEvent(this, evt);
|
|
2641
810
|
}
|
|
2642
811
|
|
|
2643
|
-
|
|
2644
|
-
|
|
812
|
+
try {
|
|
813
|
+
for (var _f = __values(Object.keys(component)), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
814
|
+
var key = _g.value;
|
|
2645
815
|
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
this._events = new Events();
|
|
2661
|
-
this._eventsCount = 0;
|
|
816
|
+
if (typeof component[key] === 'string' && notAttr.indexOf(key) === -1 && key.indexOf('_') !== 1) {
|
|
817
|
+
element.setAttribute(key, component[key]);
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
} catch (e_4_1) {
|
|
821
|
+
e_4 = {
|
|
822
|
+
error: e_4_1
|
|
823
|
+
};
|
|
824
|
+
} finally {
|
|
825
|
+
try {
|
|
826
|
+
if (_g && !_g.done && (_c = _f.return)) _c.call(_f);
|
|
827
|
+
} finally {
|
|
828
|
+
if (e_4) throw e_4.error;
|
|
829
|
+
}
|
|
2662
830
|
}
|
|
2663
|
-
|
|
2664
|
-
return this;
|
|
2665
831
|
};
|
|
2666
832
|
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
// Allow `EventEmitter` to be imported as module namespace.
|
|
2680
|
-
//
|
|
2681
|
-
EventEmitter.EventEmitter = EventEmitter;
|
|
2682
|
-
|
|
2683
|
-
//
|
|
2684
|
-
// Expose the module.
|
|
2685
|
-
//
|
|
2686
|
-
{
|
|
2687
|
-
module.exports = EventEmitter;
|
|
2688
|
-
}
|
|
2689
|
-
});
|
|
833
|
+
A11ySystem.prototype.setPosition = function (element, transform) {
|
|
834
|
+
var _a = transform.size,
|
|
835
|
+
width = _a.width,
|
|
836
|
+
height = _a.height;
|
|
837
|
+
var style = {
|
|
838
|
+
width: width === 0 ? 1 : width * this.ratioX,
|
|
839
|
+
height: height === 0 ? 1 : height * this.ratioY,
|
|
840
|
+
position: POSITION,
|
|
841
|
+
zIndex: this.zIndex,
|
|
842
|
+
pointerEvents: PointerEvents.AUTO,
|
|
843
|
+
background: this.debug ? MaskBackground.DEBUG : MaskBackground.NONE
|
|
844
|
+
};
|
|
2690
845
|
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
2697
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
2698
|
-
|
|
2699
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
2700
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
2701
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
2702
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
2703
|
-
|
|
2704
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
2705
|
-
and limitations under the License.
|
|
2706
|
-
***************************************************************************** */
|
|
2707
|
-
/* global Reflect, Promise */
|
|
2708
|
-
|
|
2709
|
-
var extendStatics = function(d, b) {
|
|
2710
|
-
extendStatics = Object.setPrototypeOf ||
|
|
2711
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
2712
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
2713
|
-
return extendStatics(d, b);
|
|
2714
|
-
};
|
|
2715
|
-
|
|
2716
|
-
function __extends(d, b) {
|
|
2717
|
-
extendStatics(d, b);
|
|
2718
|
-
function __() { this.constructor = d; }
|
|
2719
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
2720
|
-
}
|
|
2721
|
-
|
|
2722
|
-
var __assign = function() {
|
|
2723
|
-
__assign = Object.assign || function __assign(t) {
|
|
2724
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2725
|
-
s = arguments[i];
|
|
2726
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
2727
|
-
}
|
|
2728
|
-
return t;
|
|
2729
|
-
};
|
|
2730
|
-
return __assign.apply(this, arguments);
|
|
2731
|
-
};
|
|
2732
|
-
|
|
2733
|
-
function __decorate(decorators, target, key, desc) {
|
|
2734
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2735
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2736
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2737
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2738
|
-
}
|
|
2739
|
-
|
|
2740
|
-
function __values(o) {
|
|
2741
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
|
2742
|
-
if (m) return m.call(o);
|
|
2743
|
-
return {
|
|
2744
|
-
next: function () {
|
|
2745
|
-
if (o && i >= o.length) o = void 0;
|
|
2746
|
-
return { value: o && o[i++], done: !o };
|
|
2747
|
-
}
|
|
2748
|
-
};
|
|
2749
|
-
}
|
|
2750
|
-
|
|
2751
|
-
function __read(o, n) {
|
|
2752
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
2753
|
-
if (!m) return o;
|
|
2754
|
-
var i = m.call(o), r, ar = [], e;
|
|
2755
|
-
try {
|
|
2756
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
2757
|
-
}
|
|
2758
|
-
catch (error) { e = { error: error }; }
|
|
2759
|
-
finally {
|
|
2760
|
-
try {
|
|
2761
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
2762
|
-
}
|
|
2763
|
-
finally { if (e) throw e.error; }
|
|
2764
|
-
}
|
|
2765
|
-
return ar;
|
|
2766
|
-
}
|
|
2767
|
-
|
|
2768
|
-
function __spread() {
|
|
2769
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
2770
|
-
ar = ar.concat(__read(arguments[i]));
|
|
2771
|
-
return ar;
|
|
2772
|
-
}
|
|
846
|
+
var transformProps = _assign({}, transform);
|
|
847
|
+
|
|
848
|
+
setStyle(element, style);
|
|
849
|
+
setTransform(element, transformProps, this.ratioX, this.ratioY);
|
|
850
|
+
};
|
|
2773
851
|
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
this.rendererSystem = rendererSystem;
|
|
2780
|
-
}
|
|
2781
|
-
RendererManager.prototype.register = function () {
|
|
2782
|
-
var e_1, _a;
|
|
2783
|
-
var renderers = [];
|
|
2784
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2785
|
-
renderers[_i] = arguments[_i];
|
|
2786
|
-
}
|
|
2787
|
-
try {
|
|
2788
|
-
for (var renderers_1 = __values(renderers), renderers_1_1 = renderers_1.next(); !renderers_1_1.done; renderers_1_1 = renderers_1.next()) {
|
|
2789
|
-
var renderer = renderers_1_1.value;
|
|
2790
|
-
renderer.game = this.game;
|
|
2791
|
-
renderer.rendererManager = this.rendererSystem.rendererManager;
|
|
2792
|
-
renderer.containerManager = this.rendererSystem.containerManager;
|
|
2793
|
-
this.renderers.push(renderer);
|
|
2794
|
-
}
|
|
2795
|
-
}
|
|
2796
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
2797
|
-
finally {
|
|
2798
|
-
try {
|
|
2799
|
-
if (renderers_1_1 && !renderers_1_1.done && (_a = renderers_1.return)) _a.call(renderers_1);
|
|
2800
|
-
}
|
|
2801
|
-
finally { if (e_1) throw e_1.error; }
|
|
2802
|
-
}
|
|
2803
|
-
};
|
|
2804
|
-
RendererManager.prototype.componentChanged = function (changes) {
|
|
2805
|
-
var e_2, _a;
|
|
2806
|
-
var _loop_1 = function (changed) {
|
|
2807
|
-
var e_3, _a;
|
|
2808
|
-
try {
|
|
2809
|
-
for (var _b = (e_3 = void 0, __values(this_1.renderers)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2810
|
-
var renderer = _c.value;
|
|
2811
|
-
var props = renderer.observerInfo[changed.componentName];
|
|
2812
|
-
if (props) {
|
|
2813
|
-
if ([eva_js.OBSERVER_TYPE.ADD, eva_js.OBSERVER_TYPE.REMOVE].indexOf(changed.type) > -1) {
|
|
2814
|
-
try {
|
|
2815
|
-
renderer.componentChanged && renderer.componentChanged(changed);
|
|
2816
|
-
}
|
|
2817
|
-
catch (e) {
|
|
2818
|
-
console.error("gameObject: " + changed.gameObject.name + ", " + changed.componentName + " is error.", changed, e);
|
|
2819
|
-
}
|
|
2820
|
-
continue;
|
|
2821
|
-
}
|
|
2822
|
-
var index = props.findIndex(function (prop) {
|
|
2823
|
-
return isEqual(prop, changed.prop);
|
|
2824
|
-
});
|
|
2825
|
-
if (index > -1) {
|
|
2826
|
-
try {
|
|
2827
|
-
renderer.componentChanged && renderer.componentChanged(changed);
|
|
2828
|
-
}
|
|
2829
|
-
catch (e) {
|
|
2830
|
-
console.error("gameObject: " + (changed.gameObject && changed.gameObject.name) + ", " + changed.componentName + " is componentChanged error.", changed, e);
|
|
2831
|
-
}
|
|
2832
|
-
}
|
|
2833
|
-
}
|
|
2834
|
-
}
|
|
2835
|
-
}
|
|
2836
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
2837
|
-
finally {
|
|
2838
|
-
try {
|
|
2839
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2840
|
-
}
|
|
2841
|
-
finally { if (e_3) throw e_3.error; }
|
|
2842
|
-
}
|
|
2843
|
-
};
|
|
2844
|
-
var this_1 = this;
|
|
2845
|
-
try {
|
|
2846
|
-
for (var changes_1 = __values(changes), changes_1_1 = changes_1.next(); !changes_1_1.done; changes_1_1 = changes_1.next()) {
|
|
2847
|
-
var changed = changes_1_1.value;
|
|
2848
|
-
_loop_1(changed);
|
|
2849
|
-
}
|
|
2850
|
-
}
|
|
2851
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
2852
|
-
finally {
|
|
2853
|
-
try {
|
|
2854
|
-
if (changes_1_1 && !changes_1_1.done && (_a = changes_1.return)) _a.call(changes_1);
|
|
2855
|
-
}
|
|
2856
|
-
finally { if (e_2) throw e_2.error; }
|
|
2857
|
-
}
|
|
2858
|
-
};
|
|
2859
|
-
RendererManager.prototype.update = function (gameObject) {
|
|
2860
|
-
var e_4, _a, e_5, _b;
|
|
2861
|
-
try {
|
|
2862
|
-
for (var _c = __values(gameObject.components), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
2863
|
-
var component = _d.value;
|
|
2864
|
-
try {
|
|
2865
|
-
for (var _e = (e_5 = void 0, __values(this.renderers)), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
2866
|
-
var renderer = _f.value;
|
|
2867
|
-
var cache = [];
|
|
2868
|
-
var props = renderer.observerInfo[component.name];
|
|
2869
|
-
if (props && cache.indexOf(gameObject) === -1) {
|
|
2870
|
-
cache.push(gameObject);
|
|
2871
|
-
try {
|
|
2872
|
-
renderer.rendererUpdate && renderer.rendererUpdate(gameObject);
|
|
2873
|
-
}
|
|
2874
|
-
catch (e) {
|
|
2875
|
-
console.info("gameObject: " + gameObject.name + ", " + component.name + " is update error", e);
|
|
2876
|
-
}
|
|
2877
|
-
}
|
|
2878
|
-
}
|
|
2879
|
-
}
|
|
2880
|
-
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
2881
|
-
finally {
|
|
2882
|
-
try {
|
|
2883
|
-
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
2884
|
-
}
|
|
2885
|
-
finally { if (e_5) throw e_5.error; }
|
|
2886
|
-
}
|
|
2887
|
-
}
|
|
2888
|
-
}
|
|
2889
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
2890
|
-
finally {
|
|
2891
|
-
try {
|
|
2892
|
-
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
2893
|
-
}
|
|
2894
|
-
finally { if (e_4) throw e_4.error; }
|
|
2895
|
-
}
|
|
2896
|
-
};
|
|
2897
|
-
return RendererManager;
|
|
2898
|
-
}());
|
|
2899
|
-
var RendererManager$1 = RendererManager;
|
|
2900
|
-
|
|
2901
|
-
var ContainerManager = (function () {
|
|
2902
|
-
function ContainerManager() {
|
|
2903
|
-
this.containerMap = {};
|
|
2904
|
-
}
|
|
2905
|
-
ContainerManager.prototype.addContainer = function (_a) {
|
|
2906
|
-
var name = _a.name, container = _a.container;
|
|
2907
|
-
this.containerMap[name] = container;
|
|
2908
|
-
};
|
|
2909
|
-
ContainerManager.prototype.getContainer = function (name) {
|
|
2910
|
-
return this.containerMap[name];
|
|
2911
|
-
};
|
|
2912
|
-
ContainerManager.prototype.removeContainer = function (name) {
|
|
2913
|
-
var _a;
|
|
2914
|
-
(_a = this.containerMap[name]) === null || _a === void 0 ? void 0 : _a.destroy({ children: true });
|
|
2915
|
-
delete this.containerMap[name];
|
|
2916
|
-
};
|
|
2917
|
-
ContainerManager.prototype.updateTransform = function (_a) {
|
|
2918
|
-
var name = _a.name, transform = _a.transform;
|
|
2919
|
-
var container = this.containerMap[name];
|
|
2920
|
-
if (!container)
|
|
2921
|
-
return;
|
|
2922
|
-
var anchor = transform.anchor, origin = transform.origin, position = transform.position, rotation = transform.rotation, scale = transform.scale, size = transform.size, skew = transform.skew;
|
|
2923
|
-
container.rotation = rotation;
|
|
2924
|
-
container.scale = scale;
|
|
2925
|
-
container.pivot.x = size.width * origin.x;
|
|
2926
|
-
container.pivot.y = size.height * origin.y;
|
|
2927
|
-
container.skew = skew;
|
|
2928
|
-
var x = position.x;
|
|
2929
|
-
var y = position.y;
|
|
2930
|
-
if (transform.parent) {
|
|
2931
|
-
var parent_1 = transform.parent;
|
|
2932
|
-
x = x + parent_1.size.width * anchor.x;
|
|
2933
|
-
y = y + parent_1.size.height * anchor.y;
|
|
2934
|
-
}
|
|
2935
|
-
container.position = { x: x, y: y };
|
|
2936
|
-
};
|
|
2937
|
-
return ContainerManager;
|
|
2938
|
-
}());
|
|
2939
|
-
var ContainerManager$1 = ContainerManager;
|
|
2940
|
-
|
|
2941
|
-
var Transform = (function (_super) {
|
|
2942
|
-
__extends(Transform, _super);
|
|
2943
|
-
function Transform(_a) {
|
|
2944
|
-
var system = _a.system, containerManager = _a.containerManager;
|
|
2945
|
-
var _this = _super.call(this) || this;
|
|
2946
|
-
_this.name = 'Transform';
|
|
2947
|
-
_this.waitRemoveIds = [];
|
|
2948
|
-
_this.waitChangeScenes = [];
|
|
2949
|
-
_this.containerManager = containerManager;
|
|
2950
|
-
_this.init(system);
|
|
2951
|
-
return _this;
|
|
2952
|
-
}
|
|
2953
|
-
Transform.prototype.init = function (system) {
|
|
2954
|
-
var _this = this;
|
|
2955
|
-
this.system = system;
|
|
2956
|
-
this.on('changeScene', function (_a) {
|
|
2957
|
-
var scene = _a.scene, mode = _a.mode, application = _a.application;
|
|
2958
|
-
_this.waitChangeScenes.push({ scene: scene, mode: mode, application: application });
|
|
2959
|
-
});
|
|
2960
|
-
};
|
|
2961
|
-
Transform.prototype.update = function () {
|
|
2962
|
-
var e_1, _a, e_2, _b;
|
|
2963
|
-
try {
|
|
2964
|
-
for (var _c = __values(this.waitRemoveIds), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
2965
|
-
var id = _d.value;
|
|
2966
|
-
this.containerManager.removeContainer(id);
|
|
2967
|
-
}
|
|
2968
|
-
}
|
|
2969
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
2970
|
-
finally {
|
|
2971
|
-
try {
|
|
2972
|
-
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
2973
|
-
}
|
|
2974
|
-
finally { if (e_1) throw e_1.error; }
|
|
2975
|
-
}
|
|
2976
|
-
this.waitRemoveIds = [];
|
|
2977
|
-
try {
|
|
2978
|
-
for (var _e = __values(this.waitChangeScenes), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
2979
|
-
var sceneInfo = _f.value;
|
|
2980
|
-
var container = this.containerManager.getContainer(sceneInfo.scene.id);
|
|
2981
|
-
if (container) {
|
|
2982
|
-
sceneInfo.application.stage.removeChildren();
|
|
2983
|
-
sceneInfo.application.stage.addChild(container);
|
|
2984
|
-
}
|
|
2985
|
-
}
|
|
2986
|
-
}
|
|
2987
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
2988
|
-
finally {
|
|
2989
|
-
try {
|
|
2990
|
-
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
2991
|
-
}
|
|
2992
|
-
finally { if (e_2) throw e_2.error; }
|
|
2993
|
-
}
|
|
2994
|
-
this.waitChangeScenes = [];
|
|
2995
|
-
};
|
|
2996
|
-
Transform.prototype.componentChanged = function (changed) {
|
|
2997
|
-
if (changed.type === eva_js.OBSERVER_TYPE.ADD) {
|
|
2998
|
-
this.addContainer(changed);
|
|
2999
|
-
}
|
|
3000
|
-
else if (changed.type === eva_js.OBSERVER_TYPE.CHANGE) {
|
|
3001
|
-
this.change(changed);
|
|
3002
|
-
}
|
|
3003
|
-
else if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
|
|
3004
|
-
this.waitRemoveIds.push(changed.gameObject.id);
|
|
3005
|
-
}
|
|
3006
|
-
};
|
|
3007
|
-
Transform.prototype.addContainer = function (changed) {
|
|
3008
|
-
var container = new Container$1();
|
|
3009
|
-
container.name = changed.gameObject.name;
|
|
3010
|
-
this.containerManager.addContainer({
|
|
3011
|
-
name: changed.gameObject.id,
|
|
3012
|
-
container: container,
|
|
3013
|
-
});
|
|
3014
|
-
var transform = changed.component;
|
|
3015
|
-
transform.worldTransform = container.transform.worldTransform;
|
|
3016
|
-
};
|
|
3017
|
-
Transform.prototype.change = function (changed) {
|
|
3018
|
-
var transform = changed.component;
|
|
3019
|
-
if (transform.parent) {
|
|
3020
|
-
var parentContainer = this.containerManager.getContainer(transform.parent.gameObject.id);
|
|
3021
|
-
parentContainer.addChild(this.containerManager.getContainer(changed.gameObject.id));
|
|
3022
|
-
var render = changed.gameObject.transform.parent &&
|
|
3023
|
-
changed.gameObject.transform.parent.gameObject.getComponent('Render');
|
|
3024
|
-
if (render) {
|
|
3025
|
-
render.sortDirty = true;
|
|
3026
|
-
}
|
|
3027
|
-
}
|
|
3028
|
-
else {
|
|
3029
|
-
var container = this.containerManager.getContainer(changed.gameObject.id);
|
|
3030
|
-
delete transform.worldTransform;
|
|
3031
|
-
container.parent && container.parent.removeChild(container);
|
|
3032
|
-
}
|
|
3033
|
-
};
|
|
3034
|
-
Transform.prototype.destroy = function () {
|
|
3035
|
-
this.removeAllListeners();
|
|
3036
|
-
this.waitRemoveIds = null;
|
|
3037
|
-
this.waitChangeScenes = null;
|
|
3038
|
-
this.system = null;
|
|
3039
|
-
this.containerManager = null;
|
|
3040
|
-
};
|
|
3041
|
-
Transform = __decorate([
|
|
3042
|
-
eva_js.decorators.componentObserver({
|
|
3043
|
-
Transform: ['_parent'],
|
|
3044
|
-
})
|
|
3045
|
-
], Transform);
|
|
3046
|
-
return Transform;
|
|
3047
|
-
}(EventEmitter));
|
|
3048
|
-
var Transform$1 = Transform;
|
|
3049
|
-
|
|
3050
|
-
var RENDERER_TYPE;
|
|
3051
|
-
(function (RENDERER_TYPE) {
|
|
3052
|
-
RENDERER_TYPE[RENDERER_TYPE["UNKNOWN"] = 0] = "UNKNOWN";
|
|
3053
|
-
RENDERER_TYPE[RENDERER_TYPE["WEBGL"] = 1] = "WEBGL";
|
|
3054
|
-
RENDERER_TYPE[RENDERER_TYPE["CANVAS"] = 2] = "CANVAS";
|
|
3055
|
-
})(RENDERER_TYPE || (RENDERER_TYPE = {}));
|
|
3056
|
-
var disableScroll = function (renderer) {
|
|
3057
|
-
renderer.plugins.interaction.autoPreventDefault = true;
|
|
3058
|
-
renderer.view.style.touchAction = 'none';
|
|
3059
|
-
};
|
|
3060
|
-
var enableScroll = function (renderer) {
|
|
3061
|
-
renderer.plugins.interaction.autoPreventDefault = false;
|
|
3062
|
-
renderer.view.style.touchAction = 'auto';
|
|
3063
|
-
};
|
|
3064
|
-
var Renderer$2 = (function (_super) {
|
|
3065
|
-
__extends(Renderer, _super);
|
|
3066
|
-
function Renderer() {
|
|
3067
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
3068
|
-
_this.multiApps = [];
|
|
3069
|
-
return _this;
|
|
3070
|
-
}
|
|
3071
|
-
Renderer.prototype.init = function (params) {
|
|
3072
|
-
var _this = this;
|
|
3073
|
-
this.params = params;
|
|
3074
|
-
this.application = this.createApplication(params);
|
|
3075
|
-
this.containerManager = new ContainerManager$1();
|
|
3076
|
-
this.rendererManager = new RendererManager$1({
|
|
3077
|
-
game: this.game,
|
|
3078
|
-
rendererSystem: this,
|
|
3079
|
-
});
|
|
3080
|
-
this.game.canvas = this.application.view;
|
|
3081
|
-
this.transform = new Transform$1({
|
|
3082
|
-
system: this,
|
|
3083
|
-
containerManager: this.containerManager,
|
|
3084
|
-
});
|
|
3085
|
-
this.game.on('sceneChanged', function (_a) {
|
|
3086
|
-
var scene = _a.scene, mode = _a.mode, params = _a.params;
|
|
3087
|
-
var application;
|
|
3088
|
-
switch (mode) {
|
|
3089
|
-
case eva_js.LOAD_SCENE_MODE.SINGLE:
|
|
3090
|
-
application = _this.application;
|
|
3091
|
-
break;
|
|
3092
|
-
case eva_js.LOAD_SCENE_MODE.MULTI_CANVAS:
|
|
3093
|
-
application = _this.createMultiApplication({ params: params });
|
|
3094
|
-
break;
|
|
3095
|
-
}
|
|
3096
|
-
scene.canvas = application.view;
|
|
3097
|
-
_this.transform.emit('changeScene', {
|
|
3098
|
-
scene: scene,
|
|
3099
|
-
mode: mode,
|
|
3100
|
-
application: application,
|
|
3101
|
-
});
|
|
3102
|
-
});
|
|
3103
|
-
};
|
|
3104
|
-
Renderer.prototype.registerObserver = function (observerInfo) {
|
|
3105
|
-
var _a;
|
|
3106
|
-
var thisObserverInfo = this.constructor.observerInfo;
|
|
3107
|
-
for (var key in observerInfo) {
|
|
3108
|
-
if (!thisObserverInfo[key]) {
|
|
3109
|
-
thisObserverInfo[key] = [];
|
|
3110
|
-
}
|
|
3111
|
-
(_a = thisObserverInfo[key]).push.apply(_a, __spread(observerInfo[key]));
|
|
3112
|
-
}
|
|
3113
|
-
};
|
|
3114
|
-
Renderer.prototype.createMultiApplication = function (_a) {
|
|
3115
|
-
var params = _a.params;
|
|
3116
|
-
var app = this.createApplication(params);
|
|
3117
|
-
this.multiApps.push(app);
|
|
3118
|
-
return app;
|
|
3119
|
-
};
|
|
3120
|
-
Renderer.prototype.createApplication = function (params) {
|
|
3121
|
-
params.view = params.canvas;
|
|
3122
|
-
if (params.renderType === RENDERER_TYPE.CANVAS) {
|
|
3123
|
-
params.forceCanvas = true;
|
|
3124
|
-
}
|
|
3125
|
-
pixi_js.ticker.shared.autoStart = false;
|
|
3126
|
-
pixi_js.ticker.shared.stop();
|
|
3127
|
-
var app = new Application$1(__assign({ sharedTicker: true }, params));
|
|
3128
|
-
if (params.preventScroll !== undefined) {
|
|
3129
|
-
console.warn('PreventScroll property will deprecate at next major version, please use enableEnable instead. https://eva.js.org/#/tutorials/game');
|
|
3130
|
-
params.preventScroll ? enableScroll(app.renderer) : disableScroll(app.renderer);
|
|
3131
|
-
}
|
|
3132
|
-
if (params.enableScroll !== undefined) {
|
|
3133
|
-
params.enableScroll ? enableScroll(app.renderer) : disableScroll(app.renderer);
|
|
3134
|
-
}
|
|
3135
|
-
if (params.preventScroll === undefined && params.enableScroll === undefined) {
|
|
3136
|
-
enableScroll(app.renderer);
|
|
3137
|
-
}
|
|
3138
|
-
return app;
|
|
3139
|
-
};
|
|
3140
|
-
Renderer.prototype.update = function () {
|
|
3141
|
-
var e_1, _a, e_2, _b;
|
|
3142
|
-
var changes = this.componentObserver.clear();
|
|
3143
|
-
try {
|
|
3144
|
-
for (var changes_1 = __values(changes), changes_1_1 = changes_1.next(); !changes_1_1.done; changes_1_1 = changes_1.next()) {
|
|
3145
|
-
var changed = changes_1_1.value;
|
|
3146
|
-
this.transform.componentChanged(changed);
|
|
3147
|
-
}
|
|
3148
|
-
}
|
|
3149
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
3150
|
-
finally {
|
|
3151
|
-
try {
|
|
3152
|
-
if (changes_1_1 && !changes_1_1.done && (_a = changes_1.return)) _a.call(changes_1);
|
|
3153
|
-
}
|
|
3154
|
-
finally { if (e_1) throw e_1.error; }
|
|
3155
|
-
}
|
|
3156
|
-
try {
|
|
3157
|
-
for (var _c = __values(this.game.gameObjects), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
3158
|
-
var gameObject = _d.value;
|
|
3159
|
-
this.containerManager.updateTransform({
|
|
3160
|
-
name: gameObject.id,
|
|
3161
|
-
transform: gameObject.transform,
|
|
3162
|
-
});
|
|
3163
|
-
this.rendererManager.update(gameObject);
|
|
3164
|
-
}
|
|
3165
|
-
}
|
|
3166
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
3167
|
-
finally {
|
|
3168
|
-
try {
|
|
3169
|
-
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
3170
|
-
}
|
|
3171
|
-
finally { if (e_2) throw e_2.error; }
|
|
3172
|
-
}
|
|
3173
|
-
};
|
|
3174
|
-
Renderer.prototype.lateUpdate = function (e) {
|
|
3175
|
-
this.transform.update();
|
|
3176
|
-
this.application.ticker.update(e.time);
|
|
3177
|
-
};
|
|
3178
|
-
Renderer.prototype.onDestroy = function () {
|
|
3179
|
-
var e_3, _a;
|
|
3180
|
-
this.application.destroy();
|
|
3181
|
-
try {
|
|
3182
|
-
for (var _b = __values(this.multiApps), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
3183
|
-
var app = _c.value;
|
|
3184
|
-
app && app.destroy();
|
|
3185
|
-
}
|
|
3186
|
-
}
|
|
3187
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
3188
|
-
finally {
|
|
3189
|
-
try {
|
|
3190
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
3191
|
-
}
|
|
3192
|
-
finally { if (e_3) throw e_3.error; }
|
|
3193
|
-
}
|
|
3194
|
-
this.transform.destroy();
|
|
3195
|
-
this.transform = null;
|
|
3196
|
-
this.params = null;
|
|
3197
|
-
this.rendererManager = null;
|
|
3198
|
-
this.containerManager = null;
|
|
3199
|
-
this.application = null;
|
|
3200
|
-
this.game = null;
|
|
3201
|
-
this.multiApps = null;
|
|
3202
|
-
};
|
|
3203
|
-
Renderer.prototype.resize = function (width, height) {
|
|
3204
|
-
this.params.width = width;
|
|
3205
|
-
this.params.height = height;
|
|
3206
|
-
this.application.renderer.resize(width, height);
|
|
3207
|
-
};
|
|
3208
|
-
Renderer.systemName = 'Renderer';
|
|
3209
|
-
Renderer = __decorate([
|
|
3210
|
-
eva_js.decorators.componentObserver({
|
|
3211
|
-
Transform: ['_parent'],
|
|
3212
|
-
})
|
|
3213
|
-
], Renderer);
|
|
3214
|
-
return Renderer;
|
|
3215
|
-
}(eva_js.System));
|
|
3216
|
-
var Renderer$3 = Renderer$2;
|
|
3217
|
-
|
|
3218
|
-
((function (_super) {
|
|
3219
|
-
__extends(Renderer, _super);
|
|
3220
|
-
function Renderer(params) {
|
|
3221
|
-
var _this = _super.call(this, params) || this;
|
|
3222
|
-
_this.observerInfo = _this.constructor.observerInfo;
|
|
3223
|
-
return _this;
|
|
3224
|
-
}
|
|
3225
|
-
Renderer.prototype.componentChanged = function (_changed) { };
|
|
3226
|
-
Renderer.prototype.rendererUpdate = function (_gameObject) { };
|
|
3227
|
-
Renderer.prototype.update = function () {
|
|
3228
|
-
var e_1, _a;
|
|
3229
|
-
var changes = this.componentObserver.clear();
|
|
3230
|
-
try {
|
|
3231
|
-
for (var changes_1 = __values(changes), changes_1_1 = changes_1.next(); !changes_1_1.done; changes_1_1 = changes_1.next()) {
|
|
3232
|
-
var changed = changes_1_1.value;
|
|
3233
|
-
this.componentChanged(changed);
|
|
3234
|
-
}
|
|
3235
|
-
}
|
|
3236
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
3237
|
-
finally {
|
|
3238
|
-
try {
|
|
3239
|
-
if (changes_1_1 && !changes_1_1.done && (_a = changes_1.return)) _a.call(changes_1);
|
|
3240
|
-
}
|
|
3241
|
-
finally { if (e_1) throw e_1.error; }
|
|
3242
|
-
}
|
|
3243
|
-
};
|
|
3244
|
-
return Renderer;
|
|
3245
|
-
})(eva_js.System));
|
|
3246
|
-
|
|
3247
|
-
function uuid(len) {
|
|
3248
|
-
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
|
|
3249
|
-
var uuid = [];
|
|
3250
|
-
var radix = chars.length;
|
|
3251
|
-
for (var i = 0; i < len; i++)
|
|
3252
|
-
uuid[i] = chars[0 | (Math.random() * radix)];
|
|
3253
|
-
return uuid.join('');
|
|
3254
|
-
}
|
|
3255
|
-
var setStyle = function (element, style) {
|
|
3256
|
-
var width = style.width, height = style.height, position = style.position, _a = style.left, left = _a === void 0 ? 0 : _a, _b = style.top, top = _b === void 0 ? 0 : _b, zIndex = style.zIndex, pointerEvents = style.pointerEvents, background = style.background;
|
|
3257
|
-
element.style.width = width + "px";
|
|
3258
|
-
element.style.height = height + "px";
|
|
3259
|
-
element.style.position = position;
|
|
3260
|
-
element.style.left = "" + left;
|
|
3261
|
-
element.style.top = "" + top;
|
|
3262
|
-
element.style.zIndex = "" + zIndex;
|
|
3263
|
-
element.style.pointerEvents = pointerEvents;
|
|
3264
|
-
element.style.background = background;
|
|
3265
|
-
element.style.border = 'none';
|
|
3266
|
-
element.style.overflow = 'hidden';
|
|
3267
|
-
};
|
|
3268
|
-
var setTransform = function (element, transform, ratioX, ratioY) {
|
|
3269
|
-
var worldTransform = transform.worldTransform;
|
|
3270
|
-
var a = worldTransform.a, b = worldTransform.b, c = worldTransform.c, d = worldTransform.d, tx = worldTransform.tx, ty = worldTransform.ty;
|
|
3271
|
-
var matrix = "matrix(" + a + ", " + b + ", " + c + ", " + d + ", " + tx * ratioX + ", " + ty * ratioY + ")";
|
|
3272
|
-
element.style.transform = "" + matrix;
|
|
3273
|
-
element.style.webkitTransform = "" + matrix;
|
|
3274
|
-
element.style.transformOrigin = 'left top';
|
|
3275
|
-
element.style.webkitTransformOrigin = 'left top';
|
|
852
|
+
A11ySystem.prototype.onDestroy = function () {
|
|
853
|
+
this.div.parentElement.removeChild(this.div);
|
|
854
|
+
this.cache = null;
|
|
855
|
+
this.eventCache = null;
|
|
856
|
+
this.div = null;
|
|
3276
857
|
};
|
|
3277
858
|
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
], A11y.prototype, "interactive", void 0);
|
|
3298
|
-
__decorate$1([
|
|
3299
|
-
eva_js.decorators.IDEProp
|
|
3300
|
-
], A11y.prototype, "hint", void 0);
|
|
3301
|
-
__decorate$1([
|
|
3302
|
-
eva_js.decorators.IDEProp
|
|
3303
|
-
], A11y.prototype, "event", void 0);
|
|
3304
|
-
__decorate$1([
|
|
3305
|
-
eva_js.decorators.IDEProp
|
|
3306
|
-
], A11y.prototype, "delay", void 0);
|
|
3307
|
-
__decorate$1([
|
|
3308
|
-
eva_js.decorators.IDEProp
|
|
3309
|
-
], A11y.prototype, "role", void 0);
|
|
3310
|
-
__decorate$1([
|
|
3311
|
-
eva_js.decorators.IDEProp
|
|
3312
|
-
], A11y.prototype, "props", void 0);
|
|
3313
|
-
__decorate$1([
|
|
3314
|
-
eva_js.decorators.IDEProp
|
|
3315
|
-
], A11y.prototype, "state", void 0);
|
|
3316
|
-
__decorate$1([
|
|
3317
|
-
eva_js.decorators.IDEProp
|
|
3318
|
-
], A11y.prototype, "attr", void 0);
|
|
3319
|
-
__decorate$1([
|
|
3320
|
-
eva_js.decorators.IDEProp
|
|
3321
|
-
], A11y.prototype, "a11yId", void 0);
|
|
3322
|
-
return A11y;
|
|
3323
|
-
}(eva_js.Component));
|
|
3324
|
-
var A11y$1 = A11y;
|
|
3325
|
-
|
|
3326
|
-
var POSITION = 'absolute';
|
|
3327
|
-
var ZINDEX = 3;
|
|
3328
|
-
exports.A11yActivate = void 0;
|
|
3329
|
-
(function (A11yActivate) {
|
|
3330
|
-
A11yActivate[A11yActivate["ENABLE"] = 0] = "ENABLE";
|
|
3331
|
-
A11yActivate[A11yActivate["DISABLE"] = 1] = "DISABLE";
|
|
3332
|
-
A11yActivate[A11yActivate["CHECK"] = 2] = "CHECK";
|
|
3333
|
-
})(exports.A11yActivate || (exports.A11yActivate = {}));
|
|
3334
|
-
var PointerEvents;
|
|
3335
|
-
(function (PointerEvents) {
|
|
3336
|
-
PointerEvents["NONE"] = "none";
|
|
3337
|
-
PointerEvents["AUTO"] = "auto";
|
|
3338
|
-
})(PointerEvents || (PointerEvents = {}));
|
|
3339
|
-
var MaskBackground;
|
|
3340
|
-
(function (MaskBackground) {
|
|
3341
|
-
MaskBackground["DEBUG"] = "rgba(255,0,0,0.5)";
|
|
3342
|
-
MaskBackground["NONE"] = "transparent";
|
|
3343
|
-
})(MaskBackground || (MaskBackground = {}));
|
|
3344
|
-
var ElementType;
|
|
3345
|
-
(function (ElementType) {
|
|
3346
|
-
ElementType["BUTTON"] = "button";
|
|
3347
|
-
ElementType["DIV"] = "div";
|
|
3348
|
-
})(ElementType || (ElementType = {}));
|
|
3349
|
-
|
|
3350
|
-
var notAttr = ['hint', 'event', 'delay', 'attr', 'role', 'props', 'state', 'a11yId', 'name'];
|
|
3351
|
-
var getEventFunc = function (event, gameObject, e) {
|
|
3352
|
-
var _this = this;
|
|
3353
|
-
['touchstart', 'touchend', 'tap'].forEach(function (name) {
|
|
3354
|
-
event.emit(name, {
|
|
3355
|
-
stopPropagation: function () { return e.stopPropagation(); },
|
|
3356
|
-
data: {
|
|
3357
|
-
position: _this.eventPosition,
|
|
3358
|
-
},
|
|
3359
|
-
gameObject: gameObject,
|
|
3360
|
-
});
|
|
3361
|
-
});
|
|
3362
|
-
};
|
|
3363
|
-
var A11ySystem = (function (_super) {
|
|
3364
|
-
__extends$2(A11ySystem, _super);
|
|
3365
|
-
function A11ySystem(opt) {
|
|
3366
|
-
var _this = _super.call(this, opt) || this;
|
|
3367
|
-
_this.cache = new Map();
|
|
3368
|
-
_this.eventCache = new Map();
|
|
3369
|
-
return _this;
|
|
3370
|
-
}
|
|
3371
|
-
Object.defineProperty(A11ySystem.prototype, "ratioX", {
|
|
3372
|
-
get: function () {
|
|
3373
|
-
if (this._ratioX) {
|
|
3374
|
-
return this._ratioX;
|
|
3375
|
-
}
|
|
3376
|
-
else {
|
|
3377
|
-
var success = this.setRatio();
|
|
3378
|
-
if (success) {
|
|
3379
|
-
return this._ratioX;
|
|
3380
|
-
}
|
|
3381
|
-
else {
|
|
3382
|
-
return 0;
|
|
3383
|
-
}
|
|
3384
|
-
}
|
|
3385
|
-
},
|
|
3386
|
-
enumerable: false,
|
|
3387
|
-
configurable: true
|
|
3388
|
-
});
|
|
3389
|
-
Object.defineProperty(A11ySystem.prototype, "ratioY", {
|
|
3390
|
-
get: function () {
|
|
3391
|
-
if (this._ratioY) {
|
|
3392
|
-
return this._ratioY;
|
|
3393
|
-
}
|
|
3394
|
-
else {
|
|
3395
|
-
var success = this.setRatio();
|
|
3396
|
-
if (success) {
|
|
3397
|
-
return this._ratioY;
|
|
3398
|
-
}
|
|
3399
|
-
else {
|
|
3400
|
-
return 0;
|
|
3401
|
-
}
|
|
3402
|
-
}
|
|
3403
|
-
},
|
|
3404
|
-
enumerable: false,
|
|
3405
|
-
configurable: true
|
|
3406
|
-
});
|
|
3407
|
-
A11ySystem.prototype.init = function (opt) {
|
|
3408
|
-
if (opt === void 0) { opt = {}; }
|
|
3409
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
3410
|
-
var _a, activate, _b, delay, _c, checkA11yOpen, _d, _e, div;
|
|
3411
|
-
return __generator(this, function (_f) {
|
|
3412
|
-
switch (_f.label) {
|
|
3413
|
-
case 0:
|
|
3414
|
-
_a = opt.activate, activate = _a === void 0 ? exports.A11yActivate.CHECK : _a, _b = opt.delay, delay = _b === void 0 ? 100 : _b, _c = opt.checkA11yOpen, checkA11yOpen = _c === void 0 ? function () { return Promise.resolve(false); } : _c;
|
|
3415
|
-
this.delay = delay;
|
|
3416
|
-
_d = activate;
|
|
3417
|
-
switch (_d) {
|
|
3418
|
-
case exports.A11yActivate.CHECK: return [3, 1];
|
|
3419
|
-
case exports.A11yActivate.DISABLE: return [3, 5];
|
|
3420
|
-
case exports.A11yActivate.ENABLE: return [3, 6];
|
|
3421
|
-
}
|
|
3422
|
-
return [3, 7];
|
|
3423
|
-
case 1:
|
|
3424
|
-
_f.trys.push([1, 3, , 4]);
|
|
3425
|
-
_e = this;
|
|
3426
|
-
return [4, checkA11yOpen()];
|
|
3427
|
-
case 2:
|
|
3428
|
-
_e.activate = _f.sent();
|
|
3429
|
-
return [3, 4];
|
|
3430
|
-
case 3:
|
|
3431
|
-
_f.sent();
|
|
3432
|
-
this.activate = false;
|
|
3433
|
-
return [3, 4];
|
|
3434
|
-
case 4: return [3, 7];
|
|
3435
|
-
case 5:
|
|
3436
|
-
this.activate = false;
|
|
3437
|
-
return [3, 7];
|
|
3438
|
-
case 6:
|
|
3439
|
-
this.activate = true;
|
|
3440
|
-
return [3, 7];
|
|
3441
|
-
case 7:
|
|
3442
|
-
this.debug = opt.debug || false;
|
|
3443
|
-
if (this.debug) {
|
|
3444
|
-
this.activate = true;
|
|
3445
|
-
}
|
|
3446
|
-
if (!this.activate)
|
|
3447
|
-
return [2];
|
|
3448
|
-
div = document.createElement('div');
|
|
3449
|
-
this.div = div;
|
|
3450
|
-
if (this.game.canvas.parentNode) {
|
|
3451
|
-
this.game.canvas.parentNode.appendChild(this.div);
|
|
3452
|
-
}
|
|
3453
|
-
return [2];
|
|
3454
|
-
}
|
|
3455
|
-
});
|
|
3456
|
-
});
|
|
3457
|
-
};
|
|
3458
|
-
A11ySystem.prototype.setRatio = function () {
|
|
3459
|
-
var _a = this.getCanvasBoundingClientRect(), width = _a.width, height = _a.height;
|
|
3460
|
-
var _b = this.getRenderRect(), renderWidth = _b.renderWidth, renderHeight = _b.renderHeight;
|
|
3461
|
-
this._ratioX = width / renderWidth;
|
|
3462
|
-
this._ratioY = height / renderHeight;
|
|
3463
|
-
if (width || height) {
|
|
3464
|
-
this.initDiv();
|
|
3465
|
-
return true;
|
|
3466
|
-
}
|
|
3467
|
-
else {
|
|
3468
|
-
return false;
|
|
3469
|
-
}
|
|
3470
|
-
};
|
|
3471
|
-
A11ySystem.prototype.getRenderRect = function () {
|
|
3472
|
-
var params = (this.game.getSystem(Renderer$3) || { width: 300, height: 300 }).params;
|
|
3473
|
-
var renderHeight = params.height, renderWidth = params.width;
|
|
3474
|
-
return { renderWidth: renderWidth, renderHeight: renderHeight };
|
|
3475
|
-
};
|
|
3476
|
-
A11ySystem.prototype.getCanvasBoundingClientRect = function () {
|
|
3477
|
-
var _a = this.game.canvas.getBoundingClientRect(), width = _a.width, height = _a.height, left = _a.left, top = _a.top;
|
|
3478
|
-
return { width: width, height: height, left: left, top: top };
|
|
3479
|
-
};
|
|
3480
|
-
A11ySystem.prototype.initDiv = function () {
|
|
3481
|
-
var _this = this;
|
|
3482
|
-
var pageXOffset = window.pageXOffset, pageYOffset = window.pageYOffset;
|
|
3483
|
-
var _a = this.getCanvasBoundingClientRect(), width = _a.width, height = _a.height, left = _a.left, top = _a.top;
|
|
3484
|
-
var style = {
|
|
3485
|
-
width: width,
|
|
3486
|
-
height: height,
|
|
3487
|
-
left: left + pageXOffset + "px",
|
|
3488
|
-
top: top + pageYOffset + "px",
|
|
3489
|
-
position: POSITION,
|
|
3490
|
-
zIndex: ZINDEX,
|
|
3491
|
-
pointerEvents: PointerEvents.NONE,
|
|
3492
|
-
background: MaskBackground.NONE,
|
|
3493
|
-
};
|
|
3494
|
-
setStyle(this.div, style);
|
|
3495
|
-
this.div.addEventListener('click', function (e) {
|
|
3496
|
-
var currentTarget = e.currentTarget;
|
|
3497
|
-
var _a = currentTarget.getBoundingClientRect(), left = _a.left, top = _a.top;
|
|
3498
|
-
var x = (e.pageX - left) / _this.ratioX;
|
|
3499
|
-
var y = (e.pageY - top) / _this.ratioY;
|
|
3500
|
-
_this.eventPosition = { x: x, y: y };
|
|
3501
|
-
}, true);
|
|
3502
|
-
};
|
|
3503
|
-
A11ySystem.prototype.update = function () {
|
|
3504
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
3505
|
-
var changes, changes_1, changes_1_1, changed;
|
|
3506
|
-
var e_1, _a;
|
|
3507
|
-
return __generator(this, function (_b) {
|
|
3508
|
-
changes = this.componentObserver.clear();
|
|
3509
|
-
if (!this.activate) {
|
|
3510
|
-
return [2];
|
|
3511
|
-
}
|
|
3512
|
-
try {
|
|
3513
|
-
for (changes_1 = __values$1(changes), changes_1_1 = changes_1.next(); !changes_1_1.done; changes_1_1 = changes_1.next()) {
|
|
3514
|
-
changed = changes_1_1.value;
|
|
3515
|
-
switch (changed.type) {
|
|
3516
|
-
case eva_js.OBSERVER_TYPE.ADD:
|
|
3517
|
-
changed.componentName === 'Event' && this.addEvent(changed.gameObject);
|
|
3518
|
-
changed.componentName === 'A11y' && this.add(changed);
|
|
3519
|
-
break;
|
|
3520
|
-
case eva_js.OBSERVER_TYPE.CHANGE:
|
|
3521
|
-
changed.componentName === 'Transform' && this.transformChange(changed);
|
|
3522
|
-
break;
|
|
3523
|
-
case eva_js.OBSERVER_TYPE.REMOVE:
|
|
3524
|
-
changed.componentName === 'Event' && this.removeEvent(changed);
|
|
3525
|
-
changed.componentName === 'A11y' && this.remove(changed);
|
|
3526
|
-
}
|
|
3527
|
-
}
|
|
3528
|
-
}
|
|
3529
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
3530
|
-
finally {
|
|
3531
|
-
try {
|
|
3532
|
-
if (changes_1_1 && !changes_1_1.done && (_a = changes_1.return)) _a.call(changes_1);
|
|
3533
|
-
}
|
|
3534
|
-
finally { if (e_1) throw e_1.error; }
|
|
3535
|
-
}
|
|
3536
|
-
return [2];
|
|
3537
|
-
});
|
|
3538
|
-
});
|
|
3539
|
-
};
|
|
3540
|
-
A11ySystem.prototype.remove = function (changed) {
|
|
3541
|
-
var component = changed.component;
|
|
3542
|
-
if (!component)
|
|
3543
|
-
return;
|
|
3544
|
-
var a11yId = component.a11yId;
|
|
3545
|
-
var element = this.div.querySelector("#" + a11yId);
|
|
3546
|
-
element && this.div.removeChild(element);
|
|
3547
|
-
this.cache.delete(a11yId);
|
|
3548
|
-
};
|
|
3549
|
-
A11ySystem.prototype.add = function (changed) {
|
|
3550
|
-
var _this = this;
|
|
3551
|
-
if (!this.activate)
|
|
3552
|
-
return;
|
|
3553
|
-
var component = changed.component;
|
|
3554
|
-
var gameObject = changed.gameObject;
|
|
3555
|
-
var delay = component.delay, id = component.a11yId;
|
|
3556
|
-
var event = component.event;
|
|
3557
|
-
if (!gameObject)
|
|
3558
|
-
return;
|
|
3559
|
-
var transform = gameObject.transform;
|
|
3560
|
-
if (!transform)
|
|
3561
|
-
return;
|
|
3562
|
-
var element = document.createElement('div');
|
|
3563
|
-
this.cache.set(id, element);
|
|
3564
|
-
if (!event) {
|
|
3565
|
-
event = gameObject.getComponent('Event');
|
|
3566
|
-
}
|
|
3567
|
-
setTimeout(function () {
|
|
3568
|
-
_this.setPosition(element, transform);
|
|
3569
|
-
_this.setA11yAttr(element, component);
|
|
3570
|
-
if (event) {
|
|
3571
|
-
_this.addEvent(gameObject);
|
|
3572
|
-
}
|
|
3573
|
-
if (gameObject.scene) {
|
|
3574
|
-
_this.div.appendChild(element);
|
|
3575
|
-
}
|
|
3576
|
-
}, delay || this.delay);
|
|
3577
|
-
};
|
|
3578
|
-
A11ySystem.prototype.transformChange = function (changed) {
|
|
3579
|
-
var component = changed.component;
|
|
3580
|
-
var gameObject = changed.gameObject;
|
|
3581
|
-
var a11yComponent = gameObject.getComponent(A11y$1);
|
|
3582
|
-
if (!a11yComponent)
|
|
3583
|
-
return;
|
|
3584
|
-
var a11yId = a11yComponent.a11yId;
|
|
3585
|
-
if (!component.inScene) {
|
|
3586
|
-
var dom = this.div.querySelector("#" + a11yId);
|
|
3587
|
-
dom && this.div.removeChild(dom);
|
|
3588
|
-
}
|
|
3589
|
-
else {
|
|
3590
|
-
if (this.cache.has(a11yId)) {
|
|
3591
|
-
var addDom = this.cache.get(a11yId);
|
|
3592
|
-
addDom && this.div.appendChild(addDom);
|
|
3593
|
-
}
|
|
3594
|
-
}
|
|
3595
|
-
};
|
|
3596
|
-
A11ySystem.prototype.setEvent = function (element, event, gameObject, id) {
|
|
3597
|
-
if (!event) {
|
|
3598
|
-
return;
|
|
3599
|
-
}
|
|
3600
|
-
var func = getEventFunc.bind(this, event, gameObject);
|
|
3601
|
-
this.eventCache.set(id, func);
|
|
3602
|
-
element.addEventListener('click', func);
|
|
3603
|
-
};
|
|
3604
|
-
A11ySystem.prototype.addEvent = function (gameObject) {
|
|
3605
|
-
var a11y = gameObject.getComponent(A11y$1);
|
|
3606
|
-
if (!a11y)
|
|
3607
|
-
return;
|
|
3608
|
-
var event = gameObject.getComponent('Event');
|
|
3609
|
-
if (!event)
|
|
3610
|
-
return;
|
|
3611
|
-
var element = this.cache.get(a11y.a11yId);
|
|
3612
|
-
element && this.setEvent(element, event, gameObject, a11y.a11yId);
|
|
3613
|
-
};
|
|
3614
|
-
A11ySystem.prototype.removeEvent = function (changed) {
|
|
3615
|
-
var gameObject = changed.gameObject;
|
|
3616
|
-
var a11y = gameObject.getComponent(A11y$1);
|
|
3617
|
-
if (!a11y)
|
|
3618
|
-
return;
|
|
3619
|
-
var event = changed.component;
|
|
3620
|
-
if (!event)
|
|
3621
|
-
return;
|
|
3622
|
-
var a11yId = a11y.a11yId;
|
|
3623
|
-
var func = this.eventCache.get(a11yId);
|
|
3624
|
-
var element = this.cache.get(a11yId);
|
|
3625
|
-
element && element.removeEventListener('click', func);
|
|
3626
|
-
};
|
|
3627
|
-
A11ySystem.prototype.setA11yAttr = function (element, component) {
|
|
3628
|
-
var e_2, _a, e_3, _b, e_4, _c;
|
|
3629
|
-
var hint = component.hint, _d = component.props, props = _d === void 0 ? {} : _d, _e = component.state, state = _e === void 0 ? {} : _e, role = component.role, id = component.a11yId;
|
|
3630
|
-
var realRole = role || 'text';
|
|
3631
|
-
element.setAttribute('role', realRole);
|
|
3632
|
-
element.setAttribute('aria-label', hint);
|
|
3633
|
-
element.id = id;
|
|
3634
|
-
var ariaProps = Object.keys(props);
|
|
3635
|
-
try {
|
|
3636
|
-
for (var ariaProps_1 = __values$1(ariaProps), ariaProps_1_1 = ariaProps_1.next(); !ariaProps_1_1.done; ariaProps_1_1 = ariaProps_1.next()) {
|
|
3637
|
-
var key = ariaProps_1_1.value;
|
|
3638
|
-
element.setAttribute(key, props[key]);
|
|
3639
|
-
}
|
|
3640
|
-
}
|
|
3641
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
3642
|
-
finally {
|
|
3643
|
-
try {
|
|
3644
|
-
if (ariaProps_1_1 && !ariaProps_1_1.done && (_a = ariaProps_1.return)) _a.call(ariaProps_1);
|
|
3645
|
-
}
|
|
3646
|
-
finally { if (e_2) throw e_2.error; }
|
|
3647
|
-
}
|
|
3648
|
-
var ariaState = Object.keys(state);
|
|
3649
|
-
try {
|
|
3650
|
-
for (var ariaState_1 = __values$1(ariaState), ariaState_1_1 = ariaState_1.next(); !ariaState_1_1.done; ariaState_1_1 = ariaState_1.next()) {
|
|
3651
|
-
var key = ariaState_1_1.value;
|
|
3652
|
-
element.setAttribute(key, state[key]);
|
|
3653
|
-
}
|
|
3654
|
-
}
|
|
3655
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
3656
|
-
finally {
|
|
3657
|
-
try {
|
|
3658
|
-
if (ariaState_1_1 && !ariaState_1_1.done && (_b = ariaState_1.return)) _b.call(ariaState_1);
|
|
3659
|
-
}
|
|
3660
|
-
finally { if (e_3) throw e_3.error; }
|
|
3661
|
-
}
|
|
3662
|
-
try {
|
|
3663
|
-
for (var _f = __values$1(Object.keys(component)), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
3664
|
-
var key = _g.value;
|
|
3665
|
-
if (typeof component[key] === 'string' && notAttr.indexOf(key) === -1 && key.indexOf('_') !== 1) {
|
|
3666
|
-
element.setAttribute(key, component[key]);
|
|
3667
|
-
}
|
|
3668
|
-
}
|
|
3669
|
-
}
|
|
3670
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
3671
|
-
finally {
|
|
3672
|
-
try {
|
|
3673
|
-
if (_g && !_g.done && (_c = _f.return)) _c.call(_f);
|
|
3674
|
-
}
|
|
3675
|
-
finally { if (e_4) throw e_4.error; }
|
|
3676
|
-
}
|
|
3677
|
-
};
|
|
3678
|
-
A11ySystem.prototype.setPosition = function (element, transform) {
|
|
3679
|
-
var _a = transform.size, width = _a.width, height = _a.height;
|
|
3680
|
-
var style = {
|
|
3681
|
-
width: width === 0 ? 1 : width * this.ratioX,
|
|
3682
|
-
height: height === 0 ? 1 : height * this.ratioY,
|
|
3683
|
-
position: POSITION,
|
|
3684
|
-
zIndex: ZINDEX,
|
|
3685
|
-
pointerEvents: PointerEvents.AUTO,
|
|
3686
|
-
background: this.debug ? MaskBackground.DEBUG : MaskBackground.NONE,
|
|
3687
|
-
};
|
|
3688
|
-
var transformProps = __assign$1({}, transform);
|
|
3689
|
-
setStyle(element, style);
|
|
3690
|
-
setTransform(element, transformProps, this.ratioX, this.ratioY);
|
|
3691
|
-
};
|
|
3692
|
-
A11ySystem.prototype.onDestroy = function () {
|
|
3693
|
-
this.div.parentElement.removeChild(this.div);
|
|
3694
|
-
this.cache = null;
|
|
3695
|
-
this.eventCache = null;
|
|
3696
|
-
};
|
|
3697
|
-
A11ySystem.systemName = 'A11ySystem';
|
|
3698
|
-
A11ySystem = __decorate$1([
|
|
3699
|
-
eva_js.decorators.componentObserver({
|
|
3700
|
-
A11y: [],
|
|
3701
|
-
Transform: ['inScene'],
|
|
3702
|
-
Event: [],
|
|
3703
|
-
})
|
|
3704
|
-
], A11ySystem);
|
|
3705
|
-
return A11ySystem;
|
|
3706
|
-
}(eva_js.System));
|
|
3707
|
-
var A11ySystem$1 = A11ySystem;
|
|
3708
|
-
|
|
3709
|
-
exports.A11y = A11y$1;
|
|
3710
|
-
exports.A11ySystem = A11ySystem$1;
|
|
3711
|
-
|
|
3712
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3713
|
-
|
|
3714
|
-
})));
|
|
3715
|
-
//# sourceMappingURL=EVA.plugin.a11y.js.map
|
|
859
|
+
A11ySystem.systemName = 'A11ySystem';
|
|
860
|
+
A11ySystem = __decorate([eva_js.decorators.componentObserver({
|
|
861
|
+
A11y: ['hint'],
|
|
862
|
+
Transform: ['inScene'],
|
|
863
|
+
Event: []
|
|
864
|
+
})], A11ySystem);
|
|
865
|
+
return A11ySystem;
|
|
866
|
+
}(eva_js.System);
|
|
867
|
+
|
|
868
|
+
var A11ySystem$1 = A11ySystem;
|
|
869
|
+
exports.A11y = A11y$1;
|
|
870
|
+
exports.A11ySystem = A11ySystem$1;
|
|
871
|
+
Object.defineProperty(exports, '__esModule', {
|
|
872
|
+
value: true
|
|
873
|
+
});
|
|
874
|
+
return exports;
|
|
875
|
+
}({}, EVA, EVA.plugin.renderer);
|
|
876
|
+
|
|
877
|
+
window.EVA.plugin.a11y = window.EVA.plugin.a11y || _EVA_IIFE_a11y;
|