Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

three-render-objects

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

three-render-objects - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

1

dist/three-render-objects.common.js

@@ -48,3 +48,2 @@ 'use strict';

PerspectiveCamera: three.PerspectiveCamera,
AmbientLight: three.AmbientLight,
Raycaster: three.Raycaster,

@@ -51,0 +50,0 @@ Vector2: three.Vector2,

4

dist/three-render-objects.min.js

@@ -1,5 +0,5 @@

// Version 0.1.5 three-render-objects - https://github.com/vasturiano/three-render-objects
// Version 0.1.6 three-render-objects - https://github.com/vasturiano/three-render-objects
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("three")):"function"==typeof define&&define.amd?define(["three"],t):e.ThreeRenderObjects=t(e.THREE)}(this,function(e){"use strict";var t="default"in e?e.default:e;!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n color: lavender;\n font-size: 18px;\n transform: translate(-50%, 25px);\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: Sans-serif;\n}");"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e,t){return e(t={exports:{}},t.exports),t.exports}var o,i=r(function(Y){!function(f){var h=/^\s+/,d=/\s+$/,r=0,a=f.round,p=f.min,g=f.max,e=f.random;function l(e,t){if(t=t||{},(e=e||"")instanceof l)return e;if(!(this instanceof l))return new l(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,i=null,a=!1,s=!1;"string"==typeof e&&(e=function(e){e=e.replace(h,"").replace(d,"").toLowerCase();var t,n=!1;if(k[e])e=k[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=D.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=D.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=D.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=D.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=D.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=D.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=D.hex8.exec(e))return{r:T(t[1]),g:T(t[2]),b:T(t[3]),a:N(t[4]),format:n?"name":"hex8"};if(t=D.hex6.exec(e))return{r:T(t[1]),g:T(t[2]),b:T(t[3]),format:n?"name":"hex"};if(t=D.hex4.exec(e))return{r:T(t[1]+""+t[1]),g:T(t[2]+""+t[2]),b:T(t[3]+""+t[3]),a:N(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=D.hex3.exec(e))return{r:T(t[1]+""+t[1]),g:T(t[2]+""+t[2]),b:T(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==typeof e&&(z(e.r)&&z(e.g)&&z(e.b)?(c=e.r,u=e.g,l=e.b,t={r:255*j(c,255),g:255*j(u,255),b:255*j(l,255)},a=!0,s="%"===String(e.r).substr(-1)?"prgb":"rgb"):z(e.h)&&z(e.s)&&z(e.v)?(r=P(e.s),o=P(e.v),t=function(e,t,n){e=6*j(e,360),t=j(t,100),n=j(n,100);var r=f.floor(e),o=e-r,i=n*(1-t),a=n*(1-o*t),s=n*(1-(1-o)*t),c=r%6;return{r:255*[n,a,i,i,s,n][c],g:255*[s,n,n,a,i,i][c],b:255*[i,i,s,n,n,a][c]}}(e.h,r,o),a=!0,s="hsv"):z(e.h)&&z(e.s)&&z(e.l)&&(r=P(e.s),i=P(e.l),t=function(e,t,n){var r,o,i;function a(e,t,n){return n<0&&(n+=1),1<n&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=j(e,360),t=j(t,100),n=j(n,100),0===t)r=o=i=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=a(c,s,e+1/3),o=a(c,s,e),i=a(c,s,e-1/3)}return{r:255*r,g:255*o,b:255*i}}(e.h,r,i),a=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a));var c,u,l;return n=S(n),{ok:a,format:e.format||s,r:p(255,g(t.r,0)),g:p(255,g(t.g,0)),b:p(255,g(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=a(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=n.ok,this._tc_id=r++}function o(e,t,n){e=j(e,255),t=j(t,255),n=j(n,255);var r,o,i=g(e,t,n),a=p(e,t,n),s=(i+a)/2;if(i==a)r=o=0;else{var c=i-a;switch(o=.5<s?c/(2-i-a):c/(i+a),i){case e:r=(t-n)/c+(t<n?6:0);break;case t:r=(n-e)/c+2;break;case n:r=(e-t)/c+4}r/=6}return{h:r,s:o,l:s}}function i(e,t,n){e=j(e,255),t=j(t,255),n=j(n,255);var r,o,i=g(e,t,n),a=p(e,t,n),s=i,c=i-a;if(o=0===i?0:c/i,i==a)r=0;else{switch(i){case e:r=(t-n)/c+(t<n?6:0);break;case t:r=(n-e)/c+2;break;case n:r=(e-t)/c+4}r/=6}return{h:r,s:o,v:s}}function t(e,t,n,r){var o=[L(a(e).toString(16)),L(a(t).toString(16)),L(a(n).toString(16))];return r&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function s(e,t,n,r){return[L(H(r)),L(a(e).toString(16)),L(a(t).toString(16)),L(a(n).toString(16))].join("")}function n(e,t){t=0===t?0:t||10;var n=l(e).toHsl();return n.s-=t/100,n.s=R(n.s),l(n)}function c(e,t){t=0===t?0:t||10;var n=l(e).toHsl();return n.s+=t/100,n.s=R(n.s),l(n)}function u(e){return l(e).desaturate(100)}function m(e,t){t=0===t?0:t||10;var n=l(e).toHsl();return n.l+=t/100,n.l=R(n.l),l(n)}function b(e,t){t=0===t?0:t||10;var n=l(e).toRgb();return n.r=g(0,p(255,n.r-a(-t/100*255))),n.g=g(0,p(255,n.g-a(-t/100*255))),n.b=g(0,p(255,n.b-a(-t/100*255))),l(n)}function v(e,t){t=0===t?0:t||10;var n=l(e).toHsl();return n.l-=t/100,n.l=R(n.l),l(n)}function y(e,t){var n=l(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,l(n)}function w(e){var t=l(e).toHsl();return t.h=(t.h+180)%360,l(t)}function _(e){var t=l(e).toHsl(),n=t.h;return[l(e),l({h:(n+120)%360,s:t.s,l:t.l}),l({h:(n+240)%360,s:t.s,l:t.l})]}function x(e){var t=l(e).toHsl(),n=t.h;return[l(e),l({h:(n+90)%360,s:t.s,l:t.l}),l({h:(n+180)%360,s:t.s,l:t.l}),l({h:(n+270)%360,s:t.s,l:t.l})]}function E(e){var t=l(e).toHsl(),n=t.h;return[l(e),l({h:(n+72)%360,s:t.s,l:t.l}),l({h:(n+216)%360,s:t.s,l:t.l})]}function A(e,t,n){t=t||6,n=n||30;var r=l(e).toHsl(),o=360/n,i=[l(e)];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(l(r));return i}function O(e,t){t=t||6;for(var n=l(e).toHsv(),r=n.h,o=n.s,i=n.v,a=[],s=1/t;t--;)a.push(l({h:r,s:o,v:i})),i=(i+s)%1;return a}l.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:f.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:f.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:f.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=S(e),this._roundA=a(100*this._a)/100,this},toHsv:function(){var e=i(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=i(this._r,this._g,this._b),t=a(360*e.h),n=a(100*e.s),r=a(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=o(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=o(this._r,this._g,this._b),t=a(360*e.h),n=a(100*e.s),r=a(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return t(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,o){var i=[L(a(e).toString(16)),L(a(t).toString(16)),L(a(n).toString(16)),L(H(r))];if(o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*j(this._r,255))+"%",g:a(100*j(this._g,255))+"%",b:a(100*j(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*j(this._r,255))+"%, "+a(100*j(this._g,255))+"%, "+a(100*j(this._b,255))+"%)":"rgba("+a(100*j(this._r,255))+"%, "+a(100*j(this._g,255))+"%, "+a(100*j(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[t(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+s(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var o=l(e);n="#"+s(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&0<=this._a;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return l(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(b,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(n,arguments)},saturate:function(){return this._applyModification(c,arguments)},greyscale:function(){return this._applyModification(u,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(w,arguments)},monochromatic:function(){return this._applyCombination(O,arguments)},splitcomplement:function(){return this._applyCombination(E,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},l.fromRatio=function(e,t){if("object"==typeof e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:P(e[r]));e=n}return l(e,t)},l.equals=function(e,t){return!(!e||!t)&&l(e).toRgbString()==l(t).toRgbString()},l.random=function(){return l.fromRatio({r:e(),g:e(),b:e()})},l.mix=function(e,t,n){n=0===n?0:n||50;var r=l(e).toRgb(),o=l(t).toRgb(),i=n/100;return l({r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a})},
// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
l.readability=function(e,t){var n=l(e),r=l(t);return(f.max(n.getLuminance(),r.getLuminance())+.05)/(f.min(n.getLuminance(),r.getLuminance())+.05)},l.isReadable=function(e,t,n){var r,o,i=l.readability(e,t);switch(o=!1,(r=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":o=4.5<=i;break;case"AAlarge":o=3<=i;break;case"AAAsmall":o=7<=i}return o},l.mostReadable=function(e,t,n){var r,o,i,a,s=null,c=0;o=(n=n||{}).includeFallbackColors,i=n.level,a=n.size;for(var u=0;u<t.length;u++)c<(r=l.readability(e,t[u]))&&(c=r,s=l(t[u]));return l.isReadable(e,s,{level:i,size:a})||!o?s:(n.includeFallbackColors=!1,l.mostReadable(e,["#fff","#000"],n))};var k=l.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=l.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(k);function S(e){return e=parseFloat(e),(isNaN(e)||e<0||1<e)&&(e=1),e}function j(e,t){var n;"string"==typeof(n=e)&&-1!=n.indexOf(".")&&1===parseFloat(n)&&(e="100%");var r,o="string"==typeof(r=e)&&-1!=r.indexOf("%");return e=p(t,g(0,parseFloat(e))),o&&(e=parseInt(e*t,10)/100),f.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function R(e){return p(1,g(0,e))}function T(e){return parseInt(e,16)}function L(e){return 1==e.length?"0"+e:""+e}function P(e){return e<=1&&(e=100*e+"%"),e}function H(e){return f.round(255*parseFloat(e)).toString(16)}function N(e){return T(e)/255}var M,V,F,D=(V="[\\s|\\(]+("+(M="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",F="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",{CSS_UNIT:new RegExp(M),rgb:new RegExp("rgb"+V),rgba:new RegExp("rgba"+F),hsl:new RegExp("hsl"+V),hsla:new RegExp("hsla"+F),hsv:new RegExp("hsv"+V),hsva:new RegExp("hsva"+F),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function z(e){return!!D.CSS_UNIT.exec(e)}Y.exports?Y.exports=l:window.tinycolor=l}(Math)}),Z=window.THREE||t,a=o=function(e,t){var i=this,a={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new Z.Vector3;var n=new Z.Vector3,s=a.NONE,r=a.NONE,o=new Z.Vector3,c=new Z.Vector2,u=new Z.Vector2,l=new Z.Vector3,f=0,h=new Z.Vector2,d=new Z.Vector2,p=0,g=0,m=new Z.Vector2,b=new Z.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var v={type:"change"},y={type:"start"},w={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var _,x,E,A,O,k,C,S,j,R,T,L,P=(_=new Z.Vector2,function(e,t){return _.set((e-i.screen.left)/i.screen.width,(t-i.screen.top)/i.screen.height),_}),H=(x=new Z.Vector2,function(e,t){return x.set((e-.5*i.screen.width-i.screen.left)/(.5*i.screen.width),(i.screen.height+2*(i.screen.top-t))/i.screen.width),x});function N(e,t){return Array.isArray(e)?-1!==e.indexOf(t):e===t}function M(e){!1!==i.enabled&&(window.removeEventListener("keydown",M),(r=s)===a.NONE&&(N(i.keys[a.ROTATE],e.keyCode)&&!i.noRotate?s=a.ROTATE:N(i.keys[a.ZOOM],e.keyCode)&&!i.noZoom?s=a.ZOOM:N(i.keys[a.PAN],e.keyCode)&&!i.noPan&&(s=a.PAN)))}function V(e){!1!==i.enabled&&(s=r,window.addEventListener("keydown",M,!1))}function F(e){!1!==i.enabled&&(e.preventDefault(),e.stopPropagation(),s===a.NONE&&(s=e.button),s!==a.ROTATE||i.noRotate?s!==a.ZOOM||i.noZoom?s!==a.PAN||i.noPan||(m.copy(P(e.pageX,e.pageY)),b.copy(m)):(h.copy(P(e.pageX,e.pageY)),d.copy(h)):(u.copy(H(e.pageX,e.pageY)),c.copy(u)),document.addEventListener("mousemove",D,!1),document.addEventListener("mouseup",z,!1),i.dispatchEvent(y))}function D(e){!1!==i.enabled&&(e.preventDefault(),e.stopPropagation(),s!==a.ROTATE||i.noRotate?s!==a.ZOOM||i.noZoom?s!==a.PAN||i.noPan||b.copy(P(e.pageX,e.pageY)):d.copy(P(e.pageX,e.pageY)):(c.copy(u),u.copy(H(e.pageX,e.pageY))))}function z(e){!1!==i.enabled&&(e.preventDefault(),e.stopPropagation(),s=a.NONE,document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",z),i.dispatchEvent(w))}function Y(e){if(!1!==i.enabled){switch(e.preventDefault(),e.stopPropagation(),e.deltaMode){case 2:h.y-=.025*e.deltaY;break;case 1:h.y-=.01*e.deltaY;break;default:h.y-=25e-5*e.deltaY}i.dispatchEvent(y),i.dispatchEvent(w)}}function I(e){if(!1!==i.enabled){switch(e.touches.length){case 1:s=a.TOUCH_ROTATE,u.copy(H(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u);break;default:s=a.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY;g=p=Math.sqrt(t*t+n*n);var r=(e.touches[0].pageX+e.touches[1].pageX)/2,o=(e.touches[0].pageY+e.touches[1].pageY)/2;m.copy(P(r,o)),b.copy(m)}i.dispatchEvent(y)}}function X(e){if(!1!==i.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:c.copy(u),u.copy(H(e.touches[0].pageX,e.touches[0].pageY));break;default:var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY;g=Math.sqrt(t*t+n*n);var r=(e.touches[0].pageX+e.touches[1].pageX)/2,o=(e.touches[0].pageY+e.touches[1].pageY)/2;b.copy(P(r,o))}}function U(e){if(!1!==i.enabled){switch(e.touches.length){case 0:s=a.NONE;break;case 1:s=a.TOUCH_ROTATE,u.copy(H(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u)}i.dispatchEvent(w)}}function q(e){!1!==i.enabled&&e.preventDefault()}this.rotateCamera=(A=new Z.Vector3,O=new Z.Quaternion,k=new Z.Vector3,C=new Z.Vector3,S=new Z.Vector3,j=new Z.Vector3,function(){j.set(u.x-c.x,u.y-c.y,0),(E=j.length())?(o.copy(i.object.position).sub(i.target),k.copy(o).normalize(),C.copy(i.object.up).normalize(),S.crossVectors(C,k).normalize(),C.setLength(u.y-c.y),S.setLength(u.x-c.x),j.copy(C.add(S)),A.crossVectors(j,o).normalize(),E*=i.rotateSpeed,O.setFromAxisAngle(A,E),o.applyQuaternion(O),i.object.up.applyQuaternion(O),l.copy(A),f=E):!i.staticMoving&&f&&(f*=Math.sqrt(1-i.dynamicDampingFactor),o.copy(i.object.position).sub(i.target),O.setFromAxisAngle(l,f),o.applyQuaternion(O),i.object.up.applyQuaternion(O)),c.copy(u)}),this.zoomCamera=function(){var e;s===a.TOUCH_ZOOM_PAN?(e=p/g,p=g,o.multiplyScalar(e)):(1!==(e=1+(d.y-h.y)*i.zoomSpeed)&&0<e&&o.multiplyScalar(e),i.staticMoving?h.copy(d):h.y+=(d.y-h.y)*this.dynamicDampingFactor)},this.panCamera=(R=new Z.Vector2,T=new Z.Vector3,L=new Z.Vector3,function(){R.copy(b).sub(m),R.lengthSq()&&(R.multiplyScalar(o.length()*i.panSpeed),L.copy(o).cross(i.object.up).setLength(R.x),L.add(T.copy(i.object.up).setLength(R.y)),i.object.position.add(L),i.target.add(L),i.staticMoving?m.copy(b):m.add(R.subVectors(b,m).multiplyScalar(i.dynamicDampingFactor)))}),this.checkDistances=function(){i.noZoom&&i.noPan||(o.lengthSq()>i.maxDistance*i.maxDistance&&(i.object.position.addVectors(i.target,o.setLength(i.maxDistance)),h.copy(d)),o.lengthSq()<i.minDistance*i.minDistance&&(i.object.position.addVectors(i.target,o.setLength(i.minDistance)),h.copy(d)))},this.update=function(){o.subVectors(i.object.position,i.target),i.noRotate||i.rotateCamera(),i.noZoom||i.zoomCamera(),i.noPan||i.panCamera(),i.object.position.addVectors(i.target,o),i.checkDistances(),i.object.lookAt(i.target),1e-6<n.distanceToSquared(i.object.position)&&(i.dispatchEvent(v),n.copy(i.object.position))},this.reset=function(){s=a.NONE,r=a.NONE,i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.up.copy(i.up0),o.subVectors(i.object.position,i.target),i.object.lookAt(i.target),i.dispatchEvent(v),n.copy(i.object.position)},this.dispose=function(){this.domElement.removeEventListener("contextmenu",q,!1),this.domElement.removeEventListener("mousedown",F,!1),this.domElement.removeEventListener("wheel",Y,!1),this.domElement.removeEventListener("touchstart",I,!1),this.domElement.removeEventListener("touchend",U,!1),this.domElement.removeEventListener("touchmove",X,!1),document.removeEventListener("mousemove",D,!1),document.removeEventListener("mouseup",z,!1),window.removeEventListener("keydown",M,!1),window.removeEventListener("keyup",V,!1)},this.domElement.addEventListener("contextmenu",q,!1),this.domElement.addEventListener("mousedown",F,!1),this.domElement.addEventListener("wheel",Y,!1),this.domElement.addEventListener("touchstart",I,!1),this.domElement.addEventListener("touchend",U,!1),this.domElement.addEventListener("touchmove",X,!1),window.addEventListener("keydown",M,!1),window.addEventListener("keyup",V,!1),this.handleResize(),this.update()};o.prototype=Object.create(Z.EventDispatcher.prototype);var s=r(function(e,t){e.exports=function(n){function r(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}var o={};return r.m=n,r.c=o,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,n){var r,o,i;o=[e,t],void 0!==(i="function"==typeof(r=function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){return t instanceof Function?t:"string"==typeof t?function(e){return e[t]}:function(e){return t}},e.exports=t.default})?r.apply(t,o):r)&&(e.exports=i)}])}),c=n(s),u=(s.accessorFn,r(function(e,t){"undefined"!=typeof self&&self,e.exports=function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,n){var r,o,i,a;a=function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.stateInit,r=void 0===t?function(){return{}}:t,n=e.props,o=void 0===n?{}:n,i=e.methods,s=void 0===i?{}:i,a=e.aliases,c=void 0===a?{}:a,u=e.init,l=void 0===u?function(){}:u,f=e.update,h=void 0===f?function(){}:f,d=Object.keys(o).map(function(e){return new m(e,o[e])});return function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},i=Object.assign({},r instanceof Function?r():r,{initialised:!1});function a(e){return n(e,t),o(),a}var n=function(e,t){l.call(a,e,i,t),i.initialised=!0},o=(0,p.default)(function(){i.initialised&&h.call(a,i)},1);return d.forEach(function(e){a[e.name]=function(t){var n=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:function(e,t){};return function(e){return arguments.length?(i[t]=e,r.call(a,e,i),n&&o(),a):i[t]}}(e.name,e.triggerUpdate,e.onChange)}),Object.keys(s).forEach(function(o){a[o]=function(){for(var e,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=s[o]).call.apply(e,[a,i].concat(n))}}),Object.entries(c).forEach(function(e){var t=g(e,2),n=t[0],r=t[1];return a[n]=a[r]}),a.resetProps=function(){return d.forEach(function(e){a[e.name](e.defaultVal)}),a},a.resetProps(),i._rerender=o,a}};var r,p=(r=n)&&r.__esModule?r:{default:r},g=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},m=function e(t,n){var r=n.default,o=void 0===r?null:r,i=n.triggerUpdate,a=void 0===i||i,s=n.onChange,c=void 0===s?function(e,t){}:s;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t,this.defaultVal=o,this.triggerUpdate=a,this.onChange=c};e.exports=t.default},o=[e,t,n(1)],void 0===(i="function"==typeof(r=a)?r.apply(t,o):r)||(e.exports=i)},function(e,t){e.exports=function(t,n,r){var o,i,a,s,c;function u(){var e=Date.now()-s;e<n&&0<=e?o=setTimeout(u,n-e):(o=null,r||(c=t.apply(a,i),a=i=null))}null==n&&(n=100);var e=function(){a=this,i=arguments,s=Date.now();var e=r&&!o;return o||(o=setTimeout(u,n)),e&&(c=t.apply(a,i),a=i=null),c};return e.clear=function(){o&&(clearTimeout(o),o=null)},e.flush=function(){o&&(c=t.apply(a,i),a=i=null,clearTimeout(o),o=null)},e}}])})),l=n(u),f=(u.Kapsule,window.THREE?window.THREE:{WebGLRenderer:e.WebGLRenderer,Scene:e.Scene,PerspectiveCamera:e.PerspectiveCamera,AmbientLight:e.AmbientLight,Raycaster:e.Raycaster,Vector2:e.Vector2,Color:e.Color});return l({props:{width:{default:window.innerWidth},height:{default:window.innerHeight},backgroundColor:{default:"#000011",onChange:function(e,t){var n=i(e).getAlpha();t.renderer.setClearColor(new f.Color(e),n)},triggerUpdate:!1},showNavInfo:{default:!0},objects:{default:[],onChange:function(e,t){(t.prevObjs||[]).forEach(function(e){return t.scene.remove(e)}),(t.prevObjs=e).forEach(function(e){return t.scene.add(e)})},triggerUpdate:!1},enablePointerInteraction:{default:!0,onChange:function(e,t){t.hoverObj=null},triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{default:function(){return-1},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1}},methods:{tick:function(e){if(e.initialised&&(e.tbControls.update(),e.renderer.render(e.scene,e.camera),e.enablePointerInteraction)){var t=new f.Raycaster;t.linePrecision=e.lineHoverPrecision,t.setFromCamera(e.mousePos,e.camera);var n=t.intersectObjects(e.objects,!0).map(function(e){return e.object}).sort(e.hoverOrderComparator),r=n.length?n[0]:null;r!==e.hoverObj&&(e.onHover(r,e.hoverObj),e.toolTipElem.innerHTML=r&&c(e.tooltipContent)(r)||"",e.hoverObj=r)}return this},renderer:function(e){return e.renderer},scene:function(e){return e.scene},camera:function(e){return e.camera},tbControls:function(e){return e.tbControls}},stateInit:{renderer:new f.WebGLRenderer({alpha:!0}),scene:new f.Scene,camera:new f.PerspectiveCamera},init:function(e,c){e.innerHTML="",e.appendChild(c.container=document.createElement("div")),c.container.style.position="relative",c.container.appendChild(c.navInfo=document.createElement("div")),c.navInfo.className="scene-nav-info",c.navInfo.textContent="MOVE mouse & press LEFT/A: rotate, MIDDLE/S: zoom, RIGHT/D: pan",c.toolTipElem=document.createElement("div"),c.toolTipElem.classList.add("scene-tooltip"),c.container.appendChild(c.toolTipElem),c.mousePos=new f.Vector2,c.mousePos.x=-2,c.mousePos.y=-2,c.container.addEventListener("mousemove",function(e){if(c.enablePointerInteraction){var t=(o=c.container,i=o.getBoundingClientRect(),a=window.pageXOffset||document.documentElement.scrollLeft,s=window.pageYOffset||document.documentElement.scrollTop,{top:i.top+s,left:i.left+a}),n=e.pageX-t.left,r=e.pageY-t.top;c.mousePos.x=n/c.width*2-1,c.mousePos.y=-r/c.height*2+1,c.toolTipElem.style.top=r+"px",c.toolTipElem.style.left=n+"px"}var o,i,a,s},!1),c.container.addEventListener("click",function(e){c.hoverObj&&c.onClick(c.hoverObj)},!1),c.container.appendChild(c.renderer.domElement),c.tbControls=new a(c.camera,c.renderer.domElement),c.tbControls.minDistance=.1,c.tbControls.maxDistance=5e4,c.renderer.setSize(c.width,c.height),c.camera.position.z=1e3,c.camera.far=5e4,window.scene=c.scene},update:function(e){e.width&&e.height&&(e.container.style.width=e.width,e.container.style.height=e.height,e.renderer.setSize(e.width,e.height),e.camera.aspect=e.width/e.height,e.camera.updateProjectionMatrix()),e.navInfo.style.display=e.showNavInfo?null:"none"}})});
l.readability=function(e,t){var n=l(e),r=l(t);return(f.max(n.getLuminance(),r.getLuminance())+.05)/(f.min(n.getLuminance(),r.getLuminance())+.05)},l.isReadable=function(e,t,n){var r,o,i=l.readability(e,t);switch(o=!1,(r=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":o=4.5<=i;break;case"AAlarge":o=3<=i;break;case"AAAsmall":o=7<=i}return o},l.mostReadable=function(e,t,n){var r,o,i,a,s=null,c=0;o=(n=n||{}).includeFallbackColors,i=n.level,a=n.size;for(var u=0;u<t.length;u++)c<(r=l.readability(e,t[u]))&&(c=r,s=l(t[u]));return l.isReadable(e,s,{level:i,size:a})||!o?s:(n.includeFallbackColors=!1,l.mostReadable(e,["#fff","#000"],n))};var k=l.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=l.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(k);function S(e){return e=parseFloat(e),(isNaN(e)||e<0||1<e)&&(e=1),e}function j(e,t){var n;"string"==typeof(n=e)&&-1!=n.indexOf(".")&&1===parseFloat(n)&&(e="100%");var r,o="string"==typeof(r=e)&&-1!=r.indexOf("%");return e=p(t,g(0,parseFloat(e))),o&&(e=parseInt(e*t,10)/100),f.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function R(e){return p(1,g(0,e))}function T(e){return parseInt(e,16)}function L(e){return 1==e.length?"0"+e:""+e}function P(e){return e<=1&&(e=100*e+"%"),e}function H(e){return f.round(255*parseFloat(e)).toString(16)}function N(e){return T(e)/255}var M,V,F,D=(V="[\\s|\\(]+("+(M="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",F="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",{CSS_UNIT:new RegExp(M),rgb:new RegExp("rgb"+V),rgba:new RegExp("rgba"+F),hsl:new RegExp("hsl"+V),hsla:new RegExp("hsla"+F),hsv:new RegExp("hsv"+V),hsva:new RegExp("hsva"+F),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function z(e){return!!D.CSS_UNIT.exec(e)}Y.exports?Y.exports=l:window.tinycolor=l}(Math)}),Z=window.THREE||t,a=o=function(e,t){var i=this,a={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new Z.Vector3;var n=new Z.Vector3,s=a.NONE,r=a.NONE,o=new Z.Vector3,c=new Z.Vector2,u=new Z.Vector2,l=new Z.Vector3,f=0,h=new Z.Vector2,d=new Z.Vector2,p=0,g=0,m=new Z.Vector2,b=new Z.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var v={type:"change"},y={type:"start"},w={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var _,x,E,A,O,k,C,S,j,R,T,L,P=(_=new Z.Vector2,function(e,t){return _.set((e-i.screen.left)/i.screen.width,(t-i.screen.top)/i.screen.height),_}),H=(x=new Z.Vector2,function(e,t){return x.set((e-.5*i.screen.width-i.screen.left)/(.5*i.screen.width),(i.screen.height+2*(i.screen.top-t))/i.screen.width),x});function N(e,t){return Array.isArray(e)?-1!==e.indexOf(t):e===t}function M(e){!1!==i.enabled&&(window.removeEventListener("keydown",M),(r=s)===a.NONE&&(N(i.keys[a.ROTATE],e.keyCode)&&!i.noRotate?s=a.ROTATE:N(i.keys[a.ZOOM],e.keyCode)&&!i.noZoom?s=a.ZOOM:N(i.keys[a.PAN],e.keyCode)&&!i.noPan&&(s=a.PAN)))}function V(e){!1!==i.enabled&&(s=r,window.addEventListener("keydown",M,!1))}function F(e){!1!==i.enabled&&(e.preventDefault(),e.stopPropagation(),s===a.NONE&&(s=e.button),s!==a.ROTATE||i.noRotate?s!==a.ZOOM||i.noZoom?s!==a.PAN||i.noPan||(m.copy(P(e.pageX,e.pageY)),b.copy(m)):(h.copy(P(e.pageX,e.pageY)),d.copy(h)):(u.copy(H(e.pageX,e.pageY)),c.copy(u)),document.addEventListener("mousemove",D,!1),document.addEventListener("mouseup",z,!1),i.dispatchEvent(y))}function D(e){!1!==i.enabled&&(e.preventDefault(),e.stopPropagation(),s!==a.ROTATE||i.noRotate?s!==a.ZOOM||i.noZoom?s!==a.PAN||i.noPan||b.copy(P(e.pageX,e.pageY)):d.copy(P(e.pageX,e.pageY)):(c.copy(u),u.copy(H(e.pageX,e.pageY))))}function z(e){!1!==i.enabled&&(e.preventDefault(),e.stopPropagation(),s=a.NONE,document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",z),i.dispatchEvent(w))}function Y(e){if(!1!==i.enabled){switch(e.preventDefault(),e.stopPropagation(),e.deltaMode){case 2:h.y-=.025*e.deltaY;break;case 1:h.y-=.01*e.deltaY;break;default:h.y-=25e-5*e.deltaY}i.dispatchEvent(y),i.dispatchEvent(w)}}function I(e){if(!1!==i.enabled){switch(e.touches.length){case 1:s=a.TOUCH_ROTATE,u.copy(H(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u);break;default:s=a.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY;g=p=Math.sqrt(t*t+n*n);var r=(e.touches[0].pageX+e.touches[1].pageX)/2,o=(e.touches[0].pageY+e.touches[1].pageY)/2;m.copy(P(r,o)),b.copy(m)}i.dispatchEvent(y)}}function X(e){if(!1!==i.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:c.copy(u),u.copy(H(e.touches[0].pageX,e.touches[0].pageY));break;default:var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY;g=Math.sqrt(t*t+n*n);var r=(e.touches[0].pageX+e.touches[1].pageX)/2,o=(e.touches[0].pageY+e.touches[1].pageY)/2;b.copy(P(r,o))}}function U(e){if(!1!==i.enabled){switch(e.touches.length){case 0:s=a.NONE;break;case 1:s=a.TOUCH_ROTATE,u.copy(H(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u)}i.dispatchEvent(w)}}function q(e){!1!==i.enabled&&e.preventDefault()}this.rotateCamera=(A=new Z.Vector3,O=new Z.Quaternion,k=new Z.Vector3,C=new Z.Vector3,S=new Z.Vector3,j=new Z.Vector3,function(){j.set(u.x-c.x,u.y-c.y,0),(E=j.length())?(o.copy(i.object.position).sub(i.target),k.copy(o).normalize(),C.copy(i.object.up).normalize(),S.crossVectors(C,k).normalize(),C.setLength(u.y-c.y),S.setLength(u.x-c.x),j.copy(C.add(S)),A.crossVectors(j,o).normalize(),E*=i.rotateSpeed,O.setFromAxisAngle(A,E),o.applyQuaternion(O),i.object.up.applyQuaternion(O),l.copy(A),f=E):!i.staticMoving&&f&&(f*=Math.sqrt(1-i.dynamicDampingFactor),o.copy(i.object.position).sub(i.target),O.setFromAxisAngle(l,f),o.applyQuaternion(O),i.object.up.applyQuaternion(O)),c.copy(u)}),this.zoomCamera=function(){var e;s===a.TOUCH_ZOOM_PAN?(e=p/g,p=g,o.multiplyScalar(e)):(1!==(e=1+(d.y-h.y)*i.zoomSpeed)&&0<e&&o.multiplyScalar(e),i.staticMoving?h.copy(d):h.y+=(d.y-h.y)*this.dynamicDampingFactor)},this.panCamera=(R=new Z.Vector2,T=new Z.Vector3,L=new Z.Vector3,function(){R.copy(b).sub(m),R.lengthSq()&&(R.multiplyScalar(o.length()*i.panSpeed),L.copy(o).cross(i.object.up).setLength(R.x),L.add(T.copy(i.object.up).setLength(R.y)),i.object.position.add(L),i.target.add(L),i.staticMoving?m.copy(b):m.add(R.subVectors(b,m).multiplyScalar(i.dynamicDampingFactor)))}),this.checkDistances=function(){i.noZoom&&i.noPan||(o.lengthSq()>i.maxDistance*i.maxDistance&&(i.object.position.addVectors(i.target,o.setLength(i.maxDistance)),h.copy(d)),o.lengthSq()<i.minDistance*i.minDistance&&(i.object.position.addVectors(i.target,o.setLength(i.minDistance)),h.copy(d)))},this.update=function(){o.subVectors(i.object.position,i.target),i.noRotate||i.rotateCamera(),i.noZoom||i.zoomCamera(),i.noPan||i.panCamera(),i.object.position.addVectors(i.target,o),i.checkDistances(),i.object.lookAt(i.target),1e-6<n.distanceToSquared(i.object.position)&&(i.dispatchEvent(v),n.copy(i.object.position))},this.reset=function(){s=a.NONE,r=a.NONE,i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.up.copy(i.up0),o.subVectors(i.object.position,i.target),i.object.lookAt(i.target),i.dispatchEvent(v),n.copy(i.object.position)},this.dispose=function(){this.domElement.removeEventListener("contextmenu",q,!1),this.domElement.removeEventListener("mousedown",F,!1),this.domElement.removeEventListener("wheel",Y,!1),this.domElement.removeEventListener("touchstart",I,!1),this.domElement.removeEventListener("touchend",U,!1),this.domElement.removeEventListener("touchmove",X,!1),document.removeEventListener("mousemove",D,!1),document.removeEventListener("mouseup",z,!1),window.removeEventListener("keydown",M,!1),window.removeEventListener("keyup",V,!1)},this.domElement.addEventListener("contextmenu",q,!1),this.domElement.addEventListener("mousedown",F,!1),this.domElement.addEventListener("wheel",Y,!1),this.domElement.addEventListener("touchstart",I,!1),this.domElement.addEventListener("touchend",U,!1),this.domElement.addEventListener("touchmove",X,!1),window.addEventListener("keydown",M,!1),window.addEventListener("keyup",V,!1),this.handleResize(),this.update()};o.prototype=Object.create(Z.EventDispatcher.prototype);var s=r(function(e,t){e.exports=function(n){function r(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}var o={};return r.m=n,r.c=o,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,n){var r,o,i;o=[e,t],void 0!==(i="function"==typeof(r=function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){return t instanceof Function?t:"string"==typeof t?function(e){return e[t]}:function(e){return t}},e.exports=t.default})?r.apply(t,o):r)&&(e.exports=i)}])}),c=n(s),u=(s.accessorFn,r(function(e,t){"undefined"!=typeof self&&self,e.exports=function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,n){var r,o,i,a;a=function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.stateInit,r=void 0===t?function(){return{}}:t,n=e.props,o=void 0===n?{}:n,i=e.methods,s=void 0===i?{}:i,a=e.aliases,c=void 0===a?{}:a,u=e.init,l=void 0===u?function(){}:u,f=e.update,h=void 0===f?function(){}:f,d=Object.keys(o).map(function(e){return new m(e,o[e])});return function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},i=Object.assign({},r instanceof Function?r():r,{initialised:!1});function a(e){return n(e,t),o(),a}var n=function(e,t){l.call(a,e,i,t),i.initialised=!0},o=(0,p.default)(function(){i.initialised&&h.call(a,i)},1);return d.forEach(function(e){a[e.name]=function(t){var n=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:function(e,t){};return function(e){return arguments.length?(i[t]=e,r.call(a,e,i),n&&o(),a):i[t]}}(e.name,e.triggerUpdate,e.onChange)}),Object.keys(s).forEach(function(o){a[o]=function(){for(var e,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=s[o]).call.apply(e,[a,i].concat(n))}}),Object.entries(c).forEach(function(e){var t=g(e,2),n=t[0],r=t[1];return a[n]=a[r]}),a.resetProps=function(){return d.forEach(function(e){a[e.name](e.defaultVal)}),a},a.resetProps(),i._rerender=o,a}};var r,p=(r=n)&&r.__esModule?r:{default:r},g=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},m=function e(t,n){var r=n.default,o=void 0===r?null:r,i=n.triggerUpdate,a=void 0===i||i,s=n.onChange,c=void 0===s?function(e,t){}:s;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t,this.defaultVal=o,this.triggerUpdate=a,this.onChange=c};e.exports=t.default},o=[e,t,n(1)],void 0===(i="function"==typeof(r=a)?r.apply(t,o):r)||(e.exports=i)},function(e,t){e.exports=function(t,n,r){var o,i,a,s,c;function u(){var e=Date.now()-s;e<n&&0<=e?o=setTimeout(u,n-e):(o=null,r||(c=t.apply(a,i),a=i=null))}null==n&&(n=100);var e=function(){a=this,i=arguments,s=Date.now();var e=r&&!o;return o||(o=setTimeout(u,n)),e&&(c=t.apply(a,i),a=i=null),c};return e.clear=function(){o&&(clearTimeout(o),o=null)},e.flush=function(){o&&(c=t.apply(a,i),a=i=null,clearTimeout(o),o=null)},e}}])})),l=n(u),f=(u.Kapsule,window.THREE?window.THREE:{WebGLRenderer:e.WebGLRenderer,Scene:e.Scene,PerspectiveCamera:e.PerspectiveCamera,Raycaster:e.Raycaster,Vector2:e.Vector2,Color:e.Color});return l({props:{width:{default:window.innerWidth},height:{default:window.innerHeight},backgroundColor:{default:"#000011",onChange:function(e,t){var n=i(e).getAlpha();t.renderer.setClearColor(new f.Color(e),n)},triggerUpdate:!1},showNavInfo:{default:!0},objects:{default:[],onChange:function(e,t){(t.prevObjs||[]).forEach(function(e){return t.scene.remove(e)}),(t.prevObjs=e).forEach(function(e){return t.scene.add(e)})},triggerUpdate:!1},enablePointerInteraction:{default:!0,onChange:function(e,t){t.hoverObj=null},triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{default:function(){return-1},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1}},methods:{tick:function(e){if(e.initialised&&(e.tbControls.update(),e.renderer.render(e.scene,e.camera),e.enablePointerInteraction)){var t=new f.Raycaster;t.linePrecision=e.lineHoverPrecision,t.setFromCamera(e.mousePos,e.camera);var n=t.intersectObjects(e.objects,!0).map(function(e){return e.object}).sort(e.hoverOrderComparator),r=n.length?n[0]:null;r!==e.hoverObj&&(e.onHover(r,e.hoverObj),e.toolTipElem.innerHTML=r&&c(e.tooltipContent)(r)||"",e.hoverObj=r)}return this},renderer:function(e){return e.renderer},scene:function(e){return e.scene},camera:function(e){return e.camera},tbControls:function(e){return e.tbControls}},stateInit:{renderer:new f.WebGLRenderer({alpha:!0}),scene:new f.Scene,camera:new f.PerspectiveCamera},init:function(e,c){e.innerHTML="",e.appendChild(c.container=document.createElement("div")),c.container.style.position="relative",c.container.appendChild(c.navInfo=document.createElement("div")),c.navInfo.className="scene-nav-info",c.navInfo.textContent="MOVE mouse & press LEFT/A: rotate, MIDDLE/S: zoom, RIGHT/D: pan",c.toolTipElem=document.createElement("div"),c.toolTipElem.classList.add("scene-tooltip"),c.container.appendChild(c.toolTipElem),c.mousePos=new f.Vector2,c.mousePos.x=-2,c.mousePos.y=-2,c.container.addEventListener("mousemove",function(e){if(c.enablePointerInteraction){var t=(o=c.container,i=o.getBoundingClientRect(),a=window.pageXOffset||document.documentElement.scrollLeft,s=window.pageYOffset||document.documentElement.scrollTop,{top:i.top+s,left:i.left+a}),n=e.pageX-t.left,r=e.pageY-t.top;c.mousePos.x=n/c.width*2-1,c.mousePos.y=-r/c.height*2+1,c.toolTipElem.style.top=r+"px",c.toolTipElem.style.left=n+"px"}var o,i,a,s},!1),c.container.addEventListener("click",function(e){c.hoverObj&&c.onClick(c.hoverObj)},!1),c.container.appendChild(c.renderer.domElement),c.tbControls=new a(c.camera,c.renderer.domElement),c.tbControls.minDistance=.1,c.tbControls.maxDistance=5e4,c.renderer.setSize(c.width,c.height),c.camera.position.z=1e3,c.camera.far=5e4,window.scene=c.scene},update:function(e){e.width&&e.height&&(e.container.style.width=e.width,e.container.style.height=e.height,e.renderer.setSize(e.width,e.height),e.camera.aspect=e.width/e.height,e.camera.updateProjectionMatrix()),e.navInfo.style.display=e.showNavInfo?null:"none"}})});

@@ -1,2 +0,2 @@

import { WebGLRenderer, Scene, PerspectiveCamera, AmbientLight, Raycaster, Vector2, Color } from 'three';
import { WebGLRenderer, Scene, PerspectiveCamera, Raycaster, Vector2, Color } from 'three';
import tinycolor from 'tinycolor2';

@@ -44,3 +44,2 @@ import ThreeTrackballControls from 'three-trackballcontrols';

PerspectiveCamera: PerspectiveCamera,
AmbientLight: AmbientLight,
Raycaster: Raycaster,

@@ -47,0 +46,0 @@ Vector2: Vector2,

{
"name": "three-render-objects",
"version": "0.1.5",
"version": "0.1.6",
"description": "Easy way to render ThreeJS objects with built-in interaction defaults",

@@ -5,0 +5,0 @@ "unpkg": "dist/three-render-objects.min.js",

@@ -5,3 +5,2 @@ import {

PerspectiveCamera,
AmbientLight,
Raycaster,

@@ -18,3 +17,2 @@ Vector2,

PerspectiveCamera,
AmbientLight,
Raycaster,

@@ -21,0 +19,0 @@ Vector2,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc