diff --git a/Assets/HappyFunTimes/HappyFunTimesCore/Server/Resources/HFTOSXServer.bytes b/Assets/HappyFunTimes/HappyFunTimesCore/Server/Resources/HFTOSXServer.bytes index cf49cca..98f5eb5 100755 --- a/Assets/HappyFunTimes/HappyFunTimesCore/Server/Resources/HFTOSXServer.bytes +++ b/Assets/HappyFunTimes/HappyFunTimesCore/Server/Resources/HFTOSXServer.bytes @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fc359e279e947eb5531965d127dd71257c01f04433e4887cb0cb701995f502fc +oid sha256:a6f057e6d0694b14bf2deedb24b94f1f4cfa6971268e2768e076269a297a3897 size 7851504 diff --git a/Assets/HappyFunTimes/HappyFunTimesCore/Server/Resources/HFTOSXServer.sha256.bytes b/Assets/HappyFunTimes/HappyFunTimesCore/Server/Resources/HFTOSXServer.sha256.bytes index dad7adc..2549518 100644 --- a/Assets/HappyFunTimes/HappyFunTimesCore/Server/Resources/HFTOSXServer.sha256.bytes +++ b/Assets/HappyFunTimes/HappyFunTimesCore/Server/Resources/HFTOSXServer.sha256.bytes @@ -1 +1 @@ -a5da3e4c873c30b929e4848a939326402d53d55e *hft-server.osx +5143d368970e377a73c5adfcd2dda613c0e09efe *hft-server.osx diff --git a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/controllers/gamepad/controller.html.bytes b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/controllers/gamepad/controller.html.bytes index db6c109..a1cbe78 100644 --- a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/controllers/gamepad/controller.html.bytes +++ b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/controllers/gamepad/controller.html.bytes @@ -232,8 +232,8 @@ linear-gradient( - - + + diff --git a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui-min.js.bytes b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui-min.js.bytes index 736ae1e..8d5b358 100644 --- a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui-min.js.bytes +++ b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui-min.js.bytes @@ -1,2 +1,2 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var r,o;r=[n(1),n(5),n(13),n(14),n(9),n(10),n(15),n(16)],o=function(e,t,n,r,o,i,a,s){window.sampleUI=window.sampleUI||{};var c=window.sampleUI;c.commonUI=e,c.dialog=t,c.dpad=n,c.input=r,c.misc=o,c.mobileHacks=i,c.strings=a,c.touch=s}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[n(3),n(8),n(4),n(5),n(6),n(2),n(9),n(10),n(11),n(12)],o=function(e,t,n,r,o,i,a,s,c,u){function l(e){if(e=e||"",!v){v=document.createElement("div");var t=document.getElementById("hft-menu");t.parentNode.insertBefore(v,t)}e.indexOf("portrait")>=0?v.innerHTML=E:e.indexOf("landscape")>=0?v.innerHTML=b:v.innerHTML=""}function d(){o.isFullScreen()&&c.set(g.orientation)}function h(e,t){if(g.orientation=e,c.canOrient())d();else{var n=g.orientation;t&&(n="none"),l(n)}}function f(){r.modal({title:"HappyFunTimes",msg:"This game requires the HappyFunTimes App
Please download it from your app store"},function(){var e=window.navigator.userAgent;e.indexOf("iPhone")>=0||e.indexOf("iPad")>=0?a.gotoIFrame("itms://itunes.apple.com/"):e.indexOf("Android")>=0?a.gotoIFrame("market://details?id=com.greggman.HappyFunTimes"):showRequiredApp()})}function p(e){var t=m("hft-menu");t.style.display=e?"block":"none"}var v,m=function(e){return document.getElementById(e)},g={logger:new i.NullLogger},y={},b=['
','
','
'," Turn the Screen ","
",'
'," ↺ ","
","
","
"].join("\n"),E=['
','
','
'," Turn the Screen ","
",'
'," ↻ ","
","
","
"].join("\n"),w=function(t,n){function r(t){e.sendJSON(window.location.href,{cmd:"happyFunTimesPing"},function(e,n){t(e,n)},{timeout:2e3})}n=n||{};var c=m("hft-settings"),l=m("hft-disconnected"),v=m("hft-touchstart"),b=m("hft-menu");b.addEventListener("click",function(){c.style.display="block"},!1),b.addEventListener("touchstart",function(){c.style.display="block"},!1),p(!1);var E=function(){o.isFullScreen()||(v.removeEventListener("touchstart",E,!1),v.style.display="none",o.requestFullScreen(document.body))},w=function(){o.isFullScreen()?d():o.canGoFullScreen()&&(v.addEventListener("touchstart",E,!1),v.style.display="block")};if(o.onFullScreenChange(document.body,w),s.isMobile()&&w(),y.playerNameHandler=new u(t,m("hft-name")),m("hft-setname").addEventListener("click",function(){c.style.display="none",y.playerNameHandler.startNameEntry()},!1),m("hft-restart").addEventListener("click",function(){window.location.reload()},!1),m("hft-back").addEventListener("click",function(){c.style.display="none"}),t.addEventListener("connect",function(){l.style.display="none",n.connectFn&&n.connectFn()}),t.addEventListener("disconnect",function(){function e(){r(function(t,n){return t?(setTimeout(e,1e3),void 0):(window.location.href="/",void 0)})}l.style.display="block",n.disconnectFn&&n.disconnectFn(),setTimeout(e,2e3)}),t.addEventListener("_hft_redirect_",function(e){window.location.href=e.url}),h(n.orientation,n.orientationOptional),n.requireApp&&f(),n.debug){g.statusNode=document.createTextNode(""),m("hft-status").appendChild(g.statusNode);var S=a.findCSSStyleRule("#hft-debug");S.style.display="block",g.logger=new i.HTMLLogger(m("hft-console"),n.numConsoleLines)}if(n.consoleTarget){switch(n.consoleTarget.toLowerCase()){case"html":g.logger=g.logger||new i.HTMLLogger(m("hft-console"),n.numConsoleLines),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)});break;case"game":g.logger=new i.GameLogger(t),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)})}console.log("here")}},S=function(){S=function(){},y.playerNameHandler.isNameSet()||y.playerNameHandler.startNameEntry()},T=function(e){g.statusNode&&(g.statusNode.nodeValue=e)},P=function(e){g.logger.log(e)},I=function(e){g.logger.error(e)};return{askForNameOnce:S,log:P,error:I,setOrientation:h,setStatus:T,setupStandardControllerUI:w,showMenu:p}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){};e.prototype.log=function(){},e.prototype.error=function(){};var t=function(){};t.prototype.log=function(){console.log.apply(console,arguments)},t.prototype.error=function(){console.error.apply(console,arguments)};var n=function(e,t){this.container=e,this.maxLines=t||10,this.lines=[]};n.prototype.addLine_=function(e,t){var n,r;this.lines.lengtho;++o){var i=e[o];void 0===i?r.push("undefined"):"number"==typeof i?(t&&r.push(", "),i===Math.floor(i)?r.push(i.toFixed(0)):r.push(i.toFixed(3)),t=!0):window.Float32Array&&i instanceof Float32Array?r.push(tdl.string.argsToString(i)):(r.push(i.toString()),t=!1)}return r.join("")};n.prototype.log=function(){this.addLine_(r(arguments),void 0)},n.prototype.error=function(){this.addLine_(r(arguments),"red")};var o=function(e){this.log=e.logImpl.bind(e),this.error=e.errorImpl.bind(e)};return{ConsoleLogger:t,GameLogger:o,HTMLLogger:n,NullLogger:e}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;"use strict",r=function(){var e=function(){},t=function(t,n,r,o){o=o||{};var i=new XMLHttpRequest;i.overrideMimeType&&i.overrideMimeType("text/plain");var a=o.timeout||0;a&&(i.timeout=a,e("set timeout to: "+i.timeout)),i.open("POST",t,!0);var s=JSON.stringify(n),c=function(t,n){r&&(e("calling-callback:"+(t?" has error":"success")),r(t,n),r=void 0)},u=function(){e("--error--"),c("error sending json to "+t)},l=function(){e("--timeout--"),c("timeout sending json to "+t)},d=function(){r&&(e("--forced timeout--"),i.abort(),c("forced timeout sending json to "+t))},h=function(){e("--finish--");var n=void 0,r=200===i.status||0===i.status;if(r)try{n=JSON.parse(i.responseText)}catch(o){r=!1}c(r?null:"could not load: "+t,n)};try{a&&setTimeout(d,a+50),i.addEventListener("load",h,!1),i.addEventListener("timeout",l,!1),i.addEventListener("error",u,!1),i.setRequestHeader("Content-type","application/json"),i.send(s),e("--sent: "+t)}catch(f){e("--exception--"),setTimeout(function(){c("could not load: "+t,null)},0)}};return{sendJSON:t}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;r=function(){var e=function(e,t){var n=t||"/";this.set=function(t,r){if(void 0===t)return this.erase(),void 0;if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.setItem(e,t),void 0;var o="";r=r||9999;var i=new Date;i.setTime(Date.now()+Math.floor(24*r*60*60*1e3)),o="; expires="+i.toGMTString();var a=encodeURIComponent(e)+"="+encodeURIComponent(t)+o+"; path="+n;document.cookie=a},this.get=function(){if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.getItem(e);for(var t=encodeURIComponent(e)+"=",n=document.cookie.split(";"),r=0;rn;++n)t+=(16*Math.random()|0).toString(16);return t}function c(e,t){Object.keys(t).forEach(function(n){e.addEventListener(n,t[n])})}var u=function(e,t,n){return Object.keys(e).forEach(function(r){if(2!==n||void 0===t[r]){var o=e[r];if(o instanceof Array){var i=t[r];i||(i=[],t[name]=i),u(o,i,n)}else if(!(o instanceof Object)||o instanceof Function||o instanceof HTMLElement){if(1===n&&void 0!==t[r])return;t[r]=o}else{var a=t[r];a||(a={},t[r]=a),u(o,a,n)}}}),t},l=function(t,n){var r=n||{};try{var o=t.indexOf("?"),i=t.indexOf("#");0>i&&(i=t.length);var a=t.substring(o+1,i);e(a,r)}catch(i){console.error(i)}return r},d=function(t){return e(window.location.search,t)},h=new RegExp("([a-zA-Z0-9_]+):","g"),f=function(e,t){var n=t||"settings",r=d(),o=e||{},i=r[n];if(i){var a=i.replace(h,'"$1":'),s=JSON.parse(a);u(s,o)}return o},p=["","moz","webkit","ms"],v=function(e){return Math.floor(Math.random()*e)},m=function(e){for(var t=e||v,n=t(3),r=[],o=0;3>o;++o)r.push(t(128)+(o===n?128:64));return"rgb("+r.join(",")+")"},g=function(e){for(var t=e||v,n=t(3),r=255,o=0;3>o;++o)r=r<<8|t(128)+(o===n?128:64);return r},y=function(e){for(var t=0;te?-1:e>0?1:0},P=function(e,t){return Math.abs(e)=8}}();return n&&(e||t)}(),o=function(){return r},i=function(){var e=/iP(hone|od|ad)/i.test(navigator.platform);return function(){return e}}(),a=function(){var e=/Android|webOS|Phone|Pad|Pod|Tablet|BlackBerry/i.test(navigator.userAgent);return function(){return e}}(),s=function(){for(var e=document.querySelectorAll(".fixheight"),t=0;t]/g,"");t.length>16&&(t=t.substring(0,16)),0===t.length?a.value=u:t!==u&&(u=t,c.set(u,700),m()),g(!1)};this.startNameEntry=function(){l.style.display="block",d.style.display="none",s()||(a.value=t.pickRandomElement(o)),a.focus()},i.addEventListener("_hft_setname_",v),a.addEventListener("click",y,!1),a.addEventListener("change",b,!1),a.addEventListener("blur",b,!1),a.addEventListener("focus",y,!1),a.form&&a.form.addEventListener("submit",b,!1),f(),m()};return i}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[],o=function(){var e=function(e,t,n,r,o){o=o||1,e.beginPath(),e.arc(t,n,r,0,2*Math.PI),1&o&&e.fill(),2&o&&e.stroke()},t=function(e){this.element=e.element,this.size=e.size,this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.resize(),this.ctx=this.canvas.getContext("2d"),this.drawBits(0)};return t.prototype.getSize=function(){var e=this.size;return e||(e=Math.min(this.canvas.width,this.canvas.height)),e},t.prototype.drawBits=function(t){var n=this.getSize(),r=Math.floor(n/6.5),o=Math.floor(n/2),i=Math.floor(n/2),a=Math.floor(n/2*.8),s=Math.floor(n/2*.8),c=this.ctx;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.save(),c.translate(o,i),c.fillStyle="#AAA",c.stokeStyle="#444",e(c,0,0,.95*o,3),c.fillStyle="#888",c.fillRect(-r,-s,2*r,2*s),c.fillRect(-a,-r,2*a,2*r),c.fillStyle="#CCC",1&t&&e(c,a-r,0,.8*r),2&t&&e(c,-a+r,0,.8*r),4&t&&e(c,0,-a+r,.8*r),8&t&&e(c,0,a-r,.8*r),c.restore()},t.prototype.draw=function(e){this.drawBits(e.bits)},t.prototype.resize=function(){var e=this.size;e||(e=Math.min(this.canvas.clientWidth,this.canvas.clientHeight)),this.canvas.width===e&&this.canvas.height===e||(this.canvas.width=e,this.canvas.height=e)},t}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[n(9)],o=function(e){var t={kLeft:37,kRight:39,kUp:38,kDown:40},n=[37,39,38,40],r=[65,68,87,83],o={pads:[{keys:r}]},i={pads:[{keys:n}]},a=/^\d+$/,s=1,c=2,u=4,l=8,d={};d[-1]={direction:-1,dx:0,dy:0,bits:0,symbol:String.fromCharCode(10065)},d[0]={direction:0,dx:1,dy:0,bits:s,symbol:String.fromCharCode(8594)},d[1]={direction:1,dx:1,dy:1,bits:u|s,symbol:String.fromCharCode(8599)},d[2]={direction:2,dx:0,dy:1,bits:u,symbol:String.fromCharCode(8593)},d[3]={direction:3,dx:-1,dy:1,bits:u|c,symbol:String.fromCharCode(8598)},d[4]={direction:4,dx:-1,dy:0,bits:c,symbol:String.fromCharCode(8592)},d[5]={direction:5,dx:-1,dy:-1,bits:l|c,symbol:String.fromCharCode(8601)},d[6]={direction:6,dx:0,dy:-1,bits:l,symbol:String.fromCharCode(8595)},d[7]={direction:7,dx:1,dy:-1,bits:l|s,symbol:String.fromCharCode(8600)};var h=function(e){return{pad:e,info:void 0}},f=function(e,t,n,r){var o=d[t];n.pad=e,n.info=o,r(n)},p=function(e){return d[e]},v=function(t,n){var r=e.getAbsolutePosition(t),o=n.pageX-r.x,i=n.pageY-r.y;return{x:o,y:i}},m=function(e,t){var n={},r={},o=function(o,i){n[o]=i,r!==n&&(r=i,i?e(o):t(o))},i=function(e){o(e.keyCode,!1)},a=function(e){o(e.keyCode,!0)};window.addEventListener("keyup",i,!1),window.addEventListener("keydown",a,!1)},g=function(t,o){o||(o={pads:[{keys:r},{keys:n}]});for(var i=[],a=[],s=[],c=[],u=[{bit:1,exclude:2,mask:3},{bit:2,exclude:1,mask:3},{bit:4,exclude:8,mask:12},{bit:8,exclude:4,mask:12}],l={},d=0;dv;++v){var g=u[v],y={pad:d};e.copyProperties(g,y),l[p.keys[v]]=y}}var b=[-1,4,0,-1,2,3,1,-1,6,5,7,-1,-1,-1,-1,-1],E=function(e,n){var r=l[e];if(r){var o=r.pad,u=r.bit,d=i[o];if(n?(d|=u,a[o]=a[o]&~r.mask|r.exclude):(d&=~u,a[o]&=~r.mask),d!==i[o]){i[o]=d;var h=b[d&~a[o]];h!==s[o]&&(s[o]=h,f(o,h,c[o],t))}}},w=function(e){E(e,0)},S=function(e){E(e,1)};m(S,w)},y=function(e){var t={};Object.keys(e).forEach(function(n){var r=e[n];if(!a.test(n)){if(1!==n.length)throw"bad key code: '"+n+"'";n=n.charCodeAt(0)}t[n]=r});var n=function(e,n,r){var o=t[e];o&&o({keyCode:e,pressed:r})},r=function(e,t){n(e,t,!0)},o=function(e,t){n(e,t,!1)};m(r,o)};return{cursorKeys:t,createDirectionEventInfo:h,emitDirectionEvent:f,getDirectionInfo:p,kCursorKeys:n,kCursorPadOnly:i,kASWDKeys:r,kASWDPadOnly:o,getRelativeCoordinates:v,setupControllerKeys:m,setupKeyboardDPadKeys:g,setupKeys:y}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){var e={};return function(t,n){var r=e[t];return(!r||r.length=r)return n;var i=e(o,r);return n+i.substr(n.length-r)},r=function(n,r,o){if(n=t(n),n.length>=r)return n;var i=e(o,r);return i.substr(n.length-r)+n},o=function(){var e=/%\(([^\)]+)\)s/g;return function(t,n){return n.length||(n=[n]),t.replace(e,function(e,t){for(var r=t.split("."),o=0;o=t.length&&e.substr(0,t.length)===t},a=function(e,t){return e.length>=t.length&&e.substring(e.length-t.length)===t},s=String.fromCodePoint?String.fromCodePoint:function(){var e=String.fromCharCode,t=Math.floor,n=function(){var n,r,o=16384,i=[],a=-1,s=arguments.length;if(!s)return"";for(var c="";++au||u>1114111||t(u)!==u)throw new RangeError("Invalid code point: "+u);65535>=u?i.push(u):(u-=65536,n=(u>>10)+55296,r=u%1024+56320,i.push(n,r)),(a+1===s||i.length>o)&&(c+=e.apply(null,i),i.length=0)}return c};return n}(),c={endsWith:a,fromCodePoint:s,padLeft:r,padRight:n,replaceParams:o,startsWith:i};return c}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r,o;"use strict",r=[n(17),n(14),n(9)],o=function(e,t,n){var r=function(e){var n=e.callback,r=e.inputElement;e.deadSpaceRadius=e.deadSpaceRadius||10;var o=e.deadSpaceRadius*e.deadSpaceRadius,i=function(e,t){this.reset(e,t)};i.prototype.reset=function(e,t){return this.x=e,this.y=t,this},i.prototype.copyFrom=function(e){this.x=e.x,this.y=e.y},i.prototype.minusEq=function(e){return this.x-=e.x,this.y-=e.y,this};for(var a=function(e){return{pointerId:-1,pointerPos:new i(0,0),pointerStartPos:new i(0,0),vector:new i(0,0),dir:-1,lastDir:0,event:t.createDirectionEventInfo(e)}},s=[],c=0;ct?2:6:0>e?4:0},d=[3,4,2,-1,1,0,2,-1,5,4,6,-1,7,0,6,-1],h=function(t,n){var r=Math.abs(n)0?4:0)|(n>0?8:0);return d[i]},f=e.axisSize?h:u;4===e.divisions&&(f=l);var p=function(e,r){var o=s[e];t.emitDirectionEvent(e,r,o.event,n)},v=function(e,t,n){var r=-1;if(!n&&e.pointerId>=0){var i=e.vector.x*e.vector.x+e.vector.y*e.vector.y;i>o&&(r=f(e.vector.x,e.vector.y),e.lastDir=r)}e.dir!==r&&(e.dir=r,p(t,r))},m=function(n,r){var o=s[n],i=e.pads[n];o.pointerId=r.pointerId;var a=t.getRelativeCoordinates(i.referenceElement,r),c=a.x-(i.offsetX||i.referenceElement.clientWidth/2),u=a.y-(i.offsetY||i.referenceElement.clientHeight/2);e.fixedCenter?(o.pointerStartPos.reset(0,0),o.pointerPos.reset(c,u),o.vector.reset(c,u),v(o,n)):(o.pointerStartPos.reset(c,u),o.pointerPos.copyFrom(o.pointerStartPos),o.vector.reset(0,0),o.dir=o.lastDir,p(n,o.lastDir))},g=function(n){for(var r,o=0,i=0;ip)&&(r=p,o=i)}return o},y=function(e){var t=g(e);m(t,e)},b=function(n){for(var r=0;rr&&(t=this.eventSourceList[r]);r++)t.register.call(t,e)},unregister:function(e){for(var t,n=this.eventSourceList.length,r=0;n>r&&(t=this.eventSourceList[r]);r++)t.unregister.call(t,e)},contains:function(e,t){try{return e.contains(t)}catch(n){return!1}},down:function(e){e.bubbles=!0,this.fireEvent("pointerdown",e)},move:function(e){e.bubbles=!0,this.fireEvent("pointermove",e)},up:function(e){e.bubbles=!0,this.fireEvent("pointerup",e)},enter:function(e){e.bubbles=!1,this.fireEvent("pointerenter",e)},leave:function(e){e.bubbles=!1,this.fireEvent("pointerleave",e)},over:function(e){e.bubbles=!0,this.fireEvent("pointerover",e)},out:function(e){e.bubbles=!0,this.fireEvent("pointerout",e)},cancel:function(e){e.bubbles=!0,this.fireEvent("pointercancel",e)},leaveOut:function(e){this.out(e),this.contains(e.target,e.relatedTarget)||this.leave(e)},enterOver:function(e){this.over(e),this.contains(e.target,e.relatedTarget)||this.enter(e)},eventHandler:function(e){if(!e._handledByPE){var t=e.type,n=this.eventMap&&this.eventMap[t];n&&n(e),e._handledByPE=!0}},listen:function(e,t){t.forEach(function(t){this.addEvent(e,t)},this)},unlisten:function(e,t){t.forEach(function(t){this.removeEvent(e,t)},this)},addEvent:function(e,t){e.addEventListener(t,this.boundHandler)},removeEvent:function(e,t){e.removeEventListener(t,this.boundHandler)},makeEvent:function(e,t){this.captureInfo[t.pointerId]&&(t.relatedTarget=null);var n=new h(e,t);return t.preventDefault&&(n.preventDefault=t.preventDefault),n._target=n._target||t.target,n},fireEvent:function(e,t){var n=this.makeEvent(e,t);return this.dispatchEvent(n)},cloneEvent:function(e){for(var t,n=Object.create(null),r=0;ri&&(t=n[i]);i++){var s=Math.abs(r-t.x),c=Math.abs(o-t.y);if(_>=s&&_>=c)return!0}},prepareEvent:function(e){var t=w.cloneEvent(e),n=t.preventDefault;return t.preventDefault=function(){e.preventDefault(),n()},t.pointerId=this.POINTER_ID,t.isPrimary=!0,t.pointerType=this.POINTER_TYPE,t},prepareButtonsForMove:function(e,t){var n=A.get(this.POINTER_ID);e.buttons=n?n.buttons:0,t.buttons=e.buttons},mousedown:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=A.get(this.POINTER_ID),n=this.prepareEvent(e);Y||(n.buttons=D[n.button],t&&(n.buttons|=t.buttons),e.buttons=n.buttons),A.set(this.POINTER_ID,e),t?w.move(n):w.down(n)}},mousemove:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);Y||this.prepareButtonsForMove(t,e),w.move(t)}},mouseup:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=A.get(this.POINTER_ID),n=this.prepareEvent(e);if(!Y){var r=D[n.button];n.buttons=t?t.buttons&~r:0,e.buttons=n.buttons}A.set(this.POINTER_ID,e),0===n.buttons||n.buttons===D[n.button]?(this.cleanupMouse(),w.up(n)):w.move(n)}},mouseover:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);Y||this.prepareButtonsForMove(t,e),w.enterOver(t)}},mouseout:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);Y||this.prepareButtonsForMove(t,e),w.leaveOut(t)}},cancel:function(e){var t=this.prepareEvent(e);w.cancel(t),this.cleanupMouse()},cleanupMouse:function(){A["delete"](this.POINTER_ID)}},X=q,j=w.captureInfo,B=S.findTarget.bind(S),U=S.allShadows.bind(S),K=w.pointermap,W=2500,G=200,V="touch-action",J=!1,$={events:["touchstart","touchmove","touchend","touchcancel"],register:function(e){J?w.listen(e,this.events):z.enableOnSubtree(e)},unregister:function(e){J&&w.unlisten(e,this.events)},elementAdded:function(e){var t=e.getAttribute(V),n=this.touchActionToScrollType(t);n&&(e._scrollType=n,w.listen(e,this.events),U(e).forEach(function(e){e._scrollType=n,w.listen(e,this.events)},this))},elementRemoved:function(e){e._scrollType=void 0,w.unlisten(e,this.events),U(e).forEach(function(e){e._scrollType=void 0,w.unlisten(e,this.events)},this)},elementChanged:function(e,t){var n=e.getAttribute(V),r=this.touchActionToScrollType(n),o=this.touchActionToScrollType(t);r&&o?(e._scrollType=r,U(e).forEach(function(e){e._scrollType=r},this)):o?this.elementRemoved(e):r&&this.elementAdded(e)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(e){var t=e,n=this.scrollTypes;return"none"===t?"none":t===n.XSCROLLER?"X":t===n.YSCROLLER?"Y":n.SCROLLER.exec(t)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(e){return this.firstTouch===e.identifier},setPrimaryTouch:function(e){(0===K.size||1===K.size&&K.has(1))&&(this.firstTouch=e.identifier,this.firstXY={X:e.clientX,Y:e.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(e){e.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var e=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(e,G)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(e){var t=0;return("touchstart"===e||"touchmove"===e)&&(t=1),t},touchToPointer:function(e){var t=this.currentTouchEvent,n=w.cloneEvent(e),r=n.pointerId=e.identifier+2;n.target=j[r]||B(n),n.bubbles=!0,n.cancelable=!0,n.detail=this.clickCount,n.button=0,n.buttons=this.typeToButtons(t.type),n.width=e.radiusX||e.webkitRadiusX||0,n.height=e.radiusY||e.webkitRadiusY||0,n.pressure=e.force||e.webkitForce||.5,n.isPrimary=this.isPrimaryTouch(e),n.pointerType=this.POINTER_TYPE;var o=this;return n.preventDefault=function(){o.scrolling=!1,o.firstXY=null,t.preventDefault()},n},processTouches:function(e,t){var n=e.changedTouches;this.currentTouchEvent=e;for(var r,o=0;o=s}return this.firstXY=null,t}},findTouch:function(e,t){for(var n,r=0,o=e.length;o>r&&(n=e[r]);r++)if(n.identifier===t)return!0},vacuumTouches:function(e){var t=e.touches;if(K.size>=t.length){var n=[];K.forEach(function(e,r){if(1!==r&&!this.findTouch(t,r-2)){var o=e.out;n.push(o)}},this),n.forEach(this.cancelOut,this)}},touchstart:function(e){this.vacuumTouches(e),this.setPrimaryTouch(e.changedTouches[0]),this.dedupSynthMouse(e),this.scrolling||(this.clickCount++,this.processTouches(e,this.overDown))},overDown:function(e){K.set(e.pointerId,{target:e.target,out:e,outTarget:e.target}),w.over(e),w.enter(e),w.down(e)},touchmove:function(e){this.scrolling||(this.shouldScroll(e)?(this.scrolling=!0,this.touchcancel(e)):(e.preventDefault(),this.processTouches(e,this.moveOverOut)))},moveOverOut:function(e){var t=e,n=K.get(t.pointerId);if(n){var r=n.out,o=n.outTarget;w.move(t),r&&o!==t.target&&(r.relatedTarget=t.target,t.relatedTarget=o,r.target=o,t.target?(w.leaveOut(r),w.enterOver(t)):(t.target=o,t.relatedTarget=null,this.cancelOut(t))),n.out=t,n.outTarget=t.target}},touchend:function(e){this.dedupSynthMouse(e),this.processTouches(e,this.upOut)},upOut:function(e){this.scrolling||(w.up(e),w.out(e),w.leave(e)),this.cleanUpPointer(e)},touchcancel:function(e){this.processTouches(e,this.cancelOut)},cancelOut:function(e){w.cancel(e),w.out(e),w.leave(e),this.cleanUpPointer(e)},cleanUpPointer:function(e){K["delete"](e.pointerId),this.removePrimaryPointer(e)},dedupSynthMouse:function(e){var t=X.lastTouches,n=e.changedTouches[0];if(this.isPrimaryTouch(n)){var r={x:n.clientX,y:n.clientY};t.push(r);var o=function(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}.bind(null,t,r);setTimeout(o,W)}}};J||(z=new L($.elementAdded,$.elementRemoved,$.elementChanged,$));var Q,Z,ee=$,te=w.pointermap,ne=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,re={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(e){w.listen(e,this.events)},unregister:function(e){w.unlisten(e,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(e){var t=e;return ne&&(t=w.cloneEvent(e),t.pointerType=this.POINTER_TYPES[e.pointerType]),t},cleanup:function(e){te["delete"](e)},MSPointerDown:function(e){te.set(e.pointerId,e);var t=this.prepareEvent(e);w.down(t)},MSPointerMove:function(e){var t=this.prepareEvent(e);w.move(t)},MSPointerUp:function(e){var t=this.prepareEvent(e);w.up(t),this.cleanup(e.pointerId)},MSPointerOut:function(e){var t=this.prepareEvent(e);w.leaveOut(t)},MSPointerOver:function(e){var t=this.prepareEvent(e);w.enterOver(t)},MSPointerCancel:function(e){var t=this.prepareEvent(e);w.cancel(t),this.cleanup(e.pointerId)},MSLostPointerCapture:function(e){var t=w.makeEvent("lostpointercapture",e);w.dispatchEvent(t)},MSGotPointerCapture:function(e){var t=w.makeEvent("gotpointercapture",e);w.dispatchEvent(t)}},oe=re,ie=window.navigator;ie.msPointerEnabled?(Q=function(e){c(e),this.msSetPointerCapture(e)},Z=function(e){c(e),this.msReleasePointerCapture(e)}):(Q=function(e){c(e),w.setCapture(e,this)},Z=function(e){c(e),w.releaseCapture(e,this)}),a(),s(),u();var ae={dispatcher:w,Installer:L,PointerEvent:h,PointerMap:v,targetFinding:S};return ae})}]); \ No newline at end of file +!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var r,o;r=[n(1),n(5),n(13),n(14),n(9),n(10),n(15),n(16)],o=function(e,t,n,r,o,i,a,s){window.sampleUI=window.sampleUI||{};var c=window.sampleUI;c.commonUI=e,c.dialog=t,c.dpad=n,c.input=r,c.misc=o,c.mobileHacks=i,c.strings=a,c.touch=s}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[n(3),n(8),n(4),n(5),n(6),n(2),n(9),n(10),n(11),n(12)],o=function(e,t,n,r,o,i,a,s,c,u){function l(e){if(e=e||"",!v){v=document.createElement("div");var t=document.getElementById("hft-menu");t.parentNode.insertBefore(v,t)}e.indexOf("portrait")>=0?v.innerHTML=E:e.indexOf("landscape")>=0?v.innerHTML=b:v.innerHTML=""}function d(){o.isFullScreen()&&c.set(g.orientation)}function h(e,t){if(g.orientation=e,c.canOrient())d();else{var n=g.orientation;t&&(n="none"),l(n)}}function f(){r.modal({title:"HappyFunTimes",msg:"This game requires the HappyFunTimes App
Please download it from your app store"},function(){var e=window.navigator.userAgent;e.indexOf("iPhone")>=0||e.indexOf("iPad")>=0?a.gotoIFrame("itms://itunes.apple.com/"):e.indexOf("Android")>=0?a.gotoIFrame("market://details?id=com.greggman.HappyFunTimes"):showRequiredApp()})}function p(e){var t=m("hft-menu");t.style.display=e?"block":"none"}var v,m=function(e){return document.getElementById(e)},g={logger:new i.NullLogger},y={},b=['
','
','
'," Turn the Screen ","
",'
'," ↺ ","
","
","
"].join("\n"),E=['
','
','
'," Turn the Screen ","
",'
'," ↻ ","
","
","
"].join("\n"),w=function(t,n){function r(t){e.sendJSON(window.location.href,{cmd:"happyFunTimesPing"},function(e,n){t(e,n)},{timeout:2e3})}n=n||{};var c=m("hft-settings"),l=m("hft-disconnected"),v=m("hft-touchstart"),b=m("hft-menu");b.addEventListener("click",function(){c.style.display="block"},!1),b.addEventListener("touchstart",function(){c.style.display="block"},!1),p(!1);var E=function(){o.isFullScreen()||(v.removeEventListener("touchstart",E,!1),v.style.display="none",o.requestFullScreen(document.body))},w=function(){o.isFullScreen()?d():o.canGoFullScreen()&&(v.addEventListener("touchstart",E,!1),v.style.display="block")};if(o.onFullScreenChange(document.body,w),s.isMobile()&&w(),y.playerNameHandler=new u(t,m("hft-name")),m("hft-setname").addEventListener("click",function(){c.style.display="none",y.playerNameHandler.startNameEntry()},!1),m("hft-restart").addEventListener("click",function(){window.location.reload()},!1),m("hft-back").addEventListener("click",function(){c.style.display="none"}),t.addEventListener("connect",function(){l.style.display="none",n.connectFn&&n.connectFn()}),t.addEventListener("disconnect",function(){function e(){r(function(t,n){return t?(setTimeout(e,1e3),void 0):(window.location.href="/",void 0)})}l.style.display="block",n.disconnectFn&&n.disconnectFn(),setTimeout(e,2e3)}),t.addEventListener("_hft_redirect_",function(e){window.location.href=e.url}),h(n.orientation,n.orientationOptional),n.requireApp&&f(),n.debug){g.statusNode=document.createTextNode(""),m("hft-status").appendChild(g.statusNode);var S=a.findCSSStyleRule("#hft-debug");S.style.display="block",g.logger=new i.HTMLLogger(m("hft-console"),n.numConsoleLines)}if(n.consoleTarget){switch(n.consoleTarget.toLowerCase()){case"html":g.logger=g.logger||new i.HTMLLogger(m("hft-console"),n.numConsoleLines),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)});break;case"game":g.logger=new i.GameLogger(t),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)})}console.log("here")}},S=function(){S=function(){},y.playerNameHandler.isNameSet()||y.playerNameHandler.startNameEntry()},T=function(e){g.statusNode&&(g.statusNode.nodeValue=e)},P=function(e){g.logger.log(e)},I=function(e){g.logger.error(e)};return{askForNameOnce:S,log:P,error:I,setOrientation:h,setStatus:T,setupStandardControllerUI:w,showMenu:p}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){};e.prototype.log=function(){},e.prototype.error=function(){};var t=function(){};t.prototype.log=function(){console.log.apply(console,arguments)},t.prototype.error=function(){console.error.apply(console,arguments)};var n=function(e,t){this.container=e,this.maxLines=t||10,this.lines=[]};n.prototype.addLine_=function(e,t){var n,r;this.lines.lengtho;++o){var i=e[o];void 0===i?r.push("undefined"):"number"==typeof i?(t&&r.push(", "),i===Math.floor(i)?r.push(i.toFixed(0)):r.push(i.toFixed(3)),t=!0):window.Float32Array&&i instanceof Float32Array?r.push(tdl.string.argsToString(i)):(r.push(i.toString()),t=!1)}return r.join("")};n.prototype.log=function(){this.addLine_(r(arguments),void 0)},n.prototype.error=function(){this.addLine_(r(arguments),"red")};var o=function(e){this.log=e.logImpl.bind(e),this.error=e.errorImpl.bind(e)};return{ConsoleLogger:t,GameLogger:o,HTMLLogger:n,NullLogger:e}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;"use strict",r=function(){var e=function(){},t=function(t,n,r,o){o=o||{};var i=new XMLHttpRequest;i.overrideMimeType&&i.overrideMimeType("text/plain");var a=o.timeout||0;a&&(i.timeout=a,e("set timeout to: "+i.timeout)),i.open("POST",t,!0);var s=JSON.stringify(n),c=function(t,n){r&&(e("calling-callback:"+(t?" has error":"success")),r(t,n),r=void 0)},u=function(){e("--error--"),c("error sending json to "+t)},l=function(){e("--timeout--"),c("timeout sending json to "+t)},d=function(){r&&(e("--forced timeout--"),i.abort(),c("forced timeout sending json to "+t))},h=function(){e("--finish--");var n=void 0,r=200===i.status||0===i.status;if(r)try{n=JSON.parse(i.responseText)}catch(o){r=!1}c(r?null:"could not load: "+t,n)};try{a&&setTimeout(d,a+50),i.addEventListener("load",h,!1),i.addEventListener("timeout",l,!1),i.addEventListener("error",u,!1),i.setRequestHeader("Content-type","application/json"),i.send(s),e("--sent: "+t)}catch(f){e("--exception--"),setTimeout(function(){c("could not load: "+t,null)},0)}};return{sendJSON:t}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;r=function(){var e=function(e,t){var n=t||"/";this.set=function(t,r){if(void 0===t)return this.erase(),void 0;if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.setItem(e,t),void 0;var o="";r=r||9999;var i=new Date;i.setTime(Date.now()+Math.floor(24*r*60*60*1e3)),o="; expires="+i.toGMTString();var a=encodeURIComponent(e)+"="+encodeURIComponent(t)+o+"; path="+n;document.cookie=a},this.get=function(){if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.getItem(e);for(var t=encodeURIComponent(e)+"=",n=document.cookie.split(";"),r=0;rn;++n)t+=(16*Math.random()|0).toString(16);return t}function c(e,t){Object.keys(t).forEach(function(n){e.addEventListener(n,t[n])})}var u=function(e,t,n){return Object.keys(e).forEach(function(r){if(2!==n||void 0===t[r]){var o=e[r];if(o instanceof Array){var i=t[r];i||(i=[],t[name]=i),u(o,i,n)}else if(!(o instanceof Object)||o instanceof Function||o instanceof HTMLElement){if(1===n&&void 0!==t[r])return;t[r]=o}else{var a=t[r];a||(a={},t[r]=a),u(o,a,n)}}}),t},l=function(t,n){var r=n||{};try{var o=t.indexOf("?"),i=t.indexOf("#");0>i&&(i=t.length);var a=t.substring(o+1,i);e(a,r)}catch(i){console.error(i)}return r},d=function(t){return e(window.location.search,t)},h=new RegExp("([a-zA-Z0-9_]+):","g"),f=function(e,t){var n=t||"settings",r=d(),o=e||{},i=r[n];if(i){var a=i.replace(h,'"$1":'),s=JSON.parse(a);u(s,o)}return o},p=["","moz","webkit","ms"],v=function(e){return Math.floor(Math.random()*e)},m=function(e){for(var t=e||v,n=t(3),r=[],o=0;3>o;++o)r.push(t(128)+(o===n?128:64));return"rgb("+r.join(",")+")"},g=function(e){for(var t=e||v,n=t(3),r=255,o=0;3>o;++o)r=r<<8|t(128)+(o===n?128:64);return r},y=function(e){for(var t=0;te?-1:e>0?1:0},P=function(e,t){return Math.abs(e)=8}}();return n&&(e||t)}(),o=function(){return r},i=function(){var e=/iP(hone|od|ad)/i.test(navigator.platform);return function(){return e}}(),a=function(){var e=/Android|webOS|Phone|Pad|Pod|Tablet|BlackBerry/i.test(navigator.userAgent);return function(){return e}}(),s=function(){for(var e=document.querySelectorAll(".fixheight"),t=0;t]/g,"");t.length>16&&(t=t.substring(0,16)),0===t.length?a.value=u:t!==u&&(u=t,c.set(u,700),m()),g(!1)};this.startNameEntry=function(){l.style.display="block",d.style.display="none",s()||(a.value=t.pickRandomElement(o)),a.focus()},i.addEventListener("_hft_setname_",v),a.addEventListener("click",y,!1),a.addEventListener("change",b,!1),a.addEventListener("blur",b,!1),a.addEventListener("focus",y,!1),a.form&&a.form.addEventListener("submit",b,!1),f(),m()};return i}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[],o=function(){var e=function(e,t,n,r,o){o=o||1,e.beginPath(),e.arc(t,n,r,0,2*Math.PI),1&o&&e.fill(),2&o&&e.stroke()},t=function(e){this.element=e.element,this.size=e.size,this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.resize(),this.ctx=this.canvas.getContext("2d"),this.drawBits(0)};return t.prototype.getSize=function(){var e=this.size;return e||(e=Math.min(this.canvas.width,this.canvas.height)),e},t.prototype.drawBits=function(t){var n=this.getSize(),r=Math.floor(n/6.5),o=Math.floor(n/2),i=Math.floor(n/2),a=Math.floor(n/2*.8),s=Math.floor(n/2*.8),c=this.ctx;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.save(),c.translate(o,i),c.fillStyle="#AAA",c.stokeStyle="#444",e(c,0,0,.95*o,3),c.fillStyle="#888",c.fillRect(-r,-s,2*r,2*s),c.fillRect(-a,-r,2*a,2*r),c.fillStyle="#CCC",1&t&&e(c,a-r,0,.8*r),2&t&&e(c,-a+r,0,.8*r),4&t&&e(c,0,-a+r,.8*r),8&t&&e(c,0,a-r,.8*r),c.restore()},t.prototype.draw=function(e){this.drawBits(e.bits)},t.prototype.resize=function(){var e=this.size;e||(e=Math.min(this.canvas.clientWidth,this.canvas.clientHeight)),this.canvas.width===e&&this.canvas.height===e||(this.canvas.width=e,this.canvas.height=e)},t}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[n(9)],o=function(e){var t={kLeft:37,kRight:39,kUp:38,kDown:40},n=[37,39,38,40],r=[65,68,87,83],o={pads:[{keys:r}]},i={pads:[{keys:n}]},a=/^\d+$/,s=1,c=2,u=4,l=8,d={};d[-1]={direction:-1,dx:0,dy:0,bits:0,symbol:String.fromCharCode(10065)},d[0]={direction:0,dx:1,dy:0,bits:s,symbol:String.fromCharCode(8594)},d[1]={direction:1,dx:1,dy:1,bits:u|s,symbol:String.fromCharCode(8599)},d[2]={direction:2,dx:0,dy:1,bits:u,symbol:String.fromCharCode(8593)},d[3]={direction:3,dx:-1,dy:1,bits:u|c,symbol:String.fromCharCode(8598)},d[4]={direction:4,dx:-1,dy:0,bits:c,symbol:String.fromCharCode(8592)},d[5]={direction:5,dx:-1,dy:-1,bits:l|c,symbol:String.fromCharCode(8601)},d[6]={direction:6,dx:0,dy:-1,bits:l,symbol:String.fromCharCode(8595)},d[7]={direction:7,dx:1,dy:-1,bits:l|s,symbol:String.fromCharCode(8600)};var h=function(e){return{pad:e,info:void 0}},f=function(e,t,n,r){var o=d[t];n.pad=e,n.info=o,r(n)},p=function(e){return d[e]},v=function(t,n){var r=e.getAbsolutePosition(t),o=n.pageX-r.x,i=n.pageY-r.y;return{x:o,y:i}},m=function(e,t){var n={},r={},o=function(o,i){n[o]=i,r!==n&&(r=i,i?e(o):t(o))},i=function(e){o(e.keyCode,!1)},a=function(e){o(e.keyCode,!0)};window.addEventListener("keyup",i,!1),window.addEventListener("keydown",a,!1)},g=function(t,o){o||(o={pads:[{keys:r},{keys:n}]});for(var i=[],a=[],s=[],c=[],u=[{bit:1,exclude:2,mask:3},{bit:2,exclude:1,mask:3},{bit:4,exclude:8,mask:12},{bit:8,exclude:4,mask:12}],l={},d=0;dv;++v){var g=u[v],y={pad:d};e.copyProperties(g,y),l[p.keys[v]]=y}}var b=[-1,4,0,-1,2,3,1,-1,6,5,7,-1,-1,-1,-1,-1],E=function(e,n){var r=l[e];if(r){var o=r.pad,u=r.bit,d=i[o];if(n?(d|=u,a[o]=a[o]&~r.mask|r.exclude):(d&=~u,a[o]&=~r.mask),d!==i[o]){i[o]=d;var h=b[d&~a[o]];h!==s[o]&&(s[o]=h,f(o,h,c[o],t))}}},w=function(e){E(e,0)},S=function(e){E(e,1)};m(S,w)},y=function(e){var t={};Object.keys(e).forEach(function(n){var r=e[n];if(!a.test(n)){if(1!==n.length)throw"bad key code: '"+n+"'";n=n.charCodeAt(0)}t[n]=r});var n=function(e,n,r){var o=t[e];o&&o({keyCode:e,pressed:r})},r=function(e,t){n(e,t,!0)},o=function(e,t){n(e,t,!1)};m(r,o)};return{cursorKeys:t,createDirectionEventInfo:h,emitDirectionEvent:f,getDirectionInfo:p,kCursorKeys:n,kCursorPadOnly:i,kASWDKeys:r,kASWDPadOnly:o,getRelativeCoordinates:v,setupControllerKeys:m,setupKeyboardDPadKeys:g,setupKeys:y}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){var e={};return function(t,n){var r=e[t];return(!r||r.length=r)return n;var i=e(o,r);return n+i.substr(n.length-r)},r=function(n,r,o){if(n=t(n),n.length>=r)return n;var i=e(o,r);return i.substr(n.length-r)+n},o=function(){var e=/%\(([^\)]+)\)s/g;return function(t,n){return n.length||(n=[n]),t.replace(e,function(e,t){for(var r=t.split("."),o=0;o=t.length&&e.substr(0,t.length)===t},a=function(e,t){return e.length>=t.length&&e.substring(e.length-t.length)===t},s=String.fromCodePoint?String.fromCodePoint:function(){var e=String.fromCharCode,t=Math.floor,n=function(){var n,r,o=16384,i=[],a=-1,s=arguments.length;if(!s)return"";for(var c="";++au||u>1114111||t(u)!==u)throw new RangeError("Invalid code point: "+u);65535>=u?i.push(u):(u-=65536,n=(u>>10)+55296,r=u%1024+56320,i.push(n,r)),(a+1===s||i.length>o)&&(c+=e.apply(null,i),i.length=0)}return c};return n}(),c={endsWith:a,fromCodePoint:s,padLeft:r,padRight:n,replaceParams:o,startsWith:i};return c}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r,o;"use strict",r=[n(17),n(14),n(9)],o=function(e,t,n){var r=function(e){var n=e.callback,r=e.inputElement;e.deadSpaceRadius=e.deadSpaceRadius||10;var o=e.deadSpaceRadius*e.deadSpaceRadius,i=function(e,t){this.reset(e,t)};i.prototype.reset=function(e,t){return this.x=e,this.y=t,this},i.prototype.copyFrom=function(e){this.x=e.x,this.y=e.y},i.prototype.minusEq=function(e){return this.x-=e.x,this.y-=e.y,this};for(var a=function(e){return{pointerId:-1,pointerPos:new i(0,0),pointerStartPos:new i(0,0),vector:new i(0,0),dir:-1,lastDir:0,event:t.createDirectionEventInfo(e)}},s=[],c=0;ct?2:6:0>e?4:0},d=[3,4,2,-1,1,0,2,-1,5,4,6,-1,7,0,6,-1],h=function(t,n){var r=Math.abs(n)0?4:0)|(n>0?8:0);return d[i]},f=e.axisSize?h:u;4===e.divisions&&(f=l);var p=function(e,r){var o=s[e];t.emitDirectionEvent(e,r,o.event,n)},v=function(e,t,n){var r=-1;if(!n){var i=e.vector.x*e.vector.x+e.vector.y*e.vector.y;i>o&&(r=f(e.vector.x,e.vector.y),e.lastDir=r)}e.dir!==r&&(e.dir=r,p(t,r))},m=function(n,r){var o=s[n],i=e.pads[n];o.pointerId=r.pointerId;var a=t.getRelativeCoordinates(i.referenceElement,r),c=a.x-(i.offsetX||i.referenceElement.clientWidth/2),u=a.y-(i.offsetY||i.referenceElement.clientHeight/2);e.fixedCenter?(o.pointerStartPos.reset(0,0),o.pointerPos.reset(c,u),o.vector.reset(c,u),v(o,n)):(o.pointerStartPos.reset(c,u),o.pointerPos.copyFrom(o.pointerStartPos),o.vector.reset(0,0),o.dir=o.lastDir,p(n,o.lastDir))},g=function(n){for(var r,o=0,i=0;ip)&&(r=p,o=i)}return o},y=function(e){var t=g(e);m(t,e)},b=function(n){for(var r=0;rr&&(t=this.eventSourceList[r]);r++)t.register.call(t,e)},unregister:function(e){for(var t,n=this.eventSourceList.length,r=0;n>r&&(t=this.eventSourceList[r]);r++)t.unregister.call(t,e)},contains:function(e,t){try{return e.contains(t)}catch(n){return!1}},down:function(e){e.bubbles=!0,this.fireEvent("pointerdown",e)},move:function(e){e.bubbles=!0,this.fireEvent("pointermove",e)},up:function(e){e.bubbles=!0,this.fireEvent("pointerup",e)},enter:function(e){e.bubbles=!1,this.fireEvent("pointerenter",e)},leave:function(e){e.bubbles=!1,this.fireEvent("pointerleave",e)},over:function(e){e.bubbles=!0,this.fireEvent("pointerover",e)},out:function(e){e.bubbles=!0,this.fireEvent("pointerout",e)},cancel:function(e){e.bubbles=!0,this.fireEvent("pointercancel",e)},leaveOut:function(e){this.out(e),this.propagate(e,this.leave,!1)},enterOver:function(e){this.over(e),this.propagate(e,this.enter,!0)},eventHandler:function(e){if(!e._handledByPE){var t=e.type,n=this.eventMap&&this.eventMap[t];n&&n(e),e._handledByPE=!0}},listen:function(e,t){t.forEach(function(t){this.addEvent(e,t)},this)},unlisten:function(e,t){t.forEach(function(t){this.removeEvent(e,t)},this)},addEvent:function(e,t){e.addEventListener(t,this.boundHandler)},removeEvent:function(e,t){e.removeEventListener(t,this.boundHandler)},makeEvent:function(t,n){this.captureInfo[n.pointerId]&&(n.relatedTarget=null);var r=new e(t,n);return n.preventDefault&&(r.preventDefault=n.preventDefault),r._target=r._target||n.target,r},fireEvent:function(e,t){var n=this.makeEvent(e,t);return this.dispatchEvent(n)},cloneEvent:function(e){for(var t,n=Object.create(null),r=0;ri&&(t=n[i]);i++){var s=Math.abs(r-t.x),c=Math.abs(o-t.y);if(N>=s&&N>=c)return!0}},prepareEvent:function(e){var t=E.cloneEvent(e),n=t.preventDefault;return t.preventDefault=function(){e.preventDefault(),n()},t.pointerId=this.POINTER_ID,t.isPrimary=!0,t.pointerType=this.POINTER_TYPE,t},prepareButtonsForMove:function(e,t){var n=F.get(this.POINTER_ID);0!==t.which&&n?e.buttons=n.buttons:e.buttons=0,t.buttons=e.buttons},mousedown:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=F.get(this.POINTER_ID),n=this.prepareEvent(e);D||(n.buttons=A[n.button],t&&(n.buttons|=t.buttons),e.buttons=n.buttons),F.set(this.POINTER_ID,e),t&&0!==t.buttons?E.move(n):E.down(n)}},mousemove:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);D||this.prepareButtonsForMove(t,e),t.button=-1,F.set(this.POINTER_ID,e),E.move(t)}},mouseup:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=F.get(this.POINTER_ID),n=this.prepareEvent(e);if(!D){var r=A[n.button];n.buttons=t?t.buttons&~r:0,e.buttons=n.buttons}F.set(this.POINTER_ID,e),n.buttons&=~A[n.button],0===n.buttons?E.up(n):E.move(n)}},mouseover:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);D||this.prepareButtonsForMove(t,e),t.button=-1,F.set(this.POINTER_ID,e),E.enterOver(t)}},mouseout:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);D||this.prepareButtonsForMove(t,e),t.button=-1,E.leaveOut(t)}},cancel:function(e){var t=this.prepareEvent(e);E.cancel(t),this.deactivateMouse()},deactivateMouse:function(){F["delete"](this.POINTER_ID)}},z=E.captureInfo,q=w.findTarget.bind(w),X=w.allShadows.bind(w),j=E.pointermap,B=2500,U=200,K="touch-action",W={events:["touchstart","touchmove","touchend","touchcancel"],register:function(e){Y.enableOnSubtree(e)},unregister:function(){},elementAdded:function(e){var t=e.getAttribute(K),n=this.touchActionToScrollType(t);n&&(e._scrollType=n,E.listen(e,this.events),X(e).forEach(function(e){e._scrollType=n,E.listen(e,this.events)},this))},elementRemoved:function(e){e._scrollType=void 0,E.unlisten(e,this.events),X(e).forEach(function(e){e._scrollType=void 0,E.unlisten(e,this.events)},this)},elementChanged:function(e,t){var n=e.getAttribute(K),r=this.touchActionToScrollType(n),o=this.touchActionToScrollType(t);r&&o?(e._scrollType=r,X(e).forEach(function(e){e._scrollType=r},this)):o?this.elementRemoved(e):r&&this.elementAdded(e)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(e){var t=e,n=this.scrollTypes;return"none"===t?"none":t===n.XSCROLLER?"X":t===n.YSCROLLER?"Y":n.SCROLLER.exec(t)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(e){return this.firstTouch===e.identifier},setPrimaryTouch:function(e){(0===j.size||1===j.size&&j.has(1))&&(this.firstTouch=e.identifier,this.firstXY={X:e.clientX,Y:e.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(e){e.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var e=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(e,U)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(e){var t=0;return"touchstart"!==e&&"touchmove"!==e||(t=1),t},touchToPointer:function(e){var t=this.currentTouchEvent,n=E.cloneEvent(e),r=n.pointerId=e.identifier+2;n.target=z[r]||q(n),n.bubbles=!0,n.cancelable=!0,n.detail=this.clickCount,n.button=0,n.buttons=this.typeToButtons(t.type),n.width=2*(e.radiusX||e.webkitRadiusX||0),n.height=2*(e.radiusY||e.webkitRadiusY||0),n.pressure=e.force||e.webkitForce||.5,n.isPrimary=this.isPrimaryTouch(e),n.pointerType=this.POINTER_TYPE,n.altKey=t.altKey,n.ctrlKey=t.ctrlKey,n.metaKey=t.metaKey,n.shiftKey=t.shiftKey;var o=this;return n.preventDefault=function(){o.scrolling=!1,o.firstXY=null,t.preventDefault()},n},processTouches:function(e,t){var n=e.changedTouches;this.currentTouchEvent=e;for(var r,o=0;o=s}return this.firstXY=null,t}},findTouch:function(e,t){for(var n,r=0,o=e.length;o>r&&(n=e[r]);r++)if(n.identifier===t)return!0},vacuumTouches:function(e){var t=e.touches;if(j.size>=t.length){var n=[];j.forEach(function(e,r){if(1!==r&&!this.findTouch(t,r-2)){var o=e.out;n.push(o)}},this),n.forEach(this.cancelOut,this)}},touchstart:function(e){this.vacuumTouches(e),this.setPrimaryTouch(e.changedTouches[0]),this.dedupSynthMouse(e),this.scrolling||(this.clickCount++,this.processTouches(e,this.overDown))},overDown:function(e){j.set(e.pointerId,{target:e.target,out:e,outTarget:e.target}),E.enterOver(e),E.down(e)},touchmove:function(e){this.scrolling||(this.shouldScroll(e)?(this.scrolling=!0,this.touchcancel(e)):(e.preventDefault(),this.processTouches(e,this.moveOverOut)))},moveOverOut:function(e){var t=e,n=j.get(t.pointerId);if(n){var r=n.out,o=n.outTarget;E.move(t),r&&o!==t.target&&(r.relatedTarget=t.target,t.relatedTarget=o,r.target=o,t.target?(E.leaveOut(r),E.enterOver(t)):(t.target=o,t.relatedTarget=null,this.cancelOut(t))),n.out=t,n.outTarget=t.target}},touchend:function(e){this.dedupSynthMouse(e),this.processTouches(e,this.upOut)},upOut:function(e){this.scrolling||(E.up(e),E.leaveOut(e)),this.cleanUpPointer(e)},touchcancel:function(e){this.processTouches(e,this.cancelOut)},cancelOut:function(e){E.cancel(e),E.leaveOut(e),this.cleanUpPointer(e)},cleanUpPointer:function(e){j["delete"](e.pointerId),this.removePrimaryPointer(e)},dedupSynthMouse:function(e){var t=H.lastTouches,n=e.changedTouches[0];if(this.isPrimaryTouch(n)){var r={x:n.clientX,y:n.clientY};t.push(r);var o=function(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}.bind(null,t,r);setTimeout(o,B)}}};Y=new n(W.elementAdded,W.elementRemoved,W.elementChanged,W);var G,V,J,$=E.pointermap,Q=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,Z={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(e){E.listen(e,this.events)},unregister:function(e){E.unlisten(e,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(e){var t=e;return Q&&(t=E.cloneEvent(e),t.pointerType=this.POINTER_TYPES[e.pointerType]),t},cleanup:function(e){$["delete"](e)},MSPointerDown:function(e){$.set(e.pointerId,e);var t=this.prepareEvent(e);E.down(t)},MSPointerMove:function(e){var t=this.prepareEvent(e);E.move(t)},MSPointerUp:function(e){var t=this.prepareEvent(e);E.up(t),this.cleanup(e.pointerId)},MSPointerOut:function(e){var t=this.prepareEvent(e);E.leaveOut(t)},MSPointerOver:function(e){var t=this.prepareEvent(e);E.enterOver(t)},MSPointerCancel:function(e){var t=this.prepareEvent(e);E.cancel(t),this.cleanup(e.pointerId)},MSLostPointerCapture:function(e){var t=E.makeEvent("lostpointercapture",e);E.dispatchEvent(t)},MSGotPointerCapture:function(e){var t=E.makeEvent("gotpointercapture",e);E.dispatchEvent(t)}},ee=window.navigator;ee.msPointerEnabled?(G=function(e){c(e),u(this),l(e)&&(E.setCapture(e,this,!0),this.msSetPointerCapture(e))},V=function(e){c(e),E.releaseCapture(e,!0),this.msReleasePointerCapture(e)}):(G=function(e){c(e),u(this),l(e)&&E.setCapture(e,this)},V=function(e){c(e),E.releaseCapture(e)}),J=function(e){return!!E.captureInfo[e]},a(),s(),d();var te={dispatcher:E,Installer:n,PointerEvent:e,PointerMap:v,targetFinding:w};return te})}]); \ No newline at end of file diff --git a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui.js.bytes b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui.js.bytes index b980e3d..3da75b3 100644 --- a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui.js.bytes +++ b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/sample-ui/sample-ui.js.bytes @@ -3431,7 +3431,7 @@ var updatePad = function(pad, padId, out) { var newDir = -1; - if (!out && pad.pointerId >= 0) { + if (!out /* && pad.pointerId !== 0*/) { var distSq = pad.vector.x * pad.vector.x + pad.vector.y * pad.vector.y; if (distSq > deadSpaceRadiusSq) { newDir = computeDir(pad.vector.x, pad.vector.y); @@ -3697,10 +3697,215 @@ /***/ function(module, exports, __webpack_require__) { /*! - * PEP v0.4.1 | https://github.com/jquery/PEP + * PEP v0.4.3 | https://github.com/jquery/PEP * Copyright jQuery Foundation and other contributors | http://jquery.org/license */ - !function(a,b){ true?module.exports=b():"function"==typeof define&&define.amd?define(b):a.PointerEventsPolyfill=b()}(this,function(){"use strict";function a(a,b){b=b||Object.create(null);var c=document.createEvent("Event");c.initEvent(a,b.bubbles||!1,b.cancelable||!1);for(var d,e=2;ed&&(b=this.eventSourceList[d]);d++)b.register.call(b,a)},unregister:function(a){for(var b,c=this.eventSourceList.length,d=0;c>d&&(b=this.eventSourceList[d]);d++)b.unregister.call(b,a)},contains:function(a,b){try{return a.contains(b)}catch(c){return!1}},down:function(a){a.bubbles=!0,this.fireEvent("pointerdown",a)},move:function(a){a.bubbles=!0,this.fireEvent("pointermove",a)},up:function(a){a.bubbles=!0,this.fireEvent("pointerup",a)},enter:function(a){a.bubbles=!1,this.fireEvent("pointerenter",a)},leave:function(a){a.bubbles=!1,this.fireEvent("pointerleave",a)},over:function(a){a.bubbles=!0,this.fireEvent("pointerover",a)},out:function(a){a.bubbles=!0,this.fireEvent("pointerout",a)},cancel:function(a){a.bubbles=!0,this.fireEvent("pointercancel",a)},leaveOut:function(a){this.out(a),this.contains(a.target,a.relatedTarget)||this.leave(a)},enterOver:function(a){this.over(a),this.contains(a.target,a.relatedTarget)||this.enter(a)},eventHandler:function(a){if(!a._handledByPE){var b=a.type,c=this.eventMap&&this.eventMap[b];c&&c(a),a._handledByPE=!0}},listen:function(a,b){b.forEach(function(b){this.addEvent(a,b)},this)},unlisten:function(a,b){b.forEach(function(b){this.removeEvent(a,b)},this)},addEvent:function(a,b){a.addEventListener(b,this.boundHandler)},removeEvent:function(a,b){a.removeEventListener(b,this.boundHandler)},makeEvent:function(a,b){this.captureInfo[b.pointerId]&&(b.relatedTarget=null);var c=new m(a,b);return b.preventDefault&&(c.preventDefault=b.preventDefault),c._target=c._target||b.target,c},fireEvent:function(a,b){var c=this.makeEvent(a,b);return this.dispatchEvent(c)},cloneEvent:function(a){for(var b,c=Object.create(null),d=0;df&&(b=c[f]);f++){var h=Math.abs(d-b.x),i=Math.abs(e-b.y);if(K>=h&&K>=i)return!0}},prepareEvent:function(a){var b=v.cloneEvent(a),c=b.preventDefault;return b.preventDefault=function(){a.preventDefault(),c()},b.pointerId=this.POINTER_ID,b.isPrimary=!0,b.pointerType=this.POINTER_TYPE,b},prepareButtonsForMove:function(a,b){var c=J.get(this.POINTER_ID);a.buttons=c?c.buttons:0,b.buttons=a.buttons},mousedown:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=J.get(this.POINTER_ID),c=this.prepareEvent(a);M||(c.buttons=L[c.button],b&&(c.buttons|=b.buttons),a.buttons=c.buttons),J.set(this.POINTER_ID,a),b?v.move(c):v.down(c)}},mousemove:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);M||this.prepareButtonsForMove(b,a),v.move(b)}},mouseup:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=J.get(this.POINTER_ID),c=this.prepareEvent(a);if(!M){var d=L[c.button];c.buttons=b?b.buttons&~d:0,a.buttons=c.buttons}J.set(this.POINTER_ID,a),0===c.buttons||c.buttons===L[c.button]?(this.cleanupMouse(),v.up(c)):v.move(c)}},mouseover:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);M||this.prepareButtonsForMove(b,a),v.enterOver(b)}},mouseout:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);M||this.prepareButtonsForMove(b,a),v.leaveOut(b)}},cancel:function(a){var b=this.prepareEvent(a);v.cancel(b),this.cleanupMouse()},cleanupMouse:function(){J["delete"](this.POINTER_ID)}},Q=P,R=v.captureInfo,S=w.findTarget.bind(w),T=w.allShadows.bind(w),U=v.pointermap,V=2500,W=200,X="touch-action",Y=!1,Z={events:["touchstart","touchmove","touchend","touchcancel"],register:function(a){Y?v.listen(a,this.events):O.enableOnSubtree(a)},unregister:function(a){Y&&v.unlisten(a,this.events)},elementAdded:function(a){var b=a.getAttribute(X),c=this.touchActionToScrollType(b);c&&(a._scrollType=c,v.listen(a,this.events),T(a).forEach(function(a){a._scrollType=c,v.listen(a,this.events)},this))},elementRemoved:function(a){a._scrollType=void 0,v.unlisten(a,this.events),T(a).forEach(function(a){a._scrollType=void 0,v.unlisten(a,this.events)},this)},elementChanged:function(a,b){var c=a.getAttribute(X),d=this.touchActionToScrollType(c),e=this.touchActionToScrollType(b);d&&e?(a._scrollType=d,T(a).forEach(function(a){a._scrollType=d},this)):e?this.elementRemoved(a):d&&this.elementAdded(a)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(a){var b=a,c=this.scrollTypes;return"none"===b?"none":b===c.XSCROLLER?"X":b===c.YSCROLLER?"Y":c.SCROLLER.exec(b)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(a){return this.firstTouch===a.identifier},setPrimaryTouch:function(a){(0===U.size||1===U.size&&U.has(1))&&(this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(a){a.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var a=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(a,W)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(a){var b=0;return("touchstart"===a||"touchmove"===a)&&(b=1),b},touchToPointer:function(a){var b=this.currentTouchEvent,c=v.cloneEvent(a),d=c.pointerId=a.identifier+2;c.target=R[d]||S(c),c.bubbles=!0,c.cancelable=!0,c.detail=this.clickCount,c.button=0,c.buttons=this.typeToButtons(b.type),c.width=a.radiusX||a.webkitRadiusX||0,c.height=a.radiusY||a.webkitRadiusY||0,c.pressure=a.force||a.webkitForce||.5,c.isPrimary=this.isPrimaryTouch(a),c.pointerType=this.POINTER_TYPE;var e=this;return c.preventDefault=function(){e.scrolling=!1,e.firstXY=null,b.preventDefault()},c},processTouches:function(a,b){var c=a.changedTouches;this.currentTouchEvent=a;for(var d,e=0;e=h}return this.firstXY=null,b}},findTouch:function(a,b){for(var c,d=0,e=a.length;e>d&&(c=a[d]);d++)if(c.identifier===b)return!0},vacuumTouches:function(a){var b=a.touches;if(U.size>=b.length){var c=[];U.forEach(function(a,d){if(1!==d&&!this.findTouch(b,d-2)){var e=a.out;c.push(e)}},this),c.forEach(this.cancelOut,this)}},touchstart:function(a){this.vacuumTouches(a),this.setPrimaryTouch(a.changedTouches[0]),this.dedupSynthMouse(a),this.scrolling||(this.clickCount++,this.processTouches(a,this.overDown))},overDown:function(a){U.set(a.pointerId,{target:a.target,out:a,outTarget:a.target}),v.over(a),v.enter(a),v.down(a)},touchmove:function(a){this.scrolling||(this.shouldScroll(a)?(this.scrolling=!0,this.touchcancel(a)):(a.preventDefault(),this.processTouches(a,this.moveOverOut)))},moveOverOut:function(a){var b=a,c=U.get(b.pointerId);if(c){var d=c.out,e=c.outTarget;v.move(b),d&&e!==b.target&&(d.relatedTarget=b.target,b.relatedTarget=e,d.target=e,b.target?(v.leaveOut(d),v.enterOver(b)):(b.target=e,b.relatedTarget=null,this.cancelOut(b))),c.out=b,c.outTarget=b.target}},touchend:function(a){this.dedupSynthMouse(a),this.processTouches(a,this.upOut)},upOut:function(a){this.scrolling||(v.up(a),v.out(a),v.leave(a)),this.cleanUpPointer(a)},touchcancel:function(a){this.processTouches(a,this.cancelOut)},cancelOut:function(a){v.cancel(a),v.out(a),v.leave(a),this.cleanUpPointer(a)},cleanUpPointer:function(a){U["delete"](a.pointerId),this.removePrimaryPointer(a)},dedupSynthMouse:function(a){var b=Q.lastTouches,c=a.changedTouches[0];if(this.isPrimaryTouch(c)){var d={x:c.clientX,y:c.clientY};b.push(d);var e=function(a,b){var c=a.indexOf(b);c>-1&&a.splice(c,1)}.bind(null,b,d);setTimeout(e,V)}}};Y||(O=new E(Z.elementAdded,Z.elementRemoved,Z.elementChanged,Z));var $,_,aa=Z,ba=v.pointermap,ca=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,da={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(a){v.listen(a,this.events)},unregister:function(a){v.unlisten(a,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(a){var b=a;return ca&&(b=v.cloneEvent(a),b.pointerType=this.POINTER_TYPES[a.pointerType]),b},cleanup:function(a){ba["delete"](a)},MSPointerDown:function(a){ba.set(a.pointerId,a);var b=this.prepareEvent(a);v.down(b)},MSPointerMove:function(a){var b=this.prepareEvent(a);v.move(b)},MSPointerUp:function(a){var b=this.prepareEvent(a);v.up(b),this.cleanup(a.pointerId)},MSPointerOut:function(a){var b=this.prepareEvent(a);v.leaveOut(b)},MSPointerOver:function(a){var b=this.prepareEvent(a);v.enterOver(b)},MSPointerCancel:function(a){var b=this.prepareEvent(a);v.cancel(b),this.cleanup(a.pointerId)},MSLostPointerCapture:function(a){var b=v.makeEvent("lostpointercapture",a);v.dispatchEvent(b)},MSGotPointerCapture:function(a){var b=v.makeEvent("gotpointercapture",a);v.dispatchEvent(b)}},ea=da,fa=window.navigator;fa.msPointerEnabled?($=function(a){i(a),this.msSetPointerCapture(a)},_=function(a){i(a),this.msReleasePointerCapture(a)}):($=function(a){i(a),v.setCapture(a,this)},_=function(a){i(a),v.releaseCapture(a,this)}),g(),h(),j();var ga={dispatcher:v,Installer:E,PointerEvent:m,PointerMap:p,targetFinding:w};return ga}); + !function(a,b){ true?module.exports=b():"function"==typeof define&&define.amd?define(b):a.PointerEventsPolyfill=b()}(this,function(){"use strict";function a(a,b){b=b||Object.create(null);var c=document.createEvent("Event");c.initEvent(a,b.bubbles||!1,b.cancelable||!1); + // define inherited MouseEvent properties + // skip bubbles and cancelable since they're set above in initEvent() + for(var d,e=2;e element that is represented by the instance for Safari, Chrome, IE. + // This is the behavior implemented by Firefox. + !t||"target"!==b&&"relatedTarget"!==b||c[b]instanceof SVGElementInstance&&(c[b]=c[b].correspondingUseElement); + // keep the semantics of preventDefault + return a.preventDefault&&(c.preventDefault=function(){a.preventDefault()}),c},getTarget:function(a){var b=this.captureInfo[a.pointerId];return b?a._target!==b&&a.type in s?void 0:b:a._target},propagate:function(a,b,c){ + // Order of conditions due to document.contains() missing in IE. + for(var d=a.target,e=[];d!==document&&!d.contains(a.relatedTarget);) + // Touch: Do not propagate if node is detached. + if(e.push(d),d=d.parentNode,!d)return;c&&e.reverse(),e.forEach(function(c){a.target=c,b.call(this,a)},this)},setCapture:function(b,c,d){this.captureInfo[b]&&this.releaseCapture(b,d),this.captureInfo[b]=c,this.implicitRelease=this.releaseCapture.bind(this,b,d),document.addEventListener("pointerup",this.implicitRelease),document.addEventListener("pointercancel",this.implicitRelease);var e=new a("gotpointercapture");e.pointerId=b,e._target=c,d||this.asyncDispatchEvent(e)},releaseCapture:function(b,c){var d=this.captureInfo[b];if(d){this.captureInfo[b]=void 0,document.removeEventListener("pointerup",this.implicitRelease),document.removeEventListener("pointercancel",this.implicitRelease);var e=new a("lostpointercapture");e.pointerId=b,e._target=d,c||this.asyncDispatchEvent(e)}},/** + * Dispatches the event to its target. + * + * @param {Event} inEvent The event to be dispatched. + * @return {Boolean} True if an event handler returns true, false otherwise. + */ + dispatchEvent:/*scope.external.dispatchEvent || */function(a){var b=this.getTarget(a);if(b)return b.dispatchEvent(a)},asyncDispatchEvent:function(a){requestAnimationFrame(this.dispatchEvent.bind(this,a))}};u.boundHandler=u.eventHandler.bind(u);var v={shadow:function(a){if(a)return a.shadowRoot||a.webkitShadowRoot},canTarget:function(a){return a&&Boolean(a.elementFromPoint)},targetingShadow:function(a){var b=this.shadow(a);if(this.canTarget(b))return b},olderShadow:function(a){var b=a.olderShadowRoot;if(!b){var c=a.querySelector("shadow");c&&(b=c.olderShadowRoot)}return b},allShadows:function(a){for(var b=[],c=this.shadow(a);c;)b.push(c),c=this.olderShadow(c);return b},searchRoot:function(a,b,c){if(a){var d,e,f=a.elementFromPoint(b,c);for( + // is element a shadow host? + e=this.targetingShadow(f);e;){if( + // find the the element inside the shadow root + d=e.elementFromPoint(b,c)){ + // shadowed element may contain a shadow root + var g=this.targetingShadow(d);return this.searchRoot(g,b,c)||d} + // check for older shadows + e=this.olderShadow(e)} + // light dom element is the target + return f}},owner:function(a){ + // walk up until you hit the shadow root or document + for(var b=a;b.parentNode;)b=b.parentNode; + // the owner element is expected to be a Document or ShadowRoot + return b.nodeType!==Node.DOCUMENT_NODE&&b.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&(b=document),b},findTarget:function(a){var b=a.clientX,c=a.clientY,d=this.owner(a.target); + // if x, y is not in this root, fall back to document search + return d.elementFromPoint(b,c)||(d=document),this.searchRoot(d,b,c)}},w=Array.prototype.forEach.call.bind(Array.prototype.forEach),x=Array.prototype.map.call.bind(Array.prototype.map),y=Array.prototype.slice.call.bind(Array.prototype.slice),z=Array.prototype.filter.call.bind(Array.prototype.filter),A=window.MutationObserver||window.WebKitMutationObserver,B="[touch-action]",C={subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["touch-action"]};c.prototype={watchSubtree:function(a){ + // Only watch scopes that can target find, as these are top-level. + // Otherwise we can see duplicate additions and removals that add noise. + // + // TODO(dfreedman): For some instances with ShadowDOMPolyfill, we can see + // a removal without an insertion when a node is redistributed among + // shadows. Since it all ends up correct in the document, watching only + // the document will yield the correct mutations to watch. + this.observer&&v.canTarget(a)&&this.observer.observe(a,C)},enableOnSubtree:function(a){this.watchSubtree(a),a===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(a)},installNewSubtree:function(a){w(this.findElements(a),this.addElement,this)},findElements:function(a){return a.querySelectorAll?a.querySelectorAll(B):[]},removeElement:function(a){this.removeCallback(a)},addElement:function(a){this.addCallback(a)},elementChanged:function(a,b){this.changedCallback(a,b)},concatLists:function(a,b){return a.concat(y(b))}, + // register all touch-action = none nodes on document load + installOnLoad:function(){document.addEventListener("readystatechange",function(){"complete"===document.readyState&&this.installNewSubtree(document)}.bind(this))},isElement:function(a){return a.nodeType===Node.ELEMENT_NODE},flattenMutationTree:function(a){ + // find children with touch-action + var b=x(a,this.findElements,this); + // flatten the list + // make sure the added nodes are accounted for + return b.push(z(a,this.isElement)),b.reduce(this.concatLists,[])},mutationWatcher:function(a){a.forEach(this.mutationHandler,this)},mutationHandler:function(a){if("childList"===a.type){var b=this.flattenMutationTree(a.addedNodes);b.forEach(this.addElement,this);var c=this.flattenMutationTree(a.removedNodes);c.forEach(this.removeElement,this)}else"attributes"===a.type&&this.elementChanged(a.target,a.oldValue)}};var D=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],E="",F=window.PointerEvent||window.MSPointerEvent,G=!window.ShadowDOMPolyfill&&document.head.createShadowRoot,H=u.pointermap,I=25,J=[1,4,2,8,16],K=!1;try{K=1===new MouseEvent("test",{buttons:1}).buttons}catch(L){} + // handler block for native mouse events + var M,N={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],register:function(a){u.listen(a,this.events)},unregister:function(a){u.unlisten(a,this.events)},lastTouches:[], + // collide with the global mouse listener + isEventSimulatedFromTouch:function(a){for(var b,c=this.lastTouches,d=a.clientX,e=a.clientY,f=0,g=c.length;f delta other axis, scroll instead of + // making events + b=g>=h}return this.firstXY=null,b}},findTouch:function(a,b){for(var c,d=0,e=a.length;d=b.length){var c=[];R.forEach(function(a,d){ + // Never remove pointerId == 1, which is mouse. + // Touch identifiers are 2 smaller than their pointerId, which is the + // index in pointermap. + if(1!==d&&!this.findTouch(b,d-2)){var e=a.out;c.push(e)}},this),c.forEach(this.cancelOut,this)}},touchstart:function(a){this.vacuumTouches(a),this.setPrimaryTouch(a.changedTouches[0]),this.dedupSynthMouse(a),this.scrolling||(this.clickCount++,this.processTouches(a,this.overDown))},overDown:function(a){R.set(a.pointerId,{target:a.target,out:a,outTarget:a.target}),u.enterOver(a),u.down(a)},touchmove:function(a){this.scrolling||(this.shouldScroll(a)?(this.scrolling=!0,this.touchcancel(a)):(a.preventDefault(),this.processTouches(a,this.moveOverOut)))},moveOverOut:function(a){var b=a,c=R.get(b.pointerId); + // a finger drifted off the screen, ignore it + if(c){var d=c.out,e=c.outTarget;u.move(b),d&&e!==b.target&&(d.relatedTarget=b.target,b.relatedTarget=e, + // recover from retargeting by shadow + d.target=e,b.target?(u.leaveOut(d),u.enterOver(b)):( + // clean up case when finger leaves the screen + b.target=e,b.relatedTarget=null,this.cancelOut(b))),c.out=b,c.outTarget=b.target}},touchend:function(a){this.dedupSynthMouse(a),this.processTouches(a,this.upOut)},upOut:function(a){this.scrolling||(u.up(a),u.leaveOut(a)),this.cleanUpPointer(a)},touchcancel:function(a){this.processTouches(a,this.cancelOut)},cancelOut:function(a){u.cancel(a),u.leaveOut(a),this.cleanUpPointer(a)},cleanUpPointer:function(a){R["delete"](a.pointerId),this.removePrimaryPointer(a)}, + // prevent synth mouse events from creating pointer events + dedupSynthMouse:function(a){var b=N.lastTouches,c=a.changedTouches[0]; + // only the primary finger will synth mouse events + if(this.isPrimaryTouch(c)){ + // remember x/y of last touch + var d={x:c.clientX,y:c.clientY};b.push(d);var e=function(a,b){var c=a.indexOf(b);c>-1&&a.splice(c,1)}.bind(null,b,d);setTimeout(e,S)}}};M=new c(V.elementAdded,V.elementRemoved,V.elementChanged,V);var W,X,Y,Z=u.pointermap,$=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,_={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(a){u.listen(a,this.events)},unregister:function(a){u.unlisten(a,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(a){var b=a;return $&&(b=u.cloneEvent(a),b.pointerType=this.POINTER_TYPES[a.pointerType]),b},cleanup:function(a){Z["delete"](a)},MSPointerDown:function(a){Z.set(a.pointerId,a);var b=this.prepareEvent(a);u.down(b)},MSPointerMove:function(a){var b=this.prepareEvent(a);u.move(b)},MSPointerUp:function(a){var b=this.prepareEvent(a);u.up(b),this.cleanup(a.pointerId)},MSPointerOut:function(a){var b=this.prepareEvent(a);u.leaveOut(b)},MSPointerOver:function(a){var b=this.prepareEvent(a);u.enterOver(b)},MSPointerCancel:function(a){var b=this.prepareEvent(a);u.cancel(b),this.cleanup(a.pointerId)},MSLostPointerCapture:function(a){var b=u.makeEvent("lostpointercapture",a);u.dispatchEvent(b)},MSGotPointerCapture:function(a){var b=u.makeEvent("gotpointercapture",a);u.dispatchEvent(b)}},aa=window.navigator;aa.msPointerEnabled?(W=function(a){i(a),j(this),k(a)&&(u.setCapture(a,this,!0),this.msSetPointerCapture(a))},X=function(a){i(a),u.releaseCapture(a,!0),this.msReleasePointerCapture(a)}):(W=function(a){i(a),j(this),k(a)&&u.setCapture(a,this)},X=function(a){i(a),u.releaseCapture(a)}),Y=function(a){return!!u.captureInfo[a]},g(),h(),l();var ba={dispatcher:u,Installer:c,PointerEvent:a,PointerMap:p,targetFinding:v};return ba}); /***/ } /******/ ]); \ No newline at end of file diff --git a/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui-min.js b/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui-min.js index 736ae1e..8d5b358 100644 --- a/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui-min.js +++ b/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui-min.js @@ -1,2 +1,2 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var r,o;r=[n(1),n(5),n(13),n(14),n(9),n(10),n(15),n(16)],o=function(e,t,n,r,o,i,a,s){window.sampleUI=window.sampleUI||{};var c=window.sampleUI;c.commonUI=e,c.dialog=t,c.dpad=n,c.input=r,c.misc=o,c.mobileHacks=i,c.strings=a,c.touch=s}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[n(3),n(8),n(4),n(5),n(6),n(2),n(9),n(10),n(11),n(12)],o=function(e,t,n,r,o,i,a,s,c,u){function l(e){if(e=e||"",!v){v=document.createElement("div");var t=document.getElementById("hft-menu");t.parentNode.insertBefore(v,t)}e.indexOf("portrait")>=0?v.innerHTML=E:e.indexOf("landscape")>=0?v.innerHTML=b:v.innerHTML=""}function d(){o.isFullScreen()&&c.set(g.orientation)}function h(e,t){if(g.orientation=e,c.canOrient())d();else{var n=g.orientation;t&&(n="none"),l(n)}}function f(){r.modal({title:"HappyFunTimes",msg:"This game requires the HappyFunTimes App
Please download it from your app store"},function(){var e=window.navigator.userAgent;e.indexOf("iPhone")>=0||e.indexOf("iPad")>=0?a.gotoIFrame("itms://itunes.apple.com/"):e.indexOf("Android")>=0?a.gotoIFrame("market://details?id=com.greggman.HappyFunTimes"):showRequiredApp()})}function p(e){var t=m("hft-menu");t.style.display=e?"block":"none"}var v,m=function(e){return document.getElementById(e)},g={logger:new i.NullLogger},y={},b=['
','
','
'," Turn the Screen ","
",'
'," ↺ ","
","
","
"].join("\n"),E=['
','
','
'," Turn the Screen ","
",'
'," ↻ ","
","
","
"].join("\n"),w=function(t,n){function r(t){e.sendJSON(window.location.href,{cmd:"happyFunTimesPing"},function(e,n){t(e,n)},{timeout:2e3})}n=n||{};var c=m("hft-settings"),l=m("hft-disconnected"),v=m("hft-touchstart"),b=m("hft-menu");b.addEventListener("click",function(){c.style.display="block"},!1),b.addEventListener("touchstart",function(){c.style.display="block"},!1),p(!1);var E=function(){o.isFullScreen()||(v.removeEventListener("touchstart",E,!1),v.style.display="none",o.requestFullScreen(document.body))},w=function(){o.isFullScreen()?d():o.canGoFullScreen()&&(v.addEventListener("touchstart",E,!1),v.style.display="block")};if(o.onFullScreenChange(document.body,w),s.isMobile()&&w(),y.playerNameHandler=new u(t,m("hft-name")),m("hft-setname").addEventListener("click",function(){c.style.display="none",y.playerNameHandler.startNameEntry()},!1),m("hft-restart").addEventListener("click",function(){window.location.reload()},!1),m("hft-back").addEventListener("click",function(){c.style.display="none"}),t.addEventListener("connect",function(){l.style.display="none",n.connectFn&&n.connectFn()}),t.addEventListener("disconnect",function(){function e(){r(function(t,n){return t?(setTimeout(e,1e3),void 0):(window.location.href="/",void 0)})}l.style.display="block",n.disconnectFn&&n.disconnectFn(),setTimeout(e,2e3)}),t.addEventListener("_hft_redirect_",function(e){window.location.href=e.url}),h(n.orientation,n.orientationOptional),n.requireApp&&f(),n.debug){g.statusNode=document.createTextNode(""),m("hft-status").appendChild(g.statusNode);var S=a.findCSSStyleRule("#hft-debug");S.style.display="block",g.logger=new i.HTMLLogger(m("hft-console"),n.numConsoleLines)}if(n.consoleTarget){switch(n.consoleTarget.toLowerCase()){case"html":g.logger=g.logger||new i.HTMLLogger(m("hft-console"),n.numConsoleLines),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)});break;case"game":g.logger=new i.GameLogger(t),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)})}console.log("here")}},S=function(){S=function(){},y.playerNameHandler.isNameSet()||y.playerNameHandler.startNameEntry()},T=function(e){g.statusNode&&(g.statusNode.nodeValue=e)},P=function(e){g.logger.log(e)},I=function(e){g.logger.error(e)};return{askForNameOnce:S,log:P,error:I,setOrientation:h,setStatus:T,setupStandardControllerUI:w,showMenu:p}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){};e.prototype.log=function(){},e.prototype.error=function(){};var t=function(){};t.prototype.log=function(){console.log.apply(console,arguments)},t.prototype.error=function(){console.error.apply(console,arguments)};var n=function(e,t){this.container=e,this.maxLines=t||10,this.lines=[]};n.prototype.addLine_=function(e,t){var n,r;this.lines.lengtho;++o){var i=e[o];void 0===i?r.push("undefined"):"number"==typeof i?(t&&r.push(", "),i===Math.floor(i)?r.push(i.toFixed(0)):r.push(i.toFixed(3)),t=!0):window.Float32Array&&i instanceof Float32Array?r.push(tdl.string.argsToString(i)):(r.push(i.toString()),t=!1)}return r.join("")};n.prototype.log=function(){this.addLine_(r(arguments),void 0)},n.prototype.error=function(){this.addLine_(r(arguments),"red")};var o=function(e){this.log=e.logImpl.bind(e),this.error=e.errorImpl.bind(e)};return{ConsoleLogger:t,GameLogger:o,HTMLLogger:n,NullLogger:e}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;"use strict",r=function(){var e=function(){},t=function(t,n,r,o){o=o||{};var i=new XMLHttpRequest;i.overrideMimeType&&i.overrideMimeType("text/plain");var a=o.timeout||0;a&&(i.timeout=a,e("set timeout to: "+i.timeout)),i.open("POST",t,!0);var s=JSON.stringify(n),c=function(t,n){r&&(e("calling-callback:"+(t?" has error":"success")),r(t,n),r=void 0)},u=function(){e("--error--"),c("error sending json to "+t)},l=function(){e("--timeout--"),c("timeout sending json to "+t)},d=function(){r&&(e("--forced timeout--"),i.abort(),c("forced timeout sending json to "+t))},h=function(){e("--finish--");var n=void 0,r=200===i.status||0===i.status;if(r)try{n=JSON.parse(i.responseText)}catch(o){r=!1}c(r?null:"could not load: "+t,n)};try{a&&setTimeout(d,a+50),i.addEventListener("load",h,!1),i.addEventListener("timeout",l,!1),i.addEventListener("error",u,!1),i.setRequestHeader("Content-type","application/json"),i.send(s),e("--sent: "+t)}catch(f){e("--exception--"),setTimeout(function(){c("could not load: "+t,null)},0)}};return{sendJSON:t}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;r=function(){var e=function(e,t){var n=t||"/";this.set=function(t,r){if(void 0===t)return this.erase(),void 0;if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.setItem(e,t),void 0;var o="";r=r||9999;var i=new Date;i.setTime(Date.now()+Math.floor(24*r*60*60*1e3)),o="; expires="+i.toGMTString();var a=encodeURIComponent(e)+"="+encodeURIComponent(t)+o+"; path="+n;document.cookie=a},this.get=function(){if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.getItem(e);for(var t=encodeURIComponent(e)+"=",n=document.cookie.split(";"),r=0;rn;++n)t+=(16*Math.random()|0).toString(16);return t}function c(e,t){Object.keys(t).forEach(function(n){e.addEventListener(n,t[n])})}var u=function(e,t,n){return Object.keys(e).forEach(function(r){if(2!==n||void 0===t[r]){var o=e[r];if(o instanceof Array){var i=t[r];i||(i=[],t[name]=i),u(o,i,n)}else if(!(o instanceof Object)||o instanceof Function||o instanceof HTMLElement){if(1===n&&void 0!==t[r])return;t[r]=o}else{var a=t[r];a||(a={},t[r]=a),u(o,a,n)}}}),t},l=function(t,n){var r=n||{};try{var o=t.indexOf("?"),i=t.indexOf("#");0>i&&(i=t.length);var a=t.substring(o+1,i);e(a,r)}catch(i){console.error(i)}return r},d=function(t){return e(window.location.search,t)},h=new RegExp("([a-zA-Z0-9_]+):","g"),f=function(e,t){var n=t||"settings",r=d(),o=e||{},i=r[n];if(i){var a=i.replace(h,'"$1":'),s=JSON.parse(a);u(s,o)}return o},p=["","moz","webkit","ms"],v=function(e){return Math.floor(Math.random()*e)},m=function(e){for(var t=e||v,n=t(3),r=[],o=0;3>o;++o)r.push(t(128)+(o===n?128:64));return"rgb("+r.join(",")+")"},g=function(e){for(var t=e||v,n=t(3),r=255,o=0;3>o;++o)r=r<<8|t(128)+(o===n?128:64);return r},y=function(e){for(var t=0;te?-1:e>0?1:0},P=function(e,t){return Math.abs(e)=8}}();return n&&(e||t)}(),o=function(){return r},i=function(){var e=/iP(hone|od|ad)/i.test(navigator.platform);return function(){return e}}(),a=function(){var e=/Android|webOS|Phone|Pad|Pod|Tablet|BlackBerry/i.test(navigator.userAgent);return function(){return e}}(),s=function(){for(var e=document.querySelectorAll(".fixheight"),t=0;t]/g,"");t.length>16&&(t=t.substring(0,16)),0===t.length?a.value=u:t!==u&&(u=t,c.set(u,700),m()),g(!1)};this.startNameEntry=function(){l.style.display="block",d.style.display="none",s()||(a.value=t.pickRandomElement(o)),a.focus()},i.addEventListener("_hft_setname_",v),a.addEventListener("click",y,!1),a.addEventListener("change",b,!1),a.addEventListener("blur",b,!1),a.addEventListener("focus",y,!1),a.form&&a.form.addEventListener("submit",b,!1),f(),m()};return i}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[],o=function(){var e=function(e,t,n,r,o){o=o||1,e.beginPath(),e.arc(t,n,r,0,2*Math.PI),1&o&&e.fill(),2&o&&e.stroke()},t=function(e){this.element=e.element,this.size=e.size,this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.resize(),this.ctx=this.canvas.getContext("2d"),this.drawBits(0)};return t.prototype.getSize=function(){var e=this.size;return e||(e=Math.min(this.canvas.width,this.canvas.height)),e},t.prototype.drawBits=function(t){var n=this.getSize(),r=Math.floor(n/6.5),o=Math.floor(n/2),i=Math.floor(n/2),a=Math.floor(n/2*.8),s=Math.floor(n/2*.8),c=this.ctx;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.save(),c.translate(o,i),c.fillStyle="#AAA",c.stokeStyle="#444",e(c,0,0,.95*o,3),c.fillStyle="#888",c.fillRect(-r,-s,2*r,2*s),c.fillRect(-a,-r,2*a,2*r),c.fillStyle="#CCC",1&t&&e(c,a-r,0,.8*r),2&t&&e(c,-a+r,0,.8*r),4&t&&e(c,0,-a+r,.8*r),8&t&&e(c,0,a-r,.8*r),c.restore()},t.prototype.draw=function(e){this.drawBits(e.bits)},t.prototype.resize=function(){var e=this.size;e||(e=Math.min(this.canvas.clientWidth,this.canvas.clientHeight)),this.canvas.width===e&&this.canvas.height===e||(this.canvas.width=e,this.canvas.height=e)},t}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[n(9)],o=function(e){var t={kLeft:37,kRight:39,kUp:38,kDown:40},n=[37,39,38,40],r=[65,68,87,83],o={pads:[{keys:r}]},i={pads:[{keys:n}]},a=/^\d+$/,s=1,c=2,u=4,l=8,d={};d[-1]={direction:-1,dx:0,dy:0,bits:0,symbol:String.fromCharCode(10065)},d[0]={direction:0,dx:1,dy:0,bits:s,symbol:String.fromCharCode(8594)},d[1]={direction:1,dx:1,dy:1,bits:u|s,symbol:String.fromCharCode(8599)},d[2]={direction:2,dx:0,dy:1,bits:u,symbol:String.fromCharCode(8593)},d[3]={direction:3,dx:-1,dy:1,bits:u|c,symbol:String.fromCharCode(8598)},d[4]={direction:4,dx:-1,dy:0,bits:c,symbol:String.fromCharCode(8592)},d[5]={direction:5,dx:-1,dy:-1,bits:l|c,symbol:String.fromCharCode(8601)},d[6]={direction:6,dx:0,dy:-1,bits:l,symbol:String.fromCharCode(8595)},d[7]={direction:7,dx:1,dy:-1,bits:l|s,symbol:String.fromCharCode(8600)};var h=function(e){return{pad:e,info:void 0}},f=function(e,t,n,r){var o=d[t];n.pad=e,n.info=o,r(n)},p=function(e){return d[e]},v=function(t,n){var r=e.getAbsolutePosition(t),o=n.pageX-r.x,i=n.pageY-r.y;return{x:o,y:i}},m=function(e,t){var n={},r={},o=function(o,i){n[o]=i,r!==n&&(r=i,i?e(o):t(o))},i=function(e){o(e.keyCode,!1)},a=function(e){o(e.keyCode,!0)};window.addEventListener("keyup",i,!1),window.addEventListener("keydown",a,!1)},g=function(t,o){o||(o={pads:[{keys:r},{keys:n}]});for(var i=[],a=[],s=[],c=[],u=[{bit:1,exclude:2,mask:3},{bit:2,exclude:1,mask:3},{bit:4,exclude:8,mask:12},{bit:8,exclude:4,mask:12}],l={},d=0;dv;++v){var g=u[v],y={pad:d};e.copyProperties(g,y),l[p.keys[v]]=y}}var b=[-1,4,0,-1,2,3,1,-1,6,5,7,-1,-1,-1,-1,-1],E=function(e,n){var r=l[e];if(r){var o=r.pad,u=r.bit,d=i[o];if(n?(d|=u,a[o]=a[o]&~r.mask|r.exclude):(d&=~u,a[o]&=~r.mask),d!==i[o]){i[o]=d;var h=b[d&~a[o]];h!==s[o]&&(s[o]=h,f(o,h,c[o],t))}}},w=function(e){E(e,0)},S=function(e){E(e,1)};m(S,w)},y=function(e){var t={};Object.keys(e).forEach(function(n){var r=e[n];if(!a.test(n)){if(1!==n.length)throw"bad key code: '"+n+"'";n=n.charCodeAt(0)}t[n]=r});var n=function(e,n,r){var o=t[e];o&&o({keyCode:e,pressed:r})},r=function(e,t){n(e,t,!0)},o=function(e,t){n(e,t,!1)};m(r,o)};return{cursorKeys:t,createDirectionEventInfo:h,emitDirectionEvent:f,getDirectionInfo:p,kCursorKeys:n,kCursorPadOnly:i,kASWDKeys:r,kASWDPadOnly:o,getRelativeCoordinates:v,setupControllerKeys:m,setupKeyboardDPadKeys:g,setupKeys:y}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){var e={};return function(t,n){var r=e[t];return(!r||r.length=r)return n;var i=e(o,r);return n+i.substr(n.length-r)},r=function(n,r,o){if(n=t(n),n.length>=r)return n;var i=e(o,r);return i.substr(n.length-r)+n},o=function(){var e=/%\(([^\)]+)\)s/g;return function(t,n){return n.length||(n=[n]),t.replace(e,function(e,t){for(var r=t.split("."),o=0;o=t.length&&e.substr(0,t.length)===t},a=function(e,t){return e.length>=t.length&&e.substring(e.length-t.length)===t},s=String.fromCodePoint?String.fromCodePoint:function(){var e=String.fromCharCode,t=Math.floor,n=function(){var n,r,o=16384,i=[],a=-1,s=arguments.length;if(!s)return"";for(var c="";++au||u>1114111||t(u)!==u)throw new RangeError("Invalid code point: "+u);65535>=u?i.push(u):(u-=65536,n=(u>>10)+55296,r=u%1024+56320,i.push(n,r)),(a+1===s||i.length>o)&&(c+=e.apply(null,i),i.length=0)}return c};return n}(),c={endsWith:a,fromCodePoint:s,padLeft:r,padRight:n,replaceParams:o,startsWith:i};return c}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r,o;"use strict",r=[n(17),n(14),n(9)],o=function(e,t,n){var r=function(e){var n=e.callback,r=e.inputElement;e.deadSpaceRadius=e.deadSpaceRadius||10;var o=e.deadSpaceRadius*e.deadSpaceRadius,i=function(e,t){this.reset(e,t)};i.prototype.reset=function(e,t){return this.x=e,this.y=t,this},i.prototype.copyFrom=function(e){this.x=e.x,this.y=e.y},i.prototype.minusEq=function(e){return this.x-=e.x,this.y-=e.y,this};for(var a=function(e){return{pointerId:-1,pointerPos:new i(0,0),pointerStartPos:new i(0,0),vector:new i(0,0),dir:-1,lastDir:0,event:t.createDirectionEventInfo(e)}},s=[],c=0;ct?2:6:0>e?4:0},d=[3,4,2,-1,1,0,2,-1,5,4,6,-1,7,0,6,-1],h=function(t,n){var r=Math.abs(n)0?4:0)|(n>0?8:0);return d[i]},f=e.axisSize?h:u;4===e.divisions&&(f=l);var p=function(e,r){var o=s[e];t.emitDirectionEvent(e,r,o.event,n)},v=function(e,t,n){var r=-1;if(!n&&e.pointerId>=0){var i=e.vector.x*e.vector.x+e.vector.y*e.vector.y;i>o&&(r=f(e.vector.x,e.vector.y),e.lastDir=r)}e.dir!==r&&(e.dir=r,p(t,r))},m=function(n,r){var o=s[n],i=e.pads[n];o.pointerId=r.pointerId;var a=t.getRelativeCoordinates(i.referenceElement,r),c=a.x-(i.offsetX||i.referenceElement.clientWidth/2),u=a.y-(i.offsetY||i.referenceElement.clientHeight/2);e.fixedCenter?(o.pointerStartPos.reset(0,0),o.pointerPos.reset(c,u),o.vector.reset(c,u),v(o,n)):(o.pointerStartPos.reset(c,u),o.pointerPos.copyFrom(o.pointerStartPos),o.vector.reset(0,0),o.dir=o.lastDir,p(n,o.lastDir))},g=function(n){for(var r,o=0,i=0;ip)&&(r=p,o=i)}return o},y=function(e){var t=g(e);m(t,e)},b=function(n){for(var r=0;rr&&(t=this.eventSourceList[r]);r++)t.register.call(t,e)},unregister:function(e){for(var t,n=this.eventSourceList.length,r=0;n>r&&(t=this.eventSourceList[r]);r++)t.unregister.call(t,e)},contains:function(e,t){try{return e.contains(t)}catch(n){return!1}},down:function(e){e.bubbles=!0,this.fireEvent("pointerdown",e)},move:function(e){e.bubbles=!0,this.fireEvent("pointermove",e)},up:function(e){e.bubbles=!0,this.fireEvent("pointerup",e)},enter:function(e){e.bubbles=!1,this.fireEvent("pointerenter",e)},leave:function(e){e.bubbles=!1,this.fireEvent("pointerleave",e)},over:function(e){e.bubbles=!0,this.fireEvent("pointerover",e)},out:function(e){e.bubbles=!0,this.fireEvent("pointerout",e)},cancel:function(e){e.bubbles=!0,this.fireEvent("pointercancel",e)},leaveOut:function(e){this.out(e),this.contains(e.target,e.relatedTarget)||this.leave(e)},enterOver:function(e){this.over(e),this.contains(e.target,e.relatedTarget)||this.enter(e)},eventHandler:function(e){if(!e._handledByPE){var t=e.type,n=this.eventMap&&this.eventMap[t];n&&n(e),e._handledByPE=!0}},listen:function(e,t){t.forEach(function(t){this.addEvent(e,t)},this)},unlisten:function(e,t){t.forEach(function(t){this.removeEvent(e,t)},this)},addEvent:function(e,t){e.addEventListener(t,this.boundHandler)},removeEvent:function(e,t){e.removeEventListener(t,this.boundHandler)},makeEvent:function(e,t){this.captureInfo[t.pointerId]&&(t.relatedTarget=null);var n=new h(e,t);return t.preventDefault&&(n.preventDefault=t.preventDefault),n._target=n._target||t.target,n},fireEvent:function(e,t){var n=this.makeEvent(e,t);return this.dispatchEvent(n)},cloneEvent:function(e){for(var t,n=Object.create(null),r=0;ri&&(t=n[i]);i++){var s=Math.abs(r-t.x),c=Math.abs(o-t.y);if(_>=s&&_>=c)return!0}},prepareEvent:function(e){var t=w.cloneEvent(e),n=t.preventDefault;return t.preventDefault=function(){e.preventDefault(),n()},t.pointerId=this.POINTER_ID,t.isPrimary=!0,t.pointerType=this.POINTER_TYPE,t},prepareButtonsForMove:function(e,t){var n=A.get(this.POINTER_ID);e.buttons=n?n.buttons:0,t.buttons=e.buttons},mousedown:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=A.get(this.POINTER_ID),n=this.prepareEvent(e);Y||(n.buttons=D[n.button],t&&(n.buttons|=t.buttons),e.buttons=n.buttons),A.set(this.POINTER_ID,e),t?w.move(n):w.down(n)}},mousemove:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);Y||this.prepareButtonsForMove(t,e),w.move(t)}},mouseup:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=A.get(this.POINTER_ID),n=this.prepareEvent(e);if(!Y){var r=D[n.button];n.buttons=t?t.buttons&~r:0,e.buttons=n.buttons}A.set(this.POINTER_ID,e),0===n.buttons||n.buttons===D[n.button]?(this.cleanupMouse(),w.up(n)):w.move(n)}},mouseover:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);Y||this.prepareButtonsForMove(t,e),w.enterOver(t)}},mouseout:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);Y||this.prepareButtonsForMove(t,e),w.leaveOut(t)}},cancel:function(e){var t=this.prepareEvent(e);w.cancel(t),this.cleanupMouse()},cleanupMouse:function(){A["delete"](this.POINTER_ID)}},X=q,j=w.captureInfo,B=S.findTarget.bind(S),U=S.allShadows.bind(S),K=w.pointermap,W=2500,G=200,V="touch-action",J=!1,$={events:["touchstart","touchmove","touchend","touchcancel"],register:function(e){J?w.listen(e,this.events):z.enableOnSubtree(e)},unregister:function(e){J&&w.unlisten(e,this.events)},elementAdded:function(e){var t=e.getAttribute(V),n=this.touchActionToScrollType(t);n&&(e._scrollType=n,w.listen(e,this.events),U(e).forEach(function(e){e._scrollType=n,w.listen(e,this.events)},this))},elementRemoved:function(e){e._scrollType=void 0,w.unlisten(e,this.events),U(e).forEach(function(e){e._scrollType=void 0,w.unlisten(e,this.events)},this)},elementChanged:function(e,t){var n=e.getAttribute(V),r=this.touchActionToScrollType(n),o=this.touchActionToScrollType(t);r&&o?(e._scrollType=r,U(e).forEach(function(e){e._scrollType=r},this)):o?this.elementRemoved(e):r&&this.elementAdded(e)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(e){var t=e,n=this.scrollTypes;return"none"===t?"none":t===n.XSCROLLER?"X":t===n.YSCROLLER?"Y":n.SCROLLER.exec(t)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(e){return this.firstTouch===e.identifier},setPrimaryTouch:function(e){(0===K.size||1===K.size&&K.has(1))&&(this.firstTouch=e.identifier,this.firstXY={X:e.clientX,Y:e.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(e){e.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var e=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(e,G)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(e){var t=0;return("touchstart"===e||"touchmove"===e)&&(t=1),t},touchToPointer:function(e){var t=this.currentTouchEvent,n=w.cloneEvent(e),r=n.pointerId=e.identifier+2;n.target=j[r]||B(n),n.bubbles=!0,n.cancelable=!0,n.detail=this.clickCount,n.button=0,n.buttons=this.typeToButtons(t.type),n.width=e.radiusX||e.webkitRadiusX||0,n.height=e.radiusY||e.webkitRadiusY||0,n.pressure=e.force||e.webkitForce||.5,n.isPrimary=this.isPrimaryTouch(e),n.pointerType=this.POINTER_TYPE;var o=this;return n.preventDefault=function(){o.scrolling=!1,o.firstXY=null,t.preventDefault()},n},processTouches:function(e,t){var n=e.changedTouches;this.currentTouchEvent=e;for(var r,o=0;o=s}return this.firstXY=null,t}},findTouch:function(e,t){for(var n,r=0,o=e.length;o>r&&(n=e[r]);r++)if(n.identifier===t)return!0},vacuumTouches:function(e){var t=e.touches;if(K.size>=t.length){var n=[];K.forEach(function(e,r){if(1!==r&&!this.findTouch(t,r-2)){var o=e.out;n.push(o)}},this),n.forEach(this.cancelOut,this)}},touchstart:function(e){this.vacuumTouches(e),this.setPrimaryTouch(e.changedTouches[0]),this.dedupSynthMouse(e),this.scrolling||(this.clickCount++,this.processTouches(e,this.overDown))},overDown:function(e){K.set(e.pointerId,{target:e.target,out:e,outTarget:e.target}),w.over(e),w.enter(e),w.down(e)},touchmove:function(e){this.scrolling||(this.shouldScroll(e)?(this.scrolling=!0,this.touchcancel(e)):(e.preventDefault(),this.processTouches(e,this.moveOverOut)))},moveOverOut:function(e){var t=e,n=K.get(t.pointerId);if(n){var r=n.out,o=n.outTarget;w.move(t),r&&o!==t.target&&(r.relatedTarget=t.target,t.relatedTarget=o,r.target=o,t.target?(w.leaveOut(r),w.enterOver(t)):(t.target=o,t.relatedTarget=null,this.cancelOut(t))),n.out=t,n.outTarget=t.target}},touchend:function(e){this.dedupSynthMouse(e),this.processTouches(e,this.upOut)},upOut:function(e){this.scrolling||(w.up(e),w.out(e),w.leave(e)),this.cleanUpPointer(e)},touchcancel:function(e){this.processTouches(e,this.cancelOut)},cancelOut:function(e){w.cancel(e),w.out(e),w.leave(e),this.cleanUpPointer(e)},cleanUpPointer:function(e){K["delete"](e.pointerId),this.removePrimaryPointer(e)},dedupSynthMouse:function(e){var t=X.lastTouches,n=e.changedTouches[0];if(this.isPrimaryTouch(n)){var r={x:n.clientX,y:n.clientY};t.push(r);var o=function(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}.bind(null,t,r);setTimeout(o,W)}}};J||(z=new L($.elementAdded,$.elementRemoved,$.elementChanged,$));var Q,Z,ee=$,te=w.pointermap,ne=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,re={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(e){w.listen(e,this.events)},unregister:function(e){w.unlisten(e,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(e){var t=e;return ne&&(t=w.cloneEvent(e),t.pointerType=this.POINTER_TYPES[e.pointerType]),t},cleanup:function(e){te["delete"](e)},MSPointerDown:function(e){te.set(e.pointerId,e);var t=this.prepareEvent(e);w.down(t)},MSPointerMove:function(e){var t=this.prepareEvent(e);w.move(t)},MSPointerUp:function(e){var t=this.prepareEvent(e);w.up(t),this.cleanup(e.pointerId)},MSPointerOut:function(e){var t=this.prepareEvent(e);w.leaveOut(t)},MSPointerOver:function(e){var t=this.prepareEvent(e);w.enterOver(t)},MSPointerCancel:function(e){var t=this.prepareEvent(e);w.cancel(t),this.cleanup(e.pointerId)},MSLostPointerCapture:function(e){var t=w.makeEvent("lostpointercapture",e);w.dispatchEvent(t)},MSGotPointerCapture:function(e){var t=w.makeEvent("gotpointercapture",e);w.dispatchEvent(t)}},oe=re,ie=window.navigator;ie.msPointerEnabled?(Q=function(e){c(e),this.msSetPointerCapture(e)},Z=function(e){c(e),this.msReleasePointerCapture(e)}):(Q=function(e){c(e),w.setCapture(e,this)},Z=function(e){c(e),w.releaseCapture(e,this)}),a(),s(),u();var ae={dispatcher:w,Installer:L,PointerEvent:h,PointerMap:v,targetFinding:S};return ae})}]); \ No newline at end of file +!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var r,o;r=[n(1),n(5),n(13),n(14),n(9),n(10),n(15),n(16)],o=function(e,t,n,r,o,i,a,s){window.sampleUI=window.sampleUI||{};var c=window.sampleUI;c.commonUI=e,c.dialog=t,c.dpad=n,c.input=r,c.misc=o,c.mobileHacks=i,c.strings=a,c.touch=s}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[n(3),n(8),n(4),n(5),n(6),n(2),n(9),n(10),n(11),n(12)],o=function(e,t,n,r,o,i,a,s,c,u){function l(e){if(e=e||"",!v){v=document.createElement("div");var t=document.getElementById("hft-menu");t.parentNode.insertBefore(v,t)}e.indexOf("portrait")>=0?v.innerHTML=E:e.indexOf("landscape")>=0?v.innerHTML=b:v.innerHTML=""}function d(){o.isFullScreen()&&c.set(g.orientation)}function h(e,t){if(g.orientation=e,c.canOrient())d();else{var n=g.orientation;t&&(n="none"),l(n)}}function f(){r.modal({title:"HappyFunTimes",msg:"This game requires the HappyFunTimes App
Please download it from your app store"},function(){var e=window.navigator.userAgent;e.indexOf("iPhone")>=0||e.indexOf("iPad")>=0?a.gotoIFrame("itms://itunes.apple.com/"):e.indexOf("Android")>=0?a.gotoIFrame("market://details?id=com.greggman.HappyFunTimes"):showRequiredApp()})}function p(e){var t=m("hft-menu");t.style.display=e?"block":"none"}var v,m=function(e){return document.getElementById(e)},g={logger:new i.NullLogger},y={},b=['
','
','
'," Turn the Screen ","
",'
'," ↺ ","
","
","
"].join("\n"),E=['
','
','
'," Turn the Screen ","
",'
'," ↻ ","
","
","
"].join("\n"),w=function(t,n){function r(t){e.sendJSON(window.location.href,{cmd:"happyFunTimesPing"},function(e,n){t(e,n)},{timeout:2e3})}n=n||{};var c=m("hft-settings"),l=m("hft-disconnected"),v=m("hft-touchstart"),b=m("hft-menu");b.addEventListener("click",function(){c.style.display="block"},!1),b.addEventListener("touchstart",function(){c.style.display="block"},!1),p(!1);var E=function(){o.isFullScreen()||(v.removeEventListener("touchstart",E,!1),v.style.display="none",o.requestFullScreen(document.body))},w=function(){o.isFullScreen()?d():o.canGoFullScreen()&&(v.addEventListener("touchstart",E,!1),v.style.display="block")};if(o.onFullScreenChange(document.body,w),s.isMobile()&&w(),y.playerNameHandler=new u(t,m("hft-name")),m("hft-setname").addEventListener("click",function(){c.style.display="none",y.playerNameHandler.startNameEntry()},!1),m("hft-restart").addEventListener("click",function(){window.location.reload()},!1),m("hft-back").addEventListener("click",function(){c.style.display="none"}),t.addEventListener("connect",function(){l.style.display="none",n.connectFn&&n.connectFn()}),t.addEventListener("disconnect",function(){function e(){r(function(t,n){return t?(setTimeout(e,1e3),void 0):(window.location.href="/",void 0)})}l.style.display="block",n.disconnectFn&&n.disconnectFn(),setTimeout(e,2e3)}),t.addEventListener("_hft_redirect_",function(e){window.location.href=e.url}),h(n.orientation,n.orientationOptional),n.requireApp&&f(),n.debug){g.statusNode=document.createTextNode(""),m("hft-status").appendChild(g.statusNode);var S=a.findCSSStyleRule("#hft-debug");S.style.display="block",g.logger=new i.HTMLLogger(m("hft-console"),n.numConsoleLines)}if(n.consoleTarget){switch(n.consoleTarget.toLowerCase()){case"html":g.logger=g.logger||new i.HTMLLogger(m("hft-console"),n.numConsoleLines),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)});break;case"game":g.logger=new i.GameLogger(t),console.log=g.logger.log.bind(g.logger),console.error=g.logger.error.bind(g.logger),window.addEventListener("error",function(e,t,n){console.error(t,n,e)})}console.log("here")}},S=function(){S=function(){},y.playerNameHandler.isNameSet()||y.playerNameHandler.startNameEntry()},T=function(e){g.statusNode&&(g.statusNode.nodeValue=e)},P=function(e){g.logger.log(e)},I=function(e){g.logger.error(e)};return{askForNameOnce:S,log:P,error:I,setOrientation:h,setStatus:T,setupStandardControllerUI:w,showMenu:p}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){};e.prototype.log=function(){},e.prototype.error=function(){};var t=function(){};t.prototype.log=function(){console.log.apply(console,arguments)},t.prototype.error=function(){console.error.apply(console,arguments)};var n=function(e,t){this.container=e,this.maxLines=t||10,this.lines=[]};n.prototype.addLine_=function(e,t){var n,r;this.lines.lengtho;++o){var i=e[o];void 0===i?r.push("undefined"):"number"==typeof i?(t&&r.push(", "),i===Math.floor(i)?r.push(i.toFixed(0)):r.push(i.toFixed(3)),t=!0):window.Float32Array&&i instanceof Float32Array?r.push(tdl.string.argsToString(i)):(r.push(i.toString()),t=!1)}return r.join("")};n.prototype.log=function(){this.addLine_(r(arguments),void 0)},n.prototype.error=function(){this.addLine_(r(arguments),"red")};var o=function(e){this.log=e.logImpl.bind(e),this.error=e.errorImpl.bind(e)};return{ConsoleLogger:t,GameLogger:o,HTMLLogger:n,NullLogger:e}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;"use strict",r=function(){var e=function(){},t=function(t,n,r,o){o=o||{};var i=new XMLHttpRequest;i.overrideMimeType&&i.overrideMimeType("text/plain");var a=o.timeout||0;a&&(i.timeout=a,e("set timeout to: "+i.timeout)),i.open("POST",t,!0);var s=JSON.stringify(n),c=function(t,n){r&&(e("calling-callback:"+(t?" has error":"success")),r(t,n),r=void 0)},u=function(){e("--error--"),c("error sending json to "+t)},l=function(){e("--timeout--"),c("timeout sending json to "+t)},d=function(){r&&(e("--forced timeout--"),i.abort(),c("forced timeout sending json to "+t))},h=function(){e("--finish--");var n=void 0,r=200===i.status||0===i.status;if(r)try{n=JSON.parse(i.responseText)}catch(o){r=!1}c(r?null:"could not load: "+t,n)};try{a&&setTimeout(d,a+50),i.addEventListener("load",h,!1),i.addEventListener("timeout",l,!1),i.addEventListener("error",u,!1),i.setRequestHeader("Content-type","application/json"),i.send(s),e("--sent: "+t)}catch(f){e("--exception--"),setTimeout(function(){c("could not load: "+t,null)},0)}};return{sendJSON:t}}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r;r=function(){var e=function(e,t){var n=t||"/";this.set=function(t,r){if(void 0===t)return this.erase(),void 0;if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.setItem(e,t),void 0;var o="";r=r||9999;var i=new Date;i.setTime(Date.now()+Math.floor(24*r*60*60*1e3)),o="; expires="+i.toGMTString();var a=encodeURIComponent(e)+"="+encodeURIComponent(t)+o+"; path="+n;document.cookie=a},this.get=function(){if(window.hftSettings&&window.hftSettings.inApp)return window.localStorage.getItem(e);for(var t=encodeURIComponent(e)+"=",n=document.cookie.split(";"),r=0;rn;++n)t+=(16*Math.random()|0).toString(16);return t}function c(e,t){Object.keys(t).forEach(function(n){e.addEventListener(n,t[n])})}var u=function(e,t,n){return Object.keys(e).forEach(function(r){if(2!==n||void 0===t[r]){var o=e[r];if(o instanceof Array){var i=t[r];i||(i=[],t[name]=i),u(o,i,n)}else if(!(o instanceof Object)||o instanceof Function||o instanceof HTMLElement){if(1===n&&void 0!==t[r])return;t[r]=o}else{var a=t[r];a||(a={},t[r]=a),u(o,a,n)}}}),t},l=function(t,n){var r=n||{};try{var o=t.indexOf("?"),i=t.indexOf("#");0>i&&(i=t.length);var a=t.substring(o+1,i);e(a,r)}catch(i){console.error(i)}return r},d=function(t){return e(window.location.search,t)},h=new RegExp("([a-zA-Z0-9_]+):","g"),f=function(e,t){var n=t||"settings",r=d(),o=e||{},i=r[n];if(i){var a=i.replace(h,'"$1":'),s=JSON.parse(a);u(s,o)}return o},p=["","moz","webkit","ms"],v=function(e){return Math.floor(Math.random()*e)},m=function(e){for(var t=e||v,n=t(3),r=[],o=0;3>o;++o)r.push(t(128)+(o===n?128:64));return"rgb("+r.join(",")+")"},g=function(e){for(var t=e||v,n=t(3),r=255,o=0;3>o;++o)r=r<<8|t(128)+(o===n?128:64);return r},y=function(e){for(var t=0;te?-1:e>0?1:0},P=function(e,t){return Math.abs(e)=8}}();return n&&(e||t)}(),o=function(){return r},i=function(){var e=/iP(hone|od|ad)/i.test(navigator.platform);return function(){return e}}(),a=function(){var e=/Android|webOS|Phone|Pad|Pod|Tablet|BlackBerry/i.test(navigator.userAgent);return function(){return e}}(),s=function(){for(var e=document.querySelectorAll(".fixheight"),t=0;t]/g,"");t.length>16&&(t=t.substring(0,16)),0===t.length?a.value=u:t!==u&&(u=t,c.set(u,700),m()),g(!1)};this.startNameEntry=function(){l.style.display="block",d.style.display="none",s()||(a.value=t.pickRandomElement(o)),a.focus()},i.addEventListener("_hft_setname_",v),a.addEventListener("click",y,!1),a.addEventListener("change",b,!1),a.addEventListener("blur",b,!1),a.addEventListener("focus",y,!1),a.form&&a.form.addEventListener("submit",b,!1),f(),m()};return i}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[],o=function(){var e=function(e,t,n,r,o){o=o||1,e.beginPath(),e.arc(t,n,r,0,2*Math.PI),1&o&&e.fill(),2&o&&e.stroke()},t=function(e){this.element=e.element,this.size=e.size,this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.resize(),this.ctx=this.canvas.getContext("2d"),this.drawBits(0)};return t.prototype.getSize=function(){var e=this.size;return e||(e=Math.min(this.canvas.width,this.canvas.height)),e},t.prototype.drawBits=function(t){var n=this.getSize(),r=Math.floor(n/6.5),o=Math.floor(n/2),i=Math.floor(n/2),a=Math.floor(n/2*.8),s=Math.floor(n/2*.8),c=this.ctx;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.save(),c.translate(o,i),c.fillStyle="#AAA",c.stokeStyle="#444",e(c,0,0,.95*o,3),c.fillStyle="#888",c.fillRect(-r,-s,2*r,2*s),c.fillRect(-a,-r,2*a,2*r),c.fillStyle="#CCC",1&t&&e(c,a-r,0,.8*r),2&t&&e(c,-a+r,0,.8*r),4&t&&e(c,0,-a+r,.8*r),8&t&&e(c,0,a-r,.8*r),c.restore()},t.prototype.draw=function(e){this.drawBits(e.bits)},t.prototype.resize=function(){var e=this.size;e||(e=Math.min(this.canvas.clientWidth,this.canvas.clientHeight)),this.canvas.width===e&&this.canvas.height===e||(this.canvas.width=e,this.canvas.height=e)},t}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r,o;"use strict",r=[n(9)],o=function(e){var t={kLeft:37,kRight:39,kUp:38,kDown:40},n=[37,39,38,40],r=[65,68,87,83],o={pads:[{keys:r}]},i={pads:[{keys:n}]},a=/^\d+$/,s=1,c=2,u=4,l=8,d={};d[-1]={direction:-1,dx:0,dy:0,bits:0,symbol:String.fromCharCode(10065)},d[0]={direction:0,dx:1,dy:0,bits:s,symbol:String.fromCharCode(8594)},d[1]={direction:1,dx:1,dy:1,bits:u|s,symbol:String.fromCharCode(8599)},d[2]={direction:2,dx:0,dy:1,bits:u,symbol:String.fromCharCode(8593)},d[3]={direction:3,dx:-1,dy:1,bits:u|c,symbol:String.fromCharCode(8598)},d[4]={direction:4,dx:-1,dy:0,bits:c,symbol:String.fromCharCode(8592)},d[5]={direction:5,dx:-1,dy:-1,bits:l|c,symbol:String.fromCharCode(8601)},d[6]={direction:6,dx:0,dy:-1,bits:l,symbol:String.fromCharCode(8595)},d[7]={direction:7,dx:1,dy:-1,bits:l|s,symbol:String.fromCharCode(8600)};var h=function(e){return{pad:e,info:void 0}},f=function(e,t,n,r){var o=d[t];n.pad=e,n.info=o,r(n)},p=function(e){return d[e]},v=function(t,n){var r=e.getAbsolutePosition(t),o=n.pageX-r.x,i=n.pageY-r.y;return{x:o,y:i}},m=function(e,t){var n={},r={},o=function(o,i){n[o]=i,r!==n&&(r=i,i?e(o):t(o))},i=function(e){o(e.keyCode,!1)},a=function(e){o(e.keyCode,!0)};window.addEventListener("keyup",i,!1),window.addEventListener("keydown",a,!1)},g=function(t,o){o||(o={pads:[{keys:r},{keys:n}]});for(var i=[],a=[],s=[],c=[],u=[{bit:1,exclude:2,mask:3},{bit:2,exclude:1,mask:3},{bit:4,exclude:8,mask:12},{bit:8,exclude:4,mask:12}],l={},d=0;dv;++v){var g=u[v],y={pad:d};e.copyProperties(g,y),l[p.keys[v]]=y}}var b=[-1,4,0,-1,2,3,1,-1,6,5,7,-1,-1,-1,-1,-1],E=function(e,n){var r=l[e];if(r){var o=r.pad,u=r.bit,d=i[o];if(n?(d|=u,a[o]=a[o]&~r.mask|r.exclude):(d&=~u,a[o]&=~r.mask),d!==i[o]){i[o]=d;var h=b[d&~a[o]];h!==s[o]&&(s[o]=h,f(o,h,c[o],t))}}},w=function(e){E(e,0)},S=function(e){E(e,1)};m(S,w)},y=function(e){var t={};Object.keys(e).forEach(function(n){var r=e[n];if(!a.test(n)){if(1!==n.length)throw"bad key code: '"+n+"'";n=n.charCodeAt(0)}t[n]=r});var n=function(e,n,r){var o=t[e];o&&o({keyCode:e,pressed:r})},r=function(e,t){n(e,t,!0)},o=function(e,t){n(e,t,!1)};m(r,o)};return{cursorKeys:t,createDirectionEventInfo:h,emitDirectionEvent:f,getDirectionInfo:p,kCursorKeys:n,kCursorPadOnly:i,kASWDKeys:r,kASWDPadOnly:o,getRelativeCoordinates:v,setupControllerKeys:m,setupKeyboardDPadKeys:g,setupKeys:y}}.apply(t,r),!(void 0!==o&&(e.exports=o))},function(e,t,n){var r;"use strict",r=function(){var e=function(){var e={};return function(t,n){var r=e[t];return(!r||r.length=r)return n;var i=e(o,r);return n+i.substr(n.length-r)},r=function(n,r,o){if(n=t(n),n.length>=r)return n;var i=e(o,r);return i.substr(n.length-r)+n},o=function(){var e=/%\(([^\)]+)\)s/g;return function(t,n){return n.length||(n=[n]),t.replace(e,function(e,t){for(var r=t.split("."),o=0;o=t.length&&e.substr(0,t.length)===t},a=function(e,t){return e.length>=t.length&&e.substring(e.length-t.length)===t},s=String.fromCodePoint?String.fromCodePoint:function(){var e=String.fromCharCode,t=Math.floor,n=function(){var n,r,o=16384,i=[],a=-1,s=arguments.length;if(!s)return"";for(var c="";++au||u>1114111||t(u)!==u)throw new RangeError("Invalid code point: "+u);65535>=u?i.push(u):(u-=65536,n=(u>>10)+55296,r=u%1024+56320,i.push(n,r)),(a+1===s||i.length>o)&&(c+=e.apply(null,i),i.length=0)}return c};return n}(),c={endsWith:a,fromCodePoint:s,padLeft:r,padRight:n,replaceParams:o,startsWith:i};return c}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))},function(e,t,n){var r,o;"use strict",r=[n(17),n(14),n(9)],o=function(e,t,n){var r=function(e){var n=e.callback,r=e.inputElement;e.deadSpaceRadius=e.deadSpaceRadius||10;var o=e.deadSpaceRadius*e.deadSpaceRadius,i=function(e,t){this.reset(e,t)};i.prototype.reset=function(e,t){return this.x=e,this.y=t,this},i.prototype.copyFrom=function(e){this.x=e.x,this.y=e.y},i.prototype.minusEq=function(e){return this.x-=e.x,this.y-=e.y,this};for(var a=function(e){return{pointerId:-1,pointerPos:new i(0,0),pointerStartPos:new i(0,0),vector:new i(0,0),dir:-1,lastDir:0,event:t.createDirectionEventInfo(e)}},s=[],c=0;ct?2:6:0>e?4:0},d=[3,4,2,-1,1,0,2,-1,5,4,6,-1,7,0,6,-1],h=function(t,n){var r=Math.abs(n)0?4:0)|(n>0?8:0);return d[i]},f=e.axisSize?h:u;4===e.divisions&&(f=l);var p=function(e,r){var o=s[e];t.emitDirectionEvent(e,r,o.event,n)},v=function(e,t,n){var r=-1;if(!n){var i=e.vector.x*e.vector.x+e.vector.y*e.vector.y;i>o&&(r=f(e.vector.x,e.vector.y),e.lastDir=r)}e.dir!==r&&(e.dir=r,p(t,r))},m=function(n,r){var o=s[n],i=e.pads[n];o.pointerId=r.pointerId;var a=t.getRelativeCoordinates(i.referenceElement,r),c=a.x-(i.offsetX||i.referenceElement.clientWidth/2),u=a.y-(i.offsetY||i.referenceElement.clientHeight/2);e.fixedCenter?(o.pointerStartPos.reset(0,0),o.pointerPos.reset(c,u),o.vector.reset(c,u),v(o,n)):(o.pointerStartPos.reset(c,u),o.pointerPos.copyFrom(o.pointerStartPos),o.vector.reset(0,0),o.dir=o.lastDir,p(n,o.lastDir))},g=function(n){for(var r,o=0,i=0;ip)&&(r=p,o=i)}return o},y=function(e){var t=g(e);m(t,e)},b=function(n){for(var r=0;rr&&(t=this.eventSourceList[r]);r++)t.register.call(t,e)},unregister:function(e){for(var t,n=this.eventSourceList.length,r=0;n>r&&(t=this.eventSourceList[r]);r++)t.unregister.call(t,e)},contains:function(e,t){try{return e.contains(t)}catch(n){return!1}},down:function(e){e.bubbles=!0,this.fireEvent("pointerdown",e)},move:function(e){e.bubbles=!0,this.fireEvent("pointermove",e)},up:function(e){e.bubbles=!0,this.fireEvent("pointerup",e)},enter:function(e){e.bubbles=!1,this.fireEvent("pointerenter",e)},leave:function(e){e.bubbles=!1,this.fireEvent("pointerleave",e)},over:function(e){e.bubbles=!0,this.fireEvent("pointerover",e)},out:function(e){e.bubbles=!0,this.fireEvent("pointerout",e)},cancel:function(e){e.bubbles=!0,this.fireEvent("pointercancel",e)},leaveOut:function(e){this.out(e),this.propagate(e,this.leave,!1)},enterOver:function(e){this.over(e),this.propagate(e,this.enter,!0)},eventHandler:function(e){if(!e._handledByPE){var t=e.type,n=this.eventMap&&this.eventMap[t];n&&n(e),e._handledByPE=!0}},listen:function(e,t){t.forEach(function(t){this.addEvent(e,t)},this)},unlisten:function(e,t){t.forEach(function(t){this.removeEvent(e,t)},this)},addEvent:function(e,t){e.addEventListener(t,this.boundHandler)},removeEvent:function(e,t){e.removeEventListener(t,this.boundHandler)},makeEvent:function(t,n){this.captureInfo[n.pointerId]&&(n.relatedTarget=null);var r=new e(t,n);return n.preventDefault&&(r.preventDefault=n.preventDefault),r._target=r._target||n.target,r},fireEvent:function(e,t){var n=this.makeEvent(e,t);return this.dispatchEvent(n)},cloneEvent:function(e){for(var t,n=Object.create(null),r=0;ri&&(t=n[i]);i++){var s=Math.abs(r-t.x),c=Math.abs(o-t.y);if(N>=s&&N>=c)return!0}},prepareEvent:function(e){var t=E.cloneEvent(e),n=t.preventDefault;return t.preventDefault=function(){e.preventDefault(),n()},t.pointerId=this.POINTER_ID,t.isPrimary=!0,t.pointerType=this.POINTER_TYPE,t},prepareButtonsForMove:function(e,t){var n=F.get(this.POINTER_ID);0!==t.which&&n?e.buttons=n.buttons:e.buttons=0,t.buttons=e.buttons},mousedown:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=F.get(this.POINTER_ID),n=this.prepareEvent(e);D||(n.buttons=A[n.button],t&&(n.buttons|=t.buttons),e.buttons=n.buttons),F.set(this.POINTER_ID,e),t&&0!==t.buttons?E.move(n):E.down(n)}},mousemove:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);D||this.prepareButtonsForMove(t,e),t.button=-1,F.set(this.POINTER_ID,e),E.move(t)}},mouseup:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=F.get(this.POINTER_ID),n=this.prepareEvent(e);if(!D){var r=A[n.button];n.buttons=t?t.buttons&~r:0,e.buttons=n.buttons}F.set(this.POINTER_ID,e),n.buttons&=~A[n.button],0===n.buttons?E.up(n):E.move(n)}},mouseover:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);D||this.prepareButtonsForMove(t,e),t.button=-1,F.set(this.POINTER_ID,e),E.enterOver(t)}},mouseout:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);D||this.prepareButtonsForMove(t,e),t.button=-1,E.leaveOut(t)}},cancel:function(e){var t=this.prepareEvent(e);E.cancel(t),this.deactivateMouse()},deactivateMouse:function(){F["delete"](this.POINTER_ID)}},z=E.captureInfo,q=w.findTarget.bind(w),X=w.allShadows.bind(w),j=E.pointermap,B=2500,U=200,K="touch-action",W={events:["touchstart","touchmove","touchend","touchcancel"],register:function(e){Y.enableOnSubtree(e)},unregister:function(){},elementAdded:function(e){var t=e.getAttribute(K),n=this.touchActionToScrollType(t);n&&(e._scrollType=n,E.listen(e,this.events),X(e).forEach(function(e){e._scrollType=n,E.listen(e,this.events)},this))},elementRemoved:function(e){e._scrollType=void 0,E.unlisten(e,this.events),X(e).forEach(function(e){e._scrollType=void 0,E.unlisten(e,this.events)},this)},elementChanged:function(e,t){var n=e.getAttribute(K),r=this.touchActionToScrollType(n),o=this.touchActionToScrollType(t);r&&o?(e._scrollType=r,X(e).forEach(function(e){e._scrollType=r},this)):o?this.elementRemoved(e):r&&this.elementAdded(e)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(e){var t=e,n=this.scrollTypes;return"none"===t?"none":t===n.XSCROLLER?"X":t===n.YSCROLLER?"Y":n.SCROLLER.exec(t)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(e){return this.firstTouch===e.identifier},setPrimaryTouch:function(e){(0===j.size||1===j.size&&j.has(1))&&(this.firstTouch=e.identifier,this.firstXY={X:e.clientX,Y:e.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(e){e.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var e=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(e,U)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(e){var t=0;return"touchstart"!==e&&"touchmove"!==e||(t=1),t},touchToPointer:function(e){var t=this.currentTouchEvent,n=E.cloneEvent(e),r=n.pointerId=e.identifier+2;n.target=z[r]||q(n),n.bubbles=!0,n.cancelable=!0,n.detail=this.clickCount,n.button=0,n.buttons=this.typeToButtons(t.type),n.width=2*(e.radiusX||e.webkitRadiusX||0),n.height=2*(e.radiusY||e.webkitRadiusY||0),n.pressure=e.force||e.webkitForce||.5,n.isPrimary=this.isPrimaryTouch(e),n.pointerType=this.POINTER_TYPE,n.altKey=t.altKey,n.ctrlKey=t.ctrlKey,n.metaKey=t.metaKey,n.shiftKey=t.shiftKey;var o=this;return n.preventDefault=function(){o.scrolling=!1,o.firstXY=null,t.preventDefault()},n},processTouches:function(e,t){var n=e.changedTouches;this.currentTouchEvent=e;for(var r,o=0;o=s}return this.firstXY=null,t}},findTouch:function(e,t){for(var n,r=0,o=e.length;o>r&&(n=e[r]);r++)if(n.identifier===t)return!0},vacuumTouches:function(e){var t=e.touches;if(j.size>=t.length){var n=[];j.forEach(function(e,r){if(1!==r&&!this.findTouch(t,r-2)){var o=e.out;n.push(o)}},this),n.forEach(this.cancelOut,this)}},touchstart:function(e){this.vacuumTouches(e),this.setPrimaryTouch(e.changedTouches[0]),this.dedupSynthMouse(e),this.scrolling||(this.clickCount++,this.processTouches(e,this.overDown))},overDown:function(e){j.set(e.pointerId,{target:e.target,out:e,outTarget:e.target}),E.enterOver(e),E.down(e)},touchmove:function(e){this.scrolling||(this.shouldScroll(e)?(this.scrolling=!0,this.touchcancel(e)):(e.preventDefault(),this.processTouches(e,this.moveOverOut)))},moveOverOut:function(e){var t=e,n=j.get(t.pointerId);if(n){var r=n.out,o=n.outTarget;E.move(t),r&&o!==t.target&&(r.relatedTarget=t.target,t.relatedTarget=o,r.target=o,t.target?(E.leaveOut(r),E.enterOver(t)):(t.target=o,t.relatedTarget=null,this.cancelOut(t))),n.out=t,n.outTarget=t.target}},touchend:function(e){this.dedupSynthMouse(e),this.processTouches(e,this.upOut)},upOut:function(e){this.scrolling||(E.up(e),E.leaveOut(e)),this.cleanUpPointer(e)},touchcancel:function(e){this.processTouches(e,this.cancelOut)},cancelOut:function(e){E.cancel(e),E.leaveOut(e),this.cleanUpPointer(e)},cleanUpPointer:function(e){j["delete"](e.pointerId),this.removePrimaryPointer(e)},dedupSynthMouse:function(e){var t=H.lastTouches,n=e.changedTouches[0];if(this.isPrimaryTouch(n)){var r={x:n.clientX,y:n.clientY};t.push(r);var o=function(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}.bind(null,t,r);setTimeout(o,B)}}};Y=new n(W.elementAdded,W.elementRemoved,W.elementChanged,W);var G,V,J,$=E.pointermap,Q=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,Z={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(e){E.listen(e,this.events)},unregister:function(e){E.unlisten(e,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(e){var t=e;return Q&&(t=E.cloneEvent(e),t.pointerType=this.POINTER_TYPES[e.pointerType]),t},cleanup:function(e){$["delete"](e)},MSPointerDown:function(e){$.set(e.pointerId,e);var t=this.prepareEvent(e);E.down(t)},MSPointerMove:function(e){var t=this.prepareEvent(e);E.move(t)},MSPointerUp:function(e){var t=this.prepareEvent(e);E.up(t),this.cleanup(e.pointerId)},MSPointerOut:function(e){var t=this.prepareEvent(e);E.leaveOut(t)},MSPointerOver:function(e){var t=this.prepareEvent(e);E.enterOver(t)},MSPointerCancel:function(e){var t=this.prepareEvent(e);E.cancel(t),this.cleanup(e.pointerId)},MSLostPointerCapture:function(e){var t=E.makeEvent("lostpointercapture",e);E.dispatchEvent(t)},MSGotPointerCapture:function(e){var t=E.makeEvent("gotpointercapture",e);E.dispatchEvent(t)}},ee=window.navigator;ee.msPointerEnabled?(G=function(e){c(e),u(this),l(e)&&(E.setCapture(e,this,!0),this.msSetPointerCapture(e))},V=function(e){c(e),E.releaseCapture(e,!0),this.msReleasePointerCapture(e)}):(G=function(e){c(e),u(this),l(e)&&E.setCapture(e,this)},V=function(e){c(e),E.releaseCapture(e)}),J=function(e){return!!E.captureInfo[e]},a(),s(),d();var te={dispatcher:E,Installer:n,PointerEvent:e,PointerMap:v,targetFinding:w};return te})}]); \ No newline at end of file diff --git a/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui.js b/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui.js index b980e3d..3da75b3 100644 --- a/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui.js +++ b/Assets/WebPlayerTemplates/HappyFunTimes/sample-ui/sample-ui.js @@ -3431,7 +3431,7 @@ var updatePad = function(pad, padId, out) { var newDir = -1; - if (!out && pad.pointerId >= 0) { + if (!out /* && pad.pointerId !== 0*/) { var distSq = pad.vector.x * pad.vector.x + pad.vector.y * pad.vector.y; if (distSq > deadSpaceRadiusSq) { newDir = computeDir(pad.vector.x, pad.vector.y); @@ -3697,10 +3697,215 @@ /***/ function(module, exports, __webpack_require__) { /*! - * PEP v0.4.1 | https://github.com/jquery/PEP + * PEP v0.4.3 | https://github.com/jquery/PEP * Copyright jQuery Foundation and other contributors | http://jquery.org/license */ - !function(a,b){ true?module.exports=b():"function"==typeof define&&define.amd?define(b):a.PointerEventsPolyfill=b()}(this,function(){"use strict";function a(a,b){b=b||Object.create(null);var c=document.createEvent("Event");c.initEvent(a,b.bubbles||!1,b.cancelable||!1);for(var d,e=2;ed&&(b=this.eventSourceList[d]);d++)b.register.call(b,a)},unregister:function(a){for(var b,c=this.eventSourceList.length,d=0;c>d&&(b=this.eventSourceList[d]);d++)b.unregister.call(b,a)},contains:function(a,b){try{return a.contains(b)}catch(c){return!1}},down:function(a){a.bubbles=!0,this.fireEvent("pointerdown",a)},move:function(a){a.bubbles=!0,this.fireEvent("pointermove",a)},up:function(a){a.bubbles=!0,this.fireEvent("pointerup",a)},enter:function(a){a.bubbles=!1,this.fireEvent("pointerenter",a)},leave:function(a){a.bubbles=!1,this.fireEvent("pointerleave",a)},over:function(a){a.bubbles=!0,this.fireEvent("pointerover",a)},out:function(a){a.bubbles=!0,this.fireEvent("pointerout",a)},cancel:function(a){a.bubbles=!0,this.fireEvent("pointercancel",a)},leaveOut:function(a){this.out(a),this.contains(a.target,a.relatedTarget)||this.leave(a)},enterOver:function(a){this.over(a),this.contains(a.target,a.relatedTarget)||this.enter(a)},eventHandler:function(a){if(!a._handledByPE){var b=a.type,c=this.eventMap&&this.eventMap[b];c&&c(a),a._handledByPE=!0}},listen:function(a,b){b.forEach(function(b){this.addEvent(a,b)},this)},unlisten:function(a,b){b.forEach(function(b){this.removeEvent(a,b)},this)},addEvent:function(a,b){a.addEventListener(b,this.boundHandler)},removeEvent:function(a,b){a.removeEventListener(b,this.boundHandler)},makeEvent:function(a,b){this.captureInfo[b.pointerId]&&(b.relatedTarget=null);var c=new m(a,b);return b.preventDefault&&(c.preventDefault=b.preventDefault),c._target=c._target||b.target,c},fireEvent:function(a,b){var c=this.makeEvent(a,b);return this.dispatchEvent(c)},cloneEvent:function(a){for(var b,c=Object.create(null),d=0;df&&(b=c[f]);f++){var h=Math.abs(d-b.x),i=Math.abs(e-b.y);if(K>=h&&K>=i)return!0}},prepareEvent:function(a){var b=v.cloneEvent(a),c=b.preventDefault;return b.preventDefault=function(){a.preventDefault(),c()},b.pointerId=this.POINTER_ID,b.isPrimary=!0,b.pointerType=this.POINTER_TYPE,b},prepareButtonsForMove:function(a,b){var c=J.get(this.POINTER_ID);a.buttons=c?c.buttons:0,b.buttons=a.buttons},mousedown:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=J.get(this.POINTER_ID),c=this.prepareEvent(a);M||(c.buttons=L[c.button],b&&(c.buttons|=b.buttons),a.buttons=c.buttons),J.set(this.POINTER_ID,a),b?v.move(c):v.down(c)}},mousemove:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);M||this.prepareButtonsForMove(b,a),v.move(b)}},mouseup:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=J.get(this.POINTER_ID),c=this.prepareEvent(a);if(!M){var d=L[c.button];c.buttons=b?b.buttons&~d:0,a.buttons=c.buttons}J.set(this.POINTER_ID,a),0===c.buttons||c.buttons===L[c.button]?(this.cleanupMouse(),v.up(c)):v.move(c)}},mouseover:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);M||this.prepareButtonsForMove(b,a),v.enterOver(b)}},mouseout:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);M||this.prepareButtonsForMove(b,a),v.leaveOut(b)}},cancel:function(a){var b=this.prepareEvent(a);v.cancel(b),this.cleanupMouse()},cleanupMouse:function(){J["delete"](this.POINTER_ID)}},Q=P,R=v.captureInfo,S=w.findTarget.bind(w),T=w.allShadows.bind(w),U=v.pointermap,V=2500,W=200,X="touch-action",Y=!1,Z={events:["touchstart","touchmove","touchend","touchcancel"],register:function(a){Y?v.listen(a,this.events):O.enableOnSubtree(a)},unregister:function(a){Y&&v.unlisten(a,this.events)},elementAdded:function(a){var b=a.getAttribute(X),c=this.touchActionToScrollType(b);c&&(a._scrollType=c,v.listen(a,this.events),T(a).forEach(function(a){a._scrollType=c,v.listen(a,this.events)},this))},elementRemoved:function(a){a._scrollType=void 0,v.unlisten(a,this.events),T(a).forEach(function(a){a._scrollType=void 0,v.unlisten(a,this.events)},this)},elementChanged:function(a,b){var c=a.getAttribute(X),d=this.touchActionToScrollType(c),e=this.touchActionToScrollType(b);d&&e?(a._scrollType=d,T(a).forEach(function(a){a._scrollType=d},this)):e?this.elementRemoved(a):d&&this.elementAdded(a)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(a){var b=a,c=this.scrollTypes;return"none"===b?"none":b===c.XSCROLLER?"X":b===c.YSCROLLER?"Y":c.SCROLLER.exec(b)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(a){return this.firstTouch===a.identifier},setPrimaryTouch:function(a){(0===U.size||1===U.size&&U.has(1))&&(this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(a){a.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var a=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(a,W)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(a){var b=0;return("touchstart"===a||"touchmove"===a)&&(b=1),b},touchToPointer:function(a){var b=this.currentTouchEvent,c=v.cloneEvent(a),d=c.pointerId=a.identifier+2;c.target=R[d]||S(c),c.bubbles=!0,c.cancelable=!0,c.detail=this.clickCount,c.button=0,c.buttons=this.typeToButtons(b.type),c.width=a.radiusX||a.webkitRadiusX||0,c.height=a.radiusY||a.webkitRadiusY||0,c.pressure=a.force||a.webkitForce||.5,c.isPrimary=this.isPrimaryTouch(a),c.pointerType=this.POINTER_TYPE;var e=this;return c.preventDefault=function(){e.scrolling=!1,e.firstXY=null,b.preventDefault()},c},processTouches:function(a,b){var c=a.changedTouches;this.currentTouchEvent=a;for(var d,e=0;e=h}return this.firstXY=null,b}},findTouch:function(a,b){for(var c,d=0,e=a.length;e>d&&(c=a[d]);d++)if(c.identifier===b)return!0},vacuumTouches:function(a){var b=a.touches;if(U.size>=b.length){var c=[];U.forEach(function(a,d){if(1!==d&&!this.findTouch(b,d-2)){var e=a.out;c.push(e)}},this),c.forEach(this.cancelOut,this)}},touchstart:function(a){this.vacuumTouches(a),this.setPrimaryTouch(a.changedTouches[0]),this.dedupSynthMouse(a),this.scrolling||(this.clickCount++,this.processTouches(a,this.overDown))},overDown:function(a){U.set(a.pointerId,{target:a.target,out:a,outTarget:a.target}),v.over(a),v.enter(a),v.down(a)},touchmove:function(a){this.scrolling||(this.shouldScroll(a)?(this.scrolling=!0,this.touchcancel(a)):(a.preventDefault(),this.processTouches(a,this.moveOverOut)))},moveOverOut:function(a){var b=a,c=U.get(b.pointerId);if(c){var d=c.out,e=c.outTarget;v.move(b),d&&e!==b.target&&(d.relatedTarget=b.target,b.relatedTarget=e,d.target=e,b.target?(v.leaveOut(d),v.enterOver(b)):(b.target=e,b.relatedTarget=null,this.cancelOut(b))),c.out=b,c.outTarget=b.target}},touchend:function(a){this.dedupSynthMouse(a),this.processTouches(a,this.upOut)},upOut:function(a){this.scrolling||(v.up(a),v.out(a),v.leave(a)),this.cleanUpPointer(a)},touchcancel:function(a){this.processTouches(a,this.cancelOut)},cancelOut:function(a){v.cancel(a),v.out(a),v.leave(a),this.cleanUpPointer(a)},cleanUpPointer:function(a){U["delete"](a.pointerId),this.removePrimaryPointer(a)},dedupSynthMouse:function(a){var b=Q.lastTouches,c=a.changedTouches[0];if(this.isPrimaryTouch(c)){var d={x:c.clientX,y:c.clientY};b.push(d);var e=function(a,b){var c=a.indexOf(b);c>-1&&a.splice(c,1)}.bind(null,b,d);setTimeout(e,V)}}};Y||(O=new E(Z.elementAdded,Z.elementRemoved,Z.elementChanged,Z));var $,_,aa=Z,ba=v.pointermap,ca=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,da={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(a){v.listen(a,this.events)},unregister:function(a){v.unlisten(a,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(a){var b=a;return ca&&(b=v.cloneEvent(a),b.pointerType=this.POINTER_TYPES[a.pointerType]),b},cleanup:function(a){ba["delete"](a)},MSPointerDown:function(a){ba.set(a.pointerId,a);var b=this.prepareEvent(a);v.down(b)},MSPointerMove:function(a){var b=this.prepareEvent(a);v.move(b)},MSPointerUp:function(a){var b=this.prepareEvent(a);v.up(b),this.cleanup(a.pointerId)},MSPointerOut:function(a){var b=this.prepareEvent(a);v.leaveOut(b)},MSPointerOver:function(a){var b=this.prepareEvent(a);v.enterOver(b)},MSPointerCancel:function(a){var b=this.prepareEvent(a);v.cancel(b),this.cleanup(a.pointerId)},MSLostPointerCapture:function(a){var b=v.makeEvent("lostpointercapture",a);v.dispatchEvent(b)},MSGotPointerCapture:function(a){var b=v.makeEvent("gotpointercapture",a);v.dispatchEvent(b)}},ea=da,fa=window.navigator;fa.msPointerEnabled?($=function(a){i(a),this.msSetPointerCapture(a)},_=function(a){i(a),this.msReleasePointerCapture(a)}):($=function(a){i(a),v.setCapture(a,this)},_=function(a){i(a),v.releaseCapture(a,this)}),g(),h(),j();var ga={dispatcher:v,Installer:E,PointerEvent:m,PointerMap:p,targetFinding:w};return ga}); + !function(a,b){ true?module.exports=b():"function"==typeof define&&define.amd?define(b):a.PointerEventsPolyfill=b()}(this,function(){"use strict";function a(a,b){b=b||Object.create(null);var c=document.createEvent("Event");c.initEvent(a,b.bubbles||!1,b.cancelable||!1); + // define inherited MouseEvent properties + // skip bubbles and cancelable since they're set above in initEvent() + for(var d,e=2;e element that is represented by the instance for Safari, Chrome, IE. + // This is the behavior implemented by Firefox. + !t||"target"!==b&&"relatedTarget"!==b||c[b]instanceof SVGElementInstance&&(c[b]=c[b].correspondingUseElement); + // keep the semantics of preventDefault + return a.preventDefault&&(c.preventDefault=function(){a.preventDefault()}),c},getTarget:function(a){var b=this.captureInfo[a.pointerId];return b?a._target!==b&&a.type in s?void 0:b:a._target},propagate:function(a,b,c){ + // Order of conditions due to document.contains() missing in IE. + for(var d=a.target,e=[];d!==document&&!d.contains(a.relatedTarget);) + // Touch: Do not propagate if node is detached. + if(e.push(d),d=d.parentNode,!d)return;c&&e.reverse(),e.forEach(function(c){a.target=c,b.call(this,a)},this)},setCapture:function(b,c,d){this.captureInfo[b]&&this.releaseCapture(b,d),this.captureInfo[b]=c,this.implicitRelease=this.releaseCapture.bind(this,b,d),document.addEventListener("pointerup",this.implicitRelease),document.addEventListener("pointercancel",this.implicitRelease);var e=new a("gotpointercapture");e.pointerId=b,e._target=c,d||this.asyncDispatchEvent(e)},releaseCapture:function(b,c){var d=this.captureInfo[b];if(d){this.captureInfo[b]=void 0,document.removeEventListener("pointerup",this.implicitRelease),document.removeEventListener("pointercancel",this.implicitRelease);var e=new a("lostpointercapture");e.pointerId=b,e._target=d,c||this.asyncDispatchEvent(e)}},/** + * Dispatches the event to its target. + * + * @param {Event} inEvent The event to be dispatched. + * @return {Boolean} True if an event handler returns true, false otherwise. + */ + dispatchEvent:/*scope.external.dispatchEvent || */function(a){var b=this.getTarget(a);if(b)return b.dispatchEvent(a)},asyncDispatchEvent:function(a){requestAnimationFrame(this.dispatchEvent.bind(this,a))}};u.boundHandler=u.eventHandler.bind(u);var v={shadow:function(a){if(a)return a.shadowRoot||a.webkitShadowRoot},canTarget:function(a){return a&&Boolean(a.elementFromPoint)},targetingShadow:function(a){var b=this.shadow(a);if(this.canTarget(b))return b},olderShadow:function(a){var b=a.olderShadowRoot;if(!b){var c=a.querySelector("shadow");c&&(b=c.olderShadowRoot)}return b},allShadows:function(a){for(var b=[],c=this.shadow(a);c;)b.push(c),c=this.olderShadow(c);return b},searchRoot:function(a,b,c){if(a){var d,e,f=a.elementFromPoint(b,c);for( + // is element a shadow host? + e=this.targetingShadow(f);e;){if( + // find the the element inside the shadow root + d=e.elementFromPoint(b,c)){ + // shadowed element may contain a shadow root + var g=this.targetingShadow(d);return this.searchRoot(g,b,c)||d} + // check for older shadows + e=this.olderShadow(e)} + // light dom element is the target + return f}},owner:function(a){ + // walk up until you hit the shadow root or document + for(var b=a;b.parentNode;)b=b.parentNode; + // the owner element is expected to be a Document or ShadowRoot + return b.nodeType!==Node.DOCUMENT_NODE&&b.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&(b=document),b},findTarget:function(a){var b=a.clientX,c=a.clientY,d=this.owner(a.target); + // if x, y is not in this root, fall back to document search + return d.elementFromPoint(b,c)||(d=document),this.searchRoot(d,b,c)}},w=Array.prototype.forEach.call.bind(Array.prototype.forEach),x=Array.prototype.map.call.bind(Array.prototype.map),y=Array.prototype.slice.call.bind(Array.prototype.slice),z=Array.prototype.filter.call.bind(Array.prototype.filter),A=window.MutationObserver||window.WebKitMutationObserver,B="[touch-action]",C={subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["touch-action"]};c.prototype={watchSubtree:function(a){ + // Only watch scopes that can target find, as these are top-level. + // Otherwise we can see duplicate additions and removals that add noise. + // + // TODO(dfreedman): For some instances with ShadowDOMPolyfill, we can see + // a removal without an insertion when a node is redistributed among + // shadows. Since it all ends up correct in the document, watching only + // the document will yield the correct mutations to watch. + this.observer&&v.canTarget(a)&&this.observer.observe(a,C)},enableOnSubtree:function(a){this.watchSubtree(a),a===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(a)},installNewSubtree:function(a){w(this.findElements(a),this.addElement,this)},findElements:function(a){return a.querySelectorAll?a.querySelectorAll(B):[]},removeElement:function(a){this.removeCallback(a)},addElement:function(a){this.addCallback(a)},elementChanged:function(a,b){this.changedCallback(a,b)},concatLists:function(a,b){return a.concat(y(b))}, + // register all touch-action = none nodes on document load + installOnLoad:function(){document.addEventListener("readystatechange",function(){"complete"===document.readyState&&this.installNewSubtree(document)}.bind(this))},isElement:function(a){return a.nodeType===Node.ELEMENT_NODE},flattenMutationTree:function(a){ + // find children with touch-action + var b=x(a,this.findElements,this); + // flatten the list + // make sure the added nodes are accounted for + return b.push(z(a,this.isElement)),b.reduce(this.concatLists,[])},mutationWatcher:function(a){a.forEach(this.mutationHandler,this)},mutationHandler:function(a){if("childList"===a.type){var b=this.flattenMutationTree(a.addedNodes);b.forEach(this.addElement,this);var c=this.flattenMutationTree(a.removedNodes);c.forEach(this.removeElement,this)}else"attributes"===a.type&&this.elementChanged(a.target,a.oldValue)}};var D=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],E="",F=window.PointerEvent||window.MSPointerEvent,G=!window.ShadowDOMPolyfill&&document.head.createShadowRoot,H=u.pointermap,I=25,J=[1,4,2,8,16],K=!1;try{K=1===new MouseEvent("test",{buttons:1}).buttons}catch(L){} + // handler block for native mouse events + var M,N={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],register:function(a){u.listen(a,this.events)},unregister:function(a){u.unlisten(a,this.events)},lastTouches:[], + // collide with the global mouse listener + isEventSimulatedFromTouch:function(a){for(var b,c=this.lastTouches,d=a.clientX,e=a.clientY,f=0,g=c.length;f delta other axis, scroll instead of + // making events + b=g>=h}return this.firstXY=null,b}},findTouch:function(a,b){for(var c,d=0,e=a.length;d=b.length){var c=[];R.forEach(function(a,d){ + // Never remove pointerId == 1, which is mouse. + // Touch identifiers are 2 smaller than their pointerId, which is the + // index in pointermap. + if(1!==d&&!this.findTouch(b,d-2)){var e=a.out;c.push(e)}},this),c.forEach(this.cancelOut,this)}},touchstart:function(a){this.vacuumTouches(a),this.setPrimaryTouch(a.changedTouches[0]),this.dedupSynthMouse(a),this.scrolling||(this.clickCount++,this.processTouches(a,this.overDown))},overDown:function(a){R.set(a.pointerId,{target:a.target,out:a,outTarget:a.target}),u.enterOver(a),u.down(a)},touchmove:function(a){this.scrolling||(this.shouldScroll(a)?(this.scrolling=!0,this.touchcancel(a)):(a.preventDefault(),this.processTouches(a,this.moveOverOut)))},moveOverOut:function(a){var b=a,c=R.get(b.pointerId); + // a finger drifted off the screen, ignore it + if(c){var d=c.out,e=c.outTarget;u.move(b),d&&e!==b.target&&(d.relatedTarget=b.target,b.relatedTarget=e, + // recover from retargeting by shadow + d.target=e,b.target?(u.leaveOut(d),u.enterOver(b)):( + // clean up case when finger leaves the screen + b.target=e,b.relatedTarget=null,this.cancelOut(b))),c.out=b,c.outTarget=b.target}},touchend:function(a){this.dedupSynthMouse(a),this.processTouches(a,this.upOut)},upOut:function(a){this.scrolling||(u.up(a),u.leaveOut(a)),this.cleanUpPointer(a)},touchcancel:function(a){this.processTouches(a,this.cancelOut)},cancelOut:function(a){u.cancel(a),u.leaveOut(a),this.cleanUpPointer(a)},cleanUpPointer:function(a){R["delete"](a.pointerId),this.removePrimaryPointer(a)}, + // prevent synth mouse events from creating pointer events + dedupSynthMouse:function(a){var b=N.lastTouches,c=a.changedTouches[0]; + // only the primary finger will synth mouse events + if(this.isPrimaryTouch(c)){ + // remember x/y of last touch + var d={x:c.clientX,y:c.clientY};b.push(d);var e=function(a,b){var c=a.indexOf(b);c>-1&&a.splice(c,1)}.bind(null,b,d);setTimeout(e,S)}}};M=new c(V.elementAdded,V.elementRemoved,V.elementChanged,V);var W,X,Y,Z=u.pointermap,$=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,_={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(a){u.listen(a,this.events)},unregister:function(a){u.unlisten(a,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(a){var b=a;return $&&(b=u.cloneEvent(a),b.pointerType=this.POINTER_TYPES[a.pointerType]),b},cleanup:function(a){Z["delete"](a)},MSPointerDown:function(a){Z.set(a.pointerId,a);var b=this.prepareEvent(a);u.down(b)},MSPointerMove:function(a){var b=this.prepareEvent(a);u.move(b)},MSPointerUp:function(a){var b=this.prepareEvent(a);u.up(b),this.cleanup(a.pointerId)},MSPointerOut:function(a){var b=this.prepareEvent(a);u.leaveOut(b)},MSPointerOver:function(a){var b=this.prepareEvent(a);u.enterOver(b)},MSPointerCancel:function(a){var b=this.prepareEvent(a);u.cancel(b),this.cleanup(a.pointerId)},MSLostPointerCapture:function(a){var b=u.makeEvent("lostpointercapture",a);u.dispatchEvent(b)},MSGotPointerCapture:function(a){var b=u.makeEvent("gotpointercapture",a);u.dispatchEvent(b)}},aa=window.navigator;aa.msPointerEnabled?(W=function(a){i(a),j(this),k(a)&&(u.setCapture(a,this,!0),this.msSetPointerCapture(a))},X=function(a){i(a),u.releaseCapture(a,!0),this.msReleasePointerCapture(a)}):(W=function(a){i(a),j(this),k(a)&&u.setCapture(a,this)},X=function(a){i(a),u.releaseCapture(a)}),Y=function(a){return!!u.captureInfo[a]},g(),h(),l();var ba={dispatcher:u,Installer:c,PointerEvent:a,PointerMap:p,targetFinding:v};return ba}); /***/ } /******/ ]); \ No newline at end of file