// Marzipano - a 360° media viewer for the modern web (v0.7.1) // // Copyright 2016 Google Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Marzipano=t()}}(function(){var t;return function(){function t(e,i,n){function r(s,a){if(!i[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var u=i[s]={exports:{}};e[s][0].call(u.exports,function(t){var i=e[s][1][t];return r(i||t)},u,u.exports,t,e,i,n)}return i[s].exports}for(var o="function"==typeof require&&require,s=0;s1&&i[1]||""}function i(e){var i=t.match(e);return i&&i.length>1&&i[2]||""}var n,r=e(/(ipod|iphone|ipad)/i).toLowerCase(),o=/like android/i.test(t),a=!o&&/android/i.test(t),l=/nexus\s*[0-6]\s*/i.test(t),h=!l&&/nexus\s*[0-9]+/i.test(t),u=/CrOS/.test(t),c=/silk/i.test(t),p=/sailfish/i.test(t),d=/tizen/i.test(t),f=/(web|hpw)os/i.test(t),m=/windows phone/i.test(t),v=(/SamsungBrowser/i.test(t),!m&&/windows/i.test(t)),_=!r&&!c&&/macintosh/i.test(t),y=!a&&!p&&!d&&!f&&/linux/i.test(t),g=i(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),x=e(/version\/(\d+(\.\d+)?)/i),w=/tablet/i.test(t)&&!/tablet pc/i.test(t),M=!w&&/[^-]mobi/i.test(t),b=/xbox/i.test(t);/opera/i.test(t)?n={name:"Opera",opera:s,version:x||e(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(t)?n={name:"Opera",opera:s,version:e(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||x}:/SamsungBrowser/i.test(t)?n={name:"Samsung Internet for Android",samsungBrowser:s,version:x||e(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(t)?n={name:"Opera Coast",coast:s,version:x||e(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(t)?n={name:"Yandex Browser",yandexbrowser:s,version:x||e(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(t)?n={name:"UC Browser",ucbrowser:s,version:e(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(t)?n={name:"Maxthon",maxthon:s,version:e(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(t)?n={name:"Epiphany",epiphany:s,version:e(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(t)?n={name:"Puffin",puffin:s,version:e(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(t)?n={name:"Sleipnir",sleipnir:s,version:e(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(t)?n={name:"K-Meleon",kMeleon:s,version:e(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:m?(n={name:"Windows Phone",osname:"Windows Phone",windowsphone:s},g?(n.msedge=s,n.version=g):(n.msie=s,n.version=e(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(t)?n={name:"Internet Explorer",msie:s,version:e(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:u?n={name:"Chrome",osname:"Chrome OS",chromeos:s,chromeBook:s,chrome:s,version:e(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(t)?n={name:"Microsoft Edge",msedge:s,version:g}:/vivaldi/i.test(t)?n={name:"Vivaldi",vivaldi:s,version:e(/vivaldi\/(\d+(\.\d+)?)/i)||x}:p?n={name:"Sailfish",osname:"Sailfish OS",sailfish:s,version:e(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(t)?n={name:"SeaMonkey",seamonkey:s,version:e(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(t)?(n={name:"Firefox",firefox:s,version:e(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(t)&&(n.firefoxos=s,n.osname="Firefox OS")):c?n={name:"Amazon Silk",silk:s,version:e(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(t)?n={name:"PhantomJS",phantom:s,version:e(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(t)?n={name:"SlimerJS",slimer:s,version:e(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(t)||/rim\stablet/i.test(t)?n={name:"BlackBerry",osname:"BlackBerry OS",blackberry:s,version:x||e(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:f?(n={name:"WebOS",osname:"WebOS",webos:s,version:x||e(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(t)&&(n.touchpad=s)):/bada/i.test(t)?n={name:"Bada",osname:"Bada",bada:s,version:e(/dolfin\/(\d+(\.\d+)?)/i)}:d?n={name:"Tizen",osname:"Tizen",tizen:s,version:e(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||x}:/qupzilla/i.test(t)?n={name:"QupZilla",qupzilla:s,version:e(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||x}:/chromium/i.test(t)?n={name:"Chromium",chromium:s,version:e(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||x}:/chrome|crios|crmo/i.test(t)?n={name:"Chrome",chrome:s,version:e(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:a?n={name:"Android",version:x}:/safari|applewebkit/i.test(t)?(n={name:"Safari",safari:s},x&&(n.version=x)):r?(n={name:"iphone"==r?"iPhone":"ipad"==r?"iPad":"iPod"},x&&(n.version=x)):n=/googlebot/i.test(t)?{name:"Googlebot",googlebot:s,version:e(/googlebot\/(\d+(\.\d+))/i)||x}:{name:e(/^(.*)\/(.*) /),version:i(/^(.*)\/(.*) /)},!n.msedge&&/(apple)?webkit/i.test(t)?(/(apple)?webkit\/537\.36/i.test(t)?(n.name=n.name||"Blink",n.blink=s):(n.name=n.name||"Webkit",n.webkit=s),!n.version&&x&&(n.version=x)):!n.opera&&/gecko\//i.test(t)&&(n.name=n.name||"Gecko",n.gecko=s,n.version=n.version||e(/gecko\/(\d+(\.\d+)?)/i)),n.windowsphone||!a&&!n.silk?!n.windowsphone&&r?(n[r]=s,n.ios=s,n.osname="iOS"):_?(n.mac=s,n.osname="macOS"):b?(n.xbox=s,n.osname="Xbox"):v?(n.windows=s,n.osname="Windows"):y&&(n.linux=s,n.osname="Linux"):(n.android=s,n.osname="Android");var S="";n.windows?S=function(t){switch(t){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return undefined}}(e(/Windows ((NT|XP)( \d\d?.\d)?)/i)):n.windowsphone?S=e(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):n.mac?(S=e(/Mac OS X (\d+([_\.\s]\d+)*)/i),S=S.replace(/[_\s]/g,".")):r?(S=e(/os (\d+([_\s]\d+)*) like mac os x/i),S=S.replace(/[_\s]/g,".")):a?S=e(/android[ \/-](\d+(\.\d+)*)/i):n.webos?S=e(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):n.blackberry?S=e(/rim\stablet\sos\s(\d+(\.\d+)*)/i):n.bada?S=e(/bada\/(\d+(\.\d+)*)/i):n.tizen&&(S=e(/tizen[\/\s](\d+(\.\d+)*)/i)),S&&(n.osversion=S);var I=!n.windows&&S.split(".")[0];return w||h||"ipad"==r||a&&(3==I||I>=4&&!M)||n.silk?n.tablet=s:(M||"iphone"==r||"ipod"==r||a||l||n.blackberry||n.webos||n.bada)&&(n.mobile=s),n.msedge||n.msie&&n.version>=10||n.yandexbrowser&&n.version>=15||n.vivaldi&&n.version>=1||n.chrome&&n.version>=20||n.samsungBrowser&&n.version>=4||n.firefox&&n.version>=20||n.safari&&n.version>=6||n.opera&&n.version>=10||n.ios&&n.osversion&&n.osversion.split(".")[0]>=6||n.blackberry&&n.version>=10.1||n.chromium&&n.version>=20?n.a=s:n.msie&&n.version<10||n.chrome&&n.version<20||n.firefox&&n.version<20||n.safari&&n.version<6||n.opera&&n.version<10||n.ios&&n.osversion&&n.osversion.split(".")[0]<6||n.chromium&&n.version<20?n.c=s:n.x=s,n}function e(t){return t.split(".").length}function i(t,e){var i,n=[];if(Array.prototype.map)return Array.prototype.map.call(t,e);for(i=0;i=0;){if(r[0][n]>r[1][n])return 1;if(r[0][n]!==r[1][n])return-1;if(0===n)return 0}}function r(e,i,r){var o=a;"string"==typeof i&&(r=i,i=void 0),void 0===i&&(i=!1),r&&(o=t(r));var s=""+o.version;for(var l in e)if(e.hasOwnProperty(l)&&o[l]){if("string"!=typeof e[l])throw new Error("Browser version in the minVersion map should be a string: "+l+": "+String(e));return n([s,e[l]])<0}return i}function o(t,e,i){return!r(t,e,i)}var s=!0,a=t("undefined"!=typeof navigator?navigator.userAgent||"":"");return a.test=function(t){for(var e=0;e0?(n=2*Math.sqrt(i+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},r.fromRotationTranslationScale=function(t,e,i,n){var r=e[0],o=e[1],s=e[2],a=e[3],l=r+r,h=o+o,u=s+s,c=r*l,p=r*h,d=r*u,f=o*h,m=o*u,v=s*u,_=a*l,y=a*h,g=a*u,x=n[0],w=n[1],M=n[2];return t[0]=(1-(f+v))*x,t[1]=(p+g)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(p-g)*w,t[5]=(1-(c+v))*w,t[6]=(m+_)*w,t[7]=0,t[8]=(d+y)*M,t[9]=(m-_)*M,t[10]=(1-(c+f))*M,t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1,t},r.fromRotationTranslationScaleOrigin=function(t,e,i,n,r){var o=e[0],s=e[1],a=e[2],l=e[3],h=o+o,u=s+s,c=a+a,p=o*h,d=o*u,f=o*c,m=s*u,v=s*c,_=a*c,y=l*h,g=l*u,x=l*c,w=n[0],M=n[1],b=n[2],S=r[0],I=r[1],E=r[2];return t[0]=(1-(m+_))*w,t[1]=(d+x)*w,t[2]=(f-g)*w,t[3]=0,t[4]=(d-x)*M,t[5]=(1-(p+_))*M,t[6]=(v+y)*M,t[7]=0,t[8]=(f+g)*b,t[9]=(v-y)*b,t[10]=(1-(p+m))*b,t[11]=0,t[12]=i[0]+S-(t[0]*S+t[4]*I+t[8]*E),t[13]=i[1]+I-(t[1]*S+t[5]*I+t[9]*E),t[14]=i[2]+E-(t[2]*S+t[6]*I+t[10]*E),t[15]=1,t},r.fromQuat=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i+i,a=n+n,l=r+r,h=i*s,u=n*s,c=n*a,p=r*s,d=r*a,f=r*l,m=o*s,v=o*a,_=o*l;return t[0]=1-c-f,t[1]=u+_,t[2]=p-v,t[3]=0,t[4]=u-_,t[5]=1-h-f,t[6]=d+m,t[7]=0,t[8]=p+v,t[9]=d-m,t[10]=1-h-c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},r.frustum=function(t,e,i,n,r,o,s){var a=1/(i-e),l=1/(r-n),h=1/(o-s);return t[0]=2*o*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*l,t[6]=0,t[7]=0,t[8]=(i+e)*a,t[9]=(r+n)*l,t[10]=(s+o)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*h,t[15]=0,t},r.perspective=function(t,e,i,n,r){var o=1/Math.tan(e/2),s=1/(n-r);return t[0]=o/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(r+n)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*r*n*s,t[15]=0,t},r.perspectiveFromFieldOfView=function(t,e,i,n){var r=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),l=2/(s+a),h=2/(r+o);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(s-a)*l*.5,t[9]=(r-o)*h*.5,t[10]=n/(i-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*i/(i-n),t[15]=0,t},r.ortho=function(t,e,i,n,r,o,s){var a=1/(e-i),l=1/(n-r),h=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*l,t[14]=(s+o)*h,t[15]=1,t},r.lookAt=function(t,e,i,o){var s,a,l,h,u,c,p,d,f,m,v=e[0],_=e[1],y=e[2],g=o[0],x=o[1],w=o[2],M=i[0],b=i[1],S=i[2];return Math.abs(v-M).999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(o.cross(t,r,s),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,a.normalize(n,n))}}(),a.setAxes=function(){var t=r.create();return function(e,i,n,r){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=r[0],t[4]=r[1],t[7]=r[2],t[2]=-i[0],t[5]=-i[1],t[8]=-i[2],a.normalize(e,a.fromMat3(e,t))}}(),a.clone=s.clone,a.fromValues=s.fromValues,a.copy=s.copy,a.set=s.set,a.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},a.setAxisAngle=function(t,e,i){i*=.5;var n=Math.sin(i);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(i),t},a.getAxisAngle=function(t,e){var i=2*Math.acos(e[3]),n=Math.sin(i/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),i},a.add=s.add,a.multiply=function(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=i[0],l=i[1],h=i[2],u=i[3];return t[0]=n*u+s*a+r*h-o*l,t[1]=r*u+s*l+o*a-n*h,t[2]=o*u+s*h+n*l-r*a,t[3]=s*u-n*a-r*l-o*h,t},a.mul=a.multiply,a.scale=s.scale,a.rotateX=function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=n*l+s*a,t[1]=r*l+o*a,t[2]=o*l-r*a,t[3]=s*l-n*a,t},a.rotateY=function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=n*l-o*a,t[1]=r*l+s*a,t[2]=o*l+n*a,t[3]=s*l-r*a,t},a.rotateZ=function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=n*l+r*a,t[1]=r*l-n*a,t[2]=o*l+s*a,t[3]=s*l-o*a,t},a.calculateW=function(t,e){var i=e[0],n=e[1],r=e[2];return t[0]=i,t[1]=n,t[2]=r,t[3]=Math.sqrt(Math.abs(1-i*i-n*n-r*r)),t},a.dot=s.dot,a.lerp=s.lerp,a.slerp=function(t,e,i,n){var r,o,s,a,l,h=e[0],u=e[1],c=e[2],p=e[3],d=i[0],f=i[1],m=i[2],v=i[3];return o=h*d+u*f+c*m+p*v,o<0&&(o=-o,d=-d,f=-f,m=-m,v=-v),1-o>1e-6?(r=Math.acos(o),s=Math.sin(r),a=Math.sin((1-n)*r)/s,l=Math.sin(n*r)/s):(a=1-n,l=n),t[0]=a*h+l*d,t[1]=a*u+l*f,t[2]=a*c+l*m,t[3]=a*p+l*v,t},a.sqlerp=function(){var t=a.create(),e=a.create();return function(i,n,r,o,s,l){return a.slerp(t,n,s,l),a.slerp(e,r,o,l),a.slerp(i,t,e,2*l*(1-l)),i}}(),a.invert=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i*i+n*n+r*r+o*o,a=s?1/s:0;return t[0]=-i*a,t[1]=-n*a,t[2]=-r*a,t[3]=o*a,t},a.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},a.length=s.length,a.len=a.length,a.squaredLength=s.squaredLength,a.sqrLen=a.squaredLength,a.normalize=s.normalize,a.fromMat3=function(t,e){var i,n=e[0]+e[4]+e[8];if(n>0)i=Math.sqrt(n+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var o=(r+1)%3,s=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*o+o]-e[3*s+s]+1),t[r]=.5*i,i=.5/i,t[3]=(e[3*o+s]-e[3*s+o])*i,t[o]=(e[3*o+r]+e[3*r+o])*i,t[s]=(e[3*s+r]+e[3*r+s])*i}return t},a.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},a.exactEquals=s.exactEquals,a.equals=s.equals,e.exports=a},{"./common.js":3,"./mat3.js":6,"./vec3.js":10,"./vec4.js":11}],9:[function(t,e,i){var n=t("./common.js"),r={};r.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},r.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},r.fromValues=function(t,e){var i=new n.ARRAY_TYPE(2);return i[0]=t,i[1]=e,i},r.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},r.set=function(t,e,i){return t[0]=e,t[1]=i,t},r.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t},r.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t},r.sub=r.subtract,r.multiply=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t},r.mul=r.multiply,r.divide=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t},r.div=r.divide,r.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},r.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},r.min=function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t},r.max=function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t},r.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},r.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},r.scaleAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t},r.distance=function(t,e){var i=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(i*i+n*n)},r.dist=r.distance,r.squaredDistance=function(t,e){var i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n},r.sqrDist=r.squaredDistance,r.length=function(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)},r.len=r.length,r.squaredLength=function(t){var e=t[0],i=t[1];return e*e+i*i},r.sqrLen=r.squaredLength,r.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},r.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},r.normalize=function(t,e){var i=e[0],n=e[1],r=i*i+n*n;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},r.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},r.cross=function(t,e,i){var n=e[0]*i[1]-e[1]*i[0];return t[0]=t[1]=0,t[2]=n,t},r.lerp=function(t,e,i,n){var r=e[0],o=e[1];return t[0]=r+n*(i[0]-r),t[1]=o+n*(i[1]-o),t},r.random=function(t,e){e=e||1;var i=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(i)*e,t[1]=Math.sin(i)*e,t},r.transformMat2=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r,t[1]=i[1]*n+i[3]*r,t},r.transformMat2d=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r+i[4],t[1]=i[1]*n+i[3]*r+i[5],t},r.transformMat3=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[3]*r+i[6],t[1]=i[1]*n+i[4]*r+i[7],t},r.transformMat4=function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[4]*r+i[12],t[1]=i[1]*n+i[5]*r+i[13],t},r.forEach=function(){var t=r.create();return function(e,i,n,r,o,s){var a,l;for(i||(i=2),n||(n=0),l=r?Math.min(r*i+n,e.length):e.length,a=n;a0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t},r.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},r.cross=function(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[0],a=i[1],l=i[2];return t[0]=r*l-o*a,t[1]=o*s-n*l,t[2]=n*a-r*s,t},r.lerp=function(t,e,i,n){var r=e[0],o=e[1],s=e[2];return t[0]=r+n*(i[0]-r),t[1]=o+n*(i[1]-o),t[2]=s+n*(i[2]-s),t},r.hermite=function(t,e,i,n,r,o){var s=o*o,a=s*(2*o-3)+1,l=s*(o-2)+o,h=s*(o-1),u=s*(3-2*o);return t[0]=e[0]*a+i[0]*l+n[0]*h+r[0]*u,t[1]=e[1]*a+i[1]*l+n[1]*h+r[1]*u,t[2]=e[2]*a+i[2]*l+n[2]*h+r[2]*u,t},r.bezier=function(t,e,i,n,r,o){var s=1-o,a=s*s,l=o*o,h=a*s,u=3*o*a,c=3*l*s,p=l*o;return t[0]=e[0]*h+i[0]*u+n[0]*c+r[0]*p,t[1]=e[1]*h+i[1]*u+n[1]*c+r[1]*p,t[2]=e[2]*h+i[2]*u+n[2]*c+r[2]*p,t},r.random=function(t,e){e=e||1;var i=2*n.RANDOM()*Math.PI,r=2*n.RANDOM()-1,o=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(i)*o,t[1]=Math.sin(i)*o,t[2]=r*e,t},r.transformMat4=function(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[3]*n+i[7]*r+i[11]*o+i[15];return s=s||1,t[0]=(i[0]*n+i[4]*r+i[8]*o+i[12])/s,t[1]=(i[1]*n+i[5]*r+i[9]*o+i[13])/s,t[2]=(i[2]*n+i[6]*r+i[10]*o+i[14])/s,t},r.transformMat3=function(t,e,i){var n=e[0],r=e[1],o=e[2];return t[0]=n*i[0]+r*i[3]+o*i[6],t[1]=n*i[1]+r*i[4]+o*i[7],t[2]=n*i[2]+r*i[5]+o*i[8],t},r.transformQuat=function(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[0],a=i[1],l=i[2],h=i[3],u=h*n+a*o-l*r,c=h*r+l*n-s*o,p=h*o+s*r-a*n,d=-s*n-a*r-l*o;return t[0]=u*h+d*-s+c*-l-p*-a,t[1]=c*h+d*-a+p*-s-u*-l,t[2]=p*h+d*-l+u*-a-c*-s,t},r.rotateX=function(t,e,i,n){var r=[],o=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[0],o[1]=r[1]*Math.cos(n)-r[2]*Math.sin(n),o[2]=r[1]*Math.sin(n)+r[2]*Math.cos(n),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t},r.rotateY=function(t,e,i,n){var r=[],o=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[2]*Math.sin(n)+r[0]*Math.cos(n),o[1]=r[1],o[2]=r[2]*Math.cos(n)-r[0]*Math.sin(n),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t},r.rotateZ=function(t,e,i,n){var r=[],o=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[0]*Math.cos(n)-r[1]*Math.sin(n),o[1]=r[0]*Math.sin(n)+r[1]*Math.cos(n),o[2]=r[2],t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t},r.forEach=function(){var t=r.create();return function(e,i,n,r,o,s){var a,l;for(i||(i=3),n||(n=0),l=r?Math.min(r*i+n,e.length):e.length,a=n;a1?0:o<-1?Math.PI:Math.acos(o)},r.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},r.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},r.equals=function(t,e){var i=t[0],r=t[1],o=t[2],s=e[0],a=e[1],l=e[2];return Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(o-l)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(l))},e.exports=r},{"./common.js":3}],11:[function(t,e,i){var n=t("./common.js"),r={};r.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},r.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},r.fromValues=function(t,e,i,r){var o=new n.ARRAY_TYPE(4);return o[0]=t,o[1]=e,o[2]=i,o[3]=r,o},r.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},r.set=function(t,e,i,n,r){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t},r.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t},r.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t},r.sub=r.subtract,r.multiply=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t},r.mul=r.multiply,r.divide=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t[3]=e[3]/i[3],t},r.div=r.divide,r.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},r.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},r.min=function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t[3]=Math.min(e[3],i[3]),t},r.max=function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t[3]=Math.max(e[3],i[3]),t},r.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},r.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t},r.scaleAndAdd=function(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t[3]=e[3]+i[3]*n,t},r.distance=function(t,e){var i=e[0]-t[0],n=e[1]-t[1],r=e[2]-t[2],o=e[3]-t[3];return Math.sqrt(i*i+n*n+r*r+o*o)},r.dist=r.distance,r.squaredDistance=function(t,e){var i=e[0]-t[0],n=e[1]-t[1],r=e[2]-t[2],o=e[3]-t[3];return i*i+n*n+r*r+o*o},r.sqrDist=r.squaredDistance,r.length=function(t){var e=t[0],i=t[1],n=t[2],r=t[3];return Math.sqrt(e*e+i*i+n*n+r*r)},r.len=r.length,r.squaredLength=function(t){var e=t[0],i=t[1],n=t[2],r=t[3];return e*e+i*i+n*n+r*r},r.sqrLen=r.squaredLength,r.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},r.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},r.normalize=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i*i+n*n+r*r+o*o;return s>0&&(s=1/Math.sqrt(s),t[0]=i*s,t[1]=n*s,t[2]=r*s,t[3]=o*s),t},r.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},r.lerp=function(t,e,i,n){var r=e[0],o=e[1],s=e[2],a=e[3];return t[0]=r+n*(i[0]-r),t[1]=o+n*(i[1]-o),t[2]=s+n*(i[2]-s),t[3]=a+n*(i[3]-a),t},r.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),r.normalize(t,t),r.scale(t,t,e),t},r.transformMat4=function(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3];return t[0]=i[0]*n+i[4]*r+i[8]*o+i[12]*s,t[1]=i[1]*n+i[5]*r+i[9]*o+i[13]*s,t[2]=i[2]*n+i[6]*r+i[10]*o+i[14]*s,t[3]=i[3]*n+i[7]*r+i[11]*o+i[15]*s,t},r.transformQuat=function(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[0],a=i[1],l=i[2],h=i[3],u=h*n+a*o-l*r,c=h*r+l*n-s*o,p=h*o+s*r-a*n,d=-s*n-a*r-l*o;return t[0]=u*h+d*-s+c*-l-p*-a,t[1]=c*h+d*-a+p*-s-u*-l,t[2]=p*h+d*-l+u*-a-c*-s,t[3]=e[3],t},r.forEach=function(){var t=r.create();return function(e,i,n,r,o,s){var a,l;for(i||(i=4),n||(n=0),l=r?Math.min(r*i+n,e.length):e.length,a=n;a-1}function x(t){return t.trim().split(/\s+/g)}function w(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;ni[e]}):n.sort()),n}function S(t,e){for(var i,n,r=e[0].toUpperCase()+e.slice(1),s=0;s1&&!i.firstMultiple?i.firstMultiple=R(e):1===r&&(i.firstMultiple=!1);var o=i.firstInput,s=i.firstMultiple,a=s?s.center:o.center,l=e.center=A(n);e.timeStamp=vt(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=H(a,l),e.distance=O(a,l),C(i,e),e.offsetDirection=k(e.deltaX,e.deltaY),e.scale=s?Y(s.pointers,n):1,e.rotation=s?N(s.pointers,n):0,z(i,e);var h=t.element;y(e.srcEvent.target,h)&&(h=e.srcEvent.target),e.target=h}function C(t,e){var i=e.center,n=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};e.eventType!==bt&&o.eventType!==It||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=r.x+(i.x-n.x),e.deltaY=r.y+(i.y-n.y)}function z(t,e){var i,n,r,s,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(e.eventType!=Et&&(l>Mt||a.velocity===o)){var h=a.deltaX-e.deltaX,u=a.deltaY-e.deltaY,c=P(l,h,u);n=c.x,r=c.y,i=mt(c.x)>mt(c.y)?c.x:c.y,s=k(h,u),t.lastInterval=e}else i=a.velocity,n=a.velocityX,r=a.velocityY,s=a.direction;e.velocity=i,e.velocityX=n,e.velocityY=r,e.direction=s}function R(t){for(var e=[],i=0;i=mt(e)?t>0?Lt:Tt:e>0?Ft:Ct}function O(t,e,i){i||(i=Pt);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return Math.sqrt(n*n+r*r)}function H(t,e,i){i||(i=Pt);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return 180*Math.atan2(r,n)/Math.PI}function N(t,e){return H(e[1],e[0],kt)-H(t[1],t[0],kt)}function Y(t,e){return O(e[0],e[1],kt)/O(t[0],t[1],kt)}function q(){this.evEl=Ht,Yt?this.evDoc=Nt:this.evWin=Nt,this.allow=!0,this.pressed=!1,D.apply(this,arguments)}function W(){this.evEl=Bt,this.evWin=Xt,D.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function B(){this.evTarget=Vt,this.evWin=Gt,this.started=!1,D.apply(this,arguments)}function X(t,e){var i=M(t.touches),n=M(t.changedTouches);return e&(It|Et)&&(i=b(i.concat(n),"identifier",!0)),[i,n]}function j(){this.evTarget=Zt,this.targetIds={},D.apply(this,arguments)}function V(t,e){var i=M(t.touches),n=this.targetIds;if(e&(bt|St)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,o,s=M(t.changedTouches),a=[],l=this.target;if(o=i.filter(function(t){return y(t.target,l)}),e===bt)for(r=0;r0;p(q,D,{handler:function(t){var e=Ot[t.type],i=0;Yt&&(i=1),e&bt&&t.button===i&&(this.pressed=!0),e&St&&t.button!==i&&(e=It),this.pressed&&this.allow&&(e&It&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var qt={pointerdown:bt,pointermove:St,pointerup:It,pointercancel:Et,pointerout:Et},Wt={2:"touch",3:"pen",4:"mouse",5:"kinect"},Bt="pointerdown",Xt="pointermove pointerup pointercancel";e.MSPointerEvent&&(Bt="MSPointerDown",Xt="MSPointerMove MSPointerUp MSPointerCancel"),p(W,D,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),r=qt[n],o=Wt[t.pointerType]||t.pointerType,s="touch"==o,a=w(e,t.pointerId,"pointerId");r&bt&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):r&(It|Et)&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),i&&e.splice(a,1))}});var jt={touchstart:bt,touchmove:St,touchend:It,touchcancel:Et},Vt="touchstart",Gt="touchstart touchmove touchend touchcancel";p(B,D,{handler:function(t){var e=jt[t.type];if(e===bt&&(this.started=!0),this.started){var i=X.call(this,t,e);e&(It|Et)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:"touch",srcEvent:t})}}});var Ut={touchstart:bt,touchmove:St,touchend:It,touchcancel:Et},Zt="touchstart touchmove touchend touchcancel";p(j,D,{handler:function(t){var e=Ut[t.type],i=V.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:"touch",srcEvent:t})}}),p(G,D,{handler:function(t,e,i){var n="touch"==i.pointerType,r="mouse"==i.pointerType;if(n)this.mouse.allow=!1;else if(r&&!this.mouse.allow)return;e&(It|Et)&&(this.mouse.allow=!0),this.callback(t,e,i)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Kt=S(pt.style,"touchAction"),Qt=Kt!==o,$t="auto",Jt="manipulation",te="none",ee="pan-x",ie="pan-y";U.prototype={set:function(t){"compute"==t&&(t=this.compute()),Qt&&this.manager.element.style&&(this.manager.element.style[Kt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return l(this.manager.recognizers,function(e){f(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),Z(t.join(" "))},preventDefaults:function(t){if(!Qt){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var n=this.actions,r=g(n,te),o=g(n,ie),s=g(n,ee);return r||o&&i&zt||s&&i&Rt?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var ne=1,re=2,oe=4,se=8,ae=se,le=16;K.prototype={defaults:{},set:function(t){return h(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(a(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=J(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return a(t,"dropRecognizeWith",this)?this:(t=J(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(a(t,"requireFailure",this))return this;var e=this.requireFail;return t=J(t,this),-1===w(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(a(t,"dropRequireFailure",this))return this;t=J(t,this);var e=w(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(i.options.event+(e?Q(n):""),t)}var i=this,n=this.state;n=se&&e(!0)},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;te.threshold&&r&e.direction},attrTest:function(t){return tt.prototype.attrTest.call(this,t)&&(this.state&re||!(this.state&re)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=$(t.direction);e&&this.manager.emit(this.options.event+e,t),this._super.emit.call(this,t)}}),p(it,tt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[te]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&re)},emit:function(t){if(this._super.emit.call(this,t),1!==t.scale){var e=t.scale<1?"in":"out";this.manager.emit(this.options.event+e,t)}}}),p(nt,K,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[$t]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distancee.time;if(this._input=t,!n||!i||t.eventType&(It|Et)&&!r)this.reset();else if(t.eventType&bt)this.reset(),this._timer=s(function(){this.state=ae,this.tryEmit()},e.time,this);else if(t.eventType&It)return ae;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===ae&&(t&&t.eventType&It?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=vt(),this.manager.emit(this.options.event,this._input)))}}),p(rt,tt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[te]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&re)}}),p(ot,tt,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:zt|Rt,pointers:1},getTouchAction:function(){return et.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(zt|Rt)?e=t.velocity:i&zt?e=t.velocityX:i&Rt&&(e=t.velocityY),this._super.attrTest.call(this,t)&&i&t.direction&&t.distance>this.options.threshold&&mt(e)>this.options.velocity&&t.eventType&It},emit:function(t){var e=$(t.direction);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),p(st,K,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[Jt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance=0&&n.splice(r,1)}},n.prototype.emit=function(){var t=this.__events=this.__events||{},e=arguments[0],i=t[e];if(i)for(var n=0;n0;){var r=this._queue.shift();if(!e.has(r)&&n(r)){e.add(r);for(var o=i(r),s=0;s=0},n.prototype.listHotspots=function(){return[].concat(this._hotspots)},n.prototype.destroyHotspot=function(t){var e=this._hotspots.indexOf(t);if(e<0)throw new Error("No such hotspot");this._hotspots.splice(e,1),t.destroy(),this.emit("hotspotsChange")},n.prototype.hide=function(){this._visible=!1,this._updateVisibility()},n.prototype.show=function(){this._visible=!0,this._updateVisibility()},n.prototype._updateVisibility=function(){var t=this._visible&&this._supported;t&&!this._isVisible?(this._hotspotContainerWrapper.style.display="block",this._isVisible=!0):!t&&this._isVisible&&(this._hotspotContainerWrapper.style.display="none",this._isVisible=!1)},n.prototype._update=function(){this._updatePositionAndSize();for(var t=0;t0?(console.warn("HotspotContainer: this browser does not support using effects.rect with hotspots. Hotspots will be hidden."),this._supported=!1):(s(this._stage.width(),this._stage.height(),this._rect,this._newPositionAndSize),this._setPositionAndSizeWithRect(this._newPositionAndSize),this._supported=!0):(this._setPositionAndSizeWithoutRect(),this._supported=!0),this._updateVisibility()},n.prototype._setPositionAndSizeWithRect=function(t){var e=this._hotspotContainerWrapper;!0!==this._hasRect&&u(e),!0===this._hasRect&&t.left===this._positionAndSize.left&&t.top===this._positionAndSize.top||a(e,t.left,t.top),!0===this._hasRect&&+t.width===this._positionAndSize.width&&t.height===this._positionAndSize.height||d(e,t.width,t.height),this._positionAndSize.left=t.left,this._positionAndSize.top=t.top,this._positionAndSize.width=t.width,this._positionAndSize.height=t.height,this._hasRect=!0},n.prototype._setPositionAndSizeWithoutRect=function(){!1!==this._hasRect&&(a(this._hotspotContainerWrapper,0,0),p(this._hotspotContainerWrapper),c(this._hotspotContainerWrapper),this._hasRect=!1)},e.exports=n},{"./Hotspot":16,"./calcRect":30,"./positionAbsolutely":59,"./support/cssPointerEvents":84,"./util/dom":98,"minimal-event-emitter":14}],18:[function(t,e,i){"use strict";function n(t,e,i,n,r,o){o=o||{};var s=this;this._stage=t,this._source=e,this._geometry=i,this._view=n,this._textureStore=r,this._effects=o.effects||{},this._fixedLevelIndex=null,this._viewChangeHandler=function(){s.emit("viewChange",s.view())},this._view.addEventListener("change",this._viewChangeHandler),this._textureStoreChangeHandler=function(){s.emit("textureStoreChange",s.textureStore())},this._textureStore.addEventListener("textureLoad",this._textureStoreChangeHandler),this._textureStore.addEventListener("textureError",this._textureStoreChangeHandler),this._textureStore.addEventListener("textureInvalid",this._textureStoreChangeHandler)}var r=t("minimal-event-emitter"),o=t("./util/extend");r(n),n.prototype.destroy=function(){this._view.removeEventListener("change",this._viewChangeHandler),this._textureStore.removeEventListener("textureLoad",this._textureStoreChangeHandler),this._textureStore.removeEventListener("textureError",this._textureStoreChangeHandler),this._textureStore.removeEventListener("textureInvalid",this._textureStoreChangeHandler),this._stage=null,this._source=null,this._geometry=null,this._view=null,this._textureStore=null,this._fixedLevelIndex=null,this._effects=null,this._viewChangeHandler=null,this._textureStoreChangeHandler=null},n.prototype.stage=function(){return this._stage},n.prototype.source=function(){return this._source},n.prototype.geometry=function(){return this._geometry},n.prototype.view=function(){return this._view},n.prototype.textureStore=function(){return this._textureStore},n.prototype.effects=function(){return this._effects},n.prototype.setEffects=function(t){this._effects=t,this.emit("effectsChange",this._effects)},n.prototype.mergeEffects=function(t){o(this._effects,t),this.emit("effectsChange",this._effects)},n.prototype.fixedLevel=function(){return this._fixedLevelIndex},n.prototype.setFixedLevel=function(t){if(t!==this._fixedLevelIndex){if(null!=t&&(t>=this._geometry.levelList.length||t<0))throw new Error("Level index out of range: "+t);this._fixedLevelIndex=t,this.emit("fixedLevelChange",this._fixedLevelIndex)}},n.prototype._selectLevel=function(){return null!=this._fixedLevelIndex?this._geometry.levelList[this._fixedLevelIndex]:this._view.selectLevel(this._geometry.selectableLevelList)},n.prototype.visibleTiles=function(t){var e=this._selectLevel();return this._geometry.visibleTiles(this._view,e,t)},n.prototype.pinLevel=function(t){for(var e=this._geometry.levelList[t],i=this._geometry.levelTiles(e),n=0;n0;)this.destroyLayer(this._layers[0])},n.prototype.switchTo=function(t,e){return this._viewer.switchScene(this,t,e)},n.prototype.lookTo=function(t,e,i){if(e=e||{},i=i||h,"object"!==u(t))throw new Error("Target view parameters must be an object");var n=null!=e.transitionDuration?e.transitionDuration:1e3,r=null==e.shortest||e.shortest,o=this._view,s=o.parameters(),a={};c(a,t),c(a,s),r&&o.normalizeToClosest&&o.normalizeToClosest(a,a);var l=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},p=function(){var t=!1;return function(e,i){if(i>=n&&t)return null;var r=Math.min(i/n,1);for(var o in e){var h=s[o],u=a[o];e[o]=h+l(r)*(u-h)}return t=i>=n,e}},d=this._viewer.controls().enabled();this._viewer.controls().disable(),this.startMovement(p,function(){d&&this._viewer.controls().enable(),i()})},n.prototype.startMovement=function(t,e){var i=this._viewer.renderLoop();this._movement&&this.stopMovement();var n=t();if("function"!=typeof n)throw new Error("Bad movement");this._movement=t,this._movementStep=n,this._movementStartTime=l(),this._movementParams={},this._movementCallback=e,i.addEventListener("beforeRender",this._updateMovementHandler),i.renderOnNextFrame()},n.prototype.stopMovement=function(){var t=this._viewer.renderLoop();this._movementCallback&&this._movementCallback(),t.removeEventListener("beforeRender",this._updateMovementHandler),this._movement=null,this._movementStep=null,this._movementStartTime=null,this._movementParams=null,this._movementCallback=null},n.prototype.movement=function(){return this._movement},n.prototype._updateMovement=function(){ if(!this._movement)throw new Error("Should not call update");var t=this._viewer.renderLoop(),e=this._view,i=l()-this._movementStartTime,n=this._movementStep,r=this._movementParams;r=e.parameters(r),r=n(r,i),null==r?this.stopMovement():(e.setParameters(r),t.renderOnNextFrame())},n.prototype._updateHotspotContainer=function(){this.visible()?this._hotspotContainer.show():this._hotspotContainer.hide()},e.exports=n},{"./HotspotContainer":17,"./Layer":18,"./TextureStore":22,"./util/clock":89,"./util/defaults":94,"./util/noop":104,"./util/type":112,"minimal-event-emitter":14}],22:[function(t,e,i){"use strict";function n(){}function r(t,e){var i=this;i._id=_++,i._store=t,i._tile=e,i._asset=null,i._texture=null,i._changeHandler=function(){t.emit("textureInvalid",e)};var r=t.source(),o=t.stage(),s=r.loadAsset.bind(r),a=o.createTexture.bind(o),l=p(c(s),a);f&&console.log("loading",i._id,i._tile),i._cancel=l(o,e,function(t,e,r,o){if(i._cancel=null,t)return r&&r.destroy(),o&&o.destroy(),void(t instanceof n?(i._store.emit("textureCancel",i._tile),f&&console.log("cancel",i._id,i._tile)):(i._store.emit("textureError",i._tile,t),f&&console.log("error",i._id,i._tile)));i._texture=o,r.dynamic?(i._asset=r,r.addEventListener("change",i._changeHandler)):r.destroy(),i._store.emit("textureLoad",i._tile),f&&console.log("load",i._id,i._tile)})}function o(t,e,i,n){n=u(n||{},v),this._source=e,this._stage=i;var r=t.TileClass;this._clientPhase=m,this._clientCounter=0,this._itemMap=new s(r.equals,r.hash),this._visible=new a(r.equals,r.hash),this._previouslyVisible=new l(r.equals,r.hash,n.previouslyVisibleCacheSize),this._pinMap=new s(r.equals,r.hash),this._newVisible=new a(r.equals,r.hash),this._noLongerVisible=[],this._visibleAgain=[],this._evicted=[]}var s=t("./collections/Map"),a=t("./collections/Set"),l=t("./collections/LruSet"),h=t("minimal-event-emitter"),u=t("./util/defaults"),c=t("./util/retry"),p=t("./util/chain"),d=t("./util/inherits"),f="undefined"!=typeof MARZIPANODEBUG&&MARZIPANODEBUG.textureStore,m="idle",v={previouslyVisibleCacheSize:32},_=0;d(n,Error),r.prototype.asset=function(){return this._asset},r.prototype.texture=function(){return this._texture},r.prototype.destroy=function(){var t=this,e=t._id,i=t._store,r=t._tile,o=t._asset,s=t._texture,a=t._cancel;if(a)return void a(new n("Texture load cancelled"));o&&(o.removeEventListener("change",t._changeHandler),o.destroy()),s&&s.destroy(),i.emit("textureUnload",r),f&&console.log("unload",e,r),t._changeHandler=null,t._asset=null,t._texture=null,t._tile=null,t._store=null,t._id=null},h(r),h(o),o.prototype.destroy=function(){this.clear(),this._source=null,this._stage=null,this._itemMap=null,this._visible=null,this._previouslyVisible=null,this._pinMap=null,this._newVisible=null,this._noLongerVisible=null,this._visibleAgain=null,this._evicted=null},o.prototype.stage=function(){return this._stage},o.prototype.source=function(){return this._source},o.prototype.clear=function(){var t=this;t._evicted.length=0,t._itemMap.each(function(e){t._evicted.push(e)}),t._evicted.forEach(function(e){t._unloadTile(e)}),t._itemMap.clear(),t._visible.clear(),t._previouslyVisible.clear(),t._pinMap.clear(),t._newVisible.clear(),t._noLongerVisible.length=0,t._visibleAgain.length=0,t._evicted.length=0},o.prototype.clearNotPinned=function(){var t=this;t._evicted.length=0,t._itemMap.each(function(e){t._pinMap.has(e)||t._evicted.push(e)}),t._evicted.forEach(function(e){t._unloadTile(e)}),t._visible.clear(),t._previouslyVisible.clear(),t._evicted.length=0},o.prototype.startFrame=function(){if(this._clientPhase!==m&&"start"!==this._clientPhase)throw new Error("TextureStore: startFrame called out of sequence");this._clientPhase="start",this._clientCounter++,this._newVisible.clear()},o.prototype.markTile=function(t){if("start"!==this._clientPhase)throw new Error("TextureStore: markTile called out of sequence");var e=this._itemMap.get(t),i=e&&e.texture(),n=e&&e.asset();i&&n&&i.refresh(t,n),this._newVisible.add(t)},o.prototype.endFrame=function(){if("start"!==this._clientPhase&&"end"!==this._clientPhase)throw new Error("TextureStore: endFrame called out of sequence");this._clientPhase="end",--this._clientCounter||(this._update(),this._clientPhase=m)},o.prototype._update=function(){var t=this;t._noLongerVisible.length=0,t._visible.each(function(e){t._newVisible.has(e)||t._noLongerVisible.push(e)}),t._visibleAgain.length=0,t._newVisible.each(function(e){t._previouslyVisible.has(e)&&t._visibleAgain.push(e)}),t._visibleAgain.forEach(function(e){t._previouslyVisible.remove(e)}),t._evicted.length=0,t._noLongerVisible.forEach(function(e){var i=t._itemMap.get(e);if(i&&i.texture()){var n=t._previouslyVisible.add(e);null!=n&&t._evicted.push(n)}else i&&t._unloadTile(e)}),t._evicted.forEach(function(e){t._pinMap.has(e)||t._unloadTile(e)}),t._newVisible.each(function(e){t._itemMap.get(e)||t._loadTile(e)});var e=t._visible;t._visible=t._newVisible,t._newVisible=e,t._noLongerVisible.length=0,t._visibleAgain.length=0,t._evicted.length=0},o.prototype._loadTile=function(t){if(this._itemMap.has(t))throw new Error("TextureStore: loading texture already in cache");var e=new r(this,t);this._itemMap.set(t,e)},o.prototype._unloadTile=function(t){var e=this._itemMap.del(t);if(!e)throw new Error("TextureStore: unloading texture not in cache");e.destroy()},o.prototype.asset=function(t){var e=this._itemMap.get(t);return e?e.asset():null},o.prototype.texture=function(t){var e=this._itemMap.get(t);return e?e.texture():null},o.prototype.pin=function(t){var e=(this._pinMap.get(t)||0)+1;return this._pinMap.set(t,e),this._itemMap.has(t)||this._loadTile(t),e},o.prototype.unpin=function(t){var e=this._pinMap.get(t);if(!e)throw new Error("TextureStore: unpin when not pinned");return e--,e>0?this._pinMap.set(t,e):(this._pinMap.del(t),this._visible.has(t)||this._previouslyVisible.has(t)||this._unloadTile(t)),e},o.prototype.query=function(t){var e=this._itemMap.get(t),i=this._pinMap.get(t)||0;return{visible:this._visible.has(t),previouslyVisible:this._previouslyVisible.has(t),hasAsset:null!=e&&null!=e.asset(),hasTexture:null!=e&&null!=e.texture(),pinned:0!==i,pinCount:i}},e.exports=o},{"./collections/LruSet":32,"./collections/Map":33,"./collections/Set":34,"./util/chain":87,"./util/defaults":94,"./util/inherits":101,"./util/retry":109,"minimal-event-emitter":14}],23:[function(t,e,i){"use strict";function n(t){t=o(t||{},a),this._duration=t.duration,this._startTime=null,this._handle=null,this._check=this._check.bind(this)}var r=t("minimal-event-emitter"),o=t("./util/defaults"),s=t("./util/clock"),a={duration:Infinity};r(n),n.prototype.start=function(){this._startTime=s(),null==this._handle&&this._durationn.length)for(var o=0;o0;)this.destroyScene(this._scenes[0])},n.prototype.hasScene=function(t){return this._scenes.indexOf(t)>=0},n.prototype.listScenes=function(){return[].concat(this._scenes)},n.prototype.scene=function(){return this._currentScene},n.prototype.view=function(){var t=this._currentScene;return t?t.view():null},n.prototype.lookTo=function(t,e,i){var n=this._currentScene;n&&n.lookTo(t,e,i)},n.prototype.startMovement=function(t,e){var i=this._currentScene;i&&i.startMovement(t,e)},n.prototype.stopMovement=function(){var t=this._currentScene;t&&t.stopMovement()},n.prototype.setIdleMovement=function(t,e){this._idleTimer.setDuration(t),this._idleMovement=e},n.prototype.breakIdleMovement=function(){this._leaveIdle(),this._resetIdleTimer()},n.prototype._resetIdleTimer=function(){this._idleTimer.start()},n.prototype._enterIdle=function(){var t=this._currentScene,e=this._idleMovement;t&&e&&t.startMovement(e)},n.prototype._leaveIdle=function(){var t=this._currentScene;t&&t.movement()===this._idleMovement&&t.stopMovement()};n.prototype.switchScene=function(t,e,i){function n(e){d(e,t,l)}function o(){if(s._replacedScene){s._removeSceneEventListeners(s._replacedScene),h=s._replacedScene.listLayers();for(var t=0;t1&&c[0]!=h[0]))throw new Error("Stage not in sync with viewer");for(var p=null!=e.transitionDuration?e.transitionDuration:1e3,d=null!=e.transitionUpdate?e.transitionUpdate:r,u=t.listLayers(),f=0;fw?Math.min(f+t*a,i):Math.max(f-t*a,0),o=_*t,hg.pitch&&(g.pitch=Math.min(h,g.pitch+o))}if(null!=u&&g.fov!==h){var M=.5*m*m/l;y=Math.abs(u-g.fov)>M?Math.min(m+t*l,n):Math.max(m-t*l,0),c=y*t,ug.fov&&(g.fov=Math.min(u,g.fov+c))}return p=x,d=v,f=_,m=y,g}}}var r=t("./util/defaults"),o={yawSpeed:.1,pitchSpeed:.1,fovSpeed:.1,yawAccel:.01,pitchAccel:.01,fovAccel:.01,targetPitch:0,targetFov:null};e.exports=n},{"./util/defaults":94}],30:[function(t,e,i){"use strict";function n(t,e,i,n){n=n||{};var r;r=null!=i&&null!=i.absoluteWidth?i.absoluteWidth:null!=i&&null!=i.relativeWidth?i.relativeWidth*t:t;var o;o=i&&null!=i.absoluteHeight?i.absoluteHeight:null!=i&&null!=i.relativeHeight?i.relativeHeight*e:e;var s;s=null!=i&&null!=i.absoluteX?i.absoluteX:null!=i&&null!=i.relativeX?i.relativeX*t:0;var a;return a=null!=i&&null!=i.absoluteY?i.absoluteY:null!=i&&null!=i.relativeY?i.relativeY*e:0,n.height=o,n.width=r,n.left=s,n.top=a,n.right=s+r,n.bottom=a+o,n.totalWidth=t,n.totalHeight=e,n}e.exports=n},{}],31:[function(t,e,i){"use strict";function n(t,e,i){if("function"!=typeof t)throw new Error("LruMap: bad equals function");if(this._equals=t,"function"!=typeof e)throw new Error("LruMap: bad hash function");if(this._hash=e,"number"!=typeof i||isNaN(i)||i<0)throw new Error("LruMap: bad maximum size");this._maxsize=i,this._keys=[],this._values=[],this._pivot=0}var r=t("../util/mod");n.prototype._modulus=function(){return this._maxsize>this._keys.length?this._keys.length+1:this._maxsize},n.prototype.get=function(t){for(var e=0;ethis._items.length?this._items.length+1:this._maxsize},n.prototype.add=function(t){var e=null,i=!1;if(0===this._maxsize)return t;for(var n=0;n=0&&(this._queue.splice(i,1),t.cb.apply(null,e))}},r.prototype._next=function(){if(!this._paused&&this._queue.length&&!this._currentTask){if(null!=this._lastFinished){var t=o()-this._lastFinished,e=this._delay-t;if(e>0)return void setTimeout(this._next.bind(this),e)}var i=this._queue.shift();this._start(i)}},e.exports=r},{"../util/clock":89}],37:[function(t,e,i){"use strict";function n(t){var e=t||{};return e.colorOffset=e.colorOffset||a.create(),e.colorMatrix=e.colorMatrix||l.create(),e}function r(t,e,i){o(i,t,e.colorMatrix),a.add(i,i,e.colorOffset)}function o(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3];return t[0]=i[0]*n+i[1]*r+i[2]*o+i[3]*s,t[1]=i[4]*n+i[5]*r+i[6]*o+i[7]*s,t[2]=i[8]*n+i[9]*r+i[10]*o+i[11]*s,t[3]=i[12]*n+i[13]*r+i[14]*o+i[15]*s,t}function s(t,e){for(var i=t.width,n=t.height,o=t.data,s=0;s=0){var i=this._methods.splice(e,1)[0];i.instance.removeEventListener("parameterDynamics",i.parameterDynamicsHandler)}},n.prototype.has=function(t){return this._indexOfInstance(t)>=0},n.prototype._indexOfInstance=function(t){for(var e=0;e0&&this.emit("active"),this.emit("enabled"),this._updateComposer()},n.prototype.disable=function(){this._enabled=!1,this._activeCount>0&&this.emit("inactive"),this.emit("disabled"),this._updateComposer()},n.prototype.attach=function(t){this._attachedRenderLoop&&this.detach(),this._attachedRenderLoop=t,this._beforeRenderHandler=this._updateViewsWithControls.bind(this),this._changeHandler=t.renderOnNextFrame.bind(t),this._attachedRenderLoop.addEventListener("beforeRender",this._beforeRenderHandler),this._composer.addEventListener("change",this._changeHandler)},n.prototype.detach=function(){this._attachedRenderLoop&&(this._attachedRenderLoop.removeEventListener("beforeRender",this._beforeRenderHandler),this._composer.removeEventListener("change",this._changeHandler),this._beforeRenderHandler=null,this._changeHandler=null,this._attachedRenderLoop=null)},n.prototype.attached=function(){return null!=this._attachedRenderLoop},n.prototype._listen=function(t){var e=this._methods[t];if(!e)throw new Error("Bad method id");e.instance.addEventListener("active",e.activeHandler),e.instance.addEventListener("inactive",e.inactiveHandler)},n.prototype._unlisten=function(t){var e=this._methods[t];if(!e)throw new Error("Bad method id");e.instance.removeEventListener("active",e.activeHandler),e.instance.removeEventListener("inactive",e.inactiveHandler)},n.prototype._handleActive=function(t){var e=this._methods[t];if(!e)throw new Error("Bad method id");if(!e.enabled)throw new Error("Should not receive event from disabled control method");e.active||(e.active=!0,this._incrementActiveCount())},n.prototype._handleInactive=function(t){var e=this._methods[t];if(!e)throw new Error("Bad method id");if(!e.enabled)throw new Error("Should not receive event from disabled control method");e.active&&(e.active=!1,this._decrementActiveCount())},n.prototype._incrementActiveCount=function(){this._activeCount++,s&&this._checkActiveCount(),this._enabled&&1===this._activeCount&&this.emit("active")},n.prototype._decrementActiveCount=function(){this._activeCount--,s&&this._checkActiveCount(),this._enabled&&0===this._activeCount&&this.emit("inactive")},n.prototype._checkActiveCount=function(){var t=0;for(var e in this._methods){var i=this._methods[e];i.enabled&&i.active&&t++}if(t!=this._activeCount)throw new Error("Bad control state")},n.prototype._updateComposer=function(){var t=this._composer;for(var e in this._methods){var i=this._methods[e],n=this._enabled&&i.enabled;n&&!t.has(i.instance)&&t.add(i.instance),!n&&t.has(i.instance)&&t.remove(i.instance)}},n.prototype._updateViewsWithControls=function(){var t=this._composer.offsets();t.changing&&this._attachedRenderLoop.renderOnNextFrame(),this.updatedViews_.length=0;for(var e=this._attachedRenderLoop.stage().listLayers(),i=0;i0?Math.max(0,t-e):0}n.equals=function(t,e){return t.velocity===e.velocity&&t.friction===e.friction&&t.offset===e.offset},n.prototype.equals=function(t){return n.equals(this,t)},n.prototype.update=function(t,e){t.offset&&(this.offset=this.offset||0,this.offset+=t.offset);var i=this.offsetFromVelocity(e);i&&(this.offset=this.offset||0,this.offset+=i),this.velocity=t.velocity,this.friction=t.friction},n.prototype.reset=function(){this.velocity=null,this.friction=null,this.offset=null},n.prototype.velocityAfter=function(t){return this.velocity?this.friction?r(this.velocity,this.friction*t):this.velocity:null},n.prototype.offsetFromVelocity=function(t){t=Math.min(t,this.nullVelocityTime());var e=this.velocityAfter(t);return(this.velocity+e)/2*t},n.prototype.nullVelocityTime=function(){return null==this.velocity?0:this.velocity&&!this.friction?Infinity:Math.abs(this.velocity/this.friction)},e.exports=n},{}],43:[function(t,e,i){"use strict";function n(t,e,i,n){if(!t)throw new Error("ElementPressControlMethod: element must be defined");if(!e)throw new Error("ElementPressControlMethod: parameter must be defined");if(!i)throw new Error("ElementPressControlMethod: velocity must be defined");if(!n)throw new Error("ElementPressControlMethod: friction must be defined");this._element=t,this._pressHandler=this._handlePress.bind(this),this._releaseHandler=this._handleRelease.bind(this),t.addEventListener("mousedown",this._pressHandler),t.addEventListener("mouseup",this._releaseHandler),t.addEventListener("mouseleave",this._releaseHandler),t.addEventListener("touchstart",this._pressHandler),t.addEventListener("touchmove",this._releaseHandler),t.addEventListener("touchend",this._releaseHandler),this._parameter=e,this._velocity=i,this._friction=n,this._dynamics=new r,this._pressing=!1}var r=t("./Dynamics");t("minimal-event-emitter")(n),n.prototype.destroy=function(){this._element.removeEventListener("mousedown",this._pressHandler),this._element.removeEventListener("mouseup",this._releaseHandler),this._element.removeEventListener("mouseleave",this._releaseHandler),this._element.removeEventListener("touchstart",this._pressHandler),this._element.removeEventListener("touchmove",this._releaseHandler),this._element.removeEventListener("touchend",this._releaseHandler)},n.prototype._handlePress=function(){this._pressing=!0,this._dynamics.velocity=this._velocity,this._dynamics.friction=0,this.emit("parameterDynamics",this._parameter,this._dynamics),this.emit("active")},n.prototype._handleRelease=function(){this._pressing&&(this._dynamics.friction=this._friction,this.emit("parameterDynamics",this._parameter,this._dynamics),this.emit("inactive")),this._pressing=!1},e.exports=n},{"./Dynamics":42,"minimal-event-emitter":14}],44:[function(t,e,i){"use strict";function n(){this._managers=new l(r,o)}function r(t,e){return t===e}function o(t){for(var e=t.id||t.toString();e.length<5;)e+="0";return h(e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3),e.charCodeAt(4))}function s(t,e,i,n){this._manager=e,this._element=i,this._type=n,this._hammerGestures=t,this._eventHandlers=[]}var a=t("hammerjs"),l=t("../collections/Map"),h=t("../util/hash"),u=t("bowser");n.prototype.get=function(t,e){this._managers.has(t)||this._managers.set(t,{});var i=this._managers.get(t);i[e]||(i[e]=this._createManager(t,e));var n=i[e];return n.refs+=1,new s(this,n.manager,t,e)},n.prototype._createManager=function(t,e){var i=new a.Manager(t);return"mouse"===e?i.add(new a.Pan({direction:a.DIRECTION_ALL,threshold:0})):"touch"!==e&&"pen"!==e&&"kinect"!==e||(i.add(new a.Pan({direction:a.DIRECTION_ALL,threshold:20,pointers:1})),u.msie&&parseFloat(u.version)<10||i.add(new a.Pinch)),{manager:i,refs:0}},n.prototype._releaseHandle=function(t,e){var i=this._managers.get(t)[e];i.refs-=1,i.refs<=0&&(i.manager.destroy(),this._managers.get(t)[e]=null)},s.prototype.on=function(t,e){var i=this._type,n=function(t){i===t.pointerType&&e(t)};this._eventHandlers.push({events:t,handler:n}),this._manager.on(t,n)},s.prototype.release=function(){for(var t=0;t=0&&t.enableMethod(d)}for(var m in c){var v=c[m];t.addMethodGroup(m,v)}return n}var r=t("../util/defaults"),o=t("./Drag"),s=t("./Qtvr"),a=t("./ScrollZoom"),l=t("./PinchZoom"),h=t("./Key"),u={mouseViewMode:"drag"};e.exports=n},{"../util/defaults":94,"./Drag":40,"./Key":45,"./PinchZoom":46,"./Qtvr":47,"./ScrollZoom":48}],52:[function(t,e,i){"use strict";function n(t,e,i,n,o){var s=Math.sqrt(Math.pow(e,2)+Math.pow(i,2));t=Math.max(t,s/n),r(e,i,t,o),o[0]=Math.abs(o[0]),o[1]=Math.abs(o[1])}function r(t,e,i,n){var r=Math.atan(e/t);n[0]=i*Math.cos(r),n[1]=i*Math.sin(r)}e.exports={maxFriction:n,changeVectorNorm:r}},{}],53:[function(t,e,i){"use strict";function n(t,e,i,n,r){this.face=t,this.x=e,this.y=i,this.z=n,this._geometry=r,this._level=r.levelList[n]}function r(t){if(this.constructor.super_.call(this,t),this._size=t.size,this._tileSize=t.tileSize,this._size%this._tileSize!=0)throw new Error("Level size is not multiple of tile size: "+this._size+" "+this._tileSize)}function o(t){if("array"!==v(t))throw new Error("Level list must be an array");this.levelList=c(t,r),this.selectableLevelList=p(this.levelList);for(var e=1;e=u||w<0||w>=c){var S=this.centerX(),D=this.centerY();x<0?(_.set(r,-.5,D,-.5),b=I[o][0]):x>=u?(_.set(r,.5,D,-.5),b=I[o][1]):w<0?(_.set(r,S,.5,-.5),b=I[o][2]):w>=c&&(_.set(r,S,-.5,-.5),b=I[o][3]);var L;L=g[o],d(r,r,L.y,L.x,0),L=g[b],d(r,r,-L.y,-L.x,0),x=f(Math.floor((.5+r[0])*u),0,u-1),w=f(Math.floor((.5-r[1])*c),0,c-1)}p.push(new n(b,x,w,M,t))}return e.set(this,p),p},n.prototype.hash=function(){return n.hash(this)},n.prototype.equals=function(t){return n.equals(this,t)},n.prototype.cmp=function(t){return n.cmp(this,t)},n.prototype.str=function(){return n.str(this)},n.hash=function(t){return null!=t?a(t.face.charCodeAt(0),t.z,t.x,t.y):0},n.equals=function(t,e){return null!=t&&null!=e&&t.face===e.face&&t.z===e.z&&t.x===e.x&&t.y===e.y},n.cmp=function(t,e){var i=y.indexOf(t.face),n=y.indexOf(e.face);return m(t.z,e.z)||m(i,n)||m(t.y,e.y)||m(t.x,e.x)},n.str=function(t){return"CubeTile("+t.face+", "+t.x+", "+t.y+", "+t.z+")"},s(r,u),r.prototype.width=function(){return this._size},r.prototype.height=function(){return this._size},r.prototype.tileWidth=function(){return this._tileSize},r.prototype.tileHeight=function(){return this._tileSize},r.prototype._validateWithParentLevel=function(t){var e=this.width(),i=this.height(),n=this.tileWidth(),r=this.tileHeight(),o=this.numHorizontalTiles(),s=this.numVerticalTiles(),a=t.width(),l=t.height(),h=t.tileWidth(),u=t.tileHeight(),c=t.numHorizontalTiles(),p=t.numVerticalTiles();if(e%a!=0)throw new Error("Level width must be multiple of parent level: "+e+" vs. "+a);if(i%l!=0)throw new Error("Level height must be multiple of parent level: "+i+" vs. "+l);if(o%c!=0)throw new Error("Number of horizontal tiles must be multiple of parent level: "+o+" ("+e+"/"+n+") vs. "+c+" ("+a+"/"+h+")");if(s%p!=0)throw new Error("Number of vertical tiles must be multiple of parent level: "+s+" ("+i+"/"+r+") vs. "+p+" ("+l+"/"+u+")")},o.prototype.maxTileSize=function(){for(var t=0,e=0;e=0);)c=l.nextSibling,p.removeChild(l),l=c,r=d[++e];if(s=m.get(o),!(a=s?s._canvas:null))throw new Error("Rendering tile with missing texture");if(r&&0===r.cmp(o)){if(a!=l)throw new Error("DOM not in sync with tile list");l=l.nextSibling,r=d[++e]}else p.insertBefore(a,l);h(a,this.calculateTransform(o,s,v)),u&&a.setAttribute("data-tile",o.str())}for(;l;)c=l.nextSibling,p.removeChild(l),l=c;if(p.children.length!==f.length)throw new Error("DOM not in sync with tile list");var _=this._oldTileList;this._oldTileList=this._newTileList,this._newTileList=_},e.exports=r},{"../collections/Map":33,"../util/dom":98}],61:[function(t,e,i){"use strict";function n(t,e){this.constructor.super_.call(this,t,e,r)}var r=t("../geometries/Cube").TileClass,o=t("./CssBase"),s=t("../util/decimal");t("../util/inherits")(n,o),n.prototype.calculateTransform=function(t,e,i){var n=this._browserQuirks.padSize,r=this._browserQuirks.reverseLevelDepth,o=this._browserQuirks.perspectiveNudge,a="",l=r?256-t.z:t.levelWidth(),h=i.size(),u=h.width,c=h.height;a+="translate3d("+s(u/2)+"px, "+s(c/2)+"px, 0px) ";var p=.5*c/Math.tan(i.fov()/2),d=p+o;a+="perspective("+s(p)+"px) translateZ("+s(d)+"px) ";var f=-i.roll(),m=-i.pitch(),v=i.yaw();a+="rotateZ("+s(f)+"rad) rotateX("+s(m)+"rad) rotateY("+s(v)+"rad) ";var _=-t.rotX(),y=t.rotY();a+="rotateX("+s(_)+"rad) rotateY("+s(y)+"rad) ";var g=t.centerX()-t.scaleX()/2,x=-(t.centerY()+t.scaleY()/2),w=g*l,M=x*l,b=-l/2;if(a+="translate3d("+s(w)+"px, "+s(M)+"px, "+s(b)+"px) ",r){var S=l*t.scaleX()/t.width(),I=l*t.scaleY()/t.height();a+="scale("+s(S)+", "+s(I)+") "}var E=t.padLeft()?n:0,D=t.padTop()?n:0;return 0===E&&0===D||(a+="translate3d("+s(-E)+"px, "+s(-D)+"px, 0) "),a},e.exports=n},{"../geometries/Cube":53,"../util/decimal":93,"../util/inherits":101,"./CssBase":60}],62:[function(t,e,i){"use strict";function n(t,e){this.constructor.super_.call(this,t,e,r)}var r=t("../geometries/Flat").TileClass,o=t("./CssBase"),s=t("../util/decimal");t("../util/inherits")(n,o),n.prototype.calculateTransform=function(t,e,i){var n=this._browserQuirks.padSize,r="",o=i.width(),a=i.height();r+="translateX("+s(o/2)+"px) translateY("+s(a/2)+"px) ";var l=o/i._zoomX(),h=a/i._zoomY(),u=t.centerX()-t.scaleX()/2+.5,c=.5-t.centerY()-t.scaleY()/2,p=u*l,d=c*h;r+="translateX("+s(p)+"px) translateY("+s(d)+"px) ";var f=-i.x()*l,m=-i.y()*h;r+="translateX("+s(f)+"px) translateY("+s(m)+"px) ";var v=t.padLeft()?n:0,_=t.padTop()?n:0;0===v&&0===_||(r+="translateX("+s(-v)+"px) translateY("+s(-_)+"px) ");var y=l/t.levelWidth(),g=h/t.levelHeight();return r+="scale("+s(y)+", "+s(g)+") "},e.exports=n},{"../geometries/Flat":55,"../util/decimal":93,"../util/inherits":101,"./CssBase":60}],63:[function(t,e,i){"use strict";function n(t,e){return t.cmp(e)}function r(t,e,i,n){this._flashElement=t,this._layerId=e,this._quirks=i,this._tileList=[],this._textureMap=new o(n.equals,n.hash),this._layerCreated=!1}var o=t("../collections/Map");r.prototype.destroy=function(){this._flashElement.destroyLayer(this._layerId),this._flashElement=null,this._layerId=null,this._layerCreated=null,this._tileList=null,this._padSize=null},r.prototype.startLayer=function(t,e){this._flashElement.isReady&&this._flashElement.isReady()&&(this._layerCreated||(this._flashElement.createLayer(this._layerId),this._layerCreated=!0),this._tileList.length=0,this._textureMap.clear())},r.prototype.renderTile=function(t,e){this._tileList.push(t),this._textureMap.set(t,e)},r.prototype.endLayer=function(t,e){if(this._flashElement.isReady&&this._flashElement.isReady()){this._tileList.sort(n),this._renderOnFlash(t,e)}},e.exports=r},{"../collections/Map":33}],64:[function(t,e,i){"use strict";function n(t,e,i){this.constructor.super_.call(this,t,e,i,o),this._flashTileList=[]}var r=t("./FlashBase"),o=t("../geometries/Cube").TileClass,s=t("../util/inherits"),a=t("../util/radToDeg");s(n,r),n.prototype._renderOnFlash=function(t,e){var i=this._flashElement,n=this._layerId,r=this._quirks.padSize,o=this._tileList,s=this._textureMap,l=this._flashTileList;l.length=0;for(var h=0;h',s="";s+='',s+='',s+='',s+='',o+=s,o+="";var a=document.createElement("div");a.innerHTML=o;var l=a.firstChild;p(l),d(l),n.appendChild(l);var h=document.createElement("div");return p(h),d(h),f(h),n.appendChild(h),{root:n,flash:l,blocking:h}}function s(t,e,i){var n=i.element(),r=e.width(),o=e.height(),s=x.padSize,a=e.padTop()?s:0,l=e.padBottom()?s:0,h=e.padLeft()?s:0,u=e.padRight()?s:0,c=t._flashElement.createTexture(n,r,o,a,l,h,u);this._stage=t,this._textureId=c}var a=t("./Stage"),l=t("../support/Flash"),h=t("../collections/WorkQueue"),u=t("../util/inherits"),c=t("../util/defer"),p=t("../util/dom").setAbsolute,d=t("../util/dom").setFullSize,f=t("../util/dom").setBlocking,m=t("./loadImageFlash"),v="transparent",_=function(){var t=document.currentScript;if(!t){var e=document.getElementsByTagName("script");t=e.length?e[e.length-1]:null}if(!t)return null;var i=t.src,n=i.lastIndexOf("/");return(i=n>=0?i.slice(0,n+1):"")+"marzipano.swf"}(),y="MarzipanoFlashCallbackMap";y in window||(window[y]={__next:0});var g=["imageLoaded"],x={padSize:3};u(r,a),r.prototype.destroy=function(){this.constructor.super_.prototype.destroy.call(this),this._domElement=null,this._blockingElement=null,this._flashElement=null,window[y][this._flashStageId]=null,this._callbacksObj=null,this._loadImageQueue=null,clearInterval(this._checkReadyTimer)},r.supported=function(){return l()},r.prototype._setSize=function(){},r.prototype.loadImage=function(t,e,i){var n=m.bind(null,this,t,e);return this._loadImageQueue.push(n,i)},r.prototype._validateLayer=function(t){},r.prototype._onCallback=function(t,e){this._callbackListeners[t]=this._callbackListeners[t]||[],this._callbackListeners[t].push(e)},r.prototype._offCallback=function(t,e){var i=this._callbackListeners[t]||[],n=i.indexOf(e);n>=0&&i.splice(n,1)},r.prototype._callListeners=function(t){var e=this;return function(){for(var i=e._callbackListeners[t]||[],n=0;n100)throw new Error("FlashStage: Snapshot quality needs to be a number between 0 and 100");return this._flashElement.takeSnapshot(e)},r.type=r.prototype.type="flash",s.prototype.refresh=function(t,e){},s.prototype.destroy=function(){var t=this._textureId;this._stage._flashElement.destroyTexture(t),this._stage=null,this._textureId=null},r.TextureClass=r.prototype.TextureClass=s,e.exports=r},{"../collections/WorkQueue":36,"../support/Flash":82,"../util/defer":95,"../util/dom":98,"../util/inherits":101,"./Stage":77,"./loadImageFlash":79}],76:[function(t,e,i){"use strict";function n(){this._renderers={}}n.prototype.set=function(t,e,i){this._renderers[t]||(this._renderers[t]={}),this._renderers[t][e]=i},n.prototype.get=function(t,e){return this._renderers[t]&&this._renderers[t][e]||null},e.exports=n},{}],77:[function(t,e,i){"use strict";function n(t,e){return-t.cmp(e)}function r(t){this._domElement=null,this._layers=[],this._renderers=[],this._visibleTiles=[],this._fallbackTiles={children:[],parents:[]},this._tmpTiles=[],this._width=null,this._height=null,this._rect={},this._createTextureWorkQueue=new s({delay:c}),this.emitRenderInvalid=this.emitRenderInvalid.bind(this),this._rendererRegistry=new u}var o=t("minimal-event-emitter"),s=t("../collections/WorkQueue"),a=t("../calcRect"),l=t("../util/async"),h=t("../util/cancelize"),u=t("./RendererRegistry"),c=20;o(r),r.prototype.destroy=function(){this.removeAllLayers(),this._layers=null,this._renderers=null,this._visibleTiles=null,this._fallbackTiles=null,this._tmpTiles=null,this._width=null,this._height=null,this._createTextureWorkQueue=null,this.emitRenderInvalid=null,this._rendererRegistry=null},r.prototype.registerRenderer=function(t,e,i){return this._rendererRegistry.set(t,e,i)},r.prototype.domElement=function(){return this._domElement},r.prototype.width=function(){return this._width},r.prototype.height=function(){return this._height},r.prototype.size=function(t){return t=t||{},t.width=this._width,t.height=this._height,t},r.prototype.setSize=function(t){this._width=t.width,this._height=t.height,this._setSize(),this.emit("resize"),this.emitRenderInvalid()},r.prototype.emitRenderInvalid=function(){this.emit("renderInvalid")},r.prototype.listLayers=function(){return[].concat(this._layers)},r.prototype.hasLayer=function(t){return this._layers.indexOf(t)>=0},r.prototype.addLayer=function(t,e){if(this._layers.indexOf(t)>=0)throw new Error("Layer already in stage");if(null==e&&(e=this._layers.length),e<0||e>this._layers.length)throw new Error("Invalid layer position");this._validateLayer(t),this._layers.splice(e,0,t),this._renderers.splice(e,0,null),t.addEventListener("viewChange",this.emitRenderInvalid),t.addEventListener("effectsChange",this.emitRenderInvalid),t.addEventListener("fixedLevelChange",this.emitRenderInvalid),t.addEventListener("textureStoreChange",this.emitRenderInvalid),this.emitRenderInvalid()},r.prototype.moveLayer=function(t,e){var i=this._layers.indexOf(t);if(i<0)throw new Error("No such layer in stage");if(e<0||e>=this._layers.length)throw new Error("Invalid layer position");t=this._layers.splice(i,1)[0];var n=this._renderers.splice(i,1)[0];this._layers.splice(e,0,t),this._renderers.splice(e,0,n),this.emitRenderInvalid()},r.prototype.removeLayer=function(t){var e=this._layers.indexOf(t);if(e<0)throw new Error("No such layer in stage");var i=this._layers.splice(e,1)[0],n=this._renderers.splice(e,1)[0];n&&this.destroyRenderer(n),i.removeEventListener("viewChange",this.emitRenderInvalid),i.removeEventListener("effectsChange",this.emitRenderInvalid),i.removeEventListener("fixedLevelChange",this.emitRenderInvalid),i.removeEventListener("textureStoreChange",this.emitRenderInvalid),this.emitRenderInvalid()},r.prototype.removeAllLayers=function(){for(;this._layers.length>0;)this.removeLayer(this._layers[0])},r.prototype.render=function(){var t,e=this._visibleTiles,i=this._fallbackTiles,r=this._width,o=this._height,s=this._rect;if(!(r<=0||o<=0)){for(this.startFrame(),t=0;ti)throw new Error("Layer has level with tile size larger than maximum texture size ("+e+" vs. "+i+")")},r.prototype.createRenderer=function(t){if(this._rendererInstances.has(t))return this._rendererInstances.get(t);var e=new t(this._gl);return this._rendererInstances.set(t,e),e},r.prototype.destroyRenderer=function(t){this._renderers.indexOf(t)<0&&(t.destroy(),this._rendererInstances.del(t.constructor))},r.prototype.startFrame=function(){var t=this._gl;if(!t)throw new Error("Bad WebGL context - maybe context was lost?");var e=this._width,i=this._height,n=p();t.viewport(0,0,n*e,n*i),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.enable(t.DEPTH_TEST),t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA)},r.prototype.endFrame=function(){},r.prototype.takeSnapshot=function(t){"object"==typeof t&&null!=t||(t={});var e=t.quality;if(void 0===e&&(e=75),"number"!=typeof e||e<0||e>100)throw new Error("WebGLStage: Snapshot quality needs to be a number between 0 and 100");return this.render(),this._domElement.toDataURL("image/jpeg",e/100)},r.type=r.prototype.type="webgl",o.prototype.refresh=function(t,e){var i,n=this._gl,r=this._stage,o=e.timestamp();if(o!==this._timestamp){var s=e.element(),a=e.width(),l=e.height();if(a!==this._width||l!==this._height){var h=r.maxTextureSize();if(a>h)throw new Error("Texture width larger than max size ("+a+" vs. "+h+")");if(l>h)throw new Error("Texture height larger than max size ("+l+" vs. "+h+")");this._texture&&n.deleteTexture(i),i=this._texture=n.createTexture(),n.bindTexture(n.TEXTURE_2D,i),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,s)}else i=this._texture,n.bindTexture(n.TEXTURE_2D,i),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),s instanceof HTMLVideoElement&&y.videoUseTexImage2D?n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,s):n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,s);r._generateMipmaps&&f(a)&&f(l)?(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.generateMipmap(n.TEXTURE_2D)):(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR)),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.bindTexture(n.TEXTURE_2D,null),this._timestamp=o,this._width=a,this._height=l}},o.prototype.destroy=function(){var t=this._texture,e=this._gl;t&&e.deleteTexture(t),this._stage=null,this._gl=null,this._texture=null,this._timestamp=null,this._width=this._height=null},r.TextureClass=r.prototype.TextureClass=o,e.exports=r},{"../collections/Map":33,"../support/WebGl":83,"../util/defer":95,"../util/dom":98,"../util/hash":100,"../util/inherits":101,"../util/ispot":102,"../util/pixelRatio":106,"./Stage":77,"./loadImageHtml":80,bowser:1}],79:[function(t,e,i){"use strict";function n(t,e,i,n){function a(i,o){o===f&&(t._offCallback("imageLoaded",a),i?n(new r("Network error: "+e)):n(null,new s(h,f)))}function l(){h.cancelImage(f),t._offCallback("imageLoaded",a),n.apply(null,arguments)}var h=t._flashElement,u=i&&i.x||0,c=i&&i.y||0,p=i&&i.width||1,d=i&&i.height||1,f=h.loadImage(e,p,d,u,c);return n=o(n),t._onCallback("imageLoaded",a),l}var r=t("../NetworkError"),o=t("../util/once"),s=t("../assets/FlashImage");e.exports=n},{"../NetworkError":19,"../assets/FlashImage":26,"../util/once":105}],80:[function(t,e,i){"use strict";function n(t,e,i){function n(){l.onload=l.onerror=null,l.src="",i.apply(null,arguments)}var l=new Image;l.crossOrigin="anonymous";var h=e&&e.x||0,u=e&&e.y||0,c=e&&e.width||1,p=e&&e.height||1;return i=o(i),l.onload=function(){if(0===h&&0===u&&1===c&&1===p)i(null,new s(l));else{h*=l.naturalWidth,u*=l.naturalHeight,c*=l.naturalWidth,p*=l.naturalHeight;var t=document.createElement("canvas");t.width=c,t.height=p;t.getContext("2d").drawImage(l,h,u,c,p,0,0,c,p),i(null,new a(t))}},l.onerror=function(){i(new r("Network error: "+t))},l.src=t,n}var r=t("../NetworkError"),o=t("../util/once"),s=t("../assets/StaticImage"),a=t("../assets/StaticCanvas");e.exports=n},{"../NetworkError":19,"../assets/StaticCanvas":27,"../assets/StaticImage":28,"../util/once":105}],81:[function(t,e,i){"use strict";function n(){var t=s("perspective"),e=document.createElement("div"),i="undefined"!=typeof e.style[t];if(i&&"WebkitPerspective"===t){var n="__marzipano_test_css3d_support__",r=document.createElement("style");r.textContent="@media(-webkit-transform-3d){#"+n+"{height: 3px;})",document.getElementsByTagName("head")[0].appendChild(r),e.id=n,document.body.appendChild(e),i=e.offsetHeight>0,r.parentNode.removeChild(r),e.parentNode.removeChild(e)}return i}function r(){return o!==undefined?o:o=n()}var o,s=t("../util/dom").prefixProperty;e.exports=r},{"../util/dom":98}],82:[function(t,e,i){"use strict";function n(){var t=null,e=navigator.plugins,i=navigator.mimeTypes,n=null;if(e&&e["Shockwave Flash"]&&i&&i["application/x-shockwave-flash"]&&i["application/x-shockwave-flash"].enabledPlugin)n=e["Shockwave Flash"].description,n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),t=[0,0,0],t[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10),t[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10),t[2]=/[a-zA-Z]/.test(n)?parseInt(n.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0;else if(window.ActiveXObject)try{var r=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");r&&(n=r.GetVariable("$version"))&&(n=n.split(" ")[1].split(","),t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)])}catch(o){}return t}function r(){var t=n();return t&&(t[0]>=11||10===t[0]&&t[1]>=1)}function o(){return s!==undefined?s:s=r()}var s;e.exports=o},{}],83:[function(t,e,i){"use strict";function n(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}function r(){return o!==undefined?o:o=n()}var o;e.exports=r},{}],84:[function(t,e,i){"use strict";function n(){var t=document.createElement("a").style;t.cssText="pointer-events:auto";var e="auto"===t.pointerEvents,i=s.msie&&parseFloat(s.version)<11;return e&&!i}function r(){return o!==undefined?o:o=n()}var o,s=t("bowser");e.exports=r},{bowser:1}],85:[function(t,e,i){"use strict";function n(t){return function(e){var i,n;try{n=t()}catch(r){i=r}finally{e(i||null,i?null:n)}}}e.exports=n},{}],86:[function(t,e,i){"use strict";function n(t){return function(){function e(){n.apply(null,arguments)}if(!arguments.length)throw new Error("cancelized: expected at least one argument");var i=Array.prototype.slice.call(arguments,0),n=i[i.length-1]=r(i[i.length-1]);return t.apply(null,i),e}}var r=t("./once");e.exports=n},{"./once":105}],87:[function(t,e,i){"use strict";function n(){var t=Array.prototype.slice.call(arguments,0);return function(){function e(){if(arguments[0])return o=s=null,void l.apply(null,arguments);if(!n.length)return o=s=null,void l.apply(null,arguments);o=n.shift();var t=o,i=Array.prototype.slice.call(arguments,1);i.push(e);var r=o.apply(null,i);if(t===o){if("function"!=typeof r)throw new Error("chain: chaining on non-cancellable function");s=r}}function i(){s&&s.apply(null,arguments)}var n=t.slice(0),o=null,s=null,a=arguments.length?Array.prototype.slice.call(arguments,0,arguments.length-1):[],l=arguments.length?arguments[arguments.length-1]:r;return a.unshift(null),e.apply(null,a),i}}var r=t("./noop");e.exports=n},{"./noop":104}],88:[function(t,e,i){"use strict";function n(t,e,i){return Math.min(Math.max(t,e),i)}e.exports=n},{}],89:[function(t,e,i){"use strict";var n=function(){return window.performance&&window.performance.now?function(){return window.performance.now()}:null}()||function(){return function(){return Date.now()}}();e.exports=n},{}],90:[function(t,e,i){"use strict";function n(t,e){return te?1:0}e.exports=n},{}],91:[function(t,e,i){"use strict";function n(){var t=arguments;return function(e){for(var i=e,n=0;n0?t.apply(null,e):t()}setTimeout(i,0)}e.exports=n},{}],96:[function(t,e,i){"use strict";function n(t){return t*Math.PI/180}e.exports=n},{}],97:[function(t,e,i){"use strict";function n(t,e){function i(){null!=r&&(r=null,e(null))}function n(){null!=r&&(clearTimeout(r),r=null,e.apply(null,arguments))}var r=null;return r=setTimeout(i,t),n}e.exports=n},{}],98:[function(t,e,i){"use strict";function n(t){for(var e=document.documentElement.style,i=["Moz","Webkit","Khtml","O","ms"],n=0;n>6}return t+=t<<3,t^=t>>11,t+=t<<15,t>=0?t:-t}e.exports=n},{}],101:[function(t,e,i){"use strict";function n(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}e.exports=n},{}],102:[function(t,e,i){"use strict";function n(t){return 0==(t&t-1)}e.exports=n},{}],103:[function(t,e,i){"use strict";function n(t,e){return(+t%(e=+e)+e)%e}e.exports=n},{}],104:[function(t,e,i){"use strict";function n(){}e.exports=n},{}],105:[function(t,e,i){"use strict";function n(t){var e,i=!1;return function(){return i||(i=!0,e=t.apply(null,arguments)),e}}e.exports=n},{}],106:[function(t,e,i){"use strict";function n(){if("undefined"!=typeof window){if(window.devicePixelRatio)return window.devicePixelRatio;var t=window.screen;if(t&&t.deviceXDPI&&t.logicalXDPI)return t.deviceXDPI/t.logicalXDPI;if(t&&t.systemXDPI&&t.logicalXDPI)return t.systemXDPI/t.logicalXDPI}return r}var r=1;e.exports=n},{}],107:[function(t,e,i){"use strict";function n(t){return 180*t/Math.PI}e.exports=n},{}],108:[function(t,e,i){"use strict";function n(t){return"number"==typeof t&&isFinite(t)}e.exports=n},{}],109:[function(t,e,i){"use strict";function n(t){return function(){function e(){!arguments[0]||s?n.apply(null,arguments):o=t.apply(null,i)}var i=arguments.length?Array.prototype.slice.call(arguments,0,arguments.length-1):[],n=arguments.length?arguments[arguments.length-1]:r,o=null,s=!1;return i.push(e),e(!0),function(){s=!0,o.apply(null,arguments)}}}var r=t("./noop");e.exports=n},{"./noop":104}],110:[function(t,e,i){"use strict";function n(t,e,i,n,l){return o.copy(a,s),i&&o.rotateY(a,a,i),n&&o.rotateX(a,a,n),l&&o.rotateZ(a,a,l),r.transformMat4(t,e,a),t}var r=t("gl-matrix/src/gl-matrix/vec3"),o=t("gl-matrix/src/gl-matrix/mat4"),s=o.identity(o.create()),a=o.create();e.exports=n},{"gl-matrix/src/gl-matrix/mat4":7,"gl-matrix/src/gl-matrix/vec3":10}],111:[function(t,e,i){"use strict";function n(t,e,i){function n(){if(!o){var a=(r()-s)/t;a<1?(e(a),requestAnimationFrame(n)):(e(1),i())}}var o=!1,s=r();return e(0),requestAnimationFrame(n),function(){o=!0,i.apply(null,arguments)}}var r=t("./clock");e.exports=n},{"./clock":89}],112:[function(t,e,i){"use strict";function n(t){var e=typeof t;if("object"===e){if(null===t)return"null";if("[object Array]"===Object.prototype.toString.call(t))return"array";if("[object RegExp]"===Object.prototype.toString.call(t))return"regexp"}return e}e.exports=n},{}],113:[function(t,e,i){"use strict";function n(t,e){if(!t||null==t.mediaAspectRatio)throw new Error("mediaAspectRatio must be defined");this._x=t&&null!=t.x?t.x:p,this._y=t&&null!=t.y?t.y:d,this._zoom=t&&null!=t.zoom?t.zoom:f,this._mediaAspectRatio=t.mediaAspectRatio,this._width=t&&null!=t.width?t.width:u,this._height=t&&null!=t.height?t.height:c,this._limiter=e||null,this._viewFrustum=[0,0,0,0],this._projectionMatrix=l.create(),this._projectionChanged=!0,this._params={},this._vertex=h.create(),this._invProj=l.create(),this._update()}var r=t("minimal-event-emitter"),o=t("../util/pixelRatio"),s=t("../util/real"),a=t("../util/clamp"),l=t("gl-matrix/src/gl-matrix/mat4"),h=t("gl-matrix/src/gl-matrix/vec4"),u=0,c=0,p=.5,d=.5,f=1,m=[1,0,1,0],v=[-1,-1,1,1];r(n),n.prototype.destroy=function(){this._x=null,this._y=null,this._zoom=null,this._mediaAspectRatio=null,this._width=null,this._height=null,this._limiter=null,this._viewFrustum=null,this._projectionMatrix=null,this._projectionChanged=null,this._params=null,this._vertex=null,this._invProj=null},n.prototype.x=function(){return this._x},n.prototype.y=function(){return this._y},n.prototype.zoom=function(){return this._zoom},n.prototype.mediaAspectRatio=function(){return this._mediaAspectRatio},n.prototype.width=function(){return this._width},n.prototype.height=function(){return this._height},n.prototype.size=function(t){return t=t||{},t.width=this._width,t.height=this._height,t},n.prototype.parameters=function(t){return t=t||{},t.x=this._x,t.y=this._y,t.zoom=this._zoom,t.mediaAspectRatio=this._mediaAspectRatio,t},n.prototype.limiter=function(){return this._limiter},n.prototype.setX=function(t){this._resetParams(),this._params.x=t,this._update(this._params)},n.prototype.setY=function(t){this._resetParams(),this._params.y=t,this._update(this._params)},n.prototype.setZoom=function(t){this._resetParams(),this._params.zoom=t,this._update(this._params)},n.prototype.offsetX=function(t){this.setX(this._x+t)},n.prototype.offsetY=function(t){this.setY(this._y+t)},n.prototype.offsetZoom=function(t){this.setZoom(this._zoom+t)},n.prototype.setMediaAspectRatio=function(t){this._resetParams(),this._params.mediaAspectRatio=t,this._update(this._params)},n.prototype.setSize=function(t){this._resetParams(),this._params.width=t.width,this._params.height=t.height,this._update(this._params)},n.prototype.setParameters=function(t){this._resetParams();var e=this._params;e.x=t.x,e.y=t.y,e.zoom=t.zoom,e.mediaAspectRatio=t.mediaAspectRatio,this._update(e)},n.prototype.setLimiter=function(t){this._limiter=t||null,this._update()},n.prototype._resetParams=function(){var t=this._params;t.x=null,t.y=null,t.zoom=null,t.mediaAspectRatio=null,t.width=null,t.height=null},n.prototype._update=function(t){null==t&&(this._resetParams(),t=this._params);var e=this._x,i=this._y,n=this._zoom,r=this._mediaAspectRatio,o=this._width,l=this._height;if(t.x=null!=t.x?t.x:e,t.y=null!=t.y?t.y:i,t.zoom=null!=t.zoom?t.zoom:n,t.mediaAspectRatio=null!=t.mediaAspectRatio?t.mediaAspectRatio:r,t.width=null!=t.width?t.width:o, t.height=null!=t.height?t.height:l,this._limiter&&!(t=this._limiter(t)))throw new Error("Bad view limiter");var h=t.x,u=t.y,c=t.zoom,p=t.mediaAspectRatio,d=t.width,f=t.height;if(!(s(h)&&s(u)&&s(c)&&s(p)&&s(d)&&s(f)))throw new Error("Bad view - suspect a broken limiter");c=a(c,1e-9,Infinity),this._x=h,this._y=u,this._zoom=c,this._mediaAspectRatio=p,this._width=d,this._height=f,h===e&&u===i&&c===n&&p===r&&d===o&&f===l||(this._projectionChanged=!0,this.emit("change")),d===o&&f===l||this.emit("resize")},n.prototype._zoomX=function(){return this._zoom},n.prototype._zoomY=function(){var t=this._mediaAspectRatio,e=this._width/this._height,i=this._zoom,n=i*t/e;return isNaN(n)&&(n=i),n},n.prototype.updateWithControlParameters=function(t){var e=this.zoom(),i=this._zoomX(),n=this._zoomY();this.offsetX(t.axisScaledX*i+t.x*e),this.offsetY(t.axisScaledY*n+t.y*e),this.offsetZoom(t.zoom*e)},n.prototype.projection=function(){var t=this._projectionMatrix;if(this._projectionChanged){var e=this._x,i=this._y,n=this._zoomX(),r=this._zoomY(),o=this._viewFrustum,s=o[0]=.5-i+.5*r,a=o[1]=e-.5+.5*n,h=o[2]=.5-i-.5*r,u=o[3]=e-.5-.5*n;l.ortho(t,u,a,h,s,-1,1),this._projectionChanged=!1}return t},n.prototype.intersects=function(t){var e=this._viewFrustum;this.projection();for(var i=0;i0&&l[r]>n){s=!0;break}}if(!s)return!1}return!0},n.prototype.selectLevel=function(t){for(var e=o()*this.width(),i=this._zoom,n=0;n=e)return r}return t[t.length-1]},n.prototype.coordinatesToScreen=function(t,e){var i=this._vertex;e||(e={});var n=this._width,r=this._height;if(n<=0||r<=0)return e.x=null,e.y=null,null;var o=t&&null!=t.x?t.x:p,s=t&&null!=t.y?t.y:d;h.set(i,o-.5,.5-s,-1,1),h.transformMat4(i,i,this.projection());for(var a=0;a<3;a++)i[a]/=i[3];return e.x=n*(i[0]+1)/2,e.y=r*(1-i[1])/2,e},n.prototype.screenToCoordinates=function(t,e){var i=this._vertex,n=this._invProj;e||(e={});var r=this._width,o=this._height;l.invert(n,this.projection());var s=2*t.x/r-1,a=1-2*t.y/o;return h.set(i,s,a,1,1),h.transformMat4(i,i,n),e.x=.5+i[0],e.y=.5-i[1],e},n.limit={x:function(t,e){return function(i){return i.x=a(i.x,t,e),i}},y:function(t,e){return function(i){return i.y=a(i.y,t,e),i}},zoom:function(t,e){return function(i){return i.zoom=a(i.zoom,t,e),i}},resolution:function(t){return function(e){if(e.width<=0||e.height<=0)return e;var i=e.width,n=o()*i/t;return e.zoom=a(e.zoom,n,Infinity),e}},visibleX:function(t,e){return function(i){var n=e-t;i.zoom>n&&(i.zoom=n);var r=t+.5*i.zoom,o=e-.5*i.zoom;return i.x=a(i.x,r,o),i}},visibleY:function(t,e){return function(i){if(i.width<=0||i.height<=0)return i;var n=i.width/i.height,r=n/i.mediaAspectRatio,o=(e-t)*r;i.zoom>o&&(i.zoom=o);var s=t+.5*i.zoom/r,l=e-.5*i.zoom/r;return i.y=a(i.y,s,l),i}},letterbox:function(){return function(t){if(t.width<=0||t.height<=0)return t;var e=t.width/t.height,i=e/t.mediaAspectRatio;t.mediaAspectRatio>=e&&(t.zoom=Math.min(t.zoom,1)),t.mediaAspectRatio<=e&&(t.zoom=Math.min(t.zoom,i));var n,r;t.zoom>1?n=r=.5:(n=0+.5*t.zoom/1,r=1-.5*t.zoom/1);var o,s;return t.zoom>i?o=s=.5:(o=0+.5*t.zoom/i,s=1-.5*t.zoom/i),t.x=a(t.x,n,r),t.y=a(t.y,o,s),t}}},n.type=n.prototype.type="flat",e.exports=n},{"../util/clamp":88,"../util/pixelRatio":106,"../util/real":108,"gl-matrix/src/gl-matrix/mat4":7,"gl-matrix/src/gl-matrix/vec4":11,"minimal-event-emitter":14}],114:[function(t,e,i){"use strict";function n(t,e){this._yaw=t&&null!=t.yaw?t.yaw:_,this._pitch=t&&null!=t.pitch?t.pitch:y,this._roll=t&&null!=t.roll?t.roll:g,this._fov=t&&null!=t.fov?t.fov:x,this._width=t&&null!=t.width?t.width:m,this._height=t&&null!=t.height?t.height:v,this._projectionCenterX=t&&null!=t.projectionCenterX?t.projectionCenterX:w,this._projectionCenterY=t&&null!=t.projectionCenterY?t.projectionCenterY:M,this._limiter=e||null,this._projectionMatrix=d.create(),this._projectionChanged=!0,this._viewFrustum=[f.create(),f.create(),f.create(),f.create(),f.create()],this._params={},this._fovs={},this._vertex=f.create(),this._invProj=d.create(),this._update()}var r=t("minimal-event-emitter"),o=t("../util/pixelRatio"),s=t("../util/convertFov"),a=t("../util/rotateVector"),l=t("../util/mod"),h=t("../util/real"),u=t("../util/clamp"),c=t("../util/decimal"),p=t("../util/compose"),d=t("gl-matrix/src/gl-matrix/mat4"),f=t("gl-matrix/src/gl-matrix/vec4"),m=0,v=0,_=0,y=0,g=0,x=Math.PI/4,w=0,M=0;r(n),n.prototype.destroy=function(){this._yaw=null,this._pitch=null,this._roll=null,this._fov=null,this._width=null,this._height=null,this._limiter=null,this._projectionChanged=null,this._projectionMatrix=null,this._viewFrustum=null,this._params=null,this._vertex=null,this._invProj=null},n.prototype.yaw=function(){return this._yaw},n.prototype.pitch=function(){return this._pitch},n.prototype.roll=function(){return this._roll},n.prototype.projectionCenterX=function(){return this._projectionCenterX},n.prototype.projectionCenterY=function(){return this._projectionCenterY},n.prototype.fov=function(){return this._fov},n.prototype.width=function(){return this._width},n.prototype.height=function(){return this._height},n.prototype.size=function(t){return t||(t={}),t.width=this._width,t.height=this._height,t},n.prototype.parameters=function(t){return t||(t={}),t.yaw=this._yaw,t.pitch=this._pitch,t.roll=this._roll,t.fov=this._fov,t},n.prototype.limiter=function(){return this._limiter},n.prototype.setYaw=function(t){this._resetParams(),this._params.yaw=t,this._update(this._params)},n.prototype.setPitch=function(t){this._resetParams(),this._params.pitch=t,this._update(this._params)},n.prototype.setRoll=function(t){this._resetParams(),this._params.roll=t,this._update(this._params)},n.prototype.setFov=function(t){this._resetParams(),this._params.fov=t,this._update(this._params)},n.prototype.setProjectionCenterX=function(t){this._resetParams(),this._params.projectionCenterX=t,this._update(this._params)},n.prototype.setProjectionCenterY=function(t){this._resetParams(),this._params.projectionCenterY=t,this._update(this._params)},n.prototype.offsetYaw=function(t){this.setYaw(this._yaw+t)},n.prototype.offsetPitch=function(t){this.setPitch(this._pitch+t)},n.prototype.offsetRoll=function(t){this.setRoll(this._roll+t)},n.prototype.offsetFov=function(t){this.setFov(this._fov+t)},n.prototype.setSize=function(t){this._resetParams(),this._params.width=t.width,this._params.height=t.height,this._update(this._params)},n.prototype.setParameters=function(t){this._resetParams();var e=this._params;e.yaw=t.yaw,e.pitch=t.pitch,e.roll=t.roll,e.fov=t.fov,e.projectionCenterX=t.projectionCenterX,e.projectionCenterY=t.projectionCenterY,this._update(e)},n.prototype.setLimiter=function(t){this._limiter=t||null,this._update()},n.prototype._resetParams=function(){var t=this._params;t.yaw=null,t.pitch=null,t.roll=null,t.fov=null,t.width=null,t.height=null},n.prototype._update=function(t){null==t&&(this._resetParams(),t=this._params);var e=this._yaw,i=this._pitch,n=this._roll,r=this._fov,o=this._projectionCenterX,s=this._projectionCenterY,a=this._width,l=this._height;if(t.yaw=null!=t.yaw?t.yaw:e,t.pitch=null!=t.pitch?t.pitch:i,t.roll=null!=t.roll?t.roll:n,t.fov=null!=t.fov?t.fov:r,t.width=null!=t.width?t.width:a,t.height=null!=t.height?t.height:l,t.projectionCenterX=null!=t.projectionCenterX?t.projectionCenterX:o,t.projectionCenterY=null!=t.projectionCenterY?t.projectionCenterY:s,this._limiter&&!(t=this._limiter(t)))throw new Error("Bad view limiter");t=this._normalize(t);var u=t.yaw,c=t.pitch,p=t.roll,d=t.fov,f=t.width,m=t.height,v=t.projectionCenterX,_=t.projectionCenterY;if(!(h(u)&&h(c)&&h(p)&&h(d)&&h(f)&&h(m)&&h(v)&&h(_)))throw new Error("Bad view - suspect a broken limiter");this._yaw=u,this._pitch=c,this._roll=p,this._fov=d,this._width=f,this._height=m,this._projectionCenterX=v,this._projectionCenterY=_,u===e&&c===i&&p===n&&d===r&&f===a&&m===l&&v===o&&_===s||(this._projectionChanged=!0,this.emit("change")),f===a&&m===l||this.emit("resize")},n.prototype._normalize=function(t){this._normalizeCoordinates(t);var e=s.htov(Math.PI,t.width,t.height),i=isNaN(e)?Math.PI:Math.min(Math.PI,e);return t.fov=u(t.fov,1e-9,i-1e-9),t},n.prototype._normalizeCoordinates=function(t){return"yaw"in t&&(t.yaw=l(t.yaw-Math.PI,-2*Math.PI)+Math.PI),"pitch"in t&&(t.pitch=l(t.pitch-Math.PI,-2*Math.PI)+Math.PI),"roll"in t&&(t.roll=l(t.roll-Math.PI,-2*Math.PI)+Math.PI),t},n.prototype.normalizeToClosest=function(t,e){var i=this._yaw,n=this._pitch,r=t.yaw,o=t.pitch,s=r-2*Math.PI,a=r+2*Math.PI;Math.abs(s-i)=0&&(o=!0)}if(!o)return!1}return!0},n.prototype.selectLevel=function(t){for(var e=o()*this._height,i=Math.tan(.5*this._fov),n=0;n=e)return r}return t[t.length-1]},n.prototype.coordinatesToScreen=function(t,e){var i=this._vertex;e||(e={});var n=this._width,r=this._height;if(n<=0||r<=0)return e.x=null,e.y=null,null;var o=t&&null!=t.yaw?t.yaw:_,s=t&&null!=t.pitch?t.pitch:y,l=t&&null!=t.roll?t.roll:g;return f.set(i,0,0,-1,1),a(i,i,-o,-s,-l),f.transformMat4(i,i,this.projection()),i[3]>=0?(e.x=n*(i[0]/i[3]+1)/2,e.y=r*(1-i[1]/i[3])/2,e):(e.x=null,e.y=null,null)},n.prototype.screenToCoordinates=function(t,e){var i=this._vertex,n=this._invProj;e||(e={});var r=this._width,o=this._height;d.invert(n,this.projection());var s=2*t.x/r-1,a=1-2*t.y/o;f.set(i,s,a,1,1),f.transformMat4(i,i,n);var l=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);return e.yaw=Math.atan2(i[0],-i[2]),e.pitch=Math.acos(i[1]/l)-Math.PI/2,this._normalizeCoordinates(e),e},n.prototype.coordinatesToPerspectiveTransform=function(t,e,i){i=i||"";var n=this._height,r=this._width,o=this._fov,s=.5*n/Math.tan(o/2),a="";return a+="translateX("+c(r/2)+"px) translateY("+c(n/2)+"px) ",a+="translateX(-50%) translateY(-50%) ",a+="perspective("+c(s)+"px) ",a+="translateZ("+c(s)+"px) ",a+="rotateZ("+c(-this._roll)+"rad) ",a+="rotateX("+c(-this._pitch)+"rad) ",a+="rotateY("+c(this._yaw)+"rad) ",a+="rotateY("+c(-t.yaw)+"rad) ",a+="rotateX("+c(t.pitch)+"rad) ",a+="translateZ("+c(-e)+"px) ",a+=i+" "},n.limit={yaw:function(t,e){return function(i){return i.yaw=u(i.yaw,t,e),i}},pitch:function(t,e){return function(i){return i.pitch=u(i.pitch,t,e),i}},roll:function(t,e){return function(i){return i.roll=u(i.roll,t,e),i}},hfov:function(t,e){return function(i){var n=i.width,r=i.height;if(n>0&&r>0){var o=s.htov(t,n,r),a=s.htov(e,n,r);i.fov=u(i.fov,o,a)}return i}},vfov:function(t,e){return function(i){return i.fov=u(i.fov,t,e),i}},resolution:function(t){return function(e){var i=e.height;if(i){var n=o()*i,r=2*Math.atan(n/t);e.fov=u(e.fov,r,Infinity)}return e}},traditional:function(t,e,i){return i=null!=i?i:e,p(n.limit.resolution(t),n.limit.vfov(0,e),n.limit.hfov(0,i),n.limit.pitch(-Math.PI/2,Math.PI/2))}},n.type=n.prototype.type="rectilinear",e.exports=n},{"../util/clamp":88,"../util/compose":91,"../util/convertFov":92,"../util/decimal":93,"../util/mod":103,"../util/pixelRatio":106,"../util/real":108,"../util/rotateVector":110,"gl-matrix/src/gl-matrix/mat4":7,"gl-matrix/src/gl-matrix/vec4":11,"minimal-event-emitter":14}]},{},[58])(58)});