-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbundle.js.map
1 lines (1 loc) · 549 KB
/
bundle.js.map
1
{"version":3,"sources":["webpack:///webpack/bootstrap f518ed51a02b0f16eacf","webpack:///./node_modules/gl-matrix/src/gl-matrix/common.js","webpack:///./node_modules/gl-matrix/src/gl-matrix.js","webpack:///./src/globals.ts","webpack:///./node_modules/gl-mat4/invert.js","webpack:///./node_modules/gl-vec3/normalize.js","webpack:///./node_modules/gl-matrix/src/gl-matrix/mat3.js","webpack:///./node_modules/gl-matrix/src/gl-matrix/vec3.js","webpack:///./node_modules/gl-matrix/src/gl-matrix/vec4.js","webpack:///./src/rendering/gl/Drawable.ts","webpack:///./node_modules/filtered-vector/fvec.js","webpack:///./node_modules/binary-search-bounds/search-bounds.js","webpack:///./node_modules/gl-vec3/cross.js","webpack:///./node_modules/gl-vec3/dot.js","webpack:///./node_modules/gl-mat4/lookAt.js","webpack:///./node_modules/gl-mat4/identity.js","webpack:///./node_modules/gl-mat4/translate.js","webpack:///./node_modules/gl-mat4/create.js","webpack:///./node_modules/gl-mat4/scale.js","webpack:///./node_modules/gl-mat4/determinant.js","webpack:///./src/main.ts","webpack:///./node_modules/gl-matrix/src/gl-matrix/mat2.js","webpack:///./node_modules/gl-matrix/src/gl-matrix/mat2d.js","webpack:///./node_modules/gl-matrix/src/gl-matrix/mat4.js","webpack:///./node_modules/gl-matrix/src/gl-matrix/quat.js","webpack:///./node_modules/gl-matrix/src/gl-matrix/vec2.js","webpack:///./node_modules/stats-js/build/stats.min.js","webpack:///./node_modules/dat-gui/index.js","webpack:///./node_modules/dat-gui/vendor/dat.gui.js","webpack:///./node_modules/dat-gui/vendor/dat.color.js","webpack:///./src/geometry/Icosphere.ts","webpack:///./src/geometry/Square.ts","webpack:///./src/rendering/gl/OpenGLRenderer.ts","webpack:///./src/Camera.ts","webpack:///./node_modules/3d-view-controls/camera.js","webpack:///./node_modules/right-now/browser.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/3d-view/view.js","webpack:///./node_modules/turntable-camera-controller/turntable.js","webpack:///./node_modules/cubic-hermite/hermite.js","webpack:///./node_modules/gl-mat4/rotate.js","webpack:///./node_modules/orbit-camera-controller/orbit.js","webpack:///./node_modules/gl-mat4/fromQuat.js","webpack:///./node_modules/orbit-camera-controller/lib/quatFromFrame.js","webpack:///./node_modules/matrix-camera-controller/matrix.js","webpack:///./node_modules/mat4-interpolate/index.js","webpack:///./node_modules/gl-vec3/lerp.js","webpack:///./node_modules/mat4-recompose/index.js","webpack:///./node_modules/gl-mat4/multiply.js","webpack:///./node_modules/gl-mat4/fromRotationTranslation.js","webpack:///./node_modules/mat4-decompose/index.js","webpack:///./node_modules/mat4-decompose/normalize.js","webpack:///./node_modules/gl-mat4/clone.js","webpack:///./node_modules/gl-mat4/transpose.js","webpack:///./node_modules/gl-vec3/length.js","webpack:///./node_modules/quat-slerp/index.js","webpack:///./node_modules/gl-quat/slerp.js","webpack:///./node_modules/gl-mat4/rotateX.js","webpack:///./node_modules/gl-mat4/rotateY.js","webpack:///./node_modules/gl-mat4/rotateZ.js","webpack:///./node_modules/mouse-change/mouse-listen.js","webpack:///./node_modules/mouse-event/mouse.js","webpack:///./node_modules/mouse-wheel/wheel.js","webpack:///./node_modules/to-px/topx.js","webpack:///./node_modules/parse-unit/index.js","webpack:///./node_modules/mouse-event-offset/index.js","webpack:///./src/rendering/gl/ShaderProgram.ts","webpack:///./src/shaders/noisePlanet-vert.glsl","webpack:///./src/shaders/noisePlanet-frag.glsl","webpack:///./src/shaders/backGround-vert.glsl","webpack:///./src/shaders/backGround-frag.glsl"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;AC7DA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;AC7DA;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;ACnCO,IAAI,EAA0B,CAAC;AAChC,eAAgB,GAA2B;IAC/C,EAAE,GAAG,GAAG,CAAC;AACX,CAAC;;;;;;;ACJD;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,e;AACA,oB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,E;;;;;;ACtDA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtBA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU,KAAK;AACf,UAAU,KAAK;AACf;AACA,YAAY,KAAK;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,UAAU,KAAK;AACf,UAAU,KAAK;AACf;AACA,YAAY,KAAK;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5vBA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA,mBAAmB,OAAO;AAC1B,oBAAoB,iBAAiB;AACrC;AACA,oBAAoB,iBAAiB;AACrC;;AAEA;AACA;AACA,CAAC;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvwBD;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA,cA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gB,KAAK;AACrB;AACA;AACA,GAAG;AACH;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,KAAK;AACvB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,KAAK;AACvB;AACA;AACA,KAAK;AACL;AACA,kBAAkB,KAAK;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B,MAAM;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,KAAK;AACnB,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AClSA;;AAEA;AACA;AACA,+DAA+D;AAC/D;AACA,EAAE,YAAY;AACd;AACA;AACA;AACA,kBAAkB,UAAU,SAAS,cAAc;AACnD,KAAK;AACL,kBAAkB,aAAa,UAAU,SAAS,cAAc;AAChE;AACA,GAAG;AACH,gBAAgB,oBAAoB,IAAI;AACxC;AACA;AACA,qBAAqB,KAAK,MAAM;AAChC,GAAG;AACH,qBAAqB,KAAK,MAAM;AAChC;AACA,cAAc;AACd;AACA,0BAA0B;AAC1B,GAAG;AACH,yBAAyB;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD,YAAY;AACZ,2BAA2B;AAC3B;AACA,CAAC,KAAK;AACN;AACA,EAAE,KAAK;AACP,2BAA2B;AAC3B;AACA,CAAC,KAAK;AACN;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC3DA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,C;;;;;;AClBA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA,C;;;;;;ACXA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,E;;;;;;ACzFA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;AC1BA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,mBAAmB,YAAY,YAAY;AAC3C,mBAAmB,YAAY,YAAY;AAC3C,mBAAmB,YAAY,aAAa;;AAE5C,qBAAqB,cAAc,cAAc;AACjD,qBAAqB,cAAc,cAAc;AACjD,qBAAqB,cAAc,eAAe;;AAElD;AACA;AACA;AACA;AACA;;AAEA;AACA,E;;;;;;ACrCA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;AC1BA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;AC9BA;;AAEA;AACA;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AAC;QAC9D,MAAM,CAAC,sBAAsB,EAAE,CAAC;IAClC,CAAC,EAAE,KAAK,CAAC,CAAC;IAEV,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACxD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IAC9D,MAAM,CAAC,sBAAsB,EAAE,CAAC;IAEhC,wBAAwB;IAGxB,IAAI,EAAE,CAAC;AACT,CAAC;AAED,IAAI,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxNP;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChbA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,KAAK;AAChB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,KAAK;AAChB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,KAAK;AAChB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,KAAK;AAChB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjdA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,WAAW,WAAW;AAClC;AACA;AACA;AACA;;AAEA,YAAY,WAAW,YAAY;AACnC;AACA;AACA;AACA;;AAEA,aAAa,YAAY,YAAY;AACrC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,eAAe,YAAY,YAAY;AACvC,eAAe,YAAY,YAAY;AACvC,eAAe,YAAY,aAAa;;AAExC,iBAAiB,cAAc,cAAc;AAC7C,iBAAiB,cAAc,cAAc;AAC7C,iBAAiB,cAAc,eAAe;;AAE9C;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iFAAyC,aAAa;;AAEtD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,aAAa,YAAY,YAAY;AACrC,aAAa,YAAY,YAAY;AACrC,aAAa,YAAY,aAAa;;AAEtC;AACA,sBAAsB,yBAAyB;AAC/C,0BAA0B,qBAAqB;AAC/C,0BAA0B,yBAAyB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;;AAEA,iFAAyC,aAAa;;AAEtD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,KAAK;AACjB,YAAY,KAAK;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,KAAK;AACjB,YAAY,KAAK;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,YAAY,KAAK;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AChpDA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,KAAK;AACjB,YAAY,KAAK;AACjB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC;AACpC;AACA,sBAAsB;AACtB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,EAAE;AACb,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AAAA;AAAA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AAAA;AAAA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AAAA;AAAA;;AAEA;AACA,cAAc;AACd;AACA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,QAAQ;AACrB;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,QAAQ;AACrB;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAA;AAAA;;AAED;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AAAA;AAAA;;AAED;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjnBD;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,K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AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;;AAEA,CAAC;;;AAGD;;AAEA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA,qBAAqB,2BAA2B;AAChD;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA,qBAAqB,2BAA2B;AAChD;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,qBAAqB,2BAA2B;AAChD;AACA;AACA;AACA,SAAS;;AAET;AACA,qBAAqB,QAAQ;AAC7B;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;AAGA,CAAC;;;AAGD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,CAAC;;;AAGD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,gBAAgB;AAC7B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,CAAC;AACD;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,+BAA+B;AAC/B,OAAO;AACP;AACA;AACA;;AAEA,KAAK;;AAEL;;AAEA;;AAEA;;;AAGA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,SAAS;;AAET;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA,qBAAqB,iCAAiC;AACtD;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA,qBAAqB,iCAAiC;AACtD;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA,qBAAqB,iCAAiC;AACtD;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA,CAAC;AACD;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,OAAO;A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AAW;;AAEX;;AAEA,SAAS;;AAET;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAW;;AAEX;;AAEA;;AAEA;;AAEA,KAAK;;AAEL;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;;AAEA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;;AAEA;;AAEA;;AAEA,KAAK;;AAEL;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;AAGA;;AAEA;;;AAGA,CAAC;AACD;;;AAGA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB;AACA,aAAa,QAAQ;AACrB,aAAa,YAAY;AACzB,aAAa,QAAQ;AACrB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;AACA;;AAEA,KAAK;;AAEL,qBAAqB;;AAErB;;AAEA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;;AAET;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;;AAGA,OAAO;;;AAGP;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;AAGA;AACA;;AAEA;;AAEA,2CAA2C,mBAAmB;AAC9D,2DAA2D,kBAAkB,EAAE;AAC/E,qDAAqD,mBAAmB;AACxE,sDAAsD,mBAAmB;AACzE;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,GAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,2BAA2B;AAChD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS;;AAET;AACA;AACA;AACA,qBAAqB,gCAAgC;AACrD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX,SAAS;;AAET;;AAEA;AACA;AACA;;AAEA,SAAS;;AAET;AACA;AACA,qBAAqB,YAAY;AACjC,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,gCAAgC;;AAEhC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,wCAAwC;;AAExC;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,SAAS;;AAET;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;;AAET;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;;AAEA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,mBAAmB,UAAU;AAC7B,oBAAoB,MAAM;AAC1B;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;;AAEA,SAAS;;AAET;AACA,qBAAqB,YAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;;AAEA,SAAS;;AAET;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,SAAS;;AAET;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,SAAS;;AAET;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,WAAW;;AAEX;AACA;AACA,WAAW;;AAEX;AACA;AACA;;;AAGA,SAAS;;AAET;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,KAAK;;AAEL;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,OAAO;;AAEP;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;;AAEA;AACA,WAAW,wEAAwE;;AAEnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;;AAEf;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO;;AAEP;AACA,4BAA4B;AAC5B,OAAO;;AAEP;AACA;;AAEA;AACA;AACA,OAAO;;AAEP;AACA;AACA,OAAO;;AAEP;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,SAAS;;AAET;AACA;;AAEA,SAAS;;AAET;;AAEA;;AAEA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;A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;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,6BAA6B;AAC7B;AACA;AACA,KAAK;;AAEL;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;;AAEA;AACA;;AAEA;;AAEA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AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;;AAEA,CAAC;AACD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,CAAC;AACD;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA;;AAEA;;;;AAIA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,CAAC;AACD;AACA;AACA,kB;;;;;;AC3kHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,U;;AAEA,aAAa;;AAEb;;AAEA;;AAEA;AACA;AACA;;AAEA,OAAO;;AAEP;;AAEA,KAAK;;AAEL;;AAEA;;AAEA;AACA;AACA;;AAEA,OAAO;;AAEP;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA,KAAK;;AAEL;;;AAGA,iD;;AAEA;;AAEA,OAAO,0CAA0C;;AAEjD,yCAAyC,SAAS;AAClD;AACA;;AAEA,OAAO;;AAEP;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;AACA,KAAK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;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAW;;AAEX;;AAEA,SAAS;;AAET;;AAEA;;AAEA,mDAAmD,EAAE;AACrD;;AAEA;AACA;AACA;AACA;;AAEA,WAAW;;AAEX;;AAEA,SAAS;;AAET;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAW;;AAEX;;AAEA,SAAS;;AAET;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAW;;AAEX;;AAEA;;AAEA;;AAEA,KAAK;;AAEL;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;;AAEA;;AAEA,KAAK;;AAEL;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;;AAEA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;;AAEA;;AAEA;;AAEA,KAAK;;AAEL;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,MAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH,wCAAwC;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;AClOA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;;ACNA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;ACpBA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,aAAa;AAC3B;AACA;AACA,0CAA0C,YAAY,YAAY,KAAK,yCAAyC;AAChH;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH,C;;;;;;;ACzHA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,MAAM;AACpB;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,KAAK;AACnB;AACA;;AAEA,cAAc,KAAK;AACnB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,G;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,Y;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;AC3jBA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,MAAM;AAChC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,MAAM;AAChC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,yC;;;;;;ACtCA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mCAAmC,aAAa;;AAEhD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,eAAe,YAAY,YAAY;AACvC,eAAe,YAAY,YAAY;AACvC,eAAe,YAAY,aAAa;;AAExC;AACA,wBAAwB,yBAAyB;AACjD,4BAA4B,qBAAqB;AACjD,4BAA4B,yBAAyB;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;;AC/DA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,KAAK;AACnB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,KAAK;AACnB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,C;;;;;;ACxYA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,E;;;;;;;AC9CA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;ACxCA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;AACA,kBAAkB,MAAM;AACxB;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,MAAM;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc,MAAM;AACpB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACrMA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,C;;;;;;ACnDA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;ACnBA;AACA,qBAAqB;AACrB,qBAAqB;AACrB,qBAAqB;AACrB,qBAAqB;AACrB,qBAAqB;AACrB,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,C;;;;;;AC3DA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oD;AACA;AACA;AACA;AACA;;AAEA,cAAc,WAAW,WAAW;AACpC;AACA;AACA;AACA;;AAEA,cAAc,WAAW,YAAY;AACrC;AACA;AACA;AACA;;AAEA,eAAe,YAAY,YAAY;AACvC;AACA;AACA;AACA;AACA;AACA,E;;;;;;ACzCA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,MAAM;AACjB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,E;;;;;;ACpDA;AACA;AACA,qBAAqB;AACrB,qBAAqB;AACrB,qBAAqB;AACrB,qBAAqB;AACrB,qBAAqB;AACrB,qBAAqB;AACrB;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK,O;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,C;;;;;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,MAAM;AACvB;AACA;AACA,C;;;;;;ACTA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;AC3BA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,E;;;;;;AChDA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;ACbA,wC;;;;;;ACAA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;AClDA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;AC3CA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;AC3CA;;AAEA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;;AC3CA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA,wBAAwB,qBAAqB;AAC7C;AACA,KAAK;AACL;AACA,wBAAwB,WAAW;AACnC;AACA,KAAK;AACL;AACA,wBAAwB,WAAW;AACnC;AACA,KAAK;AACL;AACA,wBAAwB,cAAc;AACtC;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;AC5MA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3DA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;AC3DA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAC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BAAmB,mBAAmB,mBAAmB,oCAAoC,oCAAoC,oCAAoC,kCAAkC,2EAA2E,EAAE,4BAA4B,yEAAyE,KAAK,kBAAkB,iGAAiG,kCAAkC,2LAA2L,wFAAwF,uDAAuD,mDAAmD,+EAA+E,0FAA0F,sFAAsF,6EAA6E,yCAAyC,4FAA4F,KAAK,iCAAiC,+LAA+L,8DAA8D,KAAK,qCAAqC,8DAA8D,KAAK,wBAAwB,2CAA2C,sEAAsE,uCAAuC,+BAA+B,8CAA8C,gFAAgF,0CAA0C,sEAAsE,iDAAiD,wEAAwE,uFAAuF,yCAAyC,4DAA4D,6BAA6B,yBAAyB,6CAA6C,mDAAmD,8BAA8B,0CAA0C,mCAAmC,oFAAoF,8BAA8B,sCAAsC,wFAAwF,KAAK,K","file":"bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"dist/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 19);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f518ed51a02b0f16eacf","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\n/**\n * Common utilities\n * @module glMatrix\n */\n\n// Configuration Constants\nexport const EPSILON = 0.000001;\nexport let ARRAY_TYPE = (typeof Float32Array !== 'undefined') ? Float32Array : Array;\nexport const RANDOM = Math.random;\n\n/**\n * Sets the type of array used when creating new vectors and matrices\n *\n * @param {Type} type Array type, such as Float32Array or Array\n */\nexport function setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\n\nconst degree = Math.PI / 180;\n\n/**\n * Convert Degree To Radian\n *\n * @param {Number} a Angle in Degrees\n */\nexport function toRadian(a) {\n return a * degree;\n}\n\n/**\n * Tests whether or not the arguments have approximately the same value, within an absolute\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\n * than or equal to 1.0, and a relative tolerance is used for larger values)\n *\n * @param {Number} a The first number to test.\n * @param {Number} b The second number to test.\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\n */\nexport function equals(a, b) {\n return Math.abs(a - b) <= EPSILON*Math.max(1.0, Math.abs(a), Math.abs(b));\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-matrix/src/gl-matrix/common.js\n// module id = 0\n// module chunks = 0","/**\n * @fileoverview gl-matrix - High performance matrix and vector operations\n * @author Brandon Jones\n * @author Colin MacKenzie IV\n * @version 2.4.0\n */\n\n/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n// END HEADER\n\nimport * as glMatrix from \"./gl-matrix/common\";\nimport * as mat2 from \"./gl-matrix/mat2\";\nimport * as mat2d from \"./gl-matrix/mat2d\";\nimport * as mat3 from \"./gl-matrix/mat3\";\nimport * as mat4 from \"./gl-matrix/mat4\";\nimport * as quat from \"./gl-matrix/quat\";\nimport * as vec2 from \"./gl-matrix/vec2\";\nimport * as vec3 from \"./gl-matrix/vec3\";\nimport * as vec4 from \"./gl-matrix/vec4\";\n\nexport {\n glMatrix,\n mat2, mat2d, mat3, mat4,\n quat,\n vec2, vec3, vec4,\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-matrix/src/gl-matrix.js\n// module id = 1\n// module chunks = 0","\r\nexport var gl: WebGL2RenderingContext;\r\nexport function setGL(_gl: WebGL2RenderingContext) {\r\n gl = _gl;\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/globals.ts","module.exports = invert;\n\n/**\n * Inverts a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the source matrix\n * @returns {mat4} out\n */\nfunction invert(out, a) {\n var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n // Calculate the determinant\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) { \n return null; \n }\n det = 1.0 / det;\n\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n\n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/invert.js\n// module id = 3\n// module chunks = 0","module.exports = normalize;\n\n/**\n * Normalize a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a vector to normalize\n * @returns {vec3} out\n */\nfunction normalize(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2]\n var len = x*x + y*y + z*z\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len)\n out[0] = a[0] * len\n out[1] = a[1] * len\n out[2] = a[2] * len\n }\n return out\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-vec3/normalize.js\n// module id = 4\n// module chunks = 0","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nimport * as glMatrix from \"./common\";\n\n/**\n * 3x3 Matrix\n * @module mat3\n */\n\n/**\n * Creates a new identity mat3\n *\n * @returns {mat3} a new 3x3 matrix\n */\nexport function create() {\n let out = new glMatrix.ARRAY_TYPE(9);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n\n/**\n * Copies the upper-left 3x3 values into the given mat3.\n *\n * @param {mat3} out the receiving 3x3 matrix\n * @param {mat4} a the source 4x4 matrix\n * @returns {mat3} out\n */\nexport function fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n\n/**\n * Creates a new mat3 initialized with values from an existing matrix\n *\n * @param {mat3} a matrix to clone\n * @returns {mat3} a new 3x3 matrix\n */\nexport function clone(a) {\n let out = new glMatrix.ARRAY_TYPE(9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n\n/**\n * Copy the values from one mat3 to another\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the source matrix\n * @returns {mat3} out\n */\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n\n/**\n * Create a new mat3 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} A new mat3\n */\nexport function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n let out = new glMatrix.ARRAY_TYPE(9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n\n/**\n * Set the components of a mat3 to the given values\n *\n * @param {mat3} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} out\n */\nexport function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n\n/**\n * Set a mat3 to the identity matrix\n *\n * @param {mat3} out the receiving matrix\n * @returns {mat3} out\n */\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n\n/**\n * Transpose the values of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the source matrix\n * @returns {mat3} out\n */\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n let a01 = a[1], a02 = a[2], a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n\n/**\n * Inverts a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the source matrix\n * @returns {mat3} out\n */\nexport function invert(out, a) {\n let a00 = a[0], a01 = a[1], a02 = a[2];\n let a10 = a[3], a11 = a[4], a12 = a[5];\n let a20 = a[6], a21 = a[7], a22 = a[8];\n\n let b01 = a22 * a11 - a12 * a21;\n let b11 = -a22 * a10 + a12 * a20;\n let b21 = a21 * a10 - a11 * a20;\n\n // Calculate the determinant\n let det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n det = 1.0 / det;\n\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n\n/**\n * Calculates the adjugate of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the source matrix\n * @returns {mat3} out\n */\nexport function adjoint(out, a) {\n let a00 = a[0], a01 = a[1], a02 = a[2];\n let a10 = a[3], a11 = a[4], a12 = a[5];\n let a20 = a[6], a21 = a[7], a22 = a[8];\n\n out[0] = (a11 * a22 - a12 * a21);\n out[1] = (a02 * a21 - a01 * a22);\n out[2] = (a01 * a12 - a02 * a11);\n out[3] = (a12 * a20 - a10 * a22);\n out[4] = (a00 * a22 - a02 * a20);\n out[5] = (a02 * a10 - a00 * a12);\n out[6] = (a10 * a21 - a11 * a20);\n out[7] = (a01 * a20 - a00 * a21);\n out[8] = (a00 * a11 - a01 * a10);\n return out;\n}\n\n/**\n * Calculates the determinant of a mat3\n *\n * @param {mat3} a the source matrix\n * @returns {Number} determinant of a\n */\nexport function determinant(a) {\n let a00 = a[0], a01 = a[1], a02 = a[2];\n let a10 = a[3], a11 = a[4], a12 = a[5];\n let a20 = a[6], a21 = a[7], a22 = a[8];\n\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n\n/**\n * Multiplies two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the first operand\n * @param {mat3} b the second operand\n * @returns {mat3} out\n */\nexport function multiply(out, a, b) {\n let a00 = a[0], a01 = a[1], a02 = a[2];\n let a10 = a[3], a11 = a[4], a12 = a[5];\n let a20 = a[6], a21 = a[7], a22 = a[8];\n\n let b00 = b[0], b01 = b[1], b02 = b[2];\n let b10 = b[3], b11 = b[4], b12 = b[5];\n let b20 = b[6], b21 = b[7], b22 = b[8];\n\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n\n/**\n * Translate a mat3 by the given vector\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the matrix to translate\n * @param {vec2} v vector to translate by\n * @returns {mat3} out\n */\nexport function translate(out, a, v) {\n let a00 = a[0], a01 = a[1], a02 = a[2],\n a10 = a[3], a11 = a[4], a12 = a[5],\n a20 = a[6], a21 = a[7], a22 = a[8],\n x = v[0], y = v[1];\n\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n\n/**\n * Rotates a mat3 by the given angle\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\nexport function rotate(out, a, rad) {\n let a00 = a[0], a01 = a[1], a02 = a[2],\n a10 = a[3], a11 = a[4], a12 = a[5],\n a20 = a[6], a21 = a[7], a22 = a[8],\n\n s = Math.sin(rad),\n c = Math.cos(rad);\n\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n};\n\n/**\n * Scales the mat3 by the dimensions in the given vec2\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the matrix to rotate\n * @param {vec2} v the vec2 to scale the matrix by\n * @returns {mat3} out\n **/\nexport function scale(out, a, v) {\n let x = v[0], y = v[1];\n\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {vec2} v Translation vector\n * @returns {mat3} out\n */\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\nexport function fromRotation(out, rad) {\n let s = Math.sin(rad), c = Math.cos(rad);\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {vec2} v Scaling vector\n * @returns {mat3} out\n */\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n\n/**\n * Copies the values from a mat2d into a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {mat2d} a the matrix to copy\n * @returns {mat3} out\n **/\nexport function fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n\n/**\n* Calculates a 3x3 matrix from the given quaternion\n*\n* @param {mat3} out mat3 receiving operation result\n* @param {quat} q Quaternion to create matrix from\n*\n* @returns {mat3} out\n*/\nexport function fromQuat(out, q) {\n let x = q[0], y = q[1], z = q[2], w = q[3];\n let x2 = x + x;\n let y2 = y + y;\n let z2 = z + z;\n\n let xx = x * x2;\n let yx = y * x2;\n let yy = y * y2;\n let zx = z * x2;\n let zy = z * y2;\n let zz = z * z2;\n let wx = w * x2;\n let wy = w * y2;\n let wz = w * z2;\n\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n\n return out;\n}\n\n/**\n* Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n*\n* @param {mat3} out mat3 receiving operation result\n* @param {mat4} a Mat4 to derive the normal matrix from\n*\n* @returns {mat3} out\n*/\nexport function normalFromMat4(out, a) {\n let a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n let a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n let a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n let a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n\n let b00 = a00 * a11 - a01 * a10;\n let b01 = a00 * a12 - a02 * a10;\n let b02 = a00 * a13 - a03 * a10;\n let b03 = a01 * a12 - a02 * a11;\n let b04 = a01 * a13 - a03 * a11;\n let b05 = a02 * a13 - a03 * a12;\n let b06 = a20 * a31 - a21 * a30;\n let b07 = a20 * a32 - a22 * a30;\n let b08 = a20 * a33 - a23 * a30;\n let b09 = a21 * a32 - a22 * a31;\n let b10 = a21 * a33 - a23 * a31;\n let b11 = a22 * a33 - a23 * a32;\n\n // Calculate the determinant\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n det = 1.0 / det;\n\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n\n return out;\n}\n\n/**\n * Generates a 2D projection matrix with the given bounds\n *\n * @param {mat3} out mat3 frustum matrix will be written into\n * @param {number} width Width of your gl context\n * @param {number} height Height of gl context\n * @returns {mat3} out\n */\nexport function projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n\n/**\n * Returns a string representation of a mat3\n *\n * @param {mat3} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\nexport function str(a) {\n return 'mat3(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' +\n a[3] + ', ' + a[4] + ', ' + a[5] + ', ' +\n a[6] + ', ' + a[7] + ', ' + a[8] + ')';\n}\n\n/**\n * Returns Frobenius norm of a mat3\n *\n * @param {mat3} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\nexport function frob(a) {\n return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2)))\n}\n\n/**\n * Adds two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the first operand\n * @param {mat3} b the second operand\n * @returns {mat3} out\n */\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the first operand\n * @param {mat3} b the second operand\n * @returns {mat3} out\n */\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n\n\n\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat3} out the receiving matrix\n * @param {mat3} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat3} out\n */\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n\n/**\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat3} out the receiving vector\n * @param {mat3} a the first operand\n * @param {mat3} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat3} out\n */\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + (b[0] * scale);\n out[1] = a[1] + (b[1] * scale);\n out[2] = a[2] + (b[2] * scale);\n out[3] = a[3] + (b[3] * scale);\n out[4] = a[4] + (b[4] * scale);\n out[5] = a[5] + (b[5] * scale);\n out[6] = a[6] + (b[6] * scale);\n out[7] = a[7] + (b[7] * scale);\n out[8] = a[8] + (b[8] * scale);\n return out;\n}\n\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {mat3} a The first matrix.\n * @param {mat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] &&\n a[3] === b[3] && a[4] === b[4] && a[5] === b[5] &&\n a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {mat3} a The first matrix.\n * @param {mat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function equals(a, b) {\n let a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5], a6 = a[6], a7 = a[7], a8 = a[8];\n let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8];\n return (Math.abs(a0 - b0) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\n Math.abs(a1 - b1) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\n Math.abs(a2 - b2) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\n Math.abs(a3 - b3) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\n Math.abs(a4 - b4) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\n Math.abs(a5 - b5) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\n Math.abs(a6 - b6) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\n Math.abs(a7 - b7) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a7), Math.abs(b7)) &&\n Math.abs(a8 - b8) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a8), Math.abs(b8)));\n}\n\n/**\n * Alias for {@link mat3.multiply}\n * @function\n */\nexport const mul = multiply;\n\n/**\n * Alias for {@link mat3.subtract}\n * @function\n */\nexport const sub = subtract;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-matrix/src/gl-matrix/mat3.js\n// module id = 5\n// module chunks = 0","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nimport * as glMatrix from \"./common\";\n\n/**\n * 3 Dimensional Vector\n * @module vec3\n */\n\n/**\n * Creates a new, empty vec3\n *\n * @returns {vec3} a new 3D vector\n */\nexport function create() {\n let out = new glMatrix.ARRAY_TYPE(3);\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n return out;\n}\n\n/**\n * Creates a new vec3 initialized with values from an existing vector\n *\n * @param {vec3} a vector to clone\n * @returns {vec3} a new 3D vector\n */\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n\n/**\n * Calculates the length of a vec3\n *\n * @param {vec3} a vector to calculate length of\n * @returns {Number} length of a\n */\nexport function length(a) {\n let x = a[0];\n let y = a[1];\n let z = a[2];\n return Math.sqrt(x*x + y*y + z*z);\n}\n\n/**\n * Creates a new vec3 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} a new 3D vector\n */\nexport function fromValues(x, y, z) {\n let out = new glMatrix.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n\n/**\n * Copy the values from one vec3 to another\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the source vector\n * @returns {vec3} out\n */\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n\n/**\n * Set the components of a vec3 to the given values\n *\n * @param {vec3} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} out\n */\nexport function set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n\n/**\n * Adds two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n\n/**\n * Multiplies two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n\n/**\n * Divides two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n\n/**\n * Math.ceil the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a vector to ceil\n * @returns {vec3} out\n */\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n\n/**\n * Math.floor the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a vector to floor\n * @returns {vec3} out\n */\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n\n/**\n * Returns the minimum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n\n/**\n * Returns the maximum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n\n/**\n * Math.round the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a vector to round\n * @returns {vec3} out\n */\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n\n/**\n * Scales a vec3 by a scalar number\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec3} out\n */\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n\n/**\n * Adds two vec3's after scaling the second operand by a scalar value\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec3} out\n */\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + (b[0] * scale);\n out[1] = a[1] + (b[1] * scale);\n out[2] = a[2] + (b[2] * scale);\n return out;\n}\n\n/**\n * Calculates the euclidian distance between two vec3's\n *\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {Number} distance between a and b\n */\nexport function distance(a, b) {\n let x = b[0] - a[0];\n let y = b[1] - a[1];\n let z = b[2] - a[2];\n return Math.sqrt(x*x + y*y + z*z);\n}\n\n/**\n * Calculates the squared euclidian distance between two vec3's\n *\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {Number} squared distance between a and b\n */\nexport function squaredDistance(a, b) {\n let x = b[0] - a[0];\n let y = b[1] - a[1];\n let z = b[2] - a[2];\n return x*x + y*y + z*z;\n}\n\n/**\n * Calculates the squared length of a vec3\n *\n * @param {vec3} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\nexport function squaredLength(a) {\n let x = a[0];\n let y = a[1];\n let z = a[2];\n return x*x + y*y + z*z;\n}\n\n/**\n * Negates the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a vector to negate\n * @returns {vec3} out\n */\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n\n/**\n * Returns the inverse of the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a vector to invert\n * @returns {vec3} out\n */\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n\n/**\n * Normalize a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a vector to normalize\n * @returns {vec3} out\n */\nexport function normalize(out, a) {\n let x = a[0];\n let y = a[1];\n let z = a[2];\n let len = x*x + y*y + z*z;\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n }\n return out;\n}\n\n/**\n * Calculates the dot product of two vec3's\n *\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {Number} dot product of a and b\n */\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\n/**\n * Computes the cross product of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nexport function cross(out, a, b) {\n let ax = a[0], ay = a[1], az = a[2];\n let bx = b[0], by = b[1], bz = b[2];\n\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n\n/**\n * Performs a linear interpolation between two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {vec3} out\n */\nexport function lerp(out, a, b, t) {\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n\n/**\n * Performs a hermite interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @param {vec3} c the third operand\n * @param {vec3} d the fourth operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {vec3} out\n */\nexport function hermite(out, a, b, c, d, t) {\n let factorTimes2 = t * t;\n let factor1 = factorTimes2 * (2 * t - 3) + 1;\n let factor2 = factorTimes2 * (t - 2) + t;\n let factor3 = factorTimes2 * (t - 1);\n let factor4 = factorTimes2 * (3 - 2 * t);\n\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n\n return out;\n}\n\n/**\n * Performs a bezier interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @param {vec3} c the third operand\n * @param {vec3} d the fourth operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {vec3} out\n */\nexport function bezier(out, a, b, c, d, t) {\n let inverseFactor = 1 - t;\n let inverseFactorTimesTwo = inverseFactor * inverseFactor;\n let factorTimes2 = t * t;\n let factor1 = inverseFactorTimesTwo * inverseFactor;\n let factor2 = 3 * t * inverseFactorTimesTwo;\n let factor3 = 3 * factorTimes2 * inverseFactor;\n let factor4 = factorTimes2 * t;\n\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n\n return out;\n}\n\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec3} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec3} out\n */\nexport function random(out, scale) {\n scale = scale || 1.0;\n\n let r = glMatrix.RANDOM() * 2.0 * Math.PI;\n let z = (glMatrix.RANDOM() * 2.0) - 1.0;\n let zScale = Math.sqrt(1.0-z*z) * scale;\n\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n\n/**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the vector to transform\n * @param {mat4} m matrix to transform with\n * @returns {vec3} out\n */\nexport function transformMat4(out, a, m) {\n let x = a[0], y = a[1], z = a[2];\n let w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n\n/**\n * Transforms the vec3 with a mat3.\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the vector to transform\n * @param {mat3} m the 3x3 matrix to transform with\n * @returns {vec3} out\n */\nexport function transformMat3(out, a, m) {\n let x = a[0], y = a[1], z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n\n/**\n * Transforms the vec3 with a quat\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the vector to transform\n * @param {quat} q quaternion to transform with\n * @returns {vec3} out\n */\nexport function transformQuat(out, a, q) {\n // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\n\n let x = a[0], y = a[1], z = a[2];\n let qx = q[0], qy = q[1], qz = q[2], qw = q[3];\n\n // calculate quat * vec\n let ix = qw * x + qy * z - qz * y;\n let iy = qw * y + qz * x - qx * z;\n let iz = qw * z + qx * y - qy * x;\n let iw = -qx * x - qy * y - qz * z;\n\n // calculate result * inverse quat\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n return out;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n * @param {vec3} out The receiving vec3\n * @param {vec3} a The vec3 point to rotate\n * @param {vec3} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @returns {vec3} out\n */\nexport function rotateX(out, a, b, c){\n let p = [], r=[];\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0];\n r[1] = p[1]*Math.cos(c) - p[2]*Math.sin(c);\n r[2] = p[1]*Math.sin(c) + p[2]*Math.cos(c);\n\n //translate to correct position\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n\n return out;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n * @param {vec3} out The receiving vec3\n * @param {vec3} a The vec3 point to rotate\n * @param {vec3} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @returns {vec3} out\n */\nexport function rotateY(out, a, b, c){\n let p = [], r=[];\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[2]*Math.sin(c) + p[0]*Math.cos(c);\n r[1] = p[1];\n r[2] = p[2]*Math.cos(c) - p[0]*Math.sin(c);\n\n //translate to correct position\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n\n return out;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n * @param {vec3} out The receiving vec3\n * @param {vec3} a The vec3 point to rotate\n * @param {vec3} b The origin of the rotation\n * @param {Number} c The angle of rotation\n * @returns {vec3} out\n */\nexport function rotateZ(out, a, b, c){\n let p = [], r=[];\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n\n //perform rotation\n r[0] = p[0]*Math.cos(c) - p[1]*Math.sin(c);\n r[1] = p[0]*Math.sin(c) + p[1]*Math.cos(c);\n r[2] = p[2];\n\n //translate to correct position\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n\n return out;\n}\n\n/**\n * Get the angle between two 3D vectors\n * @param {vec3} a The first operand\n * @param {vec3} b The second operand\n * @returns {Number} The angle in radians\n */\nexport function angle(a, b) {\n let tempA = fromValues(a[0], a[1], a[2]);\n let tempB = fromValues(b[0], b[1], b[2]);\n\n normalize(tempA, tempA);\n normalize(tempB, tempB);\n\n let cosine = dot(tempA, tempB);\n\n if(cosine > 1.0) {\n return 0;\n }\n else if(cosine < -1.0) {\n return Math.PI;\n } else {\n return Math.acos(cosine);\n }\n}\n\n/**\n * Returns a string representation of a vector\n *\n * @param {vec3} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\nexport function str(a) {\n return 'vec3(' + a[0] + ', ' + a[1] + ', ' + a[2] + ')';\n}\n\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {vec3} a The first vector.\n * @param {vec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {vec3} a The first vector.\n * @param {vec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function equals(a, b) {\n let a0 = a[0], a1 = a[1], a2 = a[2];\n let b0 = b[0], b1 = b[1], b2 = b[2];\n return (Math.abs(a0 - b0) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\n Math.abs(a1 - b1) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\n Math.abs(a2 - b2) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a2), Math.abs(b2)));\n}\n\n/**\n * Alias for {@link vec3.subtract}\n * @function\n */\nexport const sub = subtract;\n\n/**\n * Alias for {@link vec3.multiply}\n * @function\n */\nexport const mul = multiply;\n\n/**\n * Alias for {@link vec3.divide}\n * @function\n */\nexport const div = divide;\n\n/**\n * Alias for {@link vec3.distance}\n * @function\n */\nexport const dist = distance;\n\n/**\n * Alias for {@link vec3.squaredDistance}\n * @function\n */\nexport const sqrDist = squaredDistance;\n\n/**\n * Alias for {@link vec3.length}\n * @function\n */\nexport const len = length;\n\n/**\n * Alias for {@link vec3.squaredLength}\n * @function\n */\nexport const sqrLen = squaredLength;\n\n/**\n * Perform some operation over an array of vec3s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\nexport const forEach = (function() {\n let vec = create();\n\n return function(a, stride, offset, count, fn, arg) {\n let i, l;\n if(!stride) {\n stride = 3;\n }\n\n if(!offset) {\n offset = 0;\n }\n\n if(count) {\n l = Math.min((count * stride) + offset, a.length);\n } else {\n l = a.length;\n }\n\n for(i = offset; i < l; i += stride) {\n vec[0] = a[i]; vec[1] = a[i+1]; vec[2] = a[i+2];\n fn(vec, vec, arg);\n a[i] = vec[0]; a[i+1] = vec[1]; a[i+2] = vec[2];\n }\n\n return a;\n };\n})();\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-matrix/src/gl-matrix/vec3.js\n// module id = 6\n// module chunks = 0","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nimport * as glMatrix from \"./common\";\n\n/**\n * 4 Dimensional Vector\n * @module vec4\n */\n\n/**\n * Creates a new, empty vec4\n *\n * @returns {vec4} a new 4D vector\n */\nexport function create() {\n let out = new glMatrix.ARRAY_TYPE(4);\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n}\n\n/**\n * Creates a new vec4 initialized with values from an existing vector\n *\n * @param {vec4} a vector to clone\n * @returns {vec4} a new 4D vector\n */\nexport function clone(a) {\n let out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n\n/**\n * Creates a new vec4 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} a new 4D vector\n */\nexport function fromValues(x, y, z, w) {\n let out = new glMatrix.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n\n/**\n * Copy the values from one vec4 to another\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the source vector\n * @returns {vec4} out\n */\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n\n/**\n * Set the components of a vec4 to the given values\n *\n * @param {vec4} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} out\n */\nexport function set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n\n/**\n * Adds two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {vec4} out\n */\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {vec4} out\n */\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n\n/**\n * Multiplies two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {vec4} out\n */\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n\n/**\n * Divides two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {vec4} out\n */\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n\n/**\n * Math.ceil the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a vector to ceil\n * @returns {vec4} out\n */\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n\n/**\n * Math.floor the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a vector to floor\n * @returns {vec4} out\n */\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n\n/**\n * Returns the minimum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {vec4} out\n */\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n\n/**\n * Returns the maximum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {vec4} out\n */\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n\n/**\n * Math.round the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a vector to round\n * @returns {vec4} out\n */\nexport function round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n\n/**\n * Scales a vec4 by a scalar number\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec4} out\n */\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n\n/**\n * Adds two vec4's after scaling the second operand by a scalar value\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec4} out\n */\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + (b[0] * scale);\n out[1] = a[1] + (b[1] * scale);\n out[2] = a[2] + (b[2] * scale);\n out[3] = a[3] + (b[3] * scale);\n return out;\n}\n\n/**\n * Calculates the euclidian distance between two vec4's\n *\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {Number} distance between a and b\n */\nexport function distance(a, b) {\n let x = b[0] - a[0];\n let y = b[1] - a[1];\n let z = b[2] - a[2];\n let w = b[3] - a[3];\n return Math.sqrt(x*x + y*y + z*z + w*w);\n}\n\n/**\n * Calculates the squared euclidian distance between two vec4's\n *\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {Number} squared distance between a and b\n */\nexport function squaredDistance(a, b) {\n let x = b[0] - a[0];\n let y = b[1] - a[1];\n let z = b[2] - a[2];\n let w = b[3] - a[3];\n return x*x + y*y + z*z + w*w;\n}\n\n/**\n * Calculates the length of a vec4\n *\n * @param {vec4} a vector to calculate length of\n * @returns {Number} length of a\n */\nexport function length(a) {\n let x = a[0];\n let y = a[1];\n let z = a[2];\n let w = a[3];\n return Math.sqrt(x*x + y*y + z*z + w*w);\n}\n\n/**\n * Calculates the squared length of a vec4\n *\n * @param {vec4} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\nexport function squaredLength(a) {\n let x = a[0];\n let y = a[1];\n let z = a[2];\n let w = a[3];\n return x*x + y*y + z*z + w*w;\n}\n\n/**\n * Negates the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a vector to negate\n * @returns {vec4} out\n */\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n\n/**\n * Returns the inverse of the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a vector to invert\n * @returns {vec4} out\n */\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n\n/**\n * Normalize a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a vector to normalize\n * @returns {vec4} out\n */\nexport function normalize(out, a) {\n let x = a[0];\n let y = a[1];\n let z = a[2];\n let w = a[3];\n let len = x*x + y*y + z*z + w*w;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n }\n return out;\n}\n\n/**\n * Calculates the dot product of two vec4's\n *\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @returns {Number} dot product of a and b\n */\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n\n/**\n * Performs a linear interpolation between two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the first operand\n * @param {vec4} b the second operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {vec4} out\n */\nexport function lerp(out, a, b, t) {\n let ax = a[0];\n let ay = a[1];\n let az = a[2];\n let aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec4} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec4} out\n */\nexport function random(out, vectorScale) {\n vectorScale = vectorScale || 1.0;\n\n //TODO: This is a pretty awful way of doing this. Find something better.\n out[0] = glMatrix.RANDOM();\n out[1] = glMatrix.RANDOM();\n out[2] = glMatrix.RANDOM();\n out[3] = glMatrix.RANDOM();\n normalize(out, out);\n scale(out, out, vectorScale);\n return out;\n}\n\n/**\n * Transforms the vec4 with a mat4.\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the vector to transform\n * @param {mat4} m matrix to transform with\n * @returns {vec4} out\n */\nexport function transformMat4(out, a, m) {\n let x = a[0], y = a[1], z = a[2], w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n\n/**\n * Transforms the vec4 with a quat\n *\n * @param {vec4} out the receiving vector\n * @param {vec4} a the vector to transform\n * @param {quat} q quaternion to transform with\n * @returns {vec4} out\n */\nexport function transformQuat(out, a, q) {\n let x = a[0], y = a[1], z = a[2];\n let qx = q[0], qy = q[1], qz = q[2], qw = q[3];\n\n // calculate quat * vec\n let ix = qw * x + qy * z - qz * y;\n let iy = qw * y + qz * x - qx * z;\n let iz = qw * z + qx * y - qy * x;\n let iw = -qx * x - qy * y - qz * z;\n\n // calculate result * inverse quat\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n\n/**\n * Returns a string representation of a vector\n *\n * @param {vec4} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\nexport function str(a) {\n return 'vec4(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')';\n}\n\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {vec4} a The first vector.\n * @param {vec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {vec4} a The first vector.\n * @param {vec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function equals(a, b) {\n let a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];\n return (Math.abs(a0 - b0) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\n Math.abs(a1 - b1) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\n Math.abs(a2 - b2) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\n Math.abs(a3 - b3) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a3), Math.abs(b3)));\n}\n\n/**\n * Alias for {@link vec4.subtract}\n * @function\n */\nexport const sub = subtract;\n\n/**\n * Alias for {@link vec4.multiply}\n * @function\n */\nexport const mul = multiply;\n\n/**\n * Alias for {@link vec4.divide}\n * @function\n */\nexport const div = divide;\n\n/**\n * Alias for {@link vec4.distance}\n * @function\n */\nexport const dist = distance;\n\n/**\n * Alias for {@link vec4.squaredDistance}\n * @function\n */\nexport const sqrDist = squaredDistance;\n\n/**\n * Alias for {@link vec4.length}\n * @function\n */\nexport const len = length;\n\n/**\n * Alias for {@link vec4.squaredLength}\n * @function\n */\nexport const sqrLen = squaredLength;\n\n/**\n * Perform some operation over an array of vec4s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\nexport const forEach = (function() {\n let vec = create();\n\n return function(a, stride, offset, count, fn, arg) {\n let i, l;\n if(!stride) {\n stride = 4;\n }\n\n if(!offset) {\n offset = 0;\n }\n\n if(count) {\n l = Math.min((count * stride) + offset, a.length);\n } else {\n l = a.length;\n }\n\n for(i = offset; i < l; i += stride) {\n vec[0] = a[i]; vec[1] = a[i+1]; vec[2] = a[i+2]; vec[3] = a[i+3];\n fn(vec, vec, arg);\n a[i] = vec[0]; a[i+1] = vec[1]; a[i+2] = vec[2]; a[i+3] = vec[3];\n }\n\n return a;\n };\n})();\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-matrix/src/gl-matrix/vec4.js\n// module id = 7\n// module chunks = 0","import {mat4, vec3, vec4} from 'gl-matrix';\r\nimport {gl} from '../../globals';\r\n\r\nabstract class Drawable {\r\n count: number = 0;\r\n\r\n bufIdx: WebGLBuffer;\r\n bufPos: WebGLBuffer;\r\n bufNor: WebGLBuffer;\r\n\r\n idxBound: boolean = false;\r\n posBound: boolean = false;\r\n norBound: boolean = false;\r\n\r\n diffuseMap: WebGLTexture;\r\n diffuseMapBound: boolean = false;\r\n\r\n modelMat: mat4 = mat4.create();\r\n transMat: mat4 = mat4.create();\r\n rotMat: mat4 = mat4.create();\r\n scaleMat: mat4 = mat4.create();\r\n\r\n\r\n abstract create() : void;\r\n\r\n updatePos(deltaPos:vec3)\r\n {\r\n mat4.translate(this.modelMat, this.modelMat, deltaPos);\r\n }\r\n\r\n updateNewPos(absPos:vec3)\r\n {\r\n let tranMat = mat4.create();\r\n mat4.translate(this.transMat, tranMat, absPos);\r\n }\r\n\r\n updateScale(newScale:vec3)\r\n {\r\n let sMat = mat4.create();\r\n mat4.scale(this.scaleMat, sMat, newScale);\r\n }\r\n\r\n updateRotY(rad:number)\r\n {\r\n let rotMat = mat4.create();\r\n mat4.rotateY(this.rotMat, rotMat, rad);\r\n }\r\n \r\n updateModelMat()\r\n {\r\n let sr = mat4.create();\r\n mat4.multiply(sr, this.scaleMat, this.transMat );\r\n mat4.multiply(this.modelMat, sr, this.rotMat );\r\n }\r\n\r\n \r\n\r\n destory() {\r\n gl.deleteBuffer(this.bufIdx);\r\n gl.deleteBuffer(this.bufPos);\r\n gl.deleteBuffer(this.bufNor);\r\n\r\n gl.deleteTexture(this.diffuseMap);\r\n }\r\n\r\n generateIdx() {\r\n this.idxBound = true;\r\n this.bufIdx = gl.createBuffer();\r\n }\r\n\r\n generatePos() {\r\n this.posBound = true;\r\n this.bufPos = gl.createBuffer();\r\n }\r\n\r\n generateNor() {\r\n this.norBound = true;\r\n this.bufNor = gl.createBuffer();\r\n }\r\n\r\n generateTexture() {\r\n this.diffuseMapBound = true;\r\n }\r\n\r\n bindIdx(): boolean {\r\n if (this.idxBound) {\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.bufIdx);\r\n }\r\n return this.idxBound;\r\n }\r\n\r\n bindPos(): boolean {\r\n if (this.posBound) {\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.bufPos);\r\n }\r\n return this.posBound;\r\n }\r\n\r\n bindNor(): boolean {\r\n if (this.norBound) {\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.bufNor);\r\n }\r\n return this.norBound;\r\n }\r\n\r\n bindTexture(url:string)\r\n { \r\n const texture = gl.createTexture();\r\n\r\n const image = new Image();\r\n image.onload = function() {\r\n gl.bindTexture(gl.TEXTURE_2D, texture);\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);\r\n //gl.generateMipmap(gl.TEXTURE_2D);\r\n gl.bindTexture(gl.TEXTURE_2D, null);\r\n\r\n gl.activeTexture(gl.TEXTURE0);\r\n }\r\n\r\n image.src = url;\r\n\r\n this.diffuseMap = texture;\r\n }\r\n\r\n elemCount(): number {\r\n return this.count;\r\n }\r\n\r\n drawMode(): GLenum {\r\n return gl.TRIANGLES;\r\n }\r\n};\r\n\r\nexport default Drawable;\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/rendering/gl/Drawable.ts","'use strict'\n\nmodule.exports = createFilteredVector\n\nvar cubicHermite = require('cubic-hermite')\nvar bsearch = require('binary-search-bounds')\n\nfunction clamp(lo, hi, x) {\n return Math.min(hi, Math.max(lo, x))\n}\n\nfunction FilteredVector(state0, velocity0, t0) {\n this.dimension = state0.length\n this.bounds = [ new Array(this.dimension), new Array(this.dimension) ]\n for(var i=0; i<this.dimension; ++i) {\n this.bounds[0][i] = -Infinity\n this.bounds[1][i] = Infinity\n }\n this._state = state0.slice().reverse()\n this._velocity = velocity0.slice().reverse()\n this._time = [ t0 ]\n this._scratch = [ state0.slice(), state0.slice(), state0.slice(), state0.slice(), state0.slice() ]\n}\n\nvar proto = FilteredVector.prototype\n\nproto.flush = function(t) {\n var idx = bsearch.gt(this._time, t) - 1\n if(idx <= 0) {\n return\n }\n this._time.splice(0, idx)\n this._state.splice(0, idx * this.dimension)\n this._velocity.splice(0, idx * this.dimension)\n}\n\nproto.curve = function(t) {\n var time = this._time\n var n = time.length\n var idx = bsearch.le(time, t)\n var result = this._scratch[0]\n var state = this._state\n var velocity = this._velocity\n var d = this.dimension\n var bounds = this.bounds\n if(idx < 0) {\n var ptr = d-1\n for(var i=0; i<d; ++i, --ptr) {\n result[i] = state[ptr]\n }\n } else if(idx >= n-1) {\n var ptr = state.length-1\n var tf = t - time[n-1]\n for(var i=0; i<d; ++i, --ptr) {\n result[i] = state[ptr] + tf * velocity[ptr]\n }\n } else {\n var ptr = d * (idx+1) - 1\n var t0 = time[idx]\n var t1 = time[idx+1]\n var dt = (t1 - t0) || 1.0\n var x0 = this._scratch[1]\n var x1 = this._scratch[2]\n var v0 = this._scratch[3]\n var v1 = this._scratch[4]\n var steady = true\n for(var i=0; i<d; ++i, --ptr) {\n x0[i] = state[ptr]\n v0[i] = velocity[ptr] * dt\n x1[i] = state[ptr+d]\n v1[i] = velocity[ptr+d] * dt\n steady = steady && (x0[i] === x1[i] && v0[i] === v1[i] && v0[i] === 0.0)\n }\n if(steady) {\n for(var i=0; i<d; ++i) {\n result[i] = x0[i]\n }\n } else {\n cubicHermite(x0, v0, x1, v1, (t-t0)/dt, result)\n }\n }\n var lo = bounds[0]\n var hi = bounds[1]\n for(var i=0; i<d; ++i) {\n result[i] = clamp(lo[i], hi[i], result[i])\n }\n return result\n}\n\nproto.dcurve = function(t) {\n var time = this._time\n var n = time.length\n var idx = bsearch.le(time, t)\n var result = this._scratch[0]\n var state = this._state\n var velocity = this._velocity\n var d = this.dimension\n if(idx >= n-1) {\n var ptr = state.length-1\n var tf = t - time[n-1]\n for(var i=0; i<d; ++i, --ptr) {\n result[i] = velocity[ptr]\n }\n } else {\n var ptr = d * (idx+1) - 1\n var t0 = time[idx]\n var t1 = time[idx+1]\n var dt = (t1 - t0) || 1.0\n var x0 = this._scratch[1]\n var x1 = this._scratch[2]\n var v0 = this._scratch[3]\n var v1 = this._scratch[4]\n var steady = true\n for(var i=0; i<d; ++i, --ptr) {\n x0[i] = state[ptr]\n v0[i] = velocity[ptr] * dt\n x1[i] = state[ptr+d]\n v1[i] = velocity[ptr+d] * dt\n steady = steady && (x0[i] === x1[i] && v0[i] === v1[i] && v0[i] === 0.0)\n }\n if(steady) {\n for(var i=0; i<d; ++i) {\n result[i] = 0.0\n }\n } else {\n cubicHermite.derivative(x0, v0, x1, v1, (t-t0)/dt, result)\n for(var i=0; i<d; ++i) {\n result[i] /= dt\n }\n }\n }\n return result\n}\n\nproto.lastT = function() {\n var time = this._time\n return time[time.length-1]\n}\n\nproto.stable = function() {\n var velocity = this._velocity\n var ptr = velocity.length\n for(var i=this.dimension-1; i>=0; --i) {\n if(velocity[--ptr]) {\n return false\n }\n }\n return true\n}\n\nproto.jump = function(t) {\n var t0 = this.lastT()\n var d = this.dimension\n if(t < t0 || arguments.length !== d+1) {\n return\n }\n var state = this._state\n var velocity = this._velocity\n var ptr = state.length-this.dimension\n var bounds = this.bounds\n var lo = bounds[0]\n var hi = bounds[1]\n this._time.push(t0, t)\n for(var j=0; j<2; ++j) {\n for(var i=0; i<d; ++i) {\n state.push(state[ptr++])\n velocity.push(0)\n }\n }\n this._time.push(t)\n for(var i=d; i>0; --i) {\n state.push(clamp(lo[i-1], hi[i-1], arguments[i]))\n velocity.push(0)\n }\n}\n\nproto.push = function(t) {\n var t0 = this.lastT()\n var d = this.dimension\n if(t < t0 || arguments.length !== d+1) {\n return\n }\n var state = this._state\n var velocity = this._velocity\n var ptr = state.length-this.dimension\n var dt = t - t0\n var bounds = this.bounds\n var lo = bounds[0]\n var hi = bounds[1]\n var sf = (dt > 1e-6) ? 1/dt : 0\n this._time.push(t)\n for(var i=d; i>0; --i) {\n var xc = clamp(lo[i-1], hi[i-1], arguments[i])\n state.push(xc)\n velocity.push((xc - state[ptr++]) * sf)\n }\n}\n\nproto.set = function(t) {\n var d = this.dimension\n if(t < this.lastT() || arguments.length !== d+1) {\n return\n }\n var state = this._state\n var velocity = this._velocity\n var bounds = this.bounds\n var lo = bounds[0]\n var hi = bounds[1]\n this._time.push(t)\n for(var i=d; i>0; --i) {\n state.push(clamp(lo[i-1], hi[i-1], arguments[i]))\n velocity.push(0)\n }\n}\n\nproto.move = function(t) {\n var t0 = this.lastT()\n var d = this.dimension\n if(t <= t0 || arguments.length !== d+1) {\n return\n }\n var state = this._state\n var velocity = this._velocity\n var statePtr = state.length - this.dimension\n var bounds = this.bounds\n var lo = bounds[0]\n var hi = bounds[1]\n var dt = t - t0\n var sf = (dt > 1e-6) ? 1/dt : 0.0\n this._time.push(t)\n for(var i=d; i>0; --i) {\n var dx = arguments[i]\n state.push(clamp(lo[i-1], hi[i-1], state[statePtr++] + dx))\n velocity.push(dx * sf)\n }\n}\n\nproto.idle = function(t) {\n var t0 = this.lastT()\n if(t < t0) {\n return\n }\n var d = this.dimension\n var state = this._state\n var velocity = this._velocity\n var statePtr = state.length-d\n var bounds = this.bounds\n var lo = bounds[0]\n var hi = bounds[1]\n var dt = t - t0\n this._time.push(t)\n for(var i=d-1; i>=0; --i) {\n state.push(clamp(lo[i], hi[i], state[statePtr] + dt * velocity[statePtr]))\n velocity.push(0)\n statePtr += 1\n }\n}\n\nfunction getZero(d) {\n var result = new Array(d)\n for(var i=0; i<d; ++i) {\n result[i] = 0.0\n }\n return result\n}\n\nfunction createFilteredVector(initState, initVelocity, initTime) {\n switch(arguments.length) {\n case 0:\n return new FilteredVector([0], [0], 0)\n case 1:\n if(typeof initState === 'number') {\n var zero = getZero(initState)\n return new FilteredVector(zero, zero, 0)\n } else {\n return new FilteredVector(initState, getZero(initState.length), 0)\n }\n case 2:\n if(typeof initVelocity === 'number') {\n var zero = getZero(initState.length)\n return new FilteredVector(initState, zero, +initVelocity)\n } else {\n initTime = 0\n }\n case 3:\n if(initState.length !== initVelocity.length) {\n throw new Error('state and velocity lengths must match')\n }\n return new FilteredVector(initState, initVelocity, initTime)\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/filtered-vector/fvec.js\n// module id = 9\n// module chunks = 0","\"use strict\"\n\nfunction compileSearch(funcName, predicate, reversed, extraArgs, useNdarray, earlyOut) {\n var code = [\n \"function \", funcName, \"(a,l,h,\", extraArgs.join(\",\"), \"){\",\nearlyOut ? \"\" : \"var i=\", (reversed ? \"l-1\" : \"h+1\"),\n\";while(l<=h){\\\nvar m=(l+h)>>>1,x=a\", useNdarray ? \".get(m)\" : \"[m]\"]\n if(earlyOut) {\n if(predicate.indexOf(\"c\") < 0) {\n code.push(\";if(x===y){return m}else if(x<=y){\")\n } else {\n code.push(\";var p=c(x,y);if(p===0){return m}else if(p<=0){\")\n }\n } else {\n code.push(\";if(\", predicate, \"){i=m;\")\n }\n if(reversed) {\n code.push(\"l=m+1}else{h=m-1}\")\n } else {\n code.push(\"h=m-1}else{l=m+1}\")\n }\n code.push(\"}\")\n if(earlyOut) {\n code.push(\"return -1};\")\n } else {\n code.push(\"return i};\")\n }\n return code.join(\"\")\n}\n\nfunction compileBoundsSearch(predicate, reversed, suffix, earlyOut) {\n var result = new Function([\n compileSearch(\"A\", \"x\" + predicate + \"y\", reversed, [\"y\"], false, earlyOut),\n compileSearch(\"B\", \"x\" + predicate + \"y\", reversed, [\"y\"], true, earlyOut),\n compileSearch(\"P\", \"c(x,y)\" + predicate + \"0\", reversed, [\"y\", \"c\"], false, earlyOut),\n compileSearch(\"Q\", \"c(x,y)\" + predicate + \"0\", reversed, [\"y\", \"c\"], true, earlyOut),\n\"function dispatchBsearch\", suffix, \"(a,y,c,l,h){\\\nif(a.shape){\\\nif(typeof(c)==='function'){\\\nreturn Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)\\\n}else{\\\nreturn B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)\\\n}}else{\\\nif(typeof(c)==='function'){\\\nreturn P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)\\\n}else{\\\nreturn A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)\\\n}}}\\\nreturn dispatchBsearch\", suffix].join(\"\"))\n return result()\n}\n\nmodule.exports = {\n ge: compileBoundsSearch(\">=\", false, \"GE\"),\n gt: compileBoundsSearch(\">\", false, \"GT\"),\n lt: compileBoundsSearch(\"<\", true, \"LT\"),\n le: compileBoundsSearch(\"<=\", true, \"LE\"),\n eq: compileBoundsSearch(\"-\", true, \"EQ\", true)\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/binary-search-bounds/search-bounds.js\n// module id = 10\n// module chunks = 0","module.exports = cross;\n\n/**\n * Computes the cross product of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {vec3} out\n */\nfunction cross(out, a, b) {\n var ax = a[0], ay = a[1], az = a[2],\n bx = b[0], by = b[1], bz = b[2]\n\n out[0] = ay * bz - az * by\n out[1] = az * bx - ax * bz\n out[2] = ax * by - ay * bx\n return out\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-vec3/cross.js\n// module id = 11\n// module chunks = 0","module.exports = dot;\n\n/**\n * Calculates the dot product of two vec3's\n *\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @returns {Number} dot product of a and b\n */\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-vec3/dot.js\n// module id = 12\n// module chunks = 0","var identity = require('./identity');\n\nmodule.exports = lookAt;\n\n/**\n * Generates a look-at matrix with the given eye position, focal point, and up axis\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {vec3} eye Position of the viewer\n * @param {vec3} center Point the viewer is looking at\n * @param {vec3} up vec3 pointing up\n * @returns {mat4} out\n */\nfunction lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len,\n eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2],\n centerx = center[0],\n centery = center[1],\n centerz = center[2];\n\n if (Math.abs(eyex - centerx) < 0.000001 &&\n Math.abs(eyey - centery) < 0.000001 &&\n Math.abs(eyez - centerz) < 0.000001) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n\n len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n\n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/lookAt.js\n// module id = 13\n// module chunks = 0","module.exports = identity;\n\n/**\n * Set a mat4 to the identity matrix\n *\n * @param {mat4} out the receiving matrix\n * @returns {mat4} out\n */\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/identity.js\n// module id = 14\n// module chunks = 0","module.exports = translate;\n\n/**\n * Translate a mat4 by the given vector\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to translate\n * @param {vec3} v vector to translate by\n * @returns {mat4} out\n */\nfunction translate(out, a, v) {\n var x = v[0], y = v[1], z = v[2],\n a00, a01, a02, a03,\n a10, a11, a12, a13,\n a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3];\n a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7];\n a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11];\n\n out[0] = a00; out[1] = a01; out[2] = a02; out[3] = a03;\n out[4] = a10; out[5] = a11; out[6] = a12; out[7] = a13;\n out[8] = a20; out[9] = a21; out[10] = a22; out[11] = a23;\n\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/translate.js\n// module id = 15\n// module chunks = 0","module.exports = create;\n\n/**\n * Creates a new identity mat4\n *\n * @returns {mat4} a new 4x4 matrix\n */\nfunction create() {\n var out = new Float32Array(16);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/create.js\n// module id = 16\n// module chunks = 0","module.exports = scale;\n\n/**\n * Scales the mat4 by the dimensions in the given vec3\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to scale\n * @param {vec3} v the vec3 to scale the matrix by\n * @returns {mat4} out\n **/\nfunction scale(out, a, v) {\n var x = v[0], y = v[1], z = v[2];\n\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/scale.js\n// module id = 17\n// module chunks = 0","module.exports = determinant;\n\n/**\n * Calculates the determinant of a mat4\n *\n * @param {mat4} a the source matrix\n * @returns {Number} determinant of a\n */\nfunction determinant(a) {\n var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n // Calculate the determinant\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/determinant.js\n// module id = 18\n// module chunks = 0","import {vec2, vec3, vec4} from 'gl-matrix';\r\nimport * as Stats from 'stats-js';\r\nimport * as DAT from 'dat-gui';\r\nimport Icosphere from './geometry/Icosphere';\r\nimport Cube from './geometry/Cube';\r\nimport Square from './geometry/Square';\r\nimport OpenGLRenderer from './rendering/gl/OpenGLRenderer';\r\nimport Camera from './Camera';\r\nimport {setGL} from './globals';\r\nimport ShaderProgram, {Shader} from './rendering/gl/ShaderProgram';\r\n\r\n\r\n\r\n// Define an object with application parameters and button callbacks\r\n// This will be referred to by dat.GUI's functions that add GUI elements.\r\nconst controls = {\r\n tesselations: 9,\r\n 'Load Scene': loadNoisyPlanet, // A function pointer, essentially\r\n x: 0.06,\r\n y: 0.54,\r\n z: 0.6,\r\n Oceans: [38, 152, 232, 1.0],\r\n OceanHeight: 1.0,\r\n Shoreline: [233, 200, 143, 1.0],\r\n ShoreHeight: 0.02,\r\n Foliage: [11, 143, 11, 1.0], \r\n Steeps: [62, 35, 3, 1.0],\r\n Snow: [255, 255, 255, 1.0],\r\n SnowHeight: 1.10,\r\n PolarCaps: [155, 214, 236, 1.0],\r\n PolarCapsAttitude: 1.1,\r\n Atmosphere: [64, 88, 172, 1.0],\r\n Shader: 2,\r\n Noise4D: 0, \r\n TerrainExp: 0.35,\r\n TerrainSeed: 0.0,\r\n Time: 1,\r\n EnvironmentMap : 1,\r\n\r\n};\r\n\r\nlet backScreenQaud: Square;\r\nlet noisyPlanet: Icosphere;\r\n\r\nlet time: number;\r\nlet oldTime : number;\r\nlet startTime : number;\r\nlet currentTime : number;\r\n\r\nfunction rotatePlanet(planet: Icosphere, speed: number)\r\n{\r\n let seed: number;\r\n seed = speed * time;\r\n\r\n planet.updateRotY(seed);\r\n planet.updateModelMat();\r\n}\r\n\r\nfunction loadNoisyPlanet()\r\n{\r\n noisyPlanet = new Icosphere(vec3.fromValues(0, 0, 0), 1.0, controls.tesselations);\r\n noisyPlanet.create();\r\n noisyPlanet.bindTexture(\"src/textures/envMap2.jpg\");\r\n\r\n backScreenQaud = new Square(vec3.fromValues(0, 0, 0));\r\n backScreenQaud.create();\r\n}\r\n\r\nfunction main() {\r\n // Initial display for framerate\r\n\r\n time = 0.0; \r\n oldTime = startTime = Date.now();\r\n\r\n const stats = Stats();\r\n stats.setMode(0);\r\n stats.domElement.style.position = 'absolute';\r\n stats.domElement.style.left = '0px';\r\n stats.domElement.style.top = '0px';\r\n document.body.appendChild(stats.domElement);\r\n\r\n // Add controls to the gui\r\n const gui = new DAT.GUI();\r\n gui.add(controls, 'tesselations', 0, 20).step(1);\r\n gui.add(controls, 'Load Scene');\r\n\r\n var sunPos = gui.addFolder('SunDirection');\r\n sunPos.add(controls, 'x', -1.0, 1.0).step(0.01);\r\n sunPos.add(controls, 'y', -1.0, 1.0).step(0.01);\r\n sunPos.add(controls, 'z', -1.0, 1.0).step(0.01);\r\n\r\n //sunPos.open();\r\n\r\n var colors = gui.addFolder('Colors');\r\n colors.addColor(controls, 'Oceans');\r\n colors.addColor(controls, 'Shoreline');\r\n colors.addColor(controls, 'Foliage');\r\n colors.addColor(controls, 'Steeps');\r\n colors.addColor(controls, 'Snow');\r\n colors.addColor(controls, 'PolarCaps');\r\n colors.addColor(controls, 'Atmosphere');\r\n\r\n //colors.open();\r\n\r\n var terrain = gui.addFolder('Terrain'); \r\n\r\n terrain.add(controls, 'OceanHeight', 0.0, 1.50).step(0.01);\r\n terrain.add(controls, 'ShoreHeight', 0.0, 0.04).step(0.01);\r\n terrain.add(controls, 'SnowHeight', 0.0, 2.00).step(0.01);\r\n terrain.add(controls, 'PolarCapsAttitude', 0.0, 3.0).step(0.01);\r\n terrain.add(controls, 'TerrainExp', 0.0, 1.0).step(0.01);\r\n terrain.add(controls, 'TerrainSeed', 0.0, 100.0).step(1.0);\r\n\r\n gui.add(controls, 'Time', { Pause: 0, Play: 1 });\r\n gui.add(controls, 'EnvironmentMap', { Off: 0, On: 1 });\r\n\r\n gui.add(controls, 'Noise4D', { Off: 0, On: 1 });\r\n\r\n gui.add(controls, 'Shader', { Lambertian: 0, Blinn_phong: 1, Physically_based: 2 });\r\n \r\n // get canvas and webgl context\r\n const canvas = <HTMLCanvasElement> document.getElementById('canvas');\r\n const gl = <WebGL2RenderingContext> canvas.getContext('webgl2');\r\n if (!gl) {\r\n alert('WebGL 2 not supported!');\r\n }\r\n // `setGL` is a function imported above which sets the value of `gl` in the `globals.ts` module.\r\n // Later, we can import `gl` from `globals.ts` to access it\r\n setGL(gl);\r\n\r\n gl.enable(gl.DEPTH_TEST);\r\n\r\n const camera = new Camera(vec3.fromValues(0, 0, 6.0), vec3.fromValues(0, 0, 0));\r\n const renderer = new OpenGLRenderer(canvas);\r\n \r\n \r\n let planetShader: ShaderProgram;\r\n let spaceShader: ShaderProgram;\r\n\r\n planetShader = new ShaderProgram([\r\n new Shader(gl.VERTEX_SHADER, require('./shaders/noisePlanet-vert.glsl')),\r\n new Shader(gl.FRAGMENT_SHADER, require('./shaders/noisePlanet-frag.glsl')),]);\r\n\r\n spaceShader = new ShaderProgram([\r\n new Shader(gl.VERTEX_SHADER, require('./shaders/backGround-vert.glsl')),\r\n new Shader(gl.FRAGMENT_SHADER, require('./shaders/backGround-frag.glsl')),]);\r\n\r\n loadNoisyPlanet();\r\n\r\n renderer.setClearColor(0.0, 0.0, 0.0, 1);\r\n\r\n \r\n // This function will be called every frame\r\n function tick()\r\n {\r\n currentTime = Date.now();\r\n\r\n if(controls.Time > 0.0)\r\n {\r\n time += (currentTime - oldTime) * 0.06;\r\n }\r\n\r\n oldTime = currentTime;\r\n camera.update();\r\n \r\n rotatePlanet(noisyPlanet, 0.0005);\r\n\r\n stats.begin();\r\n gl.viewport(0, 0, window.innerWidth, window.innerHeight);\r\n renderer.clear();\r\n\r\n renderer.renderBackground(camera, spaceShader,\r\n [backScreenQaud,], \r\n vec4.fromValues( camera.position[0], camera.position[1], camera.position[2], camera.up[0] ), \r\n vec4.fromValues( window.innerWidth, window.innerHeight, camera.up[1], camera.up[2]),\r\n vec4.fromValues( controls.Atmosphere[0], controls.Atmosphere[1], controls.Atmosphere[2], controls.Atmosphere[3]), \r\n vec4.fromValues(time, controls.Noise4D, controls.TerrainExp, controls.TerrainSeed * 39.0),\r\n );\r\n\r\n renderer.render(camera, planetShader,\r\n [noisyPlanet,],\r\n\r\n vec4.fromValues(controls.x, controls.y, controls.z, controls.Shader),\r\n vec4.fromValues(controls.Oceans[0], controls.Oceans[1], controls.Oceans[2], controls.Oceans[3]),\r\n vec4.fromValues(controls.Shoreline[0], controls.Shoreline[1], controls.Shoreline[2], controls.Shoreline[3]),\r\n vec4.fromValues(controls.Foliage[0], controls.Foliage[1], controls.Foliage[2], controls.Foliage[3]),\r\n vec4.fromValues(controls.Steeps[0], controls.Steeps[1], controls.Steeps[2], controls.Steeps[3]),\r\n vec4.fromValues(controls.Snow[0], controls.Snow[1], controls.Snow[2], controls.Snow[3]),\r\n vec4.fromValues(controls.PolarCaps[0], controls.PolarCaps[1], controls.PolarCaps[2], controls.PolarCaps[3]),\r\n vec4.fromValues(controls.Atmosphere[0], controls.Atmosphere[1], controls.Atmosphere[2], controls.Atmosphere[3]), \r\n vec4.fromValues(controls.OceanHeight, controls.ShoreHeight, controls.SnowHeight, controls.PolarCapsAttitude),\r\n vec4.fromValues(time, controls.Noise4D, controls.TerrainExp, controls.TerrainSeed * 39.0),\r\n vec4.fromValues(camera.position[0], camera.position[1], camera.position[2], controls.EnvironmentMap), \r\n );\r\n\r\n stats.end();\r\n // Tell the browser to call `tick` again whenever it renders a new frame\r\n requestAnimationFrame(tick);\r\n }\r\n\r\n window.addEventListener('resize', function() {\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n camera.setAspectRatio(window.innerWidth / window.innerHeight);\r\n camera.updateProjectionMatrix();\r\n }, false);\r\n\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n camera.setAspectRatio(window.innerWidth / window.innerHeight);\r\n camera.updateProjectionMatrix();\r\n\r\n // Start the render loop\r\n\r\n\r\n tick();\r\n}\r\n\r\nmain();\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.ts","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nimport * as glMatrix from \"./common\"\n\n/**\n * 2x2 Matrix\n * @module mat2\n */\n\n/**\n * Creates a new identity mat2\n *\n * @returns {mat2} a new 2x2 matrix\n */\nexport function create() {\n let out = new glMatrix.ARRAY_TYPE(4);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n\n/**\n * Creates a new mat2 initialized with values from an existing matrix\n *\n * @param {mat2} a matrix to clone\n * @returns {mat2} a new 2x2 matrix\n */\nexport function clone(a) {\n let out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n\n/**\n * Copy the values from one mat2 to another\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the source matrix\n * @returns {mat2} out\n */\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n\n/**\n * Set a mat2 to the identity matrix\n *\n * @param {mat2} out the receiving matrix\n * @returns {mat2} out\n */\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n\n/**\n * Create a new mat2 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\n * @returns {mat2} out A new 2x2 matrix\n */\nexport function fromValues(m00, m01, m10, m11) {\n let out = new glMatrix.ARRAY_TYPE(4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n\n/**\n * Set the components of a mat2 to the given values\n *\n * @param {mat2} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\n * @returns {mat2} out\n */\nexport function set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n\n/**\n * Transpose the values of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the source matrix\n * @returns {mat2} out\n */\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n let a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n\n return out;\n}\n\n/**\n * Inverts a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the source matrix\n * @returns {mat2} out\n */\nexport function invert(out, a) {\n let a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n\n // Calculate the determinant\n let det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n det = 1.0 / det;\n\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n\n return out;\n}\n\n/**\n * Calculates the adjugate of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the source matrix\n * @returns {mat2} out\n */\nexport function adjoint(out, a) {\n // Caching this value is nessecary if out == a\n let a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n\n return out;\n}\n\n/**\n * Calculates the determinant of a mat2\n *\n * @param {mat2} a the source matrix\n * @returns {Number} determinant of a\n */\nexport function determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n\n/**\n * Multiplies two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the first operand\n * @param {mat2} b the second operand\n * @returns {mat2} out\n */\nexport function multiply(out, a, b) {\n let a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n\n/**\n * Rotates a mat2 by the given angle\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\nexport function rotate(out, a, rad) {\n let a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n\n/**\n * Scales the mat2 by the dimensions in the given vec2\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the matrix to rotate\n * @param {vec2} v the vec2 to scale the matrix by\n * @returns {mat2} out\n **/\nexport function scale(out, a, v) {\n let a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n let v0 = v[0], v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\nexport function fromRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {vec2} v Scaling vector\n * @returns {mat2} out\n */\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n\n/**\n * Returns a string representation of a mat2\n *\n * @param {mat2} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\nexport function str(a) {\n return 'mat2(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')';\n}\n\n/**\n * Returns Frobenius norm of a mat2\n *\n * @param {mat2} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\nexport function frob(a) {\n return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2)))\n}\n\n/**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @param {mat2} L the lower triangular matrix\n * @param {mat2} D the diagonal matrix\n * @param {mat2} U the upper triangular matrix\n * @param {mat2} a the input matrix to factorize\n */\n\nexport function LDU(L, D, U, a) {\n L[2] = a[2]/a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n\n/**\n * Adds two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the first operand\n * @param {mat2} b the second operand\n * @returns {mat2} out\n */\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the first operand\n * @param {mat2} b the second operand\n * @returns {mat2} out\n */\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {mat2} a The first matrix.\n * @param {mat2} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {mat2} a The first matrix.\n * @param {mat2} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function equals(a, b) {\n let a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];\n return (Math.abs(a0 - b0) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\n Math.abs(a1 - b1) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\n Math.abs(a2 - b2) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\n Math.abs(a3 - b3) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a3), Math.abs(b3)));\n}\n\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat2} out the receiving matrix\n * @param {mat2} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat2} out\n */\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n\n/**\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat2} out the receiving vector\n * @param {mat2} a the first operand\n * @param {mat2} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat2} out\n */\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + (b[0] * scale);\n out[1] = a[1] + (b[1] * scale);\n out[2] = a[2] + (b[2] * scale);\n out[3] = a[3] + (b[3] * scale);\n return out;\n}\n\n/**\n * Alias for {@link mat2.multiply}\n * @function\n */\nexport const mul = multiply;\n\n/**\n * Alias for {@link mat2.subtract}\n * @function\n */\nexport const sub = subtract;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-matrix/src/gl-matrix/mat2.js\n// module id = 20\n// module chunks = 0","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nimport * as glMatrix from \"./common\";\n\n/**\n * 2x3 Matrix\n * @module mat2d\n *\n * @description\n * A mat2d contains six elements defined as:\n * <pre>\n * [a, c, tx,\n * b, d, ty]\n * </pre>\n * This is a short form for the 3x3 matrix:\n * <pre>\n * [a, c, tx,\n * b, d, ty,\n * 0, 0, 1]\n * </pre>\n * The last row is ignored so the array is shorter and operations are faster.\n */\n\n/**\n * Creates a new identity mat2d\n *\n * @returns {mat2d} a new 2x3 matrix\n */\nexport function create() {\n let out = new glMatrix.ARRAY_TYPE(6);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n\n/**\n * Creates a new mat2d initialized with values from an existing matrix\n *\n * @param {mat2d} a matrix to clone\n * @returns {mat2d} a new 2x3 matrix\n */\nexport function clone(a) {\n let out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n\n/**\n * Copy the values from one mat2d to another\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the source matrix\n * @returns {mat2d} out\n */\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n\n/**\n * Set a mat2d to the identity matrix\n *\n * @param {mat2d} out the receiving matrix\n * @returns {mat2d} out\n */\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n\n/**\n * Create a new mat2d with the given values\n *\n * @param {Number} a Component A (index 0)\n * @param {Number} b Component B (index 1)\n * @param {Number} c Component C (index 2)\n * @param {Number} d Component D (index 3)\n * @param {Number} tx Component TX (index 4)\n * @param {Number} ty Component TY (index 5)\n * @returns {mat2d} A new mat2d\n */\nexport function fromValues(a, b, c, d, tx, ty) {\n let out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n\n/**\n * Set the components of a mat2d to the given values\n *\n * @param {mat2d} out the receiving matrix\n * @param {Number} a Component A (index 0)\n * @param {Number} b Component B (index 1)\n * @param {Number} c Component C (index 2)\n * @param {Number} d Component D (index 3)\n * @param {Number} tx Component TX (index 4)\n * @param {Number} ty Component TY (index 5)\n * @returns {mat2d} out\n */\nexport function set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n\n/**\n * Inverts a mat2d\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the source matrix\n * @returns {mat2d} out\n */\nexport function invert(out, a) {\n let aa = a[0], ab = a[1], ac = a[2], ad = a[3];\n let atx = a[4], aty = a[5];\n\n let det = aa * ad - ab * ac;\n if(!det){\n return null;\n }\n det = 1.0 / det;\n\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n\n/**\n * Calculates the determinant of a mat2d\n *\n * @param {mat2d} a the source matrix\n * @returns {Number} determinant of a\n */\nexport function determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n\n/**\n * Multiplies two mat2d's\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the first operand\n * @param {mat2d} b the second operand\n * @returns {mat2d} out\n */\nexport function multiply(out, a, b) {\n let a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5];\n let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n\n/**\n * Rotates a mat2d by the given angle\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2d} out\n */\nexport function rotate(out, a, rad) {\n let a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5];\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n\n/**\n * Scales the mat2d by the dimensions in the given vec2\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the matrix to translate\n * @param {vec2} v the vec2 to scale the matrix by\n * @returns {mat2d} out\n **/\nexport function scale(out, a, v) {\n let a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5];\n let v0 = v[0], v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n\n/**\n * Translates the mat2d by the dimensions in the given vec2\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the matrix to translate\n * @param {vec2} v the vec2 to translate the matrix by\n * @returns {mat2d} out\n **/\nexport function translate(out, a, v) {\n let a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5];\n let v0 = v[0], v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n}\n\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.rotate(dest, dest, rad);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2d} out\n */\nexport function fromRotation(out, rad) {\n let s = Math.sin(rad), c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.scale(dest, dest, vec);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {vec2} v Scaling vector\n * @returns {mat2d} out\n */\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.translate(dest, dest, vec);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {vec2} v Translation vector\n * @returns {mat2d} out\n */\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n\n/**\n * Returns a string representation of a mat2d\n *\n * @param {mat2d} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\nexport function str(a) {\n return 'mat2d(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' +\n a[3] + ', ' + a[4] + ', ' + a[5] + ')';\n}\n\n/**\n * Returns Frobenius norm of a mat2d\n *\n * @param {mat2d} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\nexport function frob(a) {\n return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + 1))\n}\n\n/**\n * Adds two mat2d's\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the first operand\n * @param {mat2d} b the second operand\n * @returns {mat2d} out\n */\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n}\n\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the first operand\n * @param {mat2d} b the second operand\n * @returns {mat2d} out\n */\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n}\n\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat2d} out the receiving matrix\n * @param {mat2d} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat2d} out\n */\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n}\n\n/**\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat2d} out the receiving vector\n * @param {mat2d} a the first operand\n * @param {mat2d} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat2d} out\n */\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + (b[0] * scale);\n out[1] = a[1] + (b[1] * scale);\n out[2] = a[2] + (b[2] * scale);\n out[3] = a[3] + (b[3] * scale);\n out[4] = a[4] + (b[4] * scale);\n out[5] = a[5] + (b[5] * scale);\n return out;\n}\n\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {mat2d} a The first matrix.\n * @param {mat2d} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {mat2d} a The first matrix.\n * @param {mat2d} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function equals(a, b) {\n let a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5];\n let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5];\n return (Math.abs(a0 - b0) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\n Math.abs(a1 - b1) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\n Math.abs(a2 - b2) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\n Math.abs(a3 - b3) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\n Math.abs(a4 - b4) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\n Math.abs(a5 - b5) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a5), Math.abs(b5)));\n}\n\n/**\n * Alias for {@link mat2d.multiply}\n * @function\n */\nexport const mul = multiply;\n\n/**\n * Alias for {@link mat2d.subtract}\n * @function\n */\nexport const sub = subtract;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-matrix/src/gl-matrix/mat2d.js\n// module id = 21\n// module chunks = 0","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nimport * as glMatrix from \"./common\";\n\n/**\n * 4x4 Matrix\n * @module mat4\n */\n\n/**\n * Creates a new identity mat4\n *\n * @returns {mat4} a new 4x4 matrix\n */\nexport function create() {\n let out = new glMatrix.ARRAY_TYPE(16);\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n\n/**\n * Creates a new mat4 initialized with values from an existing matrix\n *\n * @param {mat4} a matrix to clone\n * @returns {mat4} a new 4x4 matrix\n */\nexport function clone(a) {\n let out = new glMatrix.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n\n/**\n * Copy the values from one mat4 to another\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the source matrix\n * @returns {mat4} out\n */\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n\n/**\n * Create a new mat4 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} A new mat4\n */\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n let out = new glMatrix.ARRAY_TYPE(16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n\n/**\n * Set the components of a mat4 to the given values\n *\n * @param {mat4} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} out\n */\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n\n\n/**\n * Set a mat4 to the identity matrix\n *\n * @param {mat4} out the receiving matrix\n * @returns {mat4} out\n */\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n\n/**\n * Transpose the values of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the source matrix\n * @returns {mat4} out\n */\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n let a01 = a[1], a02 = a[2], a03 = a[3];\n let a12 = a[6], a13 = a[7];\n let a23 = a[11];\n\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n\n/**\n * Inverts a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the source matrix\n * @returns {mat4} out\n */\nexport function invert(out, a) {\n let a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n let a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n let a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n let a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n\n let b00 = a00 * a11 - a01 * a10;\n let b01 = a00 * a12 - a02 * a10;\n let b02 = a00 * a13 - a03 * a10;\n let b03 = a01 * a12 - a02 * a11;\n let b04 = a01 * a13 - a03 * a11;\n let b05 = a02 * a13 - a03 * a12;\n let b06 = a20 * a31 - a21 * a30;\n let b07 = a20 * a32 - a22 * a30;\n let b08 = a20 * a33 - a23 * a30;\n let b09 = a21 * a32 - a22 * a31;\n let b10 = a21 * a33 - a23 * a31;\n let b11 = a22 * a33 - a23 * a32;\n\n // Calculate the determinant\n let det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n det = 1.0 / det;\n\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n\n return out;\n}\n\n/**\n * Calculates the adjugate of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the source matrix\n * @returns {mat4} out\n */\nexport function adjoint(out, a) {\n let a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n let a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n let a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n let a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n\n out[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22));\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12));\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22));\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12));\n out[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21));\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11));\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21));\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11));\n return out;\n}\n\n/**\n * Calculates the determinant of a mat4\n *\n * @param {mat4} a the source matrix\n * @returns {Number} determinant of a\n */\nexport function determinant(a) {\n let a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n let a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n let a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n let a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n\n let b00 = a00 * a11 - a01 * a10;\n let b01 = a00 * a12 - a02 * a10;\n let b02 = a00 * a13 - a03 * a10;\n let b03 = a01 * a12 - a02 * a11;\n let b04 = a01 * a13 - a03 * a11;\n let b05 = a02 * a13 - a03 * a12;\n let b06 = a20 * a31 - a21 * a30;\n let b07 = a20 * a32 - a22 * a30;\n let b08 = a20 * a33 - a23 * a30;\n let b09 = a21 * a32 - a22 * a31;\n let b10 = a21 * a33 - a23 * a31;\n let b11 = a22 * a33 - a23 * a32;\n\n // Calculate the determinant\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n\n/**\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the first operand\n * @param {mat4} b the second operand\n * @returns {mat4} out\n */\nexport function multiply(out, a, b) {\n let a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];\n let a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];\n let a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];\n let a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n\n // Cache only the current line of the second matrix\n let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];\n out[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n out[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n out[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n out[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n b0 = b[4]; b1 = b[5]; b2 = b[6]; b3 = b[7];\n out[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n out[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n out[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n out[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n b0 = b[8]; b1 = b[9]; b2 = b[10]; b3 = b[11];\n out[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n out[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n out[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n out[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n b0 = b[12]; b1 = b[13]; b2 = b[14]; b3 = b[15];\n out[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n out[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n out[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n return out;\n}\n\n/**\n * Translate a mat4 by the given vector\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to translate\n * @param {vec3} v vector to translate by\n * @returns {mat4} out\n */\nexport function translate(out, a, v) {\n let x = v[0], y = v[1], z = v[2];\n let a00, a01, a02, a03;\n let a10, a11, a12, a13;\n let a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3];\n a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7];\n a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11];\n\n out[0] = a00; out[1] = a01; out[2] = a02; out[3] = a03;\n out[4] = a10; out[5] = a11; out[6] = a12; out[7] = a13;\n out[8] = a20; out[9] = a21; out[10] = a22; out[11] = a23;\n\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n\n/**\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to scale\n * @param {vec3} v the vec3 to scale the matrix by\n * @returns {mat4} out\n **/\nexport function scale(out, a, v) {\n let x = v[0], y = v[1], z = v[2];\n\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n\n/**\n * Rotates a mat4 by the given angle around the given axis\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @param {vec3} axis the axis to rotate around\n * @returns {mat4} out\n */\nexport function rotate(out, a, rad, axis) {\n let x = axis[0], y = axis[1], z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n let s, c, t;\n let a00, a01, a02, a03;\n let a10, a11, a12, a13;\n let a20, a21, a22, a23;\n let b00, b01, b02;\n let b10, b11, b12;\n let b20, b21, b22;\n\n if (Math.abs(len) < glMatrix.EPSILON) { return null; }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n\n a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3];\n a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7];\n a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11];\n\n // Construct the elements of the rotation matrix\n b00 = x * x * t + c; b01 = y * x * t + z * s; b02 = z * x * t - y * s;\n b10 = x * y * t - z * s; b11 = y * y * t + c; b12 = z * y * t + x * s;\n b20 = x * z * t + y * s; b21 = y * z * t - x * s; b22 = z * z * t + c;\n\n // Perform rotation-specific matrix multiplication\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) { // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n}\n\n/**\n * Rotates a matrix by the given angle around the X axis\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateX(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n\n if (a !== out) { // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n // Perform axis-specific matrix multiplication\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n\n/**\n * Rotates a matrix by the given angle around the Y axis\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateY(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a20 = a[8];\n let a21 = a[9];\n let a22 = a[10];\n let a23 = a[11];\n\n if (a !== out) { // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n // Perform axis-specific matrix multiplication\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n\n/**\n * Rotates a matrix by the given angle around the Z axis\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateZ(out, a, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n let a00 = a[0];\n let a01 = a[1];\n let a02 = a[2];\n let a03 = a[3];\n let a10 = a[4];\n let a11 = a[5];\n let a12 = a[6];\n let a13 = a[7];\n\n if (a !== out) { // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n // Perform axis-specific matrix multiplication\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {vec3} v Translation vector\n * @returns {mat4} out\n */\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {vec3} v Scaling vector\n * @returns {mat4} out\n */\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @param {vec3} axis the axis to rotate around\n * @returns {mat4} out\n */\nexport function fromRotation(out, rad, axis) {\n let x = axis[0], y = axis[1], z = axis[2];\n let len = Math.sqrt(x * x + y * y + z * z);\n let s, c, t;\n\n if (Math.abs(len) < glMatrix.EPSILON) { return null; }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n\n // Perform rotation-specific matrix multiplication\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function fromXRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n\n // Perform axis-specific matrix multiplication\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function fromYRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n\n // Perform axis-specific matrix multiplication\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function fromZRotation(out, rad) {\n let s = Math.sin(rad);\n let c = Math.cos(rad);\n\n // Perform axis-specific matrix multiplication\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n\n/**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {vec3} v Translation vector\n * @returns {mat4} out\n */\nexport function fromRotationTranslation(out, q, v) {\n // Quaternion math\n let x = q[0], y = q[1], z = q[2], w = q[3];\n let x2 = x + x;\n let y2 = y + y;\n let z2 = z + z;\n\n let xx = x * x2;\n let xy = x * y2;\n let xz = x * z2;\n let yy = y * y2;\n let yz = y * z2;\n let zz = z * z2;\n let wx = w * x2;\n let wy = w * y2;\n let wz = w * z2;\n\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n\n return out;\n}\n\n/**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @param {vec3} out Vector to receive translation component\n * @param {mat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\nexport function getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n\n return out;\n}\n\n/**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion paramter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @param {vec3} out Vector to receive scaling factor component\n * @param {mat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\nexport function getScaling(out, mat) {\n let m11 = mat[0];\n let m12 = mat[1];\n let m13 = mat[2];\n let m21 = mat[4];\n let m22 = mat[5];\n let m23 = mat[6];\n let m31 = mat[8];\n let m32 = mat[9];\n let m33 = mat[10];\n\n out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n\n return out;\n}\n\n/**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @param {quat} out Quaternion to receive the rotation component\n * @param {mat4} mat Matrix to be decomposed (input)\n * @return {quat} out\n */\nexport function getRotation(out, mat) {\n // Algorithm taken from http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n let trace = mat[0] + mat[5] + mat[10];\n let S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (mat[6] - mat[9]) / S;\n out[1] = (mat[8] - mat[2]) / S;\n out[2] = (mat[1] - mat[4]) / S;\n } else if ((mat[0] > mat[5])&(mat[0] > mat[10])) {\n S = Math.sqrt(1.0 + mat[0] - mat[5] - mat[10]) * 2;\n out[3] = (mat[6] - mat[9]) / S;\n out[0] = 0.25 * S;\n out[1] = (mat[1] + mat[4]) / S;\n out[2] = (mat[8] + mat[2]) / S;\n } else if (mat[5] > mat[10]) {\n S = Math.sqrt(1.0 + mat[5] - mat[0] - mat[10]) * 2;\n out[3] = (mat[8] - mat[2]) / S;\n out[0] = (mat[1] + mat[4]) / S;\n out[1] = 0.25 * S;\n out[2] = (mat[6] + mat[9]) / S;\n } else {\n S = Math.sqrt(1.0 + mat[10] - mat[0] - mat[5]) * 2;\n out[3] = (mat[1] - mat[4]) / S;\n out[0] = (mat[8] + mat[2]) / S;\n out[1] = (mat[6] + mat[9]) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {vec3} v Translation vector\n * @param {vec3} s Scaling vector\n * @returns {mat4} out\n */\nexport function fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n let x = q[0], y = q[1], z = q[2], w = q[3];\n let x2 = x + x;\n let y2 = y + y;\n let z2 = z + z;\n\n let xx = x * x2;\n let xy = x * y2;\n let xz = x * z2;\n let yy = y * y2;\n let yz = y * z2;\n let zz = z * z2;\n let wx = w * x2;\n let wy = w * y2;\n let wz = w * z2;\n let sx = s[0];\n let sy = s[1];\n let sz = s[2];\n\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n\n return out;\n}\n\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {vec3} v Translation vector\n * @param {vec3} s Scaling vector\n * @param {vec3} o The origin vector around which to scale and rotate\n * @returns {mat4} out\n */\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n let x = q[0], y = q[1], z = q[2], w = q[3];\n let x2 = x + x;\n let y2 = y + y;\n let z2 = z + z;\n\n let xx = x * x2;\n let xy = x * y2;\n let xz = x * z2;\n let yy = y * y2;\n let yz = y * z2;\n let zz = z * z2;\n let wx = w * x2;\n let wy = w * y2;\n let wz = w * z2;\n\n let sx = s[0];\n let sy = s[1];\n let sz = s[2];\n\n let ox = o[0];\n let oy = o[1];\n let oz = o[2];\n\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0] + ox - (out[0] * ox + out[4] * oy + out[8] * oz);\n out[13] = v[1] + oy - (out[1] * ox + out[5] * oy + out[9] * oz);\n out[14] = v[2] + oz - (out[2] * ox + out[6] * oy + out[10] * oz);\n out[15] = 1;\n\n return out;\n}\n\n/**\n * Calculates a 4x4 matrix from the given quaternion\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat} q Quaternion to create matrix from\n *\n * @returns {mat4} out\n */\nexport function fromQuat(out, q) {\n let x = q[0], y = q[1], z = q[2], w = q[3];\n let x2 = x + x;\n let y2 = y + y;\n let z2 = z + z;\n\n let xx = x * x2;\n let yx = y * x2;\n let yy = y * y2;\n let zx = z * x2;\n let zy = z * y2;\n let zz = z * z2;\n let wx = w * x2;\n let wy = w * y2;\n let wz = w * z2;\n\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n\n return out;\n}\n\n/**\n * Generates a frustum matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Number} left Left bound of the frustum\n * @param {Number} right Right bound of the frustum\n * @param {Number} bottom Bottom bound of the frustum\n * @param {Number} top Top bound of the frustum\n * @param {Number} near Near bound of the frustum\n * @param {Number} far Far bound of the frustum\n * @returns {mat4} out\n */\nexport function frustum(out, left, right, bottom, top, near, far) {\n let rl = 1 / (right - left);\n let tb = 1 / (top - bottom);\n let nf = 1 / (near - far);\n out[0] = (near * 2) * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = (near * 2) * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = (far * near * 2) * nf;\n out[15] = 0;\n return out;\n}\n\n/**\n * Generates a perspective projection matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\nexport function perspective(out, fovy, aspect, near, far) {\n let f = 1.0 / Math.tan(fovy / 2);\n let nf = 1 / (near - far);\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = (2 * far * near) * nf;\n out[15] = 0;\n return out;\n}\n\n/**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n let upTan = Math.tan(fov.upDegrees * Math.PI/180.0);\n let downTan = Math.tan(fov.downDegrees * Math.PI/180.0);\n let leftTan = Math.tan(fov.leftDegrees * Math.PI/180.0);\n let rightTan = Math.tan(fov.rightDegrees * Math.PI/180.0);\n let xScale = 2.0 / (leftTan + rightTan);\n let yScale = 2.0 / (upTan + downTan);\n\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = ((upTan - downTan) * yScale * 0.5);\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = (far * near) / (near - far);\n out[15] = 0.0;\n return out;\n}\n\n/**\n * Generates a orthogonal projection matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\nexport function ortho(out, left, right, bottom, top, near, far) {\n let lr = 1 / (left - right);\n let bt = 1 / (bottom - top);\n let nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n\n/**\n * Generates a look-at matrix with the given eye position, focal point, and up axis\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {vec3} eye Position of the viewer\n * @param {vec3} center Point the viewer is looking at\n * @param {vec3} up vec3 pointing up\n * @returns {mat4} out\n */\nexport function lookAt(out, eye, center, up) {\n let x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n let eyex = eye[0];\n let eyey = eye[1];\n let eyez = eye[2];\n let upx = up[0];\n let upy = up[1];\n let upz = up[2];\n let centerx = center[0];\n let centery = center[1];\n let centerz = center[2];\n\n if (Math.abs(eyex - centerx) < glMatrix.EPSILON &&\n Math.abs(eyey - centery) < glMatrix.EPSILON &&\n Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n return mat4.identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n\n len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n\n return out;\n}\n\n/**\n * Generates a matrix that makes something look at something else.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {vec3} eye Position of the viewer\n * @param {vec3} center Point the viewer is looking at\n * @param {vec3} up vec3 pointing up\n * @returns {mat4} out\n */\nexport function targetTo(out, eye, target, up) {\n let eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n\n let z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n\n let len = z0*z0 + z1*z1 + z2*z2;\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n let x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n};\n\n/**\n * Returns a string representation of a mat4\n *\n * @param {mat4} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\nexport function str(a) {\n return 'mat4(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ', ' +\n a[4] + ', ' + a[5] + ', ' + a[6] + ', ' + a[7] + ', ' +\n a[8] + ', ' + a[9] + ', ' + a[10] + ', ' + a[11] + ', ' +\n a[12] + ', ' + a[13] + ', ' + a[14] + ', ' + a[15] + ')';\n}\n\n/**\n * Returns Frobenius norm of a mat4\n *\n * @param {mat4} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\nexport function frob(a) {\n return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2) + Math.pow(a[9], 2) + Math.pow(a[10], 2) + Math.pow(a[11], 2) + Math.pow(a[12], 2) + Math.pow(a[13], 2) + Math.pow(a[14], 2) + Math.pow(a[15], 2) ))\n}\n\n/**\n * Adds two mat4's\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the first operand\n * @param {mat4} b the second operand\n * @returns {mat4} out\n */\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the first operand\n * @param {mat4} b the second operand\n * @returns {mat4} out\n */\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat4} out\n */\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n\n/**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat4} out the receiving vector\n * @param {mat4} a the first operand\n * @param {mat4} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat4} out\n */\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + (b[0] * scale);\n out[1] = a[1] + (b[1] * scale);\n out[2] = a[2] + (b[2] * scale);\n out[3] = a[3] + (b[3] * scale);\n out[4] = a[4] + (b[4] * scale);\n out[5] = a[5] + (b[5] * scale);\n out[6] = a[6] + (b[6] * scale);\n out[7] = a[7] + (b[7] * scale);\n out[8] = a[8] + (b[8] * scale);\n out[9] = a[9] + (b[9] * scale);\n out[10] = a[10] + (b[10] * scale);\n out[11] = a[11] + (b[11] * scale);\n out[12] = a[12] + (b[12] * scale);\n out[13] = a[13] + (b[13] * scale);\n out[14] = a[14] + (b[14] * scale);\n out[15] = a[15] + (b[15] * scale);\n return out;\n}\n\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {mat4} a The first matrix.\n * @param {mat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] &&\n a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] &&\n a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] &&\n a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {mat4} a The first matrix.\n * @param {mat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function equals(a, b) {\n let a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n let a4 = a[4], a5 = a[5], a6 = a[6], a7 = a[7];\n let a8 = a[8], a9 = a[9], a10 = a[10], a11 = a[11];\n let a12 = a[12], a13 = a[13], a14 = a[14], a15 = a[15];\n\n let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];\n let b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7];\n let b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11];\n let b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15];\n\n return (Math.abs(a0 - b0) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\n Math.abs(a1 - b1) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a1), Math.abs(b1)) &&\n Math.abs(a2 - b2) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a2), Math.abs(b2)) &&\n Math.abs(a3 - b3) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a3), Math.abs(b3)) &&\n Math.abs(a4 - b4) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a4), Math.abs(b4)) &&\n Math.abs(a5 - b5) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a5), Math.abs(b5)) &&\n Math.abs(a6 - b6) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a6), Math.abs(b6)) &&\n Math.abs(a7 - b7) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a7), Math.abs(b7)) &&\n Math.abs(a8 - b8) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a8), Math.abs(b8)) &&\n Math.abs(a9 - b9) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a9), Math.abs(b9)) &&\n Math.abs(a10 - b10) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a10), Math.abs(b10)) &&\n Math.abs(a11 - b11) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a11), Math.abs(b11)) &&\n Math.abs(a12 - b12) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a12), Math.abs(b12)) &&\n Math.abs(a13 - b13) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a13), Math.abs(b13)) &&\n Math.abs(a14 - b14) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a14), Math.abs(b14)) &&\n Math.abs(a15 - b15) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a15), Math.abs(b15)));\n}\n\n/**\n * Alias for {@link mat4.multiply}\n * @function\n */\nexport const mul = multiply;\n\n/**\n * Alias for {@link mat4.subtract}\n * @function\n */\nexport const sub = subtract;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-matrix/src/gl-matrix/mat4.js\n// module id = 22\n// module chunks = 0","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nimport * as glMatrix from \"./common\"\nimport * as mat3 from \"./mat3\"\nimport * as vec3 from \"./vec3\"\nimport * as vec4 from \"./vec4\"\n\n/**\n * Quaternion\n * @module quat\n */\n\n/**\n * Creates a new identity quat\n *\n * @returns {quat} a new quaternion\n */\nexport function create() {\n let out = new glMatrix.ARRAY_TYPE(4);\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n\n/**\n * Set a quat to the identity quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\nexport function identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n\n/**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n *\n * @param {quat} out the receiving quaternion\n * @param {vec3} axis the axis around which to rotate\n * @param {Number} rad the angle in radians\n * @returns {quat} out\n **/\nexport function setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n let s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n\n/**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as providied in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @param {vec3} out_axis Vector receiving the axis of rotation\n * @param {quat} q Quaternion to be decomposed\n * @return {Number} Angle, in radians, of the rotation\n */\nexport function getAxisAngle(out_axis, q) {\n let rad = Math.acos(q[3]) * 2.0;\n let s = Math.sin(rad / 2.0);\n if (s != 0.0) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n return rad;\n}\n\n/**\n * Multiplies two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a the first operand\n * @param {quat} b the second operand\n * @returns {quat} out\n */\nexport function multiply(out, a, b) {\n let ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n\n/**\n * Rotates a quaternion by the given angle about the X axis\n *\n * @param {quat} out quat receiving operation result\n * @param {quat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\nexport function rotateX(out, a, rad) {\n rad *= 0.5;\n\n let ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = Math.sin(rad), bw = Math.cos(rad);\n\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n\n/**\n * Rotates a quaternion by the given angle about the Y axis\n *\n * @param {quat} out quat receiving operation result\n * @param {quat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\nexport function rotateY(out, a, rad) {\n rad *= 0.5;\n\n let ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let by = Math.sin(rad), bw = Math.cos(rad);\n\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n\n/**\n * Rotates a quaternion by the given angle about the Z axis\n *\n * @param {quat} out quat receiving operation result\n * @param {quat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\nexport function rotateZ(out, a, rad) {\n rad *= 0.5;\n\n let ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bz = Math.sin(rad), bw = Math.cos(rad);\n\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n\n/**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a quat to calculate W component of\n * @returns {quat} out\n */\nexport function calculateW(out, a) {\n let x = a[0], y = a[1], z = a[2];\n\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n\n/**\n * Performs a spherical linear interpolation between two quat\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a the first operand\n * @param {quat} b the second operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {quat} out\n */\nexport function slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n let ax = a[0], ay = a[1], az = a[2], aw = a[3];\n let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n\n let omega, cosom, sinom, scale0, scale1;\n\n // calc cosine\n cosom = ax * bx + ay * by + az * bz + aw * bw;\n // adjust signs (if necessary)\n if ( cosom < 0.0 ) {\n cosom = -cosom;\n bx = - bx;\n by = - by;\n bz = - bz;\n bw = - bw;\n }\n // calculate coefficients\n if ( (1.0 - cosom) > 0.000001 ) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n }\n // calculate final values\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n\n return out;\n}\n\n/**\n * Calculates the inverse of a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a quat to calculate inverse of\n * @returns {quat} out\n */\nexport function invert(out, a) {\n let a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];\n let dot = a0*a0 + a1*a1 + a2*a2 + a3*a3;\n let invDot = dot ? 1.0/dot : 0;\n\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0*invDot;\n out[1] = -a1*invDot;\n out[2] = -a2*invDot;\n out[3] = a3*invDot;\n return out;\n}\n\n/**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a quat to calculate conjugate of\n * @returns {quat} out\n */\nexport function conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n\n/**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n *\n * @param {quat} out the receiving quaternion\n * @param {mat3} m rotation matrix\n * @returns {quat} out\n * @function\n */\nexport function fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n let fTrace = m[0] + m[4] + m[8];\n let fRoot;\n\n if ( fTrace > 0.0 ) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n out[3] = 0.5 * fRoot;\n fRoot = 0.5/fRoot; // 1/(4w)\n out[0] = (m[5]-m[7])*fRoot;\n out[1] = (m[6]-m[2])*fRoot;\n out[2] = (m[1]-m[3])*fRoot;\n } else {\n // |w| <= 1/2\n let i = 0;\n if ( m[4] > m[0] )\n i = 1;\n if ( m[8] > m[i*3+i] )\n i = 2;\n let j = (i+1)%3;\n let k = (i+2)%3;\n\n fRoot = Math.sqrt(m[i*3+i]-m[j*3+j]-m[k*3+k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j*3+k] - m[k*3+j]) * fRoot;\n out[j] = (m[j*3+i] + m[i*3+j]) * fRoot;\n out[k] = (m[k*3+i] + m[i*3+k]) * fRoot;\n }\n\n return out;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z.\n *\n * @param {quat} out the receiving quaternion\n * @param {x} Angle to rotate around X axis in degrees.\n * @param {y} Angle to rotate around Y axis in degrees.\n * @param {z} Angle to rotate around Z axis in degrees.\n * @returns {quat} out\n * @function\n */\nexport function fromEuler(out, x, y, z) {\n let halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n\n let sx = Math.sin(x);\n let cx = Math.cos(x);\n let sy = Math.sin(y);\n let cy = Math.cos(y);\n let sz = Math.sin(z);\n let cz = Math.cos(z);\n\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n\n return out;\n}\n\n/**\n * Returns a string representation of a quatenion\n *\n * @param {quat} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\nexport function str(a) {\n return 'quat(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')';\n}\n\n/**\n * Creates a new quat initialized with values from an existing quaternion\n *\n * @param {quat} a quaternion to clone\n * @returns {quat} a new quaternion\n * @function\n */\nexport const clone = vec4.clone;\n\n/**\n * Creates a new quat initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} a new quaternion\n * @function\n */\nexport const fromValues = vec4.fromValues;\n\n/**\n * Copy the values from one quat to another\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a the source quaternion\n * @returns {quat} out\n * @function\n */\nexport const copy = vec4.copy;\n\n/**\n * Set the components of a quat to the given values\n *\n * @param {quat} out the receiving quaternion\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} out\n * @function\n */\nexport const set = vec4.set;\n\n/**\n * Adds two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a the first operand\n * @param {quat} b the second operand\n * @returns {quat} out\n * @function\n */\nexport const add = vec4.add;\n\n/**\n * Alias for {@link quat.multiply}\n * @function\n */\nexport const mul = multiply;\n\n/**\n * Scales a quat by a scalar number\n *\n * @param {quat} out the receiving vector\n * @param {quat} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {quat} out\n * @function\n */\nexport const scale = vec4.scale;\n\n/**\n * Calculates the dot product of two quat's\n *\n * @param {quat} a the first operand\n * @param {quat} b the second operand\n * @returns {Number} dot product of a and b\n * @function\n */\nexport const dot = vec4.dot;\n\n/**\n * Performs a linear interpolation between two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a the first operand\n * @param {quat} b the second operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {quat} out\n * @function\n */\nexport const lerp = vec4.lerp;\n\n/**\n * Calculates the length of a quat\n *\n * @param {quat} a vector to calculate length of\n * @returns {Number} length of a\n */\nexport const length = vec4.length;\n\n/**\n * Alias for {@link quat.length}\n * @function\n */\nexport const len = length;\n\n/**\n * Calculates the squared length of a quat\n *\n * @param {quat} a vector to calculate squared length of\n * @returns {Number} squared length of a\n * @function\n */\nexport const squaredLength = vec4.squaredLength;\n\n/**\n * Alias for {@link quat.squaredLength}\n * @function\n */\nexport const sqrLen = squaredLength;\n\n/**\n * Normalize a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a quaternion to normalize\n * @returns {quat} out\n * @function\n */\nexport const normalize = vec4.normalize;\n\n/**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n *\n * @param {quat} a The first quaternion.\n * @param {quat} b The second quaternion.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport const exactEquals = vec4.exactEquals;\n\n/**\n * Returns whether or not the quaternions have approximately the same elements in the same position.\n *\n * @param {quat} a The first vector.\n * @param {quat} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport const equals = vec4.equals;\n\n/**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n *\n * @param {quat} out the receiving quaternion.\n * @param {vec3} a the initial vector\n * @param {vec3} b the destination vector\n * @returns {quat} out\n */\nexport const rotationTo = (function() {\n let tmpvec3 = vec3.create();\n let xUnitVec3 = vec3.fromValues(1,0,0);\n let yUnitVec3 = vec3.fromValues(0,1,0);\n\n return function(out, a, b) {\n let dot = vec3.dot(a, b);\n if (dot < -0.999999) {\n vec3.cross(tmpvec3, xUnitVec3, a);\n if (vec3.len(tmpvec3) < 0.000001)\n vec3.cross(tmpvec3, yUnitVec3, a);\n vec3.normalize(tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n vec3.cross(tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n})();\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a the first operand\n * @param {quat} b the second operand\n * @param {quat} c the third operand\n * @param {quat} d the fourth operand\n * @param {Number} t interpolation amount\n * @returns {quat} out\n */\nexport const sqlerp = (function () {\n let temp1 = create();\n let temp2 = create();\n\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n\n return out;\n };\n}());\n\n/**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n *\n * @param {vec3} view the vector representing the viewing direction\n * @param {vec3} right the vector representing the local \"right\" direction\n * @param {vec3} up the vector representing the local \"up\" direction\n * @returns {quat} out\n */\nexport const setAxes = (function() {\n let matr = mat3.create();\n\n return function(out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n\n return normalize(out, fromMat3(out, matr));\n };\n})();\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-matrix/src/gl-matrix/quat.js\n// module id = 23\n// module chunks = 0","/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n\nimport * as glMatrix from \"./common\";\n\n/**\n * 2 Dimensional Vector\n * @module vec2\n */\n\n/**\n * Creates a new, empty vec2\n *\n * @returns {vec2} a new 2D vector\n */\nexport function create() {\n let out = new glMatrix.ARRAY_TYPE(2);\n out[0] = 0;\n out[1] = 0;\n return out;\n}\n\n/**\n * Creates a new vec2 initialized with values from an existing vector\n *\n * @param {vec2} a vector to clone\n * @returns {vec2} a new 2D vector\n */\nexport function clone(a) {\n let out = new glMatrix.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n\n/**\n * Creates a new vec2 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} a new 2D vector\n */\nexport function fromValues(x, y) {\n let out = new glMatrix.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n\n/**\n * Copy the values from one vec2 to another\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the source vector\n * @returns {vec2} out\n */\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n\n/**\n * Set the components of a vec2 to the given values\n *\n * @param {vec2} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} out\n */\nexport function set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n\n/**\n * Adds two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n\n/**\n * Multiplies two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nexport function multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n};\n\n/**\n * Divides two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nexport function divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n};\n\n/**\n * Math.ceil the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to ceil\n * @returns {vec2} out\n */\nexport function ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n};\n\n/**\n * Math.floor the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to floor\n * @returns {vec2} out\n */\nexport function floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n};\n\n/**\n * Returns the minimum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nexport function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n};\n\n/**\n * Returns the maximum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nexport function max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n};\n\n/**\n * Math.round the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to round\n * @returns {vec2} out\n */\nexport function round (out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n};\n\n/**\n * Scales a vec2 by a scalar number\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec2} out\n */\nexport function scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n};\n\n/**\n * Adds two vec2's after scaling the second operand by a scalar value\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec2} out\n */\nexport function scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + (b[0] * scale);\n out[1] = a[1] + (b[1] * scale);\n return out;\n};\n\n/**\n * Calculates the euclidian distance between two vec2's\n *\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {Number} distance between a and b\n */\nexport function distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.sqrt(x*x + y*y);\n};\n\n/**\n * Calculates the squared euclidian distance between two vec2's\n *\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {Number} squared distance between a and b\n */\nexport function squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x*x + y*y;\n};\n\n/**\n * Calculates the length of a vec2\n *\n * @param {vec2} a vector to calculate length of\n * @returns {Number} length of a\n */\nexport function length(a) {\n var x = a[0],\n y = a[1];\n return Math.sqrt(x*x + y*y);\n};\n\n/**\n * Calculates the squared length of a vec2\n *\n * @param {vec2} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\nexport function squaredLength (a) {\n var x = a[0],\n y = a[1];\n return x*x + y*y;\n};\n\n/**\n * Negates the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to negate\n * @returns {vec2} out\n */\nexport function negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n};\n\n/**\n * Returns the inverse of the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to invert\n * @returns {vec2} out\n */\nexport function inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n};\n\n/**\n * Normalize a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to normalize\n * @returns {vec2} out\n */\nexport function normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x*x + y*y;\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n }\n return out;\n};\n\n/**\n * Calculates the dot product of two vec2's\n *\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {Number} dot product of a and b\n */\nexport function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n};\n\n/**\n * Computes the cross product of two vec2's\n * Note that the cross product must by definition produce a 3D vector\n *\n * @param {vec3} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec3} out\n */\nexport function cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n};\n\n/**\n * Performs a linear interpolation between two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {vec2} out\n */\nexport function lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n};\n\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec2} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec2} out\n */\nexport function random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n};\n\n/**\n * Transforms the vec2 with a mat2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to transform\n * @param {mat2} m matrix to transform with\n * @returns {vec2} out\n */\nexport function transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n};\n\n/**\n * Transforms the vec2 with a mat2d\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to transform\n * @param {mat2d} m matrix to transform with\n * @returns {vec2} out\n */\nexport function transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n};\n\n/**\n * Transforms the vec2 with a mat3\n * 3rd vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to transform\n * @param {mat3} m matrix to transform with\n * @returns {vec2} out\n */\nexport function transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n};\n\n/**\n * Transforms the vec2 with a mat4\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to transform\n * @param {mat4} m matrix to transform with\n * @returns {vec2} out\n */\nexport function transformMat4(out, a, m) {\n let x = a[0];\n let y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n\n/**\n * Returns a string representation of a vector\n *\n * @param {vec2} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\nexport function str(a) {\n return 'vec2(' + a[0] + ', ' + a[1] + ')';\n}\n\n/**\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\n *\n * @param {vec2} a The first vector.\n * @param {vec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {vec2} a The first vector.\n * @param {vec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function equals(a, b) {\n let a0 = a[0], a1 = a[1];\n let b0 = b[0], b1 = b[1];\n return (Math.abs(a0 - b0) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\n Math.abs(a1 - b1) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a1), Math.abs(b1)));\n}\n\n/**\n * Alias for {@link vec2.length}\n * @function\n */\nexport const len = length;\n\n/**\n * Alias for {@link vec2.subtract}\n * @function\n */\nexport const sub = subtract;\n\n/**\n * Alias for {@link vec2.multiply}\n * @function\n */\nexport const mul = multiply;\n\n/**\n * Alias for {@link vec2.divide}\n * @function\n */\nexport const div = divide;\n\n/**\n * Alias for {@link vec2.distance}\n * @function\n */\nexport const dist = distance;\n\n/**\n * Alias for {@link vec2.squaredDistance}\n * @function\n */\nexport const sqrDist = squaredDistance;\n\n/**\n * Alias for {@link vec2.squaredLength}\n * @function\n */\nexport const sqrLen = squaredLength;\n\n/**\n * Perform some operation over an array of vec2s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\nexport const forEach = (function() {\n let vec = create();\n\n return function(a, stride, offset, count, fn, arg) {\n let i, l;\n if(!stride) {\n stride = 2;\n }\n\n if(!offset) {\n offset = 0;\n }\n\n if(count) {\n l = Math.min((count * stride) + offset, a.length);\n } else {\n l = a.length;\n }\n\n for(i = offset; i < l; i += stride) {\n vec[0] = a[i]; vec[1] = a[i+1];\n fn(vec, vec, arg);\n a[i] = vec[0]; a[i+1] = vec[1];\n }\n\n return a;\n };\n})();\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-matrix/src/gl-matrix/vec2.js\n// module id = 24\n// module chunks = 0","// stats.js - http://github.com/mrdoob/stats.js\nvar Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement(\"div\");f.id=\"stats\";f.addEventListener(\"mousedown\",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText=\"width:80px;opacity:0.9;cursor:pointer\";var a=document.createElement(\"div\");a.id=\"fps\";a.style.cssText=\"padding:0 0 3px 3px;text-align:left;background-color:#002\";f.appendChild(a);var i=document.createElement(\"div\");i.id=\"fpsText\";i.style.cssText=\"color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px\";\ni.innerHTML=\"FPS\";a.appendChild(i);var c=document.createElement(\"div\");c.id=\"fpsGraph\";c.style.cssText=\"position:relative;width:74px;height:30px;background-color:#0ff\";for(a.appendChild(c);74>c.children.length;){var j=document.createElement(\"span\");j.style.cssText=\"width:1px;height:30px;float:left;background-color:#113\";c.appendChild(j)}var d=document.createElement(\"div\");d.id=\"ms\";d.style.cssText=\"padding:0 0 3px 3px;text-align:left;background-color:#020;display:none\";f.appendChild(d);var k=document.createElement(\"div\");\nk.id=\"msText\";k.style.cssText=\"color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px\";k.innerHTML=\"MS\";d.appendChild(k);var e=document.createElement(\"div\");e.id=\"msGraph\";e.style.cssText=\"position:relative;width:74px;height:30px;background-color:#0f0\";for(d.appendChild(e);74>e.children.length;)j=document.createElement(\"span\"),j.style.cssText=\"width:1px;height:30px;float:left;background-color:#131\",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display=\n\"block\";d.style.display=\"none\";break;case 1:a.style.display=\"none\",d.style.display=\"block\"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+\" MS (\"+n+\"-\"+o+\")\";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+\"px\";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+\" FPS (\"+p+\"-\"+q+\")\",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height=\na+\"px\",m=b,r=0);return b},update:function(){l=this.end()}}};\"object\"===typeof module&&(module.exports=Stats);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/stats-js/build/stats.min.js\n// module id = 25\n// module chunks = 0","module.exports = require('./vendor/dat.gui')\nmodule.exports.color = require('./vendor/dat.color')\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dat-gui/index.js\n// module id = 26\n// module chunks = 0","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n/** @namespace */\nvar dat = module.exports = dat || {};\n\n/** @namespace */\ndat.gui = dat.gui || {};\n\n/** @namespace */\ndat.utils = dat.utils || {};\n\n/** @namespace */\ndat.controllers = dat.controllers || {};\n\n/** @namespace */\ndat.dom = dat.dom || {};\n\n/** @namespace */\ndat.color = dat.color || {};\n\ndat.utils.css = (function () {\n return {\n load: function (url, doc) {\n doc = doc || document;\n var link = doc.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = url;\n doc.getElementsByTagName('head')[0].appendChild(link);\n },\n inject: function(css, doc) {\n doc = doc || document;\n var injected = document.createElement('style');\n injected.type = 'text/css';\n injected.innerHTML = css;\n doc.getElementsByTagName('head')[0].appendChild(injected);\n }\n }\n})();\n\n\ndat.utils.common = (function () {\n \n var ARR_EACH = Array.prototype.forEach;\n var ARR_SLICE = Array.prototype.slice;\n\n /**\n * Band-aid methods for things that should be a lot easier in JavaScript.\n * Implementation and structure inspired by underscore.js\n * http://documentcloud.github.com/underscore/\n */\n\n return { \n \n BREAK: {},\n \n extend: function(target) {\n \n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n \n for (var key in obj)\n if (!this.isUndefined(obj[key])) \n target[key] = obj[key];\n \n }, this);\n \n return target;\n \n },\n \n defaults: function(target) {\n \n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n \n for (var key in obj)\n if (this.isUndefined(target[key])) \n target[key] = obj[key];\n \n }, this);\n \n return target;\n \n },\n \n compose: function() {\n var toCall = ARR_SLICE.call(arguments);\n return function() {\n var args = ARR_SLICE.call(arguments);\n for (var i = toCall.length -1; i >= 0; i--) {\n args = [toCall[i].apply(this, args)];\n }\n return args[0];\n }\n },\n \n each: function(obj, itr, scope) {\n\n \n if (ARR_EACH && obj.forEach === ARR_EACH) { \n \n obj.forEach(itr, scope);\n \n } else if (obj.length === obj.length + 0) { // Is number but not NaN\n \n for (var key = 0, l = obj.length; key < l; key++)\n if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) \n return;\n \n } else {\n\n for (var key in obj) \n if (itr.call(scope, obj[key], key) === this.BREAK)\n return;\n \n }\n \n },\n \n defer: function(fnc) {\n setTimeout(fnc, 0);\n },\n \n toArray: function(obj) {\n if (obj.toArray) return obj.toArray();\n return ARR_SLICE.call(obj);\n },\n\n isUndefined: function(obj) {\n return obj === undefined;\n },\n \n isNull: function(obj) {\n return obj === null;\n },\n \n isNaN: function(obj) {\n return obj !== obj;\n },\n \n isArray: Array.isArray || function(obj) {\n return obj.constructor === Array;\n },\n \n isObject: function(obj) {\n return obj === Object(obj);\n },\n \n isNumber: function(obj) {\n return obj === obj+0;\n },\n \n isString: function(obj) {\n return obj === obj+'';\n },\n \n isBoolean: function(obj) {\n return obj === false || obj === true;\n },\n \n isFunction: function(obj) {\n return Object.prototype.toString.call(obj) === '[object Function]';\n }\n \n };\n \n})();\n\n\ndat.controllers.Controller = (function (common) {\n\n /**\n * @class An \"abstract\" class that represents a given property of an object.\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n *\n * @member dat.controllers\n */\n var Controller = function(object, property) {\n\n this.initialValue = object[property];\n\n /**\n * Those who extend this class will put their DOM elements in here.\n * @type {DOMElement}\n */\n this.domElement = document.createElement('div');\n\n /**\n * The object to manipulate\n * @type {Object}\n */\n this.object = object;\n\n /**\n * The name of the property to manipulate\n * @type {String}\n */\n this.property = property;\n\n /**\n * The function to be called on change.\n * @type {Function}\n * @ignore\n */\n this.__onChange = undefined;\n\n /**\n * The function to be called on finishing change.\n * @type {Function}\n * @ignore\n */\n this.__onFinishChange = undefined;\n\n };\n\n common.extend(\n\n Controller.prototype,\n\n /** @lends dat.controllers.Controller.prototype */\n {\n\n /**\n * Specify that a function fire every time someone changes the value with\n * this Controller.\n *\n * @param {Function} fnc This function will be called whenever the value\n * is modified via this Controller.\n * @returns {dat.controllers.Controller} this\n */\n onChange: function(fnc) {\n this.__onChange = fnc;\n return this;\n },\n\n /**\n * Specify that a function fire every time someone \"finishes\" changing\n * the value wih this Controller. Useful for values that change\n * incrementally like numbers or strings.\n *\n * @param {Function} fnc This function will be called whenever\n * someone \"finishes\" changing the value via this Controller.\n * @returns {dat.controllers.Controller} this\n */\n onFinishChange: function(fnc) {\n this.__onFinishChange = fnc;\n return this;\n },\n\n /**\n * Change the value of <code>object[property]</code>\n *\n * @param {Object} newValue The new value of <code>object[property]</code>\n */\n setValue: function(newValue) {\n this.object[this.property] = newValue;\n if (this.__onChange) {\n this.__onChange.call(this, newValue);\n }\n this.updateDisplay();\n return this;\n },\n\n /**\n * Gets the value of <code>object[property]</code>\n *\n * @returns {Object} The current value of <code>object[property]</code>\n */\n getValue: function() {\n return this.object[this.property];\n },\n\n /**\n * Refreshes the visual display of a Controller in order to keep sync\n * with the object's current value.\n * @returns {dat.controllers.Controller} this\n */\n updateDisplay: function() {\n return this;\n },\n\n /**\n * @returns {Boolean} true if the value has deviated from initialValue\n */\n isModified: function() {\n return this.initialValue !== this.getValue()\n }\n\n }\n\n );\n\n return Controller;\n\n\n})(dat.utils.common);\n\n\ndat.dom.dom = (function (common) {\n\n var EVENT_MAP = {\n 'HTMLEvents': ['change'],\n 'MouseEvents': ['click','mousemove','mousedown','mouseup', 'mouseover'],\n 'KeyboardEvents': ['keydown']\n };\n\n var EVENT_MAP_INV = {};\n common.each(EVENT_MAP, function(v, k) {\n common.each(v, function(e) {\n EVENT_MAP_INV[e] = k;\n });\n });\n\n var CSS_VALUE_PIXELS = /(\\d+(\\.\\d+)?)px/;\n\n function cssValueToPixels(val) {\n\n if (val === '0' || common.isUndefined(val)) return 0;\n\n var match = val.match(CSS_VALUE_PIXELS);\n\n if (!common.isNull(match)) {\n return parseFloat(match[1]);\n }\n\n // TODO ...ems? %?\n\n return 0;\n\n }\n\n /**\n * @namespace\n * @member dat.dom\n */\n var dom = {\n\n /**\n * \n * @param elem\n * @param selectable\n */\n makeSelectable: function(elem, selectable) {\n\n if (elem === undefined || elem.style === undefined) return;\n\n elem.onselectstart = selectable ? function() {\n return false;\n } : function() {\n };\n\n elem.style.MozUserSelect = selectable ? 'auto' : 'none';\n elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none';\n elem.unselectable = selectable ? 'on' : 'off';\n\n },\n\n /**\n *\n * @param elem\n * @param horizontal\n * @param vertical\n */\n makeFullscreen: function(elem, horizontal, vertical) {\n\n if (common.isUndefined(horizontal)) horizontal = true;\n if (common.isUndefined(vertical)) vertical = true;\n\n elem.style.position = 'absolute';\n\n if (horizontal) {\n elem.style.left = 0;\n elem.style.right = 0;\n }\n if (vertical) {\n elem.style.top = 0;\n elem.style.bottom = 0;\n }\n\n },\n\n /**\n *\n * @param elem\n * @param eventType\n * @param params\n */\n fakeEvent: function(elem, eventType, params, aux) {\n params = params || {};\n var className = EVENT_MAP_INV[eventType];\n if (!className) {\n throw new Error('Event type ' + eventType + ' not supported.');\n }\n var evt = document.createEvent(className);\n switch (className) {\n case 'MouseEvents':\n var clientX = params.x || params.clientX || 0;\n var clientY = params.y || params.clientY || 0;\n evt.initMouseEvent(eventType, params.bubbles || false,\n params.cancelable || true, window, params.clickCount || 1,\n 0, //screen X\n 0, //screen Y\n clientX, //client X\n clientY, //client Y\n false, false, false, false, 0, null);\n break;\n case 'KeyboardEvents':\n var init = evt.initKeyboardEvent || evt.initKeyEvent; // webkit || moz\n common.defaults(params, {\n cancelable: true,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n keyCode: undefined,\n charCode: undefined\n });\n init(eventType, params.bubbles || false,\n params.cancelable, window,\n params.ctrlKey, params.altKey,\n params.shiftKey, params.metaKey,\n params.keyCode, params.charCode);\n break;\n default:\n evt.initEvent(eventType, params.bubbles || false,\n params.cancelable || true);\n break;\n }\n common.defaults(evt, aux);\n elem.dispatchEvent(evt);\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n bind: function(elem, event, func, bool) {\n bool = bool || false;\n if (elem.addEventListener)\n elem.addEventListener(event, func, bool);\n else if (elem.attachEvent)\n elem.attachEvent('on' + event, func);\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n unbind: function(elem, event, func, bool) {\n bool = bool || false;\n if (elem.removeEventListener)\n elem.removeEventListener(event, func, bool);\n else if (elem.detachEvent)\n elem.detachEvent('on' + event, func);\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n addClass: function(elem, className) {\n if (elem.className === undefined) {\n elem.className = className;\n } else if (elem.className !== className) {\n var classes = elem.className.split(/ +/);\n if (classes.indexOf(className) == -1) {\n classes.push(className);\n elem.className = classes.join(' ').replace(/^\\s+/, '').replace(/\\s+$/, '');\n }\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n removeClass: function(elem, className) {\n if (className) {\n if (elem.className === undefined) {\n // elem.className = className;\n } else if (elem.className === className) {\n elem.removeAttribute('class');\n } else {\n var classes = elem.className.split(/ +/);\n var index = classes.indexOf(className);\n if (index != -1) {\n classes.splice(index, 1);\n elem.className = classes.join(' ');\n }\n }\n } else {\n elem.className = undefined;\n }\n return dom;\n },\n\n hasClass: function(elem, className) {\n return new RegExp('(?:^|\\\\s+)' + className + '(?:\\\\s+|$)').test(elem.className) || false;\n },\n\n /**\n *\n * @param elem\n */\n getWidth: function(elem) {\n\n var style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-left-width']) +\n cssValueToPixels(style['border-right-width']) +\n cssValueToPixels(style['padding-left']) +\n cssValueToPixels(style['padding-right']) +\n cssValueToPixels(style['width']);\n },\n\n /**\n *\n * @param elem\n */\n getHeight: function(elem) {\n\n var style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-top-width']) +\n cssValueToPixels(style['border-bottom-width']) +\n cssValueToPixels(style['padding-top']) +\n cssValueToPixels(style['padding-bottom']) +\n cssValueToPixels(style['height']);\n },\n\n /**\n *\n * @param elem\n */\n getOffset: function(elem) {\n var offset = {left: 0, top:0};\n if (elem.offsetParent) {\n do {\n offset.left += elem.offsetLeft;\n offset.top += elem.offsetTop;\n } while (elem = elem.offsetParent);\n }\n return offset;\n },\n\n // http://stackoverflow.com/posts/2684561/revisions\n /**\n * \n * @param elem\n */\n isActive: function(elem) {\n return elem === document.activeElement && ( elem.type || elem.href );\n }\n\n };\n\n return dom;\n\n})(dat.utils.common);\n\n\ndat.controllers.OptionController = (function (Controller, dom, common) {\n\n /**\n * @class Provides a select input to alter the property of an object, using a\n * list of accepted values.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object|string[]} options A map of labels to acceptable values, or\n * a list of acceptable string values.\n *\n * @member dat.controllers\n */\n var OptionController = function(object, property, options) {\n\n OptionController.superclass.call(this, object, property);\n\n var _this = this;\n\n /**\n * The drop down menu\n * @ignore\n */\n this.__select = document.createElement('select');\n\n if (common.isArray(options)) {\n var map = {};\n common.each(options, function(element) {\n map[element] = element;\n });\n options = map;\n }\n\n common.each(options, function(value, key) {\n\n var opt = document.createElement('option');\n opt.innerHTML = key;\n opt.setAttribute('value', value);\n _this.__select.appendChild(opt);\n\n });\n\n // Acknowledge original value\n this.updateDisplay();\n\n dom.bind(this.__select, 'change', function() {\n var desiredValue = this.options[this.selectedIndex].value;\n _this.setValue(desiredValue);\n });\n\n this.domElement.appendChild(this.__select);\n\n };\n\n OptionController.superclass = Controller;\n\n common.extend(\n\n OptionController.prototype,\n Controller.prototype,\n\n {\n\n setValue: function(v) {\n var toReturn = OptionController.superclass.prototype.setValue.call(this, v);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n return toReturn;\n },\n\n updateDisplay: function() {\n this.__select.value = this.getValue();\n return OptionController.superclass.prototype.updateDisplay.call(this);\n }\n\n }\n\n );\n\n return OptionController;\n\n})(dat.controllers.Controller,\ndat.dom.dom,\ndat.utils.common);\n\n\ndat.controllers.NumberController = (function (Controller, common) {\n\n /**\n * @class Represents a given property of an object that is a number.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n *\n * @member dat.controllers\n */\n var NumberController = function(object, property, params) {\n\n NumberController.superclass.call(this, object, property);\n\n params = params || {};\n\n this.__min = params.min;\n this.__max = params.max;\n this.__step = params.step;\n\n if (common.isUndefined(this.__step)) {\n\n if (this.initialValue == 0) {\n this.__impliedStep = 1; // What are we, psychics?\n } else {\n // Hey Doug, check this out.\n this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue)/Math.LN10))/10;\n }\n\n } else {\n\n this.__impliedStep = this.__step;\n\n }\n\n this.__precision = numDecimals(this.__impliedStep);\n\n\n };\n\n NumberController.superclass = Controller;\n\n common.extend(\n\n NumberController.prototype,\n Controller.prototype,\n\n /** @lends dat.controllers.NumberController.prototype */\n {\n\n setValue: function(v) {\n\n if (this.__min !== undefined && v < this.__min) {\n v = this.__min;\n } else if (this.__max !== undefined && v > this.__max) {\n v = this.__max;\n }\n\n if (this.__step !== undefined && v % this.__step != 0) {\n v = Math.round(v / this.__step) * this.__step;\n }\n\n return NumberController.superclass.prototype.setValue.call(this, v);\n\n },\n\n /**\n * Specify a minimum value for <code>object[property]</code>.\n *\n * @param {Number} minValue The minimum value for\n * <code>object[property]</code>\n * @returns {dat.controllers.NumberController} this\n */\n min: function(v) {\n this.__min = v;\n return this;\n },\n\n /**\n * Specify a maximum value for <code>object[property]</code>.\n *\n * @param {Number} maxValue The maximum value for\n * <code>object[property]</code>\n * @returns {dat.controllers.NumberController} this\n */\n max: function(v) {\n this.__max = v;\n return this;\n },\n\n /**\n * Specify a step value that dat.controllers.NumberController\n * increments by.\n *\n * @param {Number} stepValue The step value for\n * dat.controllers.NumberController\n * @default if minimum and maximum specified increment is 1% of the\n * difference otherwise stepValue is 1\n * @returns {dat.controllers.NumberController} this\n */\n step: function(v) {\n this.__step = v;\n return this;\n }\n\n }\n\n );\n\n function numDecimals(x) {\n x = x.toString();\n if (x.indexOf('.') > -1) {\n return x.length - x.indexOf('.') - 1;\n } else {\n return 0;\n }\n }\n\n return NumberController;\n\n})(dat.controllers.Controller,\ndat.utils.common);\n\n\ndat.controllers.NumberControllerBox = (function (NumberController, dom, common) {\n\n /**\n * @class Represents a given property of an object that is a number and\n * provides an input element with which to manipulate it.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n *\n * @member dat.controllers\n */\n var NumberControllerBox = function(object, property, params) {\n\n this.__truncationSuspended = false;\n\n NumberControllerBox.superclass.call(this, object, property, params);\n\n var _this = this;\n\n /**\n * {Number} Previous mouse y position\n * @ignore\n */\n var prev_y;\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n // Makes it so manually specified values are not truncated.\n\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'mousedown', onMouseDown);\n dom.bind(this.__input, 'keydown', function(e) {\n\n // When pressing entire, you can be as precise as you want.\n if (e.keyCode === 13) {\n _this.__truncationSuspended = true;\n this.blur();\n _this.__truncationSuspended = false;\n }\n\n });\n\n function onChange() {\n var attempted = parseFloat(_this.__input.value);\n if (!common.isNaN(attempted)) _this.setValue(attempted);\n }\n\n function onBlur() {\n onChange();\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n function onMouseDown(e) {\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n prev_y = e.clientY;\n }\n\n function onMouseDrag(e) {\n\n var diff = prev_y - e.clientY;\n _this.setValue(_this.getValue() + diff * _this.__impliedStep);\n\n prev_y = e.clientY;\n\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n }\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n\n };\n\n NumberControllerBox.superclass = NumberController;\n\n common.extend(\n\n NumberControllerBox.prototype,\n NumberController.prototype,\n\n {\n\n updateDisplay: function() {\n\n this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);\n return NumberControllerBox.superclass.prototype.updateDisplay.call(this);\n }\n\n }\n\n );\n\n function roundToDecimal(value, decimals) {\n var tenTo = Math.pow(10, decimals);\n return Math.round(value * tenTo) / tenTo;\n }\n\n return NumberControllerBox;\n\n})(dat.controllers.NumberController,\ndat.dom.dom,\ndat.utils.common);\n\n\ndat.controllers.NumberControllerSlider = (function (NumberController, dom, css, common, styleSheet) {\n\n /**\n * @class Represents a given property of an object that is a number, contains\n * a minimum and maximum, and provides a slider element with which to\n * manipulate it. It should be noted that the slider element is made up of\n * <code><div></code> tags, <strong>not</strong> the html5\n * <code><slider></code> element.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n * \n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Number} minValue Minimum allowed value\n * @param {Number} maxValue Maximum allowed value\n * @param {Number} stepValue Increment by which to change value\n *\n * @member dat.controllers\n */\n var NumberControllerSlider = function(object, property, min, max, step) {\n\n NumberControllerSlider.superclass.call(this, object, property, { min: min, max: max, step: step });\n\n var _this = this;\n\n this.__background = document.createElement('div');\n this.__foreground = document.createElement('div');\n \n\n\n dom.bind(this.__background, 'mousedown', onMouseDown);\n \n dom.addClass(this.__background, 'slider');\n dom.addClass(this.__foreground, 'slider-fg');\n\n function onMouseDown(e) {\n\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n\n onMouseDrag(e);\n }\n\n function onMouseDrag(e) {\n\n e.preventDefault();\n\n var offset = dom.getOffset(_this.__background);\n var width = dom.getWidth(_this.__background);\n \n _this.setValue(\n map(e.clientX, offset.left, offset.left + width, _this.__min, _this.__max)\n );\n\n return false;\n\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.updateDisplay();\n\n this.__background.appendChild(this.__foreground);\n this.domElement.appendChild(this.__background);\n\n };\n\n NumberControllerSlider.superclass = NumberController;\n\n /**\n * Injects default stylesheet for slider elements.\n */\n NumberControllerSlider.useDefaultStyles = function() {\n css.inject(styleSheet);\n };\n\n common.extend(\n\n NumberControllerSlider.prototype,\n NumberController.prototype,\n\n {\n\n updateDisplay: function() {\n var pct = (this.getValue() - this.__min)/(this.__max - this.__min);\n this.__foreground.style.width = pct*100+'%';\n return NumberControllerSlider.superclass.prototype.updateDisplay.call(this);\n }\n\n }\n\n\n\n );\n\n function map(v, i1, i2, o1, o2) {\n return o1 + (o2 - o1) * ((v - i1) / (i2 - i1));\n }\n\n return NumberControllerSlider;\n \n})(dat.controllers.NumberController,\ndat.dom.dom,\ndat.utils.css,\ndat.utils.common,\n\".slider {\\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\\n height: 1em;\\n border-radius: 1em;\\n background-color: #eee;\\n padding: 0 0.5em;\\n overflow: hidden;\\n}\\n\\n.slider-fg {\\n padding: 1px 0 2px 0;\\n background-color: #aaa;\\n height: 1em;\\n margin-left: -0.5em;\\n padding-right: 0.5em;\\n border-radius: 1em 0 0 1em;\\n}\\n\\n.slider-fg:after {\\n display: inline-block;\\n border-radius: 1em;\\n background-color: #fff;\\n border: 1px solid #aaa;\\n content: '';\\n float: right;\\n margin-right: -1em;\\n margin-top: -1px;\\n height: 0.9em;\\n width: 0.9em;\\n}\");\n\n\ndat.controllers.FunctionController = (function (Controller, dom, common) {\n\n /**\n * @class Provides a GUI interface to fire a specified method, a property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n *\n * @member dat.controllers\n */\n var FunctionController = function(object, property, text) {\n\n FunctionController.superclass.call(this, object, property);\n\n var _this = this;\n\n this.__button = document.createElement('div');\n this.__button.innerHTML = text === undefined ? 'Fire' : text;\n dom.bind(this.__button, 'click', function(e) {\n e.preventDefault();\n _this.fire();\n return false;\n });\n\n dom.addClass(this.__button, 'button');\n\n this.domElement.appendChild(this.__button);\n\n\n };\n\n FunctionController.superclass = Controller;\n\n common.extend(\n\n FunctionController.prototype,\n Controller.prototype,\n {\n \n fire: function() {\n if (this.__onChange) {\n this.__onChange.call(this);\n }\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n this.getValue().call(this.object);\n }\n }\n\n );\n\n return FunctionController;\n\n})(dat.controllers.Controller,\ndat.dom.dom,\ndat.utils.common);\n\n\ndat.controllers.BooleanController = (function (Controller, dom, common) {\n\n /**\n * @class Provides a checkbox input to alter the boolean property of an object.\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n *\n * @member dat.controllers\n */\n var BooleanController = function(object, property) {\n\n BooleanController.superclass.call(this, object, property);\n\n var _this = this;\n this.__prev = this.getValue();\n\n this.__checkbox = document.createElement('input');\n this.__checkbox.setAttribute('type', 'checkbox');\n\n\n dom.bind(this.__checkbox, 'change', onChange, false);\n\n this.domElement.appendChild(this.__checkbox);\n\n // Match original value\n this.updateDisplay();\n\n function onChange() {\n _this.setValue(!_this.__prev);\n }\n\n };\n\n BooleanController.superclass = Controller;\n\n common.extend(\n\n BooleanController.prototype,\n Controller.prototype,\n\n {\n\n setValue: function(v) {\n var toReturn = BooleanController.superclass.prototype.setValue.call(this, v);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n this.__prev = this.getValue();\n return toReturn;\n },\n\n updateDisplay: function() {\n \n if (this.getValue() === true) {\n this.__checkbox.setAttribute('checked', 'checked');\n this.__checkbox.checked = true; \n } else {\n this.__checkbox.checked = false;\n }\n\n return BooleanController.superclass.prototype.updateDisplay.call(this);\n\n }\n\n\n }\n\n );\n\n return BooleanController;\n\n})(dat.controllers.Controller,\ndat.dom.dom,\ndat.utils.common);\n\n\ndat.color.toString = (function (common) {\n\n return function(color) {\n\n if (color.a == 1 || common.isUndefined(color.a)) {\n\n var s = color.hex.toString(16);\n while (s.length < 6) {\n s = '0' + s;\n }\n\n return '#' + s;\n\n } else {\n\n return 'rgba(' + Math.round(color.r) + ',' + Math.round(color.g) + ',' + Math.round(color.b) + ',' + color.a + ')';\n\n }\n\n }\n\n})(dat.utils.common);\n\n\ndat.color.interpret = (function (toString, common) {\n\n var result, toReturn;\n\n var interpret = function() {\n\n toReturn = false;\n\n var original = arguments.length > 1 ? common.toArray(arguments) : arguments[0];\n\n common.each(INTERPRETATIONS, function(family) {\n\n if (family.litmus(original)) {\n\n common.each(family.conversions, function(conversion, conversionName) {\n\n result = conversion.read(original);\n\n if (toReturn === false && result !== false) {\n toReturn = result;\n result.conversionName = conversionName;\n result.conversion = conversion;\n return common.BREAK;\n\n }\n\n });\n\n return common.BREAK;\n\n }\n\n });\n\n return toReturn;\n\n };\n\n var INTERPRETATIONS = [\n\n // Strings\n {\n\n litmus: common.isString,\n\n conversions: {\n\n THREE_CHAR_HEX: {\n\n read: function(original) {\n\n var test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);\n if (test === null) return false;\n\n return {\n space: 'HEX',\n hex: parseInt(\n '0x' +\n test[1].toString() + test[1].toString() +\n test[2].toString() + test[2].toString() +\n test[3].toString() + test[3].toString())\n };\n\n },\n\n write: toString\n\n },\n\n SIX_CHAR_HEX: {\n\n read: function(original) {\n\n var test = original.match(/^#([A-F0-9]{6})$/i);\n if (test === null) return false;\n\n return {\n space: 'HEX',\n hex: parseInt('0x' + test[1].toString())\n };\n\n },\n\n write: toString\n\n },\n\n CSS_RGB: {\n\n read: function(original) {\n\n var test = original.match(/^rgb\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\n if (test === null) return false;\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3])\n };\n\n },\n\n write: toString\n\n },\n\n CSS_RGBA: {\n\n read: function(original) {\n\n var test = original.match(/^rgba\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\,\\s*(.+)\\s*\\)/);\n if (test === null) return false;\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3]),\n a: parseFloat(test[4])\n };\n\n },\n\n write: toString\n\n }\n\n }\n\n },\n\n // Numbers\n {\n\n litmus: common.isNumber,\n\n conversions: {\n\n HEX: {\n read: function(original) {\n return {\n space: 'HEX',\n hex: original,\n conversionName: 'HEX'\n }\n },\n\n write: function(color) {\n return color.hex;\n }\n }\n\n }\n\n },\n\n // Arrays\n {\n\n litmus: common.isArray,\n\n conversions: {\n\n RGB_ARRAY: {\n read: function(original) {\n if (original.length != 3) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b];\n }\n\n },\n\n RGBA_ARRAY: {\n read: function(original) {\n if (original.length != 4) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2],\n a: original[3]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b, color.a];\n }\n\n }\n\n }\n\n },\n\n // Objects\n {\n\n litmus: common.isObject,\n\n conversions: {\n\n RGBA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b) &&\n common.isNumber(original.a)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b,\n a: original.a\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b,\n a: color.a\n }\n }\n },\n\n RGB_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b\n }\n }\n },\n\n HSVA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v) &&\n common.isNumber(original.a)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v,\n a: original.a\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v,\n a: color.a\n }\n }\n },\n\n HSV_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v\n }\n }\n\n }\n\n }\n\n }\n\n\n ];\n\n return interpret;\n\n\n})(dat.color.toString,\ndat.utils.common);\n\n\ndat.GUI = dat.gui.GUI = (function (css, saveDialogueContents, styleSheet, controllerFactory, Controller, BooleanController, FunctionController, NumberControllerBox, NumberControllerSlider, OptionController, ColorController, requestAnimationFrame, CenteredDiv, dom, common) {\n\n css.inject(styleSheet);\n\n /** Outer-most className for GUI's */\n var CSS_NAMESPACE = 'dg';\n\n var HIDE_KEY_CODE = 72;\n\n /** The only value shared between the JS and SCSS. Use caution. */\n var CLOSE_BUTTON_HEIGHT = 20;\n\n var DEFAULT_DEFAULT_PRESET_NAME = 'Default';\n\n var SUPPORTS_LOCAL_STORAGE = (function() {\n try {\n return 'localStorage' in window && window['localStorage'] !== null;\n } catch (e) {\n return false;\n }\n })();\n\n var SAVE_DIALOGUE;\n\n /** Have we yet to create an autoPlace GUI? */\n var auto_place_virgin = true;\n\n /** Fixed position div that auto place GUI's go inside */\n var auto_place_container;\n\n /** Are we hiding the GUI's ? */\n var hide = false;\n\n /** GUI's which should be hidden */\n var hideable_guis = [];\n\n /**\n * A lightweight controller library for JavaScript. It allows you to easily\n * manipulate variables and fire functions on the fly.\n * @class\n *\n * @member dat.gui\n *\n * @param {Object} [params]\n * @param {String} [params.name] The name of this GUI.\n * @param {Object} [params.load] JSON object representing the saved state of\n * this GUI.\n * @param {Boolean} [params.auto=true]\n * @param {dat.gui.GUI} [params.parent] The GUI I'm nested in.\n * @param {Boolean} [params.closed] If true, starts closed\n */\n var GUI = function(params) {\n\n var _this = this;\n\n /**\n * Outermost DOM Element\n * @type DOMElement\n */\n this.domElement = document.createElement('div');\n this.__ul = document.createElement('ul');\n this.domElement.appendChild(this.__ul);\n\n dom.addClass(this.domElement, CSS_NAMESPACE);\n\n /**\n * Nested GUI's by name\n * @ignore\n */\n this.__folders = {};\n\n this.__controllers = [];\n\n /**\n * List of objects I'm remembering for save, only used in top level GUI\n * @ignore\n */\n this.__rememberedObjects = [];\n\n /**\n * Maps the index of remembered objects to a map of controllers, only used\n * in top level GUI.\n *\n * @private\n * @ignore\n *\n * @example\n * [\n * {\n * propertyName: Controller,\n * anotherPropertyName: Controller\n * },\n * {\n * propertyName: Controller\n * }\n * ]\n */\n this.__rememberedObjectIndecesToControllers = [];\n\n this.__listening = [];\n\n params = params || {};\n\n // Default parameters\n params = common.defaults(params, {\n autoPlace: true,\n width: GUI.DEFAULT_WIDTH\n });\n\n params = common.defaults(params, {\n resizable: params.autoPlace,\n hideable: params.autoPlace\n });\n\n\n if (!common.isUndefined(params.load)) {\n\n // Explicit preset\n if (params.preset) params.load.preset = params.preset;\n\n } else {\n\n params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME };\n\n }\n\n if (common.isUndefined(params.parent) && params.hideable) {\n hideable_guis.push(this);\n }\n\n // Only root level GUI's are resizable.\n params.resizable = common.isUndefined(params.parent) && params.resizable;\n\n\n if (params.autoPlace && common.isUndefined(params.scrollable)) {\n params.scrollable = true;\n }\n// params.scrollable = common.isUndefined(params.parent) && params.scrollable === true;\n\n // Not part of params because I don't want people passing this in via\n // constructor. Should be a 'remembered' value.\n var use_local_storage =\n SUPPORTS_LOCAL_STORAGE &&\n localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true';\n\n Object.defineProperties(this,\n\n /** @lends dat.gui.GUI.prototype */\n {\n\n /**\n * The parent <code>GUI</code>\n * @type dat.gui.GUI\n */\n parent: {\n get: function() {\n return params.parent;\n }\n },\n\n scrollable: {\n get: function() {\n return params.scrollable;\n }\n },\n\n /**\n * Handles <code>GUI</code>'s element placement for you\n * @type Boolean\n */\n autoPlace: {\n get: function() {\n return params.autoPlace;\n }\n },\n\n /**\n * The identifier for a set of saved values\n * @type String\n */\n preset: {\n\n get: function() {\n if (_this.parent) {\n return _this.getRoot().preset;\n } else {\n return params.load.preset;\n }\n },\n\n set: function(v) {\n if (_this.parent) {\n _this.getRoot().preset = v;\n } else {\n params.load.preset = v;\n }\n setPresetSelectIndex(this);\n _this.revert();\n }\n\n },\n\n /**\n * The width of <code>GUI</code> element\n * @type Number\n */\n width: {\n get: function() {\n return params.width;\n },\n set: function(v) {\n params.width = v;\n setWidth(_this, v);\n }\n },\n\n /**\n * The name of <code>GUI</code>. Used for folders. i.e\n * a folder's name\n * @type String\n */\n name: {\n get: function() {\n return params.name;\n },\n set: function(v) {\n // TODO Check for collisions among sibling folders\n params.name = v;\n if (title_row_name) {\n title_row_name.innerHTML = params.name;\n }\n }\n },\n\n /**\n * Whether the <code>GUI</code> is collapsed or not\n * @type Boolean\n */\n closed: {\n get: function() {\n return params.closed;\n },\n set: function(v) {\n params.closed = v;\n if (params.closed) {\n dom.addClass(_this.__ul, GUI.CLASS_CLOSED);\n } else {\n dom.removeClass(_this.__ul, GUI.CLASS_CLOSED);\n }\n // For browsers that aren't going to respect the CSS transition,\n // Lets just check our height against the window height right off\n // the bat.\n this.onResize();\n\n if (_this.__closeButton) {\n _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED;\n }\n }\n },\n\n /**\n * Contains all presets\n * @type Object\n */\n load: {\n get: function() {\n return params.load;\n }\n },\n\n /**\n * Determines whether or not to use <a href=\"https://developer.mozilla.org/en/DOM/Storage#localStorage\">localStorage</a> as the means for\n * <code>remember</code>ing\n * @type Boolean\n */\n useLocalStorage: {\n\n get: function() {\n return use_local_storage;\n },\n set: function(bool) {\n if (SUPPORTS_LOCAL_STORAGE) {\n use_local_storage = bool;\n if (bool) {\n dom.bind(window, 'unload', saveToLocalStorage);\n } else {\n dom.unbind(window, 'unload', saveToLocalStorage);\n }\n localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool);\n }\n }\n\n }\n\n });\n\n // Are we a root level GUI?\n if (common.isUndefined(params.parent)) {\n\n params.closed = false;\n\n dom.addClass(this.domElement, GUI.CLASS_MAIN);\n dom.makeSelectable(this.domElement, false);\n\n // Are we supposed to be loading locally?\n if (SUPPORTS_LOCAL_STORAGE) {\n\n if (use_local_storage) {\n\n _this.useLocalStorage = true;\n\n var saved_gui = localStorage.getItem(getLocalStorageHash(this, 'gui'));\n\n if (saved_gui) {\n params.load = JSON.parse(saved_gui);\n }\n\n }\n\n }\n\n this.__closeButton = document.createElement('div');\n this.__closeButton.innerHTML = GUI.TEXT_CLOSED;\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON);\n this.domElement.appendChild(this.__closeButton);\n\n dom.bind(this.__closeButton, 'click', function() {\n\n _this.closed = !_this.closed;\n\n\n });\n\n\n // Oh, you're a nested GUI!\n } else {\n\n if (params.closed === undefined) {\n params.closed = true;\n }\n\n var title_row_name = document.createTextNode(params.name);\n dom.addClass(title_row_name, 'controller-name');\n\n var title_row = addRow(_this, title_row_name);\n\n var on_click_title = function(e) {\n e.preventDefault();\n _this.closed = !_this.closed;\n return false;\n };\n\n dom.addClass(this.__ul, GUI.CLASS_CLOSED);\n\n dom.addClass(title_row, 'title');\n dom.bind(title_row, 'click', on_click_title);\n\n if (!params.closed) {\n this.closed = false;\n }\n\n }\n\n if (params.autoPlace) {\n\n if (common.isUndefined(params.parent)) {\n\n if (auto_place_virgin) {\n auto_place_container = document.createElement('div');\n dom.addClass(auto_place_container, CSS_NAMESPACE);\n dom.addClass(auto_place_container, GUI.CLASS_AUTO_PLACE_CONTAINER);\n document.body.appendChild(auto_place_container);\n auto_place_virgin = false;\n }\n\n // Put it in the dom for you.\n auto_place_container.appendChild(this.domElement);\n\n // Apply the auto styles\n dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE);\n\n }\n\n\n // Make it not elastic.\n if (!this.parent) setWidth(_this, params.width);\n\n }\n\n dom.bind(window, 'resize', function() { _this.onResize() });\n dom.bind(this.__ul, 'webkitTransitionEnd', function() { _this.onResize(); });\n dom.bind(this.__ul, 'transitionend', function() { _this.onResize() });\n dom.bind(this.__ul, 'oTransitionEnd', function() { _this.onResize() });\n this.onResize();\n\n\n if (params.resizable) {\n addResizeHandle(this);\n }\n\n function saveToLocalStorage() {\n localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject()));\n }\n\n var root = _this.getRoot();\n function resetWidth() {\n var root = _this.getRoot();\n root.width += 1;\n common.defer(function() {\n root.width -= 1;\n });\n }\n\n if (!params.parent) {\n resetWidth();\n }\n\n };\n\n GUI.toggleHide = function() {\n\n hide = !hide;\n common.each(hideable_guis, function(gui) {\n gui.domElement.style.zIndex = hide ? -999 : 999;\n gui.domElement.style.opacity = hide ? 0 : 1;\n });\n };\n\n GUI.CLASS_AUTO_PLACE = 'a';\n GUI.CLASS_AUTO_PLACE_CONTAINER = 'ac';\n GUI.CLASS_MAIN = 'main';\n GUI.CLASS_CONTROLLER_ROW = 'cr';\n GUI.CLASS_TOO_TALL = 'taller-than-window';\n GUI.CLASS_CLOSED = 'closed';\n GUI.CLASS_CLOSE_BUTTON = 'close-button';\n GUI.CLASS_DRAG = 'drag';\n\n GUI.DEFAULT_WIDTH = 245;\n GUI.TEXT_CLOSED = 'Close Controls';\n GUI.TEXT_OPEN = 'Open Controls';\n\n dom.bind(window, 'keydown', function(e) {\n\n if (document.activeElement.type !== 'text' &&\n (e.which === HIDE_KEY_CODE || e.keyCode == HIDE_KEY_CODE)) {\n GUI.toggleHide();\n }\n\n }, false);\n\n common.extend(\n\n GUI.prototype,\n\n /** @lends dat.gui.GUI */\n {\n\n /**\n * @param object\n * @param property\n * @returns {dat.controllers.Controller} The new controller that was added.\n * @instance\n */\n add: function(object, property) {\n\n return add(\n this,\n object,\n property,\n {\n factoryArgs: Array.prototype.slice.call(arguments, 2)\n }\n );\n\n },\n\n /**\n * @param object\n * @param property\n * @returns {dat.controllers.ColorController} The new controller that was added.\n * @instance\n */\n addColor: function(object, property) {\n\n return add(\n this,\n object,\n property,\n {\n color: true\n }\n );\n\n },\n\n /**\n * @param controller\n * @instance\n */\n remove: function(controller) {\n\n // TODO listening?\n this.__ul.removeChild(controller.__li);\n this.__controllers.slice(this.__controllers.indexOf(controller), 1);\n var _this = this;\n common.defer(function() {\n _this.onResize();\n });\n\n },\n\n destroy: function() {\n\n if (this.autoPlace) {\n auto_place_container.removeChild(this.domElement);\n }\n\n },\n\n /**\n * @param name\n * @returns {dat.gui.GUI} The new folder.\n * @throws {Error} if this GUI already has a folder by the specified\n * name\n * @instance\n */\n addFolder: function(name) {\n\n // We have to prevent collisions on names in order to have a key\n // by which to remember saved values\n if (this.__folders[name] !== undefined) {\n throw new Error('You already have a folder in this GUI by the' +\n ' name \"' + name + '\"');\n }\n\n var new_gui_params = { name: name, parent: this };\n\n // We need to pass down the autoPlace trait so that we can\n // attach event listeners to open/close folder actions to\n // ensure that a scrollbar appears if the window is too short.\n new_gui_params.autoPlace = this.autoPlace;\n\n // Do we have saved appearance data for this folder?\n\n if (this.load && // Anything loaded?\n this.load.folders && // Was my parent a dead-end?\n this.load.folders[name]) { // Did daddy remember me?\n\n // Start me closed if I was closed\n new_gui_params.closed = this.load.folders[name].closed;\n\n // Pass down the loaded data\n new_gui_params.load = this.load.folders[name];\n\n }\n\n var gui = new GUI(new_gui_params);\n this.__folders[name] = gui;\n\n var li = addRow(this, gui.domElement);\n dom.addClass(li, 'folder');\n return gui;\n\n },\n\n open: function() {\n this.closed = false;\n },\n\n close: function() {\n this.closed = true;\n },\n\n onResize: function() {\n\n var root = this.getRoot();\n\n if (root.scrollable) {\n\n var top = dom.getOffset(root.__ul).top;\n var h = 0;\n\n common.each(root.__ul.childNodes, function(node) {\n if (! (root.autoPlace && node === root.__save_row))\n h += dom.getHeight(node);\n });\n\n if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) {\n dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px';\n } else {\n dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = 'auto';\n }\n\n }\n\n if (root.__resize_handle) {\n common.defer(function() {\n root.__resize_handle.style.height = root.__ul.offsetHeight + 'px';\n });\n }\n\n if (root.__closeButton) {\n root.__closeButton.style.width = root.width + 'px';\n }\n\n },\n\n /**\n * Mark objects for saving. The order of these objects cannot change as\n * the GUI grows. When remembering new objects, append them to the end\n * of the list.\n *\n * @param {Object...} objects\n * @throws {Error} if not called on a top level GUI.\n * @instance\n */\n remember: function() {\n\n if (common.isUndefined(SAVE_DIALOGUE)) {\n SAVE_DIALOGUE = new CenteredDiv();\n SAVE_DIALOGUE.domElement.innerHTML = saveDialogueContents;\n }\n\n if (this.parent) {\n throw new Error(\"You can only call remember on a top level GUI.\");\n }\n\n var _this = this;\n\n common.each(Array.prototype.slice.call(arguments), function(object) {\n if (_this.__rememberedObjects.length == 0) {\n addSaveMenu(_this);\n }\n if (_this.__rememberedObjects.indexOf(object) == -1) {\n _this.__rememberedObjects.push(object);\n }\n });\n\n if (this.autoPlace) {\n // Set save row width\n setWidth(this, this.width);\n }\n\n },\n\n /**\n * @returns {dat.gui.GUI} the topmost parent GUI of a nested GUI.\n * @instance\n */\n getRoot: function() {\n var gui = this;\n while (gui.parent) {\n gui = gui.parent;\n }\n return gui;\n },\n\n /**\n * @returns {Object} a JSON object representing the current state of\n * this GUI as well as its remembered properties.\n * @instance\n */\n getSaveObject: function() {\n\n var toReturn = this.load;\n\n toReturn.closed = this.closed;\n\n // Am I remembering any values?\n if (this.__rememberedObjects.length > 0) {\n\n toReturn.preset = this.preset;\n\n if (!toReturn.remembered) {\n toReturn.remembered = {};\n }\n\n toReturn.remembered[this.preset] = getCurrentPreset(this);\n\n }\n\n toReturn.folders = {};\n common.each(this.__folders, function(element, key) {\n toReturn.folders[key] = element.getSaveObject();\n });\n\n return toReturn;\n\n },\n\n save: function() {\n\n if (!this.load.remembered) {\n this.load.remembered = {};\n }\n\n this.load.remembered[this.preset] = getCurrentPreset(this);\n markPresetModified(this, false);\n\n },\n\n saveAs: function(presetName) {\n\n if (!this.load.remembered) {\n\n // Retain default values upon first save\n this.load.remembered = {};\n this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true);\n\n }\n\n this.load.remembered[presetName] = getCurrentPreset(this);\n this.preset = presetName;\n addPresetOption(this, presetName, true);\n\n },\n\n revert: function(gui) {\n\n common.each(this.__controllers, function(controller) {\n // Make revert work on Default.\n if (!this.getRoot().load.remembered) {\n controller.setValue(controller.initialValue);\n } else {\n recallSavedValue(gui || this.getRoot(), controller);\n }\n }, this);\n\n common.each(this.__folders, function(folder) {\n folder.revert(folder);\n });\n\n if (!gui) {\n markPresetModified(this.getRoot(), false);\n }\n\n\n },\n\n listen: function(controller) {\n\n var init = this.__listening.length == 0;\n this.__listening.push(controller);\n if (init) updateDisplays(this.__listening);\n\n }\n\n }\n\n );\n\n function add(gui, object, property, params) {\n\n if (object[property] === undefined) {\n throw new Error(\"Object \" + object + \" has no property \\\"\" + property + \"\\\"\");\n }\n\n var controller;\n\n if (params.color) {\n\n controller = new ColorController(object, property);\n\n } else {\n\n var factoryArgs = [object,property].concat(params.factoryArgs);\n controller = controllerFactory.apply(gui, factoryArgs);\n\n }\n\n if (params.before instanceof Controller) {\n params.before = params.before.__li;\n }\n\n recallSavedValue(gui, controller);\n\n dom.addClass(controller.domElement, 'c');\n\n var name = document.createElement('span');\n dom.addClass(name, 'property-name');\n name.innerHTML = controller.property;\n\n var container = document.createElement('div');\n container.appendChild(name);\n container.appendChild(controller.domElement);\n\n var li = addRow(gui, container, params.before);\n\n dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);\n dom.addClass(li, typeof controller.getValue());\n\n augmentController(gui, li, controller);\n\n gui.__controllers.push(controller);\n\n return controller;\n\n }\n\n /**\n * Add a row to the end of the GUI or before another row.\n *\n * @param gui\n * @param [dom] If specified, inserts the dom content in the new row\n * @param [liBefore] If specified, places the new row before another row\n */\n function addRow(gui, dom, liBefore) {\n var li = document.createElement('li');\n if (dom) li.appendChild(dom);\n if (liBefore) {\n gui.__ul.insertBefore(li, params.before);\n } else {\n gui.__ul.appendChild(li);\n }\n gui.onResize();\n return li;\n }\n\n function augmentController(gui, li, controller) {\n\n controller.__li = li;\n controller.__gui = gui;\n\n common.extend(controller, {\n\n options: function(options) {\n\n if (arguments.length > 1) {\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: controller.__li.nextElementSibling,\n factoryArgs: [common.toArray(arguments)]\n }\n );\n\n }\n\n if (common.isArray(options) || common.isObject(options)) {\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: controller.__li.nextElementSibling,\n factoryArgs: [options]\n }\n );\n\n }\n\n },\n\n name: function(v) {\n controller.__li.firstElementChild.firstElementChild.innerHTML = v;\n return controller;\n },\n\n listen: function() {\n controller.__gui.listen(controller);\n return controller;\n },\n\n remove: function() {\n controller.__gui.remove(controller);\n return controller;\n }\n\n });\n\n // All sliders should be accompanied by a box.\n if (controller instanceof NumberControllerSlider) {\n\n var box = new NumberControllerBox(controller.object, controller.property,\n { min: controller.__min, max: controller.__max, step: controller.__step });\n\n common.each(['updateDisplay', 'onChange', 'onFinishChange'], function(method) {\n var pc = controller[method];\n var pb = box[method];\n controller[method] = box[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n pc.apply(controller, args);\n return pb.apply(box, args);\n }\n });\n\n dom.addClass(li, 'has-slider');\n controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild);\n\n }\n else if (controller instanceof NumberControllerBox) {\n\n var r = function(returned) {\n\n // Have we defined both boundaries?\n if (common.isNumber(controller.__min) && common.isNumber(controller.__max)) {\n\n // Well, then lets just replace this with a slider.\n controller.remove();\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: controller.__li.nextElementSibling,\n factoryArgs: [controller.__min, controller.__max, controller.__step]\n });\n\n }\n\n return returned;\n\n };\n\n controller.min = common.compose(r, controller.min);\n controller.max = common.compose(r, controller.max);\n\n }\n else if (controller instanceof BooleanController) {\n\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__checkbox, 'click');\n });\n\n dom.bind(controller.__checkbox, 'click', function(e) {\n e.stopPropagation(); // Prevents double-toggle\n })\n\n }\n else if (controller instanceof FunctionController) {\n\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__button, 'click');\n });\n\n dom.bind(li, 'mouseover', function() {\n dom.addClass(controller.__button, 'hover');\n });\n\n dom.bind(li, 'mouseout', function() {\n dom.removeClass(controller.__button, 'hover');\n });\n\n }\n else if (controller instanceof ColorController) {\n\n dom.addClass(li, 'color');\n controller.updateDisplay = common.compose(function(r) {\n li.style.borderLeftColor = controller.__color.toString();\n return r;\n }, controller.updateDisplay);\n\n controller.updateDisplay();\n\n }\n\n controller.setValue = common.compose(function(r) {\n if (gui.getRoot().__preset_select && controller.isModified()) {\n markPresetModified(gui.getRoot(), true);\n }\n return r;\n }, controller.setValue);\n\n }\n\n function recallSavedValue(gui, controller) {\n\n // Find the topmost GUI, that's where remembered objects live.\n var root = gui.getRoot();\n\n // Does the object we're controlling match anything we've been told to\n // remember?\n var matched_index = root.__rememberedObjects.indexOf(controller.object);\n\n // Why yes, it does!\n if (matched_index != -1) {\n\n // Let me fetch a map of controllers for thcommon.isObject.\n var controller_map =\n root.__rememberedObjectIndecesToControllers[matched_index];\n\n // Ohp, I believe this is the first controller we've created for this\n // object. Lets make the map fresh.\n if (controller_map === undefined) {\n controller_map = {};\n root.__rememberedObjectIndecesToControllers[matched_index] =\n controller_map;\n }\n\n // Keep track of this controller\n controller_map[controller.property] = controller;\n\n // Okay, now have we saved any values for this controller?\n if (root.load && root.load.remembered) {\n\n var preset_map = root.load.remembered;\n\n // Which preset are we trying to load?\n var preset;\n\n if (preset_map[gui.preset]) {\n\n preset = preset_map[gui.preset];\n\n } else if (preset_map[DEFAULT_DEFAULT_PRESET_NAME]) {\n\n // Uhh, you can have the default instead?\n preset = preset_map[DEFAULT_DEFAULT_PRESET_NAME];\n\n } else {\n\n // Nada.\n\n return;\n\n }\n\n\n // Did the loaded object remember thcommon.isObject?\n if (preset[matched_index] &&\n\n // Did we remember this particular property?\n preset[matched_index][controller.property] !== undefined) {\n\n // We did remember something for this guy ...\n var value = preset[matched_index][controller.property];\n\n // And that's what it is.\n controller.initialValue = value;\n controller.setValue(value);\n\n }\n\n }\n\n }\n\n }\n\n function getLocalStorageHash(gui, key) {\n // TODO how does this deal with multiple GUI's?\n return document.location.href + '.' + key;\n\n }\n\n function addSaveMenu(gui) {\n\n var div = gui.__save_row = document.createElement('li');\n\n dom.addClass(gui.domElement, 'has-save');\n\n gui.__ul.insertBefore(div, gui.__ul.firstChild);\n\n dom.addClass(div, 'save-row');\n\n var gears = document.createElement('span');\n gears.innerHTML = ' ';\n dom.addClass(gears, 'button gears');\n\n // TODO replace with FunctionController\n var button = document.createElement('span');\n button.innerHTML = 'Save';\n dom.addClass(button, 'button');\n dom.addClass(button, 'save');\n\n var button2 = document.createElement('span');\n button2.innerHTML = 'New';\n dom.addClass(button2, 'button');\n dom.addClass(button2, 'save-as');\n\n var button3 = document.createElement('span');\n button3.innerHTML = 'Revert';\n dom.addClass(button3, 'button');\n dom.addClass(button3, 'revert');\n\n var select = gui.__preset_select = document.createElement('select');\n\n if (gui.load && gui.load.remembered) {\n\n common.each(gui.load.remembered, function(value, key) {\n addPresetOption(gui, key, key == gui.preset);\n });\n\n } else {\n addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false);\n }\n\n dom.bind(select, 'change', function() {\n\n\n for (var index = 0; index < gui.__preset_select.length; index++) {\n gui.__preset_select[index].innerHTML = gui.__preset_select[index].value;\n }\n\n gui.preset = this.value;\n\n });\n\n div.appendChild(select);\n div.appendChild(gears);\n div.appendChild(button);\n div.appendChild(button2);\n div.appendChild(button3);\n\n if (SUPPORTS_LOCAL_STORAGE) {\n\n var saveLocally = document.getElementById('dg-save-locally');\n var explain = document.getElementById('dg-local-explain');\n\n saveLocally.style.display = 'block';\n\n var localStorageCheckBox = document.getElementById('dg-local-storage');\n\n if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') {\n localStorageCheckBox.setAttribute('checked', 'checked');\n }\n\n function showHideExplain() {\n explain.style.display = gui.useLocalStorage ? 'block' : 'none';\n }\n\n showHideExplain();\n\n // TODO: Use a boolean controller, fool!\n dom.bind(localStorageCheckBox, 'change', function() {\n gui.useLocalStorage = !gui.useLocalStorage;\n showHideExplain();\n });\n\n }\n\n var newConstructorTextArea = document.getElementById('dg-new-constructor');\n\n dom.bind(newConstructorTextArea, 'keydown', function(e) {\n if (e.metaKey && (e.which === 67 || e.keyCode == 67)) {\n SAVE_DIALOGUE.hide();\n }\n });\n\n dom.bind(gears, 'click', function() {\n newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2);\n SAVE_DIALOGUE.show();\n newConstructorTextArea.focus();\n newConstructorTextArea.select();\n });\n\n dom.bind(button, 'click', function() {\n gui.save();\n });\n\n dom.bind(button2, 'click', function() {\n var presetName = prompt('Enter a new preset name.');\n if (presetName) gui.saveAs(presetName);\n });\n\n dom.bind(button3, 'click', function() {\n gui.revert();\n });\n\n// div.appendChild(button2);\n\n }\n\n function addResizeHandle(gui) {\n\n gui.__resize_handle = document.createElement('div');\n\n common.extend(gui.__resize_handle.style, {\n\n width: '6px',\n marginLeft: '-3px',\n height: '200px',\n cursor: 'ew-resize',\n position: 'absolute'\n// border: '1px solid blue'\n\n });\n\n var pmouseX;\n\n dom.bind(gui.__resize_handle, 'mousedown', dragStart);\n dom.bind(gui.__closeButton, 'mousedown', dragStart);\n\n gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild);\n\n function dragStart(e) {\n\n e.preventDefault();\n\n pmouseX = e.clientX;\n\n dom.addClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.bind(window, 'mousemove', drag);\n dom.bind(window, 'mouseup', dragStop);\n\n return false;\n\n }\n\n function drag(e) {\n\n e.preventDefault();\n\n gui.width += pmouseX - e.clientX;\n gui.onResize();\n pmouseX = e.clientX;\n\n return false;\n\n }\n\n function dragStop() {\n\n dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.unbind(window, 'mousemove', drag);\n dom.unbind(window, 'mouseup', dragStop);\n\n }\n\n }\n\n function setWidth(gui, w) {\n gui.domElement.style.width = w + 'px';\n // Auto placed save-rows are position fixed, so we have to\n // set the width manually if we want it to bleed to the edge\n if (gui.__save_row && gui.autoPlace) {\n gui.__save_row.style.width = w + 'px';\n }if (gui.__closeButton) {\n gui.__closeButton.style.width = w + 'px';\n }\n }\n\n function getCurrentPreset(gui, useInitialValues) {\n\n var toReturn = {};\n\n // For each object I'm remembering\n common.each(gui.__rememberedObjects, function(val, index) {\n\n var saved_values = {};\n\n // The controllers I've made for thcommon.isObject by property\n var controller_map =\n gui.__rememberedObjectIndecesToControllers[index];\n\n // Remember each value for each property\n common.each(controller_map, function(controller, property) {\n saved_values[property] = useInitialValues ? controller.initialValue : controller.getValue();\n });\n\n // Save the values for thcommon.isObject\n toReturn[index] = saved_values;\n\n });\n\n return toReturn;\n\n }\n\n function addPresetOption(gui, name, setSelected) {\n var opt = document.createElement('option');\n opt.innerHTML = name;\n opt.value = name;\n gui.__preset_select.appendChild(opt);\n if (setSelected) {\n gui.__preset_select.selectedIndex = gui.__preset_select.length - 1;\n }\n }\n\n function setPresetSelectIndex(gui) {\n for (var index = 0; index < gui.__preset_select.length; index++) {\n if (gui.__preset_select[index].value == gui.preset) {\n gui.__preset_select.selectedIndex = index;\n }\n }\n }\n\n function markPresetModified(gui, modified) {\n var opt = gui.__preset_select[gui.__preset_select.selectedIndex];\n// console.log('mark', modified, opt);\n if (modified) {\n opt.innerHTML = opt.value + \"*\";\n } else {\n opt.innerHTML = opt.value;\n }\n }\n\n function updateDisplays(controllerArray) {\n\n\n if (controllerArray.length != 0) {\n\n requestAnimationFrame(function() {\n updateDisplays(controllerArray);\n });\n\n }\n\n common.each(controllerArray, function(c) {\n c.updateDisplay();\n });\n\n }\n\n return GUI;\n\n})(dat.utils.css,\n\"<div id=\\\"dg-save\\\" class=\\\"dg dialogue\\\">\\n\\n Here's the new load parameter for your <code>GUI</code>'s constructor:\\n\\n <textarea id=\\\"dg-new-constructor\\\"></textarea>\\n\\n <div id=\\\"dg-save-locally\\\">\\n\\n <input id=\\\"dg-local-storage\\\" type=\\\"checkbox\\\"/> Automatically save\\n values to <code>localStorage</code> on exit.\\n\\n <div id=\\\"dg-local-explain\\\">The values saved to <code>localStorage</code> will\\n override those passed to <code>dat.GUI</code>'s constructor. This makes it\\n easier to work incrementally, but <code>localStorage</code> is fragile,\\n and your friends may not see the same values you do.\\n \\n </div>\\n \\n </div>\\n\\n</div>\",\n\".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\\n\",\ndat.controllers.factory = (function (OptionController, NumberControllerBox, NumberControllerSlider, StringController, FunctionController, BooleanController, common) {\n\n return function(object, property) {\n\n var initialValue = object[property];\n\n // Providing options?\n if (common.isArray(arguments[2]) || common.isObject(arguments[2])) {\n return new OptionController(object, property, arguments[2]);\n }\n\n // Providing a map?\n\n if (common.isNumber(initialValue)) {\n\n if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {\n\n // Has min and max.\n return new NumberControllerSlider(object, property, arguments[2], arguments[3]);\n\n } else {\n\n return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });\n\n }\n\n }\n\n if (common.isString(initialValue)) {\n return new StringController(object, property);\n }\n\n if (common.isFunction(initialValue)) {\n return new FunctionController(object, property, '');\n }\n\n if (common.isBoolean(initialValue)) {\n return new BooleanController(object, property);\n }\n\n }\n\n })(dat.controllers.OptionController,\ndat.controllers.NumberControllerBox,\ndat.controllers.NumberControllerSlider,\ndat.controllers.StringController = (function (Controller, dom, common) {\n\n /**\n * @class Provides a text input to alter the string property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n *\n * @member dat.controllers\n */\n var StringController = function(object, property) {\n\n StringController.superclass.call(this, object, property);\n\n var _this = this;\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n dom.bind(this.__input, 'keyup', onChange);\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) {\n this.blur();\n }\n });\n \n\n function onChange() {\n _this.setValue(_this.__input.value);\n }\n\n function onBlur() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n\n };\n\n StringController.superclass = Controller;\n\n common.extend(\n\n StringController.prototype,\n Controller.prototype,\n\n {\n\n updateDisplay: function() {\n // Stops the caret from moving on account of:\n // keyup -> setValue -> updateDisplay\n if (!dom.isActive(this.__input)) {\n this.__input.value = this.getValue();\n }\n return StringController.superclass.prototype.updateDisplay.call(this);\n }\n\n }\n\n );\n\n return StringController;\n\n})(dat.controllers.Controller,\ndat.dom.dom,\ndat.utils.common),\ndat.controllers.FunctionController,\ndat.controllers.BooleanController,\ndat.utils.common),\ndat.controllers.Controller,\ndat.controllers.BooleanController,\ndat.controllers.FunctionController,\ndat.controllers.NumberControllerBox,\ndat.controllers.NumberControllerSlider,\ndat.controllers.OptionController,\ndat.controllers.ColorController = (function (Controller, dom, Color, interpret, common) {\n\n var ColorController = function(object, property) {\n\n ColorController.superclass.call(this, object, property);\n\n this.__color = new Color(this.getValue());\n this.__temp = new Color(0);\n\n var _this = this;\n\n this.domElement = document.createElement('div');\n\n dom.makeSelectable(this.domElement, false);\n\n this.__selector = document.createElement('div');\n this.__selector.className = 'selector';\n\n this.__saturation_field = document.createElement('div');\n this.__saturation_field.className = 'saturation-field';\n\n this.__field_knob = document.createElement('div');\n this.__field_knob.className = 'field-knob';\n this.__field_knob_border = '2px solid ';\n\n this.__hue_knob = document.createElement('div');\n this.__hue_knob.className = 'hue-knob';\n\n this.__hue_field = document.createElement('div');\n this.__hue_field.className = 'hue-field';\n\n this.__input = document.createElement('input');\n this.__input.type = 'text';\n this.__input_textShadow = '0 1px 1px ';\n\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) { // on enter\n onBlur.call(this);\n }\n });\n\n dom.bind(this.__input, 'blur', onBlur);\n\n dom.bind(this.__selector, 'mousedown', function(e) {\n\n dom\n .addClass(this, 'drag')\n .bind(window, 'mouseup', function(e) {\n dom.removeClass(_this.__selector, 'drag');\n });\n\n });\n\n var value_field = document.createElement('div');\n\n common.extend(this.__selector.style, {\n width: '122px',\n height: '102px',\n padding: '3px',\n backgroundColor: '#222',\n boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'\n });\n\n common.extend(this.__field_knob.style, {\n position: 'absolute',\n width: '12px',\n height: '12px',\n border: this.__field_knob_border + (this.__color.v < .5 ? '#fff' : '#000'),\n boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',\n borderRadius: '12px',\n zIndex: 1\n });\n \n common.extend(this.__hue_knob.style, {\n position: 'absolute',\n width: '15px',\n height: '2px',\n borderRight: '4px solid #fff',\n zIndex: 1\n });\n\n common.extend(this.__saturation_field.style, {\n width: '100px',\n height: '100px',\n border: '1px solid #555',\n marginRight: '3px',\n display: 'inline-block',\n cursor: 'pointer'\n });\n\n common.extend(value_field.style, {\n width: '100%',\n height: '100%',\n background: 'none'\n });\n \n linearGradient(value_field, 'top', 'rgba(0,0,0,0)', '#000');\n\n common.extend(this.__hue_field.style, {\n width: '15px',\n height: '100px',\n display: 'inline-block',\n border: '1px solid #555',\n cursor: 'ns-resize'\n });\n\n hueGradient(this.__hue_field);\n\n common.extend(this.__input.style, {\n outline: 'none',\n// width: '120px',\n textAlign: 'center',\n// padding: '4px',\n// marginBottom: '6px',\n color: '#fff',\n border: 0,\n fontWeight: 'bold',\n textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'\n });\n\n dom.bind(this.__saturation_field, 'mousedown', fieldDown);\n dom.bind(this.__field_knob, 'mousedown', fieldDown);\n\n dom.bind(this.__hue_field, 'mousedown', function(e) {\n setH(e);\n dom.bind(window, 'mousemove', setH);\n dom.bind(window, 'mouseup', unbindH);\n });\n\n function fieldDown(e) {\n setSV(e);\n // document.body.style.cursor = 'none';\n dom.bind(window, 'mousemove', setSV);\n dom.bind(window, 'mouseup', unbindSV);\n }\n\n function unbindSV() {\n dom.unbind(window, 'mousemove', setSV);\n dom.unbind(window, 'mouseup', unbindSV);\n // document.body.style.cursor = 'default';\n }\n\n function onBlur() {\n var i = interpret(this.value);\n if (i !== false) {\n _this.__color.__state = i;\n _this.setValue(_this.__color.toOriginal());\n } else {\n this.value = _this.__color.toString();\n }\n }\n\n function unbindH() {\n dom.unbind(window, 'mousemove', setH);\n dom.unbind(window, 'mouseup', unbindH);\n }\n\n this.__saturation_field.appendChild(value_field);\n this.__selector.appendChild(this.__field_knob);\n this.__selector.appendChild(this.__saturation_field);\n this.__selector.appendChild(this.__hue_field);\n this.__hue_field.appendChild(this.__hue_knob);\n\n this.domElement.appendChild(this.__input);\n this.domElement.appendChild(this.__selector);\n\n this.updateDisplay();\n\n function setSV(e) {\n\n e.preventDefault();\n\n var w = dom.getWidth(_this.__saturation_field);\n var o = dom.getOffset(_this.__saturation_field);\n var s = (e.clientX - o.left + document.body.scrollLeft) / w;\n var v = 1 - (e.clientY - o.top + document.body.scrollTop) / w;\n\n if (v > 1) v = 1;\n else if (v < 0) v = 0;\n\n if (s > 1) s = 1;\n else if (s < 0) s = 0;\n\n _this.__color.v = v;\n _this.__color.s = s;\n\n _this.setValue(_this.__color.toOriginal());\n\n\n return false;\n\n }\n\n function setH(e) {\n\n e.preventDefault();\n\n var s = dom.getHeight(_this.__hue_field);\n var o = dom.getOffset(_this.__hue_field);\n var h = 1 - (e.clientY - o.top + document.body.scrollTop) / s;\n\n if (h > 1) h = 1;\n else if (h < 0) h = 0;\n\n _this.__color.h = h * 360;\n\n _this.setValue(_this.__color.toOriginal());\n\n return false;\n\n }\n\n };\n\n ColorController.superclass = Controller;\n\n common.extend(\n\n ColorController.prototype,\n Controller.prototype,\n\n {\n\n updateDisplay: function() {\n\n var i = interpret(this.getValue());\n\n if (i !== false) {\n\n var mismatch = false;\n\n // Check for mismatch on the interpreted value.\n\n common.each(Color.COMPONENTS, function(component) {\n if (!common.isUndefined(i[component]) &&\n !common.isUndefined(this.__color.__state[component]) &&\n i[component] !== this.__color.__state[component]) {\n mismatch = true;\n return {}; // break\n }\n }, this);\n\n // If nothing diverges, we keep our previous values\n // for statefulness, otherwise we recalculate fresh\n if (mismatch) {\n common.extend(this.__color.__state, i);\n }\n\n }\n\n common.extend(this.__temp.__state, this.__color.__state);\n\n this.__temp.a = 1;\n\n var flip = (this.__color.v < .5 || this.__color.s > .5) ? 255 : 0;\n var _flip = 255 - flip;\n\n common.extend(this.__field_knob.style, {\n marginLeft: 100 * this.__color.s - 7 + 'px',\n marginTop: 100 * (1 - this.__color.v) - 7 + 'px',\n backgroundColor: this.__temp.toString(),\n border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip +')'\n });\n\n this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px'\n\n this.__temp.s = 1;\n this.__temp.v = 1;\n\n linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toString());\n\n common.extend(this.__input.style, {\n backgroundColor: this.__input.value = this.__color.toString(),\n color: 'rgb(' + flip + ',' + flip + ',' + flip +')',\n textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip +',.7)'\n });\n\n }\n\n }\n\n );\n \n var vendors = ['-moz-','-o-','-webkit-','-ms-',''];\n \n function linearGradient(elem, x, a, b) {\n elem.style.background = '';\n common.each(vendors, function(vendor) {\n elem.style.cssText += 'background: ' + vendor + 'linear-gradient('+x+', '+a+' 0%, ' + b + ' 100%); ';\n });\n }\n \n function hueGradient(elem) {\n elem.style.background = '';\n elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'\n elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'\n elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'\n elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'\n elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'\n }\n\n\n return ColorController;\n\n})(dat.controllers.Controller,\ndat.dom.dom,\ndat.color.Color = (function (interpret, math, toString, common) {\n\n var Color = function() {\n\n this.__state = interpret.apply(this, arguments);\n\n if (this.__state === false) {\n throw 'Failed to interpret color arguments';\n }\n\n this.__state.a = this.__state.a || 1;\n\n\n };\n\n Color.COMPONENTS = ['r','g','b','h','s','v','hex','a'];\n\n common.extend(Color.prototype, {\n\n toString: function() {\n return toString(this);\n },\n\n toOriginal: function() {\n return this.__state.conversion.write(this);\n }\n\n });\n\n defineRGBComponent(Color.prototype, 'r', 2);\n defineRGBComponent(Color.prototype, 'g', 1);\n defineRGBComponent(Color.prototype, 'b', 0);\n\n defineHSVComponent(Color.prototype, 'h');\n defineHSVComponent(Color.prototype, 's');\n defineHSVComponent(Color.prototype, 'v');\n\n Object.defineProperty(Color.prototype, 'a', {\n\n get: function() {\n return this.__state.a;\n },\n\n set: function(v) {\n this.__state.a = v;\n }\n\n });\n\n Object.defineProperty(Color.prototype, 'hex', {\n\n get: function() {\n\n if (!this.__state.space !== 'HEX') {\n this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b);\n }\n\n return this.__state.hex;\n\n },\n\n set: function(v) {\n\n this.__state.space = 'HEX';\n this.__state.hex = v;\n\n }\n\n });\n\n function defineRGBComponent(target, component, componentHexIndex) {\n\n Object.defineProperty(target, component, {\n\n get: function() {\n\n if (this.__state.space === 'RGB') {\n return this.__state[component];\n }\n\n recalculateRGB(this, component, componentHexIndex);\n\n return this.__state[component];\n\n },\n\n set: function(v) {\n\n if (this.__state.space !== 'RGB') {\n recalculateRGB(this, component, componentHexIndex);\n this.__state.space = 'RGB';\n }\n\n this.__state[component] = v;\n\n }\n\n });\n\n }\n\n function defineHSVComponent(target, component) {\n\n Object.defineProperty(target, component, {\n\n get: function() {\n\n if (this.__state.space === 'HSV')\n return this.__state[component];\n\n recalculateHSV(this);\n\n return this.__state[component];\n\n },\n\n set: function(v) {\n\n if (this.__state.space !== 'HSV') {\n recalculateHSV(this);\n this.__state.space = 'HSV';\n }\n\n this.__state[component] = v;\n\n }\n\n });\n\n }\n\n function recalculateRGB(color, component, componentHexIndex) {\n\n if (color.__state.space === 'HEX') {\n\n color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex);\n\n } else if (color.__state.space === 'HSV') {\n\n common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v));\n\n } else {\n\n throw 'Corrupted color state';\n\n }\n\n }\n\n function recalculateHSV(color) {\n\n var result = math.rgb_to_hsv(color.r, color.g, color.b);\n\n common.extend(color.__state,\n {\n s: result.s,\n v: result.v\n }\n );\n\n if (!common.isNaN(result.h)) {\n color.__state.h = result.h;\n } else if (common.isUndefined(color.__state.h)) {\n color.__state.h = 0;\n }\n\n }\n\n return Color;\n\n})(dat.color.interpret,\ndat.color.math = (function () {\n\n var tmpComponent;\n\n return {\n\n hsv_to_rgb: function(h, s, v) {\n\n var hi = Math.floor(h / 60) % 6;\n\n var f = h / 60 - Math.floor(h / 60);\n var p = v * (1.0 - s);\n var q = v * (1.0 - (f * s));\n var t = v * (1.0 - ((1.0 - f) * s));\n var c = [\n [v, t, p],\n [q, v, p],\n [p, v, t],\n [p, q, v],\n [t, p, v],\n [v, p, q]\n ][hi];\n\n return {\n r: c[0] * 255,\n g: c[1] * 255,\n b: c[2] * 255\n };\n\n },\n\n rgb_to_hsv: function(r, g, b) {\n\n var min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n delta = max - min,\n h, s;\n\n if (max != 0) {\n s = delta / max;\n } else {\n return {\n h: NaN,\n s: 0,\n v: 0\n };\n }\n\n if (r == max) {\n h = (g - b) / delta;\n } else if (g == max) {\n h = 2 + (b - r) / delta;\n } else {\n h = 4 + (r - g) / delta;\n }\n h /= 6;\n if (h < 0) {\n h += 1;\n }\n\n return {\n h: h * 360,\n s: s,\n v: max / 255\n };\n },\n\n rgb_to_hex: function(r, g, b) {\n var hex = this.hex_with_component(0, 2, r);\n hex = this.hex_with_component(hex, 1, g);\n hex = this.hex_with_component(hex, 0, b);\n return hex;\n },\n\n component_from_hex: function(hex, componentIndex) {\n return (hex >> (componentIndex * 8)) & 0xFF;\n },\n\n hex_with_component: function(hex, componentIndex, value) {\n return value << (tmpComponent = componentIndex * 8) | (hex & ~ (0xFF << tmpComponent));\n }\n\n }\n\n})(),\ndat.color.toString,\ndat.utils.common),\ndat.color.interpret,\ndat.utils.common),\ndat.utils.requestAnimationFrame = (function () {\n\n /**\n * requirejs version of Paul Irish's RequestAnimationFrame\n * http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n */\n\n return window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function(callback, element) {\n\n window.setTimeout(callback, 1000 / 60);\n\n };\n})(),\ndat.dom.CenteredDiv = (function (dom, common) {\n\n\n var CenteredDiv = function() {\n\n this.backgroundElement = document.createElement('div');\n common.extend(this.backgroundElement.style, {\n backgroundColor: 'rgba(0,0,0,0.8)',\n top: 0,\n left: 0,\n display: 'none',\n zIndex: '1000',\n opacity: 0,\n WebkitTransition: 'opacity 0.2s linear'\n });\n\n dom.makeFullscreen(this.backgroundElement);\n this.backgroundElement.style.position = 'fixed';\n\n this.domElement = document.createElement('div');\n common.extend(this.domElement.style, {\n position: 'fixed',\n display: 'none',\n zIndex: '1001',\n opacity: 0,\n WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear'\n });\n\n\n document.body.appendChild(this.backgroundElement);\n document.body.appendChild(this.domElement);\n\n var _this = this;\n dom.bind(this.backgroundElement, 'click', function() {\n _this.hide();\n });\n\n\n };\n\n CenteredDiv.prototype.show = function() {\n\n var _this = this;\n \n\n\n this.backgroundElement.style.display = 'block';\n\n this.domElement.style.display = 'block';\n this.domElement.style.opacity = 0;\n// this.domElement.style.top = '52%';\n this.domElement.style.webkitTransform = 'scale(1.1)';\n\n this.layout();\n\n common.defer(function() {\n _this.backgroundElement.style.opacity = 1;\n _this.domElement.style.opacity = 1;\n _this.domElement.style.webkitTransform = 'scale(1)';\n });\n\n };\n\n CenteredDiv.prototype.hide = function() {\n\n var _this = this;\n\n var hide = function() {\n\n _this.domElement.style.display = 'none';\n _this.backgroundElement.style.display = 'none';\n\n dom.unbind(_this.domElement, 'webkitTransitionEnd', hide);\n dom.unbind(_this.domElement, 'transitionend', hide);\n dom.unbind(_this.domElement, 'oTransitionEnd', hide);\n\n };\n\n dom.bind(this.domElement, 'webkitTransitionEnd', hide);\n dom.bind(this.domElement, 'transitionend', hide);\n dom.bind(this.domElement, 'oTransitionEnd', hide);\n\n this.backgroundElement.style.opacity = 0;\n// this.domElement.style.top = '48%';\n this.domElement.style.opacity = 0;\n this.domElement.style.webkitTransform = 'scale(1.1)';\n\n };\n\n CenteredDiv.prototype.layout = function() {\n this.domElement.style.left = window.innerWidth/2 - dom.getWidth(this.domElement) / 2 + 'px';\n this.domElement.style.top = window.innerHeight/2 - dom.getHeight(this.domElement) / 2 + 'px';\n };\n \n function lockScroll(e) {\n console.log(e);\n }\n\n return CenteredDiv;\n\n})(dat.dom.dom,\ndat.utils.common),\ndat.dom.dom,\ndat.utils.common);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dat-gui/vendor/dat.gui.js\n// module id = 27\n// module chunks = 0","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n/** @namespace */\nvar dat = module.exports = dat || {};\n\n/** @namespace */\ndat.color = dat.color || {};\n\n/** @namespace */\ndat.utils = dat.utils || {};\n\ndat.utils.common = (function () {\n \n var ARR_EACH = Array.prototype.forEach;\n var ARR_SLICE = Array.prototype.slice;\n\n /**\n * Band-aid methods for things that should be a lot easier in JavaScript.\n * Implementation and structure inspired by underscore.js\n * http://documentcloud.github.com/underscore/\n */\n\n return { \n \n BREAK: {},\n \n extend: function(target) {\n \n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n \n for (var key in obj)\n if (!this.isUndefined(obj[key])) \n target[key] = obj[key];\n \n }, this);\n \n return target;\n \n },\n \n defaults: function(target) {\n \n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n \n for (var key in obj)\n if (this.isUndefined(target[key])) \n target[key] = obj[key];\n \n }, this);\n \n return target;\n \n },\n \n compose: function() {\n var toCall = ARR_SLICE.call(arguments);\n return function() {\n var args = ARR_SLICE.call(arguments);\n for (var i = toCall.length -1; i >= 0; i--) {\n args = [toCall[i].apply(this, args)];\n }\n return args[0];\n }\n },\n \n each: function(obj, itr, scope) {\n\n \n if (ARR_EACH && obj.forEach === ARR_EACH) { \n \n obj.forEach(itr, scope);\n \n } else if (obj.length === obj.length + 0) { // Is number but not NaN\n \n for (var key = 0, l = obj.length; key < l; key++)\n if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) \n return;\n \n } else {\n\n for (var key in obj) \n if (itr.call(scope, obj[key], key) === this.BREAK)\n return;\n \n }\n \n },\n \n defer: function(fnc) {\n setTimeout(fnc, 0);\n },\n \n toArray: function(obj) {\n if (obj.toArray) return obj.toArray();\n return ARR_SLICE.call(obj);\n },\n\n isUndefined: function(obj) {\n return obj === undefined;\n },\n \n isNull: function(obj) {\n return obj === null;\n },\n \n isNaN: function(obj) {\n return obj !== obj;\n },\n \n isArray: Array.isArray || function(obj) {\n return obj.constructor === Array;\n },\n \n isObject: function(obj) {\n return obj === Object(obj);\n },\n \n isNumber: function(obj) {\n return obj === obj+0;\n },\n \n isString: function(obj) {\n return obj === obj+'';\n },\n \n isBoolean: function(obj) {\n return obj === false || obj === true;\n },\n \n isFunction: function(obj) {\n return Object.prototype.toString.call(obj) === '[object Function]';\n }\n \n };\n \n})();\n\n\ndat.color.toString = (function (common) {\n\n return function(color) {\n\n if (color.a == 1 || common.isUndefined(color.a)) {\n\n var s = color.hex.toString(16);\n while (s.length < 6) {\n s = '0' + s;\n }\n\n return '#' + s;\n\n } else {\n\n return 'rgba(' + Math.round(color.r) + ',' + Math.round(color.g) + ',' + Math.round(color.b) + ',' + color.a + ')';\n\n }\n\n }\n\n})(dat.utils.common);\n\n\ndat.Color = dat.color.Color = (function (interpret, math, toString, common) {\n\n var Color = function() {\n\n this.__state = interpret.apply(this, arguments);\n\n if (this.__state === false) {\n throw 'Failed to interpret color arguments';\n }\n\n this.__state.a = this.__state.a || 1;\n\n\n };\n\n Color.COMPONENTS = ['r','g','b','h','s','v','hex','a'];\n\n common.extend(Color.prototype, {\n\n toString: function() {\n return toString(this);\n },\n\n toOriginal: function() {\n return this.__state.conversion.write(this);\n }\n\n });\n\n defineRGBComponent(Color.prototype, 'r', 2);\n defineRGBComponent(Color.prototype, 'g', 1);\n defineRGBComponent(Color.prototype, 'b', 0);\n\n defineHSVComponent(Color.prototype, 'h');\n defineHSVComponent(Color.prototype, 's');\n defineHSVComponent(Color.prototype, 'v');\n\n Object.defineProperty(Color.prototype, 'a', {\n\n get: function() {\n return this.__state.a;\n },\n\n set: function(v) {\n this.__state.a = v;\n }\n\n });\n\n Object.defineProperty(Color.prototype, 'hex', {\n\n get: function() {\n\n if (!this.__state.space !== 'HEX') {\n this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b);\n }\n\n return this.__state.hex;\n\n },\n\n set: function(v) {\n\n this.__state.space = 'HEX';\n this.__state.hex = v;\n\n }\n\n });\n\n function defineRGBComponent(target, component, componentHexIndex) {\n\n Object.defineProperty(target, component, {\n\n get: function() {\n\n if (this.__state.space === 'RGB') {\n return this.__state[component];\n }\n\n recalculateRGB(this, component, componentHexIndex);\n\n return this.__state[component];\n\n },\n\n set: function(v) {\n\n if (this.__state.space !== 'RGB') {\n recalculateRGB(this, component, componentHexIndex);\n this.__state.space = 'RGB';\n }\n\n this.__state[component] = v;\n\n }\n\n });\n\n }\n\n function defineHSVComponent(target, component) {\n\n Object.defineProperty(target, component, {\n\n get: function() {\n\n if (this.__state.space === 'HSV')\n return this.__state[component];\n\n recalculateHSV(this);\n\n return this.__state[component];\n\n },\n\n set: function(v) {\n\n if (this.__state.space !== 'HSV') {\n recalculateHSV(this);\n this.__state.space = 'HSV';\n }\n\n this.__state[component] = v;\n\n }\n\n });\n\n }\n\n function recalculateRGB(color, component, componentHexIndex) {\n\n if (color.__state.space === 'HEX') {\n\n color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex);\n\n } else if (color.__state.space === 'HSV') {\n\n common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v));\n\n } else {\n\n throw 'Corrupted color state';\n\n }\n\n }\n\n function recalculateHSV(color) {\n\n var result = math.rgb_to_hsv(color.r, color.g, color.b);\n\n common.extend(color.__state,\n {\n s: result.s,\n v: result.v\n }\n );\n\n if (!common.isNaN(result.h)) {\n color.__state.h = result.h;\n } else if (common.isUndefined(color.__state.h)) {\n color.__state.h = 0;\n }\n\n }\n\n return Color;\n\n})(dat.color.interpret = (function (toString, common) {\n\n var result, toReturn;\n\n var interpret = function() {\n\n toReturn = false;\n\n var original = arguments.length > 1 ? common.toArray(arguments) : arguments[0];\n\n common.each(INTERPRETATIONS, function(family) {\n\n if (family.litmus(original)) {\n\n common.each(family.conversions, function(conversion, conversionName) {\n\n result = conversion.read(original);\n\n if (toReturn === false && result !== false) {\n toReturn = result;\n result.conversionName = conversionName;\n result.conversion = conversion;\n return common.BREAK;\n\n }\n\n });\n\n return common.BREAK;\n\n }\n\n });\n\n return toReturn;\n\n };\n\n var INTERPRETATIONS = [\n\n // Strings\n {\n\n litmus: common.isString,\n\n conversions: {\n\n THREE_CHAR_HEX: {\n\n read: function(original) {\n\n var test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);\n if (test === null) return false;\n\n return {\n space: 'HEX',\n hex: parseInt(\n '0x' +\n test[1].toString() + test[1].toString() +\n test[2].toString() + test[2].toString() +\n test[3].toString() + test[3].toString())\n };\n\n },\n\n write: toString\n\n },\n\n SIX_CHAR_HEX: {\n\n read: function(original) {\n\n var test = original.match(/^#([A-F0-9]{6})$/i);\n if (test === null) return false;\n\n return {\n space: 'HEX',\n hex: parseInt('0x' + test[1].toString())\n };\n\n },\n\n write: toString\n\n },\n\n CSS_RGB: {\n\n read: function(original) {\n\n var test = original.match(/^rgb\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\n if (test === null) return false;\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3])\n };\n\n },\n\n write: toString\n\n },\n\n CSS_RGBA: {\n\n read: function(original) {\n\n var test = original.match(/^rgba\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\,\\s*(.+)\\s*\\)/);\n if (test === null) return false;\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3]),\n a: parseFloat(test[4])\n };\n\n },\n\n write: toString\n\n }\n\n }\n\n },\n\n // Numbers\n {\n\n litmus: common.isNumber,\n\n conversions: {\n\n HEX: {\n read: function(original) {\n return {\n space: 'HEX',\n hex: original,\n conversionName: 'HEX'\n }\n },\n\n write: function(color) {\n return color.hex;\n }\n }\n\n }\n\n },\n\n // Arrays\n {\n\n litmus: common.isArray,\n\n conversions: {\n\n RGB_ARRAY: {\n read: function(original) {\n if (original.length != 3) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b];\n }\n\n },\n\n RGBA_ARRAY: {\n read: function(original) {\n if (original.length != 4) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2],\n a: original[3]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b, color.a];\n }\n\n }\n\n }\n\n },\n\n // Objects\n {\n\n litmus: common.isObject,\n\n conversions: {\n\n RGBA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b) &&\n common.isNumber(original.a)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b,\n a: original.a\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b,\n a: color.a\n }\n }\n },\n\n RGB_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b\n }\n }\n },\n\n HSVA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v) &&\n common.isNumber(original.a)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v,\n a: original.a\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v,\n a: color.a\n }\n }\n },\n\n HSV_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v\n }\n }\n\n }\n\n }\n\n }\n\n\n ];\n\n return interpret;\n\n\n})(dat.color.toString,\ndat.utils.common),\ndat.color.math = (function () {\n\n var tmpComponent;\n\n return {\n\n hsv_to_rgb: function(h, s, v) {\n\n var hi = Math.floor(h / 60) % 6;\n\n var f = h / 60 - Math.floor(h / 60);\n var p = v * (1.0 - s);\n var q = v * (1.0 - (f * s));\n var t = v * (1.0 - ((1.0 - f) * s));\n var c = [\n [v, t, p],\n [q, v, p],\n [p, v, t],\n [p, q, v],\n [t, p, v],\n [v, p, q]\n ][hi];\n\n return {\n r: c[0] * 255,\n g: c[1] * 255,\n b: c[2] * 255\n };\n\n },\n\n rgb_to_hsv: function(r, g, b) {\n\n var min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n delta = max - min,\n h, s;\n\n if (max != 0) {\n s = delta / max;\n } else {\n return {\n h: NaN,\n s: 0,\n v: 0\n };\n }\n\n if (r == max) {\n h = (g - b) / delta;\n } else if (g == max) {\n h = 2 + (b - r) / delta;\n } else {\n h = 4 + (r - g) / delta;\n }\n h /= 6;\n if (h < 0) {\n h += 1;\n }\n\n return {\n h: h * 360,\n s: s,\n v: max / 255\n };\n },\n\n rgb_to_hex: function(r, g, b) {\n var hex = this.hex_with_component(0, 2, r);\n hex = this.hex_with_component(hex, 1, g);\n hex = this.hex_with_component(hex, 0, b);\n return hex;\n },\n\n component_from_hex: function(hex, componentIndex) {\n return (hex >> (componentIndex * 8)) & 0xFF;\n },\n\n hex_with_component: function(hex, componentIndex, value) {\n return value << (tmpComponent = componentIndex * 8) | (hex & ~ (0xFF << tmpComponent));\n }\n\n }\n\n})(),\ndat.color.toString,\ndat.utils.common);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/dat-gui/vendor/dat.color.js\n// module id = 28\n// module chunks = 0","import {vec3, vec4} from 'gl-matrix';\r\nimport Drawable from '../rendering/gl/Drawable';\r\nimport {gl} from '../globals';\r\n\r\nclass Icosphere extends Drawable {\r\n buffer: ArrayBuffer;\r\n indices: Uint32Array;\r\n positions: Float32Array;\r\n normals: Float32Array;\r\n center: vec4;\r\n\r\n constructor(center: vec3, public radius: number, public subdivisions: number) {\r\n super(); // Call the constructor of the super class. This is required.\r\n this.center = vec4.fromValues(center[0], center[1], center[2], 1);\r\n }\r\n\r\n create() {\r\n const X = 0.525731112119133606;\r\n const Z = 0.850650808352039932;\r\n const N = 0;\r\n\r\n let maxIndexCount = 20 * Math.pow(4, this.subdivisions);\r\n let maxVertexCount = 10 * Math.pow(4, this.subdivisions) + 2;\r\n\r\n // Create buffers to back geometry data\r\n // Index data will ping pong back and forth between buffer0 and buffer1 during creation\r\n // All data will be in buffer0 at the end\r\n const buffer0 = new ArrayBuffer(\r\n maxIndexCount * 3 * Uint32Array.BYTES_PER_ELEMENT +\r\n maxVertexCount * 4 * Float32Array.BYTES_PER_ELEMENT +\r\n maxVertexCount * 4 * Float32Array.BYTES_PER_ELEMENT\r\n );\r\n const buffer1 = new ArrayBuffer(\r\n maxIndexCount * 3 * Uint32Array.BYTES_PER_ELEMENT\r\n );\r\n const buffers = [buffer0, buffer1];\r\n let b = 0;\r\n\r\n const indexByteOffset = 0;\r\n const vertexByteOffset = maxIndexCount * 3 * Uint32Array.BYTES_PER_ELEMENT;\r\n const normalByteOffset = vertexByteOffset;\r\n const positionByteOffset = vertexByteOffset + maxVertexCount * 4 * Float32Array.BYTES_PER_ELEMENT;\r\n\r\n // Create 3-uint buffer views into the backing buffer to represent triangles\r\n // The C++ analogy to this would be something like:\r\n // triangles[i] = reinterpret_cast<std::array<unsigned int, 3>*>(&buffer[offset]);\r\n let triangles: Array<Uint32Array> = new Array(20);\r\n let nextTriangles: Array<Uint32Array> = new Array();\r\n for (let i = 0; i < 20; ++i) {\r\n triangles[i] = new Uint32Array(buffers[b], indexByteOffset + i * 3 * Uint32Array.BYTES_PER_ELEMENT, 3);\r\n }\r\n\r\n // Create 3-float buffer views into the backing buffer to represent positions\r\n let vertices: Array<vec4> = new Array(12);\r\n for (let i = 0; i < 12; ++i) {\r\n vertices[i] = <vec4> new Float32Array(buffer0, vertexByteOffset + i * 4 * Float32Array.BYTES_PER_ELEMENT, 4);\r\n }\r\n\r\n // Initialize normals for a 20-sided icosahedron\r\n vertices[0].set([ -X,N,Z,0 ]);\r\n vertices[1].set([ X,N,Z,0 ]);\r\n vertices[2].set([ -X,N,-Z,0 ]);\r\n vertices[3].set([ X,N,-Z,0 ]);\r\n vertices[4].set([ N,Z,X,0 ]);\r\n vertices[5].set([ N,Z,-X,0 ]);\r\n vertices[6].set([ N,-Z,X,0 ]);\r\n vertices[7].set([ N,-Z,-X,0 ]);\r\n vertices[8].set([ Z,X,N,0 ]);\r\n vertices[9].set([ -Z,X, N,0 ]);\r\n vertices[10].set([ Z,-X,N,0 ]);\r\n vertices[11].set([ -Z,-X,N,0 ]);\r\n\r\n // Initialize indices for a 20-sided icosahedron\r\n triangles[0].set([ 0,4,1 ]);\r\n triangles[1].set([ 0,9,4 ]);\r\n triangles[2].set([ 9,5,4 ]);\r\n triangles[3].set([ 4,5,8 ]);\r\n triangles[4].set([ 4,8,1 ]);\r\n triangles[5].set([ 8,10,1 ]);\r\n triangles[6].set([ 8,3,10 ]);\r\n triangles[7].set([ 5,3,8 ]);\r\n triangles[8].set([ 5,2,3 ]);\r\n triangles[9].set([ 2,7,3 ]);\r\n triangles[10].set([ 7,10,3 ]);\r\n triangles[11].set([ 7,6,10 ]);\r\n triangles[12].set([ 7,11,6 ]);\r\n triangles[13].set([ 11,0,6 ]);\r\n triangles[14].set([ 0,1,6 ],);\r\n triangles[15].set([ 6,1,10 ]);\r\n triangles[16].set([ 9,0,11 ]);\r\n triangles[17].set([ 9,11,2 ]);\r\n triangles[18].set([ 9,2,5 ]);\r\n triangles[19].set([ 7,2,11 ]);\r\n\r\n // This loop subdivides the icosahedron\r\n for (let s = 0; s < this.subdivisions; ++s) {\r\n b = 1 - b;\r\n nextTriangles.length = triangles.length * 4;\r\n let triangleIdx = 0;\r\n\r\n // edgeMap maps a pair of vertex indices to a vertex index at their midpoint\r\n // The function `mid` will get that midpoint vertex if it has already been created\r\n // or it will create the vertex and add it to the map\r\n let edgeMap: Map<string, number> = new Map();\r\n function mid(v0: number, v1: number): number {\r\n let key = [v0, v1].sort().join('_');\r\n if (!edgeMap.has(key)) {\r\n let midpoint = <vec4> new Float32Array(buffer0, vertexByteOffset + vertices.length * 4 * Float32Array.BYTES_PER_ELEMENT, 4);\r\n vec4.add(midpoint, vertices[v0], vertices[v1]);\r\n vec4.normalize(midpoint, midpoint);\r\n edgeMap.set(key, vertices.length);\r\n vertices.push(midpoint);\r\n }\r\n return edgeMap.get(key);\r\n }\r\n\r\n for (let t = 0; t < triangles.length; ++t) {\r\n let v0 = triangles[t][0];\r\n let v1 = triangles[t][1];\r\n let v2 = triangles[t][2];\r\n let v3 = mid(v0, v1); // Get or create a vertex between these two vertices\r\n let v4 = mid(v1, v2);\r\n let v5 = mid(v2, v0);\r\n\r\n let t0 = nextTriangles[triangleIdx] = new Uint32Array(buffers[b], indexByteOffset + (triangleIdx++) * 3 * Uint32Array.BYTES_PER_ELEMENT, 3);\r\n let t1 = nextTriangles[triangleIdx] = new Uint32Array(buffers[b], indexByteOffset + (triangleIdx++) * 3 * Uint32Array.BYTES_PER_ELEMENT, 3);\r\n let t2 = nextTriangles[triangleIdx] = new Uint32Array(buffers[b], indexByteOffset + (triangleIdx++) * 3 * Uint32Array.BYTES_PER_ELEMENT, 3);\r\n let t3 = nextTriangles[triangleIdx] = new Uint32Array(buffers[b], indexByteOffset + (triangleIdx++) * 3 * Uint32Array.BYTES_PER_ELEMENT, 3);\r\n\r\n let triangleOffset = nextTriangles.length;\r\n t0.set([v0, v3, v5]);\r\n t1.set([v3, v4, v5]);\r\n t2.set([v3, v1, v4]);\r\n t3.set([v5, v4, v2]);\r\n }\r\n\r\n // swap buffers\r\n let temp = triangles;\r\n triangles = nextTriangles;\r\n nextTriangles = temp;\r\n }\r\n\r\n if (b === 1) {\r\n // if indices did not end up in buffer0, copy them there now\r\n let temp0 = new Uint32Array(buffer0, 0, 3 * triangles.length);\r\n let temp1 = new Uint32Array(buffer1, 0, 3 * triangles.length);\r\n temp0.set(temp1);\r\n }\r\n\r\n // Populate one position for each normal\r\n for (let i = 0; i < vertices.length; ++i) {\r\n let pos = <vec4> new Float32Array(buffer0, positionByteOffset + i * 4 * Float32Array.BYTES_PER_ELEMENT, 4);\r\n vec4.scaleAndAdd(pos, this.center, vertices[i], this.radius);\r\n }\r\n\r\n this.buffer = buffer0;\r\n this.indices = new Uint32Array(this.buffer, indexByteOffset, triangles.length * 3);\r\n this.normals = new Float32Array(this.buffer, normalByteOffset, vertices.length * 4);\r\n this.positions = new Float32Array(this.buffer, positionByteOffset, vertices.length * 4);\r\n\r\n this.generateIdx();\r\n this.generatePos();\r\n this.generateNor();\r\n\r\n this.count = this.indices.length;\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.bufIdx);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);\r\n\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.bufNor);\r\n gl.bufferData(gl.ARRAY_BUFFER, this.normals, gl.STATIC_DRAW);\r\n\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.bufPos);\r\n gl.bufferData(gl.ARRAY_BUFFER, this.positions, gl.STATIC_DRAW);\r\n\r\n console.log(`Created icosphere with ${vertices.length} vertices`);\r\n }\r\n};\r\n\r\nexport default Icosphere;\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/geometry/Icosphere.ts","import {vec3, vec4} from 'gl-matrix';\r\nimport Drawable from '../rendering/gl/Drawable';\r\nimport {gl} from '../globals';\r\n\r\nclass Square extends Drawable {\r\n indices: Uint32Array;\r\n positions: Float32Array;\r\n normals: Float32Array;\r\n center: vec4;\r\n\r\n constructor(center: vec3) {\r\n super(); // Call the constructor of the super class. This is required.\r\n this.center = vec4.fromValues(center[0], center[1], center[2], 1);\r\n }\r\n\r\n create() {\r\n\r\n this.indices = new Uint32Array([0, 1, 2,\r\n 0, 2, 3]);\r\n this.normals = new Float32Array([0, 0, 1, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 1, 0,\r\n 0, 0, 1, 0]);\r\n this.positions = new Float32Array([-1, -1, 0, 1,\r\n 1, -1, 0, 1,\r\n 1, 1, 0, 1,\r\n -1, 1, 0, 1]);\r\n\r\n this.generateIdx();\r\n this.generatePos();\r\n this.generateNor();\r\n\r\n this.count = this.indices.length;\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.bufIdx);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);\r\n\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.bufNor);\r\n gl.bufferData(gl.ARRAY_BUFFER, this.normals, gl.STATIC_DRAW);\r\n\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.bufPos);\r\n gl.bufferData(gl.ARRAY_BUFFER, this.positions, gl.STATIC_DRAW);\r\n\r\n console.log(`Created square`);\r\n }\r\n};\r\n\r\nexport default Square;\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/geometry/Square.ts","import {mat4, vec2, vec4} from 'gl-matrix';\r\nimport Drawable from './Drawable';\r\nimport Camera from '../../Camera';\r\nimport {gl} from '../../globals';\r\nimport ShaderProgram from './ShaderProgram';\r\n\r\n// In this file, `gl` is accessible because it is imported above\r\nclass OpenGLRenderer {\r\n constructor(public canvas: HTMLCanvasElement) {\r\n }\r\n\r\n setClearColor(r: number, g: number, b: number, a: number) {\r\n gl.clearColor(r, g, b, a);\r\n }\r\n\r\n setSize(width: number, height: number) {\r\n this.canvas.width = width;\r\n this.canvas.height = height;\r\n }\r\n\r\n clear() {\r\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\r\n }\r\n renderBackground(camera: Camera, prog: ShaderProgram, drawables: Array<Drawable>,\r\n \r\n cameraPosParam: vec4,\r\n screenSizeParam: vec4,\r\n AtmosphereParam: vec4,\r\n\r\n timeInfo: vec4\r\n )\r\n {\r\n let viewProj = mat4.create();\r\n let AtmosphereColor = vec4.fromValues(AtmosphereParam[0] / 255, AtmosphereParam[1] / 255, AtmosphereParam[2] / 255, AtmosphereParam[3]);\r\n\r\n mat4.multiply(viewProj, camera.projectionMatrix, camera.viewMatrix);\r\n\r\n prog.setViewProjMatrix(viewProj);\r\n prog.setCameraPos(cameraPosParam);\r\n prog.setOceanColor(screenSizeParam);\r\n prog.setAtmosphereColor(AtmosphereColor);\r\n prog.setTimeInfo(timeInfo);\r\n\r\n for (let drawable of drawables)\r\n {\r\n prog.setTexture(drawable.diffuseMap);\r\n prog.setModelMatrix(drawable.modelMat);\r\n prog.draw(drawable);\r\n }\r\n\r\n }\r\n\r\n render(camera: Camera, prog: ShaderProgram, drawables: Array<Drawable>,\r\n sunPosParam: vec4,\r\n\r\n oceanColorParam: vec4,\r\n shorelineParam: vec4,\r\n foliageParam: vec4,\r\n mountainsParam: vec4,\r\n snowParam: vec4,\r\n polarCapsParam: vec4,\r\n AtmosphereParam: vec4,\r\n\r\n heightsParam: vec4,\r\n \r\n timeInfo: vec4,\r\n\r\n cameraPosParam: vec4\r\n )\r\n { \r\n let viewProj = mat4.create();\r\n let sunPos = vec4.fromValues(sunPosParam[0], sunPosParam[1], sunPosParam[2], sunPosParam[3]);\r\n let oceanColor = vec4.fromValues(oceanColorParam[0] / 255, oceanColorParam[1] / 255, oceanColorParam[2] / 255, oceanColorParam[3]);\r\n let shorelineColor = vec4.fromValues(shorelineParam[0] / 255, shorelineParam[1] / 255, shorelineParam[2] / 255, shorelineParam[3]);\r\n let foliageColor = vec4.fromValues(foliageParam[0] / 255, foliageParam[1] / 255, foliageParam[2] / 255, foliageParam[3]);\r\n let mountainsColor = vec4.fromValues(mountainsParam[0] / 255, mountainsParam[1] / 255, mountainsParam[2] / 255, mountainsParam[3]);\r\n let snowColor = vec4.fromValues(snowParam[0] / 255, snowParam[1] / 255, snowParam[2] / 255, snowParam[3]);\r\n let polarCapsColor = vec4.fromValues(polarCapsParam[0] / 255, polarCapsParam[1] / 255, polarCapsParam[2] / 255, polarCapsParam[3]);\r\n let AtmosphereColor = vec4.fromValues(AtmosphereParam[0] / 255, AtmosphereParam[1] / 255, AtmosphereParam[2] / 255, AtmosphereParam[3]);\r\n \r\n mat4.multiply(viewProj, camera.projectionMatrix, camera.viewMatrix);\r\n\r\n prog.setViewProjMatrix(viewProj);\r\n\r\n prog.setSunPos(sunPos);\r\n\r\n prog.setOceanColor(oceanColor);\r\n prog.setShorelineColor(shorelineColor);\r\n prog.setFoliageColor(foliageColor);\r\n prog.setMountainsColor(mountainsColor);\r\n prog.setSnowColor(snowColor);\r\n prog.setPolarCapsColor(polarCapsColor);\r\n prog.setAtmosphereColor(AtmosphereColor);\r\n\r\n prog.setHeights(heightsParam);\r\n\r\n prog.setTimeInfo(timeInfo);\r\n\r\n prog.setCameraPos(cameraPosParam);\r\n\r\n for (let drawable of drawables) {\r\n prog.setTexture(drawable.diffuseMap);\r\n prog.setModelMatrix(drawable.modelMat);\r\n prog.draw(drawable);\r\n }\r\n }\r\n};\r\n\r\nexport default OpenGLRenderer;\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/rendering/gl/OpenGLRenderer.ts","import * as CameraControls from '3d-view-controls';\r\nimport {vec3, mat4} from 'gl-matrix';\r\n\r\nclass Camera {\r\n controls: any;\r\n projectionMatrix: mat4 = mat4.create();\r\n viewMatrix: mat4 = mat4.create();\r\n fovy: number = 45;\r\n aspectRatio: number = 1;\r\n near: number = 0.1;\r\n far: number = 1000;\r\n position: vec3 = vec3.create();\r\n direction: vec3 = vec3.create();\r\n target: vec3 = vec3.create();\r\n up: vec3 = vec3.create();\r\n\r\n constructor(position: vec3, target: vec3) {\r\n const canvas = <HTMLCanvasElement> document.getElementById('canvas');\r\n\r\n this.controls = CameraControls(canvas, {\r\n eye: position,\r\n center: target,\r\n });\r\n\r\n vec3.add(this.target, this.position, this.direction);\r\n mat4.lookAt(this.viewMatrix, this.controls.eye, this.controls.center, this.controls.up);\r\n }\r\n\r\n setAspectRatio(aspectRatio: number) {\r\n this.aspectRatio = aspectRatio;\r\n }\r\n\r\n updateProjectionMatrix() {\r\n mat4.perspective(this.projectionMatrix, this.fovy, this.aspectRatio, this.near, this.far);\r\n }\r\n\r\n update() {\r\n this.controls.tick();\r\n\r\n vec3.add(this.target, this.position, this.direction);\r\n mat4.lookAt(this.viewMatrix, this.controls.eye, this.controls.center, this.controls.up);\r\n\r\n this.position = this.controls.eye;\r\n this.up = this.controls.up;\r\n\r\n }\r\n};\r\n\r\nexport default Camera;\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Camera.ts","'use strict'\r\n\r\nmodule.exports = createCamera\r\n\r\nvar now = require('right-now')\r\nvar createView = require('3d-view')\r\nvar mouseChange = require('mouse-change')\r\nvar mouseWheel = require('mouse-wheel')\r\nvar mouseOffset = require('mouse-event-offset')\r\n\r\nfunction createCamera(element, options) {\r\n element = element || document.body\r\n options = options || {}\r\n\r\n var limits = [ 0.01, Infinity ]\r\n if('distanceLimits' in options) {\r\n limits[0] = options.distanceLimits[0]\r\n limits[1] = options.distanceLimits[1]\r\n }\r\n if('zoomMin' in options) {\r\n limits[0] = options.zoomMin\r\n }\r\n if('zoomMax' in options) {\r\n limits[1] = options.zoomMax\r\n }\r\n\r\n var view = createView({\r\n center: options.center || [0,0,0],\r\n up: options.up || [0,1,0],\r\n eye: options.eye || [0,0,10],\r\n mode: options.mode || 'orbit',\r\n distanceLimits: limits\r\n })\r\n\r\n var pmatrix = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\r\n var distance = 0.0\r\n var width = element.clientWidth\r\n var height = element.clientHeight\r\n\r\n var camera = {\r\n view: view,\r\n element: element,\r\n delay: options.delay || 16,\r\n rotateSpeed: options.rotateSpeed || 1,\r\n zoomSpeed: options.zoomSpeed || 1,\r\n translateSpeed: options.translateSpeed || 1,\r\n flipX: !!options.flipX,\r\n flipY: !!options.flipY,\r\n modes: view.modes,\r\n tick: function() {\r\n var t = now()\r\n var delay = this.delay\r\n view.idle(t-delay)\r\n view.flush(t-(100+delay*2))\r\n var ctime = t - 2 * delay\r\n view.recalcMatrix(ctime)\r\n var allEqual = true\r\n var matrix = view.computedMatrix\r\n for(var i=0; i<16; ++i) {\r\n allEqual = allEqual && (pmatrix[i] === matrix[i])\r\n pmatrix[i] = matrix[i]\r\n }\r\n var sizeChanged =\r\n element.clientWidth === width &&\r\n element.clientHeight === height\r\n width = element.clientWidth\r\n height = element.clientHeight\r\n if(allEqual) {\r\n return !sizeChanged\r\n }\r\n distance = Math.exp(view.computedRadius[0])\r\n return true\r\n },\r\n lookAt: function(center, eye, up) {\r\n view.lookAt(view.lastT(), center, eye, up)\r\n },\r\n rotate: function(pitch, yaw, roll) {\r\n view.rotate(view.lastT(), pitch, yaw, roll)\r\n },\r\n pan: function(dx, dy, dz) {\r\n view.pan(view.lastT(), dx, dy, dz)\r\n },\r\n translate: function(dx, dy, dz) {\r\n view.translate(view.lastT(), dx, dy, dz)\r\n }\r\n }\r\n\r\n Object.defineProperties(camera, {\r\n matrix: {\r\n get: function() {\r\n return view.computedMatrix\r\n },\r\n set: function(mat) {\r\n view.setMatrix(view.lastT(), mat)\r\n return view.computedMatrix\r\n },\r\n enumerable: true\r\n },\r\n mode: {\r\n get: function() {\r\n return view.getMode()\r\n },\r\n set: function(mode) {\r\n view.setMode(mode)\r\n return view.getMode()\r\n },\r\n enumerable: true\r\n },\r\n center: {\r\n get: function() {\r\n return view.computedCenter\r\n },\r\n set: function(ncenter) {\r\n view.lookAt(view.lastT(), ncenter)\r\n return view.computedCenter\r\n },\r\n enumerable: true\r\n },\r\n eye: {\r\n get: function() {\r\n return view.computedEye\r\n },\r\n set: function(neye) {\r\n view.lookAt(view.lastT(), null, neye)\r\n return view.computedEye\r\n },\r\n enumerable: true\r\n },\r\n up: {\r\n get: function() {\r\n return view.computedUp\r\n },\r\n set: function(nup) {\r\n view.lookAt(view.lastT(), null, null, nup)\r\n return view.computedUp\r\n },\r\n enumerable: true\r\n },\r\n distance: {\r\n get: function() {\r\n return distance\r\n },\r\n set: function(d) {\r\n view.setDistance(view.lastT(), d)\r\n return d\r\n },\r\n enumerable: true\r\n },\r\n distanceLimits: {\r\n get: function() {\r\n return view.getDistanceLimits(limits)\r\n },\r\n set: function(v) {\r\n view.setDistanceLimits(v)\r\n return v\r\n },\r\n enumerable: true\r\n }\r\n })\r\n\r\n element.addEventListener('contextmenu', function(ev) {\r\n ev.preventDefault()\r\n return false\r\n })\r\n\r\n var lastX = 0, lastY = 0, lastMods = {shift: false, control: false, alt: false, meta: false}\r\n mouseChange(element, handleInteraction)\r\n\r\n //enable simple touch interactions\r\n element.addEventListener('touchstart', function (ev) {\r\n var xy = mouseOffset(ev.changedTouches[0], element)\r\n handleInteraction(0, xy[0], xy[1], lastMods)\r\n handleInteraction(1, xy[0], xy[1], lastMods)\r\n })\r\n element.addEventListener('touchmove', function (ev) {\r\n var xy = mouseOffset(ev.changedTouches[0], element)\r\n handleInteraction(1, xy[0], xy[1], lastMods)\r\n })\r\n element.addEventListener('touchend', function (ev) {\r\n var xy = mouseOffset(ev.changedTouches[0], element)\r\n handleInteraction(0, lastX, lastY, lastMods)\r\n })\r\n\r\n function handleInteraction (buttons, x, y, mods) {\r\n var scale = 1.0 / element.clientHeight\r\n var dx = scale * (x - lastX)\r\n var dy = scale * (y - lastY)\r\n\r\n var flipX = camera.flipX ? 1 : -1\r\n var flipY = camera.flipY ? 1 : -1\r\n\r\n var drot = Math.PI * camera.rotateSpeed\r\n\r\n var t = now()\r\n\r\n if(buttons & 1) {\r\n if(mods.shift) {\r\n view.rotate(t, 0, 0, -dx * drot)\r\n } else {\r\n view.rotate(t, flipX * drot * dx, -flipY * drot * dy, 0)\r\n }\r\n } else if(buttons & 2) {\r\n view.pan(t, -camera.translateSpeed * dx * distance, camera.translateSpeed * dy * distance, 0)\r\n } else if(buttons & 4) {\r\n var kzoom = camera.zoomSpeed * dy / window.innerHeight * (t - view.lastT()) * 50.0\r\n view.pan(t, 0, 0, distance * (Math.exp(kzoom) - 1))\r\n }\r\n\r\n lastX = x\r\n lastY = y\r\n lastMods = mods\r\n }\r\n\r\n mouseWheel(element, function(dx, dy, dz) {\r\n var flipX = camera.flipX ? 1 : -1\r\n var flipY = camera.flipY ? 1 : -1\r\n var t = now()\r\n if(Math.abs(dx) > Math.abs(dy)) {\r\n view.rotate(t, 0, 0, -dx * flipX * Math.PI * camera.rotateSpeed / window.innerWidth)\r\n } else {\r\n var kzoom = camera.zoomSpeed * flipY * dy / window.innerHeight * (t - view.lastT()) / 100.0\r\n view.pan(t, 0, 0, distance * (Math.exp(kzoom) - 1))\r\n }\r\n }, true)\r\n\r\n return camera\r\n}\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/3d-view-controls/camera.js\n// module id = 33\n// module chunks = 0","module.exports =\n global.performance &&\n global.performance.now ? function now() {\n return performance.now()\n } : Date.now || function now() {\n return +new Date\n }\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/right-now/browser.js\n// module id = 34\n// module chunks = 0","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/global.js\n// module id = 35\n// module chunks = 0","'use strict'\n\nmodule.exports = createViewController\n\nvar createTurntable = require('turntable-camera-controller')\nvar createOrbit = require('orbit-camera-controller')\nvar createMatrix = require('matrix-camera-controller')\n\nfunction ViewController(controllers, mode) {\n this._controllerNames = Object.keys(controllers)\n this._controllerList = this._controllerNames.map(function(n) {\n return controllers[n]\n })\n this._mode = mode\n this._active = controllers[mode]\n if(!this._active) {\n this._mode = 'turntable'\n this._active = controllers.turntable\n }\n this.modes = this._controllerNames\n this.computedMatrix = this._active.computedMatrix\n this.computedEye = this._active.computedEye\n this.computedUp = this._active.computedUp\n this.computedCenter = this._active.computedCenter\n this.computedRadius = this._active.computedRadius\n}\n\nvar proto = ViewController.prototype\n\nvar COMMON_METHODS = [\n ['flush', 1],\n ['idle', 1],\n ['lookAt', 4],\n ['rotate', 4],\n ['pan', 4],\n ['translate', 4],\n ['setMatrix', 2],\n ['setDistanceLimits', 2],\n ['setDistance', 2]\n]\n\nCOMMON_METHODS.forEach(function(method) {\n var name = method[0]\n var argNames = []\n for(var i=0; i<method[1]; ++i) {\n argNames.push('a'+i)\n }\n var code = 'var cc=this._controllerList;for(var i=0;i<cc.length;++i){cc[i].'+method[0]+'('+argNames.join()+')}'\n proto[name] = Function.apply(null, argNames.concat(code))\n})\n\nproto.recalcMatrix = function(t) {\n this._active.recalcMatrix(t)\n}\n\nproto.getDistance = function(t) {\n return this._active.getDistance(t)\n}\nproto.getDistanceLimits = function(out) {\n return this._active.getDistanceLimits(out)\n}\n\nproto.lastT = function() {\n return this._active.lastT()\n}\n\nproto.setMode = function(mode) {\n if(mode === this._mode) {\n return\n }\n var idx = this._controllerNames.indexOf(mode)\n if(idx < 0) {\n return\n }\n var prev = this._active\n var next = this._controllerList[idx]\n var lastT = Math.max(prev.lastT(), next.lastT())\n\n prev.recalcMatrix(lastT)\n next.setMatrix(lastT, prev.computedMatrix)\n \n this._active = next\n this._mode = mode\n\n //Update matrix properties\n this.computedMatrix = this._active.computedMatrix\n this.computedEye = this._active.computedEye\n this.computedUp = this._active.computedUp\n this.computedCenter = this._active.computedCenter\n this.computedRadius = this._active.computedRadius\n}\n\nproto.getMode = function() {\n return this._mode\n}\n\nfunction createViewController(options) {\n options = options || {}\n\n var eye = options.eye || [0,0,1]\n var center = options.center || [0,0,0]\n var up = options.up || [0,1,0]\n var limits = options.distanceLimits || [0, Infinity]\n var mode = options.mode || 'turntable'\n\n var turntable = createTurntable()\n var orbit = createOrbit()\n var matrix = createMatrix()\n\n turntable.setDistanceLimits(limits[0], limits[1])\n turntable.lookAt(0, eye, center, up)\n orbit.setDistanceLimits(limits[0], limits[1])\n orbit.lookAt(0, eye, center, up)\n matrix.setDistanceLimits(limits[0], limits[1])\n matrix.lookAt(0, eye, center, up)\n\n return new ViewController({\n turntable: turntable,\n orbit: orbit,\n matrix: matrix\n }, mode)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/3d-view/view.js\n// module id = 36\n// module chunks = 0","'use strict'\n\nmodule.exports = createTurntableController\n\nvar filterVector = require('filtered-vector')\nvar invert44 = require('gl-mat4/invert')\nvar rotateM = require('gl-mat4/rotate')\nvar cross = require('gl-vec3/cross')\nvar normalize3 = require('gl-vec3/normalize')\nvar dot3 = require('gl-vec3/dot')\n\nfunction len3(x, y, z) {\n return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2) + Math.pow(z, 2))\n}\n\nfunction clamp1(x) {\n return Math.min(1.0, Math.max(-1.0, x))\n}\n\nfunction findOrthoPair(v) {\n var vx = Math.abs(v[0])\n var vy = Math.abs(v[1])\n var vz = Math.abs(v[2])\n\n var u = [0,0,0]\n if(vx > Math.max(vy, vz)) {\n u[2] = 1\n } else if(vy > Math.max(vx, vz)) {\n u[0] = 1\n } else {\n u[1] = 1\n }\n\n var vv = 0\n var uv = 0\n for(var i=0; i<3; ++i ) {\n vv += v[i] * v[i]\n uv += u[i] * v[i]\n }\n for(var i=0; i<3; ++i) {\n u[i] -= (uv / vv) * v[i]\n }\n normalize3(u, u)\n return u\n}\n\nfunction TurntableController(zoomMin, zoomMax, center, up, right, radius, theta, phi) {\n this.center = filterVector(center)\n this.up = filterVector(up)\n this.right = filterVector(right)\n this.radius = filterVector([radius])\n this.angle = filterVector([theta, phi])\n this.angle.bounds = [[-Infinity,-Math.PI/2], [Infinity,Math.PI/2]]\n this.setDistanceLimits(zoomMin, zoomMax)\n\n this.computedCenter = this.center.curve(0)\n this.computedUp = this.up.curve(0)\n this.computedRight = this.right.curve(0)\n this.computedRadius = this.radius.curve(0)\n this.computedAngle = this.angle.curve(0)\n this.computedToward = [0,0,0]\n this.computedEye = [0,0,0]\n this.computedMatrix = new Array(16)\n for(var i=0; i<16; ++i) {\n this.computedMatrix[i] = 0.5\n }\n\n this.recalcMatrix(0)\n}\n\nvar proto = TurntableController.prototype\n\nproto.setDistanceLimits = function(minDist, maxDist) {\n if(minDist > 0) {\n minDist = Math.log(minDist)\n } else {\n minDist = -Infinity\n }\n if(maxDist > 0) {\n maxDist = Math.log(maxDist)\n } else {\n maxDist = Infinity\n }\n maxDist = Math.max(maxDist, minDist)\n this.radius.bounds[0][0] = minDist\n this.radius.bounds[1][0] = maxDist\n}\n\nproto.getDistanceLimits = function(out) {\n var bounds = this.radius.bounds[0]\n if(out) {\n out[0] = Math.exp(bounds[0][0])\n out[1] = Math.exp(bounds[1][0])\n return out\n }\n return [ Math.exp(bounds[0][0]), Math.exp(bounds[1][0]) ]\n}\n\nproto.recalcMatrix = function(t) {\n //Recompute curves\n this.center.curve(t)\n this.up.curve(t)\n this.right.curve(t)\n this.radius.curve(t)\n this.angle.curve(t)\n\n //Compute frame for camera matrix\n var up = this.computedUp\n var right = this.computedRight\n var uu = 0.0\n var ur = 0.0\n for(var i=0; i<3; ++i) {\n ur += up[i] * right[i]\n uu += up[i] * up[i]\n }\n var ul = Math.sqrt(uu)\n var rr = 0.0\n for(var i=0; i<3; ++i) {\n right[i] -= up[i] * ur / uu\n rr += right[i] * right[i]\n up[i] /= ul\n }\n var rl = Math.sqrt(rr)\n for(var i=0; i<3; ++i) {\n right[i] /= rl\n }\n\n //Compute toward vector\n var toward = this.computedToward\n cross(toward, up, right)\n normalize3(toward, toward)\n\n //Compute angular parameters\n var radius = Math.exp(this.computedRadius[0])\n var theta = this.computedAngle[0]\n var phi = this.computedAngle[1]\n\n var ctheta = Math.cos(theta)\n var stheta = Math.sin(theta)\n var cphi = Math.cos(phi)\n var sphi = Math.sin(phi)\n\n var center = this.computedCenter\n\n var wx = ctheta * cphi \n var wy = stheta * cphi\n var wz = sphi\n\n var sx = -ctheta * sphi\n var sy = -stheta * sphi\n var sz = cphi\n\n var eye = this.computedEye\n var mat = this.computedMatrix\n for(var i=0; i<3; ++i) {\n var x = wx * right[i] + wy * toward[i] + wz * up[i]\n mat[4*i+1] = sx * right[i] + sy * toward[i] + sz * up[i]\n mat[4*i+2] = x\n mat[4*i+3] = 0.0\n }\n\n var ax = mat[1]\n var ay = mat[5]\n var az = mat[9]\n var bx = mat[2]\n var by = mat[6]\n var bz = mat[10]\n var cx = ay * bz - az * by\n var cy = az * bx - ax * bz\n var cz = ax * by - ay * bx\n var cl = len3(cx, cy, cz)\n cx /= cl\n cy /= cl\n cz /= cl\n mat[0] = cx\n mat[4] = cy\n mat[8] = cz\n\n for(var i=0; i<3; ++i) {\n eye[i] = center[i] + mat[2+4*i]*radius\n }\n\n for(var i=0; i<3; ++i) {\n var rr = 0.0\n for(var j=0; j<3; ++j) {\n rr += mat[i+4*j] * eye[j]\n }\n mat[12+i] = -rr\n }\n mat[15] = 1.0\n}\n\nproto.getMatrix = function(t, result) {\n this.recalcMatrix(t)\n var mat = this.computedMatrix\n if(result) {\n for(var i=0; i<16; ++i) {\n result[i] = mat[i]\n }\n return result\n }\n return mat\n}\n\nvar zAxis = [0,0,0]\nproto.rotate = function(t, dtheta, dphi, droll) {\n this.angle.move(t, dtheta, dphi)\n if(droll) {\n this.recalcMatrix(t)\n\n var mat = this.computedMatrix\n zAxis[0] = mat[2]\n zAxis[1] = mat[6]\n zAxis[2] = mat[10]\n\n var up = this.computedUp\n var right = this.computedRight\n var toward = this.computedToward\n\n for(var i=0; i<3; ++i) {\n mat[4*i] = up[i]\n mat[4*i+1] = right[i]\n mat[4*i+2] = toward[i]\n }\n rotateM(mat, mat, droll, zAxis)\n for(var i=0; i<3; ++i) {\n up[i] = mat[4*i]\n right[i] = mat[4*i+1]\n }\n\n this.up.set(t, up[0], up[1], up[2])\n this.right.set(t, right[0], right[1], right[2])\n }\n}\n\nproto.pan = function(t, dx, dy, dz) {\n dx = dx || 0.0\n dy = dy || 0.0\n dz = dz || 0.0\n\n this.recalcMatrix(t)\n var mat = this.computedMatrix\n\n var dist = Math.exp(this.computedRadius[0])\n\n var ux = mat[1]\n var uy = mat[5]\n var uz = mat[9]\n var ul = len3(ux, uy, uz)\n ux /= ul\n uy /= ul\n uz /= ul\n\n var rx = mat[0]\n var ry = mat[4]\n var rz = mat[8]\n var ru = rx * ux + ry * uy + rz * uz\n rx -= ux * ru\n ry -= uy * ru\n rz -= uz * ru\n var rl = len3(rx, ry, rz)\n rx /= rl\n ry /= rl\n rz /= rl\n\n var vx = rx * dx + ux * dy\n var vy = ry * dx + uy * dy\n var vz = rz * dx + uz * dy\n this.center.move(t, vx, vy, vz)\n\n //Update z-component of radius\n var radius = Math.exp(this.computedRadius[0])\n radius = Math.max(1e-4, radius + dz)\n this.radius.set(t, Math.log(radius))\n}\n\nproto.translate = function(t, dx, dy, dz) {\n this.center.move(t,\n dx||0.0,\n dy||0.0,\n dz||0.0)\n}\n\n//Recenters the coordinate axes\nproto.setMatrix = function(t, mat, axes, noSnap) {\n \n //Get the axes for tare\n var ushift = 1\n if(typeof axes === 'number') {\n ushift = (axes)|0\n } \n if(ushift < 0 || ushift > 3) {\n ushift = 1\n }\n var vshift = (ushift + 2) % 3\n var fshift = (ushift + 1) % 3\n\n //Recompute state for new t value\n if(!mat) { \n this.recalcMatrix(t)\n mat = this.computedMatrix\n }\n\n //Get right and up vectors\n var ux = mat[ushift]\n var uy = mat[ushift+4]\n var uz = mat[ushift+8]\n if(!noSnap) {\n var ul = len3(ux, uy, uz)\n ux /= ul\n uy /= ul\n uz /= ul\n } else {\n var ax = Math.abs(ux)\n var ay = Math.abs(uy)\n var az = Math.abs(uz)\n var am = Math.max(ax,ay,az)\n if(ax === am) {\n ux = (ux < 0) ? -1 : 1\n uy = uz = 0\n } else if(az === am) {\n uz = (uz < 0) ? -1 : 1\n ux = uy = 0\n } else {\n uy = (uy < 0) ? -1 : 1\n ux = uz = 0\n }\n }\n\n var rx = mat[vshift]\n var ry = mat[vshift+4]\n var rz = mat[vshift+8]\n var ru = rx * ux + ry * uy + rz * uz\n rx -= ux * ru\n ry -= uy * ru\n rz -= uz * ru\n var rl = len3(rx, ry, rz)\n rx /= rl\n ry /= rl\n rz /= rl\n \n var fx = uy * rz - uz * ry\n var fy = uz * rx - ux * rz\n var fz = ux * ry - uy * rx\n var fl = len3(fx, fy, fz)\n fx /= fl\n fy /= fl\n fz /= fl\n\n this.center.jump(t, ex, ey, ez)\n this.radius.idle(t)\n this.up.jump(t, ux, uy, uz)\n this.right.jump(t, rx, ry, rz)\n\n var phi, theta\n if(ushift === 2) {\n var cx = mat[1]\n var cy = mat[5]\n var cz = mat[9]\n var cr = cx * rx + cy * ry + cz * rz\n var cf = cx * fx + cy * fy + cz * fz\n if(tu < 0) {\n phi = -Math.PI/2\n } else {\n phi = Math.PI/2\n }\n theta = Math.atan2(cf, cr)\n } else {\n var tx = mat[2]\n var ty = mat[6]\n var tz = mat[10]\n var tu = tx * ux + ty * uy + tz * uz\n var tr = tx * rx + ty * ry + tz * rz\n var tf = tx * fx + ty * fy + tz * fz\n\n phi = Math.asin(clamp1(tu))\n theta = Math.atan2(tf, tr)\n }\n\n this.angle.jump(t, theta, phi)\n\n this.recalcMatrix(t)\n var dx = mat[2]\n var dy = mat[6]\n var dz = mat[10]\n\n var imat = this.computedMatrix\n invert44(imat, mat)\n var w = imat[15]\n var ex = imat[12] / w\n var ey = imat[13] / w\n var ez = imat[14] / w\n\n var gs = Math.exp(this.computedRadius[0])\n this.center.jump(t, ex-dx*gs, ey-dy*gs, ez-dz*gs)\n}\n\nproto.lastT = function() {\n return Math.max(\n this.center.lastT(),\n this.up.lastT(),\n this.right.lastT(),\n this.radius.lastT(),\n this.angle.lastT())\n}\n\nproto.idle = function(t) {\n this.center.idle(t)\n this.up.idle(t)\n this.right.idle(t)\n this.radius.idle(t)\n this.angle.idle(t)\n}\n\nproto.flush = function(t) {\n this.center.flush(t)\n this.up.flush(t)\n this.right.flush(t)\n this.radius.flush(t)\n this.angle.flush(t)\n}\n\nproto.setDistance = function(t, d) {\n if(d > 0) {\n this.radius.set(t, Math.log(d))\n }\n}\n\nproto.lookAt = function(t, eye, center, up) {\n this.recalcMatrix(t)\n\n eye = eye || this.computedEye\n center = center || this.computedCenter\n up = up || this.computedUp\n\n var ux = up[0]\n var uy = up[1]\n var uz = up[2]\n var ul = len3(ux, uy, uz)\n if(ul < 1e-6) {\n return\n }\n ux /= ul\n uy /= ul\n uz /= ul\n\n var tx = eye[0] - center[0]\n var ty = eye[1] - center[1]\n var tz = eye[2] - center[2]\n var tl = len3(tx, ty, tz)\n if(tl < 1e-6) {\n return\n }\n tx /= tl\n ty /= tl\n tz /= tl\n\n var right = this.computedRight\n var rx = right[0]\n var ry = right[1]\n var rz = right[2]\n var ru = ux*rx + uy*ry + uz*rz\n rx -= ru * ux\n ry -= ru * uy\n rz -= ru * uz\n var rl = len3(rx, ry, rz)\n\n if(rl < 0.01) {\n rx = uy * tz - uz * ty\n ry = uz * tx - ux * tz\n rz = ux * ty - uy * tx\n rl = len3(rx, ry, rz)\n if(rl < 1e-6) {\n return\n }\n }\n rx /= rl\n ry /= rl\n rz /= rl\n\n this.up.set(t, ux, uy, uz)\n this.right.set(t, rx, ry, rz)\n this.center.set(t, center[0], center[1], center[2])\n this.radius.set(t, Math.log(tl))\n\n var fx = uy * rz - uz * ry\n var fy = uz * rx - ux * rz\n var fz = ux * ry - uy * rx\n var fl = len3(fx, fy, fz)\n fx /= fl\n fy /= fl\n fz /= fl\n\n var tu = ux*tx + uy*ty + uz*tz\n var tr = rx*tx + ry*ty + rz*tz\n var tf = fx*tx + fy*ty + fz*tz\n\n var phi = Math.asin(clamp1(tu))\n var theta = Math.atan2(tf, tr)\n\n var angleState = this.angle._state\n var lastTheta = angleState[angleState.length-1]\n var lastPhi = angleState[angleState.length-2]\n lastTheta = lastTheta % (2.0 * Math.PI)\n var dp = Math.abs(lastTheta + 2.0 * Math.PI - theta)\n var d0 = Math.abs(lastTheta - theta)\n var dn = Math.abs(lastTheta - 2.0 * Math.PI - theta)\n if(dp < d0) {\n lastTheta += 2.0 * Math.PI\n }\n if(dn < d0) {\n lastTheta -= 2.0 * Math.PI\n }\n\n this.angle.jump(this.angle.lastT(), lastTheta, lastPhi)\n this.angle.set(t, theta, phi)\n}\n\nfunction createTurntableController(options) {\n options = options || {}\n\n var center = options.center || [0,0,0]\n var up = options.up || [0,1,0]\n var right = options.right || findOrthoPair(up)\n var radius = options.radius || 1.0\n var theta = options.theta || 0.0\n var phi = options.phi || 0.0\n\n center = [].slice.call(center, 0, 3)\n\n up = [].slice.call(up, 0, 3)\n normalize3(up, up)\n\n right = [].slice.call(right, 0, 3)\n normalize3(right, right)\n\n if('eye' in options) {\n var eye = options.eye\n var toward = [\n eye[0]-center[0],\n eye[1]-center[1],\n eye[2]-center[2]\n ]\n cross(right, toward, up)\n if(len3(right[0], right[1], right[2]) < 1e-6) {\n right = findOrthoPair(up)\n } else {\n normalize3(right, right)\n }\n\n radius = len3(toward[0], toward[1], toward[2])\n\n var ut = dot3(up, toward) / radius\n var rt = dot3(right, toward) / radius\n phi = Math.acos(ut)\n theta = Math.acos(rt)\n }\n\n //Use logarithmic coordinates for radius\n radius = Math.log(radius)\n\n //Return the controller\n return new TurntableController(\n options.zoomMin,\n options.zoomMax,\n center,\n up,\n right,\n radius,\n theta,\n phi)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/turntable-camera-controller/turntable.js\n// module id = 37\n// module chunks = 0","\"use strict\"\n\nfunction dcubicHermite(p0, v0, p1, v1, t, f) {\n var dh00 = 6*t*t-6*t,\n dh10 = 3*t*t-4*t + 1,\n dh01 = -6*t*t+6*t,\n dh11 = 3*t*t-2*t\n if(p0.length) {\n if(!f) {\n f = new Array(p0.length)\n }\n for(var i=p0.length-1; i>=0; --i) {\n f[i] = dh00*p0[i] + dh10*v0[i] + dh01*p1[i] + dh11*v1[i]\n }\n return f\n }\n return dh00*p0 + dh10*v0 + dh01*p1[i] + dh11*v1\n}\n\nfunction cubicHermite(p0, v0, p1, v1, t, f) {\n var ti = (t-1), t2 = t*t, ti2 = ti*ti,\n h00 = (1+2*t)*ti2,\n h10 = t*ti2,\n h01 = t2*(3-2*t),\n h11 = t2*ti\n if(p0.length) {\n if(!f) {\n f = new Array(p0.length)\n }\n for(var i=p0.length-1; i>=0; --i) {\n f[i] = h00*p0[i] + h10*v0[i] + h01*p1[i] + h11*v1[i]\n }\n return f\n }\n return h00*p0 + h10*v0 + h01*p1 + h11*v1\n}\n\nmodule.exports = cubicHermite\nmodule.exports.derivative = dcubicHermite\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/cubic-hermite/hermite.js\n// module id = 38\n// module chunks = 0","module.exports = rotate;\n\n/**\n * Rotates a mat4 by the given angle\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @param {vec3} axis the axis to rotate around\n * @returns {mat4} out\n */\nfunction rotate(out, a, rad, axis) {\n var x = axis[0], y = axis[1], z = axis[2],\n len = Math.sqrt(x * x + y * y + z * z),\n s, c, t,\n a00, a01, a02, a03,\n a10, a11, a12, a13,\n a20, a21, a22, a23,\n b00, b01, b02,\n b10, b11, b12,\n b20, b21, b22;\n\n if (Math.abs(len) < 0.000001) { return null; }\n \n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n\n a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3];\n a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7];\n a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11];\n\n // Construct the elements of the rotation matrix\n b00 = x * x * t + c; b01 = y * x * t + z * s; b02 = z * x * t - y * s;\n b10 = x * y * t - z * s; b11 = y * y * t + c; b12 = z * y * t + x * s;\n b20 = x * z * t + y * s; b21 = y * z * t - x * s; b22 = z * z * t + c;\n\n // Perform rotation-specific matrix multiplication\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) { // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/rotate.js\n// module id = 39\n// module chunks = 0","'use strict'\n\nmodule.exports = createOrbitController\n\nvar filterVector = require('filtered-vector')\nvar lookAt = require('gl-mat4/lookAt')\nvar mat4FromQuat = require('gl-mat4/fromQuat')\nvar invert44 = require('gl-mat4/invert')\nvar quatFromFrame = require('./lib/quatFromFrame')\n\nfunction len3(x,y,z) {\n return Math.sqrt(Math.pow(x,2) + Math.pow(y,2) + Math.pow(z,2))\n}\n\nfunction len4(w,x,y,z) {\n return Math.sqrt(Math.pow(w,2) + Math.pow(x,2) + Math.pow(y,2) + Math.pow(z,2))\n}\n\nfunction normalize4(out, a) {\n var ax = a[0]\n var ay = a[1]\n var az = a[2]\n var aw = a[3]\n var al = len4(ax, ay, az, aw)\n if(al > 1e-6) {\n out[0] = ax/al\n out[1] = ay/al\n out[2] = az/al\n out[3] = aw/al\n } else {\n out[0] = out[1] = out[2] = 0.0\n out[3] = 1.0\n }\n}\n\nfunction OrbitCameraController(initQuat, initCenter, initRadius) {\n this.radius = filterVector([initRadius])\n this.center = filterVector(initCenter)\n this.rotation = filterVector(initQuat)\n\n this.computedRadius = this.radius.curve(0)\n this.computedCenter = this.center.curve(0)\n this.computedRotation = this.rotation.curve(0)\n this.computedUp = [0.1,0,0]\n this.computedEye = [0.1,0,0]\n this.computedMatrix = [0.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\n\n this.recalcMatrix(0)\n}\n\nvar proto = OrbitCameraController.prototype\n\nproto.lastT = function() {\n return Math.max(\n this.radius.lastT(),\n this.center.lastT(),\n this.rotation.lastT())\n}\n\nproto.recalcMatrix = function(t) {\n this.radius.curve(t)\n this.center.curve(t)\n this.rotation.curve(t)\n\n var quat = this.computedRotation\n normalize4(quat, quat)\n\n var mat = this.computedMatrix\n mat4FromQuat(mat, quat)\n\n var center = this.computedCenter\n var eye = this.computedEye\n var up = this.computedUp\n var radius = Math.exp(this.computedRadius[0])\n\n eye[0] = center[0] + radius * mat[2]\n eye[1] = center[1] + radius * mat[6]\n eye[2] = center[2] + radius * mat[10]\n up[0] = mat[1]\n up[1] = mat[5]\n up[2] = mat[9]\n\n for(var i=0; i<3; ++i) {\n var rr = 0.0\n for(var j=0; j<3; ++j) {\n rr += mat[i+4*j] * eye[j]\n }\n mat[12+i] = -rr\n }\n}\n\nproto.getMatrix = function(t, result) {\n this.recalcMatrix(t)\n var m = this.computedMatrix\n if(result) {\n for(var i=0; i<16; ++i) {\n result[i] = m[i]\n }\n return result\n }\n return m\n}\n\nproto.idle = function(t) {\n this.center.idle(t)\n this.radius.idle(t)\n this.rotation.idle(t)\n}\n\nproto.flush = function(t) {\n this.center.flush(t)\n this.radius.flush(t)\n this.rotation.flush(t)\n}\n\nproto.pan = function(t, dx, dy, dz) {\n dx = dx || 0.0\n dy = dy || 0.0\n dz = dz || 0.0\n\n this.recalcMatrix(t)\n var mat = this.computedMatrix\n\n var ux = mat[1]\n var uy = mat[5]\n var uz = mat[9]\n var ul = len3(ux, uy, uz)\n ux /= ul\n uy /= ul\n uz /= ul\n\n var rx = mat[0]\n var ry = mat[4]\n var rz = mat[8]\n var ru = rx * ux + ry * uy + rz * uz\n rx -= ux * ru\n ry -= uy * ru\n rz -= uz * ru\n var rl = len3(rx, ry, rz)\n rx /= rl\n ry /= rl\n rz /= rl\n\n var fx = mat[2]\n var fy = mat[6]\n var fz = mat[10]\n var fu = fx * ux + fy * uy + fz * uz\n var fr = fx * rx + fy * ry + fz * rz\n fx -= fu * ux + fr * rx\n fy -= fu * uy + fr * ry\n fz -= fu * uz + fr * rz\n var fl = len3(fx, fy, fz)\n fx /= fl\n fy /= fl\n fz /= fl\n\n var vx = rx * dx + ux * dy\n var vy = ry * dx + uy * dy\n var vz = rz * dx + uz * dy\n\n this.center.move(t, vx, vy, vz)\n\n //Update z-component of radius\n var radius = Math.exp(this.computedRadius[0])\n radius = Math.max(1e-4, radius + dz)\n this.radius.set(t, Math.log(radius))\n}\n\nproto.rotate = function(t, dx, dy, dz) {\n this.recalcMatrix(t)\n\n dx = dx||0.0\n dy = dy||0.0\n\n var mat = this.computedMatrix\n\n var rx = mat[0]\n var ry = mat[4]\n var rz = mat[8]\n\n var ux = mat[1]\n var uy = mat[5]\n var uz = mat[9]\n\n var fx = mat[2]\n var fy = mat[6]\n var fz = mat[10]\n\n var qx = dx * rx + dy * ux\n var qy = dx * ry + dy * uy\n var qz = dx * rz + dy * uz\n\n var bx = -(fy * qz - fz * qy)\n var by = -(fz * qx - fx * qz)\n var bz = -(fx * qy - fy * qx) \n var bw = Math.sqrt(Math.max(0.0, 1.0 - Math.pow(bx,2) - Math.pow(by,2) - Math.pow(bz,2)))\n var bl = len4(bx, by, bz, bw)\n if(bl > 1e-6) {\n bx /= bl\n by /= bl\n bz /= bl\n bw /= bl\n } else {\n bx = by = bz = 0.0\n bw = 1.0\n }\n\n var rotation = this.computedRotation\n var ax = rotation[0]\n var ay = rotation[1]\n var az = rotation[2]\n var aw = rotation[3]\n\n var cx = ax*bw + aw*bx + ay*bz - az*by\n var cy = ay*bw + aw*by + az*bx - ax*bz\n var cz = az*bw + aw*bz + ax*by - ay*bx\n var cw = aw*bw - ax*bx - ay*by - az*bz\n \n //Apply roll\n if(dz) {\n bx = fx\n by = fy\n bz = fz\n var s = Math.sin(dz) / len3(bx, by, bz)\n bx *= s\n by *= s\n bz *= s\n bw = Math.cos(dx)\n cx = cx*bw + cw*bx + cy*bz - cz*by\n cy = cy*bw + cw*by + cz*bx - cx*bz\n cz = cz*bw + cw*bz + cx*by - cy*bx\n cw = cw*bw - cx*bx - cy*by - cz*bz\n }\n\n var cl = len4(cx, cy, cz, cw)\n if(cl > 1e-6) {\n cx /= cl\n cy /= cl\n cz /= cl\n cw /= cl\n } else {\n cx = cy = cz = 0.0\n cw = 1.0\n }\n\n this.rotation.set(t, cx, cy, cz, cw)\n}\n\nproto.lookAt = function(t, eye, center, up) {\n this.recalcMatrix(t)\n\n center = center || this.computedCenter\n eye = eye || this.computedEye\n up = up || this.computedUp\n\n var mat = this.computedMatrix\n lookAt(mat, eye, center, up)\n\n var rotation = this.computedRotation\n quatFromFrame(rotation,\n mat[0], mat[1], mat[2],\n mat[4], mat[5], mat[6],\n mat[8], mat[9], mat[10])\n normalize4(rotation, rotation)\n this.rotation.set(t, rotation[0], rotation[1], rotation[2], rotation[3])\n\n var fl = 0.0\n for(var i=0; i<3; ++i) {\n fl += Math.pow(center[i] - eye[i], 2)\n }\n this.radius.set(t, 0.5 * Math.log(Math.max(fl, 1e-6)))\n\n this.center.set(t, center[0], center[1], center[2])\n}\n\nproto.translate = function(t, dx, dy, dz) {\n this.center.move(t,\n dx||0.0,\n dy||0.0,\n dz||0.0)\n}\n\nproto.setMatrix = function(t, matrix) {\n\n var rotation = this.computedRotation\n quatFromFrame(rotation,\n matrix[0], matrix[1], matrix[2],\n matrix[4], matrix[5], matrix[6],\n matrix[8], matrix[9], matrix[10])\n normalize4(rotation, rotation)\n this.rotation.set(t, rotation[0], rotation[1], rotation[2], rotation[3])\n\n var mat = this.computedMatrix\n invert44(mat, matrix)\n var w = mat[15]\n if(Math.abs(w) > 1e-6) {\n var cx = mat[12]/w\n var cy = mat[13]/w\n var cz = mat[14]/w\n\n this.recalcMatrix(t) \n var r = Math.exp(this.computedRadius[0])\n this.center.set(t, cx-mat[2]*r, cy-mat[6]*r, cz-mat[10]*r)\n this.radius.idle(t)\n } else {\n this.center.idle(t)\n this.radius.idle(t)\n }\n}\n\nproto.setDistance = function(t, d) {\n if(d > 0) {\n this.radius.set(t, Math.log(d))\n }\n}\n\nproto.setDistanceLimits = function(lo, hi) {\n if(lo > 0) {\n lo = Math.log(lo)\n } else {\n lo = -Infinity \n }\n if(hi > 0) {\n hi = Math.log(hi)\n } else {\n hi = Infinity\n }\n hi = Math.max(hi, lo)\n this.radius.bounds[0][0] = lo\n this.radius.bounds[1][0] = hi\n}\n\nproto.getDistanceLimits = function(out) {\n var bounds = this.radius.bounds\n if(out) {\n out[0] = Math.exp(bounds[0][0])\n out[1] = Math.exp(bounds[1][0])\n return out\n }\n return [ Math.exp(bounds[0][0]), Math.exp(bounds[1][0]) ]\n}\n\nproto.toJSON = function() {\n this.recalcMatrix(this.lastT())\n return {\n center: this.computedCenter.slice(),\n rotation: this.computedRotation.slice(),\n distance: Math.log(this.computedRadius[0]),\n zoomMin: this.radius.bounds[0][0],\n zoomMax: this.radius.bounds[1][0]\n }\n}\n\nproto.fromJSON = function(options) {\n var t = this.lastT()\n var c = options.center\n if(c) {\n this.center.set(t, c[0], c[1], c[2])\n }\n var r = options.rotation\n if(r) {\n this.rotation.set(t, r[0], r[1], r[2], r[3])\n }\n var d = options.distance\n if(d && d > 0) {\n this.radius.set(t, Math.log(d))\n }\n this.setDistanceLimits(options.zoomMin, options.zoomMax)\n}\n\nfunction createOrbitController(options) {\n options = options || {}\n var center = options.center || [0,0,0]\n var rotation = options.rotation || [0,0,0,1]\n var radius = options.radius || 1.0\n\n center = [].slice.call(center, 0, 3)\n rotation = [].slice.call(rotation, 0, 4)\n normalize4(rotation, rotation)\n\n var result = new OrbitCameraController(\n rotation,\n center,\n Math.log(radius))\n\n result.setDistanceLimits(options.zoomMin, options.zoomMax)\n\n if('eye' in options || 'up' in options) {\n result.lookAt(0, options.eye, options.center, options.up)\n }\n\n return result\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/orbit-camera-controller/orbit.js\n// module id = 40\n// module chunks = 0","module.exports = fromQuat;\n\n/**\n * Creates a matrix from a quaternion rotation.\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @returns {mat4} out\n */\nfunction fromQuat(out, q) {\n var x = q[0], y = q[1], z = q[2], w = q[3],\n x2 = x + x,\n y2 = y + y,\n z2 = z + z,\n\n xx = x * x2,\n yx = y * x2,\n yy = y * y2,\n zx = z * x2,\n zy = z * y2,\n zz = z * z2,\n wx = w * x2,\n wy = w * y2,\n wz = w * z2;\n\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n\n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/fromQuat.js\n// module id = 41\n// module chunks = 0","'use strict'\n\nmodule.exports = quatFromFrame\n\nfunction quatFromFrame(\n out,\n rx, ry, rz,\n ux, uy, uz,\n fx, fy, fz) {\n var tr = rx + uy + fz\n if(l > 0) {\n var l = Math.sqrt(tr + 1.0)\n out[0] = 0.5 * (uz - fy) / l\n out[1] = 0.5 * (fx - rz) / l\n out[2] = 0.5 * (ry - uy) / l\n out[3] = 0.5 * l\n } else {\n var tf = Math.max(rx, uy, fz)\n var l = Math.sqrt(2 * tf - tr + 1.0)\n if(rx >= tf) {\n //x y z order\n out[0] = 0.5 * l\n out[1] = 0.5 * (ux + ry) / l\n out[2] = 0.5 * (fx + rz) / l\n out[3] = 0.5 * (uz - fy) / l\n } else if(uy >= tf) {\n //y z x order\n out[0] = 0.5 * (ry + ux) / l\n out[1] = 0.5 * l\n out[2] = 0.5 * (fy + uz) / l\n out[3] = 0.5 * (fx - rz) / l\n } else {\n //z x y order\n out[0] = 0.5 * (rz + fx) / l\n out[1] = 0.5 * (uz + fy) / l\n out[2] = 0.5 * l\n out[3] = 0.5 * (ry - ux) / l\n }\n }\n return out\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/orbit-camera-controller/lib/quatFromFrame.js\n// module id = 42\n// module chunks = 0","'use strict'\r\n\r\nvar bsearch = require('binary-search-bounds')\r\nvar m4interp = require('mat4-interpolate')\r\nvar invert44 = require('gl-mat4/invert')\r\nvar rotateX = require('gl-mat4/rotateX')\r\nvar rotateY = require('gl-mat4/rotateY')\r\nvar rotateZ = require('gl-mat4/rotateZ')\r\nvar lookAt = require('gl-mat4/lookAt')\r\nvar translate = require('gl-mat4/translate')\r\nvar scale = require('gl-mat4/scale')\r\nvar normalize = require('gl-vec3/normalize')\r\n\r\nvar DEFAULT_CENTER = [0,0,0]\r\n\r\nmodule.exports = createMatrixCameraController\r\n\r\nfunction MatrixCameraController(initialMatrix) {\r\n this._components = initialMatrix.slice()\r\n this._time = [0]\r\n this.prevMatrix = initialMatrix.slice()\r\n this.nextMatrix = initialMatrix.slice()\r\n this.computedMatrix = initialMatrix.slice()\r\n this.computedInverse = initialMatrix.slice()\r\n this.computedEye = [0,0,0]\r\n this.computedUp = [0,0,0]\r\n this.computedCenter = [0,0,0]\r\n this.computedRadius = [0]\r\n this._limits = [-Infinity, Infinity]\r\n}\r\n\r\nvar proto = MatrixCameraController.prototype\r\n\r\nproto.recalcMatrix = function(t) {\r\n var time = this._time\r\n var tidx = bsearch.le(time, t)\r\n var mat = this.computedMatrix\r\n if(tidx < 0) {\r\n return\r\n }\r\n var comps = this._components\r\n if(tidx === time.length-1) {\r\n var ptr = 16*tidx\r\n for(var i=0; i<16; ++i) {\r\n mat[i] = comps[ptr++]\r\n }\r\n } else {\r\n var dt = (time[tidx+1] - time[tidx])\r\n var ptr = 16*tidx\r\n var prev = this.prevMatrix\r\n var allEqual = true\r\n for(var i=0; i<16; ++i) {\r\n prev[i] = comps[ptr++]\r\n }\r\n var next = this.nextMatrix\r\n for(var i=0; i<16; ++i) {\r\n next[i] = comps[ptr++]\r\n allEqual = allEqual && (prev[i] === next[i])\r\n }\r\n if(dt < 1e-6 || allEqual) {\r\n for(var i=0; i<16; ++i) {\r\n mat[i] = prev[i]\r\n }\r\n } else {\r\n m4interp(mat, prev, next, (t - time[tidx])/dt)\r\n }\r\n }\r\n\r\n var up = this.computedUp\r\n up[0] = mat[1]\r\n up[1] = mat[5]\r\n up[2] = mat[9]\r\n normalize(up, up)\r\n\r\n var imat = this.computedInverse\r\n invert44(imat, mat)\r\n var eye = this.computedEye\r\n var w = imat[15]\r\n eye[0] = imat[12]/w\r\n eye[1] = imat[13]/w\r\n eye[2] = imat[14]/w\r\n\r\n var center = this.computedCenter\r\n var radius = Math.exp(this.computedRadius[0])\r\n for(var i=0; i<3; ++i) {\r\n center[i] = eye[i] - mat[2+4*i] * radius\r\n }\r\n}\r\n\r\nproto.idle = function(t) {\r\n if(t < this.lastT()) {\r\n return\r\n }\r\n var mc = this._components\r\n var ptr = mc.length-16\r\n for(var i=0; i<16; ++i) {\r\n mc.push(mc[ptr++])\r\n }\r\n this._time.push(t)\r\n}\r\n\r\nproto.flush = function(t) {\r\n var idx = bsearch.gt(this._time, t) - 2\r\n if(idx < 0) {\r\n return\r\n }\r\n this._time.splice(0, idx)\r\n this._components.splice(0, 16*idx)\r\n}\r\n\r\nproto.lastT = function() {\r\n return this._time[this._time.length-1]\r\n}\r\n\r\nproto.lookAt = function(t, eye, center, up) {\r\n this.recalcMatrix(t)\r\n eye = eye || this.computedEye\r\n center = center || DEFAULT_CENTER\r\n up = up || this.computedUp\r\n this.setMatrix(t, lookAt(this.computedMatrix, eye, center, up))\r\n var d2 = 0.0\r\n for(var i=0; i<3; ++i) {\r\n d2 += Math.pow(center[i] - eye[i], 2)\r\n }\r\n d2 = Math.log(Math.sqrt(d2))\r\n this.computedRadius[0] = d2\r\n}\r\n\r\nproto.rotate = function(t, yaw, pitch, roll) {\r\n this.recalcMatrix(t)\r\n var mat = this.computedInverse\r\n if(yaw) rotateY(mat, mat, yaw)\r\n if(pitch) rotateX(mat, mat, pitch)\r\n if(roll) rotateZ(mat, mat, roll)\r\n this.setMatrix(t, invert44(this.computedMatrix, mat))\r\n}\r\n\r\nvar tvec = [0,0,0]\r\n\r\nproto.pan = function(t, dx, dy, dz) {\r\n tvec[0] = -(dx || 0.0)\r\n tvec[1] = -(dy || 0.0)\r\n tvec[2] = -(dz || 0.0)\r\n this.recalcMatrix(t)\r\n var mat = this.computedInverse\r\n translate(mat, mat, tvec)\r\n this.setMatrix(t, invert44(mat, mat))\r\n}\r\n\r\nproto.translate = function(t, dx, dy, dz) {\r\n tvec[0] = dx || 0.0\r\n tvec[1] = dy || 0.0\r\n tvec[2] = dz || 0.0\r\n this.recalcMatrix(t)\r\n var mat = this.computedMatrix\r\n translate(mat, mat, tvec)\r\n this.setMatrix(t, mat)\r\n}\r\n\r\nproto.setMatrix = function(t, mat) {\r\n if(t < this.lastT()) {\r\n return\r\n }\r\n this._time.push(t)\r\n for(var i=0; i<16; ++i) {\r\n this._components.push(mat[i])\r\n }\r\n}\r\n\r\nproto.setDistance = function(t, d) {\r\n this.computedRadius[0] = d\r\n}\r\n\r\nproto.setDistanceLimits = function(a,b) {\r\n var lim = this._limits\r\n lim[0] = a\r\n lim[1] = b\r\n}\r\n\r\nproto.getDistanceLimits = function(out) {\r\n var lim = this._limits\r\n if(out) {\r\n out[0] = lim[0]\r\n out[1] = lim[1]\r\n return out\r\n }\r\n return lim\r\n}\r\n\r\nfunction createMatrixCameraController(options) {\r\n options = options || {}\r\n var matrix = options.matrix || \r\n [1,0,0,0,\r\n 0,1,0,0,\r\n 0,0,1,0,\r\n 0,0,0,1]\r\n return new MatrixCameraController(matrix)\r\n}\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/matrix-camera-controller/matrix.js\n// module id = 43\n// module chunks = 0","var lerp = require('gl-vec3/lerp')\n\nvar recompose = require('mat4-recompose')\nvar decompose = require('mat4-decompose')\nvar determinant = require('gl-mat4/determinant')\nvar slerp = require('quat-slerp')\n\nvar state0 = state()\nvar state1 = state()\nvar tmp = state()\n\nmodule.exports = interpolate\nfunction interpolate(out, start, end, alpha) {\n if (determinant(start) === 0 || determinant(end) === 0)\n return false\n\n //decompose the start and end matrices into individual components\n var r0 = decompose(start, state0.translate, state0.scale, state0.skew, state0.perspective, state0.quaternion)\n var r1 = decompose(end, state1.translate, state1.scale, state1.skew, state1.perspective, state1.quaternion)\n if (!r0 || !r1)\n return false \n\n\n //now lerp/slerp the start and end components into a temporary lerp(tmptranslate, state0.translate, state1.translate, alpha)\n lerp(tmp.translate, state0.translate, state1.translate, alpha)\n lerp(tmp.skew, state0.skew, state1.skew, alpha)\n lerp(tmp.scale, state0.scale, state1.scale, alpha)\n lerp(tmp.perspective, state0.perspective, state1.perspective, alpha)\n slerp(tmp.quaternion, state0.quaternion, state1.quaternion, alpha)\n\n //and recompose into our 'out' matrix\n recompose(out, tmp.translate, tmp.scale, tmp.skew, tmp.perspective, tmp.quaternion)\n return true\n}\n\nfunction state() {\n return {\n translate: vec3(),\n scale: vec3(1),\n skew: vec3(),\n perspective: vec4(),\n quaternion: vec4()\n }\n}\n\nfunction vec3(n) {\n return [n||0,n||0,n||0]\n}\n\nfunction vec4() {\n return [0,0,0,1]\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/mat4-interpolate/index.js\n// module id = 44\n// module chunks = 0","module.exports = lerp;\n\n/**\n * Performs a linear interpolation between two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {vec3} a the first operand\n * @param {vec3} b the second operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {vec3} out\n */\nfunction lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1],\n az = a[2]\n out[0] = ax + t * (b[0] - ax)\n out[1] = ay + t * (b[1] - ay)\n out[2] = az + t * (b[2] - az)\n return out\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-vec3/lerp.js\n// module id = 45\n// module chunks = 0","/*\nInput: translation ; a 3 component vector\n scale ; a 3 component vector\n skew ; skew factors XY,XZ,YZ represented as a 3 component vector\n perspective ; a 4 component vector\n quaternion ; a 4 component vector\nOutput: matrix ; a 4x4 matrix\n\nFrom: http://www.w3.org/TR/css3-transforms/#recomposing-to-a-3d-matrix\n*/\n\nvar mat4 = {\n identity: require('gl-mat4/identity'),\n translate: require('gl-mat4/translate'),\n multiply: require('gl-mat4/multiply'),\n create: require('gl-mat4/create'),\n scale: require('gl-mat4/scale'),\n fromRotationTranslation: require('gl-mat4/fromRotationTranslation')\n}\n\nvar rotationMatrix = mat4.create()\nvar temp = mat4.create()\n\nmodule.exports = function recomposeMat4(matrix, translation, scale, skew, perspective, quaternion) {\n mat4.identity(matrix)\n\n //apply translation & rotation\n mat4.fromRotationTranslation(matrix, quaternion, translation)\n\n //apply perspective\n matrix[3] = perspective[0]\n matrix[7] = perspective[1]\n matrix[11] = perspective[2]\n matrix[15] = perspective[3]\n \n // apply skew\n // temp is a identity 4x4 matrix initially\n mat4.identity(temp)\n\n if (skew[2] !== 0) {\n temp[9] = skew[2]\n mat4.multiply(matrix, matrix, temp)\n }\n\n if (skew[1] !== 0) {\n temp[9] = 0\n temp[8] = skew[1]\n mat4.multiply(matrix, matrix, temp)\n }\n\n if (skew[0] !== 0) {\n temp[8] = 0\n temp[4] = skew[0]\n mat4.multiply(matrix, matrix, temp)\n }\n\n //apply scale\n mat4.scale(matrix, matrix, scale)\n return matrix\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/mat4-recompose/index.js\n// module id = 46\n// module chunks = 0","module.exports = multiply;\n\n/**\n * Multiplies two mat4's\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the first operand\n * @param {mat4} b the second operand\n * @returns {mat4} out\n */\nfunction multiply(out, a, b) {\n var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],\n a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],\n a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],\n a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];\n\n // Cache only the current line of the second matrix\n var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; \n out[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n out[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n out[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n out[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n b0 = b[4]; b1 = b[5]; b2 = b[6]; b3 = b[7];\n out[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n out[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n out[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n out[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n b0 = b[8]; b1 = b[9]; b2 = b[10]; b3 = b[11];\n out[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n out[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n out[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n out[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n\n b0 = b[12]; b1 = b[13]; b2 = b[14]; b3 = b[15];\n out[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30;\n out[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31;\n out[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32;\n out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33;\n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/multiply.js\n// module id = 47\n// module chunks = 0","module.exports = fromRotationTranslation;\n\n/**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * var quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {vec3} v Translation vector\n * @returns {mat4} out\n */\nfunction fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0], y = q[1], z = q[2], w = q[3],\n x2 = x + x,\n y2 = y + y,\n z2 = z + z,\n\n xx = x * x2,\n xy = x * y2,\n xz = x * z2,\n yy = y * y2,\n yz = y * z2,\n zz = z * z2,\n wx = w * x2,\n wy = w * y2,\n wz = w * z2;\n\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n \n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/fromRotationTranslation.js\n// module id = 48\n// module chunks = 0","/*jshint unused:true*/\n/*\nInput: matrix ; a 4x4 matrix\nOutput: translation ; a 3 component vector\n scale ; a 3 component vector\n skew ; skew factors XY,XZ,YZ represented as a 3 component vector\n perspective ; a 4 component vector\n quaternion ; a 4 component vector\nReturns false if the matrix cannot be decomposed, true if it can\n\n\nReferences:\nhttps://github.com/kamicane/matrix3d/blob/master/lib/Matrix3d.js\nhttps://github.com/ChromiumWebApps/chromium/blob/master/ui/gfx/transform_util.cc\nhttp://www.w3.org/TR/css3-transforms/#decomposing-a-3d-matrix\n*/\n\nvar normalize = require('./normalize')\n\nvar create = require('gl-mat4/create')\nvar clone = require('gl-mat4/clone')\nvar determinant = require('gl-mat4/determinant')\nvar invert = require('gl-mat4/invert')\nvar transpose = require('gl-mat4/transpose')\nvar vec3 = {\n length: require('gl-vec3/length'),\n normalize: require('gl-vec3/normalize'),\n dot: require('gl-vec3/dot'),\n cross: require('gl-vec3/cross')\n}\n\nvar tmp = create()\nvar perspectiveMatrix = create()\nvar tmpVec4 = [0, 0, 0, 0]\nvar row = [ [0,0,0], [0,0,0], [0,0,0] ]\nvar pdum3 = [0,0,0]\n\nmodule.exports = function decomposeMat4(matrix, translation, scale, skew, perspective, quaternion) {\n if (!translation) translation = [0,0,0]\n if (!scale) scale = [0,0,0]\n if (!skew) skew = [0,0,0]\n if (!perspective) perspective = [0,0,0,1]\n if (!quaternion) quaternion = [0,0,0,1]\n\n //normalize, if not possible then bail out early\n if (!normalize(tmp, matrix))\n return false\n\n // perspectiveMatrix is used to solve for perspective, but it also provides\n // an easy way to test for singularity of the upper 3x3 component.\n clone(perspectiveMatrix, tmp)\n\n perspectiveMatrix[3] = 0\n perspectiveMatrix[7] = 0\n perspectiveMatrix[11] = 0\n perspectiveMatrix[15] = 1\n\n // If the perspectiveMatrix is not invertible, we are also unable to\n // decompose, so we'll bail early. Constant taken from SkMatrix44::invert.\n if (Math.abs(determinant(perspectiveMatrix) < 1e-8))\n return false\n\n var a03 = tmp[3], a13 = tmp[7], a23 = tmp[11],\n a30 = tmp[12], a31 = tmp[13], a32 = tmp[14], a33 = tmp[15]\n\n // First, isolate perspective.\n if (a03 !== 0 || a13 !== 0 || a23 !== 0) {\n tmpVec4[0] = a03\n tmpVec4[1] = a13\n tmpVec4[2] = a23\n tmpVec4[3] = a33\n\n // Solve the equation by inverting perspectiveMatrix and multiplying\n // rightHandSide by the inverse.\n // resuing the perspectiveMatrix here since it's no longer needed\n var ret = invert(perspectiveMatrix, perspectiveMatrix)\n if (!ret) return false\n transpose(perspectiveMatrix, perspectiveMatrix)\n\n //multiply by transposed inverse perspective matrix, into perspective vec4\n vec4multMat4(perspective, tmpVec4, perspectiveMatrix)\n } else { \n //no perspective\n perspective[0] = perspective[1] = perspective[2] = 0\n perspective[3] = 1\n }\n\n // Next take care of translation\n translation[0] = a30\n translation[1] = a31\n translation[2] = a32\n\n // Now get scale and shear. 'row' is a 3 element array of 3 component vectors\n mat3from4(row, tmp)\n\n // Compute X scale factor and normalize first row.\n scale[0] = vec3.length(row[0])\n vec3.normalize(row[0], row[0])\n\n // Compute XY shear factor and make 2nd row orthogonal to 1st.\n skew[0] = vec3.dot(row[0], row[1])\n combine(row[1], row[1], row[0], 1.0, -skew[0])\n\n // Now, compute Y scale and normalize 2nd row.\n scale[1] = vec3.length(row[1])\n vec3.normalize(row[1], row[1])\n skew[0] /= scale[1]\n\n // Compute XZ and YZ shears, orthogonalize 3rd row\n skew[1] = vec3.dot(row[0], row[2])\n combine(row[2], row[2], row[0], 1.0, -skew[1])\n skew[2] = vec3.dot(row[1], row[2])\n combine(row[2], row[2], row[1], 1.0, -skew[2])\n\n // Next, get Z scale and normalize 3rd row.\n scale[2] = vec3.length(row[2])\n vec3.normalize(row[2], row[2])\n skew[1] /= scale[2]\n skew[2] /= scale[2]\n\n\n // At this point, the matrix (in rows) is orthonormal.\n // Check for a coordinate system flip. If the determinant\n // is -1, then negate the matrix and the scaling factors.\n vec3.cross(pdum3, row[1], row[2])\n if (vec3.dot(row[0], pdum3) < 0) {\n for (var i = 0; i < 3; i++) {\n scale[i] *= -1;\n row[i][0] *= -1\n row[i][1] *= -1\n row[i][2] *= -1\n }\n }\n\n // Now, get the rotations out\n quaternion[0] = 0.5 * Math.sqrt(Math.max(1 + row[0][0] - row[1][1] - row[2][2], 0))\n quaternion[1] = 0.5 * Math.sqrt(Math.max(1 - row[0][0] + row[1][1] - row[2][2], 0))\n quaternion[2] = 0.5 * Math.sqrt(Math.max(1 - row[0][0] - row[1][1] + row[2][2], 0))\n quaternion[3] = 0.5 * Math.sqrt(Math.max(1 + row[0][0] + row[1][1] + row[2][2], 0))\n\n if (row[2][1] > row[1][2])\n quaternion[0] = -quaternion[0]\n if (row[0][2] > row[2][0])\n quaternion[1] = -quaternion[1]\n if (row[1][0] > row[0][1])\n quaternion[2] = -quaternion[2]\n return true\n}\n\n//will be replaced by gl-vec4 eventually\nfunction vec4multMat4(out, a, m) {\n var x = a[0], y = a[1], z = a[2], w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n\n//gets upper-left of a 4x4 matrix into a 3x3 of vectors\nfunction mat3from4(out, mat4x4) {\n out[0][0] = mat4x4[0]\n out[0][1] = mat4x4[1]\n out[0][2] = mat4x4[2]\n \n out[1][0] = mat4x4[4]\n out[1][1] = mat4x4[5]\n out[1][2] = mat4x4[6]\n\n out[2][0] = mat4x4[8]\n out[2][1] = mat4x4[9]\n out[2][2] = mat4x4[10]\n}\n\nfunction combine(out, a, b, scale1, scale2) {\n out[0] = a[0] * scale1 + b[0] * scale2\n out[1] = a[1] * scale1 + b[1] * scale2\n out[2] = a[2] * scale1 + b[2] * scale2\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/mat4-decompose/index.js\n// module id = 49\n// module chunks = 0","module.exports = function normalize(out, mat) {\n var m44 = mat[15]\n // Cannot normalize.\n if (m44 === 0) \n return false\n var scale = 1 / m44\n for (var i=0; i<16; i++)\n out[i] = mat[i] * scale\n return true\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/mat4-decompose/normalize.js\n// module id = 50\n// module chunks = 0","module.exports = clone;\n\n/**\n * Creates a new mat4 initialized with values from an existing matrix\n *\n * @param {mat4} a matrix to clone\n * @returns {mat4} a new 4x4 matrix\n */\nfunction clone(a) {\n var out = new Float32Array(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/clone.js\n// module id = 51\n// module chunks = 0","module.exports = transpose;\n\n/**\n * Transpose the values of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the source matrix\n * @returns {mat4} out\n */\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1], a02 = a[2], a03 = a[3],\n a12 = a[6], a13 = a[7],\n a23 = a[11];\n\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n \n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/transpose.js\n// module id = 52\n// module chunks = 0","module.exports = length;\n\n/**\n * Calculates the length of a vec3\n *\n * @param {vec3} a vector to calculate length of\n * @returns {Number} length of a\n */\nfunction length(a) {\n var x = a[0],\n y = a[1],\n z = a[2]\n return Math.sqrt(x*x + y*y + z*z)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-vec3/length.js\n// module id = 53\n// module chunks = 0","module.exports = require('gl-quat/slerp')\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/quat-slerp/index.js\n// module id = 54\n// module chunks = 0","module.exports = slerp\n\n/**\n * Performs a spherical linear interpolation between two quat\n *\n * @param {quat} out the receiving quaternion\n * @param {quat} a the first operand\n * @param {quat} b the second operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {quat} out\n */\nfunction slerp (out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n\n var ax = a[0], ay = a[1], az = a[2], aw = a[3],\n bx = b[0], by = b[1], bz = b[2], bw = b[3]\n\n var omega, cosom, sinom, scale0, scale1\n\n // calc cosine\n cosom = ax * bx + ay * by + az * bz + aw * bw\n // adjust signs (if necessary)\n if (cosom < 0.0) {\n cosom = -cosom\n bx = -bx\n by = -by\n bz = -bz\n bw = -bw\n }\n // calculate coefficients\n if ((1.0 - cosom) > 0.000001) {\n // standard case (slerp)\n omega = Math.acos(cosom)\n sinom = Math.sin(omega)\n scale0 = Math.sin((1.0 - t) * omega) / sinom\n scale1 = Math.sin(t * omega) / sinom\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t\n scale1 = t\n }\n // calculate final values\n out[0] = scale0 * ax + scale1 * bx\n out[1] = scale0 * ay + scale1 * by\n out[2] = scale0 * az + scale1 * bz\n out[3] = scale0 * aw + scale1 * bw\n\n return out\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-quat/slerp.js\n// module id = 55\n// module chunks = 0","module.exports = rotateX;\n\n/**\n * Rotates a matrix by the given angle around the X axis\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nfunction rotateX(out, a, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad),\n a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7],\n a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n\n if (a !== out) { // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n // Perform axis-specific matrix multiplication\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/rotateX.js\n// module id = 56\n// module chunks = 0","module.exports = rotateY;\n\n/**\n * Rotates a matrix by the given angle around the Y axis\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nfunction rotateY(out, a, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad),\n a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3],\n a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n\n if (a !== out) { // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n // Perform axis-specific matrix multiplication\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/rotateY.js\n// module id = 57\n// module chunks = 0","module.exports = rotateZ;\n\n/**\n * Rotates a matrix by the given angle around the Z axis\n *\n * @param {mat4} out the receiving matrix\n * @param {mat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nfunction rotateZ(out, a, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad),\n a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3],\n a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n\n if (a !== out) { // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n // Perform axis-specific matrix multiplication\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/gl-mat4/rotateZ.js\n// module id = 58\n// module chunks = 0","'use strict'\n\nmodule.exports = mouseListen\n\nvar mouse = require('mouse-event')\n\nfunction mouseListen (element, callback) {\n if (!callback) {\n callback = element\n element = window\n }\n\n var buttonState = 0\n var x = 0\n var y = 0\n var mods = {\n shift: false,\n alt: false,\n control: false,\n meta: false\n }\n var attached = false\n\n function updateMods (ev) {\n var changed = false\n if ('altKey' in ev) {\n changed = changed || ev.altKey !== mods.alt\n mods.alt = !!ev.altKey\n }\n if ('shiftKey' in ev) {\n changed = changed || ev.shiftKey !== mods.shift\n mods.shift = !!ev.shiftKey\n }\n if ('ctrlKey' in ev) {\n changed = changed || ev.ctrlKey !== mods.control\n mods.control = !!ev.ctrlKey\n }\n if ('metaKey' in ev) {\n changed = changed || ev.metaKey !== mods.meta\n mods.meta = !!ev.metaKey\n }\n return changed\n }\n\n function handleEvent (nextButtons, ev) {\n var nextX = mouse.x(ev)\n var nextY = mouse.y(ev)\n if ('buttons' in ev) {\n nextButtons = ev.buttons | 0\n }\n if (nextButtons !== buttonState ||\n nextX !== x ||\n nextY !== y ||\n updateMods(ev)) {\n buttonState = nextButtons | 0\n x = nextX || 0\n y = nextY || 0\n callback && callback(buttonState, x, y, mods)\n }\n }\n\n function clearState (ev) {\n handleEvent(0, ev)\n }\n\n function handleBlur () {\n if (buttonState ||\n x ||\n y ||\n mods.shift ||\n mods.alt ||\n mods.meta ||\n mods.control) {\n x = y = 0\n buttonState = 0\n mods.shift = mods.alt = mods.control = mods.meta = false\n callback && callback(0, 0, 0, mods)\n }\n }\n\n function handleMods (ev) {\n if (updateMods(ev)) {\n callback && callback(buttonState, x, y, mods)\n }\n }\n\n function handleMouseMove (ev) {\n if (mouse.buttons(ev) === 0) {\n handleEvent(0, ev)\n } else {\n handleEvent(buttonState, ev)\n }\n }\n\n function handleMouseDown (ev) {\n handleEvent(buttonState | mouse.buttons(ev), ev)\n }\n\n function handleMouseUp (ev) {\n handleEvent(buttonState & ~mouse.buttons(ev), ev)\n }\n\n function attachListeners () {\n if (attached) {\n return\n }\n attached = true\n\n element.addEventListener('mousemove', handleMouseMove)\n\n element.addEventListener('mousedown', handleMouseDown)\n\n element.addEventListener('mouseup', handleMouseUp)\n\n element.addEventListener('mouseleave', clearState)\n element.addEventListener('mouseenter', clearState)\n element.addEventListener('mouseout', clearState)\n element.addEventListener('mouseover', clearState)\n\n element.addEventListener('blur', handleBlur)\n\n element.addEventListener('keyup', handleMods)\n element.addEventListener('keydown', handleMods)\n element.addEventListener('keypress', handleMods)\n\n if (element !== window) {\n window.addEventListener('blur', handleBlur)\n\n window.addEventListener('keyup', handleMods)\n window.addEventListener('keydown', handleMods)\n window.addEventListener('keypress', handleMods)\n }\n }\n\n function detachListeners () {\n if (!attached) {\n return\n }\n attached = false\n\n element.removeEventListener('mousemove', handleMouseMove)\n\n element.removeEventListener('mousedown', handleMouseDown)\n\n element.removeEventListener('mouseup', handleMouseUp)\n\n element.removeEventListener('mouseleave', clearState)\n element.removeEventListener('mouseenter', clearState)\n element.removeEventListener('mouseout', clearState)\n element.removeEventListener('mouseover', clearState)\n\n element.removeEventListener('blur', handleBlur)\n\n element.removeEventListener('keyup', handleMods)\n element.removeEventListener('keydown', handleMods)\n element.removeEventListener('keypress', handleMods)\n\n if (element !== window) {\n window.removeEventListener('blur', handleBlur)\n\n window.removeEventListener('keyup', handleMods)\n window.removeEventListener('keydown', handleMods)\n window.removeEventListener('keypress', handleMods)\n }\n }\n\n // Attach listeners\n attachListeners()\n\n var result = {\n element: element\n }\n\n Object.defineProperties(result, {\n enabled: {\n get: function () { return attached },\n set: function (f) {\n if (f) {\n attachListeners()\n } else {\n detachListeners()\n }\n },\n enumerable: true\n },\n buttons: {\n get: function () { return buttonState },\n enumerable: true\n },\n x: {\n get: function () { return x },\n enumerable: true\n },\n y: {\n get: function () { return y },\n enumerable: true\n },\n mods: {\n get: function () { return mods },\n enumerable: true\n }\n })\n\n return result\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/mouse-change/mouse-listen.js\n// module id = 59\n// module chunks = 0","'use strict'\n\nfunction mouseButtons(ev) {\n if(typeof ev === 'object') {\n if('buttons' in ev) {\n return ev.buttons\n } else if('which' in ev) {\n var b = ev.which\n if(b === 2) {\n return 4\n } else if(b === 3) {\n return 2\n } else if(b > 0) {\n return 1<<(b-1)\n }\n } else if('button' in ev) {\n var b = ev.button\n if(b === 1) {\n return 4\n } else if(b === 2) {\n return 2\n } else if(b >= 0) {\n return 1<<b\n }\n }\n }\n return 0\n}\nexports.buttons = mouseButtons\n\nfunction mouseElement(ev) {\n return ev.target || ev.srcElement || window\n}\nexports.element = mouseElement\n\nfunction mouseRelativeX(ev) {\n if(typeof ev === 'object') {\n if('offsetX' in ev) {\n return ev.offsetX\n }\n var target = mouseElement(ev)\n var bounds = target.getBoundingClientRect()\n return ev.clientX - bounds.left\n }\n return 0\n}\nexports.x = mouseRelativeX\n\nfunction mouseRelativeY(ev) {\n if(typeof ev === 'object') {\n if('offsetY' in ev) {\n return ev.offsetY\n }\n var target = mouseElement(ev)\n var bounds = target.getBoundingClientRect()\n return ev.clientY - bounds.top\n }\n return 0\n}\nexports.y = mouseRelativeY\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/mouse-event/mouse.js\n// module id = 60\n// module chunks = 0","'use strict'\n\nvar toPX = require('to-px')\n\nmodule.exports = mouseWheelListen\n\nfunction mouseWheelListen(element, callback, noScroll) {\n if(typeof element === 'function') {\n noScroll = !!callback\n callback = element\n element = window\n }\n var lineHeight = toPX('ex', element)\n var listener = function(ev) {\n if(noScroll) {\n ev.preventDefault()\n }\n var dx = ev.deltaX || 0\n var dy = ev.deltaY || 0\n var dz = ev.deltaZ || 0\n var mode = ev.deltaMode\n var scale = 1\n switch(mode) {\n case 1:\n scale = lineHeight\n break\n case 2:\n scale = window.innerHeight\n break\n }\n dx *= scale\n dy *= scale\n dz *= scale\n if(dx || dy || dz) {\n return callback(dx, dy, dz, ev)\n }\n }\n element.addEventListener('wheel', listener)\n return listener\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/mouse-wheel/wheel.js\n// module id = 61\n// module chunks = 0","'use strict'\n\nvar parseUnit = require('parse-unit')\n\nmodule.exports = toPX\n\nvar PIXELS_PER_INCH = 96\n\nfunction getPropertyInPX(element, prop) {\n var parts = parseUnit(getComputedStyle(element).getPropertyValue(prop))\n return parts[0] * toPX(parts[1], element)\n}\n\n//This brutal hack is needed\nfunction getSizeBrutal(unit, element) {\n var testDIV = document.createElement('div')\n testDIV.style['font-size'] = '128' + unit\n element.appendChild(testDIV)\n var size = getPropertyInPX(testDIV, 'font-size') / 128\n element.removeChild(testDIV)\n return size\n}\n\nfunction toPX(str, element) {\n element = element || document.body\n str = (str || 'px').trim().toLowerCase()\n if(element === window || element === document) {\n element = document.body \n }\n switch(str) {\n case '%': //Ambiguous, not sure if we should use width or height\n return element.clientHeight / 100.0\n case 'ch':\n case 'ex':\n return getSizeBrutal(str, element)\n case 'em':\n return getPropertyInPX(element, 'font-size')\n case 'rem':\n return getPropertyInPX(document.body, 'font-size')\n case 'vw':\n return window.innerWidth/100\n case 'vh':\n return window.innerHeight/100\n case 'vmin':\n return Math.min(window.innerWidth, window.innerHeight) / 100\n case 'vmax':\n return Math.max(window.innerWidth, window.innerHeight) / 100\n case 'in':\n return PIXELS_PER_INCH\n case 'cm':\n return PIXELS_PER_INCH / 2.54\n case 'mm':\n return PIXELS_PER_INCH / 25.4\n case 'pt':\n return PIXELS_PER_INCH / 72\n case 'pc':\n return PIXELS_PER_INCH / 6\n }\n return 1\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/to-px/topx.js\n// module id = 62\n// module chunks = 0","module.exports = function parseUnit(str, out) {\n if (!out)\n out = [ 0, '' ]\n\n str = String(str)\n var num = parseFloat(str, 10)\n out[0] = num\n out[1] = str.match(/[\\d.\\-\\+]*\\s*(.*)/)[1] || ''\n return out\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/parse-unit/index.js\n// module id = 63\n// module chunks = 0","var rootPosition = { left: 0, top: 0 }\n\nmodule.exports = mouseEventOffset\nfunction mouseEventOffset (ev, target, out) {\n target = target || ev.currentTarget || ev.srcElement\n if (!Array.isArray(out)) {\n out = [ 0, 0 ]\n }\n var cx = ev.clientX || 0\n var cy = ev.clientY || 0\n var rect = getBoundingClientOffset(target)\n out[0] = cx - rect.left\n out[1] = cy - rect.top\n return out\n}\n\nfunction getBoundingClientOffset (element) {\n if (element === window ||\n element === document ||\n element === document.body) {\n return rootPosition\n } else {\n return element.getBoundingClientRect()\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/mouse-event-offset/index.js\n// module id = 64\n// module chunks = 0","import {vec2, vec4, mat4} from 'gl-matrix';\r\nimport Drawable from './Drawable';\r\nimport {gl} from '../../globals';\r\n\r\nvar activeProgram: WebGLProgram = null;\r\n\r\nexport class Shader {\r\n shader: WebGLShader;\r\n\r\n constructor(type: number, source: string) {\r\n this.shader = gl.createShader(type);\r\n gl.shaderSource(this.shader, source);\r\n gl.compileShader(this.shader);\r\n\r\n if (!gl.getShaderParameter(this.shader, gl.COMPILE_STATUS)) {\r\n throw gl.getShaderInfoLog(this.shader);\r\n }\r\n }\r\n};\r\n\r\nclass ShaderProgram {\r\n prog: WebGLProgram;\r\n\r\n attrPos: number;\r\n attrNor: number;\r\n attrCol: number;\r\n\r\n unifModel: WebGLUniformLocation;\r\n unifModelInvTr: WebGLUniformLocation;\r\n unifViewProj: WebGLUniformLocation;\r\n\r\n unifSunPosition: WebGLUniformLocation;\r\n unifOceanColor: WebGLUniformLocation;\r\n unifShorelineColor: WebGLUniformLocation;\r\n unifFoliageColor: WebGLUniformLocation;\r\n unifMountainsColor: WebGLUniformLocation;\r\n unifSnowColor: WebGLUniformLocation;\r\n unifPolarCapsColor: WebGLUniformLocation;\r\n unifAtmosphereColor: WebGLUniformLocation;\r\n\r\n unifHeights: WebGLUniformLocation;\r\n unifTimeInfo : WebGLUniformLocation;\r\n unifCameraPos : WebGLUniformLocation;\r\n unifDiffuseMap: WebGLUniformLocation;\r\n\r\n constructor(shaders: Array<Shader>) {\r\n this.prog = gl.createProgram();\r\n\r\n for (let shader of shaders) {\r\n gl.attachShader(this.prog, shader.shader);\r\n }\r\n gl.linkProgram(this.prog);\r\n if (!gl.getProgramParameter(this.prog, gl.LINK_STATUS)) {\r\n throw gl.getProgramInfoLog(this.prog);\r\n }\r\n\r\n this.attrPos = gl.getAttribLocation(this.prog, \"vs_Pos\");\r\n this.attrNor = gl.getAttribLocation(this.prog, \"vs_Nor\");\r\n this.attrCol = gl.getAttribLocation(this.prog, \"vs_Col\");\r\n this.unifModel = gl.getUniformLocation(this.prog, \"u_Model\");\r\n this.unifModelInvTr = gl.getUniformLocation(this.prog, \"u_ModelInvTr\");\r\n this.unifViewProj = gl.getUniformLocation(this.prog, \"u_ViewProj\");\r\n\r\n this.unifSunPosition = gl.getUniformLocation(this.prog, \"u_SunPosition\");\r\n\r\n this.unifOceanColor = gl.getUniformLocation(this.prog, \"u_OceanColor\");\r\n this.unifShorelineColor = gl.getUniformLocation(this.prog, \"u_ShorelineColor\");\r\n this.unifFoliageColor = gl.getUniformLocation(this.prog, \"u_FoliageColor\");\r\n this.unifMountainsColor = gl.getUniformLocation(this.prog, \"u_MountainsColor\");\r\n this.unifSnowColor = gl.getUniformLocation(this.prog, \"u_SnowColor\");\r\n this.unifPolarCapsColor = gl.getUniformLocation(this.prog, \"u_PolarCapsColor\");\r\n this.unifAtmosphereColor = gl.getUniformLocation(this.prog, \"u_AtmosphereColor\");\r\n this.unifHeights = gl.getUniformLocation(this.prog, \"u_HeightsInfo\");\r\n\r\n this.unifTimeInfo = gl.getUniformLocation(this.prog, \"u_TimeInfo\");\r\n\r\n this.unifCameraPos = gl.getUniformLocation(this.prog, \"u_CameraPos\");\r\n\r\n this.unifDiffuseMap = gl.getUniformLocation(this.prog, \"u_DiffuseMap\");\r\n }\r\n\r\n use() {\r\n if (activeProgram !== this.prog) {\r\n gl.useProgram(this.prog);\r\n activeProgram = this.prog;\r\n }\r\n }\r\n\r\n setModelMatrix(model: mat4) {\r\n this.use();\r\n if (this.unifModel !== -1) {\r\n gl.uniformMatrix4fv(this.unifModel, false, model);\r\n }\r\n\r\n if (this.unifModelInvTr !== -1) {\r\n let modelinvtr: mat4 = mat4.create();\r\n mat4.transpose(modelinvtr, model);\r\n mat4.invert(modelinvtr, modelinvtr);\r\n gl.uniformMatrix4fv(this.unifModelInvTr, false, modelinvtr);\r\n }\r\n }\r\n\r\n setViewProjMatrix(vp: mat4) {\r\n this.use();\r\n if (this.unifViewProj !== -1) {\r\n gl.uniformMatrix4fv(this.unifViewProj, false, vp);\r\n }\r\n }\r\n\r\n setSunPos(pos: vec4) {\r\n this.use();\r\n if (this.unifSunPosition !== -1) {\r\n gl.uniform4fv(this.unifSunPosition, pos);\r\n }\r\n }\r\n\r\n setOceanColor(color: vec4) {\r\n this.use();\r\n if (this.unifOceanColor !== -1) {\r\n gl.uniform4fv(this.unifOceanColor, color);\r\n }\r\n }\r\n\r\n setShorelineColor(color: vec4) {\r\n this.use();\r\n if (this.unifShorelineColor !== -1) {\r\n gl.uniform4fv(this.unifShorelineColor, color);\r\n }\r\n }\r\n\r\n setFoliageColor(color: vec4) {\r\n this.use();\r\n if (this.unifFoliageColor !== -1) {\r\n gl.uniform4fv(this.unifFoliageColor, color);\r\n }\r\n }\r\n\r\n setMountainsColor(color: vec4) {\r\n this.use();\r\n if (this.unifMountainsColor !== -1) {\r\n gl.uniform4fv(this.unifMountainsColor, color);\r\n }\r\n }\r\n\r\n setSnowColor(color: vec4) {\r\n this.use();\r\n if (this.unifSnowColor !== -1) {\r\n gl.uniform4fv(this.unifSnowColor, color);\r\n }\r\n }\r\n\r\n setPolarCapsColor(color: vec4) {\r\n this.use();\r\n if (this.unifPolarCapsColor !== -1) {\r\n gl.uniform4fv(this.unifPolarCapsColor, color);\r\n }\r\n }\r\n\r\n\r\n setAtmosphereColor(color: vec4) {\r\n this.use();\r\n if (this.unifAtmosphereColor !== -1) {\r\n gl.uniform4fv(this.unifAtmosphereColor, color);\r\n }\r\n }\r\n\r\n setHeights(heights: vec4) {\r\n this.use();\r\n if (this.unifHeights !== -1) {\r\n gl.uniform4fv(this.unifHeights, heights);\r\n }\r\n }\r\n\r\n setTimeInfo(info: vec4) {\r\n this.use();\r\n if (this.unifTimeInfo !== -1) {\r\n gl.uniform4fv(this.unifTimeInfo, info);\r\n }\r\n }\r\n\r\n setCameraPos(cameraPos: vec4) {\r\n this.use();\r\n if (this.unifCameraPos !== -1) {\r\n gl.uniform4fv(this.unifCameraPos, cameraPos);\r\n }\r\n }\r\n\r\n setTexture(texture: WebGLTexture) {\r\n this.use();\r\n if (this.unifDiffuseMap !== -1) {\r\n gl.bindTexture(gl.TEXTURE_2D, texture);\r\n gl.uniform1i(gl.getUniformLocation(this.prog, \"u_DiffuseMap\"), 0);\r\n }\r\n }\r\n\r\n draw(d: Drawable) {\r\n this.use();\r\n\r\n if (this.attrPos != -1 && d.bindPos()) {\r\n gl.enableVertexAttribArray(this.attrPos);\r\n gl.vertexAttribPointer(this.attrPos, 4, gl.FLOAT, false, 0, 0);\r\n }\r\n\r\n if (this.attrNor != -1 && d.bindNor()) {\r\n gl.enableVertexAttribArray(this.attrNor);\r\n gl.vertexAttribPointer(this.attrNor, 4, gl.FLOAT, false, 0, 0);\r\n }\r\n\r\n d.bindIdx();\r\n gl.drawElements(d.drawMode(), d.elemCount(), gl.UNSIGNED_INT, 0);\r\n\r\n if (this.attrPos != -1) gl.disableVertexAttribArray(this.attrPos);\r\n if (this.attrNor != -1) gl.disableVertexAttribArray(this.attrNor);\r\n }\r\n};\r\n\r\nexport default ShaderProgram;\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/rendering/gl/ShaderProgram.ts","module.exports = \"#version 300 es\\r\\n\\r\\n\\r\\nuniform mat4 u_Model; \\r\\nuniform mat4 u_ModelInvTr;\\r\\nuniform mat4 u_ViewProj; \\r\\n\\r\\nuniform vec4 u_SunPosition;\\r\\n\\r\\nuniform vec4 u_OceanColor;\\r\\nuniform vec4 u_ShorelineColor;\\r\\nuniform vec4 u_FoliageColor;\\r\\nuniform vec4 u_MountainsColor;\\r\\nuniform vec4 u_SnowColor;\\r\\nuniform vec4 u_PolarCapsColor;\\r\\nuniform vec4 u_AtmosphereColor;\\r\\n\\r\\nuniform vec4 u_HeightsInfo; // x : Ocean, y : Shore, z : Snow, w : Polar, \\r\\n\\r\\nuniform vec4 u_TimeInfo;\\r\\n\\r\\nuniform vec4 u_CameraPos;\\r\\n\\r\\nin vec4 vs_Pos; // The array of vertex positions passed to the shader\\r\\nin vec4 vs_Nor; // The array of vertex normals passed to the shader\\r\\nin vec4 vs_Col; // The array of vertex colors passed to the shader.\\r\\n\\r\\n//Noise Generator, refer to \\\"Implicit Procedural Planet Generation Report\\\" \\r\\n\\r\\n\\r\\nfloat hash(vec2 p) { return fract(1e4 * sin(17.0 * p.x + p.y * 0.1) * (0.1 + abs(sin(p.y * 13.0 + p.x)))); }\\r\\n\\r\\nfloat hash(float n)\\r\\n{ \\r\\n //4D\\r\\n if(u_TimeInfo.y > 0.0 )\\r\\n {\\r\\n return fract( sin(n) *cos( u_TimeInfo.x * 0.00001) * 1e4);\\r\\n }\\r\\n else\\r\\n {\\r\\n return fract(sin(n) * cos( u_TimeInfo.w * 0.00001) * 1e4);\\r\\n }\\r\\n \\r\\n}\\r\\n//float noise(float x) { float i = floor(x); float f = fract(x); float u = f * f * (3.0 - 2.0 * f); return mix(hash(i), hash(i + 1.0), u); }\\r\\n\\r\\nfloat noise(vec3 x)\\r\\n{ \\r\\n vec3 step = vec3(110, 241, 171);\\r\\n vec3 i = floor(x); \\r\\n vec3 f = fract(x);\\r\\n float n = dot(i, step);\\r\\n vec3 u = f * f * (3.0 - 2.0 * f);\\r\\n return mix(mix(mix( hash(n + dot(step, vec3(0, 0, 0))), hash(n + dot(step, vec3(1, 0, 0))), u.x),\\r\\n mix( hash(n + dot(step, vec3(0, 1, 0))), hash(n + dot(step, vec3(1, 1, 0))), u.x), u.y),\\r\\n mix(mix( hash(n + dot(step, vec3(0, 0, 1))), hash(n + dot(step, vec3(1, 0, 1))), u.x),\\r\\n mix( hash(n + dot(step, vec3(0, 1, 1))), hash(n + dot(step, vec3(1, 1, 1))), u.x), u.y), u.z);\\r\\n}\\r\\n\\r\\n#define Epsilon 0.0001\\r\\n\\r\\n#define OCTAVES 6\\r\\nfloat fbm(vec3 x)\\r\\n{\\r\\n float v = 0.0;\\r\\n float a = 0.5;\\r\\n vec3 shift = vec3(100.0);\\r\\n\\r\\n for (int i = 0; i < OCTAVES; ++i)\\r\\n {\\r\\n v += a * noise(x);\\r\\n x = x * 2.0 + shift;\\r\\n a *= 0.5;\\r\\n } \\r\\n return v;\\r\\n}\\r\\n\\r\\nout vec4 fs_Pos;\\r\\nout vec4 fs_Nor; // The array of normals that has been transformed by u_ModelInvTr. This is implicitly passed to the fragment shader.\\r\\nout vec4 fs_LightVec; // The direction in which our virtual light lies, relative to each vertex. This is implicitly passed to the fragment shader.\\r\\nout vec4 fs_Col; // The color of each vertex. This is implicitly passed to the fragment shader.\\r\\nout vec4 fs_TerrainInfo; // x: oceanFlag , y: , z:, w: roughness \\r\\nout vec4 fs_ViewVec;\\r\\n\\r\\n vec3 applyNormalMap(vec3 geomnor, vec3 normap) {\\r\\n //normap = normap * 2.0 - 1.0;\\r\\n vec3 up = normalize(vec3(0.001, 1, 0.001));\\r\\n vec3 surftan = normalize(cross(geomnor, up));\\r\\n vec3 surfbinor = cross(geomnor, surftan);\\r\\n return normap.y * surftan + normap.x * surfbinor + normap.z * geomnor;\\r\\n }\\r\\n\\r\\nvec3 getTerrainPos(vec3 worldPos, float resolution)\\r\\n{\\r\\n vec3 localNormal = normalize(worldPos);\\r\\n return worldPos + localNormal * fbm(worldPos*resolution);\\r\\n}\\r\\n\\r\\nfloat OceanNoise(vec3 vertexPos, float oceneHeight, float noiseResult)\\r\\n{\\r\\n float relativeWaterDepth = min(1.0, (oceneHeight - noiseResult) * 15.0);\\r\\n\\r\\n float oceanTime = u_TimeInfo.x * 0.03;\\r\\n\\r\\n float shallowWaveRefraction = 4.0;\\r\\n float waveMagnitude = 0.001;\\r\\n float waveLength = 0.004;\\r\\n\\r\\n float shallowWavePhase = (vertexPos.y - noiseResult * shallowWaveRefraction) * (1.0 / waveLength);\\r\\n float deepWavePhase = (atan(vertexPos.z, vertexPos.x) + noise(vertexPos.xyz * 15.0) * 0.075) * (1.5 / waveLength);\\r\\n return (cos(shallowWavePhase + oceanTime * 1.5) * sqrt(1.0 - relativeWaterDepth) + cos(deepWavePhase + oceanTime * 2.0) * 2.5 * (1.0 - abs(vertexPos.y)) * (relativeWaterDepth * relativeWaterDepth)) * waveMagnitude;\\r\\n}\\r\\n\\r\\nvoid main()\\r\\n{\\r\\n fs_Col = vs_Col;\\r\\n\\r\\n fs_TerrainInfo = vec4(0.0);\\r\\n\\r\\n vec4 vertexPos = vs_Pos;\\r\\n fs_Pos = vs_Pos;\\r\\n\\r\\n float oceneHeight = length(vertexPos.xyz) + u_HeightsInfo.x;\\r\\n vec3 localNormal = normalize(vertexPos.xyz);\\r\\n\\r\\n float u_resolution = 4.0;\\r\\n\\r\\n float noiseResult = fbm(vertexPos.xyz*u_resolution) * 2.0;\\r\\n \\r\\n noiseResult = pow(noiseResult, u_TimeInfo.z);\\r\\n\\r\\n vertexPos.xyz += localNormal * noiseResult;\\r\\n\\r\\n float height = length(vertexPos.xyz);\\r\\n\\r\\n mat3 invTranspose = mat3(u_ModelInvTr);\\r\\n\\r\\n float gap = clamp((1.0 - (oceneHeight - height)), 0.0, 1.0);\\r\\n gap = pow(gap, 3.0);\\r\\n vec4 ocenColor = u_OceanColor * gap;\\r\\n\\r\\n float oceneRougness = 0.15;\\r\\n float iceRougness = 0.15;\\r\\n float foliageRougness = 0.8;\\r\\n float snowRougness = 0.8;\\r\\n float shoreRougness = 0.9;\\r\\n\\r\\n //ocean\\r\\n if(height < oceneHeight)\\r\\n {\\r\\n float wave = OceanNoise(vertexPos.xyz, oceneHeight, noiseResult); \\r\\n wave *= max(1.0 - gap, 0.0); \\r\\n vertexPos.xyz = (oceneHeight + wave) * localNormal;\\r\\n\\r\\n fs_Pos = vertexPos;\\r\\n fs_TerrainInfo.w = oceneRougness;\\r\\n fs_Col = ocenColor;\\r\\n }\\r\\n //shore\\r\\n else\\r\\n {\\r\\n fs_TerrainInfo.x = 0.05;\\r\\n\\r\\n float appliedAttitude;\\r\\n \\r\\n if(abs(vertexPos.y) > u_HeightsInfo.w)\\r\\n appliedAttitude = clamp((abs(vertexPos.y) - u_HeightsInfo.w) * 3.0, 0.0, 1.0);\\r\\n else \\r\\n appliedAttitude = 0.0;\\r\\n\\r\\n vec4 terrainColor = mix(u_FoliageColor, u_PolarCapsColor, appliedAttitude);\\r\\n float terrainRoughness = mix(foliageRougness, iceRougness, appliedAttitude);\\r\\n\\r\\n vertexPos.xyz = height * localNormal;\\r\\n\\r\\n float oceneLine = oceneHeight + u_HeightsInfo.y;\\r\\n float snowLine = 1.0 + u_HeightsInfo.z;\\r\\n\\r\\n if(height < oceneLine)\\r\\n {\\r\\n fs_Col = u_ShorelineColor;\\r\\n fs_TerrainInfo.w = shoreRougness;\\r\\n }\\r\\n else if(height >= snowLine)\\r\\n {\\r\\n fs_TerrainInfo.x = 0.15;\\r\\n\\r\\n float alpha = clamp( (height - snowLine ) / 0.03, 0.0, 1.0);\\r\\n fs_Col = mix(terrainColor, u_SnowColor, alpha);\\r\\n\\r\\n fs_TerrainInfo.w = mix(terrainRoughness, snowRougness, alpha);\\r\\n } \\r\\n else\\r\\n {\\r\\n float alpha = clamp( (height - oceneLine ) / u_HeightsInfo.y, 0.0, 1.0);\\r\\n fs_Col = mix(u_ShorelineColor, terrainColor, alpha);\\r\\n\\r\\n fs_TerrainInfo.w = mix(shoreRougness, terrainRoughness, alpha);\\r\\n }\\r\\n }\\r\\n \\r\\n vec4 modelposition = u_Model * vertexPos;\\r\\n vec3 sunDirection = normalize(u_SunPosition.xyz);\\r\\n\\r\\n mat3 invModel = mat3(inverse(u_Model));\\r\\n sunDirection = invModel * sunDirection;\\r\\n\\r\\n fs_LightVec = vec4(normalize(sunDirection), 1.0);\\r\\n\\r\\n vec3 viewVec = u_CameraPos.xyz - modelposition.xyz;\\r\\n fs_ViewVec = vec4( invModel * normalize(viewVec), length(u_CameraPos.xyz));\\r\\n\\r\\n gl_Position = u_ViewProj * modelposition;\\r\\n}\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/shaders/noisePlanet-vert.glsl\n// module id = 66\n// module chunks = 0","module.exports = \"#version 300 es\\r\\n//#extension GL_OES_standard_derivatives : enable\\r\\n\\r\\nprecision highp float;\\r\\n\\r\\n#define PI 3.1415926535897932384626422832795028841971\\r\\n#define TwoPi 6.28318530717958647692\\r\\n#define InvPi 0.31830988618379067154\\r\\n#define Inv2Pi 0.15915494309189533577\\r\\n#define Inv4Pi 0.07957747154594766788\\r\\n\\r\\n//uniform vec4 u_Color; // The color with which to render this instance of geometry.\\r\\n\\r\\nuniform vec4 u_SunPosition;\\r\\n\\r\\nuniform vec4 u_OceanColor;\\r\\nuniform vec4 u_ShorelineColor;\\r\\nuniform vec4 u_FoliageColor;\\r\\nuniform vec4 u_MountainsColor;\\r\\nuniform vec4 u_SnowColor;\\r\\nuniform vec4 u_PolarCapsColor;\\r\\nuniform vec4 u_AtmosphereColor;\\r\\n\\r\\nuniform vec4 u_HeightsInfo;\\r\\n\\r\\nuniform vec4 u_CameraPos;\\r\\n\\r\\nuniform vec4 u_TimeInfo;\\r\\n\\r\\nuniform sampler2D u_DiffuseMap;\\r\\n\\r\\n\\r\\nvec2 LightingFunGGX_FV(float dotLH, float roughness)\\r\\n{\\r\\n\\tfloat alpha = roughness*roughness;\\r\\n\\r\\n\\t//F\\r\\n\\tfloat F_a, F_b;\\r\\n\\tfloat dotLH5 = pow(clamp(1.0f - dotLH, 0.0f, 1.0f), 5.0f);\\r\\n\\tF_a = 1.0f;\\r\\n\\tF_b = dotLH5;\\r\\n\\r\\n\\t//V\\r\\n\\tfloat vis;\\r\\n\\tfloat k = alpha * 0.5f;\\r\\n\\tfloat k2 = k*k;\\r\\n\\tfloat invK2 = 1.0f - k2;\\r\\n\\tvis = 1.0f/(dotLH*dotLH*invK2 + k2);\\r\\n\\r\\n\\treturn vec2((F_a - F_b)*vis, F_b*vis);\\r\\n}\\r\\n\\r\\nfloat LightingFuncGGX_D(float dotNH, float roughness)\\r\\n{\\r\\n\\tfloat alpha = roughness*roughness;\\r\\n\\tfloat alphaSqr = alpha*alpha;\\r\\n\\tfloat denom = dotNH * dotNH * (alphaSqr - 1.0f) + 1.0f;\\r\\n\\r\\n\\treturn alphaSqr / (PI*denom*denom);\\r\\n}\\r\\n\\r\\nvec3 GGX_Spec(vec3 Normal, vec3 HalfVec, float Roughness, vec3 BaseColor, vec3 SpecularColor, vec2 paraFV)\\r\\n{\\r\\n\\tfloat NoH = clamp(dot(Normal, HalfVec), 0.0, 1.0);\\r\\n\\r\\n\\tfloat D = LightingFuncGGX_D(NoH * NoH * NoH * NoH, Roughness);\\r\\n\\tvec2 FV_helper = paraFV;\\r\\n\\r\\n\\tvec3 F0 = SpecularColor;\\r\\n\\tvec3 FV = F0*FV_helper.x + vec3(FV_helper.y, FV_helper.y, FV_helper.y);\\r\\n\\t\\r\\n\\treturn D * FV;\\r\\n}\\r\\n\\r\\nfloat hash(float n)\\r\\n{ \\r\\n //4D\\r\\n if(u_TimeInfo.y > 0.0 )\\r\\n {\\r\\n return fract(sin(n) *cos(u_TimeInfo.x * 0.00001) * 1e4);\\r\\n }\\r\\n else\\r\\n {\\r\\n return fract(sin(n) * cos( u_TimeInfo.w * 0.00001) * 1e4);\\r\\n }\\r\\n \\r\\n}\\r\\n\\r\\nfloat hash(vec2 p) { return fract(1e4 * sin(17.0 * p.x + p.y * 0.1) * (0.1 + abs(sin(p.y * 13.0 + p.x)))); }\\r\\nfloat noise(float x) { float i = floor(x); float f = fract(x); float u = f * f * (3.0 - 2.0 * f); return mix(hash(i), hash(i + 1.0), u); }\\r\\n\\r\\nfloat noise(vec3 x)\\r\\n{ \\r\\n vec3 step = vec3(110, 241, 171);\\r\\n vec3 i = floor(x); \\r\\n vec3 f = fract(x);\\r\\n float n = dot(i, step);\\r\\n vec3 u = f * f * (3.0 - 2.0 * f);\\r\\n return mix(mix(mix( hash(n + dot(step, vec3(0, 0, 0))), hash(n + dot(step, vec3(1, 0, 0))), u.x),\\r\\n mix( hash(n + dot(step, vec3(0, 1, 0))), hash(n + dot(step, vec3(1, 1, 0))), u.x), u.y),\\r\\n mix(mix( hash(n + dot(step, vec3(0, 0, 1))), hash(n + dot(step, vec3(1, 0, 1))), u.x),\\r\\n mix( hash(n + dot(step, vec3(0, 1, 1))), hash(n + dot(step, vec3(1, 1, 1))), u.x), u.y), u.z);\\r\\n}\\r\\n\\r\\n#define Epsilon 0.0001\\r\\n\\r\\nfloat fbm(vec3 x, int LOD)\\r\\n{\\r\\n float v = 0.0;\\r\\n float a = 0.5;\\r\\n vec3 shift = vec3(100.0);\\r\\n\\r\\n for (int i = 0; i < LOD; ++i)\\r\\n {\\r\\n v += a * noise(x);\\r\\n x = x * 2.0 + shift;\\r\\n a *= 0.5;\\r\\n } \\r\\n return v;\\r\\n}\\r\\n\\r\\n\\r\\n// These are the interpolated values out of the rasterizer, so you can't know\\r\\n// their specific values without knowing the vertices that contributed to them\\r\\nin vec4 fs_Pos;\\r\\nin vec4 fs_Nor;\\r\\nin vec4 fs_LightVec;\\r\\nin vec4 fs_Col;\\r\\nin vec4 fs_TerrainInfo; // x: oceanFlag , y: , z:, w: roughness\\r\\nin vec4 fs_ViewVec;\\r\\n\\r\\nout vec4 out_Col; // This is the final output color that you will see on your\\r\\n // screen for the pixel that is currently being processed.\\r\\n\\r\\nfloat SphericalTheta(vec3 v)\\r\\n{\\r\\n\\treturn acos(clamp(v.y, -1.0f, 1.0f));\\r\\n}\\r\\n\\r\\nfloat SphericalPhi(vec3 v)\\r\\n{\\r\\n\\tfloat p = atan(v.z , v.x);\\r\\n\\treturn (p < 0.0f) ? (p + TwoPi) : p;\\r\\n}\\r\\n\\r\\nvoid main()\\r\\n{\\r\\n // Material base color (before shading)\\r\\n vec3 normalVec = normalize(fs_Nor.xyz);\\r\\n\\r\\n vec4 diffuseColor = fs_Col;\\r\\n\\r\\n float Roughness = fs_TerrainInfo.w;\\r\\n\\tfloat energyConservation = 1.0f - Roughness;\\r\\n\\r\\n vec3 specularTerm = vec3(0.0);\\r\\n vec3 SpecularColor = vec3(1.0, 1.0, 1.0);\\r\\n\\r\\n vec3 localNormal = normalize(fs_Pos.xyz);\\r\\n\\r\\n //Terrain-atmosphere Color Interpolation\\r\\n float a = 1.0 - clamp(dot(fs_ViewVec.xyz, localNormal), 0.0, 1.0);\\r\\n\\r\\n a = pow(a, 5.0);\\r\\n\\r\\n //terrain\\r\\n if(fs_TerrainInfo.x > 0.0 && fs_TerrainInfo.x < 0.2 )\\r\\n {\\r\\n float u_resolution = 4.0;\\r\\n\\r\\n float constant = 10.0;\\r\\n\\r\\n float sm = (1.0 - smoothstep(0.0, 6.0, log(fs_ViewVec.w)));\\r\\n\\r\\n int LOD = int(constant * pow(sm, 1.7));\\r\\n\\r\\n float noise = fbm(fs_Pos.xyz*u_resolution, LOD) * 2.0;\\r\\n \\r\\n noise = pow(noise, u_TimeInfo.z);\\r\\n\\r\\n vec4 vertexPos = fs_Pos;\\r\\n vertexPos.xyz += localNormal * noise;\\r\\n\\r\\n //detail normal\\r\\n normalVec = normalize(cross( dFdx(vertexPos.xyz), dFdy(vertexPos.xyz))); \\r\\n \\r\\n float NolN= clamp(dot(localNormal, normalVec), 0.0, 1.0);\\r\\n diffuseColor = mix(u_MountainsColor, diffuseColor, NolN*NolN*NolN); \\r\\n }\\r\\n else\\r\\n {\\r\\n vec4 vertexPos = fs_Pos;\\r\\n\\r\\n //detail normal\\r\\n normalVec = normalize(cross( dFdx(vertexPos.xyz), dFdy(vertexPos.xyz))); \\r\\n }\\r\\n \\r\\n\\r\\n float diffuseTerm = clamp(dot(normalVec, normalize(fs_LightVec.xyz)), 0.0, 1.0);\\r\\n\\r\\n //Lambert\\r\\n if(u_SunPosition.w == 0.0)\\r\\n {\\r\\n\\r\\n }\\r\\n //Blinn_Phong\\r\\n else if(u_SunPosition.w == 1.0)\\r\\n {\\r\\n vec3 halfVec = fs_ViewVec.xyz + fs_LightVec.xyz;\\r\\n halfVec = normalize(halfVec);\\r\\n \\r\\n //Intensity of the specular light\\r\\n\\t\\tfloat NoH = clamp(dot( normalVec, halfVec ), 0.0, 1.0);\\r\\n\\t\\tspecularTerm = vec3(pow(clamp(NoH, 0.0, 1.0), pow(200.0, energyConservation))) * SpecularColor * energyConservation;\\r\\n }\\r\\n //PBS\\r\\n else if(u_SunPosition.w == 2.0)\\r\\n {\\r\\n vec3 halfVec = fs_ViewVec.xyz + fs_LightVec.xyz;\\r\\n halfVec = normalize(halfVec);\\r\\n float LoH = clamp(dot( fs_LightVec.xyz, halfVec ), 0.0, 1.0);\\r\\n\\r\\n specularTerm = GGX_Spec(normalVec, halfVec, Roughness, diffuseColor.xyz, SpecularColor, LightingFunGGX_FV(LoH, Roughness)) *energyConservation;\\r\\n }\\r\\n\\r\\n float ambientTerm = 0.0;\\r\\n\\r\\n float lightIntensity = diffuseTerm + ambientTerm; //Add a small float value to the color multiplier\\r\\n //to simulate ambient lighting. This ensures that faces that are not\\r\\n //lit by our point light are not completely black.\\r\\n\\r\\n vec3 reflecVec = reflect(-fs_ViewVec.xyz, normalVec);\\r\\n \\r\\n //Envmap\\r\\n vec2 st = vec2(SphericalPhi(reflecVec.xyz) * Inv2Pi, SphericalTheta(reflecVec.xyz) * InvPi);\\r\\n vec4 envColor = u_CameraPos.w > 0.0 ? texture(u_DiffuseMap, st) * energyConservation * 0.5 : vec4(0.0);\\r\\n\\r\\n // Compute final shaded color\\r\\n vec4 planetColor = vec4( ( diffuseColor.rgb + specularTerm + envColor.xyz) * lightIntensity, 1.0);\\r\\n\\r\\n \\r\\n\\r\\n out_Col = vec4(mix(planetColor.xyz ,u_AtmosphereColor.xyz, a), 1.0);\\r\\n\\r\\n}\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/shaders/noisePlanet-frag.glsl\n// module id = 67\n// module chunks = 0","module.exports = \"#version 300 es\\r\\n\\r\\n//This is a vertex shader. While it is called a \\\"shader\\\" due to outdated conventions, this file\\r\\n//is used to apply matrix transformations to the arrays of vertex data passed to it.\\r\\n//Since this code is run on your GPU, each vertex is transformed simultaneously.\\r\\n//If it were run on your CPU, each vertex would have to be processed in a FOR loop, one at a time.\\r\\n//This simultaneous transformation allows your program to run much faster, especially when rendering\\r\\n//geometry with millions of vertices.\\r\\n\\r\\nuniform mat4 u_Model; // The matrix that defines the transformation of the\\r\\n // object we're rendering. In this assignment,\\r\\n // this will be the result of traversing your scene graph.\\r\\n\\r\\nuniform mat4 u_ModelInvTr; // The inverse transpose of the model matrix.\\r\\n // This allows us to transform the object's normals properly\\r\\n // if the object has been non-uniformly scaled.\\r\\n\\r\\nuniform mat4 u_ViewProj; // The matrix that defines the camera's transformation.\\r\\n // We've written a static matrix for you to use for HW2,\\r\\n // but in HW3 you'll have to generate one yourself\\r\\n\\r\\nuniform vec4 u_TimeInfo;\\r\\n\\r\\nin vec4 vs_Pos; // The array of vertex positions passed to the shader\\r\\nin vec4 vs_Nor; // The array of vertex normals passed to the shader\\r\\nin vec4 vs_Col; // The array of vertex colors passed to the shader.\\r\\n\\r\\nout vec2 fs_UV;\\r\\n\\r\\nvoid main()\\r\\n{\\r\\n if(gl_VertexID == 0)\\r\\n {\\r\\n gl_Position = vec4(-1.0, -1.0, 0.99999, 1.0);\\r\\n fs_UV = vec2(0.0, 1.0);\\r\\n }\\r\\n else if(gl_VertexID == 1)\\r\\n {\\r\\n gl_Position = vec4(1.0, -1.0, 0.99999, 1.0);\\r\\n fs_UV = vec2(1.0, 1.0);\\r\\n }\\r\\n else if(gl_VertexID == 2)\\r\\n {\\r\\n gl_Position = vec4(1.0, 1.0, 0.99999, 1.0);\\r\\n fs_UV = vec2(1.0, 0.0);\\r\\n }\\r\\n else if(gl_VertexID == 3)\\r\\n {\\r\\n gl_Position = vec4(-1.0, 1.0, 0.99999, 1.0);\\r\\n fs_UV = vec2(0.0, 0.0);\\r\\n }\\r\\n}\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/shaders/backGround-vert.glsl\n// module id = 68\n// module chunks = 0","module.exports = \"#version 300 es\\r\\n\\r\\n// This is a fragment shader. If you've opened this file first, please\\r\\n// open and read lambert.vert.glsl before reading on.\\r\\n// Unlike the vertex shader, the fragment shader actually does compute\\r\\n// the shading of geometry. For every pixel in your program's output\\r\\n// screen, the fragment shader is run for every bit of geometry that\\r\\n// particular pixel overlaps. By implicitly interpolating the position\\r\\n// data passed into the fragment shader by the vertex shader, the fragment shader\\r\\n// can compute what color to apply to its pixel based on things like vertex\\r\\n// position, light position, and vertex color.\\r\\nprecision highp float;\\r\\n\\r\\nuniform mat4 u_Model;\\r\\nuniform mat4 u_ViewProj; \\r\\n\\r\\nuniform vec4 u_Color; // The color with which to render this instance of geometry.\\r\\nuniform vec4 u_CameraPos;\\r\\nuniform vec4 u_OceanColor; // this is for screenSize\\r\\nuniform vec4 u_AtmosphereColor;\\r\\n\\r\\nuniform vec4 u_TimeInfo;\\r\\n\\r\\nfloat hash(float n) { return fract(sin(n) * 1e4); }\\r\\nfloat hash(vec2 p) { return fract(1e4 * sin(17.0 * p.x + p.y * 0.1) * (0.1 + abs(sin(p.y * 13.0 + p.x)))); }\\r\\nfloat noise(float x) { float i = floor(x); float f = fract(x); float u = f * f * (3.0 - 2.0 * f); return mix(hash(i), hash(i + 1.0), u); }\\r\\nfloat noise(vec2 x) { vec2 i = floor(x); vec2 f = fract(x); float a = hash(i); float b = hash(i + vec2(1.0, 0.0)); float c = hash(i + vec2(0.0, 1.0)); float d = hash(i + vec2(1.0, 1.0)); vec2 u = f * f * (3.0 - 2.0 * f); return mix(a, b, u.x) + (c - a) * u.y * (1.0 - u.x) + (d - b) * u.x * u.y; }\\r\\n\\r\\nfloat rand(vec2 co){\\r\\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\\r\\n}\\r\\nin vec2 fs_UV;\\r\\n\\r\\n//refer to Morgan McGuire's Earth-like Tiny Planet\\r\\nvec3 addStars(vec2 screenSize)\\r\\n{\\r\\n float time = u_TimeInfo.x;\\r\\n\\r\\n // Background starfield\\r\\n float galaxyClump = (pow(noise(fs_UV.xy * (30.0 * screenSize.x)), 3.0) * 0.5 + pow(noise(100.0 + fs_UV.xy * (15.0 * screenSize.x)), 5.0)) / 3.5;\\r\\n \\r\\n vec3 starColor = vec3(galaxyClump * pow(hash(fs_UV.xy), 1500.0) * 80.0);\\r\\n\\r\\n starColor.x *= sqrt(noise(fs_UV.xy) * 1.2);\\r\\n starColor.y *= sqrt(noise(fs_UV.xy * 4.0));\\r\\n\\r\\n vec2 delta = (fs_UV.xy - screenSize.xy * 0.5) * screenSize.y * 1.2; \\r\\n float radialNoise = mix(1.0, noise(normalize(delta) * 20.0 + time * 0.5), 0.12);\\r\\n\\r\\n float att = 0.057 * pow(max(0.0, 1.0 - (length(delta) - 0.9) / 0.9), 8.0);\\r\\n\\r\\n starColor += radialNoise * u_AtmosphereColor.xyz * min(1.0, att);\\r\\n\\r\\n float randSeed = rand(fs_UV);\\r\\n\\r\\n return starColor * (( sin(randSeed + randSeed * time* 0.05) + 1.0)* 0.4 + 0.2);\\r\\n}\\r\\n\\r\\n\\r\\n\\r\\nout vec4 out_Col; // This is the final output color that you will see on your\\r\\n // screen for the pixel that is currently being processed.\\r\\n\\r\\nvec2 getScreenSpaceCoords( vec2 NDC ) \\r\\n{\\r\\n return vec2((NDC.x + 1.0) * 0.5, (1.0 - NDC.y) * 0.5);\\r\\n}\\r\\n\\r\\nvec2 getNDC( vec2 ssc ) \\r\\n{\\r\\n return vec2((ssc.x * 2.0) - 1.0, 1.0 - (ssc.y * 2.0));\\r\\n}\\r\\n\\r\\nvoid main()\\r\\n{\\r\\n out_Col = vec4(0.0, 0.0, 0.0, 1.0);\\r\\n\\r\\n vec4 planetPos_ss = u_ViewProj * vec4(0.0, 0.0, 0.0, 1.0);\\r\\n planetPos_ss /= planetPos_ss.w;\\r\\n\\r\\n float radius = 3.0;\\r\\n\\r\\n vec2 screenSize = u_OceanColor.xy;\\r\\n\\r\\n vec3 upVector = vec3(u_CameraPos.w, u_OceanColor.z, u_OceanColor.w);\\r\\n vec3 pinPoint = upVector * radius;\\r\\n\\r\\n vec4 planetPolarPos_ss = u_ViewProj * vec4(pinPoint, 1.0);\\r\\n planetPolarPos_ss /= planetPolarPos_ss.w;\\r\\n\\r\\n float radius_ss = abs(planetPolarPos_ss.y - planetPos_ss.y);\\r\\n\\r\\n \\r\\n // Background stars\\r\\n out_Col.xyz += addStars(screenSize);\\r\\n \\r\\n vec2 NDC = getNDC(fs_UV);\\r\\n\\r\\n float screenRatio = screenSize.x / screenSize.y;\\r\\n NDC.x *= screenRatio;\\r\\n NDC /= radius_ss;\\r\\n\\r\\n vec2 gap = NDC - planetPos_ss.xy; \\r\\n\\r\\n float dist = length(u_CameraPos.xyz);\\r\\n dist = planetPos_ss.z;\\r\\n\\r\\n planetPos_ss.x *= screenRatio; \\r\\n planetPos_ss /= radius_ss;\\r\\n \\r\\n float halo = clamp(1.0 - sqrt(gap.x*gap.x + gap.y*gap.y), 0.0, 1.0);\\r\\n halo = pow(halo, 0.5); \\r\\n halo = pow(halo, 3.5); \\r\\n\\r\\n out_Col += clamp(vec4(u_AtmosphereColor.xyz * halo * 4.0, 1.0), 0.0, 1.0);\\r\\n}\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/shaders/backGround-frag.glsl\n// module id = 69\n// module chunks = 0"],"sourceRoot":""}