@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.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@eva/eva.js"),require("pixi.js")):"function"==typeof define&&define.amd?define(["exports","@eva/eva.js","pixi.js"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).EVA=t.EVA||{},t.EVA.plugin=t.EVA.plugin||{},t.EVA.plugin.a11y={}),t.EVA,t.PIXI)}(this,(function(t,e,r){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function o(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function a(t,e,r,n){var o,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function c(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function c(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,c)}s((n=n.apply(t,e||[])).next())}))}function s(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}function u(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var p=function(t,e){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function l(t,e){function r(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var f=function(t){function e(e){return e.autoStart=!1,t.call(this,e)||this}return l(e,t),e}(r.Application),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e}(r.Container);!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}l(e,t)}(r.Graphics),function(t){function e(e,n,o,i,a){var c;return c="string"===e?r.Texture.fromFrame(e):r.Texture.from(e),t.call(this,c,n,o,i,a)||this}l(e,t)}(r.mesh.NineSlicePlane),function(){function t(t){this._image=null,this._image=t,t?t instanceof HTMLImageElement?this.sprite=r.Sprite.from(t):t instanceof r.Texture&&(this.sprite=new r.Sprite(t)):this.sprite=new r.Sprite}Object.defineProperty(t.prototype,"image",{get:function(){return this._image},set:function(t){this._image!==t&&(t instanceof HTMLImageElement?(this.sprite.texture&&this.sprite.texture.destroy(!1),this.sprite.texture=r.Texture.from(t)):t instanceof r.Texture&&(this.sprite.texture=t),this._image=t)},enumerable:!1,configurable:!0})}(),function(){function t(t){var e=t.frames;this.animatedSprite=new r.extras.AnimatedSprite(e)}t.prototype.play=function(){this.animatedSprite.play()},t.prototype.stop=function(){this.animatedSprite.stop()},t.prototype.gotoAndPlay=function(t){this.animatedSprite.gotoAndPlay(t)},t.prototype.gotoAndStop=function(t){this.animatedSprite.gotoAndStop(t)},Object.defineProperty(t.prototype,"speed",{get:function(){return this.animatedSprite.animationSpeed},set:function(t){this.animatedSprite.animationSpeed=t},enumerable:!1,configurable:!0})}(),function(t){function e(e,r){return t.call(this,e,r)||this}l(e,t)}(r.Text);var v=r.extras.TilingSprite;function d(t,e){return t===e||t!=t&&e!=e}function y(t,e){for(var r=t.length;r--;)if(d(t[r][0],e))return r;return-1}!function(){function t(t){this._image=null,this._image=t,t?t instanceof HTMLImageElement?this.tilingSprite=new v(r.Texture.from(t)):t instanceof r.Texture&&(this.tilingSprite=new v(t)):this.tilingSprite=new v(r.Texture.EMPTY)}Object.defineProperty(t.prototype,"image",{get:function(){return this._image},set:function(t){this._image!==t&&(t instanceof HTMLImageElement?this.tilingSprite.texture=r.Texture.from(t):t instanceof r.Texture&&(this.tilingSprite.texture=t),this._image=t)},enumerable:!1,configurable:!0})}();var m=Array.prototype.splice;function g(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}g.prototype.clear=function(){this.__data__=[],this.size=0},g.prototype.delete=function(t){var e=this.__data__,r=y(e,t);return!(r<0)&&(r==e.length-1?e.pop():m.call(e,r,1),--this.size,!0)},g.prototype.get=function(t){var e=this.__data__,r=y(e,t);return r<0?void 0:e[r][1]},g.prototype.has=function(t){return y(this.__data__,t)>-1},g.prototype.set=function(t,e){var r=this.__data__,n=y(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var b="object"==typeof global&&global&&global.Object===Object&&global,_="object"==typeof self&&self&&self.Object===Object&&self,w=b||_||Function("return this")(),j=w.Symbol,O=Object.prototype,E=O.hasOwnProperty,x=O.toString,A=j?j.toStringTag:void 0;var S=Object.prototype.toString;var C=j?j.toStringTag:void 0;function P(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":C&&C in Object(t)?function(t){var e=E.call(t,A),r=t[A];try{t[A]=void 0;var n=!0}catch(t){}var o=x.call(t);return n&&(e?t[A]=r:delete t[A]),o}(t):function(t){return S.call(t)}(t)}function T(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function I(t){if(!T(t))return!1;var e=P(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var M,R=w["__core-js_shared__"],N=(M=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"";var k=Function.prototype.toString;function D(t){if(null!=t){try{return k.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var z=/^\[object .+?Constructor\]$/,B=Function.prototype,L=Object.prototype,V=B.toString,U=L.hasOwnProperty,Y=RegExp("^"+V.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function H(t){return!(!T(t)||(e=t,N&&N in e))&&(I(t)?Y:z).test(D(t));var e}function F(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return H(r)?r:void 0}var G=F(w,"Map"),X=F(Object,"create");var W=Object.prototype.hasOwnProperty;var q=Object.prototype.hasOwnProperty;function K(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function $(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function J(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}K.prototype.clear=function(){this.__data__=X?X(null):{},this.size=0},K.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},K.prototype.get=function(t){var e=this.__data__;if(X){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return W.call(e,t)?e[t]:void 0},K.prototype.has=function(t){var e=this.__data__;return X?void 0!==e[t]:q.call(e,t)},K.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=X&&void 0===e?"__lodash_hash_undefined__":e,this},J.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(G||g),string:new K}},J.prototype.delete=function(t){var e=$(this,t).delete(t);return this.size-=e?1:0,e},J.prototype.get=function(t){return $(this,t).get(t)},J.prototype.has=function(t){return $(this,t).has(t)},J.prototype.set=function(t,e){var r=$(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Q(t){var e=this.__data__=new g(t);this.size=e.size}Q.prototype.clear=function(){this.__data__=new g,this.size=0},Q.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Q.prototype.get=function(t){return this.__data__.get(t)},Q.prototype.has=function(t){return this.__data__.has(t)},Q.prototype.set=function(t,e){var r=this.__data__;if(r instanceof g){var n=r.__data__;if(!G||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new J(n)}return r.set(t,e),this.size=r.size,this};function Z(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new J;++e<r;)this.add(t[e])}function tt(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}Z.prototype.add=Z.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Z.prototype.has=function(t){return this.__data__.has(t)};function et(t,e,r,n,o,i){var a=1&r,c=t.length,s=e.length;if(c!=s&&!(a&&s>c))return!1;var u=i.get(t),p=i.get(e);if(u&&p)return u==e&&p==t;var l=-1,f=!0,h=2&r?new Z:void 0;for(i.set(t,e),i.set(e,t);++l<c;){var v=t[l],d=e[l];if(n)var y=a?n(d,v,l,e,t,i):n(v,d,l,t,e,i);if(void 0!==y){if(y)continue;f=!1;break}if(h){if(!tt(e,(function(t,e){if(a=e,!h.has(a)&&(v===t||o(v,t,r,n,i)))return h.push(e);var a}))){f=!1;break}}else if(v!==d&&!o(v,d,r,n,i)){f=!1;break}}return i.delete(t),i.delete(e),f}var rt=w.Uint8Array;function nt(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function ot(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var it=j?j.prototype:void 0,at=it?it.valueOf:void 0;var ct=Array.isArray;var st=Object.prototype.propertyIsEnumerable,ut=Object.getOwnPropertySymbols,pt=ut?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i}(ut(t),(function(e){return st.call(t,e)})))}:function(){return[]};function lt(t){return null!=t&&"object"==typeof t}function ft(t){return lt(t)&&"[object Arguments]"==P(t)}var ht=Object.prototype,vt=ht.hasOwnProperty,dt=ht.propertyIsEnumerable,yt=ft(function(){return arguments}())?ft:function(t){return lt(t)&&vt.call(t,"callee")&&!dt.call(t,"callee")};var mt="object"==typeof t&&t&&!t.nodeType&&t,gt=mt&&"object"==typeof module&&module&&!module.nodeType&&module,bt=gt&&gt.exports===mt?w.Buffer:void 0,_t=(bt?bt.isBuffer:void 0)||function(){return!1},wt=/^(?:0|[1-9]\d*)$/;function jt(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&wt.test(t))&&t>-1&&t%1==0&&t<e}function Ot(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}var Et={};Et["[object Float32Array]"]=Et["[object Float64Array]"]=Et["[object Int8Array]"]=Et["[object Int16Array]"]=Et["[object Int32Array]"]=Et["[object Uint8Array]"]=Et["[object Uint8ClampedArray]"]=Et["[object Uint16Array]"]=Et["[object Uint32Array]"]=!0,Et["[object Arguments]"]=Et["[object Array]"]=Et["[object ArrayBuffer]"]=Et["[object Boolean]"]=Et["[object DataView]"]=Et["[object Date]"]=Et["[object Error]"]=Et["[object Function]"]=Et["[object Map]"]=Et["[object Number]"]=Et["[object Object]"]=Et["[object RegExp]"]=Et["[object Set]"]=Et["[object String]"]=Et["[object WeakMap]"]=!1;var xt,At="object"==typeof t&&t&&!t.nodeType&&t,St=At&&"object"==typeof module&&module&&!module.nodeType&&module,Ct=St&&St.exports===At&&b.process,Pt=function(){try{var t=St&&St.require&&St.require("util").types;return t||Ct&&Ct.binding&&Ct.binding("util")}catch(t){}}(),Tt=Pt&&Pt.isTypedArray,It=Tt?(xt=Tt,function(t){return xt(t)}):function(t){return lt(t)&&Ot(t.length)&&!!Et[P(t)]},Mt=Object.prototype.hasOwnProperty;function Rt(t,e){var r=ct(t),n=!r&&yt(t),o=!r&&!n&&_t(t),i=!r&&!n&&!o&&It(t),a=r||n||o||i,c=a?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],s=c.length;for(var u in t)!e&&!Mt.call(t,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||jt(u,s))||c.push(u);return c}var Nt=Object.prototype;var kt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),Dt=Object.prototype.hasOwnProperty;function zt(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||Nt))return kt(t);var e,r,n=[];for(var o in Object(t))Dt.call(t,o)&&"constructor"!=o&&n.push(o);return n}function Bt(t){return null!=(e=t)&&Ot(e.length)&&!I(e)?Rt(t):zt(t);var e}function Lt(t){return function(t,e,r){var n=e(t);return ct(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,Bt,pt)}var Vt=Object.prototype.hasOwnProperty;var Ut=F(w,"DataView"),Yt=F(w,"Promise"),Ht=F(w,"Set"),Ft=F(w,"WeakMap"),Gt="[object Map]",Xt="[object Promise]",Wt="[object Set]",qt="[object WeakMap]",Kt="[object DataView]",$t=D(Ut),Jt=D(G),Qt=D(Yt),Zt=D(Ht),te=D(Ft),ee=P;(Ut&&ee(new Ut(new ArrayBuffer(1)))!=Kt||G&&ee(new G)!=Gt||Yt&&ee(Yt.resolve())!=Xt||Ht&&ee(new Ht)!=Wt||Ft&&ee(new Ft)!=qt)&&(ee=function(t){var e=P(t),r="[object Object]"==e?t.constructor:void 0,n=r?D(r):"";if(n)switch(n){case $t:return Kt;case Jt:return Gt;case Qt:return Xt;case Zt:return Wt;case te:return qt}return e});var re=ee,ne="[object Arguments]",oe="[object Array]",ie="[object Object]",ae=Object.prototype.hasOwnProperty;function ce(t,e,r,n,o,i){var a=ct(t),c=ct(e),s=a?oe:re(t),u=c?oe:re(e),p=(s=s==ne?ie:s)==ie,l=(u=u==ne?ie:u)==ie,f=s==u;if(f&&_t(t)){if(!_t(e))return!1;a=!0,p=!1}if(f&&!p)return i||(i=new Q),a||It(t)?et(t,e,r,n,o,i):function(t,e,r,n,o,i,a){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new rt(t),new rt(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return d(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var c=nt;case"[object Set]":var s=1&n;if(c||(c=ot),t.size!=e.size&&!s)return!1;var u=a.get(t);if(u)return u==e;n|=2,a.set(t,e);var p=et(c(t),c(e),n,o,i,a);return a.delete(t),p;case"[object Symbol]":if(at)return at.call(t)==at.call(e)}return!1}(t,e,s,r,n,o,i);if(!(1&r)){var h=p&&ae.call(t,"__wrapped__"),v=l&&ae.call(e,"__wrapped__");if(h||v){var y=h?t.value():t,m=v?e.value():e;return i||(i=new Q),o(y,m,r,n,i)}}return!!f&&(i||(i=new Q),function(t,e,r,n,o,i){var a=1&r,c=Lt(t),s=c.length;if(s!=Lt(e).length&&!a)return!1;for(var u=s;u--;){var p=c[u];if(!(a?p in e:Vt.call(e,p)))return!1}var l=i.get(t),f=i.get(e);if(l&&f)return l==e&&f==t;var h=!0;i.set(t,e),i.set(e,t);for(var v=a;++u<s;){var d=t[p=c[u]],y=e[p];if(n)var m=a?n(y,d,p,e,t,i):n(d,y,p,t,e,i);if(!(void 0===m?d===y||o(d,y,r,n,i):m)){h=!1;break}v||(v="constructor"==p)}if(h&&!v){var g=t.constructor,b=e.constructor;g==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof b&&b instanceof b||(h=!1)}return i.delete(t),i.delete(e),h}(t,e,r,n,o,i))}function se(t,e,r,n,o){return t===e||(null==t||null==e||!lt(t)&&!lt(e)?t!=t&&e!=e:ce(t,e,r,n,se,o))}var ue=function(t){var e={exports:{}};return t(e,e.exports),e.exports}((function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}function o(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function i(t,e,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var c=new o(n,i||t,a),s=r?r+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],c]:t._events[s].push(c):(t._events[s]=c,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function c(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),c.prototype.eventNames=function(){var t,n,o=[];if(0===this._eventsCount)return o;for(n in t=this._events)e.call(t,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},c.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,a=new Array(i);o<i;o++)a[o]=n[o].fn;return a},c.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},c.prototype.emit=function(t,e,n,o,i,a){var c=r?r+t:t;if(!this._events[c])return!1;var s,u,p=this._events[c],l=arguments.length;if(p.fn){switch(p.once&&this.removeListener(t,p.fn,void 0,!0),l){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,e),!0;case 3:return p.fn.call(p.context,e,n),!0;case 4:return p.fn.call(p.context,e,n,o),!0;case 5:return p.fn.call(p.context,e,n,o,i),!0;case 6:return p.fn.call(p.context,e,n,o,i,a),!0}for(u=1,s=new Array(l-1);u<l;u++)s[u-1]=arguments[u];p.fn.apply(p.context,s)}else{var f,h=p.length;for(u=0;u<h;u++)switch(p[u].once&&this.removeListener(t,p[u].fn,void 0,!0),l){case 1:p[u].fn.call(p[u].context);break;case 2:p[u].fn.call(p[u].context,e);break;case 3:p[u].fn.call(p[u].context,e,n);break;case 4:p[u].fn.call(p[u].context,e,n,o);break;default:if(!s)for(f=1,s=new Array(l-1);f<l;f++)s[f-1]=arguments[f];p[u].fn.apply(p[u].context,s)}}return!0},c.prototype.on=function(t,e,r){return i(this,t,e,r,!1)},c.prototype.once=function(t,e,r){return i(this,t,e,r,!0)},c.prototype.removeListener=function(t,e,n,o){var i=r?r+t:t;if(!this._events[i])return this;if(!e)return a(this,i),this;var c=this._events[i];if(c.fn)c.fn!==e||o&&!c.once||n&&c.context!==n||a(this,i);else{for(var s=0,u=[],p=c.length;s<p;s++)(c[s].fn!==e||o&&!c[s].once||n&&c[s].context!==n)&&u.push(c[s]);u.length?this._events[i]=1===u.length?u[0]:u:a(this,i)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&a(this,e)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t.exports=c})),pe=function(t,e){return(pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function le(t,e){function r(){this.constructor=t}pe(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var fe=function(){return(fe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function he(t,e,r,n){var o,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function ve(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function de(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function ye(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(de(arguments[e]));return t}var me,ge=function(){function t(t){var e=t.game,r=t.rendererSystem;this.renderers=[],this.game=e,this.rendererSystem=r}return t.prototype.register=function(){for(var t,e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];try{for(var o=ve(r),i=o.next();!i.done;i=o.next()){var a=i.value;a.game=this.game,a.rendererManager=this.rendererSystem.rendererManager,a.containerManager=this.rendererSystem.containerManager,this.renderers.push(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}},t.prototype.componentChanged=function(t){var r,n,o=function(t){var r,n;try{for(var o=(r=void 0,ve(i.renderers)),a=o.next();!a.done;a=o.next()){var c=a.value,s=c.observerInfo[t.componentName];if(s){if([e.OBSERVER_TYPE.ADD,e.OBSERVER_TYPE.REMOVE].indexOf(t.type)>-1){try{c.componentChanged&&c.componentChanged(t)}catch(e){console.error("gameObject: "+t.gameObject.name+", "+t.componentName+" is error.",t,e)}continue}if(s.findIndex((function(e){return r=e,n=t.prop,se(r,n);var r,n}))>-1)try{c.componentChanged&&c.componentChanged(t)}catch(e){console.error("gameObject: "+(t.gameObject&&t.gameObject.name)+", "+t.componentName+" is componentChanged error.",t,e)}}}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},i=this;try{for(var a=ve(t),c=a.next();!c.done;c=a.next()){o(c.value)}}catch(t){r={error:t}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}},t.prototype.update=function(t){var e,r,n,o;try{for(var i=ve(t.components),a=i.next();!a.done;a=i.next()){var c=a.value;try{for(var s=(n=void 0,ve(this.renderers)),u=s.next();!u.done;u=s.next()){var p=u.value,l=[];if(p.observerInfo[c.name]&&-1===l.indexOf(t)){l.push(t);try{p.rendererUpdate&&p.rendererUpdate(t)}catch(e){console.info("gameObject: "+t.name+", "+c.name+" is update error",e)}}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}},t}(),be=function(){function t(){this.containerMap={}}return t.prototype.addContainer=function(t){var e=t.name,r=t.container;this.containerMap[e]=r},t.prototype.getContainer=function(t){return this.containerMap[t]},t.prototype.removeContainer=function(t){var e;null===(e=this.containerMap[t])||void 0===e||e.destroy({children:!0}),delete this.containerMap[t]},t.prototype.updateTransform=function(t){var e=t.name,r=t.transform,n=this.containerMap[e];if(n){var o=r.anchor,i=r.origin,a=r.position,c=r.rotation,s=r.scale,u=r.size,p=r.skew;n.rotation=c,n.scale=s,n.pivot.x=u.width*i.x,n.pivot.y=u.height*i.y,n.skew=p;var l=a.x,f=a.y;if(r.parent){var h=r.parent;l+=h.size.width*o.x,f+=h.size.height*o.y}n.position={x:l,y:f}}},t}(),_e=function(t){function r(e){var r=e.system,n=e.containerManager,o=t.call(this)||this;return o.name="Transform",o.waitRemoveIds=[],o.waitChangeScenes=[],o.containerManager=n,o.init(r),o}return le(r,t),r.prototype.init=function(t){var e=this;this.system=t,this.on("changeScene",(function(t){var r=t.scene,n=t.mode,o=t.application;e.waitChangeScenes.push({scene:r,mode:n,application:o})}))},r.prototype.update=function(){var t,e,r,n;try{for(var o=ve(this.waitRemoveIds),i=o.next();!i.done;i=o.next()){var a=i.value;this.containerManager.removeContainer(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}this.waitRemoveIds=[];try{for(var c=ve(this.waitChangeScenes),s=c.next();!s.done;s=c.next()){var u=s.value,p=this.containerManager.getContainer(u.scene.id);p&&(u.application.stage.removeChildren(),u.application.stage.addChild(p))}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}this.waitChangeScenes=[]},r.prototype.componentChanged=function(t){t.type===e.OBSERVER_TYPE.ADD?this.addContainer(t):t.type===e.OBSERVER_TYPE.CHANGE?this.change(t):t.type===e.OBSERVER_TYPE.REMOVE&&this.waitRemoveIds.push(t.gameObject.id)},r.prototype.addContainer=function(t){var e=new h;e.name=t.gameObject.name,this.containerManager.addContainer({name:t.gameObject.id,container:e}),t.component.worldTransform=e.transform.worldTransform},r.prototype.change=function(t){var e=t.component;if(e.parent){this.containerManager.getContainer(e.parent.gameObject.id).addChild(this.containerManager.getContainer(t.gameObject.id));var r=t.gameObject.transform.parent&&t.gameObject.transform.parent.gameObject.getComponent("Render");r&&(r.sortDirty=!0)}else{var n=this.containerManager.getContainer(t.gameObject.id);delete e.worldTransform,n.parent&&n.parent.removeChild(n)}},r.prototype.destroy=function(){this.removeAllListeners(),this.waitRemoveIds=null,this.waitChangeScenes=null,this.system=null,this.containerManager=null},r=he([e.decorators.componentObserver({Transform:["_parent"]})],r)}(ue);!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(me||(me={}));var we=function(t){t.plugins.interaction.autoPreventDefault=!0,t.view.style.touchAction="none"},je=function(t){t.plugins.interaction.autoPreventDefault=!1,t.view.style.touchAction="auto"},Oe=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.multiApps=[],e}return le(n,t),n.prototype.init=function(t){var r=this;this.params=t,this.application=this.createApplication(t),this.containerManager=new be,this.rendererManager=new ge({game:this.game,rendererSystem:this}),this.game.canvas=this.application.view,this.transform=new _e({system:this,containerManager:this.containerManager}),this.game.on("sceneChanged",(function(t){var n,o=t.scene,i=t.mode,a=t.params;switch(i){case e.LOAD_SCENE_MODE.SINGLE:n=r.application;break;case e.LOAD_SCENE_MODE.MULTI_CANVAS:n=r.createMultiApplication({params:a})}o.canvas=n.view,r.transform.emit("changeScene",{scene:o,mode:i,application:n})}))},n.prototype.registerObserver=function(t){var e,r=this.constructor.observerInfo;for(var n in t)r[n]||(r[n]=[]),(e=r[n]).push.apply(e,ye(t[n]))},n.prototype.createMultiApplication=function(t){var e=t.params,r=this.createApplication(e);return this.multiApps.push(r),r},n.prototype.createApplication=function(t){t.view=t.canvas,t.renderType===me.CANVAS&&(t.forceCanvas=!0),r.ticker.shared.autoStart=!1,r.ticker.shared.stop();var e=new f(fe({sharedTicker:!0},t));return void 0!==t.preventScroll&&(console.warn("PreventScroll property will deprecate at next major version, please use enableEnable instead. https://eva.js.org/#/tutorials/game"),t.preventScroll?je(e.renderer):we(e.renderer)),void 0!==t.enableScroll&&(t.enableScroll?je(e.renderer):we(e.renderer)),void 0===t.preventScroll&&void 0===t.enableScroll&&je(e.renderer),e},n.prototype.update=function(){var t,e,r,n,o=this.componentObserver.clear();try{for(var i=ve(o),a=i.next();!a.done;a=i.next()){var c=a.value;this.transform.componentChanged(c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}try{for(var s=ve(this.game.gameObjects),u=s.next();!u.done;u=s.next()){var p=u.value;this.containerManager.updateTransform({name:p.id,transform:p.transform}),this.rendererManager.update(p)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}},n.prototype.lateUpdate=function(t){this.transform.update(),this.application.ticker.update(t.time)},n.prototype.onDestroy=function(){var t,e;this.application.destroy();try{for(var r=ve(this.multiApps),n=r.next();!n.done;n=r.next()){var o=n.value;o&&o.destroy()}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}this.transform.destroy(),this.transform=null,this.params=null,this.rendererManager=null,this.containerManager=null,this.application=null,this.game=null,this.multiApps=null},n.prototype.resize=function(t,e){this.params.width=t,this.params.height=e,this.application.renderer.resize(t,e)},n.systemName="Renderer",n=he([e.decorators.componentObserver({Transform:["_parent"]})],n)}(e.System);!function(t){function e(e){var r=t.call(this,e)||this;return r.observerInfo=r.constructor.observerInfo,r}le(e,t),e.prototype.componentChanged=function(t){},e.prototype.rendererUpdate=function(t){},e.prototype.update=function(){var t,e,r=this.componentObserver.clear();try{for(var n=ve(r),o=n.next();!o.done;o=n.next()){var i=o.value;this.componentChanged(i)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}}}(e.System);var Ee,xe,Ae,Se,Ce=function(t,e){var r=e.width,n=e.height,o=e.position,i=e.left,a=void 0===i?0:i,c=e.top,s=void 0===c?0:c,u=e.zIndex,p=e.pointerEvents,l=e.background;t.style.width=r+"px",t.style.height=n+"px",t.style.position=o,t.style.left=""+a,t.style.top=""+s,t.style.zIndex=""+u,t.style.pointerEvents=p,t.style.background=l,t.style.border="none",t.style.overflow="hidden"},Pe=function(t){function r(e){var r=t.call(this)||this;Object.assign(r,e);var n=e.hint,o=void 0===n?"":n,i=e.event,a=e.delay,c=void 0===a?0:a,s=e.attr,u=void 0===s?{}:s,p=e.role,l=void 0===p?"":p,f=e.props,h=void 0===f?{}:f,v=e.state,d=void 0===v?{}:v;return r.hint=o,r.event=i,r.delay=c,r.attr=u,r.role=l,r.props=h,r.state=d,r.a11yId="_"+function(t){for(var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=[],n=e.length,o=0;o<t;o++)r[o]=e[0|Math.random()*n];return r.join("")}(6),r}return o(r,t),r.componentName="A11y",a([e.decorators.IDEProp],r.prototype,"interactive",void 0),a([e.decorators.IDEProp],r.prototype,"hint",void 0),a([e.decorators.IDEProp],r.prototype,"event",void 0),a([e.decorators.IDEProp],r.prototype,"delay",void 0),a([e.decorators.IDEProp],r.prototype,"role",void 0),a([e.decorators.IDEProp],r.prototype,"props",void 0),a([e.decorators.IDEProp],r.prototype,"state",void 0),a([e.decorators.IDEProp],r.prototype,"attr",void 0),a([e.decorators.IDEProp],r.prototype,"a11yId",void 0),r}(e.Component),Te="absolute";t.A11yActivate=void 0,(Ee=t.A11yActivate||(t.A11yActivate={}))[Ee.ENABLE=0]="ENABLE",Ee[Ee.DISABLE=1]="DISABLE",Ee[Ee.CHECK=2]="CHECK",function(t){t.NONE="none",t.AUTO="auto"}(xe||(xe={})),function(t){t.DEBUG="rgba(255,0,0,0.5)",t.NONE="transparent"}(Ae||(Ae={})),function(t){t.BUTTON="button",t.DIV="div"}(Se||(Se={}));var Ie=["hint","event","delay","attr","role","props","state","a11yId","name"],Me=function(t,e,r){var n=this;["touchstart","touchend","tap"].forEach((function(o){t.emit(o,{stopPropagation:function(){return r.stopPropagation()},data:{position:n.eventPosition},gameObject:e})}))},Re=function(r){function n(t){var e=r.call(this,t)||this;return e.cache=new Map,e.eventCache=new Map,e}return o(n,r),Object.defineProperty(n.prototype,"ratioX",{get:function(){return this._ratioX||this.setRatio()?this._ratioX:0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ratioY",{get:function(){return this._ratioY||this.setRatio()?this._ratioY:0},enumerable:!1,configurable:!0}),n.prototype.init=function(e){return void 0===e&&(e={}),c(this,void 0,void 0,(function(){var r,n,o,i,a,c,u,p;return s(this,(function(s){switch(s.label){case 0:switch(r=e.activate,n=void 0===r?t.A11yActivate.CHECK:r,o=e.delay,i=void 0===o?100:o,a=e.checkA11yOpen,c=void 0===a?function(){return Promise.resolve(!1)}:a,this.delay=i,n){case t.A11yActivate.CHECK:return[3,1];case t.A11yActivate.DISABLE:return[3,5];case t.A11yActivate.ENABLE:return[3,6]}return[3,7];case 1:return s.trys.push([1,3,,4]),u=this,[4,c()];case 2:return u.activate=s.sent(),[3,4];case 3:return s.sent(),this.activate=!1,[3,4];case 4:return[3,7];case 5:return this.activate=!1,[3,7];case 6:return this.activate=!0,[3,7];case 7:return this.debug=e.debug||!1,this.debug&&(this.activate=!0),this.activate?(p=document.createElement("div"),this.div=p,this.game.canvas.parentNode&&this.game.canvas.parentNode.appendChild(this.div),[2]):[2]}}))}))},n.prototype.setRatio=function(){var t=this.getCanvasBoundingClientRect(),e=t.width,r=t.height,n=this.getRenderRect(),o=n.renderWidth,i=n.renderHeight;return this._ratioX=e/o,this._ratioY=r/i,!(!e&&!r)&&(this.initDiv(),!0)},n.prototype.getRenderRect=function(){var t=(this.game.getSystem(Oe)||{width:300,height:300}).params,e=t.height;return{renderWidth:t.width,renderHeight:e}},n.prototype.getCanvasBoundingClientRect=function(){var t=this.game.canvas.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}},n.prototype.initDiv=function(){var t=this,e=window.pageXOffset,r=window.pageYOffset,n=this.getCanvasBoundingClientRect(),o={width:n.width,height:n.height,left:n.left+e+"px",top:n.top+r+"px",position:Te,zIndex:3,pointerEvents:xe.NONE,background:Ae.NONE};Ce(this.div,o),this.div.addEventListener("click",(function(e){var r=e.currentTarget.getBoundingClientRect(),n=r.left,o=r.top,i=(e.pageX-n)/t.ratioX,a=(e.pageY-o)/t.ratioY;t.eventPosition={x:i,y:a}}),!0)},n.prototype.update=function(){return c(this,void 0,void 0,(function(){var t,r,n,o,i,a;return s(this,(function(c){if(t=this.componentObserver.clear(),!this.activate)return[2];try{for(r=u(t),n=r.next();!n.done;n=r.next())switch((o=n.value).type){case e.OBSERVER_TYPE.ADD:"Event"===o.componentName&&this.addEvent(o.gameObject),"A11y"===o.componentName&&this.add(o);break;case e.OBSERVER_TYPE.CHANGE:"Transform"===o.componentName&&this.transformChange(o);break;case e.OBSERVER_TYPE.REMOVE:"Event"===o.componentName&&this.removeEvent(o),"A11y"===o.componentName&&this.remove(o)}}catch(t){i={error:t}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(i)throw i.error}}return[2]}))}))},n.prototype.remove=function(t){var e=t.component;if(e){var r=e.a11yId,n=this.div.querySelector("#"+r);n&&this.div.removeChild(n),this.cache.delete(r)}},n.prototype.add=function(t){var e=this;if(this.activate){var r=t.component,n=t.gameObject,o=r.delay,i=r.a11yId,a=r.event;if(n){var c=n.transform;if(c){var s=document.createElement("div");this.cache.set(i,s),a||(a=n.getComponent("Event")),setTimeout((function(){e.setPosition(s,c),e.setA11yAttr(s,r),a&&e.addEvent(n),n.scene&&e.div.appendChild(s)}),o||this.delay)}}}},n.prototype.transformChange=function(t){var e=t.component,r=t.gameObject.getComponent(Pe);if(r){var n=r.a11yId;if(e.inScene){if(this.cache.has(n)){var o=this.cache.get(n);o&&this.div.appendChild(o)}}else{var i=this.div.querySelector("#"+n);i&&this.div.removeChild(i)}}},n.prototype.setEvent=function(t,e,r,n){if(e){var o=Me.bind(this,e,r);this.eventCache.set(n,o),t.addEventListener("click",o)}},n.prototype.addEvent=function(t){var e=t.getComponent(Pe);if(e){var r=t.getComponent("Event");if(r){var n=this.cache.get(e.a11yId);n&&this.setEvent(n,r,t,e.a11yId)}}},n.prototype.removeEvent=function(t){var e=t.gameObject.getComponent(Pe);if(e&&t.component){var r=e.a11yId,n=this.eventCache.get(r),o=this.cache.get(r);o&&o.removeEventListener("click",n)}},n.prototype.setA11yAttr=function(t,e){var r,n,o,i,a,c,s=e.hint,p=e.props,l=void 0===p?{}:p,f=e.state,h=void 0===f?{}:f,v=e.role,d=e.a11yId,y=v||"text";t.setAttribute("role",y),t.setAttribute("aria-label",s),t.id=d;var m=Object.keys(l);try{for(var g=u(m),b=g.next();!b.done;b=g.next()){var _=b.value;t.setAttribute(_,l[_])}}catch(t){r={error:t}}finally{try{b&&!b.done&&(n=g.return)&&n.call(g)}finally{if(r)throw r.error}}var w=Object.keys(h);try{for(var j=u(w),O=j.next();!O.done;O=j.next()){_=O.value;t.setAttribute(_,h[_])}}catch(t){o={error:t}}finally{try{O&&!O.done&&(i=j.return)&&i.call(j)}finally{if(o)throw o.error}}try{for(var E=u(Object.keys(e)),x=E.next();!x.done;x=E.next()){"string"==typeof e[_=x.value]&&-1===Ie.indexOf(_)&&1!==_.indexOf("_")&&t.setAttribute(_,e[_])}}catch(t){a={error:t}}finally{try{x&&!x.done&&(c=E.return)&&c.call(E)}finally{if(a)throw a.error}}},n.prototype.setPosition=function(t,e){var r=e.size,n=r.width,o=r.height,a={width:0===n?1:n*this.ratioX,height:0===o?1:o*this.ratioY,position:Te,zIndex:3,pointerEvents:xe.AUTO,background:this.debug?Ae.DEBUG:Ae.NONE},c=i({},e);Ce(t,a),function(t,e,r,n){var o=e.worldTransform,i="matrix("+o.a+", "+o.b+", "+o.c+", "+o.d+", "+o.tx*r+", "+o.ty*n+")";t.style.transform=""+i,t.style.webkitTransform=""+i,t.style.transformOrigin="left top",t.style.webkitTransformOrigin="left top"}(t,c,this.ratioX,this.ratioY)},n.prototype.onDestroy=function(){this.div.parentElement.removeChild(this.div),this.cache=null,this.eventCache=null},n.systemName="A11ySystem",n=a([e.decorators.componentObserver({A11y:[],Transform:["inScene"],Event:[]})],n)}(e.System);t.A11y=Pe,t.A11ySystem=Re,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ function _extends(){return(_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{};var _EVA_IIFE_a11y=function(t,e,n){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function a(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function s(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))}function c(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(t,e){return t.constructor.IDEProps||(t.constructor.IDEProps={}),t.constructor.IDEProps[e]||(t.constructor.IDEProps[e]={}),t.constructor.IDEProps[e]}function p(t){return function(e,n){var r=h(e,n);r.key=n,r.type=t}}function l(t){return function(e,n){h(e,n).step=t}}var d,v,f,y,g=function(t,e){var n=e.width,r=e.height,o=e.position,i=e.left,a=void 0===i?0:i,s=e.top,c=void 0===s?0:s,u=e.zIndex,h=e.pointerEvents,p=e.background;t.style.width=n+"px",t.style.height=r+"px",t.style.position=o,t.style.left=""+a,t.style.top=""+c,t.style.zIndex=""+u,t.style.pointerEvents=h,t.style.background=p,t.style.border="none",t.style.overflow="hidden"},m=function(t){function e(e){var n=t.call(this)||this;_extends(n,e);var r=e.hint,o=void 0===r?"":r,i=e.event,a=e.delay,s=void 0===a?0:a,c=e.attr,u=void 0===c?{}:c,h=e.role,p=void 0===h?"":h,l=e.props,d=void 0===l?{}:l,v=e.state,f=void 0===v?{}:v;return n.hint=o,n.event=i,n.delay=s,n.attr=u,n.role=p,n.props=d,n.state=f,n.a11yId="_"+function(t){for(var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],r=e.length,o=0;o<t;o++)n[o]=e[0|Math.random()*r];return n.join("")}(6),n}return o(e,t),e.componentName="A11y",a([p("boolean")],e.prototype,"interactive",void 0),a([p("string")],e.prototype,"hint",void 0),a([p("number"),l(1)],e.prototype,"delay",void 0),a([p("string")],e.prototype,"role",void 0),a([p("string")],e.prototype,"a11yId",void 0),e}(e.Component),b="absolute";t.A11yActivate=void 0,(d=t.A11yActivate||(t.A11yActivate={}))[d.ENABLE=0]="ENABLE",d[d.DISABLE=1]="DISABLE",d[d.CHECK=2]="CHECK",function(t){t.NONE="none",t.AUTO="auto"}(v||(v={})),function(t){t.DEBUG="rgba(255,0,0,0.5)",t.NONE="transparent"}(f||(f={})),function(t){t.BUTTON="button",t.DIV="div"}(y||(y={}));var E=["hint","event","delay","attr","role","props","state","a11yId","name"],w=function(t,e,n){var r=this;["touchstart","touchend","tap"].forEach((function(o){t.emit(o,{stopPropagation:function(){return n.stopPropagation()},data:{position:r.eventPosition},gameObject:e})}))},A=function(r){function h(t){var e=r.call(this,t)||this;return e.cache=new Map,e.eventCache=new Map,e.zIndex=3,e}return o(h,r),Object.defineProperty(h.prototype,"ratioX",{get:function(){return this._ratioX||this.setRatio()?this._ratioX:0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"ratioY",{get:function(){return this._ratioY||this.setRatio()?this._ratioY:0},enumerable:!1,configurable:!0}),h.prototype.init=function(e){return void 0===e&&(e={}),s(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,h,p;return c(this,(function(c){switch(c.label){case 0:switch(n=e.activate,r=void 0===n?t.A11yActivate.CHECK:n,o=e.delay,i=void 0===o?100:o,a=e.checkA11yOpen,s=void 0===a?function(){return Promise.resolve(!1)}:a,u=e.zIndex,this.delay=i,this.zIndex=u||this.zIndex,r){case t.A11yActivate.CHECK:return[3,1];case t.A11yActivate.DISABLE:return[3,5];case t.A11yActivate.ENABLE:return[3,6]}return[3,7];case 1:return c.trys.push([1,3,,4]),h=this,[4,s()];case 2:return h.activate=c.sent(),[3,4];case 3:return c.sent(),this.activate=!1,[3,4];case 4:return[3,7];case 5:return this.activate=!1,[3,7];case 6:return this.activate=!0,[3,7];case 7:return this.debug=e.debug||!1,this.debug&&(this.activate=!0),this.activate?(p=document.createElement("div"),this.div=p,this.game.canvas.parentNode&&this.game.canvas.parentNode.insertBefore(this.div,this.game.canvas),[2]):[2]}}))}))},h.prototype.setRatio=function(){var t=this.getCanvasBoundingClientRect(),e=t.width,n=t.height,r=this.getRenderRect(),o=r.renderWidth,i=r.renderHeight;return this._ratioX=e/o,this._ratioY=n/i,!(!e&&!n)&&(this.initDiv(),!0)},h.prototype.getRenderRect=function(){var t=this.game.getSystem(n.RendererSystem).params,e=void 0===t?{width:300,height:300}:t,r=e.height;return{renderWidth:e.width,renderHeight:r}},h.prototype.getCanvasBoundingClientRect=function(){var t=this.game.canvas.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}},h.prototype.initDiv=function(){var t=this,e=window.pageXOffset,n=window.pageYOffset,r=this.getCanvasBoundingClientRect(),o={width:r.width,height:r.height,left:r.left+e+"px",top:r.top+n+"px",position:b,zIndex:this.zIndex,pointerEvents:v.NONE,background:f.NONE};g(this.div,o),this.div.addEventListener("click",(function(e){var n=e.currentTarget.getBoundingClientRect(),r=n.left,o=n.top,i=(e.pageX-r)/t.ratioX,a=(e.pageY-o)/t.ratioY;t.eventPosition={x:i,y:a}}),!0)},h.prototype.update=function(){return s(this,void 0,void 0,(function(){var t,n,r,o,i,a;return c(this,(function(s){if(t=this.componentObserver.clear(),!this.activate)return[2];try{for(n=u(t),r=n.next();!r.done;r=n.next())switch((o=r.value).type){case e.OBSERVER_TYPE.ADD:"Event"===o.componentName&&this.addEvent(o.gameObject),"A11y"===o.componentName&&this.add(o);break;case e.OBSERVER_TYPE.CHANGE:"Transform"===o.componentName&&this.transformChange(o),"A11y"===o.componentName&&this.change(o);break;case e.OBSERVER_TYPE.REMOVE:"Event"===o.componentName&&this.removeEvent(o),"A11y"===o.componentName&&this.remove(o)}}catch(t){i={error:t}}finally{try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(i)throw i.error}}return[2]}))}))},h.prototype.change=function(t){var e=t.component;if("hint"===t.prop.prop[0]){var n=this.cache.get(e.a11yId);null==n||n.setAttribute("aria-label",e.hint),n&&this.setPosition(n,t.gameObject.transform)}},h.prototype.remove=function(t){var e=t.component;if(e){var n=e.a11yId,r=this.div.querySelector("#"+n);r&&this.div.removeChild(r),this.cache.delete(n)}},h.prototype.add=function(t){var e=this;if(this.activate){var n=t.component,r=t.gameObject,o=n.delay,i=n.a11yId,a=n.event;if(r){var s=r.transform;if(s){var c=document.createElement("div");this.cache.set(i,c),a||(a=r.getComponent("Event")),setTimeout((function(){e.setPosition(c,s),e.setA11yAttr(c,n),a&&e.addEvent(r),r.scene&&e.div.appendChild(c)}),o||this.delay)}}}},h.prototype.transformChange=function(t){var e=t.component,n=t.gameObject.getComponent(m);if(n){var r=n.a11yId;if(e.inScene){if(this.cache.has(r)){var o=this.cache.get(r);o&&this.div.appendChild(o)}}else{var i=this.div.querySelector("#"+r);i&&this.div.removeChild(i)}}},h.prototype.setEvent=function(t,e,n,r){if(e){var o=w.bind(this,e,n);this.eventCache.set(r,o),t.addEventListener("click",o)}},h.prototype.addEvent=function(t){var e=t.getComponent(m);if(e){var n=t.getComponent("Event");if(n){var r=this.cache.get(e.a11yId);r&&this.setEvent(r,n,t,e.a11yId)}}},h.prototype.removeEvent=function(t){var e=t.gameObject.getComponent(m);if(e&&t.component){var n=e.a11yId,r=this.eventCache.get(n),o=this.cache.get(n);o&&o.removeEventListener("click",r)}},h.prototype.setA11yAttr=function(t,e){var n,r,o,i,a,s,c=e.hint,h=e.props,p=void 0===h?{}:h,l=e.state,d=void 0===l?{}:l,v=e.role,f=e.a11yId,y=v||"text";t.setAttribute("role",y),t.setAttribute("aria-label",c),t.id=f;var g=Object.keys(p);try{for(var m=u(g),b=m.next();!b.done;b=m.next()){var w=b.value;t.setAttribute(w,p[w])}}catch(t){n={error:t}}finally{try{b&&!b.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}var A=Object.keys(d);try{for(var O=u(A),x=O.next();!x.done;x=O.next()){w=x.value;t.setAttribute(w,d[w])}}catch(t){o={error:t}}finally{try{x&&!x.done&&(i=O.return)&&i.call(O)}finally{if(o)throw o.error}}try{for(var C=u(Object.keys(e)),I=C.next();!I.done;I=C.next()){"string"==typeof e[w=I.value]&&-1===E.indexOf(w)&&1!==w.indexOf("_")&&t.setAttribute(w,e[w])}}catch(t){a={error:t}}finally{try{I&&!I.done&&(s=C.return)&&s.call(C)}finally{if(a)throw a.error}}},h.prototype.setPosition=function(t,e){var n=e.size,r=n.width,o=n.height,a={width:0===r?1:r*this.ratioX,height:0===o?1:o*this.ratioY,position:b,zIndex:this.zIndex,pointerEvents:v.AUTO,background:this.debug?f.DEBUG:f.NONE},s=i({},e);g(t,a),function(t,e,n,r){var o=e.worldTransform,i="matrix("+o.a+", "+o.b+", "+o.c+", "+o.d+", "+o.tx*n+", "+o.ty*r+")";t.style.transform=""+i,t.style.webkitTransform=""+i,t.style.transformOrigin="left top",t.style.webkitTransformOrigin="left top"}(t,s,this.ratioX,this.ratioY)},h.prototype.onDestroy=function(){this.div.parentElement.removeChild(this.div),this.cache=null,this.eventCache=null,this.div=null},h.systemName="A11ySystem",h=a([e.decorators.componentObserver({A11y:["hint"],Transform:["inScene"],Event:[]})],h)}(e.System);return t.A11y=m,t.A11ySystem=A,Object.defineProperty(t,"__esModule",{value:!0}),t}({},EVA,EVA.plugin.renderer);window.EVA.plugin.a11y=window.EVA.plugin.a11y||_EVA_IIFE_a11y;