/** * 360 Product Viewer by www.YoFLA.com (c) Matus Laco * * License type: YFL_CLOUD_VERSION_A * License owner: not provided * Account Id: Hdxr53H9E * Player version: 47 */ !function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=12)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CLASSNAME_PLAYER="yofla360__player",e.CLASSNAME_IMAGES="yofla360__images",e.CLASSNAME_PRELOADER="y360-preloader",e.CLASSNAME_PRELOADER_BAR="y360-preloader__bar",e.CLASSNAME_PRELOADER_TEXT="y360-preloader-percent__text",e.CLASSNAME_CONTROLS="yofla360__controls",e.CLASSNAME_START_BUTTON="yofla360__start-button",e.CLASSNAME_START_IMAGE="yofla360__start-image",e.CLASSNAME_BUTTON_PLAY="yofla360__button--play",e.CLASSNAME_BUTTON_LEFT="yofla360__button--left",e.CLASSNAME_BUTTON_RIGHT="yofla360__button--right",e.CLASSNAME_BUTTON_FULLSCREEN="yofla360__button--fullscreen",e.LOADING_COMPLETE="LOADING_COMPLETE",e.LOADING_PROGRESS="LOADING_PROGRESS",e.LOADING_START="LOADING_START",e.PRELOADER_LOADING_COMPLETE="PRELOADER_LOADING_COMPLETE",e.IMAGE_RESIZED="IMAGE_RESIZED",e.INTERACTION_PAN_DELTAS="INTERACTION_PAN_DELTAS",e.INTERACTION_STARTS="INTERACTION_STARTS",e.INTERACTION_SINGLE_TAP="INTERACTION_SINGLE_END",e.INTERACTION_DOUBLE_TAP="INTERACTION_DOUBLE_END",e.INTERACTION_SWIPE_END="INTERACTION_SWIPE_END",e.POINTER_ON_RELEASE="POINTER_ON_RELEASE",e.BUILD_ID=46,e.LINK_HOME="https://www.yofla.com/3d-rotate/creator/?utm_medium=player",e.LINK_FREE="https://www.yofla.com/3d-rotate/player-about?utm_medium=player&utm_content=banner&utm_label=bid_"+e.BUILD_ID},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(0);e.loadScript=(t=>new Promise((e,r)=>{const i=document.createElement("script");i.onload=(()=>{e()}),i.onerror=(e=>{r("Error loading config file, path: "+t)}),i.src=t,document.body.appendChild(i)})),e.addTrailingSlash=((t="")=>{if(t&&t.length>0){const e=t.substr(t.length-1);"/"==e||"\\"==e||(t+="/")}else t="";return t}),e.parseImages=((t,e)=>t.map(t=>(t.src=t.src,t.baseUrl||(t.baseUrl=e||""),t))),e.isSettingsDataAvailable=(t=>!!window[t]),e.isInViewport=(t=>{var e=t.getBoundingClientRect();return e.bottom>0&&e.top<(window.innerHeight||document.documentElement.clientHeight)&&e.right>0&&e.left<(window.innerWidth||document.documentElement.clientWidth)}),e.addTabInactivityObserver=(t=>{let e="hidden";const r=r=>{let i,n="visible",s="hidden",o={focus:n,focusin:n,pageshow:n,blur:s,focusout:s,pagehide:s};i=(r=r||window.event).type in o?"visible"==r.type:0==document[e],t(i)};return e in document?{name:"visibilitychange",listener:r,target:document}:(e="mozHidden")in document?{name:"mozvisibilitychange",listener:r,target:document}:(e="webkitHidden")in document?{name:"webkitvisibilitychange",listener:r,target:document}:(e="msHidden")in document?{name:"msvisibilitychange",listener:r,target:document}:(window.onpageshow=window.onpagehide=window.onfocus=window.onblur=r,null)}),e.debounce=((t,e=100)=>{let r;return function(...i){clearTimeout(r),r=setTimeout(()=>{t.apply(this,i)},e)}}),e.addEvent=((t,e,r)=>{if(!e)return;let n=[],s="";window.PointerEvent&&!window.TouchEvent?(n=["pointerdown","pointermove","pointerup"],t==i.POINTER_ON_RELEASE&&(s="pointerup")):(n=["mousedown","mousemove","mouseup","touchstart","touchmove","touchend"],t==i.POINTER_ON_RELEASE&&(s="mouseup"));n.map(t=>{s.indexOf(t)>=0&&e.addEventListener(t,t=>{r()},!0)})}),e.createDivElement=(t=>{const e=document.createElement("div");return t&&(e.className=t),e}),e.getRandomInstanceDomId=(t=>t+"-"+Math.round(1e4*Math.random())),e.isFullscreen=(()=>!(!document.fullscreenElement&&!document.webkitFullscreenElement)),e.launchFullscreen=(t=>{t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()}),e.exitFullscreen=(t=>{document.exitFullscreen?document.exitFullscreen():document.cancelFullscreen?document.cancelFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}),e.getBaseName=(t=>t.split(/[\\/]/).pop()),e.isFullscreenModeSupported=(()=>{let t;const e=document.documentElement,r=!(!e.requestFullscreen&&!e.webkitRequestFullScreen),i=!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled);return t=!(!r&&!i)}),e.addAndRegisterEventListener=((t,e)=>{t.push(e),e.target.addEventListener(e.name,e.listener)}),e.removeEventListeners=(t=>{t.forEach(t=>{t.target.removeEventListener(t.name,t.listener),t.listener=void 0,delete t.listener,t.target=void 0,delete t.target}),t=[]}),e.isMobileDevice=(()=>{let t=!1;return function(e){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0)}(navigator.userAgent||navigator.vendor||window.opera),t})},function(t,e,r){var i,n;!function(s,o){"use strict";void 0===(n="function"==typeof(i=function(){var t=function(){},e="undefined",r=["trace","debug","info","warn","error"];function i(t,e){var r=t[e];if("function"==typeof r.bind)return r.bind(t);try{return Function.prototype.bind.call(r,t)}catch(e){return function(){return Function.prototype.apply.apply(r,[t,arguments])}}}function n(e,i){for(var n=0;n=0&&i<=h.levels.SILENT))throw"log.setLevel() called with invalid level: "+i;if(a=i,!1!==s&&function(t){var i=(r[t]||"silent").toUpperCase();if(typeof window===e)return;try{return void(window.localStorage[u]=i)}catch(t){}try{window.document.cookie=encodeURIComponent(u)+"="+i+";"}catch(t){}}(i),n.call(h,i,t),typeof console===e&&i{t=t||n.getRandomInstanceDomId(this.PREFIX);const a=this.getPlayer(t);if(a)return s(a);try{const n=t,a=e?JSON.parse(e):null;if(r)return this.initInstanceById(n,a);{const t=new i.default(n,e);return this.instances[n]=t,s(t)}}catch(t){return this.reportUserError(t),o(t)}})}destroyPlayer(t){if(!t)throw"No Player ID provided!";let e=this.getPlayer(t);e&&(e.destroy(),e=void 0,this.instances[t]=void 0,delete this.instances[t])}addOnPageLoadedListener(){window.addEventListener("load",()=>{this.onPageLoaded()},!1)}onPageLoaded(){}init360views(){(this.getDomTargetIds(this.DATA_ATTRIBUTE)||[]).forEach(t=>{this.initInstanceById(t,null,!0)})}getDomTargetIds(t){const e=document.querySelectorAll(`[${t}]`),r=[];return e&&e.length&&e.forEach(t=>{const e=t.getAttribute("id");if(e)r.push(e);else{const e=n.getRandomInstanceDomId(this.PREFIX);t.setAttribute("id",e),r.push(e)}}),r}initInstanceById(t,e,r=!1){const n=this.getConfigData(t,e);if(o.info("Initializing player # "+t+" with this custom data: "+JSON.stringify(n,null,4)),!n)return Promise.reject("config data is empty, domTargetId: "+t);if(this.instances[t]);else{if(r&&n.disableAutoInit){const e=n&&n.id||t;return o.info("Yofla360 :: autoInit disabled on instance with id: "+e),Promise.resolve(null)}try{const e=new i.default(t,n);return e.initialize().then(()=>(this.instances[t]=e,Promise.resolve(e))).catch(t=>(this.reportUserError(t),Promise.reject(t)))}catch(t){return this.reportUserError(t),Promise.reject(t)}}}getConfigData(t,e){const r=document.getElementById(t);if(!r)return void this.reportUserError("No html element with id: "+t);let i;const n=r.getAttribute(this.DATA_ATTRIBUTE);if(n)try{i=JSON.parse(n)}catch(r){e||this.reportUserError(`Error parsing JSON ${this.DATA_ATTRIBUTE} data for element with id: "${t}"`)}if(i||e)return e&&(i=Object.assign({},i||{},e||{})),i;this.reportUserError(`Missing or malformatted 360 view configuration for element with id: "${t}"`)}reportUserError(t){console&&("object"==typeof t?console.error("[Yofla360] "+t.toString()):console.error("[Yofla360] "+t))}},window.Y360=window.Yofla360,window.y360=window.Yofla360,e.Yofla360=window.Yofla360},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";(function(r){var i,n,s,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(r){"object"==a(e)&&void 0!==t?t.exports=r():(n=[],void 0===(s="function"==typeof(i=r)?i.apply(e,n):i)||(t.exports=s))}(function(){return function(){return function t(e,r,i){function n(a,h){if(!r[a]){if(!e[a]){if(!h&&"function"==typeof o&&o)return o(a,!0);if(s)return s(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[a]={exports:{}};e[a][0].call(l.exports,function(t){return n(e[a][1][t]||t)},l,l.exports,t,e,r,i)}return r[a].exports}for(var s="function"==typeof o&&o,a=0;a0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=i,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,i=e,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;t[e]=i<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>i(t)+1}},{}],2:[function(t,e,r){},{}],3:[function(t,e,i){(function(t){!function(r){function n(t){throw new RangeError(C[t])}function s(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function o(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+s((t=t.replace(P,".")).split("."),e).join(".")}function h(t){for(var e,r,i=[],n=0,s=t.length;n=55296&&e<=56319&&n65535&&(e+=N((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+N(t)}).join("")}function l(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:T}function c(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function d(t,e,r){var i=0;for(t=r?D(t/S):t>>1,t+=D(t/e);t>L*E>>1;i+=T)t=D(t/L);return D(i+(L+1)*t/(t+w))}function f(t){var e,r,i,s,o,a,h,c,f,p,g=[],m=t.length,v=0,y=R,_=I;for((r=t.lastIndexOf(O))<0&&(r=0),i=0;i=128&&n("not-basic"),g.push(t.charCodeAt(i));for(s=r>0?r+1:0;s=m&&n("invalid-input"),((c=l(t.charCodeAt(s++)))>=T||c>D((x-v)/a))&&n("overflow"),v+=c*a,!(c<(f=h<=_?b:h>=_+E?E:h-_));h+=T)a>D(x/(p=T-f))&&n("overflow"),a*=p;_=d(v-o,e=g.length+1,0==o),D(v/e)>x-y&&n("overflow"),y+=D(v/e),v%=e,g.splice(v++,0,y)}return u(g)}function p(t){var e,r,i,s,o,a,u,l,f,p,g,m,v,y,_,w=[];for(m=(t=h(t)).length,e=R,r=0,o=I,a=0;a=e&&gD((x-r)/(v=i+1))&&n("overflow"),r+=(u-e)*v,e=u,a=0;ax&&n("overflow"),g==e){for(l=r,f=T;!(l<(p=f<=o?b:f>=o+E?E:f-o));f+=T)_=l-p,y=T-p,w.push(N(c(p+_%y,0))),l=D(_/y);w.push(N(c(l,0))),o=d(r,v,i==s),r=0,++i}++r,++e}return w.join("")}var g="object"==(void 0===i?"undefined":a(i))&&i&&!i.nodeType&&i,m="object"==(void 0===e?"undefined":a(e))&&e&&!e.nodeType&&e,v="object"==(void 0===t?"undefined":a(t))&&t;v.global!==v&&v.window!==v&&v.self!==v||(r=v);var y,_,x=2147483647,T=36,b=1,E=26,w=38,S=700,I=72,R=128,O="-",M=/^xn--/,A=/[^\x20-\x7E]/,P=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=T-b,D=Math.floor,N=String.fromCharCode;if(y={version:"1.4.1",ucs2:{decode:h,encode:u},decode:f,encode:p,toASCII:function(t){return o(t,function(t){return A.test(t)?"xn--"+p(t):t})},toUnicode:function(t){return o(t,function(t){return M.test(t)?f(t.slice(4).toLowerCase()):t})}},g&&m)if(e.exports==g)m.exports=y;else for(_ in y)y.hasOwnProperty(_)&&(g[_]=y[_]);else r.punycode=y}(this)}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(t,e,r){function i(t,e,r){r=r||2;var i,s,a,h,u,l,d,f=e&&e.length,p=f?e[0]*r:t.length,g=n(t,0,p,r,!0),m=[];if(!g||g.next===g.prev)return m;if(f&&(g=c(t,e,g,r)),t.length>80*r){i=a=t[0],s=h=t[1];for(var v=r;va&&(a=u),l>h&&(h=l);d=0!==(d=Math.max(a-i,h-s))?1/d:0}return o(g,m,r,i,s,d),m}function n(t,e,r,i,n){var s,o;if(n===M(t,e,r,i)>0)for(s=e;s=e;s-=i)o=I(s,t[s],t[s+1],o);return o&&x(o,o.next)&&(R(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!x(i,i.next)&&0!==_(i.prev,i,i.next))i=i.next;else{if(R(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function o(t,e,r,i,n,c,d){if(t){!d&&c&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=g(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,r,i,n,s,o,a,h,u=1;do{for(r=t,t=null,s=null,o=0;r;){for(o++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;r=i}s.nextZ=null,u*=2}while(o>1)}(n)}(t,i,n,c);for(var f,p,m=t;t.prev!==t.next;)if(f=t.prev,p=t.next,c?h(t,i,n,c):a(t))e.push(f.i/r),e.push(t.i/r),e.push(p.i/r),R(t),t=p.next,m=p.next;else if((t=p)===m){d?1===d?o(t=u(s(t),e,r),e,r,i,n,c,2):2===d&&l(t,e,r,i,n,c):o(s(t),e,r,i,n,c,1);break}}}function a(t){var e=t.prev,r=t,i=t.next;if(_(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(v(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&_(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function h(t,e,r,i){var n=t.prev,s=t,o=t.next;if(_(n,s,o)>=0)return!1;for(var a=n.xs.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,l=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,c=g(a,h,e,r,i),d=g(u,l,e,r,i),f=t.prevZ,p=t.nextZ;f&&f.z>=c&&p&&p.z<=d;){if(f!==t.prev&&f!==t.next&&v(n.x,n.y,s.x,s.y,o.x,o.y,f.x,f.y)&&_(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==t.prev&&p!==t.next&&v(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&_(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&v(n.x,n.y,s.x,s.y,o.x,o.y,f.x,f.y)&&_(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&v(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&_(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function u(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!x(n,o)&&T(n,i,i.next,o)&&w(n,o)&&w(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),R(i),R(i.next),i=t=o),i=i.next}while(i!==t);return s(i)}function l(t,e,r,i,n,a){var h=t;do{for(var u=h.next.next;u!==h.prev;){if(h.i!==u.i&&y(h,u)){var l=S(h,u);return h=s(h,h.next),l=s(l,l.next),o(h,e,r,i,n,a),void o(l,e,r,i,n,a)}u=u.next}h=h.next}while(h!==t)}function c(t,e,r,i){var o,a,h,u=[];for(o=0,a=e.length;o=i.next.y&&i.next.y!==i.y){var a=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>o){if(o=a,a===n){if(s===i.y)return i;if(s===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&v(sr.x||i.x===r.x&&p(r,i)))&&(r=i,d=h)),i=i.next}while(i!==u);return r}(t,e)){var r=S(e,t);s(e,e.next),s(r,r.next)}}function p(t,e){return _(t.prev,t,e.prev)<0&&_(e.next,t,t.next)<0}function g(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function m(t){var e=t,r=t;do{(e.x=0&&(t-o)*(i-a)-(r-o)*(e-a)>=0&&(r-o)*(s-a)-(n-o)*(i-a)>=0}function y(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&T(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,s=(t.y+e.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&n<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(_(t.prev,t,e.prev)||_(t,e.prev,e))||x(t,e)&&_(t.prev,t,t.next)>0&&_(e.prev,e,e.next)>0)}function _(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function x(t,e){return t.x===e.x&&t.y===e.y}function T(t,e,r,i){var n=E(_(t,e,r)),s=E(_(t,e,i)),o=E(_(r,i,t)),a=E(_(r,i,e));return n!==s&&o!==a||!(0!==n||!b(t,r,e))||!(0!==s||!b(t,i,e))||!(0!==o||!b(r,t,i))||!(0!==a||!b(r,e,i))}function b(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function E(t){return t>0?1:t<0?-1:0}function w(t,e){return _(t.prev,t,t.next)<0?_(t,e,t.next)>=0&&_(t,t.prev,e)>=0:_(t,e,t.prev)<0||_(t,t.next,e)<0}function S(t,e){var r=new O(t.i,t.x,t.y),i=new O(e.i,e.x,e.y),n=t.next,s=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,s.next=i,i.prev=s,i}function I(t,e,r,i){var n=new O(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function R(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function O(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(t,e,r,i){for(var n=0,s=e,o=r-i;s0&&(i+=t[n-1].length,r.holes.push(i))}return r}},{}],5:[function(t,e,r){function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function s(){this._events=new i,this._eventsCount=0}var o=Object.prototype.hasOwnProperty,a="~";Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(a=!1)),s.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)o.call(t,e)&&r.push(a?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t,e){var r=a?a+t:t,i=this._events[r];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,o=new Array(s);n=0;i--){var n=t[i];"."===n?t.splice(i,1):".."===n?(t.splice(i,1),r++):r&&(t.splice(i,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var r=[],i=0;i=-1&&!n;s--){var o=s>=0?arguments[s]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,n="/"===o.charAt(0))}return r=e(i(r.split("/"),function(t){return!!t}),!n).join("/"),(n?"/":"")+r||"."},r.normalize=function(t){var s=r.isAbsolute(t),o="/"===n(t,-1);return(t=e(i(t.split("/"),function(t){return!!t}),!s).join("/"))||s||(t="."),t&&o&&(t+="/"),(s?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(i(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function i(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var n=i(t.split("/")),s=i(e.split("/")),o=Math.min(n.length,s.length),a=o,h=0;h=1;--s)if(47===(e=t.charCodeAt(s))){if(!n){i=s;break}}else n=!1;return-1===i?r?"/":".":r&&1===i?"/":t.slice(0,i)},r.basename=function(t,e){var r=function(t){"string"!=typeof t&&(t+="");var e,r=0,i=-1,n=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!n){r=e+1;break}}else-1===i&&(n=!1,i=e+1);return-1===i?"":t.slice(r,i)}(t);return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,r=0,i=-1,n=!0,s=0,o=t.length-1;o>=0;--o){var a=t.charCodeAt(o);if(47!==a)-1===i&&(n=!1,i=o+1),46===a?-1===e?e=o:1!==s&&(s=1):-1!==e&&(s=-1);else if(!n){r=o+1;break}}return-1===e||-1===i||0===s||1===s&&e===i-1&&e===r+1?"":t.slice(e,i)};var n="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:28}],11:[function(t,e,r){var i=new ArrayBuffer(0),n=function(t,e,r,n){this.gl=t,this.buffer=t.createBuffer(),this.type=e||t.ARRAY_BUFFER,this.drawType=n||t.STATIC_DRAW,this.data=i,r&&this.upload(r),this._updateID=0};n.prototype.upload=function(t,e,r){r||this.bind();var i=this.gl;t=t||this.data,e=e||0,this.data.byteLength>=t.byteLength?i.bufferSubData(this.type,e,t):i.bufferData(this.type,t,this.drawType),this.data=t},n.prototype.bind=function(){this.gl.bindBuffer(this.type,this.buffer)},n.createVertexBuffer=function(t,e,r){return new n(t,t.ARRAY_BUFFER,e,r)},n.createIndexBuffer=function(t,e,r){return new n(t,t.ELEMENT_ARRAY_BUFFER,e,r)},n.create=function(t,e,r,i){return new n(t,e,r,i)},n.prototype.destroy=function(){this.gl.deleteBuffer(this.buffer)},e.exports=n},{}],12:[function(t,e,r){var i=t("./GLTexture"),n=function(t,e,r){this.gl=t,this.framebuffer=t.createFramebuffer(),this.stencil=null,this.texture=null,this.width=e||100,this.height=r||100};n.prototype.enableTexture=function(t){var e=this.gl;this.texture=t||new i(e),this.texture.bind(),this.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture.texture,0)},n.prototype.enableStencil=function(){if(!this.stencil){var t=this.gl;this.stencil=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencil),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencil),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.width,this.height)}},n.prototype.clear=function(t,e,r,i){this.bind();var n=this.gl;n.clearColor(t,e,r,i),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT)},n.prototype.bind=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer)},n.prototype.unbind=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)},n.prototype.resize=function(t,e){var r=this.gl;this.width=t,this.height=e,this.texture&&this.texture.uploadData(null,t,e),this.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencil),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e))},n.prototype.destroy=function(){var t=this.gl;this.texture&&this.texture.destroy(),t.deleteFramebuffer(this.framebuffer),this.gl=null,this.stencil=null,this.texture=null},n.createRGBA=function(t,e,r,s){var o=i.fromData(t,null,e,r);o.enableNearestScaling(),o.enableWrapClamp();var a=new n(t,e,r);return a.enableTexture(o),a.unbind(),a},n.createFloat32=function(t,e,r,s){var o=new i.fromData(t,s,e,r);o.enableNearestScaling(),o.enableWrapClamp();var a=new n(t,e,r);return a.enableTexture(o),a.unbind(),a},e.exports=n},{"./GLTexture":14}],13:[function(t,e,r){var i=t("./shader/compileProgram"),n=t("./shader/extractAttributes"),s=t("./shader/extractUniforms"),o=t("./shader/setPrecision"),a=t("./shader/generateUniformAccessObject"),h=function(t,e,r,h,u){this.gl=t,h&&(e=o(e,h),r=o(r,h)),this.program=i(t,e,r,u),this.attributes=n(t,this.program),this.uniformData=s(t,this.program),this.uniforms=a(t,this.uniformData)};h.prototype.bind=function(){return this.gl.useProgram(this.program),this},h.prototype.destroy=function(){this.attributes=null,this.uniformData=null,this.uniforms=null,this.gl.deleteProgram(this.program)},e.exports=h},{"./shader/compileProgram":19,"./shader/extractAttributes":21,"./shader/extractUniforms":22,"./shader/generateUniformAccessObject":23,"./shader/setPrecision":27}],14:[function(t,e,r){var i=function(t,e,r,i,n){this.gl=t,this.texture=t.createTexture(),this.mipmap=!1,this.premultiplyAlpha=!1,this.width=e||-1,this.height=r||-1,this.format=i||t.RGBA,this.type=n||t.UNSIGNED_BYTE};i.prototype.upload=function(t){this.bind();var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha);var r=t.videoWidth||t.width,i=t.videoHeight||t.height;i!==this.height||r!==this.width?e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,this.type,t):e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.format,this.type,t),this.width=r,this.height=i};var n=!1;i.prototype.uploadData=function(t,e,r){this.bind();var i=this.gl;if(t instanceof Float32Array){if(!n){if(!i.getExtension("OES_texture_float"))throw new Error("floating point textures not available");n=!0}this.type=i.FLOAT}else this.type=this.type||i.UNSIGNED_BYTE;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),e!==this.width||r!==this.height?i.texImage2D(i.TEXTURE_2D,0,this.format,e,r,0,this.format,this.type,t||null):i.texSubImage2D(i.TEXTURE_2D,0,0,0,e,r,this.format,this.type,t||null),this.width=e,this.height=r},i.prototype.bind=function(t){var e=this.gl;void 0!==t&&e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)},i.prototype.unbind=function(){var t=this.gl;t.bindTexture(t.TEXTURE_2D,null)},i.prototype.minFilter=function(t){var e=this.gl;this.bind(),this.mipmap?e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.NEAREST_MIPMAP_NEAREST):e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR:e.NEAREST)},i.prototype.magFilter=function(t){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t?e.LINEAR:e.NEAREST)},i.prototype.enableMipmap=function(){var t=this.gl;this.bind(),this.mipmap=!0,t.generateMipmap(t.TEXTURE_2D)},i.prototype.enableLinearScaling=function(){this.minFilter(!0),this.magFilter(!0)},i.prototype.enableNearestScaling=function(){this.minFilter(!1),this.magFilter(!1)},i.prototype.enableWrapClamp=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)},i.prototype.enableWrapRepeat=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)},i.prototype.enableWrapMirrorRepeat=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.MIRRORED_REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.MIRRORED_REPEAT)},i.prototype.destroy=function(){this.gl.deleteTexture(this.texture)},i.fromSource=function(t,e,r){var n=new i(t);return n.premultiplyAlpha=r||!1,n.upload(e),n},i.fromData=function(t,e,r,n){var s=new i(t);return s.uploadData(e,r,n),s},e.exports=i},{}],15:[function(t,e,r){function i(t,e){if(this.nativeVaoExtension=null,i.FORCE_NATIVE||(this.nativeVaoExtension=t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object")),this.nativeState=e,this.nativeVaoExtension){this.nativeVao=this.nativeVaoExtension.createVertexArrayOES();var r=t.getParameter(t.MAX_VERTEX_ATTRIBS);this.nativeState={tempAttribState:new Array(r),attribState:new Array(r)}}this.gl=t,this.attributes=[],this.indexBuffer=null,this.dirty=!1}var n=t("./setVertexAttribArrays");i.prototype.constructor=i,e.exports=i,i.FORCE_NATIVE=!1,i.prototype.bind=function(){if(this.nativeVao){if(this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),this.dirty)return this.dirty=!1,this.activate(),this;this.indexBuffer&&this.indexBuffer.bind()}else this.activate();return this},i.prototype.unbind=function(){return this.nativeVao&&this.nativeVaoExtension.bindVertexArrayOES(null),this},i.prototype.activate=function(){for(var t=this.gl,e=null,r=0;r1)for(var r=1;r0&&u>h&&(u=h);for(var l=0;l=0?(c=g.substr(0,m),d=g.substr(m+1)):(c=g,d=""),f=decodeURIComponent(c),p=decodeURIComponent(d),i(o,f)?n(o[f])?o[f].push(p):o[f]=[o[f],p]:o[f]=p}return o};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],30:[function(t,e,r){function i(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i=n||0===r)){var s=n-(r=e+r>n?n-e:r);for(i=e;i0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=u.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new o.default,this.onError=new o.default,this.onLoad=new o.default,this.onStart=new o.default,this.onComplete=new o.default;for(var n=0;n0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2==(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var s=document.createElement("div");s.innerHTML=r,this.data=s}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,c||(c=document.createElement("a")),c.href=t;var r=!(t=(0,h.default)(c.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,i=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&i===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),s=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,s)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},a(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();d.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},d.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},d.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},d.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},d._loadTypeMap={gif:d.LOAD_TYPE.IMAGE,png:d.LOAD_TYPE.IMAGE,bmp:d.LOAD_TYPE.IMAGE,jpg:d.LOAD_TYPE.IMAGE,jpeg:d.LOAD_TYPE.IMAGE,tif:d.LOAD_TYPE.IMAGE,tiff:d.LOAD_TYPE.IMAGE,webp:d.LOAD_TYPE.IMAGE,tga:d.LOAD_TYPE.IMAGE,svg:d.LOAD_TYPE.IMAGE,"svg+xml":d.LOAD_TYPE.IMAGE,mp3:d.LOAD_TYPE.AUDIO,ogg:d.LOAD_TYPE.AUDIO,wav:d.LOAD_TYPE.AUDIO,mp4:d.LOAD_TYPE.VIDEO,webm:d.LOAD_TYPE.VIDEO},d._xhrTypeMap={xhtml:d.XHR_RESPONSE_TYPE.DOCUMENT,html:d.XHR_RESPONSE_TYPE.DOCUMENT,htm:d.XHR_RESPONSE_TYPE.DOCUMENT,xml:d.XHR_RESPONSE_TYPE.DOCUMENT,tmx:d.XHR_RESPONSE_TYPE.DOCUMENT,svg:d.XHR_RESPONSE_TYPE.DOCUMENT,tsx:d.XHR_RESPONSE_TYPE.DOCUMENT,gif:d.XHR_RESPONSE_TYPE.BLOB,png:d.XHR_RESPONSE_TYPE.BLOB,bmp:d.XHR_RESPONSE_TYPE.BLOB,jpg:d.XHR_RESPONSE_TYPE.BLOB,jpeg:d.XHR_RESPONSE_TYPE.BLOB,tif:d.XHR_RESPONSE_TYPE.BLOB,tiff:d.XHR_RESPONSE_TYPE.BLOB,webp:d.XHR_RESPONSE_TYPE.BLOB,tga:d.XHR_RESPONSE_TYPE.BLOB,json:d.XHR_RESPONSE_TYPE.JSON,text:d.XHR_RESPONSE_TYPE.TEXT,txt:d.XHR_RESPONSE_TYPE.TEXT,ttf:d.XHR_RESPONSE_TYPE.BUFFER,otf:d.XHR_RESPONSE_TYPE.BUFFER},d.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",void 0!==e&&(e.exports.default=d)},{"mini-signals":7,"parse-uri":9}],35:[function(t,e,r){function i(){}function n(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null,e.apply(this,arguments)}}r.__esModule=!0,r.eachSeries=function(t,e,r,i){var n=0,s=t.length;!function o(a){a||n===s?r&&r(a):i?setTimeout(function(){e(t[n++],o)},1):e(t[n++],o)}()},r.queue=function(t,e){function r(t,e,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");if(a.started=!0,null==t&&a.idle())setTimeout(function(){return a.drain()},1);else{var n={data:t,callback:"function"==typeof r?r:i};e?a._tasks.unshift(n):a._tasks.push(n),setTimeout(function(){return a.process()},1)}}function s(t){return function(){o-=1,t.callback.apply(t,arguments),null!=arguments[0]&&a.error(arguments[0],t.data),o<=a.concurrency-a.buffer&&a.unsaturated(),a.idle()&&a.drain(),a.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var o=0,a={_tasks:[],concurrency:e,saturated:i,unsaturated:i,buffer:e/4,empty:i,drain:i,error:i,started:!1,paused:!1,push:function(t,e){r(t,!1,e)},kill:function(){o=0,a.drain=i,a.started=!1,a._tasks=[]},unshift:function(t,e){r(t,!0,e)},process:function(){for(;!a.paused&&o>2,s[1]=(3&i[0])<<4|i[1]>>4,s[2]=(15&i[1])<<2|i[2]>>6,s[3]=63&i[2],r-(t.length-1)){case 2:s[3]=64,s[2]=64;break;case 1:s[3]=64}for(var a=0;a",'"',"`"," ","\r","\n","\t"]),d=["'"].concat(c),f=["%","/","?",";","#"].concat(d),p=["/","?","#"],g=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=t("querystring");i.prototype.parse=function(t,e,r){if(!o.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===t?"undefined":a(t)));var i=t.indexOf("?"),n=-1!==i&&i127?D+="x":D+=L[N];if(!D.match(g)){var B=P.slice(0,I),F=P.slice(I+1),U=L.match(m);U&&(B.push(U[1]),F.unshift(U[2])),F.length&&(c="/"+F.join(".")+c),this.hostname=B.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=s.toASCII(this.hostname));var j=this.port?":"+this.port:"",X=this.hostname||"";this.host=X+j,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==c[0]&&(c="/"+c))}if(!v[E])for(I=0,C=d.length;I0)&&r.host.split("@"))&&(r.auth=M.shift(),r.host=r.hostname=M.shift());return r.search=t.search,r.query=t.query,o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=E.slice(-1)[0],I=(r.host||t.host||E.length>1)&&("."===S||".."===S)||""===S,R=0,O=E.length;O>=0;O--)"."===(S=E[O])?E.splice(O,1):".."===S?(E.splice(O,1),R++):R&&(E.splice(O,1),R--);if(!T&&!b)for(;R--;R)E.unshift("..");!T||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),I&&"/"!==E.join("/").substr(-1)&&E.push("");var M,A=""===E[0]||E[0]&&"/"===E[0].charAt(0);w&&(r.hostname=r.host=A?"":E.length?E.shift():"",(M=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=M.shift(),r.host=r.hostname=M.shift()));return(T=T||r.host&&E.length)&&!A&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var t=this.host,e=u.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":40,punycode:3,querystring:31}],40:[function(t,e,r){e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==(void 0===t?"undefined":a(t))&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],41:[function(t,e,r){function i(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0;var n=function(){function t(t,e){for(var r=0;r]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,r.SHAPES={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},r.PRECISION={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"},r.TRANSFORM_MODE={STATIC:0,DYNAMIC:1},r.TEXT_GRADIENT={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},r.UPDATE_PRIORITY={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50}},{}],45:[function(t,e,r){r.__esModule=!0;var i=t("../math"),n=function(){function t(){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?i.Rectangle.EMPTY:((t=t||new i.Rectangle(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},t.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,s=t[0],o=t[1];e=si?s:i,n=o>n?o:n,s=t[2],o=t[3],e=si?s:i,n=o>n?o:n,s=t[4],o=t[5],e=si?s:i,n=o>n?o:n,s=t[6],o=t[7],e=si?s:i,n=o>n?o:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},t.prototype.addFrame=function(t,e,r,i,n){var s=t.worldTransform,o=s.a,a=s.b,h=s.c,u=s.d,l=s.tx,c=s.ty,d=this.minX,f=this.minY,p=this.maxX,g=this.maxY,m=o*e+h*r+l,v=a*e+u*r+c;d=mp?m:p,g=v>g?v:g,v=a*i+u*r+c,d=(m=o*i+h*r+l)p?m:p,g=v>g?v:g,v=a*e+u*n+c,d=(m=o*e+h*n+l)p?m:p,g=v>g?v:g,v=a*i+u*n+c,d=(m=o*i+h*n+l)p?m:p,g=v>g?v:g,this.minX=d,this.minY=f,this.maxX=p,this.maxY=g},t.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,s=n.a,o=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,f=this.maxX,p=this.maxY,g=r;gf?y:f,p=_>p?_:p}this.minX=c,this.minY=d,this.maxX=f,this.maxY=p},t.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minXi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},t.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=s>u?s:u}},t.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=s>u?s:u}},t}();r.default=n},{"../math":68}],46:[function(t,e,r){r.__esModule=!0;var i=function(){function t(t,e){for(var r=0;r1)for(var r=0;rthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);(0,n.removeItems)(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments.length;if(e>1)for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:0,e=arguments[1],r=t,i="number"==typeof e?e:this.children.length,n=i-r,s=void 0;if(n>0&&n<=i){s=this.children.splice(r,n);for(var o=0;o2&&void 0!==arguments[2]&&arguments[2]||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)},e.prototype.toLocal=function(t,e,r,i){return e&&(t=e.toGlobal(t,r,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,r)},e.prototype.renderWebGL=function(t){},e.prototype.renderCanvas=function(t){},e.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},e.prototype.setTransform=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0;return this.position.x=t,this.position.y=e,this.scale.x=r||1,this.scale.y=i||1,this.rotation=n,this.skew.x=s,this.skew.y=o,this.pivot.x=a,this.pivot.y=h,this},e.prototype.destroy=function(){this.removeAllListeners(),this.parent&&this.parent.removeChild(this),this.transform=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.filterArea=null,this.interactive=!1,this.interactiveChildren=!1,this._destroyed=!0},n(e,[{key:"_tempDisplayObjectParent",get:function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new e),this.tempDisplayObjectParent}},{key:"x",get:function(){return this.position.x},set:function(t){this.transform.position.x=t}},{key:"y",get:function(){return this.position.y},set:function(t){this.transform.position.y=t}},{key:"worldTransform",get:function(){return this.transform.worldTransform}},{key:"localTransform",get:function(){return this.transform.localTransform}},{key:"position",get:function(){return this.transform.position},set:function(t){this.transform.position.copy(t)}},{key:"scale",get:function(){return this.transform.scale},set:function(t){this.transform.scale.copy(t)}},{key:"pivot",get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copy(t)}},{key:"skew",get:function(){return this.transform.skew},set:function(t){this.transform.skew.copy(t)}},{key:"rotation",get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t}},{key:"worldVisible",get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},{key:"mask",get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0,this._mask.isMask=!1),this._mask=t,this._mask&&(this._mask.renderable=!1,this._mask.isMask=!0)}},{key:"filters",get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}]),e}(s.default);r.default=f,f.prototype.displayObjectUpdateTransform=f.prototype.updateTransform},{"../const":44,"../math":68,"../settings":99,"./Bounds":45,"./Transform":48,"./TransformStatic":50,eventemitter3:5}],48:[function(t,e,r){r.__esModule=!0;var i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]&&arguments[0];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(void 0===e?"undefined":a(e))&&"function"!=typeof e?t:e}(this,t.call(this));return i.fillAlpha=1,i.lineWidth=0,i.nativeLines=r,i.lineColor=0,i.lineAlignment=.5,i.graphicsData=[],i.tint=16777215,i._prevTint=16777215,i.blendMode=d.BLEND_MODES.NORMAL,i.currentPath=null,i._webGL={},i.isMask=!1,i.boundsPadding=0,i._localBounds=new f.default,i.dirty=0,i.fastRectDirty=-1,i.clearDirty=0,i.boundsDirty=-1,i.cachedSpriteDirty=!1,i._spriteRect=null,i._fastRect=!1,i._prevRectTint=null,i._prevRectFillColor=null,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":a(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.clone=function(){var t=new e;t.renderable=this.renderable,t.fillAlpha=this.fillAlpha,t.lineWidth=this.lineWidth,t.lineColor=this.lineColor,t.lineAlignment=this.lineAlignment,t.tint=this.tint,t.blendMode=this.blendMode,t.isMask=this.isMask,t.boundsPadding=this.boundsPadding,t.dirty=0,t.cachedSpriteDirty=this.cachedSpriteDirty;for(var r=0;re.CURVES.maxSegments&&(r=e.CURVES.maxSegments),r},e.prototype.lineStyle=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;if(this.lineWidth=t,this.lineColor=e,this.lineAlpha=r,this.lineAlignment=i,this.currentPath)if(this.currentPath.shape.points.length){var n=new l.Polygon(this.currentPath.shape.points.slice(-2));n.closed=!1,this.drawShape(n)}else this.currentPath.lineWidth=this.lineWidth,this.currentPath.lineColor=this.lineColor,this.currentPath.lineAlpha=this.lineAlpha,this.currentPath.lineAlignment=this.lineAlignment;return this},e.prototype.moveTo=function(t,e){var r=new l.Polygon([t,e]);return r.closed=!1,this.drawShape(r),this},e.prototype.lineTo=function(t,e){var r=this.currentPath.shape.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||(r.push(t,e),this.dirty++),this},e.prototype.quadraticCurveTo=function(t,r,i,n){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var s=this.currentPath.shape.points,o=0,a=0;0===s.length&&this.moveTo(0,0);for(var h=s[s.length-2],u=s[s.length-1],l=e.CURVES.adaptive?this._segmentsCount(this._quadraticCurveLength(h,u,t,r,i,n)):20,c=1;c<=l;++c){var d=c/l;o=h+(t-h)*d,a=u+(r-u)*d,s.push(o+(t+(i-t)*d-o)*d,a+(r+(n-r)*d-a)*d)}return this.dirty++,this},e.prototype.bezierCurveTo=function(t,r,i,n,s,o){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var a=this.currentPath.shape.points,h=a[a.length-2],u=a[a.length-1];a.length-=2;var l=e.CURVES.adaptive?this._segmentsCount(this._bezierCurveLength(h,u,t,r,i,n,s,o)):20;return(0,p.default)(h,u,t,r,i,n,s,o,l,a),this.dirty++,this},e.prototype.arcTo=function(t,e,r,i,n){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var s=this.currentPath.shape.points,o=s[s.length-2],a=s[s.length-1]-e,h=o-t,u=i-e,l=r-t,c=Math.abs(a*l-h*u);if(c<1e-8||0===n)s[s.length-2]===t&&s[s.length-1]===e||s.push(t,e);else{var d=a*a+h*h,f=u*u+l*l,p=a*u+h*l,g=n*Math.sqrt(d)/c,m=n*Math.sqrt(f)/c,v=g*p/d,y=m*p/f,_=g*l+m*h,x=g*u+m*a,T=h*(m+v),b=a*(m+v),E=l*(g+y),w=u*(g+y),S=Math.atan2(b-x,T-_),I=Math.atan2(w-x,E-_);this.arc(_+t,x+e,n,S,I,h*u>l*a)}return this.dirty++,this},e.prototype.arc=function(t,r,i,n,s){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(n===s)return this;!o&&s<=n?s+=d.PI_2:o&&n<=s&&(n+=d.PI_2);var a=s-n,h=e.CURVES.adaptive?this._segmentsCount(Math.abs(a)*i):40*Math.ceil(Math.abs(a)/d.PI_2);if(0===a)return this;var u=t+Math.cos(n)*i,l=r+Math.sin(n)*i,c=this.currentPath?this.currentPath.shape.points:null;if(c){var f=Math.abs(c[c.length-2]-u),p=Math.abs(c[c.length-1]-l);f<.001&&p<.001||c.push(u,l)}else this.moveTo(u,l),c=this.currentPath.shape.points;for(var g=a/(2*h),m=2*g,v=Math.cos(g),y=Math.sin(g),_=h-1,x=_%1/_,T=0;T<=_;++T){var b=g+n+m*(T+x*T),E=Math.cos(b),w=-Math.sin(b);c.push((v*E+y*w)*i+t,(v*-w+y*E)*i+r)}return this.dirty++,this},e.prototype.beginFill=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.filling=!0,this.fillColor=t,this.fillAlpha=e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},e.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new l.Rectangle(t,e,r,i)),this},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new l.RoundedRectangle(t,e,r,i,n)),this},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new l.Circle(t,e,r)),this},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new l.Ellipse(t,e,r,i)),this},e.prototype.drawPolygon=function(t){var e=t,r=!0;if(e instanceof l.Polygon&&(r=e.closed,e=e.points),!Array.isArray(e)){e=new Array(arguments.length);for(var i=0;i5&&void 0!==arguments[5]?arguments[5]:0;n=n||i/2;for(var o=-1*Math.PI/2+s,a=2*r,h=d.PI_2/a,u=[],l=0;l0)&&(this.lineWidth=0,this.lineAlignment=.5,this.filling=!1,this.boundsDirty=-1,this.canvasTintDirty=-1,this.dirty++,this.clearDirty++,this.graphicsData.length=0),this.currentPath=null,this._spriteRect=null,this},e.prototype.isFastRect=function(){return 1===this.graphicsData.length&&this.graphicsData[0].shape.type===d.SHAPES.RECT&&!this.graphicsData[0].lineWidth},e.prototype._renderWebGL=function(t){this.dirty!==this.fastRectDirty&&(this.fastRectDirty=this.dirty,this._fastRect=this.isFastRect()),this._fastRect?this._renderSpriteRect(t):(t.setObjectRenderer(t.plugins.graphics),t.plugins.graphics.render(this))},e.prototype._renderSpriteRect=function(t){var e=this.graphicsData[0].shape;this._spriteRect||(this._spriteRect=new u.default(new o.default(o.default.WHITE)));var r=this._spriteRect,i=this.graphicsData[0].fillColor;if(16777215===this.tint)r.tint=i;else if(this.tint!==this._prevRectTint||i!==this._prevRectFillColor){var n=_,s=x;(0,c.hex2rgb)(i,n),(0,c.hex2rgb)(this.tint,s),n[0]*=s[0],n[1]*=s[1],n[2]*=s[2],r.tint=(0,c.rgb2hex)(n),this._prevRectTint=this.tint,this._prevRectFillColor=i}r.alpha=this.graphicsData[0].fillAlpha,r.worldAlpha=this.worldAlpha*r.alpha,r.blendMode=this.blendMode,r._texture._frame.width=e.width,r._texture._frame.height=e.height,r.transform.worldTransform=this.transform.worldTransform,r.anchor.set(-e.x/e.width,-e.y/e.height),r._onAnchorUpdate(),r._renderWebGL(t)},e.prototype._renderCanvas=function(t){!0!==this.isMask&&t.plugins.graphics.render(this)},e.prototype._calculateBounds=function(){this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.updateLocalBounds(),this.cachedSpriteDirty=!0);var t=this._localBounds;this._bounds.addFrame(this.transform,t.minX,t.minY,t.maxX,t.maxY)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,y);for(var e=this.graphicsData,r=0;re?s+a:e,r=oi?o+h:i;else if(c===d.SHAPES.CIRC)s=n.x,o=n.y,a=n.radius+f,h=n.radius+f,t=s-ae?s+a:e,r=o-hi?o+h:i;else if(c===d.SHAPES.ELIP)s=n.x,o=n.y,a=n.width+f,h=n.height+f,t=s-ae?s+a:e,r=o-hi?o+h:i;else for(var p=n.points,g=0,m=0,v=0,y=0,_=0,x=0,T=0,b=0,E=0;E+2e?T+_:e,r=b-xi?b+x:i)}else t=0,e=0,r=0,i=0;var w=this.boundsPadding;this._localBounds.minX=t-w,this._localBounds.maxX=e+w,this._localBounds.minY=r-w,this._localBounds.maxY=i+w},e.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var e=new h.default(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,this.nativeLines,t,this.lineAlignment);return this.graphicsData.push(e),e.type===d.SHAPES.POLY&&(e.shape.closed=e.shape.closed,this.currentPath=e),this.dirty++,e},e.prototype.generateCanvasTexture=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=this.getLocalBounds(),i=s.default.create(r.width,r.height,t,e);m||(m=new g.default),this.transform.updateLocalTransform(),this.transform.localTransform.copy(v),v.invert(),v.tx-=r.x,v.ty-=r.y,m.render(this,i,!0,v);var n=o.default.fromCanvas(i.baseTexture._canvasRenderTarget.canvas,t,"graphics");return n.baseTexture.resolution=e,n.baseTexture.update(),n},e.prototype.closePath=function(){var t=this.currentPath;return t&&t.shape&&t.shape.close(),this},e.prototype.addHole=function(){var t=this.graphicsData.pop();return this.currentPath=this.graphicsData[this.graphicsData.length-1],this.currentPath.addHole(t.shape),this.currentPath=null,this},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e);for(var r=0;r0){p=0;for(var v=0;v=2;T-=2)r.lineTo(d[T],d[T+1]);f[y].closed&&r.closePath()}}h.fill&&(r.globalAlpha=h.fillAlpha*i,r.fillStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.fill()),h.lineWidth&&(r.globalAlpha=h.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|c).toString(16)).substr(-6),r.stroke())}else if(h.type===n.SHAPES.RECT)(h.fillColor||0===h.fillColor)&&(r.globalAlpha=h.fillAlpha*i,r.fillStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),h.lineWidth&&(r.globalAlpha=h.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|c).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===n.SHAPES.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),h.fill&&(r.globalAlpha=h.fillAlpha*i,r.fillStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.fill()),h.lineWidth&&(r.globalAlpha=h.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|c).toString(16)).substr(-6),r.stroke());else if(h.type===n.SHAPES.ELIP){var b=2*u.width,E=2*u.height,w=u.x-b/2,S=u.y-E/2;r.beginPath();var I=b/2*.5522848,R=E/2*.5522848,O=w+b,M=S+E,A=w+b/2,P=S+E/2;r.moveTo(w,P),r.bezierCurveTo(w,P-R,A-I,S,A,S),r.bezierCurveTo(A+I,S,O,P-R,O,P),r.bezierCurveTo(O,P+R,A+I,M,A,M),r.bezierCurveTo(A-I,M,w,P+R,w,P),r.closePath(),h.fill&&(r.globalAlpha=h.fillAlpha*i,r.fillStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.fill()),h.lineWidth&&(r.globalAlpha=h.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|c).toString(16)).substr(-6),r.stroke())}else if(h.type===n.SHAPES.RREC){var C=u.x,L=u.y,D=u.width,N=u.height,k=u.radius,B=Math.min(D,N)/2|0;k=k>B?B:k,r.beginPath(),r.moveTo(C,L+k),r.lineTo(C,L+N-k),r.quadraticCurveTo(C,L+N,C+k,L+N),r.lineTo(C+D-k,L+N),r.quadraticCurveTo(C+D,L+N,C+D,L+N-k),r.lineTo(C+D,L+k),r.quadraticCurveTo(C+D,L,C+D-k,L),r.lineTo(C+k,L),r.quadraticCurveTo(C,L,C,L+k),r.closePath(),(h.fillColor||0===h.fillColor)&&(r.globalAlpha=h.fillAlpha*i,r.fillStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.fill()),h.lineWidth&&(r.globalAlpha=h.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|c).toString(16)).substr(-6),r.stroke())}}},t.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.dirty;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((o>>8&255)/255*r*255<<8)+(255&o)/255*i*255,s._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},t.prototype.renderPolygon=function(t,e,r){r.moveTo(t[0],t[1]);for(var i=1;i9&&void 0!==arguments[9]?arguments[9]:[],l=0,c=0,d=0,f=0,p=0;u.push(t,e);for(var g=1,m=0;g<=h;++g)d=(c=(l=1-(m=g/h))*l)*l,p=(f=m*m)*m,u.push(d*t+3*c*m*r+3*l*f*n+p*o,d*e+3*c*m*i+3*l*f*s+p*a);return u}},{}],55:[function(t,e,r){function i(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0;var n=t("../../utils"),s=t("../../const"),o=i(t("../../renderers/webgl/utils/ObjectRenderer")),h=i(t("../../renderers/webgl/WebGLRenderer")),u=i(t("./WebGLGraphicsData")),l=i(t("./shaders/PrimitiveShader")),c=i(t("./utils/buildPoly")),d=i(t("./utils/buildRectangle")),f=i(t("./utils/buildRoundedRectangle")),p=i(t("./utils/buildCircle")),g=function(t){function e(r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(void 0===e?"undefined":a(e))&&"function"!=typeof e?t:e}(this,t.call(this,r));return i.graphicsDataPool=[],i.primitiveShader=null,i.gl=r.gl,i.CONTEXT_UID=0,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":a(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.onContextChange=function(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.primitiveShader=new l.default(this.gl)},e.prototype.destroy=function(){o.default.prototype.destroy.call(this);for(var t=0;t32e4)&&((i=this.graphicsDataPool.pop()||new u.default(this.renderer.gl,this.primitiveShader,this.renderer.state.attribsState)).nativeLines=r,i.reset(e),t.data.push(i)),i.dirty=!0,i},e}(o.default);r.default=g,h.default.registerPlugin("graphics",g)},{"../../const":44,"../../renderers/webgl/WebGLRenderer":82,"../../renderers/webgl/utils/ObjectRenderer":92,"../../utils":123,"./WebGLGraphicsData":56,"./shaders/PrimitiveShader":57,"./utils/buildCircle":58,"./utils/buildPoly":60,"./utils/buildRectangle":61,"./utils/buildRoundedRectangle":62}],56:[function(t,e,r){r.__esModule=!0;var i=function(t){return t&&t.__esModule?t:{default:t}}(t("pixi-gl-core")),n=function(){function t(e,r,n){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.gl=e,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=i.default.GLBuffer.createVertexBuffer(e),this.indexBuffer=i.default.GLBuffer.createIndexBuffer(e),this.dirty=!0,this.nativeLines=!1,this.glPoints=null,this.glIndices=null,this.shader=r,this.vao=new i.default.VertexArrayObject(e,n).addIndex(this.indexBuffer).addAttribute(this.buffer,r.attributes.aVertexPosition,e.FLOAT,!1,24,0).addAttribute(this.buffer,r.attributes.aColor,e.FLOAT,!1,24,8)}return t.prototype.reset=function(){this.points.length=0,this.indices.length=0},t.prototype.upload=function(){this.glPoints=new Float32Array(this.points),this.buffer.upload(this.glPoints),this.glIndices=new Uint16Array(this.indices),this.indexBuffer.upload(this.glIndices),this.dirty=!1},t.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.vao.destroy(),this.buffer.destroy(),this.indexBuffer.destroy(),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null},t}();r.default=n},{"pixi-gl-core":17}],57:[function(t,e,r){r.__esModule=!0;var i=function(t){function e(r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(void 0===e?"undefined":a(e))&&"function"!=typeof e?t:e}(this,t.call(this,r,["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","uniform float alpha;","uniform vec3 tint;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"].join("\n"),["varying vec4 vColor;","void main(void){"," gl_FragColor = vColor;","}"].join("\n")))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":a(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(function(t){return t&&t.__esModule?t:{default:t}}(t("../../../Shader")).default);r.default=i},{"../../../Shader":42}],58:[function(t,e,r){r.__esModule=!0,r.default=function(t,e,r){var o=t.shape,a=o.x,h=o.y,u=void 0,l=void 0;if(t.type===n.SHAPES.CIRC?(u=o.radius,l=o.radius):(u=o.width,l=o.height),0!==u&&0!==l){var c=Math.floor(30*Math.sqrt(o.radius))||Math.floor(15*Math.sqrt(o.width+o.height)),d=2*Math.PI/c;if(t.fill){var f=(0,s.hex2rgb)(t.fillColor),p=t.fillAlpha,g=f[0]*p,m=f[1]*p,v=f[2]*p,y=e.points,_=e.indices,x=y.length/6;_.push(x);for(var T=0;T196*p*p?(A=I-O,P=R-M,A/=C=Math.sqrt(A*A+P*P),P/=C,A*=p,P*=p,u.push(b-A*D,E-P*D),u.push(v,y,_,m),u.push(b+A*N,E+P*N),u.push(v,y,_,m),u.push(b-A*N*D,E-P*D),u.push(v,y,_,m),d++):(u.push(b+(W-b)*D,E+(Y-E)*D),u.push(v,y,_,m),u.push(b-(W-b)*N,E-(Y-E)*N),u.push(v,y,_,m))}}x=r[2*(c-2)],T=r[2*(c-2)+1],b=r[2*(c-1)],I=-(T-(E=r[2*(c-1)+1])),R=x-b,I/=C=Math.sqrt(I*I+R*R),R/=C,I*=p,R*=p,u.push(b-I*D,E-R*D),u.push(v,y,_,m),u.push(b+I*N,E+R*N),u.push(v,y,_,m),l.push(f);for(var z=0;z=6){for(var a=[],h=t.holes,u=0;u0&&(0,n.default)(t,e,r)};var n=i(t("./buildLine")),s=t("../../../utils"),o=i(t("earcut"))},{"../../../utils":123,"./buildLine":59,earcut:4}],61:[function(t,e,r){r.__esModule=!0,r.default=function(t,e,r){var s=t.shape,o=s.x,a=s.y,h=s.width,u=s.height;if(t.fill){var l=(0,n.hex2rgb)(t.fillColor),c=t.fillAlpha,d=l[0]*c,f=l[1]*c,p=l[2]*c,g=e.points,m=e.indices,v=g.length/6;g.push(o,a),g.push(d,f,p,c),g.push(o+h,a),g.push(d,f,p,c),g.push(o,a+u),g.push(d,f,p,c),g.push(o+h,a+u),g.push(d,f,p,c),m.push(v,v,v+1,v+2,v+3,v+3)}if(t.lineWidth){var y=t.points;t.points=[o,a,o+h,a,o+h,a+u,o,a+u,o,a],(0,i.default)(t,e,r),t.points=y}};var i=function(t){return t&&t.__esModule?t:{default:t}}(t("./buildLine")),n=t("../../../utils")},{"../../../utils":123,"./buildLine":59}],62:[function(t,e,r){function i(t){return t&&t.__esModule?t:{default:t}}function n(t,e,r){return t+(e-t)*r}function s(t,e,r,i,s,o){for(var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[],h=0,u=0,l=0,c=0,d=0,f=0,p=0,g=0;p<=20;++p)h=n(t,r,g=p/20),u=n(e,i,g),l=n(r,s,g),c=n(i,o,g),d=n(h,l,g),f=n(u,c,g),a.push(d,f);return a}r.__esModule=!0,r.default=function(t,e,r){var i=t.shape,n=i.x,u=i.y,l=i.width,c=i.height,d=i.radius,f=[];if(f.push(n+d,u),s(n+l-d,u,n+l,u,n+l,u+d,f),s(n+l,u+c-d,n+l,u+c,n+l-d,u+c,f),s(n+d,u+c,n,u+c,n,u+c-d,f),s(n,u+d,n,u,n+d+1e-10,u,f),t.fill){for(var p=(0,h.hex2rgb)(t.fillColor),g=t.fillAlpha,m=p[0]*g,v=p[1]*g,y=p[2]*g,_=e.points,x=e.indices,T=_.length/6,b=(0,o.default)(f,null,2),E=0,w=b.length;E0?1:0}r.__esModule=!0;var n=function(t){return t&&t.__esModule?t:{default:t}}(t("./Matrix")),s=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],o=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],a=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],h=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],u=[],l=[];!function(){for(var t=0;t<16;t++){var e=[];l.push(e);for(var r=0;r<16;r++)for(var c=i(s[t]*s[r]+a[t]*o[r]),d=i(o[t]*s[r]+h[t]*o[r]),f=i(s[t]*a[r]+a[t]*h[r]),p=i(o[t]*a[r]+h[t]*h[r]),g=0;g<16;g++)if(s[g]===c&&o[g]===d&&a[g]===f&&h[g]===p){e.push(g);break}}for(var m=0;m<16;m++){var v=new n.default;v.set(s[m],o[m],a[m],h[m],0,0),u.push(v)}}();var c={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return s[t]},uY:function(t){return o[t]},vX:function(t){return a[t]},vY:function(t){return h[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return l[t][e]},sub:function(t,e){return l[t][c.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?c.S:c.N:2*Math.abs(e)<=Math.abs(t)?t>0?c.E:c.W:e>0?t>0?c.SE:c.SW:t>0?c.NE:c.NW},matrixAppendRotationInv:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=u[c.inv(e)];n.tx=r,n.ty=i,t.append(n)}};r.default=c},{"./Matrix":65}],65:[function(t,e,r){r.__esModule=!0;var i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.a=e,this.b=r,this.c=i,this.d=n,this.tx=s,this.ty=o,this.array=null}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,e,r,i,n,s){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=s,this},t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},t.prototype.apply=function(t,e){e=e||new n.default;var r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e},t.prototype.applyInverse=function(t,e){e=e||new n.default;var r=1/(this.a*this.d+this.c*-this.b),i=t.x,s=t.y;return e.x=this.d*r*i+-this.c*r*s+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*s+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e},t.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},t.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},t.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,s=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=s*e-this.ty*r,this.ty=s*r+this.ty*e,this},t.prototype.append=function(t){var e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this},t.prototype.setTransform=function(t,e,r,i,n,s,o,a,h){return this.a=Math.cos(o+h)*n,this.b=Math.sin(o+h)*n,this.c=-Math.sin(o-a)*s,this.d=Math.cos(o-a)*s,this.tx=t-(r*this.a+i*this.c),this.ty=e-(r*this.b+i*this.d),this},t.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,i=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var e=this.a,r=this.b,i=this.c,n=this.d,o=-Math.atan2(-i,n),a=Math.atan2(r,e),h=Math.abs(o+a);return h<1e-5||Math.abs(s.PI_2-h)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=a),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx,t.position.y=this.ty,t},t.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,s=t*i-e*r;return this.a=i/s,this.b=-e/s,this.c=-r/s,this.d=t/s,this.tx=(r*this.ty-i*n)/s,this.ty=-(t*this.ty-e*n)/s,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var e=new t;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},t.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i(t,null,[{key:"IDENTITY",get:function(){return new t}},{key:"TEMP_MATRIX",get:function(){return new t}}]),t}();r.default=o},{"../const":44,"./Point":67}],66:[function(t,e,r){r.__esModule=!0;var i=function(){function t(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this._x=i,this._y=n,this.cb=e,this.scope=r}return t.prototype.clone=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new t(e||this.cb,r||this.scope,this._x,this._y)},t.prototype.set=function(t,e){var r=t||0,i=e||(0!==e?r:0);this._x===r&&this._y===i||(this._x=r,this._y=i,this.cb.call(this.scope))},t.prototype.copy=function(t){this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope))},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},i(t,[{key:"x",get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}},{key:"y",get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}]),t}();r.default=n},{}],67:[function(t,e,r){r.__esModule=!0;var i=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.x=e,this.y=r}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copy=function(t){this.set(t.x,t.y)},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)},t}();r.default=i},{}],68:[function(t,e,r){function i(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0;var n=t("./Point");Object.defineProperty(r,"Point",{enumerable:!0,get:function(){return i(n).default}});var s=t("./ObservablePoint");Object.defineProperty(r,"ObservablePoint",{enumerable:!0,get:function(){return i(s).default}});var o=t("./Matrix");Object.defineProperty(r,"Matrix",{enumerable:!0,get:function(){return i(o).default}});var a=t("./GroupD8");Object.defineProperty(r,"GroupD8",{enumerable:!0,get:function(){return i(a).default}});var h=t("./shapes/Circle");Object.defineProperty(r,"Circle",{enumerable:!0,get:function(){return i(h).default}});var u=t("./shapes/Ellipse");Object.defineProperty(r,"Ellipse",{enumerable:!0,get:function(){return i(u).default}});var l=t("./shapes/Polygon");Object.defineProperty(r,"Polygon",{enumerable:!0,get:function(){return i(l).default}});var c=t("./shapes/Rectangle");Object.defineProperty(r,"Rectangle",{enumerable:!0,get:function(){return i(c).default}});var d=t("./shapes/RoundedRectangle");Object.defineProperty(r,"RoundedRectangle",{enumerable:!0,get:function(){return i(d).default}})},{"./GroupD8":64,"./Matrix":65,"./ObservablePoint":66,"./Point":67,"./shapes/Circle":69,"./shapes/Ellipse":70,"./shapes/Polygon":71,"./shapes/Rectangle":72,"./shapes/RoundedRectangle":73}],69:[function(t,e,r){r.__esModule=!0;var i=function(t){return t&&t.__esModule?t:{default:t}}(t("./Rectangle")),n=t("../../const"),s=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.x=e,this.y=r,this.radius=i,this.type=n.SHAPES.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.radius*this.radius,i=this.x-t,n=this.y-e;return(i*=i)+(n*=n)<=r},t.prototype.getBounds=function(){return new i.default(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},t}();r.default=s},{"../../const":44,"./Rectangle":72}],70:[function(t,e,r){r.__esModule=!0;var i=function(t){return t&&t.__esModule?t:{default:t}}(t("./Rectangle")),n=t("../../const"),s=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.x=e,this.y=r,this.width=i,this.height=s,this.type=n.SHAPES.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,i=(e-this.y)/this.height;return(r*=r)+(i*=i)<=1},t.prototype.getBounds=function(){return new i.default(this.x-this.width,this.y-this.height,this.width,this.height)},t}();r.default=s},{"../../const":44,"./Rectangle":72}],71:[function(t,e,r){r.__esModule=!0;var i=function(t){return t&&t.__esModule?t:{default:t}}(t("../Point")),n=t("../../const"),s=function(){function t(){for(var e=arguments.length,r=Array(e),s=0;se!=u>e&&t<(e-a)/(u-a)*(h-o)+o&&(r=!r)}return r},t}();r.default=s},{"../../const":44,"../Point":67}],72:[function(t,e,r){r.__esModule=!0;var i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.x=Number(e),this.y=Number(r),this.width=Number(i),this.height=Number(s),this.type=n.SHAPES.RECT}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&t>=this.x&&t=this.y&&e0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.001,r=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=i-this.y},i(t,[{key:"left",get:function(){return this.x}},{key:"right",get:function(){return this.x+this.width}},{key:"top",get:function(){return this.y}},{key:"bottom",get:function(){return this.y+this.height}}],[{key:"EMPTY",get:function(){return new t(0,0,0,0)}}]),t}();r.default=s},{"../../const":44}],73:[function(t,e,r){r.__esModule=!0;var i=t("../../const"),n=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:20;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.x=e,this.y=r,this.width=n,this.height=s,this.radius=o,this.type=i.SHAPES.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},t}();r.default=n},{"../../const":44}],74:[function(t,e,r){function i(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0;var n=function(){function t(t,e){for(var r=0;r0){u=0;for(var d=0;d=2;m-=2)e.lineTo(a[m],a[m+1])}}}else if(s.type===i.SHAPES.RECT)e.rect(o.x,o.y,o.width,o.height),e.closePath();else if(s.type===i.SHAPES.CIRC)e.arc(o.x,o.y,o.radius,0,2*Math.PI),e.closePath();else if(s.type===i.SHAPES.ELIP){var v=2*o.width,y=2*o.height,_=o.x-v/2,x=o.y-y/2,T=v/2*.5522848,b=y/2*.5522848,E=_+v,w=x+y,S=_+v/2,I=x+y/2;e.moveTo(_,I),e.bezierCurveTo(_,I-b,S-T,x,S,x),e.bezierCurveTo(S+T,x,E,I-b,E,I),e.bezierCurveTo(E,I+b,S+T,w,S,w),e.bezierCurveTo(S-T,w,_,I+b,_,I),e.closePath()}else if(s.type===i.SHAPES.RREC){var R=o.x,O=o.y,M=o.width,A=o.height,P=o.radius,C=Math.min(M,A)/2|0;P=P>C?C:P,e.moveTo(R,O+P),e.lineTo(R,O+A-P),e.quadraticCurveTo(R,O+A,R+P,O+A),e.lineTo(R+M-P,O+A),e.quadraticCurveTo(R+M,O+A,R+M,O+A-P),e.lineTo(R+M,O+P),e.quadraticCurveTo(R+M,O,R+M-P,O),e.lineTo(R+P,O),e.quadraticCurveTo(R,O,R,O+P),e.closePath()}}}},t.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},t.prototype.destroy=function(){},t}();r.default=n},{"../../../const":44}],77:[function(t,e,r){r.__esModule=!0;var i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:[];return(0,n.default)()?(t[i.BLEND_MODES.NORMAL]="source-over",t[i.BLEND_MODES.ADD]="lighter",t[i.BLEND_MODES.MULTIPLY]="multiply",t[i.BLEND_MODES.SCREEN]="screen",t[i.BLEND_MODES.OVERLAY]="overlay",t[i.BLEND_MODES.DARKEN]="darken",t[i.BLEND_MODES.LIGHTEN]="lighten",t[i.BLEND_MODES.COLOR_DODGE]="color-dodge",t[i.BLEND_MODES.COLOR_BURN]="color-burn",t[i.BLEND_MODES.HARD_LIGHT]="hard-light",t[i.BLEND_MODES.SOFT_LIGHT]="soft-light",t[i.BLEND_MODES.DIFFERENCE]="difference",t[i.BLEND_MODES.EXCLUSION]="exclusion",t[i.BLEND_MODES.HUE]="hue",t[i.BLEND_MODES.SATURATION]="saturate",t[i.BLEND_MODES.COLOR]="color",t[i.BLEND_MODES.LUMINOSITY]="luminosity"):(t[i.BLEND_MODES.NORMAL]="source-over",t[i.BLEND_MODES.ADD]="lighter",t[i.BLEND_MODES.MULTIPLY]="source-over",t[i.BLEND_MODES.SCREEN]="source-over",t[i.BLEND_MODES.OVERLAY]="source-over",t[i.BLEND_MODES.DARKEN]="source-over",t[i.BLEND_MODES.LIGHTEN]="source-over",t[i.BLEND_MODES.COLOR_DODGE]="source-over",t[i.BLEND_MODES.COLOR_BURN]="source-over",t[i.BLEND_MODES.HARD_LIGHT]="source-over",t[i.BLEND_MODES.SOFT_LIGHT]="source-over",t[i.BLEND_MODES.DIFFERENCE]="source-over",t[i.BLEND_MODES.EXCLUSION]="source-over",t[i.BLEND_MODES.HUE]="source-over",t[i.BLEND_MODES.SATURATION]="source-over",t[i.BLEND_MODES.COLOR]="source-over",t[i.BLEND_MODES.LUMINOSITY]="source-over"),t[i.BLEND_MODES.NORMAL_NPM]=t[i.BLEND_MODES.NORMAL],t[i.BLEND_MODES.ADD_NPM]=t[i.BLEND_MODES.ADD],t[i.BLEND_MODES.SCREEN_NPM]=t[i.BLEND_MODES.SCREEN],t};var i=t("../../../const"),n=function(t){return t&&t.__esModule?t:{default:t}}(t("./canUseNewCanvasBlendModes"))},{"../../../const":44,"./canUseNewCanvasBlendModes":78}],80:[function(t,e,r){r.__esModule=!0;var i=t("../../const"),n=function(t){return t&&t.__esModule?t:{default:t}}(t("../../settings")),s=function(){function t(e){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=n.default.GC_MAX_IDLE,this.checkCountMax=n.default.GC_MAX_CHECK_COUNT,this.mode=n.default.GC_MODE}return t.prototype.update=function(){this.count++,this.mode!==i.GC_MODES.MANUAL&&++this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())},t.prototype.run=function(){for(var t=this.renderer.textureManager,e=t._managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var s=0,o=0;o=0;r--)this.unload(t.children[r])},t}();r.default=s},{"../../const":44,"../../settings":99}],81:[function(t,e,r){r.__esModule=!0;var i=t("pixi-gl-core"),n=t("../../const"),s=function(t){return t&&t.__esModule?t:{default:t}}(t("./utils/RenderTarget")),o=t("../../utils"),a=function(){function t(e){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.renderer=e,this.gl=e.gl,this._managedTextures=[]}return t.prototype.bindTexture=function(){},t.prototype.getTexture=function(){},t.prototype.updateTexture=function(t,e){var r=this.gl,o=!!t._glRenderTargets;if(!t.hasLoaded)return null;var a=this.renderer.boundTextures;if(void 0===e){e=0;for(var h=0;h 0.5)"," {"," color = vec4(1.0, 0.0, 0.0, 1.0);"," }"," else"," {"," color = vec4(0.0, 1.0, 0.0, 1.0);"," }"," gl_FragColor = mix(sample, masky, 0.5);"," gl_FragColor *= sample.a;","}"].join("\n")}}]),t}();r.default=l},{"../../../const":44,"../../../settings":99,"../../../utils":123,"./extractUniformsFromSrc":85}],85:[function(t,e,r){function i(t){for(var e=new RegExp("^(projectionMatrix|uSampler|filterArea|filterClamp)$"),r={},i=void 0,s=t.replace(/\s+/g," ").split(/\s*;\s*/),o=0;o-1){var h=a.split(" "),u=h[1],l=h[2],c=1;l.indexOf("[")>-1&&(l=(i=l.split(/\[|]/))[0],c*=Number(i[1])),l.match(e)||(r[l]={value:n(u,c),name:l,type:u})}}return r}r.__esModule=!0,r.default=function(t,e,r){var n=i(t),s=i(e);return Object.assign(n,s)};var n=function(t){return t&&t.__esModule?t:{default:t}}(t("pixi-gl-core")).default.shader.defaultValue},{"pixi-gl-core":17}],86:[function(t,e,r){r.__esModule=!0,r.calculateScreenSpaceMatrix=function(t,e,r){var i=t.identity();return i.translate(e.x/r.width,e.y/r.height),i.scale(r.width,r.height),i},r.calculateNormalizedScreenSpaceMatrix=function(t,e,r){var i=t.identity();i.translate(e.x/r.width,e.y/r.height);var n=r.width/e.width,s=r.height/e.height;return i.scale(n,s),i},r.calculateSpriteMatrix=function(t,e,r,n){var s=n._texture.orig,o=t.set(r.width,0,0,r.height,e.x,e.y),a=n.worldTransform.copy(i.Matrix.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/s.width,1/s.height),o.translate(n.anchor.x,n.anchor.y),o};var i=t("../../../math")},{"../../../math":68}],87:[function(t,e,r){function i(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0;var n=i(t("../Filter")),s=t("../../../../math"),o=i((t("path"),t("../../../../textures/TextureMatrix"))),h=function(t){function e(r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=new s.Matrix,n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(void 0===e?"undefined":a(e))&&"function"!=typeof e?t:e}(this,t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n\n original *= (masky.r * masky.a * alpha * clip);\n\n gl_FragColor = original;\n}\n"));return r.renderable=!1,n.maskSprite=r,n.maskMatrix=i,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":a(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.apply=function(t,e,r,i){var n=this.maskSprite,s=this.maskSprite.texture;s.valid&&(s.transform||(s.transform=new o.default(s,0)),s.transform.update(),this.uniforms.mask=s,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,n).prepend(s.transform.mapCoord),this.uniforms.alpha=n.worldAlpha,this.uniforms.maskClamp=s.transform.uClampFrame,t.applyFilter(this,e,r,i))},e}(n.default);r.default=h},{"../../../../math":68,"../../../../textures/TextureMatrix":114,"../Filter":84,path:10}],88:[function(t,e,r){function i(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.__esModule=!0;var s=i(t("./WebGLManager")),o=i(t("../utils/RenderTarget")),h=i(t("../utils/Quad")),u=t("../../../math"),l=i(t("../../../Shader")),c=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(t("../filters/filterTransforms")),d=i(t("bit-twiddle")),f=function(){function t(){n(this,t),this.renderTarget=null,this.target=null,this.resolution=1,this.sourceFrame=new u.Rectangle,this.destinationFrame=new u.Rectangle,this.filters=[]}return t.prototype.clear=function(){this.filters=null,this.target=null,this.renderTarget=null},t}(),p=function(t){function e(r){n(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(void 0===e?"undefined":a(e))&&"function"!=typeof e?t:e}(this,t.call(this,r));return i.gl=i.renderer.gl,i.quad=new h.default(i.gl,r.state.attribState),i.shaderCache={},i.pool={},i.filterData=null,i.managedFilters=[],i.renderer.on("prerender",i.onPrerender,i),i._screenWidth=r.view.width,i._screenHeight=r.view.height,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":a(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.pushFilter=function(t,e){var r=this.renderer,i=this.filterData;if(!i){i=this.renderer._activeRenderTarget.filterStack;var n=new f;n.sourceFrame=n.destinationFrame=this.renderer._activeRenderTarget.size,n.renderTarget=r._activeRenderTarget,this.renderer._activeRenderTarget.filterData=i={index:0,stack:[n]},this.filterData=i}var s=i.stack[++i.index],o=i.stack[0].destinationFrame;s||(s=i.stack[i.index]=new f);var a=t.filterArea&&0===t.filterArea.x&&0===t.filterArea.y&&t.filterArea.width===r.screen.width&&t.filterArea.height===r.screen.height,h=e[0].resolution,u=0|e[0].padding,l=a?r.screen:t.filterArea||t.getBounds(!0),c=s.sourceFrame,d=s.destinationFrame;c.x=(l.x*h|0)/h,c.y=(l.y*h|0)/h,c.width=(l.width*h|0)/h,c.height=(l.height*h|0)/h,a||(i.stack[0].renderTarget.transform||e[0].autoFit&&c.fit(o),c.pad(u)),d.width=c.width,d.height=c.height;var p=this.getPotRenderTarget(r.gl,c.width,c.height,h);s.target=t,s.filters=e,s.resolution=h,s.renderTarget=p,p.setFrame(d,c),r.bindRenderTarget(p),p.clear()},e.prototype.popFilter=function(){var t=this.filterData,e=t.stack[t.index-1],r=t.stack[t.index];this.quad.map(r.renderTarget.size,r.sourceFrame).upload();var i=r.filters;if(1===i.length)i[0].apply(this,r.renderTarget,e.renderTarget,!1,r),this.freePotRenderTarget(r.renderTarget);else{var n=r.renderTarget,s=this.getPotRenderTarget(this.renderer.gl,r.sourceFrame.width,r.sourceFrame.height,r.resolution);s.setFrame(r.destinationFrame,r.sourceFrame),s.clear();var o=0;for(o=0;o0&&void 0!==arguments[0]&&arguments[0],e=this.renderer,r=this.managedFilters;e.off("prerender",this.onPrerender,this);for(var i=0;i0&&(e+="\nelse "),r1&&void 0!==arguments[1]?arguments[1]:[];return e[i.BLEND_MODES.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.ADD]=[t.ONE,t.DST_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.ADD_NPM]=[t.SRC_ALPHA,t.DST_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e};var i=t("../../../const")},{"../../../const":44}],97:[function(t,e,r){r.__esModule=!0,r.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e[i.DRAW_MODES.POINTS]=t.POINTS,e[i.DRAW_MODES.LINES]=t.LINES,e[i.DRAW_MODES.LINE_LOOP]=t.LINE_LOOP,e[i.DRAW_MODES.LINE_STRIP]=t.LINE_STRIP,e[i.DRAW_MODES.TRIANGLES]=t.TRIANGLES,e[i.DRAW_MODES.TRIANGLE_STRIP]=t.TRIANGLE_STRIP,e[i.DRAW_MODES.TRIANGLE_FAN]=t.TRIANGLE_FAN,e};var i=t("../../../const")},{"../../../const":44}],98:[function(t,e,r){r.__esModule=!0,r.default=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")}},{}],99:[function(t,e,r){function i(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0;var n=i(t("./utils/maxRecommendedTextures")),s=i(t("./utils/canUploadSameBuffer"));r.default={TARGET_FPMS:.06,MIPMAP_TEXTURES:!0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:(0,n.default)(32),SPRITE_BATCH_SIZE:4096,RETINA_PREFIX:/@([0-9\.]+)x/,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoResize:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,roundPixels:!1,width:800,height:600,legacy:!1},TRANSFORM_MODE:0,GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:0,SCALE_MODE:0,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:"mediump",CAN_UPLOAD_SAME_BUFFER:(0,s.default)(),MESH_CANVAS_PADDING:0}},{"./utils/canUploadSameBuffer":120,"./utils/maxRecommendedTextures":125}],100:[function(t,e,r){function i(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0;var n=function(){function t(t,e){for(var r=0;r=i&&c.x=n&&c.y>16)+(65280&t)+((255&t)<<16)}},{key:"texture",get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t||u.default.EMPTY,this.cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}]),e}(l.default);r.default=d},{"../const":44,"../display/Container":46,"../math":68,"../textures/Texture":113,"../utils":123}],101:[function(t,e,r){function i(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0;var n=i(t("../../renderers/canvas/CanvasRenderer")),s=t("../../const"),o=t("../../math"),a=i(t("./CanvasTinter")),h=new o.Matrix,u=function(){function t(e){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.renderer=e}return t.prototype.render=function(t){var e=t._texture,r=this.renderer,i=e._frame.width,n=e._frame.height,u=t.transform.worldTransform,l=0,c=0;if(!(e.orig.width<=0||e.orig.height<=0)&&e.baseTexture.source&&(r.setBlendMode(t.blendMode),e.valid)){r.context.globalAlpha=t.worldAlpha;var d=e.baseTexture.scaleMode===s.SCALE_MODES.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==d&&(r.context[r.smoothProperty]=d),e.trim?(l=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,c=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(l=(.5-t.anchor.x)*e.orig.width,c=(.5-t.anchor.y)*e.orig.height),e.rotate&&(u.copy(h),u=h,o.GroupD8.matrixAppendRotationInv(u,e.rotate,l,c),l=0,c=0),l-=i/2,c-=n/2,r.roundPixels?(r.context.setTransform(u.a,u.b,u.c,u.d,u.tx*r.resolution|0,u.ty*r.resolution|0),l|=0,c|=0):r.context.setTransform(u.a,u.b,u.c,u.d,u.tx*r.resolution,u.ty*r.resolution);var f=e.baseTexture.resolution;16777215!==t.tint?(t.cachedTint===t.tint&&t.tintedTexture.tintId===t._texture._updateID||(t.cachedTint=t.tint,t.tintedTexture=a.default.getTintedTexture(t,t.tint)),r.context.drawImage(t.tintedTexture,0,0,i*f,n*f,l*r.resolution,c*r.resolution,i*r.resolution,n*r.resolution)):r.context.drawImage(e.baseTexture.source,e._frame.x*f,e._frame.y*f,i*f,n*f,l*r.resolution,c*r.resolution,i*r.resolution,n*r.resolution)}},t.prototype.destroy=function(){this.renderer=null},t}();r.default=u,n.default.registerPlugin("sprite",u)},{"../../const":44,"../../math":68,"../../renderers/canvas/CanvasRenderer":75,"./CanvasTinter":102}],102:[function(t,e,r){r.__esModule=!0;var i=t("../../utils"),n={getTintedTexture:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=n.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var s=r.tintCache[i],o=void 0;if(s){if(s.tintId===r._updateID)return r.tintCache[i];o=r.tintCache[i]}else o=n.canvas||document.createElement("canvas");if(n.tintMethod(r,e,o),o.tintId=r._updateID,n.convertTintToImage){var a=new Image;a.src=o.toDataURL(),r.tintCache[i]=a}else r.tintCache[i]=o,n.canvas=null;return o},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),s=t.baseTexture.resolution;n.x*=s,n.y*=s,n.width*=s,n.height*=s,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),s=t.baseTexture.resolution;n.x*=s,n.y*=s,n.width*=s,n.height*=s,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var n=r.getContext("2d"),s=t._frame.clone(),o=t.baseTexture.resolution;s.x*=o,s.y*=o,s.width*=o,s.height*=o,r.width=Math.ceil(s.width),r.height=Math.ceil(s.height),n.save(),n.globalCompositeOperation="copy",n.drawImage(t.baseTexture.source,s.x,s.y,s.width,s.height,0,0,s.width,s.height),n.restore();for(var a=(0,i.hex2rgb)(e),h=a[0],u=a[1],l=a[2],c=n.getImageData(0,0,s.width,s.height),d=c.data,f=0;f=this.size&&this.flush(),t._texture._uvs&&(this.sprites[this.currentIndex++]=t)},e.prototype.flush=function(){if(0!==this.currentIndex){var t=this.renderer.gl,e=this.MAX_TEXTURES,r=p.default.nextPow2(this.currentIndex),i=p.default.log2(r),n=this.buffers[i],s=this.sprites,o=this.groups,a=n.float32View,h=n.uint32View,u=this.boundTextures,l=this.renderer.boundTextures,v=this.renderer.textureGC.count,y=0,_=void 0,x=void 0,T=1,b=0,E=o[0],w=void 0,S=void 0,I=d.premultiplyBlendMode[s[0]._texture.baseTexture.premultipliedAlpha?1:0][s[0].blendMode];E.textureCount=0,E.start=0,E.blend=I,g++;var R=void 0;for(R=0;R0&&(e+="\nelse "),r0&&(r.shadowColor=e.dropShadowColor);for(var p=Math.cos(e.dropShadowAngle)*e.dropShadowDistance,g=Math.sin(e.dropShadowAngle)*e.dropShadowDistance,m=0;m3&&void 0!==arguments[3]&&arguments[3],n=this._style.letterSpacing;if(0!==n)for(var s=String.prototype.split.call(t,""),o=e,a=0,h="";a3&&void 0!==arguments[3]?arguments[3]:t._canvas;i=void 0===i||null===i?r.wordWrap:i;var s=r.toFontString(),o=t.measureFont(s),a=n.getContext("2d");a.font=s;for(var h=(i?t.wordWrap(e,r,n):e).split(/(?:\r\n|\r|\n)/),u=new Array(h.length),l=0,c=0;c2&&void 0!==arguments[2]?arguments[2]:t._canvas).getContext("2d"),n=0,s="",o="",a={},h=r.letterSpacing,u=r.whiteSpace,l=t.collapseSpaces(u),c=t.collapseNewlines(u),d=!l,f=r.wordWrapWidth+h,p=t.tokenize(e),g=0;gf)if(""!==s&&(o+=t.addLine(s),s="",n=0),t.canBreakWords(m,r.breakWords))for(var x=m.split(""),T=0;Tf&&(o+=t.addLine(s),d=!1,s="",n=0),s+=b,n+=I}else{s.length>0&&(o+=t.addLine(s),s="",n=0);var R=g===p.length-1;o+=t.addLine(m,!R),d=!1,s="",n=0}else _+n>f&&(d=!1,o+=t.addLine(s),s="",n=0),(s.length>0||!t.isBreakingSpace(m)||d)&&(s+=m,n+=_)}return o+t.addLine(s,!1)},t.addLine=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=t.trimRight(e),r?e+"\n":e},t.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var s=t.length*e;n=i.measureText(t).width+s,r[t]=n}return n},t.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},t.collapseNewlines=function(t){return"normal"===t},t.trimRight=function(e){if("string"!=typeof e)return"";for(var r=e.length-1;r>=0;r--){var i=e[r];if(!t.isBreakingSpace(i))break;e=e.slice(0,-1)}return e},t.isNewline=function(e){return"string"==typeof e&&t._newlines.indexOf(e.charCodeAt(0))>=0},t.isBreakingSpace=function(e){return"string"==typeof e&&t._breakingSpaces.indexOf(e.charCodeAt(0))>=0},t.tokenize=function(e){var r=[],i="";if("string"!=typeof e)return r;for(var n=0;na;--d){for(var m=0;m0&&void 0!==arguments[0]?arguments[0]:"";e?delete t._fonts[e]:t._fonts={}},t}();r.default=i;var n=document.createElement("canvas");n.width=n.height=10,i._canvas=n,i._context=n.getContext("2d"),i._fonts={},i.METRICS_STRING="|Éq",i.BASELINE_SYMBOL="M",i.BASELINE_MULTIPLIER=1.4,i._newlines=[10,13],i._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},{}],108:[function(t,e,r){function i(t){return"number"==typeof t?(0,h.hex2string)(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function n(t){if(Array.isArray(t)){for(var e=0;e=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&l.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},o(t,[{key:"align",get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)}},{key:"breakWords",get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}},{key:"dropShadow",get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}},{key:"dropShadowAlpha",get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}},{key:"dropShadowAngle",get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}},{key:"dropShadowBlur",get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}},{key:"dropShadowColor",get:function(){return this._dropShadowColor},set:function(t){var e=n(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)}},{key:"dropShadowDistance",get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}},{key:"fill",get:function(){return this._fill},set:function(t){var e=n(t);this._fill!==e&&(this._fill=e,this.styleID++)}},{key:"fillGradientType",get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}},{key:"fillGradientStops",get:function(){return this._fillGradientStops},set:function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:100,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments[2],o=arguments[3];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var h=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(void 0===e?"undefined":a(e))&&"function"!=typeof e?t:e}(this,t.call(this,null,n));return h.resolution=o||s.default.RESOLUTION,h.width=Math.ceil(r),h.height=Math.ceil(i),h.realWidth=h.width*h.resolution,h.realHeight=h.height*h.resolution,h.scaleMode=void 0!==n?n:s.default.SCALE_MODE,h.hasLoaded=!0,h._glRenderTargets={},h._canvasRenderTarget=null,h.valid=!1,h}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":a(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.resize=function(t,e){t=Math.ceil(t),e=Math.ceil(e),t===this.width&&e===this.height||(this.valid=t>0&&e>0,this.width=t,this.height=e,this.realWidth=this.width*this.resolution,this.realHeight=this.height*this.resolution,this.valid&&this.emit("update",this))},e.prototype.destroy=function(){t.prototype.destroy.call(this,!0),this.renderer=null},e}(n.default);r.default=o},{"../settings":99,"./BaseTexture":110}],110:[function(t,e,r){function i(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0;var n=t("../utils"),s=i(t("../settings")),o=i(t("eventemitter3")),h=i(t("../utils/determineCrossOrigin")),u=i(t("bit-twiddle")),l=function(t){function e(r,i,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var h=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(void 0===e?"undefined":a(e))&&"function"!=typeof e?t:e}(this,t.call(this));return h.uid=(0,n.uid)(),h.touched=0,h.resolution=o||s.default.RESOLUTION,h.width=100,h.height=100,h.realWidth=100,h.realHeight=100,h.scaleMode=void 0!==i?i:s.default.SCALE_MODE,h.hasLoaded=!1,h.isLoading=!1,h.source=null,h.origSource=null,h.imageType=null,h.sourceScale=1,h.premultipliedAlpha=!0,h.imageUrl=null,h.isPowerOfTwo=!1,h.mipmap=s.default.MIPMAP_TEXTURES,h.wrapMode=s.default.WRAP_MODE,h._glTextures={},h._enabled=0,h._virtalBoundId=-1,h._destroyed=!1,h.textureCacheIds=[],r&&h.loadSource(r),h}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":a(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.update=function(){"svg"!==this.imageType&&(this.realWidth=this.source.naturalWidth||this.source.videoWidth||this.source.width,this.realHeight=this.source.naturalHeight||this.source.videoHeight||this.source.height,this._updateDimensions()),this.emit("update",this)},e.prototype._updateDimensions=function(){this.width=this.realWidth/this.resolution,this.height=this.realHeight/this.resolution,this.isPowerOfTwo=u.default.isPow2(this.realWidth)&&u.default.isPow2(this.realHeight)},e.prototype.loadSource=function(t){var e=this.isLoading;this.hasLoaded=!1,this.isLoading=!1,e&&this.source&&(this.source.onload=null,this.source.onerror=null);var r=!this.source;if(this.source=t,(t.src&&t.complete||t.getContext)&&t.width&&t.height)this._updateImageType(),"svg"===this.imageType?this._loadSvgSource():this._sourceLoaded(),r&&this.emit("loaded",this);else if(!t.getContext){this.isLoading=!0;var i=this;if(t.onload=function(){if(i._updateImageType(),t.onload=null,t.onerror=null,i.isLoading){if(i.isLoading=!1,i._sourceLoaded(),"svg"===i.imageType)return void i._loadSvgSource();i.emit("loaded",i)}},t.onerror=function(){t.onload=null,t.onerror=null,i.isLoading&&(i.isLoading=!1,i.emit("error",i))},t.complete&&t.src){if(t.onload=null,t.onerror=null,"svg"===i.imageType)return void i._loadSvgSource();this.isLoading=!1,t.width&&t.height?(this._sourceLoaded(),e&&this.emit("loaded",this)):e&&this.emit("error",this)}}},e.prototype._updateImageType=function(){if(this.imageUrl){var t=(0,n.decomposeDataUri)(this.imageUrl),e=void 0;if(t&&"image"===t.mediaType){var r=t.subType.split("+")[0];if(!(e=(0,n.getUrlFileExtension)("."+r)))throw new Error("Invalid image type in data URI.")}else(e=(0,n.getUrlFileExtension)(this.imageUrl))||(e="png");this.imageType=e}},e.prototype._loadSvgSource=function(){if("svg"===this.imageType){var t=(0,n.decomposeDataUri)(this.imageUrl);t?this._loadSvgSourceUsingDataUri(t):this._loadSvgSourceUsingXhr()}},e.prototype._loadSvgSourceUsingDataUri=function(t){var e=void 0;if("base64"===t.encoding){if(!atob)throw new Error("Your browser doesn't support base64 conversions.");e=atob(t.data)}else e=t.data;this._loadSvgSourceUsingString(e)},e.prototype._loadSvgSourceUsingXhr=function(){var t=this,e=new XMLHttpRequest;e.onload=function(){if(e.readyState!==e.DONE||200!==e.status)throw new Error("Failed to load SVG using XHR.");t._loadSvgSourceUsingString(e.response)},e.onerror=function(){return t.emit("error",t)},e.open("GET",this.imageUrl,!0),e.send()},e.prototype._loadSvgSourceUsingString=function(t){var r=(0,n.getSvgSize)(t),i=r.width,s=r.height;if(!i||!s)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");this.realWidth=Math.round(i*this.sourceScale),this.realHeight=Math.round(s*this.sourceScale),this._updateDimensions();var o=document.createElement("canvas");o.width=this.realWidth,o.height=this.realHeight,o._pixiId="canvas_"+(0,n.uid)(),o.getContext("2d").drawImage(this.source,0,0,i,s,0,0,this.realWidth,this.realHeight),this.origSource=this.source,this.source=o,e.addToCache(this,o._pixiId),this.isLoading=!1,this._sourceLoaded(),this.emit("loaded",this)},e.prototype._sourceLoaded=function(){this.hasLoaded=!0,this.update()},e.prototype.destroy=function(){this.imageUrl&&(delete n.TextureCache[this.imageUrl],this.imageUrl=null,navigator.isCocoonJS||(this.source.src="")),this.source=null,this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this._destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.updateSourceImage=function(t){this.source.src=t,this.loadSource(this.source)},e.fromImage=function(t,r,i,s){var o=n.BaseTextureCache[t];if(!o){var a=new Image;void 0===r&&0!==t.indexOf("data:")?a.crossOrigin=(0,h.default)(t):r&&(a.crossOrigin="string"==typeof r?r:"anonymous"),(o=new e(a,i)).imageUrl=t,s&&(o.sourceScale=s),o.resolution=(0,n.getResolutionOfUrl)(t),a.src=t,e.addToCache(o,t)}return o},e.fromCanvas=function(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"canvas";t._pixiId||(t._pixiId=i+"_"+(0,n.uid)());var s=n.BaseTextureCache[t._pixiId];return s||(s=new e(t,r),e.addToCache(s,t._pixiId)),s},e.from=function(t,r,i){if("string"==typeof t)return e.fromImage(t,void 0,r,i);if(t instanceof HTMLImageElement){var s=t.src,o=n.BaseTextureCache[s];return o||((o=new e(t,r)).imageUrl=s,i&&(o.sourceScale=i),o.resolution=(0,n.getResolutionOfUrl)(s),e.addToCache(o,s)),o}return t instanceof HTMLCanvasElement?e.fromCanvas(t,r):t},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),n.BaseTextureCache[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=n.BaseTextureCache[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete n.BaseTextureCache[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r||this.baseTexture.resize(t,e),this._updateUvs()},e.create=function(t,r,i,s){return new e(new n.default(t,r,i,s))},e}(i(t("./Texture")).default);r.default=s},{"./BaseRenderTexture":109,"./Texture":113}],112:[function(t,e,r){r.__esModule=!0;var i=function(){function t(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:null;(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.baseTexture=e,this.textures={},this.animations={},this.data=r,this.resolution=this._updateResolution(i||this.baseTexture.imageUrl),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return i(t,null,[{key:"BATCH_SIZE",get:function(){return 1e3}}]),t.prototype._updateResolution=function(t){var e=this.data.meta.scale,r=(0,s.getResolutionOfUrl)(t,null);return null===r&&(r=void 0!==e?parseFloat(e):1),1!==r&&(this.baseTexture.resolution=r,this.baseTexture.update()),r},t.prototype.parse=function(e){this._batchIndex=0,this._callback=e,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()},t.prototype._processFrames=function(e){for(var r=e,i=t.BATCH_SIZE,s=this.baseTexture.sourceScale;r-e=r.length)break;s=r[n++]}else{if((n=r.next()).done)break;s=n.value}var o=s;this.animations[e].push(this.textures[o])}}},t.prototype._parseComplete=function(){var t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)},t.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout(function(){e._batchIndex*t.BATCH_SIZE0&&void 0!==arguments[0]&&arguments[0];for(var e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&this.baseTexture.destroy(),this.baseTexture=null},t}();r.default=o},{"../":63,"../utils":123}],113:[function(t,e,r){function i(t){return t&&t.__esModule?t:{default:t}}function n(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}r.__esModule=!0;var s=function(){function t(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"canvas";return new e(o.default.fromCanvas(t,r,i))},e.fromVideo=function(t,r,i,n){return"string"==typeof t?e.fromVideoUrl(t,r,i,n):new e(h.default.fromVideo(t,r,n))},e.fromVideoUrl=function(t,r,i,n){return new e(h.default.fromUrl(t,r,i,n))},e.from=function(t){if("string"==typeof t){var r=d.TextureCache[t];return r||(null!==t.match(/\.(mp4|webm|ogg|h264|avi|mov)$/)?e.fromVideoUrl(t):e.fromImage(t))}return t instanceof HTMLImageElement?new e(o.default.from(t)):t instanceof HTMLCanvasElement?e.fromCanvas(t,f.default.SCALE_MODE,"HTMLCanvasElement"):t instanceof HTMLVideoElement?e.fromVideo(t):t instanceof o.default?new e(t):t},e.fromLoader=function(t,r,i){var n=new o.default(t,void 0,(0,d.getResolutionOfUrl)(r)),s=new e(n);return n.imageUrl=r,i||(i=r),o.default.addToCache(s.baseTexture,i),e.addToCache(s,i),i!==r&&(o.default.addToCache(s.baseTexture,r),e.addToCache(s,r)),s},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),d.TextureCache[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=d.TextureCache[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete d.TextureCache[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,o=r+n>this.baseTexture.height;if(s||o){var a=s&&o?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.hasLoaded,this.trim||this.rotate||(this.orig=t),this.valid&&this._updateUvs()}},{key:"rotate",get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this._updateUvs()}},{key:"width",get:function(){return this.orig.width}},{key:"height",get:function(){return this.orig.height}}]),e}(l.default);r.default=p,p.EMPTY=new p(new o.default),n(p.EMPTY),n(p.EMPTY.baseTexture),p.WHITE=function(){var t=document.createElement("canvas");t.width=10,t.height=10;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,10,10),new p(new o.default(t))}(),n(p.WHITE),n(p.WHITE.baseTexture)},{"../math":68,"../settings":99,"../utils":123,"./BaseTexture":110,"./TextureUvs":115,"./VideoBaseTexture":116,eventemitter3:5}],114:[function(t,e,r){r.__esModule=!0;var i=function(){function t(t,e){for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),!r)throw new Error("No video source element specified.");(r.readyState===r.HAVE_ENOUGH_DATA||r.readyState===r.HAVE_FUTURE_DATA)&&r.width&&r.height&&(r.complete=!0);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(void 0===e?"undefined":a(e))&&"function"!=typeof e?t:e}(this,t.call(this,r,i));return s.width=r.videoWidth,s.height=r.videoHeight,s._autoUpdate=!0,s._isAutoUpdating=!1,s.autoPlay=n,s.update=s.update.bind(s),s._onCanPlay=s._onCanPlay.bind(s),r.addEventListener("play",s._onPlayStart.bind(s)),r.addEventListener("pause",s._onPlayStop.bind(s)),s.hasLoaded=!1,s.__loaded=!1,s._isSourceReady()?s._onCanPlay():(r.addEventListener("canplay",s._onCanPlay),r.addEventListener("canplaythrough",s._onCanPlay)),s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":a(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._isSourcePlaying=function(){var t=this.source;return t.currentTime>0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.hasLoaded||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(u.shared.add(this.update,this,l.UPDATE_PRIORITY.HIGH),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(u.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.__loaded||(this.__loaded=!0,this.emit("loaded",this)),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.source.play())},e.prototype.destroy=function(){this._isAutoUpdating&&u.shared.remove(this.update,this),this.source&&this.source._pixiId&&(o.default.removeFromCache(this.source._pixiId),delete this.source._pixiId,this.source.pause(),this.source.src="",this.source.load()),t.prototype.destroy.call(this)},e.fromVideo=function(t,r,i){t._pixiId||(t._pixiId="video_"+(0,h.uid)());var n=h.BaseTextureCache[t._pixiId];return n||(n=new e(t,r,i),o.default.addToCache(n,t._pixiId)),n},e.fromUrl=function(t,r,i,s){var o=document.createElement("video");o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline","");var a=Array.isArray(t)?t[0].src||t[0]:t.src||t;if(void 0===i&&0!==a.indexOf("data:")?o.crossOrigin=(0,c.default)(a):i&&(o.crossOrigin="string"==typeof i?i:"anonymous"),Array.isArray(t))for(var h=0;h2&&void 0!==arguments[2]?arguments[2]:o.UPDATE_PRIORITY.NORMAL;return this._addListener(new a.default(t,e,r))},t.prototype.addOnce=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.UPDATE_PRIORITY.NORMAL;return this._addListener(new a.default(t,e,r,!0))},t.prototype._addListener=function(t){var e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},t.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},t.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},t.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},t.prototype.destroy=function(){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null},t.prototype.update=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:performance.now(),e=void 0;if(t>this.lastTime){(e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*s.default.TARGET_FPMS*this.speed;for(var r=this._head,i=r.next;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.elapsedMS=0;this.lastTime=t},n(t,[{key:"FPS",get:function(){return 1e3/this.elapsedMS}},{key:"minFPS",get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(Math.max(0,t)/1e3,s.default.TARGET_FPMS);this._maxElapsedMS=1/e}}]),t}();r.default=h},{"../const":44,"../settings":99,"./TickerListener":118}],118:[function(t,e,r){r.__esModule=!0;var i=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.fn=e,this.context=r,this.priority=i,this.once=n,this.next=null,this.previous=null,this._destroyed=!1}return t.prototype.match=function(t,e){return e=e||null,this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}();r.default=i},{}],119:[function(t,e,r){r.__esModule=!0,r.Ticker=r.shared=void 0;var i=function(t){return t&&t.__esModule?t:{default:t}}(t("./Ticker")),n=new i.default;n.autoStart=!0,n.destroy=function(){},r.shared=n,r.Ticker=i.default},{"./Ticker":117}],120:[function(t,e,r){r.__esModule=!0,r.default=function(){return!(navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform))}},{}],121:[function(t,e,r){r.__esModule=!0,r.default=function(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i1&&void 0!==arguments[1]?arguments[1]:window.location;if(0===t.indexOf("data:"))return"";e=e||window.location,n||(n=document.createElement("a")),n.href=t;var r=!(t=i.default.parse(n.href)).port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"};var i=function(t){return t&&t.__esModule?t:{default:t}}(t("url")),n=void 0},{url:39}],123:[function(t,e,r){function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function n(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0,r.premultiplyBlendMode=r.BaseTextureCache=r.TextureCache=r.earcut=r.mixins=r.pluginTarget=r.EventEmitter=r.removeItems=r.isMobile=void 0,r.uid=function(){return++p},r.hex2rgb=function(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},r.hex2string=function(t){return t=t.toString(16),"#"+("000000".substr(0,6-t.length)+t)},r.rgb2hex=function(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},r.getResolutionOfUrl=function(t,e){var r=o.default.RETINA_PREFIX.exec(t);return r?parseFloat(r[1]):void 0!==e?e:1},r.decomposeDataUri=function(t){var e=s.DATA_URI.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,charset:e[3]?e[3].toLowerCase():void 0,encoding:e[4]?e[4].toLowerCase():void 0,data:e[5]}},r.getUrlFileExtension=function(t){var e=s.URL_FILE_EXTENSION.exec(t);if(e)return e[1].toLowerCase()},r.getSvgSize=function(t){var e=s.SVG_SIZE.exec(t),r={};return e&&(r[e[1]]=Math.round(parseFloat(e[3])),r[e[5]]=Math.round(parseFloat(e[7]))),r},r.skipHello=function(){!0},r.sayHello=function(t){},r.isWebGLSupported=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}},r.sign=function(t){return 0===t?0:t<0?-1:1},r.destroyTextureCache=function(){var t=void 0;for(t in g)g[t].destroy();for(t in m)m[t].destroy()},r.clearTextureCache=function(){var t=void 0;for(t in g)delete g[t];for(t in m)delete m[t]},r.correctBlendMode=function(t,e){return v[e?1:0][t]},r.premultiplyTint=function(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)},r.premultiplyRgba=function(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r},r.premultiplyTintToRgba=function(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r};var s=t("../const"),o=n(t("../settings")),a=n(t("eventemitter3")),h=n(t("./pluginTarget")),u=i(t("./mixin")),l=i(t("ismobilejs")),c=n(t("remove-array-items")),d=n(t("./mapPremultipliedBlendModes")),f=n(t("earcut")),p=0;r.isMobile=l,r.removeItems=c.default,r.EventEmitter=a.default,r.pluginTarget=h.default,r.mixins=u,r.earcut=f.default;var g=r.TextureCache=Object.create(null),m=r.BaseTextureCache=Object.create(null),v=r.premultiplyBlendMode=(0,d.default)()},{"../const":44,"../settings":99,"./mapPremultipliedBlendModes":124,"./mixin":126,"./pluginTarget":127,earcut:4,eventemitter3:5,ismobilejs:6,"remove-array-items":32}],124:[function(t,e,r){r.__esModule=!0,r.default=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[i.BLEND_MODES.NORMAL_NPM]=i.BLEND_MODES.NORMAL,t[i.BLEND_MODES.ADD_NPM]=i.BLEND_MODES.ADD,t[i.BLEND_MODES.SCREEN_NPM]=i.BLEND_MODES.SCREEN,e[i.BLEND_MODES.NORMAL]=i.BLEND_MODES.NORMAL_NPM,e[i.BLEND_MODES.ADD]=i.BLEND_MODES.ADD_NPM,e[i.BLEND_MODES.SCREEN]=i.BLEND_MODES.SCREEN_NPM;var n=[];return n.push(e),n.push(t),n};var i=t("../const")},{"../const":44}],125:[function(t,e,r){r.__esModule=!0,r.default=function(t){return i.default.tablet||i.default.phone?4:t};var i=function(t){return t&&t.__esModule?t:{default:t}}(t("ismobilejs"))},{ismobilejs:6}],126:[function(t,e,r){function i(t,e){if(t&&e)for(var r=Object.keys(e),i=0;i1?this._fontStyle="italic":t.indexOf("oblique")>-1?this._fontStyle="oblique":this._fontStyle="normal",t.indexOf("small-caps")>-1?this._fontVariant="small-caps":this._fontVariant="normal";var e=t.split(" "),r=-1;this._fontSize=26;for(var n=0;n-1&&r0?1:-1})},{}],139:[function(t,e,r){Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t})},{}],140:[function(t,e,r){var i=function(t){return t&&t.__esModule?t:{default:t}}(t("object-assign"));Object.assign||(Object.assign=i.default)},{"object-assign":8}],141:[function(t,e,r){t("./Object.assign"),t("./requestAnimationFrame"),t("./Math.sign"),t("./Number.isInteger"),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array)},{"./Math.sign":138,"./Number.isInteger":139,"./Object.assign":140,"./requestAnimationFrame":142}],142:[function(t,e,i){(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var r=Date.now(),i=["ms","moz","webkit","o"],n=0;n=0;i--)this.add(t.children[i]);return this},t.prototype.destroy=function(){this.ticking&&d.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},t}();r.default=f},{"../core":63,"./limiters/CountLimiter":146}],144:[function(t,e,r){function i(t,e){if(e instanceof n.BaseTexture){var r=e.source,i=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),s=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,i,s,0,0,t.canvas.width,t.canvas.height),!0}return!1}r.__esModule=!0;var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(t("../../core")),s=16,o=function(t){function e(r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(void 0===e?"undefined":a(e))&&"function"!=typeof e?t:e}(this,t.call(this,r));return n.uploadHookHelper=n,n.canvas=document.createElement("canvas"),n.canvas.width=s,n.canvas.height=s,n.ctx=n.canvas.getContext("2d"),n.registerUploadHook(i),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":a(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(function(t){return t&&t.__esModule?t:{default:t}}(t("../BasePrepare")).default);r.default=o,n.CanvasRenderer.registerPlugin("prepare",o)},{"../../core":63,"../BasePrepare":143}],145:[function(t,e,r){function i(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0;var n=t("./webgl/WebGLPrepare");Object.defineProperty(r,"webgl",{enumerable:!0,get:function(){return i(n).default}});var s=t("./canvas/CanvasPrepare");Object.defineProperty(r,"canvas",{enumerable:!0,get:function(){return i(s).default}});var o=t("./BasePrepare");Object.defineProperty(r,"BasePrepare",{enumerable:!0,get:function(){return i(o).default}});var a=t("./limiters/CountLimiter");Object.defineProperty(r,"CountLimiter",{enumerable:!0,get:function(){return i(a).default}});var h=t("./limiters/TimeLimiter");Object.defineProperty(r,"TimeLimiter",{enumerable:!0,get:function(){return i(h).default}})},{"./BasePrepare":143,"./canvas/CanvasPrepare":144,"./limiters/CountLimiter":146,"./limiters/TimeLimiter":147,"./webgl/WebGLPrepare":148}],146:[function(t,e,r){r.__esModule=!0;var i=function(){function t(e){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.maxItemsPerFrame=e,this.itemsLeft=0}return t.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},t.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},t}();r.default=i},{}],147:[function(t,e,r){r.__esModule=!0;var i=function(){function t(e){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.maxMilliseconds=e,this.frameStart=0}return t.prototype.beginFrame=function(){this.frameStart=Date.now()},t.prototype.allowedToUpload=function(){return Date.now()-this.frameStartwindow.btoa(unescape(encodeURIComponent(t)))),e.b64decode=(t=>decodeURIComponent(escape(window.atob(t)))),e.extractHostname=((t="")=>{let e;return e=(e=(e=t.indexOf("//")>-1?t.split("/")[2]||"":t.split("/")[0]||"").split(":")[0]).split("?")[0]})},function(t,e,r){var i; /*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */ /*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */ !function(n,s,o,a){"use strict";var h,u=["","webkit","Moz","MS","ms","o"],l=s.createElement("div"),c="function",d=Math.round,f=Math.abs,p=Date.now;function g(t,e,r){return setTimeout(b(t,r),e)}function m(t,e,r){return!!Array.isArray(t)&&(v(t,r[e],r),!0)}function v(t,e,r){var i;if(t)if(t.forEach)t.forEach(e,r);else if(t.length!==a)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=n.console&&(n.console.warn||n.console.log);return s&&s.call(n.console,i,r),t.apply(this,arguments)}}h="function"!=typeof Object.assign?function(t){if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),r=1;r-1}function M(t){return t.trim().split(/\s+/g)}function A(t,e,r){if(t.indexOf&&!r)return t.indexOf(e);for(var i=0;ir[e]}):i.sort()),i}function L(t,e){for(var r,i,n=e[0].toUpperCase()+e.slice(1),s=0;s1&&!r.firstMultiple?r.firstMultiple=rt(e):1===n&&(r.firstMultiple=!1);var s=r.firstInput,o=r.firstMultiple,h=o?o.center:s.center,u=e.center=it(i);e.timeStamp=p(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=at(h,u),e.distance=ot(h,u),function(t,e){var r=e.center,i=t.offsetDelta||{},n=t.prevDelta||{},s=t.prevInput||{};e.eventType!==j&&s.eventType!==G||(n=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},i=t.offsetDelta={x:r.x,y:r.y});e.deltaX=n.x+(r.x-i.x),e.deltaY=n.y+(r.y-i.y)}(r,e),e.offsetDirection=st(e.deltaX,e.deltaY);var l=nt(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=l.x,e.overallVelocityY=l.y,e.overallVelocity=f(l.x)>f(l.y)?l.x:l.y,e.scale=o?function(t,e){return ot(e[0],e[1],Q)/ot(t[0],t[1],Q)}(o.pointers,i):1,e.rotation=o?function(t,e){return at(e[1],e[0],Q)+at(t[1],t[0],Q)}(o.pointers,i):0,e.maxPointers=r.prevInput?e.pointers.length>r.prevInput.maxPointers?e.pointers.length:r.prevInput.maxPointers:e.pointers.length,function(t,e){var r,i,n,s,o=t.lastInterval||e,h=e.timeStamp-o.timeStamp;if(e.eventType!=H&&(h>U||o.velocity===a)){var u=e.deltaX-o.deltaX,l=e.deltaY-o.deltaY,c=nt(h,u,l);i=c.x,n=c.y,r=f(c.x)>f(c.y)?c.x:c.y,s=st(u,l),t.lastInterval=e}else r=o.velocity,i=o.velocityX,n=o.velocityY,s=o.direction;e.velocity=r,e.velocityX=i,e.velocityY=n,e.direction=s}(r,e);var c=t.element;R(e.srcEvent.target,c)&&(c=e.srcEvent.target);e.target=c}(t,r),t.emit("hammer.input",r),t.recognize(r),t.session.prevInput=r}function rt(t){for(var e=[],r=0;r=f(e)?t<0?Y:z:e<0?V:q}function ot(t,e,r){r||(r=$);var i=e[r[0]]-t[r[0]],n=e[r[1]]-t[r[1]];return Math.sqrt(i*i+n*n)}function at(t,e,r){r||(r=$);var i=e[r[0]]-t[r[0]],n=e[r[1]]-t[r[1]];return 180*Math.atan2(n,i)/Math.PI}tt.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&I(this.element,this.evEl,this.domHandler),this.evTarget&&I(this.target,this.evTarget,this.domHandler),this.evWin&&I(N(this.element),this.evWin,this.domHandler)}};var ht={mousedown:j,mousemove:X,mouseup:G},ut="mousedown",lt="mousemove mouseup";function ct(){this.evEl=ut,this.evWin=lt,this.pressed=!1,tt.apply(this,arguments)}T(ct,tt,{handler:function(t){var e=ht[t.type];e&j&&0===t.button&&(this.pressed=!0),e&X&&1!==t.which&&(e=G),this.pressed&&(e&G&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var dt={pointerdown:j,pointermove:X,pointerup:G,pointercancel:H,pointerout:H},ft={2:"touch",3:"pen",4:"mouse",5:"kinect"},pt="pointerdown",gt="pointermove pointerup pointercancel";function mt(){this.evEl=pt,this.evWin=gt,tt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}n.MSPointerEvent&&!n.PointerEvent&&(pt="MSPointerDown",gt="MSPointerMove MSPointerUp MSPointerCancel"),T(mt,tt,{handler:function(t){var e=this.store,r=!1,i=t.type.toLowerCase().replace("ms",""),n=dt[i],s=ft[t.pointerType]||t.pointerType,o="touch"==s,a=A(e,t.pointerId,"pointerId");n&j&&(0===t.button||o)?a<0&&(e.push(t),a=e.length-1):n&(G|H)&&(r=!0),a<0||(e[a]=t,this.callback(this.manager,n,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),r&&e.splice(a,1))}});var vt={touchstart:j,touchmove:X,touchend:G,touchcancel:H},yt="touchstart",_t="touchstart touchmove touchend touchcancel";function xt(){this.evTarget=yt,this.evWin=_t,this.started=!1,tt.apply(this,arguments)}T(xt,tt,{handler:function(t){var e=vt[t.type];if(e===j&&(this.started=!0),this.started){var r=function(t,e){var r=P(t.touches),i=P(t.changedTouches);e&(G|H)&&(r=C(r.concat(i),"identifier",!0));return[r,i]}.call(this,t,e);e&(G|H)&&r[0].length-r[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:r[0],changedPointers:r[1],pointerType:"touch",srcEvent:t})}}});var Tt={touchstart:j,touchmove:X,touchend:G,touchcancel:H},bt="touchstart touchmove touchend touchcancel";function Et(){this.evTarget=bt,this.targetIds={},tt.apply(this,arguments)}T(Et,tt,{handler:function(t){var e=Tt[t.type],r=function(t,e){var r=P(t.touches),i=this.targetIds;if(e&(j|X)&&1===r.length)return i[r[0].identifier]=!0,[r,r];var n,s,o=P(t.changedTouches),a=[],h=this.target;if(s=r.filter(function(t){return R(t.target,h)}),e===j)for(n=0;n-1&&i.splice(t,1)},wt)}}T(It,tt,{handler:function(t,e,r){var i="touch"==r.pointerType,n="mouse"==r.pointerType;if(!(n&&r.sourceCapabilities&&r.sourceCapabilities.firesTouchEvents)){if(i)(function(t,e){t&j?(this.primaryTouch=e.changedPointers[0].identifier,Rt.call(this,e)):t&(G|H)&&Rt.call(this,e)}).call(this,e,r);else if(n&&function(t){for(var e=t.srcEvent.clientX,r=t.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,r=this.state;function i(r){e.manager.emit(r,t)}r=jt&&i(e.options.event+Wt(r))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;te.threshold&&n&e.direction},attrTest:function(t){return Vt.prototype.attrTest.call(this,t)&&(this.state&Ft||!(this.state&Ft)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Yt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),T(Zt,Vt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ct]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&Ft)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),T(Kt,Ht,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[At]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,i=t.distancee.time;if(this._input=t,!i||!r||t.eventType&(G|H)&&!n)this.reset();else if(t.eventType&j)this.reset(),this._timer=g(function(){this.state=Xt,this.tryEmit()},e.time,this);else if(t.eventType&G)return Xt;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===Xt&&(t&&t.eventType&G?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),T(Jt,Vt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ct]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&Ft)}}),T($t,Vt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Z|K,pointers:1},getTouchAction:function(){return qt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,r=this.options.direction;return r&(Z|K)?e=t.overallVelocity:r&Z?e=t.overallVelocityX:r&K&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&r&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&f(e)>this.options.velocity&&t.eventType&G},emit:function(t){var e=Yt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),T(Qt,Ht,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Pt]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,i=t.distance{window.clearTimeout(this.tapTimer),this.tapTimer=null,this.lastTapTimestamp=e,this.eventDispatcherElement.dispatchEvent(new CustomEvent(i.INTERACTION_SINGLE_TAP,{detail:{hammerEvent:t}}))},200)}downListener(t){this.eventDispatcherElement.dispatchEvent(new CustomEvent(i.INTERACTION_STARTS))}swipeListener(t){this.lastSwipeEventTimestamp=t.timeStamp,this.eventDispatcherElement.dispatchEvent(new CustomEvent(i.INTERACTION_SWIPE_END,{detail:{dx:t.deltaX>0?1:-1,velocity:t.overallVelocity}}))}panListener(t){this.eventDispatcherElement.dispatchEvent(new CustomEvent(i.INTERACTION_PAN_DELTAS,{detail:{dx:t.deltaX,originalEvent:t}}))}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),n=r(2),s=r(1),o="LOADER_INITIALIMAGES",a={360:"images360",750:"images750",1080:"images1080",1500:"images1500",original:"imagesOriginal"};var h;!function(t){t.LOADER_STATUS_LOADED="loaded",t.LOADER_STATUS_CREATED="created",t.LOADER_STATUS_PROGRESS="progress"}(h||(h={}));e.PixiPlayerEngine=class{constructor(t,e,r,i){n.info("Initializing player engine with this user options: "+JSON.stringify(i));const s=Object.assign({},i);this.devicePixelRatio=s.devicePixelRatio||window.devicePixelRatio||1;const a=""===location.hostname;this.crossOrigin=!a||"",r||(r={images:{maxWidth:360,ratio:1}}),this.maxAvailableTextureWidth=r.images.maxWidth,this.textureAspectRatio=r.images.ratio,this.targetElement=t,this.eventDispatcherElement=e,this.loadersList={},this.loadersStatusesList={},this.loader=new PIXIM.loaders.Loader,this.loadersList[o]=this.loader,this.targetWidth=this.targetElement.clientWidth,this.targetHeight=this.targetElement.clientHeight,this.addedImagesList=[],this.imagesList=[],this.currentNeededTextureFolder=this.getDesiredTextureWidthFolder(this.targetWidth,this.targetHeight),this.initialTextureFolder=this.currentNeededTextureFolder,PIXIM.settings.SCALE_MODE=PIXIM.SCALE_MODES.LINEAR,PIXIM.settings.RESOLUTION=this.devicePixelRatio;let h={transparent:!0,autoStart:!1,autoResize:!1,antialias:!0,resolution:this.devicePixelRatio||1,roundPixels:!0,width:this.targetWidth,height:this.targetHeight,forceCanvas:!!s.forceCanvas&&s.forceCanvas};this.app=new PIXIM.Application(h),this.app.stop(),this.preloaderCurrentImageIndex=0,this.PIXIMSprite=new PIXIM.Sprite,this.PIXIMSprite.interactive=!1,this.PIXIMSprite.buttonMode=!0,this.PIXIMSprite.interactiveChildren=!1,this.app.stage.addChild(this.PIXIMSprite),this.targetElement.appendChild(this.app.view),this.resizeRenderer(this.targetWidth,this.targetHeight)}resize(t,e){this.targetWidth=t,this.targetHeight=e,this.resizeRenderer(t,e),this.currentNeededTextureFolder=this.getDesiredTextureWidthFolder(t,e),this.resizeSprite()}loadImages(t){let e;this.loadersStatusesList[o]!=h.LOADER_STATUS_LOADED?void 0===this.loadersStatusesList[o]?t&&0!=t.length?(this.imagesList=t,t.forEach(t=>{const r=this.getResourceIdFromImageData(t,this.initialTextureFolder);e=e||r,this.loader.resources&&this.loader.resources[r]||this.loader.add(r,r,{crossOrigin:this.crossOrigin})}),this.loader.onProgress.add(t=>{this.loadersStatusesList[o]=h.LOADER_STATUS_PROGRESS,this.eventDispatcherElement.dispatchEvent(new CustomEvent(i.LOADING_PROGRESS,{detail:{progress:t.progress}}))}),this.loader.onComplete.once((t,r)=>{this.loadersStatusesList[o]=h.LOADER_STATUS_LOADED,this.textureWidth&&this.textureHeight||(this.determineTextureSize(e),this.resizeSprite()),this.eventDispatcherElement.dispatchEvent(new Event(i.LOADING_COMPLETE))}),this.loadersStatusesList[o]=h.LOADER_STATUS_CREATED,this.eventDispatcherElement.dispatchEvent(new Event(i.LOADING_START)),this.loader.load()):n.info("PixiPlayerEngine :: loadImages() :: returning because imageList is empty"):n.info("PixiPlayerEngine :: loadImages() :: returning because loader already initialized"):this.eventDispatcherElement.dispatchEvent(new Event(i.LOADING_COMPLETE))}loadPreloaderImages(t){let e;this.preloaderImagesList=t,t.forEach(t=>{const r=this.getResourceIdFromImageData(t,this.initialTextureFolder);e=e||r,this.loader.add(r,r,{crossOrigin:this.crossOrigin})}),this.loader.onComplete.once(()=>{n.info("Prelaoder images loaded..."),this.determineTextureSize(e),this.PIXIMSprite.visible=!0,this.showPreloaderImage(),this.eventDispatcherElement.dispatchEvent(new Event(i.PRELOADER_LOADING_COMPLETE))}),this.loader.load()}addImage(t){let e=t.fileReference.name;this.loader.resources[e]||(this.loader.add(e,t.dataURL),this.addedImagesList.push(t))}loadAddedImages(){n.info("PlayerPlayerEngine.ts :: loadAddedImages()"),this.loader.loading?n.info("PlayerPlayerEngine.ts :: loadAddedImages() :: already loading :: returning"):this.isLoaderCompleted(o)?this.eventDispatcherElement.dispatchEvent(new Event(i.LOADING_COMPLETE)):(this.useExternalImages=!0,this.loader.onComplete.once((t,e)=>{n.info("PixiPlayerEngine.ts :: loadAddedImages() :: images loading completed");const r=this.addedImagesList[0].fileReference.name;this.determineTextureSize(r),this.currentImageData=this.addedImagesList[0],this.resizeSprite(),this.PIXIMSprite.visible=!0,this.eventDispatcherElement.dispatchEvent(new Event(i.LOADING_COMPLETE)),this.loadersStatusesList[o]=h.LOADER_STATUS_LOADED}),this.loadersStatusesList[o]=h.LOADER_STATUS_CREATED,this.loadersList[o]=this.loader,this.loader.load())}showImage(t){if(!t)return;if(this.currentImageData=t,this.useExternalImages){if(t.fileReference)return void this.showImageByResourceIdAndLoaderId(t.fileReference.name,o);n.warn("No external image:"+String(t))}const e=this.getResourceIdFromImageData(t,this.currentNeededTextureFolder);if(this.currentNeededTextureFolder===this.initialTextureFolder)this.showImageByResourceIdAndLoaderId(e);else if(this.isLoaderCompleted(this.currentNeededTextureFolder))this.showImageByResourceIdAndLoaderId(e,this.currentNeededTextureFolder);else{this.loadResources(this.currentNeededTextureFolder);const e=this.getResourceIdFromImageData(t,this.initialTextureFolder);this.showImageByResourceIdAndLoaderId(e)}}setMaxImageWidth(t=360){this.maxAvailableTextureWidth=t}setImagesRatio(t){this.textureAspectRatio=t}resizeRenderer(t,e){this.app.renderer.resize(t,e),this.app.renderer.view.style.width=t+"px",this.app.renderer.view.style.height=e+"px"}getResourceByResourceIdAndLoaderId(t,e=o){const r=this.loadersList[e];if(!r){const t="No loader with id:"+this.currentNeededTextureFolder;return n.warn(t),null}return r.resources[t]}showImageByResourceIdAndLoaderId(t,e=o){this.currentResourceId=t;const r=this.getResourceByResourceIdAndLoaderId(t,e);if(r){let t=r.texture;t&&(this.PIXIMSprite.texture=t,this.app.render())}else{const e="No resource with id: "+t;n.warn(e)}}determineTextureSize(t){if(n.info("PixiPlayerEngine.ts :: determineTextureSize() "),this.loader.resources){const e=this.loader.resources[t]&&this.loader.resources[t].texture;e?(this.textureWidth=e.width,this.textureHeight=e.height,this.textureAspectRatio=e.width/e.height):n.error("determineTextureSize() :: texture is null :: ",+t)}else n.error("determineTextureSize() :: resources are null or eimpty")}resizeSprite(){let t,e;if(n.info("PixiPlayerEngine.ts :: resizeSprite() "),!this.textureWidth||!this.targetWidth)return void n.info("PixiPlayerEngine.ts :: resizeSprite() :: exiting because no textureWidth or targetWidth is set");const r=this.getSpriteSize(this.targetWidth,this.targetHeight,this.textureAspectRatio),s=Math.floor(r.width),a=Math.floor(r.height);this.currentSpriteWidth=s,this.currentSpriteHeight=a,this.PIXIMSprite.width=s,this.PIXIMSprite.height=a,t=.5*(this.targetWidth-s),e=.5*(this.targetHeight-a),this.PIXIMSprite.x=t,this.PIXIMSprite.y=e,this.eventDispatcherElement.dispatchEvent(new CustomEvent(i.IMAGE_RESIZED,{detail:{width:s,height:a}})),this.currentImageData&&this.currentImageData.fileReference?this.showImageByResourceIdAndLoaderId(this.currentImageData.fileReference.name,o):this.showImage(this.currentImageData)}showPreloaderImage(){this.currentImageData=this.preloaderImagesList[this.preloaderCurrentImageIndex],this.resizeSprite()}nextPreloaderImage(){this.preloaderCurrentImageIndex+=1,this.preloaderCurrentImageIndex>=this.preloaderImagesList.length&&(this.preloaderCurrentImageIndex=0),this.showImage(this.preloaderImagesList[this.preloaderCurrentImageIndex])}setLicense(t){}getLoaderById(t){return this.loadersList[t]||(this.loadersList[t]=new PIXIM.loaders.Loader,this.loadersStatusesList[t]=h.LOADER_STATUS_CREATED),this.loadersList[t]}isLoaderCompleted(t){return this.loadersStatusesList[t]===h.LOADER_STATUS_LOADED}getImageDataById(t){return this.imagesList.find(e=>e.src===t)}getDesiredTextureWidthFolder(t,e){let r="360",i=this.getSpriteSize(t,e,this.textureAspectRatio||1),s=i.width*this.devicePixelRatio;return r=s<=370&&360{const i=this.getResourceIdFromImageData(r,t);e.add(i,i,{crossOrigin:this.crossOrigin})}),e.onComplete.once(()=>{this.loadersStatusesList[t]=h.LOADER_STATUS_LOADED,this.showImage(this.currentImageData)}),e.load())}removeImages(){n.info("removeImages() :: ..."),this.addedImagesList=[],this.preloaderImagesList=[],this.currentImageData=null,this.loader.resources={},this.loader.reset(),this.loader.removeAllListeners(),this.loadersStatusesList[o]=void 0,Object.keys(this.loadersList).forEach(t=>{let e=this.loadersList[t];e.resources={},e.reset(),e.removeAllListeners(),e=null,this.loadersStatusesList[t]=void 0,delete this.loadersList[t]}),this.PIXIMSprite.visible=!1,this.app.render()}destroy(){this.removeImages(),this.PIXIMSprite.destroy({children:!0,texture:!0,baseTexture:!0}),this.app.destroy(!0,!0)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseSettings=(t=>{return{preloader:{image:void 0===t.preloader.image?"first":t.preloader.image,showStartButton:void 0!==t.preloader.showStartButton&&t.preloader.showStartButton},rotation:{rotatePeriod:t.rotation.rotatePeriod,rotateOnStart:void 0!==t.rotation.rotateOnStart?t.rotation.rotateOnStart:"true"==t.rotation.rotate||!0===t.rotation.rotate,rotateDirection:"-1"===t.rotation.rotateDirection||-1===t.rotation.rotateDirection?-1:1,bounce:"true"===t.rotation.bounce||!!t.rotation.bounce,rotateOnce:"once"==t.rotation.rotate||1==t.rotation.rotateOnce,multilevel:{}},control:{reverseDrag:t.control.reverseDrag}}})},function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))(function(n,s){function o(t){try{h(i.next(t))}catch(t){s(t)}}function a(t){try{h(i.throw(t))}catch(t){s(t)}}function h(t){t.done?n(t.value):new r(function(e){e(t.value)}).then(o,a)}h((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const n=r(1),s=r(1),o=r(10),a=r(9),h=r(0),u=r(8),l=r(2),c=r(6),d=r(3);e.default=class{constructor(t,e){if(this.checkTargetElementVisible=(()=>new Promise(t=>{this.visiblityChecker()?t():this.visiblityCheckerInterval=setInterval(()=>{this.visiblityChecker()&&(clearInterval(this.visiblityCheckerInterval),t())},250)})),this.advanceBy=(t=>{this.stop(),this.currentDx=-t,this.settings.control.reverseDrag&&(this.currentDx=t),this.nextImage()}),!t)throw"Target element id not specified!";l.info("Player constructor with this configData:"+JSON.stringify(e)),this.mainLoop=this.mainLoop.bind(this),this.preloaderImages={},this.targetImageId=null,this.elementId=t,this.lke=!0,this.targetElement=document.getElementById(t),this.targetElement||(this.targetElement=s.createDivElement(h.CLASSNAME_PLAYER)),this.targetElementSize=this.getTargetElementSize(),this.resizePollInterval=setInterval(this.targetDivResizeChecker.bind(this),200),this.imagesElement=this.targetElement.getElementsByClassName(h.CLASSNAME_IMAGES)[0],this.imagesElement||(this.imagesElement=s.createDivElement(h.CLASSNAME_IMAGES),this.targetElement.appendChild(this.imagesElement)),this.path="",this.preloaderElement=null,this.configData=e,this.rotationDataId=e&&e.id||"",this.currentImageId=0,this.isVisible=void 0,this.imagesList=[],this.yoflaHome=h.LINK_FREE,this.eventsRegister=[],this.rotateOnceCounter=0}getDOMElement(){return this.targetElement}initialize(){return i(this,void 0,void 0,function*(){yield this.checkTargetElementVisible(),this.setPathVariable();let t=window.Yofla360_configs?window.Yofla360_configs[this.rotationDataId]:null;if((t=t||this.configData.productConfig)||(yield this.loadConfigFile(),(t=window.Yofla360_configs?window.Yofla360_configs[this.rotationDataId]:null)||(t=window[this.rotationDataId||"RotationData"])),!t)throw`No 360 view data with the id: ${this.rotationDataId}`;l.info("Player.ts :: initialize() :: 360 data loaded"),this.settings=o.parseSettings(t.settings),this.imagesList=n.parseImages(t.images,this.path),this.meta=t.meta,this.initDefaultAssets(),this.initPlayerEngine(),this.initInstanceEventListeners();const e=this.settings.preloader.image;l.info("Player.ts :: initialize() :: preloaderImageCode: "+e),"none"===e?this.onPreloaderLoadingComplete():this.loadPreloaderImage(e)})}setSettings(t){this.settings=t}setBounce(t){this.settings&&this.settings.rotation&&(this.settings.rotation.bounce=t)}setReverseDrag(t){this.settings&&this.settings.control&&(this.settings.control.reverseDrag=t)}setRotatePeriod(t){this.settings&&this.settings.rotation&&(this.settings.rotation.rotatePeriod=t),this.currentFrameInterval=this.computeFrameInterval(t,this.hSteps)}setRotateDirection(t){1!==(t=parseFloat(String(t)))&&-1!==t&&(t=1);let e=this.currentDx;this.currentDx=t,e!==this.currentDx&&this.nextImage()}showStartButton(t){this.stop(),this.startButtonElement&&(t?(this.startButtonElement.style.display="block",this.disableControls()):(this.startButtonElement.style.display="none",this.enableControls()))}onResize(){this.onResizeListener()}initPlayerEngine(){let t={};this.configData&&this.configData.forceCanvas&&(t.forceCanvas=!0),this.configData&&this.configData.disableRetinaOnMobile&&n.isMobileDevice()&&(t.devicePixelRatio=1),this.configData&&this.configData.forceCanvasOnMobile&&n.isMobileDevice()&&(t.forceCanvas=!0),this.playerEngine=this.playerEngine||new a.PixiPlayerEngine(this.imagesElement,this.targetElement,this.meta,t)}initInstanceEventListeners(){n.addAndRegisterEventListener(this.eventsRegister,{name:h.LOADING_START,listener:this.onLoadingStart.bind(this),target:this.targetElement}),n.addAndRegisterEventListener(this.eventsRegister,{name:h.LOADING_PROGRESS,listener:this.onLoadingProgress.bind(this),target:this.targetElement}),n.addAndRegisterEventListener(this.eventsRegister,{name:h.LOADING_COMPLETE,listener:this.onLoadingComplete.bind(this),target:this.targetElement}),n.addAndRegisterEventListener(this.eventsRegister,{name:h.PRELOADER_LOADING_COMPLETE,listener:this.onPreloaderLoadingComplete.bind(this),target:this.targetElement}),n.addAndRegisterEventListener(this.eventsRegister,{name:h.IMAGE_RESIZED,listener:this.onImageResized.bind(this),target:this.targetElement}),n.addAndRegisterEventListener(this.eventsRegister,{name:h.INTERACTION_STARTS,listener:this.onInteractionStart.bind(this),target:this.targetElement}),n.addAndRegisterEventListener(this.eventsRegister,{name:h.INTERACTION_SINGLE_TAP,listener:this.onInteractionTapEnd.bind(this),target:this.targetElement}),n.addAndRegisterEventListener(this.eventsRegister,{name:h.INTERACTION_PAN_DELTAS,listener:this.onInteractionPanDeltas.bind(this),target:this.targetElement}),n.addAndRegisterEventListener(this.eventsRegister,{name:h.INTERACTION_SWIPE_END,listener:this.onInteractionSwipeEnd.bind(this),target:this.targetElement}),n.addAndRegisterEventListener(this.eventsRegister,{name:"resize",listener:n.debounce(this.onResizeListener.bind(this),200),target:window}),n.addAndRegisterEventListener(this.eventsRegister,{name:"scroll",listener:n.debounce(this.onScrollListener.bind(this),200),target:window});const t=n.addTabInactivityObserver(this.onTabFocusChange.bind(this));t&&n.addAndRegisterEventListener(this.eventsRegister,t)}start(){this.isRunning=!0}stop(){this.isRunning=!1}togglePlay(){this.isRunning=!this.isRunning}toggleFullscreen(){n.isFullscreen()?n.exitFullscreen(this.targetElement):n.launchFullscreen(this.targetElement)}disableControls(){this.enableControls(!1)}enableControls(t=!0){this.isControlsEnabled=t,this.controlsElement&&(this.controlsElement.style.display=t?"flex":"none")}dlk(){this.lke=!1}getTargetElementSize(){return this.targetElement.clientWidth+"x"+this.targetElement.clientHeight}targetDivResizeChecker(){const t=this.getTargetElementSize();t!=this.targetElementSize&&(this.onResize(),this.targetElementSize=t)}loadPreloaderImage(t){let e;l.info("Player.ts :: loadPreloaderImage()"),e=isNaN(t)?(t.toLowerCase(),0):Math.min(this.imagesList.length-1,parseInt(t)),this.currentImageId=e;const r=this.imagesList.slice(e,e+1);l.info("Player.ts :: loadPreloaderImage() :: preloaderImages: "+JSON.stringify(r)),this.playerEngine.loadPreloaderImages(r)}onPreloaderLoadingComplete(){l.info("Player.ts :: Preloader loading complete..."),this.startButtonElement&&this.settings.preloader.showStartButton?this.startButtonElement.style.display="block":this.startImageElement||this.startLoadingImages()}onStartButtonPressed(){this.startButtonElement&&(this.startButtonElement.style.display="none",this.startLoadingImages())}onStartImagePressed(){this.startImageElement&&(this.startImageElement.style.display="none",this.areImagesLoaded?(this.enableControls(!0),this.start()):this.startLoadingImages())}startLoadingImages(){l.info("Player.ts :: startLoadingImages()"),this.areImagesLoaded?(this.enableControls(),this.start()):this.imagesList&&this.imagesList.length&&this.playerEngine.loadImages(this.imagesList)}setImage(t){this.stop(),this.currentImageId=t,this.showCurrentImage()}update(t){}addImage(t){l.info("----------------------------------"),l.info("Player.ts :: addingExternalImage()"),l.info("----------------------------------"),this.imagesList.push(t),this.playerEngine.addImage(t)}setStartImage(t,e="fit"){this.stop(),this.createStartImageElement(e);let r=this.startImageElement.firstChild;r||(r=document.createElement("img"),this.startImageElement.appendChild(r)),r.src=t,this.enableControls(!1)}setStartImageBgColor(t={r:0,g:0,b:0,a:.5}){this.startImageElement&&(this.startImageElement.style.backgroundColor=`rgba(${t.r}, ${t.g},${t.b},${t.a})`)}showStartImage(){this.enableControls(!1),this.stop(),this.startImageElement&&(this.startImageElement.style.display="flex")}createStartImageElement(t="fit"){if(this.startImageElement)this.startImageElement.style.display="flex";else{const t=document.createElement("div");t.className="yofla360__start-image",this.targetElement.appendChild(t),this.startImageElement=t,this.initStartImage()}"fit"===t&&(this.startImageElement.className="yofla360__start-image"),"keep"===t&&(this.startImageElement.className="yofla360__start-image yofla360__start-image--keep-size"),this.stop(),this.enableControls(!1)}removeStartImage(){this.startImageElement&&(this.targetElement.removeChild(this.startImageElement),this.startImageElement=void 0)}loadAddedImages(){l.info("Player.ts :: loadAddedImages()"),this.playerEngine.loadAddedImages()}removeImages(){this.stop(),l.info("Player.ts :: removeImages()"),this.playerEngine&&this.playerEngine.removeImages(),this.areImagesLoaded=!1,this.imagesList=[]}destroy(){for(this.stop(),this.playerEngine.destroy();this.targetElement.firstChild;)this.targetElement.removeChild(this.targetElement.firstChild);n.removeEventListeners(this.eventsRegister),clearInterval(this.resizePollInterval),this.targetElement.remove(),this.targetElement=void 0,delete this.targetElement}setMaxImageWidth(t){this.playerEngine&&this.playerEngine.setMaxImageWidth(t)}setImagesRatio(t){this.playerEngine&&this.playerEngine.setImagesRatio(t)}initDefaultAssets(){this.preloaderElement=this.targetElement.getElementsByClassName(h.CLASSNAME_PRELOADER)[0],this.preloaderBarElement=this.preloaderElement&&this.preloaderElement.getElementsByClassName(h.CLASSNAME_PRELOADER_BAR)[0],this.preloaderTextElement=this.preloaderElement&&this.preloaderElement.getElementsByClassName(h.CLASSNAME_PRELOADER_TEXT)[0],this.initControls(),this.initStartButton(),this.initStartImage(),this.targetElement.style.cursor="pointer"}initControls(){this.controlsElement=this.targetElement.getElementsByClassName(h.CLASSNAME_CONTROLS)[0];const t=this.targetElement.getElementsByClassName(h.CLASSNAME_BUTTON_PLAY)[0];t&&n.addEvent(h.POINTER_ON_RELEASE,t,this.buttonTogglePlayListener.bind(this));const e=this.targetElement.getElementsByClassName(h.CLASSNAME_BUTTON_LEFT)[0];e&&n.addEvent(h.POINTER_ON_RELEASE,e,this.btnLeftListener.bind(this));const r=this.targetElement.getElementsByClassName(h.CLASSNAME_BUTTON_RIGHT)[0];r&&n.addEvent(h.POINTER_ON_RELEASE,r,this.btnRightListener.bind(this));const i=this.targetElement.getElementsByClassName(h.CLASSNAME_BUTTON_FULLSCREEN)[0];i&&(n.isFullscreenModeSupported()?n.addEvent(h.POINTER_ON_RELEASE,i,this.buttonToggleFullscreenListener.bind(this)):i.style.display="none")}preloadImage(t){d.Yofla360.in_creator||(this.preloaderImages.path=new Image,this.preloaderImages.path.src=this.path+t)}buttonTogglePlayListener(){this.isControlsEnabled&&(this.settings.rotation.rotateOnce=!1,this.togglePlay())}buttonToggleFullscreenListener(){this.isControlsEnabled&&this.toggleFullscreen()}initStartButton(){this.startButtonElement=this.targetElement.getElementsByClassName(h.CLASSNAME_START_BUTTON)[0],this.startButtonElement&&n.addEvent(h.POINTER_ON_RELEASE,this.startButtonElement,this.onStartButtonPressed.bind(this))}initStartImage(){this.startImageElement=this.targetElement.getElementsByClassName(h.CLASSNAME_START_IMAGE)[0],this.startImageElement&&n.addEvent(h.POINTER_ON_RELEASE,this.startImageElement,this.onStartImagePressed.bind(this))}setPathVariable(){if(!this.configData||void 0===this.configData.path)throw"Path variable is not set for 360 view for element with id: "+this.elementId;""!==this.configData.path&&(this.path=n.addTrailingSlash(this.configData.path))}loadConfigFile(){const t=this.path+"config.js";return l.info("Yofla360 :: 360 loading config from: "+t),n.loadScript(t)}onScrollListener(){this.isVisible=this.visiblityChecker()}visiblityChecker(){const t=n.isInViewport(this.targetElement),e=this.targetElement.clientWidth>0&&this.targetElement.clientHeight>0;return t&&e}onTabFocusChange(t){this.isVisible=t}display360Info(t){console&&console.log&&console.log("YDisplayINFO: ",t)}onLoadingStart(){this.preloaderElement&&(this.preloaderElement.style.display="flex"),this.startButtonElement&&(this.startButtonElement.style.display="none")}onLoadingProgress(t){this.preloaderBarElement&&(this.preloaderBarElement.style.width=String(t.detail.progress)+"%"),this.preloaderTextElement&&(this.preloaderTextElement.innerText=String(Math.floor(t.detail.progress))+"%")}onLoadingComplete(){l.info("Player.ts :: onLoadingComplete()"),this.areImagesLoaded=!0,this.preloaderElement&&(this.preloaderElement.style.display="none"),this.controlsElement&&(this.controlsElement.style.display="flex"),this.imagesElement.style.display="block",this.setInitialValues(this.settings,this.imagesList.length),this.addInteractionManager(),this.settings.rotation.rotateOnStart?(this.isRunning=!0,this.currentDx=this.settings.rotation.rotateDirection,this.previousDx=this.currentDx):(this.showCurrentImage(),this.isRunning=!1),this.wasRunning=this.isRunning,this.enableControls(!0),this.startMainLoop(),this.addCustomisation()}setInitialValues(t,e){this.isRunning=!1,this.hSteps=e,this.currentDx=t.rotation.rotateDirection,this.isControlsEnabled=!0;const r=t.rotation.rotatePeriod||2;this.currentFrameInterval=this.computeFrameInterval(r,this.hSteps),this.intervalMultiplier=1,this.intervalMultiplierStartValue=1}computeFrameInterval(t=2,e=32){return Math.floor(1e3*t/e)}startMainLoop(){this.startTimestamp=performance.now(),window.requestAnimationFrame(this.mainLoop)}onResizeListener(){this.playerEngine.resize(this.imagesElement.clientWidth,this.imagesElement.clientHeight),this.isRunning||this.showCurrentImage()}addInteractionManager(){this.interactionManager||(this.interactionManager=new u.InteractionManager(this.targetElement,this.imagesElement))}addCustomisation(){return i(this,void 0,void 0,function*(){if(this.lke&&location.hostname&&"localhost"!==location.hostname)try{const t=yield this.getLicenseInfo();t&&(this.licenseType=t.type,this.playerEngine.setLicense(t.type),t.url&&(this.yoflaHome=t.url+"&utm_label=bid_"+h.BUILD_ID),this.setLicense(t.type),t.isExpired&&this.setExpired(),t.isDomainVoid&&this.showDomainUnauthorized())}catch(t){}})}getLicenseInfo(){return new Promise(t=>{const e="YFL_CLOUD_VERSION_A",r=this.getPageUrl(),i=r;let n=c.b64decode("aHR0cHM6Ly9hcGkzNjAubGFjb3JhLmV1L3BsYXllci9kZXYvbGMv");n=c.b64decode("aHR0cHM6Ly9hcGkzNjAubGFjb3JhLmV1L3BsYXllci92MS9sYy8=");const s=h.BUILD_ID,o=this.configData.id||"na",a={l:"Hdxr53H9E",d:i,dc:c.extractHostname(r),p:o,lid:e,bh:c.extractHostname(this.imagesList&&this.imagesList[0]&&this.imagesList[0].baseUrl),pv:s,v:1};window.console&&window.console.log("360 Product Viewer by YoFLA.com, buildId: "+h.BUILD_ID+", version: "+e);const u=new XMLHttpRequest;u.open("POST",n),u.setRequestHeader("Content-Type","application/json"),u.responseType="json",u.onload=(()=>{u.response&&0===u.response.status?t({type:"free",isDomainVoid:u.response.isDomainVoid,isExpired:u.response.isExpired,url:u.response.url||""}):u.response&&1===u.response.status?t({type:"paidOrTrial",isDomainVoid:u.response.isDomainVoid,isExpired:u.response.isExpired,url:u.response.url||""}):t({type:"unknown"})}),u.onerror=(()=>{t({type:"unknown"})}),u.onabort=(()=>{t({type:"unknown"})}),u.send(JSON.stringify(a))})}onImageResized(t){this.currentImageWidth=t.detail.width,this.currentImageHeight=t.detail.height,l.debug(`onImageResized() :: ${t.detail.width} : ${t.detail.height}`)}onInteractionTapEnd(t){this.isControlsEnabled&&(this.interactionStartImageId=this.currentImageId,this.checkTapPosition(t),this.isRunning=!this.isRunning,this.isRunning&&(this.currentDx=0===this.currentDx?this.previousDx:this.currentDx,this.intervalMultiplier=1.8,this.intervalMultiplierStartValue=this.intervalMultiplier))}onInteractionStart(t){this.isControlsEnabled&&(this.wasRunning=this.isRunning,this.currentImageId>=0&&(this.interactionStartImageId=this.currentImageId),this.settings.rotation.rotateOnce=!1)}onInteractionSwipeEnd(t){if(!this.isControlsEnabled)return;let e=t.detail.dx;this.settings.control.reverseDrag&&(e=-e),this.currentDx=e,this.wasRunning&&this.start()}onInteractionPanDeltas(t){if(this.isControlsEnabled&&!t.detail.originalEvent.isFinal){this.isRunning=!1,this.interactionStartImageId=this.interactionStartImageId||this.currentImageId,this.panEventVelocityIsSwipe=Math.abs(t.detail.originalEvent.overallVelocityX)>.7;let e=t.detail.dx||0;this.settings.control.reverseDrag&&(e=-e),e>0?this.currentDx=1:e<0&&(this.currentDx=-1);const r=.8,i=e/(this.currentImageWidth*r),n=this.hSteps*(this.settings.rotation.bounce?1:.5),s=Math.floor(n*i),o=this.computeImageOffset(this.interactionStartImageId,s,this.hSteps,this.settings.rotation.bounce);o!==this.currentImageId&&this.rotateTo({imageId:o})}}computeImageOffset(t,e,r,i=!1){let n=t+e;if(n>=r){let t=n%r;n=i?r-1-t:t}return n<0&&(n=i?-n:r+n),n}rotateTo(t){let e;const r=this.currentImageId,i=t.imageId;if(r===i)return;let n,s;i>r?(n=i-r,s=r+(this.hSteps-i)):(s=r-i,n=this.hSteps-r+i),e=ne){const i=t-e,n=e+r-t;return Math.min(i,n)}if(e>t){const i=e-t,n=t+r-e;return Math.min(i,n)}return 0}mainLoop(){let t=performance.now()-this.startTimestamp>=this.currentFrameInterval*this.intervalMultiplier,e=null!==this.targetImageId;if(t&&this.isRunning||e){if(this.intervalMultiplierStartValue<1){let t=this.intervalMultiplier+(1-this.intervalMultiplierStartValue)/this.hSteps;this.intervalMultiplier=Math.min(1,t)}else if(this.intervalMultiplierStartValue>1){let t=this.intervalMultiplier-(this.intervalMultiplierStartValue-1)/(.1*this.hSteps);this.intervalMultiplier=Math.max(1,t)}this.nextImage()}window.requestAnimationFrame(this.mainLoop)}nextImage(){0!==this.imagesList.length&&(this.currentImageId=this.computeNextImageId(this.currentImageId,this.targetImageId,this.hSteps,this.settings.rotation.bounce,this.currentDx),null!==this.targetImageId&&this.currentImageId==this.targetImageId&&(this.targetImageId=null,this.isRunning=!1,this.wasRunning&&(this.isRunning=!0)),this.settings.rotation.rotateOnce&&(this.rotateOnceCounter++,this.settings.rotation.bounce?this.rotateOnceCounter==2*(this.hSteps+1)&&(this.stop(),this.settings.rotation.rotateOnce=!1):this.rotateOnceCounter==this.hSteps+1&&(this.stop(),this.settings.rotation.rotateOnce=!1)),this.showCurrentImage())}computeNextImageId(t,e,r,i=!1,n=1){let s=t;if(null!==e){let o=this.computePath(e,t,r),a=Math.floor(Math.pow(o,.5))||1;s=this.computeImageOffset(t,a*n,r,i)}else(s=t+n)>=r&&(s=0,i&&(s=r-2,this.currentDx=-1*this.currentDx)),s<0&&(s=r-1,i&&(s=1,this.currentDx=-1*this.currentDx));return s}showCurrentImage(){let t=this.imagesList[this.currentImageId];if(t)try{if(this.playerEngine.showImage(t),this.lastImageId!=this.currentImageId){this.lastImageId=this.currentImageId;let t=performance.now();this.userDragFrameInterval=t-this.lastImageShownTimestamp,this.lastImageShownTimestamp=t}this.startTimestamp=performance.now()}catch(t){l.warn("Error: "+t)}else l.debug("No image: "+this.currentImageId)}continueRotationAfterSwipe(){this.isRunning=!0,this.panEventVelocityIsSwipe=!1,this.intervalMultiplier=this.userDragFrameInterval/this.currentFrameInterval,this.intervalMultiplierStartValue=this.intervalMultiplier}btnRightListener(){this.isControlsEnabled&&this.advanceBy(-1)}btnLeftListener(){this.isControlsEnabled&&this.advanceBy(1)}checkTapPosition(t){let e,r;if(t&&t.detail&&t.detail.hammerEvent&&t.detail.hammerEvent.srcEvent){const i=t.detail.hammerEvent.srcEvent;e=i&&i.offsetX,r=i&&i.offsetY}e&&r&&"free"===this.licenseType&&e<70&&r<15&&window.open(this.rcvdurl||h.LINK_HOME,"_blank")}setLicense(t){"free"===t&&this.showFreeBanner()}setExpired(){const t=this.yoflaHome;this.targetElement.appendChild(this.getExpiredElement(t))}showDomainUnauthorized(){const t=this.yoflaHome,e=c.extractHostname(this.getPageUrl());this.targetElement.appendChild(this.getDomainUnauthorizedElement({url:t,domain:e}))}showFreeBanner(t=!0){if(t)if(this.freeBannerElement)this.freeBannerElement.style.display="block";else{const t=this.targetElement.appendChild(this.getFreeBannerElement()),e=this.yoflaHome,r=function(){window.open(e,"_blank")},i=function(){t.style.backgroundColor="rgba(100, 100, 100, 1"},n=function(){t.style.backgroundColor="rgba(0, 0, 0, 1"};t.addEventListener("mouseover",n),t.addEventListener("click",r),t.addEventListener("mouseout",i),this.freeBannerElement=t}else this.freeBannerElement&&(this.freeBannerElement.style.display="none")}getFreeBannerElement(){const t=document.createElement("div");return t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.height="15px",t.style.lineHeight="15px",t.style.cursor="pointer",t.style.border="0px",t.style.borderRadius="4px",t.style.backgroundColor="rgba(100, 100, 100, 1",t.style.zIndex="5",t.style.color="#fff",t.style.fontFamily="sans-serif",t.style.fontWeight="normal",t.style.fontSize="10px",t.style.paddingLeft="5px",t.style.paddingRight="5px",t.style.marginTop="1px",t.style.marginLeft="3px",t.style.marginRight="5px",t.style.opacity="0.5",t.innerText="Free 360° viewer by yofla.com",t.style.textAlign="left",t}getExpiredElement(t){const e=this.getStatusMessageElement();return e.style.top="0px",e.innerHTML=`360 Player Trial Expired! more info`,e.style.height="60px",e.style.fontSize="14px",e.style.color="white",e.style.backgroundColor="rgba(100, 100, 100, 1)",e.style.lineHeight="60px",e}getDomainUnauthorizedElement(t){const{domain:e,url:r}=t,i=this.getStatusMessageElement();return i.innerHTML=`This domain [${e}] is not authorized. more info`,i.style.height="60px",i.style.fontSize="14px",i.style.color="white",i.style.backgroundColor="rgba(100, 100, 100, 1)",i.style.lineHeight="60px",i.style.top="40%",i}getStatusMessageElement(){const t=document.createElement("div");return t.style.position="absolute",t.style.top="20%",t.style.left="0px",t.style.height="100px",t.style.width="100%",t.style.lineHeight="100px",t.style.border="0px",t.style.borderRadius="4px",t.style.backgroundColor="rgba(200, 200, 200, 1)",t.style.zIndex="5",t.style.color="#FF0000",t.style.fontFamily="sans-serif",t.style.fontWeight="normal",t.style.fontSize="22px",t.style.paddingLeft="0px",t.style.paddingRight="0px",t.style.marginTop="10px",t.style.marginLeft="0px",t.style.marginRight="0px",t.style.opacity="0.9",t.innerText="",t.style.textAlign="center",t}getPageUrl(){return window.location!=window.parent.location?document.referrer:document.URL}}},function(t,e,r){r(3),t.exports=r(5)}]);