C端蜂鸟地图
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 line
912 KiB

  1. !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.fengmap=n():t.fengmap=n()}(this,function(){return d=[function(t,n,e){"use strict";var i,r,o=t.exports=e(1),s=e(16);o.codegen=e(40),o.fetch=e(41),o.path=e(42),o.fs=o.inquire("fs"),o.toArray=function(t){if(t){for(var n=Object.keys(t),e=new Array(n.length),i=0;i<n.length;)e[i]=t[n[i++]];return e}return[]},o.toObject=function(t){for(var n={},e=0;e<t.length;){var i=t[e++],r=t[e++];void 0!==r&&(n[i]=r)}return n};var a=/\\/g,u=/"/g;o.isReserved=function(t){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(t)},o.safeProp=function(t){return!/^[$\w_]+$/.test(t)||o.isReserved(t)?'["'+t.replace(a,"\\\\").replace(u,'\\"')+'"]':"."+t},o.ucFirst=function(t){return t.charAt(0).toUpperCase()+t.substring(1)};var h=/_([a-z])/g;o.camelCase=function(t){return t.substring(0,1)+t.substring(1).replace(h,function(t,n){return n.toUpperCase()})},o.compareFieldsById=function(t,n){return t.id-n.id},o.decorateType=function(t,n){if(t.$type)return n&&t.$type.name!==n&&(o.decorateRoot.remove(t.$type),t.$type.name=n,o.decorateRoot.add(t.$type)),t.$type;n=new(i=i||e(18))(n||t.name);return o.decorateRoot.add(n),n.ctor=t,Object.defineProperty(t,"$type",{value:n,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:n,enumerable:!1}),n};var c=0;o.decorateEnum=function(t){if(t.$type)return t.$type;var n=new(r=r||e(2))("Enum"+c++,t);return o.decorateRoot.add(n),Object.defineProperty(t,"$type",{value:n,enumerable:!1}),n},o.setProperty=function(t,n,e){if("object"!=typeof t)throw TypeError("dst must be an object");if(!n)throw TypeError("path must be specified");return function t(n,e,i){var r=e.shift();return 0<e.length?n[r]=t(n[r]||{},e,i):((e=n[r])&&(i=[].concat(e).concat(i)),n[r]=i),n}(t,n=n.split("."),e)},Object.defineProperty(o,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(e(26)))}})},function(t,e,o){"use strict";!function(t){var i=e;function r(t,n,e){for(var i=Object.keys(n),r=0;r<i.length;++r)void 0!==t[i[r]]&&e||(t[i[r]]=n[i[r]]);return t}function n(t){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&r(this,n)}return(e.prototype=Object.create(Error.prototype)).constructor=e,Object.defineProperty(e.prototype,"name",{get:function(){return t}}),e.prototype.toString=function(){return this.name+": "+this.message},e}i.asPromise=o(13),i.base64=o(31),i.EventEmitter=o(32),i.float=o(33),i.inquire=o(14),i.utf8=o(34),i.pool=o(35),i.LongBits=o(36),i.isNode=Boolean(void 0!==t&&t&&t.process&&t.process.versions&&t.process.versions.node),i.global=i.isNode&&t||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},i.isString=function(t){return"string"==typeof t||t instanceof String},i.isObject=function(t){return t&&"object"==typeof t},i.isset=i.isSet=function(t,n){var e=t[n];return!(null==e||!t.hasOwnProperty(n))&&("object"!=typeof e||0<(Array.isArray(e)?e:Object.keys(e)).length)},i.Buffer=function(){try{var t=i.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),i.u=null,i._=null,i.newBuffer=function(t){return"number"==typeof t?i.Buffer?i._(t):new i.Array(t):i.Buffer?i.u(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(t){return t?i.LongBits.from(t).toHash():i.LongBits.zeroHash},i.longFromHash=function(t,n){t=i.LongBits.fromHash(t);return i.Long?i.Long.fromBits(t.lo,t.hi,n):t.toNumber(Boolean(n))},i.merge=r,i.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},i.newError=n,i.ProtocolError=n("ProtocolError"),i.oneOfGetter=function(t){for(var e={},n=0;n<t.length;++n)e[t[n]]=1;return function(){for(var t=Object.keys(this),n=t.length-1;-1<n;--n)if(1===e[t[n]]&&void 0!==this[t[n]]&&null!==this[t[n]])return t[n]}},i.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i.M=function(){var e=i.Buffer;e?(i.u=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},i._=e.allocUnsafe||function(t){return new e(t)}):i.u=i._=null}}.call(this,o(12))},function(t,n,e){"use strict";t.exports=o;var a=e(3);((o.prototype=Object.create(a.prototype)).constructor=o).className="Enum";var i=e(5),r=e(0);function o(t,n,e,i,r){if(a.call(this,t,e),n&&"object"!=typeof n)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=r||{},this.reserved=void 0,n)for(var o=Object.keys(n),s=0;s<o.length;++s)"number"==typeof n[o[s]]&&(this.valuesById[this.values[o[s]]=n[o[s]]]=o[s])}o.fromJSON=function(t,n){t=new o(t,n.values,n.options,n.comment,n.comments);return t.reserved=n.reserved,t},o.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return r.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},o.prototype.add=function(t,n,e){if(!r.isString(t))throw TypeError("name must be a string");if(!r.isInteger(n))throw TypeError("id must be an integer");if(void 0!==this.values[t])throw Error("duplicate name '"+t+"' in "+this);if(this.isReservedId(n))throw Error("id "+n+" is reserved in "+this);if(this.isReservedName(t))throw Error("name '"+t+"' is reserved in "+this);if(void 0!==this.valuesById[n]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+n+" in "+this);this.values[t]=n}else this.valuesById[this.values[t]=n]=t;return this.comments[t]=e||null,this},o.prototype.remove=function(t){if(!r.isString(t))throw TypeError("name must be a string");var n=this.values[t];if(null==n)throw Error("name '"+t+"' does not exist in "+this);return delete this.valuesById[n],delete this.values[t],delete this.comments[t],this},o.prototype.isReservedId=function(t){return i.isReservedId(this.reserved,t)},o.prototype.isReservedName=function(t){return i.isReservedName(this.reserved,t)}},function(t,n,e){"use strict";(t.exports=r).className="ReflectionObject";var i,s=e(0);function r(t,n){if(!s.isString(t))throw TypeError("name must be a string");if(n&&!s.isObject(n))throw TypeError("options must be an object");this.options=n,this.parsedOptions=null,this.name=t,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(r.prototype,{root:{get:function(){for(var t=this;null!==t.parent;)t=t.parent;return t}},fullName:{get:function(){for(var t=[this.name],n=this.parent;n;)t.unshift(n.name),n=n.parent;return t.join(".")}}}),r.prototype.toJSON=function(){throw Error()},r.prototype.onAdd=function(t){this.parent&&this.parent!==t&&this.parent.remove(this),this.parent=t,this.resolved=!1;t=t.root;t instanceof i&&t.S(this)},r.prototype.onRemove=function(t){t=t.root;t instanceof i&&t.T(this),this.parent=null,this.resolved=!1},r.prototype.resolve=function(){return this.resolved||this.root instanceof i&&(this.resolved=!0),this},r.prototype.getOption=function(t){if(this.options)return this.options[t]},r.prototype.setOption=function(t,n,e){return e&&this.options&&void 0!==this.options[t]||((this.options||(this.options={}))[t]=n),this},r.prototype.setParsedOption=function(n,t,e){this.parsedOptions||(this.parsedOptions=[]);var i,r,o=this.parsedOptions;return e?(r=o.find(function(t){return Object.prototype.hasOwnProperty.call(t,n)}))?(i=r[n],s.setProperty(i,e,t)):((r={})[n]=s.setProperty({},e,t),o.push(r)):((r={})[n]=t,o.push(r)),this},r.prototype.setOptions=function(t,n){if(t)for(var e=Object.keys(t),i=0;i<e.length;++i)this.setOption(e[i],t[e[i]],n);return this},r.prototype.toString=function(){var t=this.constructor.className,n=this.fullName;return n.length?t+" "+n:t},r.M=function(t){i=t}},function(t,n,e){"use strict";t.exports=s;var a=e(3);((s.prototype=Object.create(a.prototype)).constructor=s).className="Field";var i,r=e(2),u=e(6),h=e(0),c=/^required|optional|repeated$/;function s(t,n,e,i,r,o,s){if(h.isObject(i)?(s=r,o=i,i=r=void 0):h.isObject(r)&&(s=o,o=r,r=void 0),a.call(this,t,o),!h.isInteger(n)||n<0)throw TypeError("id must be a non-negative integer");if(!h.isString(e))throw TypeError("type must be a string");if(void 0!==i&&!c.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==r&&!h.isString(r))throw TypeError("extend must be a string");this.rule=i&&"optional"!==i?i:void 0,this.type=e,this.id=n,this.extend=r||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!h.Long&&void 0!==u.long[e],this.bytes="bytes"===e,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.L=null,this.comment=s}s.fromJSON=function(t,n){return new s(t,n.id,n.type,n.rule,n.extend,n.options,n.comment)},Object.defineProperty(s.prototype,"packed",{get:function(){return null===this.L&&(this.L=!1!==this.getOption("packed")),this.L}}),s.prototype.setOption=function(t,n,e){return"packed"===t&&(this.L=null),a.prototype.setOption.call(this,t,n,e)},s.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return h.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){return this.resolved?this:(void 0===(this.typeDefault=u.defaults[this.type])&&(this.resolvedType=(this.declaringField||this).parent.lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof r&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof r)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long?(this.typeDefault=h.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault)):this.bytes&&"string"==typeof this.typeDefault&&(h.base64.test(this.typeDefault)?h.base64.decode(this.typeDefault,t=h.newBuffer(h.base64.length(this.typeDefault)),0):h.utf8.write(this.typeDefault,t=h.newBuffer(h.utf8.length(this.typeDefault)),0),this.typeDefault=t),this.map?this.defaultValue=h.emptyObject:this.repeated?this.defaultValue=h.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),a.prototype.resolve.call(this));var t},s.d=function(e,i,r,o){return"function"==typeof i?i=h.decorateType(i).name:i&&"object"==typeof i&&(i=h.decorateEnum(i).name),function(t,n){h.decorateType(t.constructor).add(new s(n,e,i,r,{default:o}))}},s.M=function(t){i=t}},function(t,n,e){"use strict";t.exports=c;var i=e(3);((c.prototype=Object.create(i.prototype)).constructor=c).className="Namespace";var r,o,s,a=e(4),u=e(0);function h(t,n){if(t&&t.length){for(var e={},i=0;i<t.length;++i)e[t[i].name]=t[i].toJSON(n);return e}}function c(t,n){i.call(this,t,n),this.nested=void 0,this.O=null}function f(t){return t.O=null,t}c.fromJSON=function(t,n){return new c(t,n.options).addJSON(n.nested)},c.arrayToJSON=h,c.isReservedId=function(t,n){if(t)for(var e=0;e<t.length;++e)if("string"!=typeof t[e]&&t[e][0]<=n&&t[e][1]>n)return!0;return!1},c.isReservedName=function(t,n){if(t)for(var e=0;e<t.length;++e)if(t[e]===n)return!0;return!1},Object.defineProperty(c.prototype,"nestedArray",{get:function(){return this.O||(this.O=u.toArray(this.nested))}}),c.prototype.toJSON=function(t){return u.toObject(["options",this.options,"nested",h(this.nestedArray,t)])},c.prototype.addJSON=function(t){if(t)for(var n,e=Object.keys(t),i=0;i<e.length;++i)n=t[e[i]],this.add((void 0!==n.fields?r:void 0!==n.values?s:void 0!==n.methods?o:void 0!==n.id?a:c).fromJSON(e[i],n));return this},c.prototype.get=function(t){return this.nested&&this.nested[t]||null},c.prototype.getEnum=function(t){if(this.nested&&this.nested[t]instanceof s)return this.nested[t].values;throw Error("no such enum: "+t)},c.prototype.add=function(t){if(!(t instanceof a&&void 0!==t.extend||t instanceof r||t instanceof s||t instanceof o||t instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var n=this.get(t.name);if(n){if(!(n instanceof c&&t instanceof c)||n instanceof r||n instanceof o)throw Error("duplicate name '"+t.name+"' in "+this);for(var e=n.nestedArray,i=0;i<e.length;++i)t.add(e[i]);this.remove(n),this.nested||(this.nested={}),t.setOptions(n.options,!0)}}else this.nested={};return(this.nested[t.name]=t).onAdd(this),f(this)},c.prototype.remove=function(t){if(!(t instanceof i))throw TypeError("object must be a ReflectionObject");if(t.parent!==this)throw Error(t+" is not a member of "+this);return delete this.nested[t.name],Object.keys(this.nested).length||(this.nested=void 0),t.onRemove(this),f(this)},c.prototype.define=function(t,n){if(u.isString(t))t=t.split(".");else if(!Array.isArray(t))throw TypeError("illegal path");if(t&&t.length&&""===t[0])throw Error("path must be relative");for(var e=this;0<t.length;){var i=t.shift();if(e.nested&&e.nested[i]){if(!((e=e.nested[i])instanceof c))throw Error("path conflicts with non-namespace objects")}else e.add(e=new c(i))}return n&&e.addJSON(n),e},c.prototype.resolveAll=function(){for(var t=this.nestedArray,n=0;n<t.length;)t[n]instanceof c?t[n++].resolveAll():t[n++].resolve();return this.resolve()},c.prototype.lookup=function(t,n,e){if("boolean"==typeof n?(e=n,n=void 0):n&&!Array.isArray(n)&&(n=[n]),u.isString(t)&&t.length){if("."===t)return this.root;t=t.split(".")}else if(!t.length)return this;if(""===t[0])return this.root.lookup(t.slice(1),n);var i=this.get(t[0]);if(i){if(1===t.length){if(!n||-1<n.indexOf(i.constructor))return i}else if(i instanceof c&&(i=i.lookup(t.slice(1),n,!0)))return i}else for(var r=0;r<this.nestedArray.length;++r)if(this.O[r]instanceof c&&(i=this.O[r].lookup(t,n,!0)))return i;return null===this.parent||e?null:this.parent.lookup(t,n)},c.prototype.lookupType=function(t){var n=this.lookup(t,[r]);if(!n)throw Error("no such type: "+t);return n},c.prototype.lookupEnum=function(t){var n=this.lookup(t,[s]);if(!n)throw Error("no such Enum '"+t+"' in "+this);return n},c.prototype.lookupTypeOrEnum=function(t){var n=this.lookup(t,[r,s]);if(!n)throw Error("no such Type or Enum '"+t+"' in "+this);return n},c.prototype.lookupService=function(t){var n=this.lookup(t,[o]);if(!n)throw Error("no such Service '"+t+"' in "+this);return n},c.M=function(t,n,e){r=t,o=n,s=e}},function(t,n,e){"use strict";var n=n,e=e(0),r=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function i(t,n){var e=0,i={};for(n|=0;e<t.length;)i[r[e+n]]=t[e++];return i}n.basic=i([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=i([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",e.emptyArray,null]),n.long=i([0,0,0,1,1],7),n.mapKey=i([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=i([1,5,0,0,0,5,5,0,0,0,1,1,0])},function(t,n,e){"use strict";!function(s){function a(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}n.a=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i,r;function o(){return r.apply(this,arguments)}return n=t,e=null,i=[{key:"global",value:(r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==s)return s;throw new Error("unable to locate global object")},o.toString=function(){return r.toString()},o)}],e&&a(n.prototype,e),i&&a(n,i),t}()}.call(this,e(12))},function(t,n,e){"use strict";t.exports=f;var i,r=e(1),o=r.LongBits,s=r.base64,a=r.utf8;function u(t,n,e){this.fn=t,this.len=n,this.next=void 0,this.val=e}function h(){}function c(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function f(){this.len=0,this.head=new u(h,0,0),this.tail=this.head,this.states=null}function l(){return r.Buffer?function(){return(f.create=function(){return new i})()}:function(){return new f}}function d(t,n,e){n[e]=255&t}function v(t,n){this.len=t,this.next=void 0,this.val=n}function p(t,n,e){for(;t.hi;)n[e++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127<t.lo;)n[e++]=127&t.lo|128,t.lo=t.lo>>>7;n[e++]=t.lo}function m(t,n,e){n[e]=255&t,n[e+1]=t>>>8&255,n[e+2]=t>>>16&255,n[e+3]=t>>>24}f.create=l(),f.alloc=function(t){return new r.Array(t)},r.Array!==Array&&(f.alloc=r.pool(f.alloc,r.Array.prototype.subarray)),f.prototype.R=function(t,n,e){return this.tail=this.tail.next=new u(t,n,e),this.len+=n,this},(v.prototype=Object.create(u.prototype)).fn=function(t,n,e){for(;127<t;)n[e++]=127&t|128,t>>>=7;n[e]=t},f.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new v((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},f.prototype.int32=function(t){return t<0?this.R(p,10,o.fromNumber(t)):this.uint32(t)},f.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},f.prototype.int64=f.prototype.uint64=function(t){t=o.from(t);return this.R(p,t.length(),t)},f.prototype.sint64=function(t){t=o.from(t).zzEncode();return this.R(p,t.length(),t)},f.prototype.bool=function(t){return this.R(d,1,t?1:0)},f.prototype.sfixed32=f.prototype.fixed32=function(t){return this.R(m,4,t>>>0)},f.prototype.sfixed64=f.prototype.fixed64=function(t){t=o.from(t);return this.R(m,4,t.lo).R(m,4,t.hi)},f.prototype.float=function(t){return this.R(r.float.writeFloatLE,4,t)},f.prototype.double=function(t){return this.R(r.float.writeDoubleLE,8,t)};var g=r.Array.prototype.set?function(t,n,e){n.set(t,e)}:function(t,n,e){for(var i=0;i<t.length;++i)n[e+i]=t[i]};f.prototype.bytes=function(t){var n,e=t.length>>>0;return e?(r.isString(t)&&(n=f.alloc(e=s.length(t)),s.decode(t,n,0),t=n),this.uint32(e).R(g,e,t)):this.R(d,1,0)},f.prototype.string=function(t){var n=a.length(t);return n?this.uint32(n).R(a.write,n,t):this.R(d,1,0)},f.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new u(h,0,0),this.len=0,this},f.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(h,0,0),this.len=0),this},f.prototype.ldelim=function(){var t=this.head,n=this.tail,e=this.len;return this.reset().uint32(e),e&&(this.tail.next=t.next,this.tail=n,this.len+=e),this},f.prototype.finish=function(){for(var t=this.head.next,n=this.constructor.alloc(this.len),e=0;t;)t.fn(t.val,n,e),e+=t.len,t=t.next;return n},f.M=function(t){i=t,f.create=l(),i.M()}},function(t,n,e){"use strict";t.exports=u;var i,r=e(1),o=r.LongBits,s=r.utf8;function a(t,n){return RangeError("index out of range: "+t.pos+" + "+(n||1)+" > "+t.len)}function u(t){this.buf=t,this.pos=0,this.len=t.length}function h(){return r.Buffer?function(t){return(u.create=function(t){return r.Buffer.isBuffer(t)?new i(t):f(t)})(t)}:f}var c,f="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new u(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new u(t);throw Error("illegal buffer")};function l(){var t=new o(0,0),n=0;if(!(4<this.len-this.pos)){for(;n<3;++n){if(this.pos>=this.len)throw a(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*n)>>>0,t}for(;n<4;++n)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(n=0,4<this.len-this.pos){for(;n<5;++n)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*n+3)>>>0,this.buf[this.pos++]<128)return t}else for(;n<5;++n){if(this.pos>=this.len)throw a(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*n+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function d(t,n){return(t[n-4]|t[n-3]<<8|t[n-2]<<16|t[n-1]<<24)>>>0}function v(){if(this.pos+8>this.len)throw a(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}u.create=h(),u.prototype.A=r.Array.prototype.subarray||r.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return d(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|d(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},u.prototype.bytes=function(){var t=this.uint32(),n=this.pos,e=this.pos+t;if(e>this.len)throw a(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(n,e):n===e?new this.buf.constructor(0):this.A.call(this.buf,n,e)},u.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},u.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw a(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},u.M=function(t){i=t,u.create=h(),i.M();var n=r.Long?"toLong":"toNumber";r.merge(u.prototype,{int64:function(){return l.call(this)[n](!1)},uint64:function(){return l.call(this)[n](!0)},sint64:function(){return l.call(this).zzDecode()[n](!1)},fixed64:function(){return v.call(this)[n](!0)},sfixed64:function(){return v.call(this)[n](!1)}})}},function(t,n,e){"use strict";t.exports=s;var r=e(3);((s.prototype=Object.create(r.prototype)).constructor=s).className="OneOf";var i=e(4),o=e(0);function s(t,n,e,i){if(Array.isArray(n)||(e=n,n=void 0),r.call(this,t,e),void 0!==n&&!Array.isArray(n))throw TypeError("fieldNames must be an Array");this.oneof=n||[],this.fieldsArray=[],this.comment=i}function a(t){if(t.parent)for(var n=0;n<t.fieldsArray.length;++n)t.fieldsArray[n].parent||t.parent.add(t.fieldsArray[n])}s.fromJSON=function(t,n){return new s(t,n.oneof,n.options,n.comment)},s.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return o.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.prototype.add=function(t){if(!(t instanceof i))throw TypeError("field must be a Field");return t.parent&&t.parent!==this.parent&&t.parent.remove(t),this.oneof.push(t.name),this.fieldsArray.push(t),a(t.partOf=this),this},s.prototype.remove=function(t){if(!(t instanceof i))throw TypeError("field must be a Field");var n=this.fieldsArray.indexOf(t);if(n<0)throw Error(t+" is not a member of "+this);return this.fieldsArray.splice(n,1),-1<(n=this.oneof.indexOf(t.name))&&this.oneof.splice(n,1),t.partOf=null,this},s.prototype.onAdd=function(t){r.prototype.onAdd.call(this,t);for(var n=0;n<this.oneof.length;++n){var e=t.get(this.oneof[n]);e&&!e.partOf&&(e.partOf=this).fieldsArray.push(e)}a(this)},s.prototype.onRemove=function(t){for(var n,e=0;e<this.fieldsArray.length;++e)(n=this.fieldsArray[e]).parent&&n.parent.remove(n);r.prototype.onRemove.call(this,t)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,n){o.decorateType(t.constructor).add(new s(n,e)),Object.defineProperty(t,n,{get:o.oneOfGetter(e),set:o.oneOfSetter(e)})}}},function(t,n,e){"use strict";t.exports=r;var i=e(1);function r(t){if(t)for(var n=Object.keys(t),e=0;e<n.length;++e)this[n[e]]=t[n[e]]}r.create=function(t){return this.$type.create(t)},r.encode=function(t,n){return this.$type.encode(t,n)},r.encodeDelimited=function(t,n){return this.$type.encodeDelimited(t,n)},r.decode=function(t){return this.$type.decode(t)},r.decodeDelimited=function(t){return this.$type.decodeDelimited(t)},r.verify=function(t){return this.$type.verify(t)},r.fromObject=function(t){return this.$type.fromObject(t)},r.toObject=function(t,n){return this.$type.toObject(t,n)},r.prototype.toJSON=function(){return this.$type.toObject(this,i.toJSONOptions)}},function(t,n){var e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n,e){"use strict";t.exports=function(t,n){var e=new Array(arguments.length-1),o=0,i=2,s=!0;for(;i<arguments.length;)e[o++]=arguments[i++];return new Promise(function(i,r){e[o]=function(t){if(s)if(s=!1,t)r(t);else{for(var n=new Array(arguments.length-1),e=0;e<n.length;)n[e++]=arguments[e];i.apply(null,n)}};try{t.apply(n||null,e)}catch(t){s&&(s=!1,r(t))}})}},function(module,exports,__webpack_require__){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},function(t,n,e){"use strict";n.Service=e(39)},function(t,n,e){"use strict";t.exports={}},function(t,n,e){"use strict";t.exports=function(t){for(var n,e=f.codegen(["m","w"],t.name+"$encode")("if(!w)")("w=Writer.create()"),i=t.fieldsArray.slice().sort(f.compareFieldsById),r=0;r<i.length;++r){var o=i[r].resolve(),s=t.C.indexOf(o),a=o.resolvedType instanceof h?"int32":o.type,u=c.basic[a];n="m"+f.safeProp(o.name),o.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",n,o.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",n)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(o.id<<3|2)>>>0,8|c.mapKey[o.keyType],o.keyType),void 0===u?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",s,n):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|u,a,n),e("}")("}")):o.repeated?(e("if(%s!=null&&%s.length){",n,n),o.packed&&void 0!==c.packed[a]?e("w.uint32(%i).fork()",(o.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",n)("w.%s(%s[i])",a,n)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",n),void 0===u?l(e,o,s,n+"[i]"):e("w.uint32(%i).%s(%s[i])",(o.id<<3|u)>>>0,a,n)),e("}")):(o.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",n,o.name),void 0===u?l(e,o,s,n):e("w.uint32(%i).%s(%s)",(o.id<<3|u)>>>0,a,n))}return e("return w")};var h=e(2),c=e(6),f=e(0);function l(t,n,e,i){return n.resolvedType.group?t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",e,i,(n.id<<3|3)>>>0,(n.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",e,i,(n.id<<3|2)>>>0)}},function(t,n,e){"use strict";t.exports=b;var s=e(5);((b.prototype=Object.create(s.prototype)).constructor=b).className="Type";var a=e(2),u=e(10),h=e(4),c=e(19),f=e(20),r=e(11),o=e(9),l=e(8),d=e(0),v=e(17),p=e(22),m=e(23),g=e(24),y=e(25);function b(t,n){s.call(this,t,n),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this.k=null,this.C=null,this.P=null,this.D=null}function i(t){return t.k=t.C=t.P=null,delete t.encode,delete t.decode,delete t.verify,t}Object.defineProperties(b.prototype,{fieldsById:{get:function(){if(this.k)return this.k;this.k={};for(var t=Object.keys(this.fields),n=0;n<t.length;++n){var e=this.fields[t[n]],i=e.id;if(this.k[i])throw Error("duplicate id "+i+" in "+this);this.k[i]=e}return this.k}},fieldsArray:{get:function(){return this.C||(this.C=d.toArray(this.fields))}},oneofsArray:{get:function(){return this.P||(this.P=d.toArray(this.oneofs))}},ctor:{get:function(){return this.D||(this.ctor=b.generateConstructor(this)())},set:function(t){var n=t.prototype;n instanceof r||((t.prototype=new r).constructor=t,d.merge(t.prototype,n)),t.$type=t.prototype.$type=this,d.merge(t,r,!0),this.D=t;for(var e=0;e<this.fieldsArray.length;++e)this.C[e].resolve();for(var i={},e=0;e<this.oneofsArray.length;++e)i[this.P[e].resolve().name]={get:d.oneOfGetter(this.P[e].oneof),set:d.oneOfSetter(this.P[e].oneof)};e&&Object.defineProperties(t.prototype,i)}}}),b.generateConstructor=function(t){for(var n,e=d.codegen(["p"],t.name),i=0;i<t.fieldsArray.length;++i)(n=t.C[i]).map?e("this%s={}",d.safeProp(n.name)):n.repeated&&e("this%s=[]",d.safeProp(n.name));return e("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},b.fromJSON=function(t,n){var e=new b(t,n.options);e.extensions=n.extensions,e.reserved=n.reserved;for(var i=Object.keys(n.fields),r=0;r<i.length;++r)e.add((void 0!==n.fields[i[r]].keyType?c:h).fromJSON(i[r],n.fields[i[r]]));if(n.oneofs)for(i=Object.keys(n.oneofs),r=0;r<i.length;++r)e.add(u.fromJSON(i[r],n.oneofs[i[r]]));if(n.nested)for(i=Object.keys(n.nested),r=0;r<i.length;++r){var o=n.nested[i[r]];e.add((void 0!==o.id?h:void 0!==o.fields?b:void 0!==o.values?a:void 0!==o.methods?f:s).fromJSON(i[r],o))}return n.extensions&&n.extensions.length&&(e.extensions=n.extensions),n.reserved&&n.reserved.length&&(e.reserved=n.reserved),n.group&&(e.group=!0),n.comment&&(e.comment=n.comment),e},b.prototype.toJSON=function(t){var n=s.prototype.toJSON.call(this,t),e=!!t&&Boolean(t.keepComments);return d.toObject(["options",n&&n.options||void 0,"oneofs",s.arrayToJSON(this.oneofsArray,t),"fields",s.arrayToJSON(this.fieldsArray.filter(function(t){return!t.declaringField}),t)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",n&&n.nested||void 0,"comment",e?this.comment:void 0])},b.prototype.resolveAll=function(){for(var t=this.fieldsArray,n=0;n<t.length;)t[n++].resolve();for(var e=this.oneofsArray,n=0;n<e.length;)e[n++].resolve();return s.prototype.resolveAll.call(this)},b.prototype.get=function(t){return this.fields[t]||this.oneofs&&this.oneofs[t]||this.nested&&this.nested[t]||null},b.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);if(t instanceof h&&void 0===t.extend){if((this.k||this.fieldsById)[t.id])throw Error("duplicate id "+t.id+" in "+this);if(this.isReservedId(t.id))throw Error("id "+t.id+" is reserved in "+this);if(this.isReservedName(t.name))throw Error("name '"+t.name+"' is reserved in "+this);return t.parent&&t.parent.remove(t),(this.fields[t.name]=t).message=this,t.onAdd(this),i(this)}return t instanceof u?(this.oneofs||(this.oneofs={}),(this.oneofs[t.name]=t).onAdd(this),i(this)):s.prototype.add.call(this,t)},b.prototype.remove=function(t){if(t instanceof h&&void 0===t.extend){if(!this.fields||this.fields[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.fields[t.name],t.parent=null,t.onRemove(this),i(this)}if(t instanceof u){if(!this.oneofs||this.oneofs[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.oneofs[t.name],t.parent=null,t.onRemove(this),i(this)}return s.prototype.remove.call(this,t)},b.prototype.isReservedId=function(t){return s.isReservedId(this.reserved,t)},b.prototype.isReservedName=function(t){return s.isReservedName(this.reserved,t)},b.prototype.create=function(t){return new this.ctor(t)},b.prototype.setup=function(){for(var t=this.fullName,n=[],e=0;e<this.fieldsArray.length;++e)n.push(this.C[e].resolve().resolvedType);this.encode=v(this)({Writer:l,types:n,util:d}),this.decode=p(this)({Reader:o,types:n,util:d}),this.verify=m(this)({types:n,util:d}),this.fromObject=g.fromObject(this)({types:n,util:d}),this.toObject=g.toObject(this)({types:n,util:d});var i=y[t];return i&&((t=Object.create(this)).fromObject=this.fromObject,this.fromObject=i.fromObject.bind(t),t.toObject=this.toObject,this.toObject=i.toObject.bind(t)),this},b.prototype.encode=function(t,n){return this.setup().encode(t,n)},b.prototype.encodeDelimited=function(t,n){return this.encode(t,n&&n.len?n.fork():n).ldelim()},b.prototype.decode=function(t,n){return this.setup().decode(t,n)},b.prototype.decodeDelimited=function(t){return t instanceof o||(t=o.create(t)),this.decode(t,t.uint32())},b.prototype.verify=function(t){return this.setup().verify(t)},b.prototype.fromObject=function(t){return this.setup().fromObject(t)},b.prototype.toObject=function(t,n){return this.setup().toObject(t,n)},b.d=function(n){return function(t){d.decorateType(t,n)}}},function(t,n,e){"use strict";t.exports=o;var s=e(4);((o.prototype=Object.create(s.prototype)).constructor=o).className="MapField";var i=e(6),a=e(0);function o(t,n,e,i,r,o){if(s.call(this,t,n,i,void 0,void 0,r,o),!a.isString(e))throw TypeError("keyType must be a string");this.keyType=e,this.resolvedKeyType=null,this.map=!0}o.fromJSON=function(t,n){return new o(t,n.id,n.keyType,n.type,n.options,n.comment)},o.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return a.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},o.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return s.prototype.resolve.call(this)},o.d=function(e,i,r){return"function"==typeof r?r=a.decorateType(r).name:r&&"object"==typeof r&&(r=a.decorateEnum(r).name),function(t,n){a.decorateType(t.constructor).add(new o(n,e,i,r))}}},function(t,n,e){"use strict";t.exports=s;var i=e(5);((s.prototype=Object.create(i.prototype)).constructor=s).className="Service";var o=e(21),a=e(0),u=e(15);function s(t,n){i.call(this,t,n),this.methods={},this.j=null}function r(t){return t.j=null,t}s.fromJSON=function(t,n){var e=new s(t,n.options);if(n.methods)for(var i=Object.keys(n.methods),r=0;r<i.length;++r)e.add(o.fromJSON(i[r],n.methods[i[r]]));return n.nested&&e.addJSON(n.nested),e.comment=n.comment,e},s.prototype.toJSON=function(t){var n=i.prototype.toJSON.call(this,t),e=!!t&&Boolean(t.keepComments);return a.toObject(["options",n&&n.options||void 0,"methods",i.arrayToJSON(this.methodsArray,t)||{},"nested",n&&n.nested||void 0,"comment",e?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this.j||(this.j=a.toArray(this.methods))}}),s.prototype.get=function(t){return this.methods[t]||i.prototype.get.call(this,t)},s.prototype.resolveAll=function(){for(var t=this.methodsArray,n=0;n<t.length;++n)t[n].resolve();return i.prototype.resolve.call(this)},s.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);return t instanceof o?r((this.methods[t.name]=t).parent=this):i.prototype.add.call(this,t)},s.prototype.remove=function(t){if(t instanceof o){if(this.methods[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.methods[t.name],t.parent=null,r(this)}return i.prototype.remove.call(this,t)},s.prototype.create=function(t,n,e){for(var i,r=new u.Service(t,n,e),o=0;o<this.methodsArray.length;++o){var s=a.lcFirst((i=this.j[o]).resolve().name).replace(/[^$\w_]/g,"");r[s]=a.codegen(["r","c"],a.isReserved(s)?s+"_":s)("return this.rpcCall(m,q,s,r,c)")({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return r}},function(t,n,e){"use strict";t.exports=i;var h=e(3);((i.prototype=Object.create(h.prototype)).constructor=i).className="Method";var c=e(0);function i(t,n,e,i,r,o,s,a,u){if(c.isObject(r)?(s=r,r=o=void 0):c.isObject(o)&&(s=o,o=void 0),void 0!==n&&!c.isString(n))throw TypeError("type must be a string");if(!c.isString(e))throw TypeError("requestType must be a string");if(!c.isString(i))throw TypeError("responseType must be a string");h.call(this,t,s),this.type=n||"rpc",this.requestType=e,this.requestStream=!!r||void 0,this.responseType=i,this.responseStream=!!o||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=a,this.parsedOptions=u}i.fromJSON=function(t,n){return new i(t,n.type,n.requestType,n.responseType,n.requestStream,n.responseStream,n.options,n.comment,n.parsedOptions)},i.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return c.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),h.prototype.resolve.call(this))}},function(t,n,e){"use strict";t.exports=function(t){var n=h.codegen(["r","l"],t.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(t.fieldsArray.filter(function(t){return t.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");t.group&&n("if((t&7)===4)")("break");n("switch(t>>>3){");for(var e=0;e<t.fieldsArray.length;++e){var i=t.C[e].resolve(),r=i.resolvedType instanceof a?"int32":i.type,o="m"+h.safeProp(i.name);n("case %i:",i.id),i.map?(n("if(%s===util.emptyObject)",o)("%s={}",o)("var c2 = r.uint32()+r.pos"),void 0!==u.defaults[i.keyType]?n("k=%j",u.defaults[i.keyType]):n("k=null"),void 0!==u.defaults[r]?n("value=%j",u.defaults[r]):n("value=null"),n("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",i.keyType)("case 2:"),void 0===u.basic[r]?n("value=types[%i].decode(r,r.uint32())",e):n("value=r.%s()",r),n("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==u.long[i.keyType]?n('%s[typeof k==="object"?util.longToHash(k):k]=value',o):n("%s[k]=value",o)):i.repeated?(n("if(!(%s&&%s.length))",o,o)("%s=[]",o),void 0!==u.packed[r]&&n("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",o,r)("}else"),void 0===u.basic[r]?n(i.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",o,e):n("%s.push(r.%s())",o,r)):void 0===u.basic[r]?n(i.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",o,e):n("%s=r.%s()",o,r),n("break")}for(n("default:")("r.skipType(t&7)")("break")("}")("}"),e=0;e<t.C.length;++e){var s=t.C[e];s.required&&n("if(!m.hasOwnProperty(%j))",s.name)("throw util.ProtocolError(%j,{instance:m})","missing required '"+s.name+"'")}return n("return m")};var a=e(2),u=e(6),h=e(0)},function(t,n,e){"use strict";t.exports=function(t){var n=u.codegen(["m"],t.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),e=t.oneofsArray,i={};e.length&&n("var p={}");for(var r=0;r<t.fieldsArray.length;++r){var o,s=t.C[r].resolve(),a="m"+u.safeProp(s.name);s.optional&&n("if(%s!=null&&m.hasOwnProperty(%j)){",a,s.name),s.map?(n("if(!util.isObject(%s))",a)("return%j",h(s,"object"))("var k=Object.keys(%s)",a)("for(var i=0;i<k.length;++i){"),function(t,n,e){switch(n.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.key32Re.test(%s))",e)("return%j",h(n,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.key64Re.test(%s))",e)("return%j",h(n,"integer|Long key"));break;case"bool":t("if(!util.key2Re.test(%s))",e)("return%j",h(n,"boolean key"))}}(n,s,"k[i]"),c(n,s,r,a+"[k[i]]")("}")):s.repeated?(n("if(!Array.isArray(%s))",a)("return%j",h(s,"array"))("for(var i=0;i<%s.length;++i){",a),c(n,s,r,a+"[i]")("}")):(s.partOf&&(o=u.safeProp(s.partOf.name),1===i[s.partOf.name]&&n("if(p%s===1)",o)("return%j",s.partOf.name+": multiple values"),i[s.partOf.name]=1,n("p%s=1",o)),c(n,s,r,a)),s.optional&&n("}")}return n("return null")};var s=e(2),u=e(0);function h(t,n){return t.name+": "+n+(t.repeated&&"array"!==n?"[]":t.map&&"object"!==n?"{k:"+t.keyType+"}":"")+" expected"}function c(t,n,e,i){if(n.resolvedType)if(n.resolvedType instanceof s){t("switch(%s){",i)("default:")("return%j",h(n,"enum value"));for(var r=Object.keys(n.resolvedType.values),o=0;o<r.length;++o)t("case %i:",n.resolvedType.values[r[o]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s);",e,i)("if(e)")("return%j+e",n.name+".")("}");else switch(n.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.isInteger(%s))",i)("return%j",h(n,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",h(n,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',i)("return%j",h(n,"number"));break;case"bool":t('if(typeof %s!=="boolean")',i)("return%j",h(n,"boolean"));break;case"string":t("if(!util.isString(%s))",i)("return%j",h(n,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",h(n,"buffer"))}return t}},function(t,n,e){"use strict";var n=n,l=e(2),d=e(0);function s(t,n,e,i){if(n.resolvedType)if(n.resolvedType instanceof l){t("switch(d%s){",i);for(var r=n.resolvedType.values,o=Object.keys(r),s=0;s<o.length;++s)n.repeated&&r[o[s]]===n.typeDefault&&t("default:"),t("case%j:",o[s])("case %i:",r[o[s]])("m%s=%j",i,r[o[s]])("break");t("}")}else t('if(typeof d%s!=="object")',i)("throw TypeError(%j)",n.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",i,e,i);else{var a=!1;switch(n.type){case"double":case"float":t("m%s=Number(d%s)",i,i);break;case"uint32":case"fixed32":t("m%s=d%s>>>0",i,i);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",i,i);break;case"uint64":a=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",i,i,a)('else if(typeof d%s==="string")',i)("m%s=parseInt(d%s,10)",i,i)('else if(typeof d%s==="number")',i)("m%s=d%s",i,i)('else if(typeof d%s==="object")',i)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",i,i,i,a?"true":"");break;case"bytes":t('if(typeof d%s==="string")',i)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",i,i,i)("else if(d%s.length)",i)("m%s=d%s",i,i);break;case"string":t("m%s=String(d%s)",i,i);break;case"bool":t("m%s=Boolean(d%s)",i,i)}}return t}function v(t,n,e,i){if(n.resolvedType)n.resolvedType instanceof l?t("d%s=o.enums===String?types[%i].values[m%s]:m%s",i,e,i,i):t("d%s=types[%i].toObject(m%s,o)",i,e,i);else{var r=!1;switch(n.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",i,i,i,i);break;case"uint64":r=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t('if(typeof m%s==="number")',i)("d%s=o.longs===String?String(m%s):m%s",i,i,i)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",i,i,i,i,r?"true":"",i);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",i,i,i,i,i);break;default:t("d%s=m%s",i,i)}}return t}n.fromObject=function(t){var n=t.fieldsArray,e=d.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!n.length)return e("return new this.ctor");e("var m=new this.ctor");for(var i=0;i<n.length;++i){var r=n[i].resolve(),o=d.safeProp(r.name);r.map?(e("if(d%s){",o)('if(typeof d%s!=="object")',o)("throw TypeError(%j)",r.fullName+": object expected")("m%s={}",o)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",o),s(e,r,i,o+"[ks[i]]")("}")("}")):r.repeated?(e("if(d%s){",o)("if(!Array.isArray(d%s))",o)("throw TypeError(%j)",r.fullName+": array expected")("m%s=[]",o)("for(var i=0;i<d%s.length;++i){",o),s(e,r,i,o+"[i]")("}")("}")):(r.resolvedType instanceof l||e("if(d%s!=null){",o),s(e,r,i,o),r.resolvedType instanceof l||e("}"))}return e("return m")},n.toObject=function(t){var n=t.fieldsArray.slice().sort(d.compareFieldsById);if(!n.length)return d.codegen()("return {}");for(var e=d.codegen(["m","o"],t.name+"$toObject")("if(!o)")("o={}")("var d={}"),i=[],r=[],o=[],s=0;s<n.length;++s)n[s].partOf||(n[s].resolve().repeated?i:n[s].map?r:o).push(n[s]);if(i.length){for(e("if(o.arrays||o.defaults){"),s=0;s<i.length;++s)e("d%s=[]",d.safeProp(i[s].name));e("}")}if(r.length){for(e("if(o.objects||o.defaults){"),s=0;s<r.length;++s)e("d%s={}",d.safeProp(r[s].name));e("}")}if(o.length){for(e("if(o.defaults){"),s=0;s<o.length;++s){var a,u=o[s],h=d.safeProp(u.name);u.resolvedType instanceof l?e("d%s=o.enums===String?%j:%j",h,u.resolvedType.valuesById[u.typeDefault],u.typeDefault):u.long?e("if(util.Long){")("var n=new util.Long(%i,%i,%j)",u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",h)("}else")("d%s=o.longs===String?%j:%i",h,u.typeDefault.toString(),u.typeDefault.toNumber()):u.bytes?(a="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]",e("if(o.bytes===String)d%s=%j",h,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",h,a)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",h,h)("}")):e("d%s=%j",h,u.typeDefault)}e("}")}for(var c=!1,s=0;s<n.length;++s){var u=n[s],f=t.C.indexOf(u),h=d.safeProp(u.name);u.map?(c||(c=!0,e("var ks2")),e("if(m%s&&(ks2=Object.keys(m%s)).length){",h,h)("d%s={}",h)("for(var j=0;j<ks2.length;++j){"),v(e,u,f,h+"[ks2[j]]")("}")):u.repeated?(e("if(m%s&&m%s.length){",h,h)("d%s=[]",h)("for(var j=0;j<m%s.length;++j){",h),v(e,u,f,h+"[j]")("}")):(e("if(m%s!=null&&m.hasOwnProperty(%j)){",h,u.name),v(e,u,f,h),u.partOf&&e("if(o.oneofs)")("d%s=%j",d.safeProp(u.partOf.name),u.name)),e("}")}return e("return d")}},function(t,n,e){"use strict";var n=n,o=e(11);n[".google.protobuf.Any"]={fromObject:function(t){if(t&&t["@type"]){var n=t["@type"].substring(t["@type"].lastIndexOf("/")+1),e=this.lookup(n);if(e){n="."===t["@type"].charAt(0)?t["@type"].substr(1):t["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:e.encode(e.fromObject(t)).finish()})}}return this.fromObject(t)},toObject:function(t,n){var e,i="",r="";if(n&&n.json&&t.type_url&&t.value&&(r=t.type_url.substring(t.type_url.lastIndexOf("/")+1),i=t.type_url.substring(0,t.type_url.lastIndexOf("/")+1),(e=this.lookup(r))&&(t=e.decode(t.value))),t instanceof this.ctor||!(t instanceof o))return this.toObject(t,n);n=t.$type.toObject(t,n),t="."===t.$type.fullName[0]?t.$type.fullName.substr(1):t.$type.fullName;return n["@type"]=r=(i=""===i?"type.googleapis.com/":i)+t,n}}},function(t,n,e){"use strict";t.exports=u;var i=e(5);((u.prototype=Object.create(i.prototype)).constructor=u).className="Root";var r,d,v,o=e(4),s=e(2),a=e(10),p=e(0);function u(t){i.call(this,"",t),this.deferred=[],this.files=[]}function m(){}u.fromJSON=function(t,n){return n=n||new u,t.options&&n.setOptions(t.options),n.addJSON(t.nested)},u.prototype.resolvePath=p.path.resolve,u.prototype.fetch=p.fetch,u.prototype.load=function t(n,o,r){"function"==typeof o&&(r=o,o=void 0);var s=this;if(!r)return p.asPromise(t,s,n,o);var a=r===m;function u(t,n){if(r){var e=r;if(r=null,a)throw t;e(t,n)}}function h(t){var n=t.lastIndexOf("google/protobuf/");if(-1<n){n=t.substring(n);if(n in v)return n}return null}function c(t,n){try{if(p.isString(n)&&"{"===n.charAt(0)&&(n=JSON.parse(n)),p.isString(n)){d.filename=t;var e,i=d(n,s,o),r=0;if(i.imports)for(;r<i.imports.length;++r)(e=h(i.imports[r])||s.resolvePath(t,i.imports[r]))&&f(e);if(i.weakImports)for(r=0;r<i.weakImports.length;++r)(e=h(i.weakImports[r])||s.resolvePath(t,i.weakImports[r]))&&f(e,!0)}else s.setOptions(n.options).addJSON(n.nested)}catch(t){u(t)}a||l||u(null,s)}function f(e,i){if(!(-1<s.files.indexOf(e)))if(s.files.push(e),e in v)a?c(e,v[e]):(++l,setTimeout(function(){--l,c(e,v[e])}));else if(a){var t;try{t=p.fs.readFileSync(e).toString("utf8")}catch(t){return void(i||u(t))}c(e,t)}else++l,s.fetch(e,function(t,n){--l,r&&(t?i?l||u(null,s):u(t):c(e,n))})}var l=0;p.isString(n)&&(n=[n]);for(var e,i=0;i<n.length;++i)(e=s.resolvePath("",n[i]))&&f(e);if(a)return s;l||u(null,s)},u.prototype.loadSync=function(t,n){if(!p.isNode)throw Error("not supported");return this.load(t,n,m)},u.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(t){return"'extend "+t.extend+"' in "+t.parent.fullName}).join(", "));return i.prototype.resolveAll.call(this)};var h=/^[A-Z]/;function c(t,n){var e=n.parent.lookup(n.extend);if(e){var i=new o(n.fullName,n.id,n.type,n.rule,void 0,n.options);return(i.declaringField=n).extensionField=i,e.add(i),1}}u.prototype.S=function(t){if(t instanceof o)void 0===t.extend||t.extensionField||c(0,t)||this.deferred.push(t);else if(t instanceof s)h.test(t.name)&&(t.parent[t.name]=t.values);else if(!(t instanceof a)){if(t instanceof r)for(var n=0;n<this.deferred.length;)c(0,this.deferred[n])?this.deferred.splice(n,1):++n;for(var e=0;e<t.nestedArray.length;++e)this.S(t.O[e]);h.test(t.name)&&(t.parent[t.name]=t)}},u.prototype.T=function(t){var n;if(t instanceof o)void 0!==t.extend&&(t.extensionField?(t.extensionField.parent.remove(t.extensionField),t.extensionField=null):-1<(n=this.deferred.indexOf(t))&&this.deferred.splice(n,1));else if(t instanceof s)h.test(t.name)&&delete t.parent[t.name];else if(t instanceof i){for(var e=0;e<t.nestedArray.length;++e)this.T(t.O[e]);h.test(t.name)&&delete t.parent[t.name]}},u.M=function(t,n,e){r=t,d=n,v=e}},function(t,n,e){var i;function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}i=function(){"use strict";function c(){var e=0,i=document.createElement("div");function t(t){return i.appendChild(t.dom),t}function n(t){for(var n=0;n<i.children.length;n++)i.children[n].style.display=n===t?"block":"none";e=t}i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",function(t){t.preventDefault(),n(++e%i.children.length)},!1);var r,o=(performance||Date).now(),s=o,a=0,u=t(new c.Panel("FPS","#0ff","#002")),h=t(new c.Panel("MS","#0f0","#020"));return self.performance&&self.performance.memory&&(r=t(new c.Panel("MB","#f08","#201"))),n(0),{REVISION:16,dom:i,addPanel:t,showPanel:n,begin:function(){o=(performance||Date).now()},end:function(){a++;var t,n=(performance||Date).now();return h.update(n-o,200),s+1e3<=n&&(u.update(1e3*a/(n-s),100),s=n,a=0,r&&(t=performance.memory,r.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576))),n},update:function(){o=this.end()},domElement:i,setMode:n}}return c.Panel=function(e,i,r){var o=1/0,s=0,a=Math.round,u=a(window.devicePixelRatio||1),h=80*u,t=48*u,c=3*u,f=2*u,l=3*u,d=15*u,v=74*u,p=30*u,m=document.createElement("canvas");m.width=h,m.height=t,m.style.cssText="width:80px;height:48px";var g=m.getContext("2d");return g.font="bold "+9*u+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=r,g.fillRect(0,0,h,t),g.fillStyle=i,g.fillText(e,c,f),g.fillRect(l,d,v,p),g.fillStyle=r,g.globalAlpha=.9,g.fillRect(l,d,v,p),{dom:m,update:function(t,n){o=Math.min(o,t),s=Math.max(s,t),g.fillStyle=r,g.globalAlpha=1,g.fillRect(0,0,h,d),g.fillStyle=i,g.fillText(a(t)+" "+e+" ("+a(o)+"-"+a(s)+")",c,f),g.drawImage(m,l+u,d,v-u,p,l,d,v-u,p),g.fillRect(l+v-u,d,u,p),g.fillStyle=r,g.globalAlpha=.9,g.fillRect(l+v-u,d,u,a((1-t/n)*p))}}},c},"object"===r(n)&&void 0!==t?t.exports=i():void 0===(i="function"==typeof(i=i)?i.call(n,e,n,t):i)||(t.exports=i)},function(t,n,e){"use strict";t.exports=e(29)},function(t,n,e){"use strict";var i=t.exports=e(30);i.build="light",i.load=function(t,n,e){return(n="function"==typeof n?(e=n,new i.Root):n||new i.Root).load(t,e)},i.loadSync=function(t,n){return(n=n||new i.Root).loadSync(t)},i.encoder=e(17),i.decoder=e(22),i.verifier=e(23),i.converter=e(24),i.ReflectionObject=e(3),i.Namespace=e(5),i.Root=e(26),i.Enum=e(2),i.Type=e(18),i.Field=e(4),i.OneOf=e(10),i.MapField=e(19),i.Service=e(20),i.Method=e(21),i.Message=e(11),i.wrappers=e(25),i.types=e(6),i.util=e(0),i.ReflectionObject.M(i.Root),i.Namespace.M(i.Type,i.Service,i.Enum),i.Root.M(i.Type),i.Field.M(i.Type)},function(t,n,e){"use strict";var i=n;function r(){i.util.M(),i.Writer.M(i.BufferWriter),i.Reader.M(i.BufferReader)}i.build="minimal",i.Writer=e(8),i.BufferWriter=e(37),i.Reader=e(9),i.BufferReader=e(38),i.util=e(1),i.rpc=e(15),i.roots=e(16),i.configure=r,r()},function(t,n,e){"use strict";n.length=function(t){var n=t.length;if(!n)return 0;for(var e=0;1<--n%4&&"="===t.charAt(n);)++e;return Math.ceil(3*t.length)/4-e};for(var h=new Array(64),u=new Array(123),i=0;i<64;)u[h[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;n.encode=function(t,n,e){for(var i,r=null,o=[],s=0,a=0;n<e;){var u=t[n++];switch(a){case 0:o[s++]=h[u>>2],i=(3&u)<<4,a=1;break;case 1:o[s++]=h[i|u>>4],i=(15&u)<<2,a=2;break;case 2:o[s++]=h[i|u>>6],o[s++]=h[63&u],a=0}8191<s&&((r=r||[]).push(String.fromCharCode.apply(String,o)),s=0)}return a&&(o[s++]=h[i],o[s++]=61,1===a&&(o[s++]=61)),r?(s&&r.push(String.fromCharCode.apply(String,o.slice(0,s))),r.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var c="invalid encoding";n.decode=function(t,n,e){for(var i,r=e,o=0,s=0;s<t.length;){var a=t.charCodeAt(s++);if(61===a&&1<o)break;if(void 0===(a=u[a]))throw Error(c);switch(o){case 0:i=a,o=1;break;case 1:n[e++]=i<<2|(48&a)>>4,i=a,o=2;break;case 2:n[e++]=(15&i)<<4|(60&a)>>2,i=a,o=3;break;case 3:n[e++]=(3&i)<<6|a,o=0}}if(1===o)throw Error(c);return e-r},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},function(t,n,e){"use strict";function i(){this.N={}}(t.exports=i).prototype.on=function(t,n,e){return(this.N[t]||(this.N[t]=[])).push({fn:n,ctx:e||this}),this},i.prototype.off=function(t,n){if(void 0===t)this.N={};else if(void 0===n)this.N[t]=[];else for(var e=this.N[t],i=0;i<e.length;)e[i].fn===n?e.splice(i,1):++i;return this},i.prototype.emit=function(t){var n=this.N[t];if(n){for(var e=[],i=1;i<arguments.length;)e.push(arguments[i++]);for(i=0;i<n.length;)n[i].fn.apply(n[i++].ctx,e)}return this}},function(t,n,e){"use strict";function i(t){function n(t,n,e,i){var r=n<0?1:0;0===(n=r?-n:n)?t(0<1/n?0:2147483648,e,i):isNaN(n)?t(2143289344,e,i):t(34028234663852886e22<n?(r<<31|2139095040)>>>0:n<11754943508222875e-54?(r<<31|Math.round(n/1401298464324817e-60))>>>0:(r<<31|(r=Math.floor(Math.log(n)/Math.LN2))+127<<23|8388607&Math.round(n*Math.pow(2,-r)*8388608))>>>0,e,i)}function e(t,n,e){t=t(n,e),n=2*(t>>31)+1,e=t>>>23&255,t&=8388607;return 255==e?t?NaN:1/0*n:0==e?1401298464324817e-60*n*t:n*Math.pow(2,e-150)*(8388608+t)}function i(t,n,e){a[0]=t,n[e]=u[0],n[e+1]=u[1],n[e+2]=u[2],n[e+3]=u[3]}function r(t,n,e){a[0]=t,n[e]=u[3],n[e+1]=u[2],n[e+2]=u[1],n[e+3]=u[0]}function o(t,n){return u[0]=t[n],u[1]=t[n+1],u[2]=t[n+2],u[3]=t[n+3],a[0]}function s(t,n){return u[3]=t[n],u[2]=t[n+1],u[1]=t[n+2],u[0]=t[n+3],a[0]}var a,u,h,c,f;function l(t,n,e,i,r,o){var s,a,u=i<0?1:0;0===(i=u?-i:i)?(t(0,r,o+n),t(0<1/i?0:2147483648,r,o+e)):isNaN(i)?(t(0,r,o+n),t(2146959360,r,o+e)):17976931348623157e292<i?(t(0,r,o+n),t((u<<31|2146435072)>>>0,r,o+e)):i<22250738585072014e-324?(t((s=i/5e-324)>>>0,r,o+n),t((u<<31|s/4294967296)>>>0,r,o+e)):(1024===(a=Math.floor(Math.log(i)/Math.LN2))&&(a=1023),t(4503599627370496*(s=i*Math.pow(2,-a))>>>0,r,o+n),t((u<<31|a+1023<<20|1048576*s&1048575)>>>0,r,o+e))}function d(t,n,e,i,r){n=t(i,r+n),i=t(i,r+e),r=2*(i>>31)+1,e=i>>>20&2047,n=4294967296*(1048575&i)+n;return 2047==e?n?NaN:1/0*r:0==e?5e-324*r*n:r*Math.pow(2,e-1075)*(n+4503599627370496)}function v(t,n,e){h[0]=t,n[e]=c[0],n[e+1]=c[1],n[e+2]=c[2],n[e+3]=c[3],n[e+4]=c[4],n[e+5]=c[5],n[e+6]=c[6],n[e+7]=c[7]}function p(t,n,e){h[0]=t,n[e]=c[7],n[e+1]=c[6],n[e+2]=c[5],n[e+3]=c[4],n[e+4]=c[3],n[e+5]=c[2],n[e+6]=c[1],n[e+7]=c[0]}function m(t,n){return c[0]=t[n],c[1]=t[n+1],c[2]=t[n+2],c[3]=t[n+3],c[4]=t[n+4],c[5]=t[n+5],c[6]=t[n+6],c[7]=t[n+7],h[0]}function g(t,n){return c[7]=t[n],c[6]=t[n+1],c[5]=t[n+2],c[4]=t[n+3],c[3]=t[n+4],c[2]=t[n+5],c[1]=t[n+6],c[0]=t[n+7],h[0]}return"undefined"!=typeof Float32Array?(a=new Float32Array([-0]),u=new Uint8Array(a.buffer),f=128===u[3],t.writeFloatLE=f?i:r,t.writeFloatBE=f?r:i,t.readFloatLE=f?o:s,t.readFloatBE=f?s:o):(t.writeFloatLE=n.bind(null,y),t.writeFloatBE=n.bind(null,b),t.readFloatLE=e.bind(null,_),t.readFloatBE=e.bind(null,w)),"undefined"!=typeof Float64Array?(h=new Float64Array([-0]),c=new Uint8Array(h.buffer),f=128===c[7],t.writeDoubleLE=f?v:p,t.writeDoubleBE=f?p:v,t.readDoubleLE=f?m:g,t.readDoubleBE=f?g:m):(t.writeDoubleLE=l.bind(null,y,0,4),t.writeDoubleBE=l.bind(null,b,4,0),t.readDoubleLE=d.bind(null,_,0,4),t.readDoubleBE=d.bind(null,w,4,0)),t}function y(t,n,e){n[e]=255&t,n[e+1]=t>>>8&255,n[e+2]=t>>>16&255,n[e+3]=t>>>24}function b(t,n,e){n[e]=t>>>24,n[e+1]=t>>>16&255,n[e+2]=t>>>8&255,n[e+3]=255&t}function _(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24)>>>0}function w(t,n){return(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3])>>>0}t.exports=i(i)},function(t,n,e){"use strict";n.length=function(t){for(var n,e=0,i=0;i<t.length;++i)(n=t.charCodeAt(i))<128?e+=1:n<2048?e+=2:55296==(64512&n)&&56320==(64512&t.charCodeAt(i+1))?(++i,e+=4):e+=3;return e},n.read=function(t,n,e){if(e-n<1)return"";for(var i,r=null,o=[],s=0;n<e;)(i=t[n++])<128?o[s++]=i:191<i&&i<224?o[s++]=(31&i)<<6|63&t[n++]:239<i&&i<365?(i=((7&i)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,o[s++]=55296+(i>>10),o[s++]=56320+(1023&i)):o[s++]=(15&i)<<12|(63&t[n++])<<6|63&t[n++],8191<s&&((r=r||[]).push(String.fromCharCode.apply(String,o)),s=0);return r?(s&&r.push(String.fromCharCode.apply(String,o.slice(0,s))),r.join("")):String.fromCharCode.apply(String,o.slice(0,s))},n.write=function(t,n,e){for(var i,r,o=e,s=0;s<t.length;++s)(i=t.charCodeAt(s))<128?n[e++]=i:(i<2048?n[e++]=i>>6|192:(55296==(64512&i)&&56320==(64512&(r=t.charCodeAt(s+1)))?(++s,n[e++]=(i=65536+((1023&i)<<10)+(1023&r))>>18|240,n[e++]=i>>12&63|128):n[e++]=i>>12|224,n[e++]=i>>6&63|128),n[e++]=63&i|128);return e-o}},function(t,n,e){"use strict";t.exports=function(n,e,t){var i=t||8192,r=i>>>1,o=null,s=i;return function(t){if(t<1||r<t)return n(t);i<s+t&&(o=n(i),s=0);t=e.call(o,s,s+=t);return 7&s&&(s=1+(7|s)),t}}},function(t,n,e){"use strict";t.exports=r;var i=e(1);function r(t,n){this.lo=t>>>0,this.hi=n>>>0}var o=r.zero=new r(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(t){if(0===t)return o;var n=t<0,e=(t=n?-t:t)>>>0,t=(t-e)/4294967296>>>0;return n&&(t=~t>>>0,e=~e>>>0,4294967295<++e&&(e=0,4294967295<++t&&(t=0))),new r(e,t)},r.from=function(t){if("number"==typeof t)return r.fromNumber(t);if(i.isString(t)){if(!i.Long)return r.fromNumber(parseInt(t,10));t=i.Long.fromString(t)}return t.low||t.high?new r(t.low>>>0,t.high>>>0):o},r.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var n=1+~this.lo>>>0,t=~this.hi>>>0;return-(n+4294967296*(t=!n?t+1>>>0:t))}return this.lo+4294967296*this.hi},r.prototype.toLong=function(t){return i.Long?new i.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var s=String.prototype.charCodeAt;r.fromHash=function(t){return"\0\0\0\0\0\0\0\0"===t?o:new r((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},r.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},r.prototype.length=function(){var t=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,e=this.hi>>>24;return 0==e?0==n?t<16384?t<128?1:2:t<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:e<128?9:10}},function(t,n,e){"use strict";t.exports=o;var i=e(8);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(1);function o(){i.call(this)}function s(t,n,e){t.length<40?r.utf8.write(t,n,e):n.utf8Write?n.utf8Write(t,e):n.write(t,e)}o.M=function(){o.alloc=r._,o.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&"set"===r.Buffer.prototype.set.name?function(t,n,e){n.set(t,e)}:function(t,n,e){if(t.copy)t.copy(n,e,0,t.length);else for(var i=0;i<t.length;)n[e++]=t[i++]}},o.prototype.bytes=function(t){var n=(t=r.isString(t)?r.u(t,"base64"):t).length>>>0;return this.uint32(n),n&&this.R(o.writeBytesBuffer,n,t),this},o.prototype.string=function(t){var n=r.Buffer.byteLength(t);return this.uint32(n),n&&this.R(s,n,t),this},o.M()},function(t,n,e){"use strict";t.exports=o;var i=e(9);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(1);function o(t){i.call(this,t)}o.M=function(){r.Buffer&&(o.prototype.A=r.Buffer.prototype.slice)},o.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},o.M()},function(t,n,e){"use strict";t.exports=i;var a=e(1);function i(t,n,e){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");a.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(n),this.responseDelimited=Boolean(e)}((i.prototype=Object.create(a.EventEmitter.prototype)).constructor=i).prototype.rpcCall=function t(e,n,i,r,o){if(!r)throw TypeError("request must be specified");var s=this;if(!o)return a.asPromise(t,s,e,n,i,r);if(s.rpcImpl)try{return s.rpcImpl(e,n[s.requestDelimited?"encodeDelimited":"encode"](r).finish(),function(t,n){if(t)return s.emit("error",t,e),o(t);if(null!==n){if(!(n instanceof i))try{n=i[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return s.emit("error",t,e),o(t)}return s.emit("data",n,e),o(null,n)}s.end(!0)})}catch(t){return s.emit("error",t,e),void setTimeout(function(){o(t)},0)}else setTimeout(function(){o(Error("already ended"))},0)},i.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},function(t,n,e){"use strict";function i(n,e){"string"==typeof n&&(e=n,n=void 0);var u=[];function h(t){if("string"!=typeof t){var n="return "+(n=c());if(t){for(var e=Object.keys(t),i=new Array(e.length+1),r=new Array(e.length),o=0;o<e.length;)i[o]=e[o],r[o]=t[e[o++]];return i[o]=n,Function.apply(null,i).apply(null,r)}return Function(n)()}for(var s=new Array(arguments.length-1),a=0;a<s.length;)s[a]=arguments[++a];if(a=0,t=t.replace(/%([%dfijs])/g,function(t,n){var e=s[a++];switch(n){case"d":case"f":return String(Number(e));case"i":return String(Math.floor(e));case"j":return JSON.stringify(e);case"s":return String(e)}return"%"}),a!==s.length)throw Error("parameter count mismatch");return u.push(t),h}function c(t){return"function "+(t||e||"")+"("+(n&&n.join(",")||"")+"){\n "+u.join("\n ")+"\n}"}return h.toString=c,h}(t.exports=i).verbose=!1},function(t,n,e){"use strict";t.exports=a;var o=e(13),s=e(14)("fs");function a(e,i,r){return i="function"==typeof i?(r=i,{}):i||{},r?!i.xhr&&s&&s.readFile?s.readFile(e,function(t,n){return t&&"undefined"!=typeof XMLHttpRequest?a.xhr(e,i,r):t?r(t):r(null,i.binary?n:n.toString("utf8"))}):a.xhr(e,i,r):o(a,this,e,i)}a.xhr=function(t,e,i){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(4===r.readyState){if(0!==r.status&&200!==r.status)return i(Error("status "+r.status));if(e.binary){if(!(t=r.response))for(var t=[],n=0;n<r.responseText.length;++n)t.push(255&r.responseText.charCodeAt(n));return i(null,"undefined"!=typeof Uint8Array?new Uint8Array(t):t)}return i(null,r.responseText)}},e.binary&&("overrideMimeType"in r&&r.overrideMimeType("text/plain; charset=x-user-defined"),r.responseType="arraybuffer"),r.open("GET",t),r.send()}},function(t,n,e){"use strict";var n=n,r=n.isAbsolute=function(t){return/^(?:\/|\w+:)/.test(t)},i=n.normalize=function(t){var n=(t=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),e=r(t),t="";e&&(t=n.shift()+"/");for(var i=0;i<n.length;)".."===n[i]?0<i&&".."!==n[i-1]?n.splice(--i,2):e?n.splice(i,1):++i:"."===n[i]?n.splice(i,1):++i;return t+n.join("/")};n.resolve=function(t,n,e){return e||(n=i(n)),!r(n)&&(t=(t=!e?i(t):t).replace(/(?:\/|^)[^/]+$/,"")).length?i(t+"/"+n):n}},function(t,n,e){"use strict";e.r(n);var u={};e.r(u),e.d(u,"ShadowMaterial",function(){return sf}),e.d(u,"SpriteMaterial",function(){return lc}),e.d(u,"RawShaderMaterial",function(){return dc}),e.d(u,"ShaderMaterial",function(){return qr}),e.d(u,"PointsMaterial",function(){return af}),e.d(u,"MeshPhysicalMaterial",function(){return hf}),e.d(u,"MeshStandardMaterial",function(){return uf}),e.d(u,"MeshPhongMaterial",function(){return cf}),e.d(u,"MeshToonMaterial",function(){return ff}),e.d(u,"MeshNormalMaterial",function(){return lf}),e.d(u,"MeshLambertMaterial",function(){return df}),e.d(u,"MeshDepthMaterial",function(){return ma}),e.d(u,"MeshDistanceMaterial",function(){return ga}),e.d(u,"MeshBasicMaterial",function(){return ao}),e.d(u,"MeshMatcapMaterial",function(){return vf}),e.d(u,"LineDashedMaterial",function(){return mf}),e.d(u,"LineBasicMaterial",function(){return pf}),e.d(u,"Material",function(){return Vr});for(var a="3.0.4",h=2455,r=[],i=0;i<256;i++)r[i]=(i<16?"0":"")+i.toString(16);var Mt={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(r[255&t]+r[t>>8&255]+r[t>>16&255]+r[t>>24&255]+"-"+r[255&n]+r[n>>8&255]+"-"+r[n>>16&15|64]+r[n>>24&255]+"-"+r[63&e|128]+r[e>>8&255]+"-"+r[e>>16&255]+r[e>>24&255]+r[255&i]+r[i>>8&255]+r[i>>16&255]+r[i>>24&255]).toUpperCase()},clamp:function(t,n,e){return Math.max(n,Math.min(e,t))},euclideanModulo:function(t,n){return(t%n+n)%n},mapLinear:function(t,n,e,i,r){return i+(t-n)*(r-i)/(e-n)},lerp:function(t,n,e){return(1-e)*t+e*n},smoothstep:function(t,n,e){return t<=n?0:e<=t?1:(t=(t-n)/(e-n))*t*(3-2*t)},smootherstep:function(t,n,e){return t<=n?0:e<=t?1:(t=(t-n)/(e-n))*t*t*(t*(6*t-15)+10)},randInt:function(t,n){return t+Math.floor(Math.random()*(n-t+1))},randFloat:function(t,n){return t+Math.random()*(n-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Mt.DEG2RAD},radToDeg:function(t){return t*Mt.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,n,e,i,r){var o=Math.cos,s=Math.sin,a=o(e/2),u=s(e/2),h=o((n+i)/2),c=s((n+i)/2),f=o((n-i)/2),e=s((n-i)/2),o=o((i-n)/2),n=s((i-n)/2);"XYX"===r?t.set(a*c,u*f,u*e,a*h):"YZY"===r?t.set(u*e,a*c,u*f,a*h):"ZXZ"===r?t.set(u*f,u*e,a*c,a*h):"XZX"===r?t.set(a*c,u*n,u*o,a*h):"YXY"===r?t.set(u*o,a*c,u*n,a*h):"ZYZ"===r?t.set(u*n,u*o,a*c,a*h):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function et(t,n,e,i){this.I=t||0,this.F=n||0,this.U=e||0,this.G=void 0!==i?i:1}Object.assign(et,{slerp:function(t,n,e,i){return e.copy(t).slerp(n,i)},slerpFlat:function(t,n,e,i,r,o,s){var a=e[i+0],u=e[i+1],h=e[i+2],c=e[i+3],f=r[o+0],l=r[o+1],d=r[o+2],v=r[o+3];c===v&&a===f&&u===l&&h===d||(e=1-s,r=0<=(i=a*f+u*l+h*d+c*v)?1:-1,(o=1-i*i)>Number.EPSILON&&(o=Math.sqrt(o),i=Math.atan2(o,i*r),e=Math.sin(e*i)/o,s=Math.sin(s*i)/o),a=a*e+f*(r=s*r),u=u*e+l*r,h=h*e+d*r,c=c*e+v*r,e===1-s&&(a*=s=1/Math.sqrt(a*a+u*u+h*h+c*c),u*=s,h*=s,c*=s)),t[n]=a,t[n+1]=u,t[n+2]=h,t[n+3]=c}}),Object.defineProperties(et.prototype,{x:{get:function(){return this.I},set:function(t){this.I=t,this.B()}},y:{get:function(){return this.F},set:function(t){this.F=t,this.B()}},z:{get:function(){return this.U},set:function(t){this.U=t,this.B()}},w:{get:function(){return this.G},set:function(t){this.G=t,this.B()}}}),Object.assign(et.prototype,{isQuaternion:!0,set:function(t,n,e,i){return this.I=t,this.F=n,this.U=e,this.G=i,this.B(),this},clone:function(){return new this.constructor(this.I,this.F,this.U,this.G)},copy:function(t){return this.I=t.x,this.F=t.y,this.U=t.z,this.G=t.w,this.B(),this},setFromEuler:function(t,n){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var e=t.I,i=t.F,r=t.U,o=t.order,s=Math.cos,a=Math.sin,u=s(e/2),t=s(i/2),s=s(r/2),e=a(e/2),i=a(i/2),r=a(r/2);return"XYZ"===o?(this.I=e*t*s+u*i*r,this.F=u*i*s-e*t*r,this.U=u*t*r+e*i*s,this.G=u*t*s-e*i*r):"YXZ"===o?(this.I=e*t*s+u*i*r,this.F=u*i*s-e*t*r,this.U=u*t*r-e*i*s,this.G=u*t*s+e*i*r):"ZXY"===o?(this.I=e*t*s-u*i*r,this.F=u*i*s+e*t*r,this.U=u*t*r+e*i*s,this.G=u*t*s-e*i*r):"ZYX"===o?(this.I=e*t*s-u*i*r,this.F=u*i*s+e*t*r,this.U=u*t*r-e*i*s,this.G=u*t*s+e*i*r):"YZX"===o?(this.I=e*t*s+u*i*r,this.F=u*i*s+e*t*r,this.U=u*t*r-e*i*s,this.G=u*t*s-e*i*r):"XZY"===o&&(this.I=e*t*s-u*i*r,this.F=u*i*s-e*t*r,this.U=u*t*r+e*i*s,this.G=u*t*s+e*i*r),!1!==n&&this.B(),this},setFromAxisAngle:function(t,n){var e=n/2,n=Math.sin(e);return this.I=t.x*n,this.F=t.y*n,this.U=t.z*n,this.G=Math.cos(e),this.B(),this},setFromRotationMatrix:function(t){var n,e=t.elements,i=e[0],r=e[4],o=e[8],s=e[1],a=e[5],u=e[9],h=e[2],c=e[6],t=e[10],e=i+a+t;return 0<e?(n=.5/Math.sqrt(e+1),this.G=.25/n,this.I=(c-u)*n,this.F=(o-h)*n,this.U=(s-r)*n):a<i&&t<i?(n=2*Math.sqrt(1+i-a-t),this.G=(c-u)/n,this.I=.25*n,this.F=(r+s)/n,this.U=(o+h)/n):t<a?(n=2*Math.sqrt(1+a-i-t),this.G=(o-h)/n,this.I=(r+s)/n,this.F=.25*n,this.U=(u+c)/n):(n=2*Math.sqrt(1+t-i-a),this.G=(s-r)/n,this.I=(o+h)/n,this.F=(u+c)/n,this.U=.25*n),this.B(),this},setFromUnitVectors:function(t,n){var e=t.dot(n)+1;return e<1e-6?(e=0,Math.abs(t.x)>Math.abs(t.z)?(this.I=-t.y,this.F=t.x,this.U=0):(this.I=0,this.F=-t.z,this.U=t.y)):(this.I=t.y*n.z-t.z*n.y,this.F=t.z*n.x-t.x*n.z,this.U=t.x*n.y-t.y*n.x),this.G=e,this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(Mt.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,n){var e=this.angleTo(t);if(0===e)return this;e=Math.min(1,n/e);return this.slerp(t,e),this},inverse:function(){return this.conjugate()},conjugate:function(){return this.I*=-1,this.F*=-1,this.U*=-1,this.B(),this},dot:function(t){return this.I*t.I+this.F*t.F+this.U*t.U+this.G*t.G},lengthSq:function(){return this.I*this.I+this.F*this.F+this.U*this.U+this.G*this.G},length:function(){return Math.sqrt(this.I*this.I+this.F*this.F+this.U*this.U+this.G*this.G)},normalize:function(){var t=this.length();return 0===t?(this.I=0,this.F=0,this.U=0,this.G=1):(this.I=this.I*(t=1/t),this.F=this.F*t,this.U=this.U*t,this.G=this.G*t),this.B(),this},multiply:function(t,n){return void 0!==n?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,n)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,n){var e=t.I,i=t.F,r=t.U,o=t.G,s=n.I,a=n.F,t=n.U,n=n.G;return this.I=e*n+o*s+i*t-r*a,this.F=i*n+o*a+r*s-e*t,this.U=r*n+o*t+e*a-i*s,this.G=o*n-e*s-i*a-r*t,this.B(),this},slerp:function(t,n){if(0===n)return this;if(1===n)return this.copy(t);var e=this.I,i=this.F,r=this.U,o=this.G,s=o*t.G+e*t.I+i*t.F+r*t.U;if(s<0?(this.G=-t.G,this.I=-t.I,this.F=-t.F,this.U=-t.U,s=-s):this.copy(t),1<=s)return this.G=o,this.I=e,this.F=i,this.U=r,this;t=1-s*s;if(t<=Number.EPSILON){var a=1-n;return this.G=a*o+n*this.G,this.I=a*e+n*this.I,this.F=a*i+n*this.F,this.U=a*r+n*this.U,this.normalize(),this.B(),this}a=Math.sqrt(t),t=Math.atan2(a,s),s=Math.sin((1-n)*t)/a,a=Math.sin(n*t)/a;return this.G=o*s+this.G*a,this.I=e*s+this.I*a,this.F=i*s+this.F*a,this.U=r*s+this.U*a,this.B(),this},equals:function(t){return t.I===this.I&&t.F===this.F&&t.U===this.U&&t.G===this.G},fromArray:function(t,n){return this.I=t[n=void 0===n?0:n],this.F=t[n+1],this.U=t[n+2],this.G=t[n+3],this.B(),this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.I,t[n+1]=this.F,t[n+2]=this.U,t[n+3]=this.G,t},fromBufferAttribute:function(t,n){return this.I=t.getX(n),this.F=t.getY(n),this.U=t.getZ(n),this.G=t.getW(n),this},H:function(t){return this.B=t,this},B:function(){}});var o=new Et,s=new et;function Et(t,n,e){this.x=t||0,this.y=n||0,this.z=e||0}Object.assign(Et.prototype,{isVector3:!0,set:function(t,n,e){return this.x=t,this.y=n,this.z=e,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,n)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this},addScaledVector:function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this},sub:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,n)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this},multiply:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,n)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(s.setFromEuler(t))},applyAxisAngle:function(t,n){return this.applyQuaternion(s.setFromAxisAngle(t,n))},applyMatrix3:function(t){var n=this.x,e=this.y,i=this.z,t=t.elements;return this.x=t[0]*n+t[3]*e+t[6]*i,this.y=t[1]*n+t[4]*e+t[7]*i,this.z=t[2]*n+t[5]*e+t[8]*i,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var n=this.x,e=this.y,i=this.z,r=t.elements,t=1/(r[3]*n+r[7]*e+r[11]*i+r[15]);return this.x=(r[0]*n+r[4]*e+r[8]*i+r[12])*t,this.y=(r[1]*n+r[5]*e+r[9]*i+r[13])*t,this.z=(r[2]*n+r[6]*e+r[10]*i+r[14])*t,this},applyQuaternion:function(t){var n=this.x,e=this.y,i=this.z,r=t.x,o=t.y,s=t.z,a=t.w,u=a*n+o*i-s*e,h=a*e+s*n-r*i,t=a*i+r*e-o*n,i=-r*n-o*e-s*i;return this.x=u*a+i*-r+h*-s-t*-o,this.y=h*a+i*-o+t*-r-u*-s,this.z=t*a+i*-s+u*-o-h*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var n=this.x,e=this.y,i=this.z,t=t.elements;return this.x=t[0]*n+t[4]*e+t[8]*i,this.y=t[1]*n+t[5]*e+t[9]*i,this.z=t[2]*n+t[6]*e+t[10]*i,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this},clampScalar:function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this},clampLength:function(t,n){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,e)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this},lerpVectors:function(t,n,e){return this.subVectors(n,t).multiplyScalar(e).add(t)},cross:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,n)):this.crossVectors(this,t)},crossVectors:function(t,n){var e=t.x,i=t.y,r=t.z,o=n.x,t=n.y,n=n.z;return this.x=i*n-r*t,this.y=r*o-e*n,this.z=e*t-i*o,this},projectOnVector:function(t){var n=t.lengthSq();if(0===n)return this.set(0,0,0);n=t.dot(this)/n;return this.copy(t).multiplyScalar(n)},projectOnPlane:function(t){return o.copy(this).projectOnVector(t),this.sub(o)},reflect:function(t){return this.sub(o.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var n=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===n)return Math.PI/2;n=this.dot(t)/n;return Math.acos(Mt.clamp(n,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var n=this.x-t.x,e=this.y-t.y,t=this.z-t.z;return n*n+e*e+t*t},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,n,e){var i=Math.sin(n)*t;return this.x=i*Math.sin(e),this.y=Math.cos(n)*t,this.z=i*Math.cos(e),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,n,e){return this.x=t*Math.sin(n),this.y=e,this.z=t*Math.cos(n),this},setFromMatrixPosition:function(t){t=t.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(t){var n=this.setFromMatrixColumn(t,0).length(),e=this.setFromMatrixColumn(t,1).length(),t=this.setFromMatrixColumn(t,2).length();return this.x=n,this.y=e,this.z=t,this},setFromMatrixColumn:function(t,n){return this.fromArray(t.elements,4*n)},setFromMatrix3Column:function(t,n){return this.fromArray(t.elements,3*n)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,n){return this.x=t[n=void 0===n?0:n],this.y=t[n+1],this.z=t[n+2],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t},fromBufferAttribute:function(t,n,e){return void 0!==e&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this}});var c=new Et,f=new St,l=new Et(0,0,0),d=new Et(1,1,1),v=new Et,p=new Et,m=new Et;function St(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function g(){}Object.assign(St.prototype,{isMatrix4:!0,set:function(t,n,e,i,r,o,s,a,u,h,c,f,l,d,v,p){var m=this.elements;return m[0]=t,m[4]=n,m[8]=e,m[12]=i,m[1]=r,m[5]=o,m[9]=s,m[13]=a,m[2]=u,m[6]=h,m[10]=c,m[14]=f,m[3]=l,m[7]=d,m[11]=v,m[15]=p,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new St).fromArray(this.elements)},copy:function(t){var n=this.elements,t=t.elements;return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],this},copyPosition:function(t){var n=this.elements,t=t.elements;return n[12]=t[12],n[13]=t[13],n[14]=t[14],this},extractBasis:function(t,n,e){return t.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),e.setFromMatrixColumn(this,2),this},makeBasis:function(t,n,e){return this.set(t.x,n.x,e.x,0,t.y,n.y,e.y,0,t.z,n.z,e.z,0,0,0,0,1),this},extractRotation:function(t){var n=this.elements,e=t.elements,i=1/c.setFromMatrixColumn(t,0).length(),r=1/c.setFromMatrixColumn(t,1).length(),t=1/c.setFromMatrixColumn(t,2).length();return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=0,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=0,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var n,e,i,r,o,s,a,u,h,c,f,l,d=this.elements,v=t.x,p=t.y,m=t.z,g=Math.cos(v),y=Math.sin(v),b=Math.cos(p),v=Math.sin(p),p=Math.cos(m),m=Math.sin(m);return"XYZ"===t.order?(o=g*p,s=g*m,a=y*p,u=y*m,d[0]=b*p,d[4]=-b*m,d[8]=v,d[1]=s+a*v,d[5]=o-u*v,d[9]=-y*b,d[2]=u-o*v,d[6]=a+s*v,d[10]=g*b):"YXZ"===t.order?(e=b*m,i=v*p,d[0]=(n=b*p)+(r=v*m)*y,d[4]=i*y-e,d[8]=g*v,d[1]=g*m,d[5]=g*p,d[9]=-y,d[2]=e*y-i,d[6]=r+n*y,d[10]=g*b):"ZXY"===t.order?(e=b*m,i=v*p,d[0]=(n=b*p)-(r=v*m)*y,d[4]=-g*m,d[8]=i+e*y,d[1]=e+i*y,d[5]=g*p,d[9]=r-n*y,d[2]=-g*v,d[6]=y,d[10]=g*b):"ZYX"===t.order?(o=g*p,s=g*m,a=y*p,u=y*m,d[0]=b*p,d[4]=a*v-s,d[8]=o*v+u,d[1]=b*m,d[5]=u*v+o,d[9]=s*v-a,d[2]=-v,d[6]=y*b,d[10]=g*b):"YZX"===t.order?(h=g*b,c=g*v,f=y*b,l=y*v,d[0]=b*p,d[4]=l-h*m,d[8]=f*m+c,d[1]=m,d[5]=g*p,d[9]=-y*p,d[2]=-v*p,d[6]=c*m+f,d[10]=h-l*m):"XZY"===t.order&&(h=g*b,c=g*v,f=y*b,l=y*v,d[0]=b*p,d[4]=-m,d[8]=v*p,d[1]=h*m+l,d[5]=g*p,d[9]=c*m-f,d[2]=f*m-c,d[6]=y*p,d[10]=l*m+h),d[3]=0,d[7]=0,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(l,t,d)},lookAt:function(t,n,e){var i=this.elements;return m.subVectors(t,n),0===m.lengthSq()&&(m.z=1),m.normalize(),v.crossVectors(e,m),0===v.lengthSq()&&(1===Math.abs(e.z)?m.x+=1e-4:m.z+=1e-4,m.normalize(),v.crossVectors(e,m)),v.normalize(),p.crossVectors(m,v),i[0]=v.x,i[4]=p.x,i[8]=m.x,i[1]=v.y,i[5]=p.y,i[9]=m.y,i[2]=v.z,i[6]=p.z,i[10]=m.z,this},multiply:function(t,n){return void 0!==n?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,n)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,n){var e=t.elements,i=n.elements,r=this.elements,o=e[0],s=e[4],a=e[8],u=e[12],h=e[1],c=e[5],f=e[9],l=e[13],d=e[2],v=e[6],p=e[10],m=e[14],g=e[3],y=e[7],b=e[11],_=e[15],w=i[0],x=i[4],M=i[8],E=i[12],S=i[1],T=i[5],L=i[9],O=i[13],R=i[2],A=i[6],C=i[10],k=i[14],t=i[3],n=i[7],e=i[11],i=i[15];return r[0]=o*w+s*S+a*R+u*t,r[4]=o*x+s*T+a*A+u*n,r[8]=o*M+s*L+a*C+u*e,r[12]=o*E+s*O+a*k+u*i,r[1]=h*w+c*S+f*R+l*t,r[5]=h*x+c*T+f*A+l*n,r[9]=h*M+c*L+f*C+l*e,r[13]=h*E+c*O+f*k+l*i,r[2]=d*w+v*S+p*R+m*t,r[6]=d*x+v*T+p*A+m*n,r[10]=d*M+v*L+p*C+m*e,r[14]=d*E+v*O+p*k+m*i,r[3]=g*w+y*S+b*R+_*t,r[7]=g*x+y*T+b*A+_*n,r[11]=g*M+y*L+b*C+_*e,r[15]=g*E+y*O+b*k+_*i,this},multiplyScalar:function(t){var n=this.elements;return n[0]*=t,n[4]*=t,n[8]*=t,n[12]*=t,n[1]*=t,n[5]*=t,n[9]*=t,n[13]*=t,n[2]*=t,n[6]*=t,n[10]*=t,n[14]*=t,n[3]*=t,n[7]*=t,n[11]*=t,n[15]*=t,this},determinant:function(){var t=this.elements,n=t[0],e=t[4],i=t[8],r=t[12],o=t[1],s=t[5],a=t[9],u=t[13],h=t[2],c=t[6],f=t[10],l=t[14];return t[3]*(+r*a*c-i*u*c-r*s*f+e*u*f+i*s*l-e*a*l)+t[7]*(+n*a*l-n*u*f+r*o*f-i*o*l+i*u*h-r*a*h)+t[11]*(+n*u*c-n*s*l-r*o*c+e*o*l+r*s*h-e*u*h)+t[15]*(-i*s*h-n*a*c+n*s*f+i*o*c-e*o*f+e*a*h)},transpose:function(){var t=this.elements,n=t[1];return t[1]=t[4],t[4]=n,n=t[2],t[2]=t[8],t[8]=n,n=t[6],t[6]=t[9],t[9]=n,n=t[3],t[3]=t[12],t[12]=n,n=t[7],t[7]=t[13],t[13]=n,n=t[11],t[11]=t[14],t[14]=n,this},setPosition:function(t,n,e){var i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=n,i[14]=e),this},getInverse:function(t,n){void 0!==n&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var e=this.elements,i=t.elements,r=i[0],o=i[1],s=i[2],a=i[3],u=i[4],h=i[5],c=i[6],f=i[7],l=i[8],d=i[9],v=i[10],p=i[11],m=i[12],g=i[13],y=i[14],b=i[15],_=d*y*f-g*v*f+g*c*p-h*y*p-d*c*b+h*v*b,w=m*v*f-l*y*f-m*c*p+u*y*p+l*c*b-u*v*b,n=l*g*f-m*d*f+m*h*p-u*g*p-l*h*b+u*d*b,t=m*d*c-l*g*c-m*h*v+u*g*v+l*h*y-u*d*y,i=r*_+o*w+s*n+a*t;if(0==i)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);i=1/i;return e[0]=_*i,e[1]=(g*v*a-d*y*a-g*s*p+o*y*p+d*s*b-o*v*b)*i,e[2]=(h*y*a-g*c*a+g*s*f-o*y*f-h*s*b+o*c*b)*i,e[3]=(d*c*a-h*v*a-d*s*f+o*v*f+h*s*p-o*c*p)*i,e[4]=w*i,e[5]=(l*y*a-m*v*a+m*s*p-r*y*p-l*s*b+r*v*b)*i,e[6]=(m*c*a-u*y*a-m*s*f+r*y*f+u*s*b-r*c*b)*i,e[7]=(u*v*a-l*c*a+l*s*f-r*v*f-u*s*p+r*c*p)*i,e[8]=n*i,e[9]=(m*d*a-l*g*a-m*o*p+r*g*p+l*o*b-r*d*b)*i,e[10]=(u*g*a-m*h*a+m*o*f-r*g*f-u*o*b+r*h*b)*i,e[11]=(l*h*a-u*d*a-l*o*f+r*d*f+u*o*p-r*h*p)*i,e[12]=t*i,e[13]=(l*g*s-m*d*s+m*o*v-r*g*v-l*o*y+r*d*y)*i,e[14]=(m*h*s-u*g*s-m*o*c+r*g*c+u*o*y-r*h*y)*i,e[15]=(u*d*s-l*h*s+l*o*c-r*d*c-u*o*v+r*h*v)*i,this},scale:function(t){var n=this.elements,e=t.x,i=t.y,t=t.z;return n[0]*=e,n[4]*=i,n[8]*=t,n[1]*=e,n[5]*=i,n[9]*=t,n[2]*=e,n[6]*=i,n[10]*=t,n[3]*=e,n[7]*=i,n[11]*=t,this},getMaxScaleOnAxis:function(){var t=this.elements,n=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],e=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(n,e,t))},makeTranslation:function(t,n,e){return this.set(1,0,0,t,0,1,0,n,0,0,1,e,0,0,0,1),this},makeRotationX:function(t){var n=Math.cos(t),t=Math.sin(t);return this.set(1,0,0,0,0,n,-t,0,0,t,n,0,0,0,0,1),this},makeRotationY:function(t){var n=Math.cos(t),t=Math.sin(t);return this.set(n,0,t,0,0,1,0,0,-t,0,n,0,0,0,0,1),this},makeRotationZ:function(t){var n=Math.cos(t),t=Math.sin(t);return this.set(n,-t,0,0,t,n,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,n){var e=Math.cos(n),i=Math.sin(n),r=1-e,o=t.x,s=t.y,a=t.z,n=r*o,t=r*s;return this.set(n*o+e,n*s-i*a,n*a+i*s,0,n*s+i*a,t*s+e,t*a-i*o,0,n*a-i*s,t*a+i*o,r*a*a+e,0,0,0,0,1),this},makeScale:function(t,n,e){return this.set(t,0,0,0,0,n,0,0,0,0,e,0,0,0,0,1),this},makeShear:function(t,n,e){return this.set(1,n,e,0,t,1,e,0,t,n,1,0,0,0,0,1),this},compose:function(t,n,e){var i=this.elements,r=n.I,o=n.F,s=n.U,a=n.G,u=r+r,h=o+o,c=s+s,f=r*u,l=r*h,d=r*c,n=o*h,r=o*c,o=s*c,s=a*u,u=a*h,h=a*c,a=e.x,c=e.y,e=e.z;return i[0]=(1-(n+o))*a,i[1]=(l+h)*a,i[2]=(d-u)*a,i[3]=0,i[4]=(l-h)*c,i[5]=(1-(f+o))*c,i[6]=(r+s)*c,i[7]=0,i[8]=(d+u)*e,i[9]=(r-s)*e,i[10]=(1-(f+n))*e,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},decompose:function(t,n,e){var i=this.elements,r=c.set(i[0],i[1],i[2]).length(),o=c.set(i[4],i[5],i[6]).length(),s=c.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],f.copy(this);var a=1/r,t=1/o,i=1/s;return f.elements[0]*=a,f.elements[1]*=a,f.elements[2]*=a,f.elements[4]*=t,f.elements[5]*=t,f.elements[6]*=t,f.elements[8]*=i,f.elements[9]*=i,f.elements[10]*=i,n.setFromRotationMatrix(f),e.x=r,e.y=o,e.z=s,this},makePerspective:function(t,n,e,i,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var s=this.elements,a=2*r/(e-i),u=(n+t)/(n-t),e=(e+i)/(e-i),i=-(o+r)/(o-r),o=-2*o*r/(o-r);return s[0]=2*r/(n-t),s[4]=0,s[8]=u,s[12]=0,s[1]=0,s[5]=a,s[9]=e,s[13]=0,s[2]=0,s[6]=0,s[10]=i,s[14]=o,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this},makeOrthographic:function(t,n,e,i,r,o){var s=this.elements,a=1/(n-t),u=1/(e-i),h=1/(o-r),t=(n+t)*a,i=(e+i)*u,r=(o+r)*h;return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-t,s[1]=0,s[5]=2*u,s[9]=0,s[13]=-i,s[2]=0,s[6]=0,s[10]=-2*h,s[14]=-r,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this},equals:function(t){for(var n=this.elements,e=t.elements,i=0;i<16;i++)if(n[i]!==e[i])return!1;return!0},fromArray:function(t,n){void 0===n&&(n=0);for(var e=0;e<16;e++)this.elements[e]=t[e+n];return this},toArray:function(t,n){var e=this.elements;return(t=void 0===t?[]:t)[n=void 0===n?0:n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t[n+4]=e[4],t[n+5]=e[5],t[n+6]=e[6],t[n+7]=e[7],t[n+8]=e[8],t[n+9]=e[9],t[n+10]=e[10],t[n+11]=e[11],t[n+12]=e[12],t[n+13]=e[13],t[n+14]=e[14],t[n+15]=e[15],t}}),Object.assign(g.prototype,{addEventListener:function(t,n){void 0===this.N&&(this.N={});var e=this.N;void 0===e[t]&&(e[t]=[]),-1===e[t].indexOf(n)&&e[t].push(n)},hasEventListener:function(t,n){if(void 0===this.N)return!1;var e=this.N;return void 0!==e[t]&&-1!==e[t].indexOf(n)},removeEventListener:function(t,n){void 0!==this.N&&(void 0===(t=this.N[t])||-1!==(n=t.indexOf(n))&&t.splice(n,1))},dispatchEvent:function(t){if(void 0!==this.N){var n=this.N[t.type];if(void 0!==n){t.target=this;for(var e=n.slice(0),i=0,r=e.length;i<r;i++)e[i].call(this,t)}}}});var y=new St,b=new et;function _(t,n,e,i){this.I=t||0,this.F=n||0,this.U=e||0,this.V=i||_.DefaultOrder}function w(){this.mask=1}function x(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}_.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],_.DefaultOrder="XYZ",Object.defineProperties(_.prototype,{x:{get:function(){return this.I},set:function(t){this.I=t,this.B()}},y:{get:function(){return this.F},set:function(t){this.F=t,this.B()}},z:{get:function(){return this.U},set:function(t){this.U=t,this.B()}},order:{get:function(){return this.V},set:function(t){this.V=t,this.B()}}}),Object.assign(_.prototype,{isEuler:!0,set:function(t,n,e,i){return this.I=t,this.F=n,this.U=e,this.V=i||this.V,this.B(),this},clone:function(){return new this.constructor(this.I,this.F,this.U,this.V)},copy:function(t){return this.I=t.I,this.F=t.F,this.U=t.U,this.V=t.V,this.B(),this},setFromRotationMatrix:function(t,n,e){var i=Mt.clamp,r=t.elements,o=r[0],s=r[4],a=r[8],u=r[1],h=r[5],c=r[9],f=r[2],t=r[6],r=r[10];return"XYZ"===(n=n||this.V)?(this.F=Math.asin(i(a,-1,1)),Math.abs(a)<.9999999?(this.I=Math.atan2(-c,r),this.U=Math.atan2(-s,o)):(this.I=Math.atan2(t,h),this.U=0)):"YXZ"===n?(this.I=Math.asin(-i(c,-1,1)),Math.abs(c)<.9999999?(this.F=Math.atan2(a,r),this.U=Math.atan2(u,h)):(this.F=Math.atan2(-f,o),this.U=0)):"ZXY"===n?(this.I=Math.asin(i(t,-1,1)),Math.abs(t)<.9999999?(this.F=Math.atan2(-f,r),this.U=Math.atan2(-s,h)):(this.F=0,this.U=Math.atan2(u,o))):"ZYX"===n?(this.F=Math.asin(-i(f,-1,1)),Math.abs(f)<.9999999?(this.I=Math.atan2(t,r),this.U=Math.atan2(u,o)):(this.I=0,this.U=Math.atan2(-s,h))):"YZX"===n?(this.U=Math.asin(i(u,-1,1)),Math.abs(u)<.9999999?(this.I=Math.atan2(-c,h),this.F=Math.atan2(-f,o)):(this.I=0,this.F=Math.atan2(a,r))):"XZY"===n?(this.U=Math.asin(-i(s,-1,1)),Math.abs(s)<.9999999?(this.I=Math.atan2(t,h),this.F=Math.atan2(a,o)):(this.I=Math.atan2(-c,r),this.F=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+n),this.V=n,!1!==e&&this.B(),this},setFromQuaternion:function(t,n,e){return y.makeRotationFromQuaternion(t),this.setFromRotationMatrix(y,n,e)},setFromVector3:function(t,n){return this.set(t.x,t.y,t.z,n||this.V)},reorder:function(t){return b.setFromEuler(this),this.setFromQuaternion(b,t)},equals:function(t){return t.I===this.I&&t.F===this.F&&t.U===this.U&&t.V===this.V},fromArray:function(t){return this.I=t[0],this.F=t[1],this.U=t[2],void 0!==t[3]&&(this.V=t[3]),this.B(),this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.I,t[n+1]=this.F,t[n+2]=this.U,t[n+3]=this.V,t},toVector3:function(t){return t?t.set(this.I,this.F,this.U):new Et(this.I,this.F,this.U)},H:function(t){return this.B=t,this},B:function(){}}),Object.assign(w.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},enableAll:function(){this.mask=-1},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},disableAll:function(){this.mask=0},test:function(t){return 0!=(this.mask&t.mask)}}),Object.assign(x.prototype,{isMatrix3:!0,set:function(t,n,e,i,r,o,s,a,u){var h=this.elements;return h[0]=t,h[1]=i,h[2]=s,h[3]=n,h[4]=r,h[5]=a,h[6]=e,h[7]=o,h[8]=u,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var n=this.elements,t=t.elements;return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],this},extractBasis:function(t,n,e){return t.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),e.setFromMatrix3Column(this,2),this},setFromMatrix4:function(t){t=t.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,n){var e=t.elements,i=n.elements,r=this.elements,o=e[0],s=e[3],a=e[6],u=e[1],h=e[4],c=e[7],f=e[2],l=e[5],d=e[8],v=i[0],p=i[3],m=i[6],g=i[1],y=i[4],t=i[7],n=i[2],e=i[5],i=i[8];return r[0]=o*v+s*g+a*n,r[3]=o*p+s*y+a*e,r[6]=o*m+s*t+a*i,r[1]=u*v+h*g+c*n,r[4]=u*p+h*y+c*e,r[7]=u*m+h*t+c*i,r[2]=f*v+l*g+d*n,r[5]=f*p+l*y+d*e,r[8]=f*m+l*t+d*i,this},multiplyScalar:function(t){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=t,n[4]*=t,n[7]*=t,n[2]*=t,n[5]*=t,n[8]*=t,this},determinant:function(){var t=this.elements,n=t[0],e=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],u=t[7],t=t[8];return n*o*t-n*s*u-e*r*t+e*s*a+i*r*u-i*o*a},getInverse:function(t,n){void 0!==n&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var e=t.elements,i=this.elements,r=e[0],o=e[1],s=e[2],a=e[3],u=e[4],h=e[5],c=e[6],f=e[7],l=e[8],d=l*u-h*f,n=h*c-l*a,t=f*a-u*c,e=r*d+o*n+s*t;if(0==e)return this.set(0,0,0,0,0,0,0,0,0);e=1/e;return i[0]=d*e,i[1]=(s*f-l*o)*e,i[2]=(h*o-s*u)*e,i[3]=n*e,i[4]=(l*r-s*c)*e,i[5]=(s*a-h*r)*e,i[6]=t*e,i[7]=(o*c-f*r)*e,i[8]=(u*r-o*a)*e,this},transpose:function(){var t=this.elements,n=t[1];return t[1]=t[3],t[3]=n,n=t[2],t[2]=t[6],t[6]=n,n=t[5],t[5]=t[7],t[7]=n,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var n=this.elements;return t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8],this},setUvTransform:function(t,n,e,i,r,o,s){var a=Math.cos(r),r=Math.sin(r);this.set(e*a,e*r,-e*(a*o+r*s)+o+t,-i*r,i*a,-i*(-r*o+a*s)+s+n,0,0,1)},scale:function(t,n){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=n,e[4]*=n,e[7]*=n,this},rotate:function(t){var n=Math.cos(t),e=Math.sin(t),i=this.elements,r=i[0],o=i[3],s=i[6],a=i[1],u=i[4],t=i[7];return i[0]=n*r+e*a,i[3]=n*o+e*u,i[6]=n*s+e*t,i[1]=-e*r+n*a,i[4]=-e*o+n*u,i[7]=-e*s+n*t,this},translate:function(t,n){var e=this.elements;return e[0]+=t*e[2],e[3]+=t*e[5],e[6]+=t*e[8],e[1]+=n*e[2],e[4]+=n*e[5],e[7]+=n*e[8],this},equals:function(t){for(var n=this.elements,e=t.elements,i=0;i<9;i++)if(n[i]!==e[i])return!1;return!0},fromArray:function(t,n){void 0===n&&(n=0);for(var e=0;e<9;e++)this.elements[e]=t[e+n];return this},toArray:function(t,n){var e=this.elements;return(t=void 0===t?[]:t)[n=void 0===n?0:n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t[n+4]=e[4],t[n+5]=e[5],t[n+6]=e[6],t[n+7]=e[7],t[n+8]=e[8],t}});var M=0,E=new Et,S=new et,T=new St,L=new Et,O=new Et,R=new Et,A=new et,C=new Et(1,0,0),k=new Et(0,1,0),P=new Et(0,0,1),D={type:"added"},j={type:"removed"};function Y(){Object.defineProperty(this,"id",{value:M++}),this.uuid=Mt.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Y.DefaultUp.clone();var t=new Et,n=new _,e=new et,i=new Et(1,1,1);n.H(function(){e.setFromEuler(n,!1)}),e.H(function(){n.setFromQuaternion(e,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:e},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new St},normalMatrix:{value:new x}}),this.matrix=new St,this.matrixWorld=new St,this.matrixAutoUpdate=Y.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new w,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function N(){Y.call(this),this.type="Camera",this.matrixWorldInverse=new St,this.projectionMatrix=new St,this.projectionMatrixInverse=new St}function Z(t,n,e,i){N.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==e?e:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==n?n:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function q(t,n,e,i,r,o){N.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==n?n:1,this.top=void 0!==e?e:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}Y.DefaultUp=new Et(0,1,0),Y.DefaultMatrixAutoUpdate=!0,Y.prototype=Object.assign(Object.create(g.prototype),{constructor:Y,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,n){this.quaternion.setFromAxisAngle(t,n)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,n){return S.setFromAxisAngle(t,n),this.quaternion.multiply(S),this},rotateOnWorldAxis:function(t,n){return S.setFromAxisAngle(t,n),this.quaternion.premultiply(S),this},rotateX:function(t){return this.rotateOnAxis(C,t)},rotateY:function(t){return this.rotateOnAxis(k,t)},rotateZ:function(t){return this.rotateOnAxis(P,t)},translateOnAxis:function(t,n){return E.copy(t).applyQuaternion(this.quaternion),this.position.add(E.multiplyScalar(n)),this},translateX:function(t){return this.translateOnAxis(C,t)},translateY:function(t){return this.translateOnAxis(k,t)},translateZ:function(t){return this.translateOnAxis(P,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(T.getInverse(this.matrixWorld))},lookAt:function(t,n,e){t.isVector3?L.copy(t):L.set(t,n,e);e=this.parent;this.updateWorldMatrix(!0,!1),O.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?T.lookAt(O,L,this.up):T.lookAt(L,O,this.up),this.quaternion.setFromRotationMatrix(T),e&&(T.extractRotation(e.matrixWorld),S.setFromRotationMatrix(T),this.quaternion.premultiply(S.inverse()))},add:function(t){if(1<arguments.length){for(var n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return t===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),(t.parent=this).children.push(t),t.dispatchEvent(D)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this},remove:function(t){if(1<arguments.length){for(var n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}var e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(j)),this},attach:function(t){return this.updateWorldMatrix(!0,!1),T.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),T.multiply(t.parent.matrixWorld)),t.applyMatrix4(T),t.updateWorldMatrix(!1,!1),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,n){if(this[t]===n)return this;for(var e=0,i=this.children.length;e<i;e++){var r=this.children[e].getObjectByProperty(t,n);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new Et),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new et),this.updateMatrixWorld(!0),this.matrixWorld.decompose(O,t,R),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new Et),this.updateMatrixWorld(!0),this.matrixWorld.decompose(O,A,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new Et),this.updateMatrixWorld(!0);var n=this.matrixWorld.elements;return t.set(n[8],n[9],n[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var n=this.children,e=0,i=n.length;e<i;e++)n[e].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var n=this.children,e=0,i=n.length;e<i;e++)n[e].traverseVisible(t)}},traverseAncestors:function(t){var n=this.parent;null!==n&&(t(n),n.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t=!(this.matrixWorldNeedsUpdate=!1));for(var n=this.children,e=0,i=n.length;e<i;e++)n[e].updateMatrixWorld(t)},updateWorldMatrix:function(t,n){var e=this.parent;if(!0===t&&null!==e&&e.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===n)for(var i=this.children,r=0,o=i.length;r<o;r++)i[r].updateWorldMatrix(!1,!0)},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,n){if(void 0===n&&(n=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===n)for(var e=0;e<t.children.length;e++){var i=t.children[e];this.add(i.clone())}return this}}),N.prototype=Object.assign(Object.create(Y.prototype),{constructor:N,isCamera:!0,copy:function(t,n){return Y.prototype.copy.call(this,t,n),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new Et),this.updateMatrixWorld(!0);var n=this.matrixWorld.elements;return t.set(-n[8],-n[9],-n[10]).normalize()},updateMatrixWorld:function(t){Y.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,n){Y.prototype.updateWorldMatrix.call(this,t,n),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Z.prototype=Object.assign(Object.create(N.prototype),{constructor:Z,isPerspectiveCamera:!0,copy:function(t,n){return N.prototype.copy.call(this,t,n),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){t=.5*this.getFilmHeight()/t;this.fov=2*Mt.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Mt.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Mt.RAD2DEG*Math.atan(Math.tan(.5*Mt.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,n,e,i,r,o){this.aspect=t/n,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=e,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t,n=this.near,e=n*Math.tan(.5*Mt.DEG2RAD*this.fov)/this.zoom,i=2*e,r=this.aspect*i,o=-.5*r,s=this.view;null!==this.view&&this.view.enabled&&(t=s.fullWidth,a=s.fullHeight,o+=s.offsetX*r/t,e-=s.offsetY*i/a,r*=s.width/t,i*=s.height/a);var a=this.filmOffset;0!==a&&(o+=n*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+r,e,e-i,n,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)}}),q.prototype=Object.assign(Object.create(N.prototype),{constructor:q,isOrthographicCamera:!0,copy:function(t,n){return N.prototype.copy.call(this,t,n),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,n,e,i,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=e,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),e=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=e-t,o=e+t,e=i+n,t=i-n;null!==this.view&&this.view.enabled&&(i=(this.right-this.left)/this.view.fullWidth/this.zoom,n=(this.top-this.bottom)/this.view.fullHeight/this.zoom,o=(r+=i*this.view.offsetX)+i*this.view.width,t=(e-=n*this.view.offsetY)-n*this.view.height),this.projectionMatrix.makeOrthographic(r,o,e,t,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)}});var I=[new Et,new Et,new Et,new Et,new Et,new Et,new Et,new Et],F=new Et,U=new $,G=new Et,B=new Et,H=new Et,V=new Et,z=new Et,W=new Et,X=new Et,K=new Et,J=new Et,Q=new Et;function $(t,n){this.min=void 0!==t?t:new Et(1/0,1/0,1/0),this.max=void 0!==n?n:new Et(-1/0,-1/0,-1/0)}function tt(t,n,e,i,r){for(var o=0,s=t.length-3;o<=s;o+=3){Q.fromArray(t,o);var a=r.x*Math.abs(Q.x)+r.y*Math.abs(Q.y)+r.z*Math.abs(Q.z),u=n.dot(Q),h=e.dot(Q),c=i.dot(Q);if(Math.max(-Math.max(u,h,c),Math.min(u,h,c))>a)return!1}return!0}Object.assign($.prototype,{isBox3:!0,set:function(t,n){return this.min.copy(t),this.max.copy(n),this},setFromArray:function(t){for(var n=1/0,e=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0,a=0,u=t.length;a<u;a+=3){var h=t[a],c=t[a+1],f=t[a+2];h<n&&(n=h),c<e&&(e=c),f<i&&(i=f),r<h&&(r=h),o<c&&(o=c),s<f&&(s=f)}return this.min.set(n,e,i),this.max.set(r,o,s),this},setFromBufferAttribute:function(t){for(var n=1/0,e=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0,a=0,u=t.count;a<u;a++){var h=t.getX(a),c=t.getY(a),f=t.getZ(a);h<n&&(n=h),c<e&&(e=c),f<i&&(i=f),r<h&&(r=h),o<c&&(o=c),s<f&&(s=f)}return this.min.set(n,e,i),this.max.set(r,o,s),this},setFromPoints:function(t){this.makeEmpty();for(var n=0,e=t.length;n<e;n++)this.expandByPoint(t[n]);return this},setFromCenterAndSize:function(t,n){n=F.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new Et),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new Et),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(t){t.updateWorldMatrix(!1,!1);var n=t.geometry;void 0!==n&&(null===n.boundingBox&&n.computeBoundingBox(),U.copy(n.boundingBox),U.applyMatrix4(t.matrixWorld),this.union(U));for(var e=t.children,i=0,r=e.length;i<r;i++)this.expandByObject(e[i]);return this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,n){return void 0===n&&(console.warn("THREE.Box3: .getParameter() target is now required"),n=new Et),n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,F),F.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var n,e=0<t.normal.x?(n=t.normal.x*this.min.x,t.normal.x*this.max.x):(n=t.normal.x*this.max.x,t.normal.x*this.min.x);return 0<t.normal.y?(n+=t.normal.y*this.min.y,e+=t.normal.y*this.max.y):(n+=t.normal.y*this.max.y,e+=t.normal.y*this.min.y),0<t.normal.z?(n+=t.normal.z*this.min.z,e+=t.normal.z*this.max.z):(n+=t.normal.z*this.max.z,e+=t.normal.z*this.min.z),n<=-t.constant&&e>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(X),K.subVectors(this.max,X),G.subVectors(t.a,X),B.subVectors(t.b,X),H.subVectors(t.c,X),V.subVectors(B,G),z.subVectors(H,B),W.subVectors(G,H);t=[0,-V.z,V.y,0,-z.z,z.y,0,-W.z,W.y,V.z,0,-V.x,z.z,0,-z.x,W.z,0,-W.x,-V.y,V.x,0,-z.y,z.x,0,-W.y,W.x,0];return!!tt(t,G,B,H,K)&&(!!tt(t=[1,0,0,0,1,0,0,0,1],G,B,H,K)&&(J.crossVectors(V,z),tt(t=[J.x,J.y,J.z],G,B,H,K)))},clampPoint:function(t,n){return void 0===n&&(console.warn("THREE.Box3: .clampPoint() target is now required"),n=new Et),n.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return F.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(F).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()||(I[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),I[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),I[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),I[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),I[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),I[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),I[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),I[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(I)),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var nt=new $;function it(t,n){this.center=void 0!==t?t:new Et,this.radius=void 0!==n?n:0}Object.assign(it.prototype,{set:function(t,n){return this.center.copy(t),this.radius=n,this},setFromPoints:function(t,n){var e=this.center;void 0!==n?e.copy(n):nt.setFromPoints(t).getCenter(e);for(var i=0,r=0,o=t.length;r<o;r++)i=Math.max(i,e.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var n=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=n*n},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,n){var e=this.center.distanceToSquared(t);return void 0===n&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),n=new Et),n.copy(t),e>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new $),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}});var rt=0,ot=1,st=2,at=0,ut=1,ht=2,ct=3,ft=0,lt=1,dt=2,vt=1,pt=2,mt=3,gt=0,Tt=1,yt=2,bt=0,_t=1,wt=2,xt=3,Lt=4,Ot=5,Rt=100,At=101,Ct=102,kt=103,Pt=104,Dt=200,jt=201,Nt=202,It=203,Ft=204,Ut=205,Gt=206,Bt=207,Ht=208,Vt=209,zt=210,Wt=0,Xt=1,Yt=2,Zt=3,qt=4,Kt=5,Jt=6,Qt=7,$t=0,tn=1,nn=2,en=0,rn=1,on=2,sn=3,an=4,un=5,hn=301,cn=302,fn=303,ln=304,dn=305,vn=306,pn=307,mn=1e3,gn=1001,yn=1002,bn=1003,_n=1004,wn=1005,xn=1006,Mn=1007,En=1008,Sn=1009,Tn=1010,Ln=1011,On=1012,Rn=1013,An=1014,Cn=1015,kn=1016,Pn=1017,Dn=1018,jn=1019,Nn=1020,In=1021,Fn=1022,Un=1023,Gn=1024,Bn=1025,Hn=1026,Vn=1027,zn=1028,Wn=1029,Xn=1030,Yn=1031,Zn=1032,qn=1033,Kn=33776,Jn=33777,Qn=33778,$n=33779,te=35840,ne=35841,ee=35842,ie=35843,re=36196,oe=37492,se=37496,ae=37808,ue=37809,he=37810,ce=37811,fe=37812,le=37813,de=37814,ve=37815,pe=37816,me=37817,ge=37818,ye=37819,be=37820,_e=37821,we=36492,xe=37840,Me=37841,Ee=37842,Se=37843,Te=37844,Le=37845,Oe=37846,Re=37847,Ae=37848,Ce=37849,ke=37850,Pe=37851,De=37852,je=37853,Ne=2300,Ie=2301,Fe=2400,Ue=2401,Ge=2,Be=3e3,He=3001,Ve=3007,ze=3002,We=3003,Xe=3004,Ye=3005,Ze=3006,qe=3200,Ke=3201,Je=0,Qe=1,$e=7680,ti=519,ni=35044;function ei(t,n,e){return this.radius=void 0!==t?t:1,this.phi=void 0!==n?n:0,this.theta=void 0!==e?e:0,this}function ii(t,n){this.x=t||0,this.y=n||0}Object.assign(ei.prototype,{set:function(t,n,e){return this.radius=t,this.phi=n,this.theta=e,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,n,e){return this.radius=Math.sqrt(t*t+n*n+e*e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,e),this.phi=Math.acos(Mt.clamp(n/this.radius,-1,1))),this}}),Object.defineProperties(ii.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(ii.prototype,{isVector2:!0,set:function(t,n){return this.x=t,this.y=n,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,n){return void 0!==n?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,n)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this},addScaledVector:function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this},sub:function(t,n){return void 0!==n?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,n)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var n=this.x,e=this.y,t=t.elements;return this.x=t[0]*n+t[3]*e+t[6],this.y=t[1]*n+t[4]*e+t[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this},clampScalar:function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this},clampLength:function(t,n){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,e)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){return Math.atan2(-this.y,-this.x)+Math.PI},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var n=this.x-t.x,t=this.y-t.y;return n*n+t*t},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this},lerpVectors:function(t,n,e){return this.subVectors(n,t).multiplyScalar(e).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,n){return this.x=t[n=void 0===n?0:n],this.y=t[n+1],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.x,t[n+1]=this.y,t},fromBufferAttribute:function(t,n,e){return void 0!==e&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(n),this.y=t.getY(n),this},rotateAround:function(t,n){var e=Math.cos(n),i=Math.sin(n),r=this.x-t.x,n=this.y-t.y;return this.x=r*e-n*i+t.x,this.y=r*i+n*e+t.y,this}});var ri=new Et,oi=new Et,si=new x;function ai(t,n){this.normal=void 0!==t?t:new Et(1,0,0),this.constant=void 0!==n?n:0}Object.assign(ai.prototype,{isPlane:!0,set:function(t,n){return this.normal.copy(t),this.constant=n,this},setComponents:function(t,n,e,i){return this.normal.set(t,n,e),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,n){return this.normal.copy(t),this.constant=-n.dot(this.normal),this},setFromCoplanarPoints:function(t,n,e){n=ri.subVectors(e,n).cross(oi.subVectors(t,n)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,n){return void 0===n&&(console.warn("THREE.Plane: .projectPoint() target is now required"),n=new Et),n.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,n){void 0===n&&(console.warn("THREE.Plane: .intersectLine() target is now required"),n=new Et);var e=t.delta(ri),i=this.normal.dot(e);if(0===i)return 0===this.distanceToPoint(t.start)?n.copy(t.start):void 0;i=-(t.start.dot(this.normal)+this.constant)/i;return i<0||1<i?void 0:n.copy(e).multiplyScalar(i).add(t.start)},intersectsLine:function(t){var n=this.distanceToPoint(t.start),t=this.distanceToPoint(t.end);return n<0&&0<t||t<0&&0<n},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new Et),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,n){n=n||si.getNormalMatrix(t),t=this.coplanarPoint(ri).applyMatrix4(t),n=this.normal.applyMatrix3(n).normalize();return this.constant=-t.dot(n),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});var ui=new it,hi=new Et;function ci(t,n,e,i,r,o){this.planes=[void 0!==t?t:new ai,void 0!==n?n:new ai,void 0!==e?e:new ai,void 0!==i?i:new ai,void 0!==r?r:new ai,void 0!==o?o:new ai]}Object.assign(ci.prototype,{set:function(t,n,e,i,r,o){var s=this.planes;return s[0].copy(t),s[1].copy(n),s[2].copy(e),s[3].copy(i),s[4].copy(r),s[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var n=this.planes,e=0;e<6;e++)n[e].copy(t.planes[e]);return this},setFromProjectionMatrix:function(t){var n=this.planes,e=t.elements,i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=e[9],d=e[10],v=e[11],p=e[12],m=e[13],t=e[14],e=e[15];return n[0].setComponents(s-i,c-a,v-f,e-p).normalize(),n[1].setComponents(s+i,c+a,v+f,e+p).normalize(),n[2].setComponents(s+r,c+u,v+l,e+m).normalize(),n[3].setComponents(s-r,c-u,v-l,e-m).normalize(),n[4].setComponents(s-o,c-h,v-d,e-t).normalize(),n[5].setComponents(s+o,c+h,v+d,e+t).normalize(),this},intersectsObject:function(t){var n=t.geometry;return null===n.boundingSphere&&n.computeBoundingSphere(),ui.copy(n.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(ui)},intersectsSprite:function(t){return ui.center.set(0,0,0),ui.radius=.7071067811865476,ui.applyMatrix4(t.matrixWorld),this.intersectsSphere(ui)},intersectsSphere:function(t){for(var n=this.planes,e=t.center,i=-t.radius,r=0;r<6;r++)if(n[r].distanceToPoint(e)<i)return!1;return!0},intersectsBox:function(t){for(var n=this.planes,e=0;e<6;e++){var i=n[e];if(hi.x=(0<i.normal.x?t.max:t.min).x,hi.y=(0<i.normal.y?t.max:t.min).y,hi.z=(0<i.normal.z?t.max:t.min).z,i.distanceToPoint(hi)<0)return!1}return!0},containsPoint:function(t){for(var n=this.planes,e=0;e<6;e++)if(n[e].distanceToPoint(t)<0)return!1;return!0}});function fi(t,n){var i,r,o,s,a;void 0===n&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),n===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.domElement=n,this.enabled=!0,this.useRange=!1,this.target=new Et,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:rt,MIDDLE:ot,RIGHT:st},this.touches={ONE:at,TWO:ht},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.enableRotate=!0,this.enableRotateLeft=!0,this.enableRotateUp=!0,this.rotateLeftStart=new ii,this.rotateLeftEnd=new ii,this.getPolarAngle=function(){return v.phi},this.getAzimuthalAngle=function(){return v.theta},this.panAdd=function(t){g.add(t)},this.saveState=function(){u.target0.copy(u.target),u.position0.copy(u.object.position),u.zoom0=u.object.zoom},this.reset=function(){u.target.copy(u.target0),u.object.position.copy(u.position0),u.object.zoom=u.zoom0,u.object.updateProjectionMatrix(),u.dispatchEvent(h),u.update(),l=f.NONE},this.update=(i=new Et,r=(new et).setFromUnitVectors(t.up,new Et(0,1,0)),o=r.clone().inverse(),s=new Et,a=new et,function(t){var n,e=u.object.position;return i.copy(e).sub(u.target),i.applyQuaternion(r),v.setFromVector3(i),u.autoRotate&&l===f.NONE&&R(2*Math.PI/60/60*u.autoRotateSpeed),u.enableDamping?(v.theta+=p.theta*u.dampingFactor,v.phi+=p.phi*u.dampingFactor):(v.theta+=p.theta,v.phi+=p.phi),v.theta=Math.max(u.minAzimuthAngle,Math.min(u.maxAzimuthAngle,v.theta)),t&&void 0!==t.theta&&(v.theta=Math.max(u.minAzimuthAngle,Math.min(u.maxAzimuthAngle,t.theta))),v.phi=Math.max(u.minPolarAngle,Math.min(u.maxPolarAngle,v.phi)),t&&void 0!==t.phi&&(v.phi=Math.max(u.minPolarAngle,Math.min(u.maxPolarAngle,t.phi))),v.makeSafe(),v.radius*=m,v.radius=Math.max(u.minDistance,Math.min(u.maxDistance,v.radius)),this.useRange?((n=(new Et).setFromMatrixPosition(u.object.matrixWorld)).add(g),n=(new St).copy(u.object.matrixWorld).setPosition(n),n=(new St).getInverse(n),(new ci).setFromProjectionMatrix((new St).multiplyMatrices(u.object.projectionMatrix,n)).intersectsSphere(u.viewSphere)&&u.target.add(g)):!0===u.enableDamping?u.target.addScaledVector(g,u.dampingFactor):u.target.add(g),i.setFromSpherical(v),i.applyQuaternion(o),t&&t.offset&&i.add(t.offset),this.useRange?((t=(new Et).setFromMatrixPosition(u.object.matrixWorld)).add(i),t=(new St).copy(u.object.matrixWorld).setPosition(t),t=(new St).getInverse(t),(new ci).setFromProjectionMatrix((new St).multiplyMatrices(u.object.projectionMatrix,t)).intersectsSphere(u.viewSphere)&&e.copy(u.target).add(i)):e.copy(u.target).add(i),u.object.lookAt(u.target),!0===u.enableDamping?(p.theta*=1-u.dampingFactor,p.phi*=1-u.dampingFactor,g.multiplyScalar(1-u.dampingFactor)):(p.set(0,0,0),g.set(0,0,0)),m=1,!!(y||s.distanceToSquared(u.object.position)>d||8*(1-a.dot(u.object.quaternion))>d)&&(u.dispatchEvent(h),s.copy(u.object.position),a.copy(u.object.quaternion),!(y=!1))}),this.dispose=function(){u.domElement.removeEventListener("contextmenu",nt,!1),u.domElement.removeEventListener("mousedown",Y,!1),u.domElement.removeEventListener("wheel",K,!1),u.domElement.removeEventListener("touchstart",Q,!1),u.domElement.removeEventListener("touchend",tt,!1),u.domElement.removeEventListener("touchmove",$,!1),document.removeEventListener("mousemove",Z,!1),document.removeEventListener("mouseup",q,!1),u.domElement.removeEventListener("keydown",J,!1)};var u=this,h={type:"change"},e={type:"start"},c={type:"end"},f={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},l=f.NONE,d=1e-6,v=new ei,p=new ei,m=1,g=new Et,y=!1,b=new ii,_=new ii,w=new ii,x=new ii,M=new ii,E=new ii,S=new ii,T=new ii,L=new ii;function O(){return Math.pow(.95,u.zoomSpeed)}function R(t){u.enableRotateLeft&&(p.theta-=t)}function A(t){u.enableRotateUp&&(p.phi-=t)}var C,k,P=(C=new Et,function(t,n){C.setFromMatrixColumn(n,0),C.multiplyScalar(-t),g.add(C)}),D=(k=new Et,function(t,n){!0===u.screenSpacePanning?k.setFromMatrixColumn(n,1):(k.setFromMatrixColumn(n,0),k.crossVectors(u.object.up,k)),k.multiplyScalar(t),g.add(k)});this.panUp=function(t){var n=new Et(0,1,0);n.multiplyScalar(t),g.add(n)};var j,N=(j=new Et,function(t,n){var e,i=u.domElement;u.object.isPerspectiveCamera?(e=u.object.position,j.copy(e).sub(u.target),e=j.length(),e*=Math.tan(u.object.fov/2*Math.PI/180),P(2*t*e/i.clientHeight,u.object.matrix),D(2*n*e/i.clientHeight,u.object.matrix)):u.object.isOrthographicCamera?(P(t*(u.object.right-u.object.left)/u.object.zoom/i.clientWidth,u.object.matrix),D(n*(u.object.top-u.object.bottom)/u.object.zoom/i.clientHeight,u.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),u.enablePan=!1)});function I(t){u.object.isPerspectiveCamera?m/=t:u.object.isOrthographicCamera?(u.object.zoom=Math.max(u.minZoom,Math.min(u.maxZoom,u.object.zoom*t)),u.object.updateProjectionMatrix(),y=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),u.enableZoom=!1)}function F(t){u.object.isPerspectiveCamera?m*=t:u.object.isOrthographicCamera?(u.object.zoom=Math.max(u.minZoom,Math.min(u.maxZoom,u.object.zoom/t)),u.object.updateProjectionMatrix(),y=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),u.enableZoom=!1)}function U(t){b.set(t.clientX,t.clientY)}function G(t){x.set(t.clientX,t.clientY)}function B(t){var n,e;1==t.touches.length?b.set(t.touches[0].pageX,t.touches[0].pageY):(n=.5*(t.touches[0].pageX+t.touches[1].pageX),e=.5*(t.touches[0].pageY+t.touches[1].pageY),b.set(n,e),e=t.touches[0].pageX-t.touches[1].pageX,t=t.touches[0].pageY-t.touches[1].pageY,u.rotateLeftStart.set(e,t))}function H(t){var n;1==t.touches.length?x.set(t.touches[0].pageX,t.touches[0].pageY):(n=.5*(t.touches[0].pageX+t.touches[1].pageX),t=.5*(t.touches[0].pageY+t.touches[1].pageY),x.set(n,t))}function V(t){var n=t.touches[0].pageX-t.touches[1].pageX,t=t.touches[0].pageY-t.touches[1].pageY,t=Math.sqrt(n*n+t*t);S.set(0,t)}function z(t){var n;1==t.touches.length?_.set(t.touches[0].pageX,t.touches[0].pageY):(n=.5*(t.touches[0].pageX+t.touches[1].pageX),e=.5*(t.touches[0].pageY+t.touches[1].pageY),_.set(n,e),n=t.touches[0].pageX-t.touches[1].pageX,e=t.touches[0].pageY-t.touches[1].pageY,u.rotateLeftEnd.set(n,e),e=u.rotateLeftStart.angle(),R((-u.rotateLeftEnd.angle()+e)*u.rotateSpeed),u.rotateLeftStart.copy(u.rotateLeftEnd)),w.subVectors(_,b).multiplyScalar(u.rotateSpeed);var e=u.domElement;A(2*Math.PI*w.y/e.clientHeight),b.copy(_)}function W(t){var n;1==t.touches.length?M.set(t.touches[0].pageX,t.touches[0].pageY):(n=.5*(t.touches[0].pageX+t.touches[1].pageX),t=.5*(t.touches[0].pageY+t.touches[1].pageY),M.set(n,t)),E.subVectors(M,x).multiplyScalar(u.panSpeed),N(E.x,E.y),x.copy(M)}function X(t){var n=t.touches[0].pageX-t.touches[1].pageX,t=t.touches[0].pageY-t.touches[1].pageY,t=Math.sqrt(n*n+t*t);T.set(0,t),L.set(0,Math.pow(T.y/S.y,u.zoomSpeed)),I(L.y),S.copy(T)}function Y(t){if(!1!==u.enabled){switch(t.preventDefault(),(u.domElement.focus?u.domElement:window).focus(),t.button){case 0:switch(u.mouseButtons.LEFT){case rt:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===u.enablePan)return;G(t),l=f.PAN}else{if(!1===u.enableRotate)return;U(t),l=f.ROTATE}break;case st:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===u.enableRotate)return;U(t),l=f.ROTATE}else{if(!1===u.enablePan)return;G(t),l=f.PAN}break;default:l=f.NONE}break;case 1:if(u.mouseButtons.MIDDLE===ot){if(!1===u.enableZoom)return;n=t,S.set(n.clientX,n.clientY),l=f.DOLLY}else l=f.NONE;break;case 2:switch(u.mouseButtons.RIGHT){case rt:if(!1===u.enableRotate)return;U(t),l=f.ROTATE;break;case st:if(!1===u.enablePan)return;G(t),l=f.PAN;break;default:l=f.NONE}}var n;l!==f.NONE&&(document.addEventListener("mousemove",Z,!1),document.addEventListener("mouseup",q,!1),u.dispatchEvent(e))}}function Z(t){var n,e;if(!1!==u.enabled)switch(t.preventDefault(),l){case f.ROTATE:if(!1===u.enableRotate)return;e=t,_.set(e.clientX,e.clientY),w.subVectors(_,b).multiplyScalar(u.rotateSpeed),e=u.domElement,R(2*Math.PI*w.x/e.clientHeight),A(2*Math.PI*w.y/e.clientHeight),b.copy(_),u.update();break;case f.DOLLY:if(!1===u.enableZoom)return;n=t,T.set(n.clientX,n.clientY),L.subVectors(T,S),0<L.y?I(O()):L.y<0&&F(O()),S.copy(T),u.update();break;case f.PAN:if(!1===u.enablePan)return;n=t,M.set(n.clientX,n.clientY),E.subVectors(M,x).multiplyScalar(u.panSpeed),N(E.x,E.y),x.copy(M),u.update()}}function q(t){!1!==u.enabled&&(document.removeEventListener("mousemove",Z,!1),document.removeEventListener("mouseup",q,!1),u.dispatchEvent(c),l=f.NONE)}function K(t){!1===u.enabled||!1===u.enableZoom||l!==f.NONE&&l!==f.ROTATE||(t.preventDefault(),t.stopPropagation(),u.dispatchEvent(e),(t=t).deltaY<0?F(O()):0<t.deltaY&&I(O()),u.update(),u.dispatchEvent(c))}function J(t){!1!==u.enabled&&!1!==u.enableKeys&&!1!==u.enablePan&&function(t){var n=!1;switch(t.keyCode){case u.keys.UP:N(0,u.keyPanSpeed),n=!0;break;case u.keys.BOTTOM:N(0,-u.keyPanSpeed),n=!0;break;case u.keys.LEFT:N(u.keyPanSpeed,0),n=!0;break;case u.keys.RIGHT:N(-u.keyPanSpeed,0),n=!0}n&&(t.preventDefault(),u.update())}(t)}function Q(t){if(!1!==u.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(u.touches.ONE){case at:if(!1===u.enableRotate)return;B(t),l=f.TOUCH_ROTATE;break;case ut:if(!1===u.enablePan)return;H(t),l=f.TOUCH_PAN;break;default:l=f.NONE}break;case 2:switch(u.touches.TWO){case ht:if(!1===u.enableZoom&&!1===u.enablePan)return;n=t,u.enableZoom&&V(n),u.enablePan&&H(n),l=f.TOUCH_DOLLY_PAN;break;case ct:if(!1===u.enableZoom&&!1===u.enableRotate)return;n=t,u.enableZoom&&V(n),u.enableRotate&&B(n),l=f.TOUCH_DOLLY_ROTATE;break;default:l=f.NONE}break;default:l=f.NONE}var n;l!==f.NONE&&u.dispatchEvent(e)}}function $(t){var n;if(!1!==u.enabled)switch(t.preventDefault(),t.stopPropagation(),l){case f.TOUCH_ROTATE:if(!1===u.enableRotate)return;z(t),u.update();break;case f.TOUCH_PAN:if(!1===u.enablePan)return;W(t),u.update();break;case f.TOUCH_DOLLY_PAN:if(!1===u.enableZoom&&!1===u.enablePan)return;n=t,u.enableZoom&&X(n),u.enablePan&&W(n),u.update();break;case f.TOUCH_DOLLY_ROTATE:if(!1===u.enableZoom&&!1===u.enableRotate)return;n=t,u.enableZoom&&X(n),u.enableRotate&&z(n),u.update();break;default:l=f.NONE}}function tt(t){!1!==u.enabled&&(u.dispatchEvent(c),l=f.NONE)}function nt(t){!1!==u.enabled&&t.preventDefault()}this.dollyIn=I,this.dollyOut=F,u.domElement.addEventListener("contextmenu",nt,!1),u.domElement.addEventListener("mousedown",Y,!1),u.domElement.addEventListener("wheel",K,!1),u.domElement.addEventListener("touchstart",Q,!1),u.domElement.addEventListener("touchend",tt,!1),u.domElement.addEventListener("touchmove",$,!1),u.domElement.addEventListener("keydown",J,!1),-1===u.domElement.tabIndex&&(u.domElement.tabIndex=0),this.update()}(fi.prototype=Object.create(g.prototype)).constructor=fi;var li=function(t,n){fi.call(this,t,n),this.mouseButtons.LEFT=st,this.mouseButtons.RIGHT=rt,this.touches.ONE=ut,this.touches.TWO=ct};li.prototype=Object.create(g.prototype),li.prototype.constructor=li;var di={FOV:35,CAMERA_NEAR:1,CAMERA_FAR:1e5,ZOOM_UPPER_BOUND:30,TILT_UPPER_BOUND:90,THOUSAND:1e3,DEG2RAD:.0174532,RAD2DEG:57.2957795,DRAW_TIME:500,EPS:.001};Object.freeze(di);var vi=di,pi={MODE_3D:2,MODE_2D:4};Object.freeze(pi);var mi=pi,gi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},yi={h:0,s:0,l:0},bi={h:0,s:0,l:0};function _i(t,n,e){return void 0===n&&void 0===e?this.set(t):this.setRGB(t,n,e)}function wi(t,n,e){return e<0&&(e+=1),1<e&&--e,e<1/6?t+6*(n-t)*e:e<.5?n:e<2/3?t+6*(n-t)*(2/3-e):t}function xi(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Mi(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Ei(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Object.assign(_i.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,n,e){return this.r=t,this.g=n,this.b=e,this},setHSL:function(t,n,e){return t=Mt.euclideanModulo(t,1),n=Mt.clamp(n,0,1),e=Mt.clamp(e,0,1),0===n?this.r=this.g=this.b=e:(this.r=wi(n=2*e-(e=e<=.5?e*(1+n):e+n-e*n),e,t+1/3),this.g=wi(n,e,t),this.b=wi(n,e,t-1/3)),this},setStyle:function(n){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+n+" will be ignored.")}if(u=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(n)){var e,i=u[1],r=u[2];switch(i){case"rgb":case"rgba":if(e=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[5]),this;if(e=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[5]),this;break;case"hsl":case"hsla":if(e=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r)){var o=parseFloat(e[1])/360,s=parseInt(e[2],10)/100,a=parseInt(e[3],10)/100;return t(e[5]),this.setHSL(o,s,a)}}}else if(u=/^\#([A-Fa-f0-9]+)$/.exec(n)){var i=u[1],u=i.length;if(3===u)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return n&&0<n.length?this.setColorName(n):this},setColorName:function(t){var n=gi[t];return void 0!==n?this.setHex(n):console.warn("THREE.Color: Unknown color "+t),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,n){return void 0===n&&(n=2),this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},copyLinearToGamma:function(t,n){n=0<(n=void 0===n?2:n)?1/n:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=xi(t.r),this.g=xi(t.g),this.b=xi(t.b),this},copyLinearToSRGB:function(t){return this.r=Mi(t.r),this.g=Mi(t.g),this.b=Mi(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var n,e=this.r,i=this.g,r=this.b,o=Math.max(e,i,r),s=Math.min(e,i,r),a=(s+o)/2;if(s===o)h=n=0;else{var u=o-s,h=a<=.5?u/(o+s):u/(2-o-s);switch(o){case e:n=(i-r)/u+(i<r?6:0);break;case i:n=(r-e)/u+2;break;case r:n=(e-i)/u+4}n/=6}return t.h=n,t.s=h,t.l=a,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,n,e){return this.getHSL(yi),yi.h+=t,yi.s+=n,yi.l+=e,this.setHSL(yi.h,yi.s,yi.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,n){return this.r=t.r+n.r,this.g=t.g+n.g,this.b=t.b+n.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,n){return this.r+=(t.r-this.r)*n,this.g+=(t.g-this.g)*n,this.b+=(t.b-this.b)*n,this},lerpHSL:function(t,n){this.getHSL(yi),t.getHSL(bi);var e=Mt.lerp(yi.h,bi.h,n),t=Mt.lerp(yi.s,bi.s,n),n=Mt.lerp(yi.l,bi.l,n);return this.setHSL(e,t,n),this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,n){return this.r=t[n=void 0===n?0:n],this.g=t[n+1],this.b=t[n+2],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.r,t[n+1]=this.g,t[n+2]=this.b,t}}),_i.NAMES=gi;var Si=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"round",value:function(t){return 0<t.toFixed(2)?Math.ceil(t.toFixed(2)):Math.floor(t.toFixed(2))}},{key:"generateUUID",value:function(){for(var t=[],n=0;n<256;n++)t[n]=(n<16?"0":"")+n.toString(16);var e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=4294967295*Math.random()|0,o=4294967295*Math.random()|0,o=t[255&e]+t[e>>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&i]+t[i>>8&255]+"-"+t[i>>16&15|64]+t[i>>24&255]+"-"+t[63&r|128]+t[r>>8&255]+"-"+t[r>>16&255]+t[r>>24&255]+t[255&o]+t[o>>8&255]+t[o>>16&255]+t[o>>24&255];return t.length=0,o.toUpperCase()}},{key:"findNearNthPowerOfTwo",value:function(t){t-=1;return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,(t|=t>>16)<0?1:1+t}},{key:"toRgba",value:function(t){if(void 0===t)return t;if("number"==typeof t)return"rgba("+parseInt(255*new _i(t).r)+","+parseInt(255*new _i(t).g)+","+parseInt(255*new _i(t).b)+",1)";var n=t.split(",");return 3<=n.length?"rgba("+parseInt(n[0])+","+parseInt(n[1])+","+parseInt(n[2])+",1)":t}},{key:"toColor",value:function(t){if("number"==typeof t)return t;var n=t.split(",");return 3<=n.length?parseInt(n[0])<<16|parseInt(n[1])<<8|parseInt(n[2]):(console.error("color format error",t),0)}}],(e=null)&&Ei(n.prototype,e),i&&Ei(n,i),t}();function Ti(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Li=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.W=t.src,this.X=t.dest,this.Y=[],this.Z=0,this.K=0,this.J=0,this.Q=vi.THOUSAND,this.$=!1,this.tt=!1,this.nt=!1,this.et=null,this.it=null,this.rt=Si.generateUUID()}var t,e,i;return t=n,(e=[{key:"stop",value:function(){return this.nt=!0,this.Z=0,this}},{key:"play",value:function(){return this.ot()}},{key:"pause",value:function(){return this.tt=!0,this}},{key:"resume",value:function(){return this.tt=!1,this.Z+=this.J,this.J=0,this}}])&&Ti(t.prototype,e),i&&Ti(t,i),n}();Object.assign(Li.prototype,{st:function(){for(var t in this)this[""+t]=null,delete this[""+t]},ut:function(t){return this.W=t,this},ht:function(t){return this.X=t,this},ct:function(t){return this.Q=t*vi.THOUSAND,this},ft:function(t){return this.K=t*vi.THOUSAND,this},lt:function(t){return this.et=t,this},dt:function(t){return this.it=t,this},vt:function(t){return this.$=t,this},ot:function(){return this.nt=!1,this.Z=(new Date).getTime(),this},pt:function(){var t=new this.constructor({src:this.W,dest:this.X});return t.Z=this.Z,t.K=this.K,t.Q=this.Q,t.$=this.$,t.et=this.et,t.it=this.it,t},mt:function(){var t=this.X.concat(),n=this.W.concat();return this.W=t,this.X=n,this}});var Oi=Li;function Ri(t){return function(t){if(Array.isArray(t))return Ai(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return Ai(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ai(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ai(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Ci(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var ki=function(){function i(t,n){var e=this;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i),this.gt=t,this.yt=[],this.bt=new Map,this._t=new li(this.gt.wt,n),this._t.addEventListener("change",function(t){e.it(),e.gt.Mt.xt({target:t.target,type:"viewChanged"})});n=!this.gt.Et.lock;this._t.enableZoom=n,this._t.enablePan=n,this._t.enableRotate=n,this._t.enableRotateLeft=n,this._t.enableRotateUp=n,this.St=n,this.Tt=n,this.Lt=n,this.Ot=n,this.Rt=this._t.useRange}var t,n,e;return t=i,(n=[{key:"enableZoom",get:function(){return this.St},set:function(t){this.St=t,this._t.enableZoom=t}},{key:"enableDragRange",get:function(){return this.Rt},set:function(t){var n,e,i,r;this.Rt=t,(this._t.useRange=t)&&(n=this.gt.getBound(),e=this.gt.yt[0].x,i=this.gt.yt[0].y,r=this.gt.getFloorSpace(),t=this.gt.getVisibleLevels().length-1,this._t.viewSphere=new it(new Et(n.center.x-e,r*t/2,-n.center.y+i),Math.max(r*t,n.size.x,n.size.y)/1e3))}},{key:"enableDrag",get:function(){return this.St},set:function(t){this.Tt=t,this._t.enablePan=t}},{key:"enableRotate",get:function(){return this.Lt},set:function(t){this.Lt=t,this._t.enableRotateLeft=t}},{key:"enableTilt",get:function(){return this.Lt},set:function(t){this.Ot=t,this._t.enableRotateUp=t}},{key:"getControls",value:function(){return this._t}}])&&Ci(t.prototype,n),e&&Ci(t,e),i}();Object.assign(ki.prototype,{st:function(){for(var t in this._t.dispose(),this)this[""+t]=null,delete this[""+t]},At:function(){for(var t=!1,n=0;n<this.gt.Ct.length;n++)this.gt.Ct[n]===this.gt.kt&&(t=!0);t?this.Pt():this.gt.setVisibleLevels([].concat(Ri(this.gt.Ct),[this.gt.kt]),this.Pt())},Pt:function(){var t,n=this.gt.Et,e=this._t,i=this.gt.Dt(Math.pow(2,vi.ZOOM_UPPER_BOUND-this.gt.jt-1)),r=this.gt.Nt;r.y=this.gt.Ut.Ft(this.gt.Gt[0],this.gt.kt).It,e.target=(new Et).copy(r),e.object.lookAt(r),this.gt.Bt===mi.MODE_3D?(t=(vi.TILT_UPPER_BOUND-n.tiltAngle)*vi.DEG2RAD,t=new Et(0,i*Math.cos(t),i*Math.sin(t)),e.object.position.set(r.x+t.x,r.y+t.y,r.z+t.z),e.minPolarAngle=(vi.TILT_UPPER_BOUND-n.maxTiltAngle)*vi.DEG2RAD,e.maxPolarAngle=(vi.TILT_UPPER_BOUND-n.minTiltAngle)*vi.DEG2RAD):(n=this.gt.Ht(Math.pow(2,vi.ZOOM_UPPER_BOUND-this.gt.jt-1)),e.minPolarAngle=0,e.maxPolarAngle=0,e.object.position.set(r.x,r.y+i,r.z),e.object.zoom=1/n,e.object.updateProjectionMatrix()),e.update()},Vt:function(t){this._t.target=t,this._t.update()},zt:function(e){var i,t,n,r=this;e.mode!==this.gt.getViewMode()&&(i=this._t,e.mode===mi.MODE_2D?(i.minPolarAngle=-90*vi.DEG2RAD,this.Wt({animate:void 0===e.animate||e.animate,duration:1,tilt:90,finish:function(){i.maxPolarAngle=0;var t=r.gt.Xt,n=r.gt.Yt(),n=r.gt.Ht(n);t.quaternion.copy(i.object.quaternion),t.position.copy(i.object.position),t.zoom=1/n,t.updateProjectionMatrix(),i.object=t,i.update(),r.gt.wt=t,r.gt.qt.Zt(),e.finish&&e.finish(),r.gt.Mt.xt({type:"viewModeChanged"})}})):e.mode===mi.MODE_3D&&(i.maxPolarAngle=(vi.TILT_UPPER_BOUND-this.gt.Et.minTiltAngle)*vi.DEG2RAD,t=this.gt.Kt,n=this.gt.Jt(),n=this.gt.Dt(n),t.quaternion.copy(i.object.quaternion),t.position.copy(i.object.position),t.position.setY(i.target.y+n),t.updateMatrix(),i.object=t,i.update(),this.gt.wt=t,this.gt.qt.Zt(),this.Wt({animate:void 0===e.animate||e.animate,duration:1,tilt:this.gt.Et.minTiltAngle,finish:e.finish}),this.gt.Mt.xt({type:"viewModeChanged"})))},Wt:function(t){var n,e,i=this,r=this._t,o=t.finish;"animate"in t&&!t.animate?(r.update({phi:(vi.TILT_UPPER_BOUND-t.tilt)*vi.DEG2RAD}),o&&o()):(n=Number.isFinite(t.duration)?t.duration:.5,(e=new Oi({src:[this.gt.getTilt()],dest:[t.tilt]})).ct(n).lt(function(t){return r.update({phi:(vi.TILT_UPPER_BOUND-t.destination[0])*vi.DEG2RAD})}).dt(function(){i.gt.$t.Qt(e),o&&o()}),this.gt.$t.tn(e.ot()))},nn:function(t){var n=this,t=this.gt.getZoom()*t,e=new Oi({src:[this.gt.getZoom()],dest:[t]});t>this.gt.Et.zoomRange[1]||t<this.gt.Et.zoomRange[0]||(e.ct(.5).lt(function(t){return n.gt.setZoom({animate:!1,zoom:t.destination[0]})}).dt(function(){return n.gt.$t.Qt(e)}),this.gt.$t.tn(e.ot()))},en:function(t){var n,e,i,r=this,o=this.gt.in[Math.floor(t.zoom)-1]+(this.gt.in[Math.floor(t.zoom)]-this.gt.in[Math.floor(t.zoom)-1])*(t.zoom-Math.floor(t.zoom)),s=this.gt.Dt(o),a=this._t,u=a.object.position.distanceTo(a.target),h=(new Et).copy(a.object.position).sub(a.target).normalize(),c=(new Et).copy(h).multiplyScalar(s-u),f=this.gt.Xt,l=[0,0,0];"animate"in t&&!t.animate?(this.gt.wt.isPerspectiveCamera?a.update({offset:c}):(n=this.gt.Ht(o),f.zoom=1/n,f.updateProjectionMatrix(),a.update(),this.gt.qt.Zt()),t.callback&&t.callback()):(n=Number.isFinite(t.duration)?t.duration:.5,this.gt.wt.isPerspectiveCamera?((e=new Oi({src:[0,0,0],dest:[c.x,c.y,c.z]})).ct(n).lt(function(t){a.update({offset:new Et(t.delta[0],t.delta[1],t.delta[2])}),l[0]+=t.delta[0],l[1]+=t.delta[1],l[2]+=t.delta[2]}).dt(function(){r.gt.$t.Qt(e),a.update({offset:new Et(c.x-l[0],c.y-l[1],c.z-l[2])}),t.finish&&t.finish()}),this.gt.$t.tn(e.ot())):((i=new Oi({src:[this.gt.Jt()],dest:[o]})).ct(n).lt(function(t){t=r.gt.Ht(t.destination[0]);f.zoom=1/t,f.updateProjectionMatrix(),a.update(),r.gt.qt.Zt()}).dt(function(){r.gt.$t.Qt(i),t.finish&&t.finish()}),this.gt.$t.tn(i.ot())))},rn:function(){var t=this._t.target,n=this.gt.yt[0];return{x:parseFloat((n.x+t.x).toFixed(4)),y:parseFloat((n.y-t.z).toFixed(4))}},sn:function(t){var n,e,i,r=this,o=this._t,s=this.gt.yt[0],a=t.x-s.x,u=-t.y+s.y,h=o.target.x,c=o.target.z,s=t.height;!!s&&Number.isFinite(s)?(e=o.target.y,n=s):e=n=0,"animate"in t&&!t.animate?(o.panAdd({x:a-h,y:n-e,z:u-c}),o.update(),t.finish&&t.finish(),this.gt.qt.Zt()):(s=Number.isFinite(t.duration)?t.duration:.5,(i=new Oi({src:[h,e,c],dest:[a,n,u]})).ct(s).lt(function(t){o.panAdd({x:t.delta[0],y:t.delta[1],z:t.delta[2]}),o.update(),r.gt.qt.Zt()}).dt(function(){r.gt.$t.Qt(i),r.gt.qt.Zt(),t.finish&&t.finish()}),this.gt.$t.tn(i.ot()))},an:function(t){if(t.level!==this.gt.kt){for(var n,e=!1,i=0;i<this.gt.Ct.length;i++)this.gt.Ct[i]===t.level&&(e=!0);e?this.un(t):((n=this.gt.Ct).push(t.level),this.gt.setVisibleLevels(n,this.un(t)))}else t.finish&&t.finish()},un:function(t){function n(){i.gt.kt=t.level,i.gt.qt.hn(),i.gt.Et.nonFocusAlphaMode&&i.gt.qt.cn(),i.gt.Mt.xt({type:"levelChanged",level:t.level}),t.finish&&t.finish(t.level),i.gt.qt.ln(i.gt.getZoom()),i.gt.qt.Zt()}var e,i=this,r=this._t,o=r.target.y,s=this.gt.Ut.Ft(this.gt.Gt[0],t.level).It;"animate"in t&&!t.animate?(r.panUp(s-o),r.update(),n()):(e=Number.isFinite(t.duration)?t.duration:.5,(s=new Oi({src:[o],dest:[s]})).ct(e).lt(function(t){r.panUp(t.delta[0]),r.update()}).dt(function(){n()}),this.gt.$t.tn(s.ot()))},dn:function(t){var n,e=this,i=this._t,r=i.getAzimuthalAngle(),o=0,s=r+(o=(s=-t.rotation%360*vi.DEG2RAD)-r!=0?Math.sin(s-r)/Math.abs(Math.sin(s-r))*Math.acos(Math.cos(s-r)):o);"animate"in t&&!t.animate?(i.update({theta:s}),t.finish&&t.finish()):(o=t&&t.duration&&Number.isFinite(t.duration)?t.duration:.5,(n=new Oi({src:[r],dest:[s]})).ct(o).lt(function(t){i.update({theta:t.destination[0]})}).dt(function(){e.gt.$t.Qt(n),t.finish&&t.finish()}),this.gt.$t.tn(n.ot()))},vn:function(t){var e=this,n=t&&t.duration&&Number.isFinite(t.duration)?t.duration:5,t=new Oi({src:[0],dest:[2*Math.PI]});return t.ct(n).vt(!0).lt(function(n){e.gt.qt.pn.forEach(function(t){return t.rotation.y=n.destination[0]}),e.gt.vn=n.destination[0]}),this.gt.$t.tn(t.ot()),this.bt.set("autoRotate",t),t},tn:function(t){var n;(n=this.yt).push.apply(n,Ri(t))},it:function(){for(var t=0;t<this.yt.length;t++)this.yt[t].call(this.gt.qt)}});var Pi=ki,Di=new Et,ji=new Et,Ni=new Et,Ii=new Et,Fi=new Et,Ui=new Et,Gi=new Et;function Bi(t,n){this.origin=void 0!==t?t:new Et,this.direction=void 0!==n?n:new Et(0,0,-1)}function Hi(t,n,e,i){this.ray=new Bi(t,n),this.near=e||0,this.far=i||1/0,this.camera=null,this.layers=new w,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function Vi(t,n){return t.distance-n.distance}function zi(t,n,e,i){if(t.layers.test(n.layers)&&t.raycast(n,e),!0===i)for(var r=t.children,o=0,s=r.length;o<s;o++)zi(r[o],n,e,!0)}Object.assign(Bi.prototype,{set:function(t,n){return this.origin.copy(t),this.direction.copy(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,n){return void 0===n&&(console.warn("THREE.Ray: .at() target is now required"),n=new Et),n.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,Di)),this},closestPointToPoint:function(t,n){void 0===n&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),n=new Et),n.subVectors(t,this.origin);t=n.dot(this.direction);return t<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(t).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var n=Di.subVectors(t,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(t):(Di.copy(this.direction).multiplyScalar(n).add(this.origin),Di.distanceToSquared(t))},distanceSqToSegment:function(t,n,e,i){ji.copy(t).add(n).multiplyScalar(.5),Ni.copy(n).sub(t).normalize(),Ii.copy(this.origin).sub(ji);var r,o,s=.5*t.distanceTo(n),a=-this.direction.dot(Ni),u=Ii.dot(this.direction),h=-Ii.dot(Ni),c=Ii.lengthSq(),t=Math.abs(1-a*a);return c=0<t?(o=a*u-h,n=s*t,0<=(r=a*h-u)?-n<=o?o<=n?(r*=t=1/t)*(r+a*(o*=t)+2*u)+o*(a*r+o+2*h)+c:(o=s,-(r=Math.max(0,-(a*o+u)))*r+o*(o+2*h)+c):(o=-s,-(r=Math.max(0,-(a*o+u)))*r+o*(o+2*h)+c):o<=-n?-(r=Math.max(0,-(-a*s+u)))*r+(o=0<r?-s:Math.min(Math.max(-s,-h),s))*(o+2*h)+c:o<=n?(r=0,(o=Math.min(Math.max(-s,-h),s))*(o+2*h)+c):-(r=Math.max(0,-(a*s+u)))*r+(o=0<r?s:Math.min(Math.max(-s,-h),s))*(o+2*h)+c):(o=0<a?-s:s,-(r=Math.max(0,-(a*o+u)))*r+o*(o+2*h)+c),e&&e.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(Ni).multiplyScalar(o).add(ji),c},intersectSphere:function(t,n){Di.subVectors(t.center,this.origin);var e=Di.dot(this.direction),i=Di.dot(Di)-e*e,t=t.radius*t.radius;if(t<i)return null;t=Math.sqrt(t-i),i=e-t,t=e+t;return i<0&&t<0?null:i<0?this.at(t,n):this.at(i,n)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var n=t.normal.dot(this.direction);if(0===n)return 0===t.distanceToPoint(this.origin)?0:null;n=-(this.origin.dot(t.normal)+t.constant)/n;return 0<=n?n:null},intersectPlane:function(t,n){t=this.distanceToPlane(t);return null===t?null:this.at(t,n)},intersectsPlane:function(t){var n=t.distanceToPoint(this.origin);return 0===n||t.normal.dot(this.direction)*n<0},intersectBox:function(t,n){var e,i,r,o=1/this.direction.x,s=1/this.direction.y,a=1/this.direction.z,u=this.origin,o=0<=o?(e=(t.min.x-u.x)*o,(t.max.x-u.x)*o):(e=(t.max.x-u.x)*o,(t.min.x-u.x)*o),s=0<=s?(i=(t.min.y-u.y)*s,(t.max.y-u.y)*s):(i=(t.max.y-u.y)*s,(t.min.y-u.y)*s);return s<e||o<i?null:((s<o||o!=o)&&(o=s),(a=0<=a?(r=(t.min.z-u.z)*a,(t.max.z-u.z)*a):(r=(t.max.z-u.z)*a,(t.min.z-u.z)*a))<(e=e<i||e!=e?i:e)||o<r?null:((e<r||e!=e)&&(e=r),(o=a<o||o!=o?a:o)<0?null:this.at(0<=e?e:o,n)))},intersectsBox:function(t){return null!==this.intersectBox(t,Di)},intersectTriangle:function(t,n,e,i,r){Fi.subVectors(n,t),Ui.subVectors(e,t),Gi.crossVectors(Fi,Ui);e=this.direction.dot(Gi);if(0<e){if(i)return null;o=1}else{if(!(e<0))return null;o=-1,e=-e}Ii.subVectors(this.origin,t);i=o*this.direction.dot(Ui.crossVectors(Ii,Ui));if(i<0)return null;t=o*this.direction.dot(Fi.cross(Ii));if(t<0)return null;if(e<i+t)return null;var o=-o*Ii.dot(Gi);return o<0?null:this.at(o/e,r)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(Hi.prototype,{set:function(t,n){this.ray.set(t,n)},setFromCamera:function(t,n){n&&n.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(n.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(n).sub(this.ray.origin).normalize(),this.camera=n):n&&n.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(n.near+n.far)/(n.near-n.far)).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld),this.camera=n):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,n,e){e=e||[];return zi(t,this,e,n),e.sort(Vi),e},intersectObjects:function(t,n,e){var i=e||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,o=t.length;r<o;r++)zi(t[r],this,i,n);return i.sort(Vi),i}});var Wi={NONE:0,EXTRUDE_MARKER:2,GRADIENT_POLYGON_MARKER:4,IMAGE_MARKER:8,LOCATION_MARKER:16,POLYGON_MARKER:32,TEXT_MARKER:64,LINE_MARKER:128,EDGES_LINES_TYPE:256,HEAT_MAP_MARKER:512,EXTENT:1024,EXTERNAL_MODEL:2048,EXTERNALMODEL:2048,MODEL:4096,FACILITY:8192,LABEL:16384,DYNAMIC_MODEL_MARKER:32768,DOM_MARKER:65536,EXTENT_LAYER:1<<20,EXTERNAL_MODEL_LAYER:1<<21,MODEL_LAYER:1<<22,FACILITY_LAYER:1<<23,LABEL_LAYER:1<<24,MARKER_GROUP:1<<25};Object.freeze(Wi);var Xi=Wi;function Yi(t){return(Yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zi(t){return function(t){if(Array.isArray(t))return qi(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return qi(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?qi(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qi(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}var Ki=function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.gt=n,this.yt=[],this.mn=null,this.gn=Si.generateUUID(),this.bt=null,this.yn=new Hi,this.bn=new Et,this.it=this.it.bind(this),this.Z=0,n.qt.renderer.domElement.addEventListener("mousedown",this.it,!1),n.qt.renderer.domElement.addEventListener("mouseup",this.it,!1),n.qt.renderer.domElement.addEventListener("mousemove",this.it,!1),n.qt.renderer.domElement.addEventListener("touchstart",this.it,!1),n.qt.renderer.domElement.addEventListener("touchend",this.it,!1),n.qt.renderer.domElement.addEventListener("touchmove",this.it,!1)};Object.assign(Ki.prototype,{st:function(){for(var t,n=0;n<this.yt.length;n++)this.yt[n]&&this.yt[n].st&&this.yt[n].st();for(t in this.yt.length=0,this.yt=null,delete this.yt,this)this[""+t]&&this[""+t].st&&this[""+t].st(),this[""+t]=null,delete this[""+t]},tn:function(t){var n;(n=this.yt).push.apply(n,Zi(t))},it:function(t){if("mousemove"!==t.type||this.gt._n)if("mousedown"!==t.type&&"touchstart"!==t.type){if("mouseup"===t.type||"touchend"===t.type){if(200<(new Date).getTime()-this.Z)return;this.Z=(new Date).getTime()}for(var n="mousemove"===t.type||"touchmove"===t.type?"hover":"click",e=this.wn(t),i=0;i<this.yt.length;i++)this.yt[i](e);var r=this.xn(e),t={type:n,targets:r,coords:this.Mn(e),mouseEvent:t};n===this.gt.En&&this.Sn(r),this.gt.Mt.xt(t)}else this.Z=(new Date).getTime()},Sn:function(s){for(var a=this,t=function(n){if(s[n].Tn===Xi.MODEL){if(a.mn&&s[n].Ln.uuid===a.mn.uuid)return{v:void 0};a.bt&&(a.gt.$t.Qt(a.bt),a.mn&&(a.mn.material=a.mn.userData.material));var t=s[n].Ln.material.clone(),e=s[n].Ln.material.clone(),i=s[n].Ln.material.color,r=new _i(a.gt.Et.highlightColor);return a.bt=new Oi({src:[i.r,i.g,i.b],dest:[r.r,r.g,r.b]}),a.bt.ct(.5).lt(function(t){return s[n].Ln.material.color=new _i(t.destination[0],t.destination[1],t.destination[2])}).dt(function(){a.gt.$t.Qt(a.bt),s[n].Ln.material.color=new _i(a.gt.Et.highlightColor)}),s[n].Ln.material=t,s[n].Ln.userData.material=e,a.mn=s[n].Ln,a.gt.$t.tn(a.bt.ot()),"break"}if(s[n].Tn===Xi.EXTERNAL_MODEL){if(a.mn&&s[n].Ln.uuid===a.mn.uuid)return{v:void 0};if(a.mn&&function(t){if(t.mapNode.Tn===Xi.MODEL)t.material=t.userData.material;else if("Mesh"===t.type)if(void 0!==t.material.length)for(var n=0;n<t.material.length;n++)"MeshLambertMaterial"!==t.material[n].type?t.material[n].uniforms.diffuse.value=t.material[n].defaultColor:t.material[n].color=t.material[n].defaultColor;else"MeshLambertMaterial"!==t.material.type?t.material.uniforms.diffuse.value=t.material.defaultColor:t.material.color=t.material.defaultColor;else"Scene"===t.type&&t.traverse(function(t){if("Mesh"===t.type)if(void 0!==t.material.length)for(var n=0;n<t.material.length;n++)t.material[n].uniforms.diffuse.value=t.material[n].defaultColor;else t.material.uniforms.diffuse.value=t.material.defaultColor})}(a.mn),a.mn=s[n].Ln,"Mesh"===a.mn.type)if(void 0!==a.mn.material.length)for(var o=0;o<a.mn.material.length;o++)"MeshLambertMaterial"!==a.mn.material[o].type?(a.mn.material[o].defaultColor||(a.mn.material[o].defaultColor=a.mn.material[o].uniforms.diffuse.value.clone()),a.mn.material[o].uniforms.diffuse.value=new _i(a.gt.Et.highlightColor)):(a.mn.material[o].defaultColor||(a.mn.material[o].defaultColor=a.mn.material[o].color.clone()),a.mn.material[o].color=new _i(a.gt.Et.highlightColor));else"MeshLambertMaterial"!==a.mn.material.type?(a.mn.material.defaultColor||(a.mn.material.defaultColor=a.mn.material.uniforms.diffuse.value.clone()),a.mn.material.uniforms.diffuse.value=new _i(a.gt.Et.highlightColor)):(a.mn.material.defaultColor||(a.mn.material.defaultColor=a.mn.material.color.clone()),a.mn.material.color=new _i(a.gt.Et.highlightColor));else"Scene"===a.mn.type&&a.mn.traverse(function(t){if("Mesh"===t.type)if(void 0!==t.material.length)for(var n=0;n<t.material.length;n++)t.material[n].defaultColor||(t.material[n].defaultColor=t.material[n].uniforms.diffuse.value.clone()),t.material[n].uniforms.diffuse.value=new _i(a.gt.Et.highlightColor);else t.material.defaultColor||(t.material.defaultColor=t.material.uniforms.diffuse.value.clone()),t.material.uniforms.diffuse.value=new _i(a.gt.Et.highlightColor)});return"break"}},n=0;n<s.length;n++){var e=t(n);if("break"===e)break;if("object"===Yi(e))return e.v}},xn:function(t){for(var n=[],e=0;e<t.length;e++)if("LineSegments"!==t[e].object.type){for(var i=t[e].object;!i.mapNode;)i=i.parent;for(var r=!0,o=0;o<n.length;o++)if(n[o].Ln&&n[o].Ln.uuid===i.uuid){r=!1;break}this.gt.pickFilterFunction({type:i.mapNode.Tn,data:i.mapNode.On})&&r&&i.visible&&n.push(i.mapNode)}return n},Mn:function(t){for(var n=null,e=0;e<t.length;e++)if("LineSegments"!==t[e].object.type){n=t[e];break}if(t.length<1||!n)return{x:NaN,y:NaN};var i=n.point.clone(),r=n.object.parent.matrix.clone();return r.getInverse(n.object.parent.matrix),i.applyMatrix4(r),{x:this.gt.getX()+i.x,y:this.gt.getY()-i.z}},wn:function(t){var n,e=this,i=[];return t.touches?(n=t.touches[0],"touchend"===t.type&&(n=t.changedTouches[0]),this.bn.x=n.pageX/this.gt.qt.renderer.domElement.clientWidth*2-1,this.bn.y=2*-(n.pageY/this.gt.qt.renderer.domElement.clientHeight)+1):(this.bn.x=(t=t).offsetX/this.gt.qt.renderer.domElement.clientWidth*2-1,this.bn.y=2*-(t.offsetY/this.gt.qt.renderer.domElement.clientHeight)+1),this.bn.z=.5,this.yn.setFromCamera(this.bn,this.gt.wt),this.gt.qt.pn.forEach(function(t){return i.push.apply(i,Zi(e.yn.intersectObject(t,!0)))}),i.sort(function(t,n){return t.distance-n.distance})}});var Ji=Ki,Qi=0;function $i(t,n,e,i,r,o,s,a,u,h){Object.defineProperty(this,"id",{value:Qi++}),this.uuid=Mt.generateUUID(),this.name="",this.image=void 0!==t?t:$i.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==n?n:$i.DEFAULT_MAPPING,this.wrapS=void 0!==e?e:gn,this.wrapT=void 0!==i?i:gn,this.magFilter=void 0!==r?r:xn,this.minFilter=void 0!==o?o:En,this.anisotropy=void 0!==u?u:1,this.format=void 0!==s?s:Un,this.internalFormat=null,this.type=void 0!==a?a:Sn,this.offset=new ii(0,0),this.repeat=new ii(1,1),this.center=new ii(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new x,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==h?h:Be,this.version=0,this.onUpdate=null}function tr(t,n,e,i,r,o,s,a,u,h,c,f){$i.call(this,null,o,s,a,u,h,i,r,c,f),this.image={data:t||null,width:n||1,height:e||1},this.magFilter=void 0!==u?u:bn,this.minFilter=void 0!==h?h:bn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}$i.DEFAULT_IMAGE=void 0,$i.DEFAULT_MAPPING=300,$i.prototype=Object.assign(Object.create(g.prototype),{constructor:$i,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||1<t.x)switch(this.wrapS){case mn:t.x=t.x-Math.floor(t.x);break;case gn:t.x=t.x<0?0:1;break;case yn:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||1<t.y)switch(this.wrapT){case mn:t.y=t.y-Math.floor(t.y);break;case gn:t.y=t.y<0?0:1;break;case yn:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty($i.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),((tr.prototype=Object.create($i.prototype)).constructor=tr).prototype.isDataTexture=!0;var nr={common:{diffuse:{value:new _i(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new x},uv2Transform:{value:new x},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new ii(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new _i(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new _i(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new x}},sprite:{diffuse:{value:new _i(15658734)},opacity:{value:1},center:{value:new ii(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new x}}};function er(t,n,e,i){this.x=t||0,this.y=n||0,this.z=e||0,this.w=void 0!==i?i:1}function ir(){Y.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function rr(){var e=null,i=!1,r=null;function o(t,n){!1!==i&&(r(t,n),e.requestAnimationFrame(o))}return{start:function(){!0!==i&&null!==r&&(e.requestAnimationFrame(o),i=!0)},stop:function(){i=!1},setAnimationLoop:function(t){r=t},setContext:function(t){e=t}}}function or(u,t){var h=t.isWebGL2,c=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),c.get(t)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=c.get(t);n&&(u.deleteBuffer(n.buffer),c.delete(t))},update:function(t,n){t.isInterleavedBufferAttribute&&(t=t.data);var e,i,r,o,s,a=c.get(t);void 0===a?c.set(t,(i=n,r=(e=t).array,o=e.usage,s=u.createBuffer(),u.bindBuffer(i,s),u.bufferData(i,r,o),e.onUploadCallback(),o=u.FLOAT,r instanceof Float32Array?o=u.FLOAT:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?o=u.UNSIGNED_SHORT:r instanceof Int16Array?o=u.SHORT:r instanceof Uint32Array?o=u.UNSIGNED_INT:r instanceof Int32Array?o=u.INT:r instanceof Int8Array?o=u.BYTE:r instanceof Uint8Array&&(o=u.UNSIGNED_BYTE),{buffer:s,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version})):a.version<t.version&&(o=a.buffer,r=n,n=(e=t).array,e=e.updateRange,u.bindBuffer(r,o),-1===e.count?u.bufferSubData(r,0,n):(h?u.bufferSubData(r,e.offset*n.BYTES_PER_ELEMENT,n,e.offset,e.count):u.bufferSubData(r,e.offset*n.BYTES_PER_ELEMENT,n.subarray(e.offset,e.offset+e.count)),e.count=-1),a.version=t.version)}}}function sr(t,n,e,i,r,o){this.a=t,this.b=n,this.c=e,this.normal=i&&i.isVector3?i:new Et,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new _i,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}Object.defineProperties(er.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(er.prototype,{isVector4:!0,set:function(t,n,e,i){return this.x=t,this.y=n,this.z=e,this.w=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,n){return void 0!==n?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,n)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this.w=t.w+n.w,this},addScaledVector:function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this.w+=t.w*n,this},sub:function(t,n){return void 0!==n?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,n)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this.w=t.w-n.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var n=this.x,e=this.y,i=this.z,r=this.w,t=t.elements;return this.x=t[0]*n+t[4]*e+t[8]*i+t[12]*r,this.y=t[1]*n+t[5]*e+t[9]*i+t[13]*r,this.z=t[2]*n+t[6]*e+t[10]*i+t[14]*r,this.w=t[3]*n+t[7]*e+t[11]*i+t[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var n=Math.sqrt(1-t.w*t.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/n,this.y=t.y/n,this.z=t.z/n),this},setAxisAngleFromRotationMatrix:function(t){var n,e,i,r=t.elements,o=r[0],s=r[4],a=r[8],u=r[1],h=r[5],c=r[9],f=r[2],l=r[6],d=r[10];if(Math.abs(s-u)<.01&&Math.abs(a-f)<.01&&Math.abs(c-l)<.01){if(Math.abs(s+u)<.1&&Math.abs(a+f)<.1&&Math.abs(c+l)<.1&&Math.abs(o+h+d-3)<.1)return this.set(1,0,0,0),this;var v=Math.PI,p=(o+1)/2,m=(h+1)/2,g=(d+1)/2,y=(s+u)/4,t=(a+f)/4,r=(c+l)/4;return m<p&&g<p?i=p<.01?(n=0,e=.707106781):(e=y/(n=Math.sqrt(p)),t/n):g<m?i=m<.01?(e=0,n=.707106781):(n=y/(e=Math.sqrt(m)),r/e):g<.01?(e=n=.707106781,i=0):(n=t/(i=Math.sqrt(g)),e=r/i),this.set(n,e,i,v),this}v=Math.sqrt((l-c)*(l-c)+(a-f)*(a-f)+(u-s)*(u-s));return Math.abs(v)<.001&&(v=1),this.x=(l-c)/v,this.y=(a-f)/v,this.z=(u-s)/v,this.w=Math.acos((o+h+d-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this.w=Math.max(t.w,Math.min(n.w,this.w)),this},clampScalar:function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this.w=Math.max(t,Math.min(n,this.w)),this},clampLength:function(t,n){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,e)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this.w+=(t.w-this.w)*n,this},lerpVectors:function(t,n,e){return this.subVectors(n,t).multiplyScalar(e).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,n){return this.x=t[n=void 0===n?0:n],this.y=t[n+1],this.z=t[n+2],this.w=t[n+3],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t[n+3]=this.w,t},fromBufferAttribute:function(t,n,e){return void 0!==e&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this.w=t.getW(n),this}}),ir.prototype=Object.assign(Object.create(Y.prototype),{constructor:ir,isScene:!0,copy:function(t,n){return Y.prototype.copy.call(this,t,n),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.assign(sr.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var n=0,e=t.vertexNormals.length;n<e;n++)this.vertexNormals[n]=t.vertexNormals[n].clone();for(n=0,e=t.vertexColors.length;n<e;n++)this.vertexColors[n]=t.vertexColors[n].clone();return this}});var ar=0,ur=new St,hr=new Y,cr=new Et;function fr(){Object.defineProperty(this,"id",{value:ar+=2}),this.uuid=Mt.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}fr.prototype=Object.assign(Object.create(g.prototype),{constructor:fr,isGeometry:!0,applyMatrix4:function(t){for(var n=(new x).getNormalMatrix(t),e=0,i=this.vertices.length;e<i;e++)this.vertices[e].applyMatrix4(t);for(e=0,i=this.faces.length;e<i;e++){var r=this.faces[e];r.normal.applyMatrix3(n).normalize();for(var o=0,s=r.vertexNormals.length;o<s;o++)r.vertexNormals[o].applyMatrix3(n).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(t){return ur.makeRotationX(t),this.applyMatrix4(ur),this},rotateY:function(t){return ur.makeRotationY(t),this.applyMatrix4(ur),this},rotateZ:function(t){return ur.makeRotationZ(t),this.applyMatrix4(ur),this},translate:function(t,n,e){return ur.makeTranslation(t,n,e),this.applyMatrix4(ur),this},scale:function(t,n,e){return ur.makeScale(t,n,e),this.applyMatrix4(ur),this},lookAt:function(t){return hr.lookAt(t),hr.updateMatrix(),this.applyMatrix4(hr.matrix),this},fromBufferGeometry:function(t){var o=this,n=null!==t.index?t.index.array:void 0,e=t.attributes;if(void 0===e.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var i=e.position.array,s=void 0!==e.normal?e.normal.array:void 0,a=void 0!==e.color?e.color.array:void 0,u=void 0!==e.uv?e.uv.array:void 0,h=void 0!==e.uv2?e.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var r=0;r<i.length;r+=3)o.vertices.push((new Et).fromArray(i,r)),void 0!==a&&o.colors.push((new _i).fromArray(a,r));function c(t,n,e,i){var r=void 0===a?[]:[o.colors[t].clone(),o.colors[n].clone(),o.colors[e].clone()],i=new sr(t,n,e,void 0===s?[]:[(new Et).fromArray(s,3*t),(new Et).fromArray(s,3*n),(new Et).fromArray(s,3*e)],r,i);o.faces.push(i),void 0!==u&&o.faceVertexUvs[0].push([(new ii).fromArray(u,2*t),(new ii).fromArray(u,2*n),(new ii).fromArray(u,2*e)]),void 0!==h&&o.faceVertexUvs[1].push([(new ii).fromArray(h,2*t),(new ii).fromArray(h,2*n),(new ii).fromArray(h,2*e)])}var f=t.groups;if(0<f.length)for(r=0;r<f.length;r++)for(var l=f[r],d=l.start,v=d,p=d+l.count;v<p;v+=3)void 0!==n?c(n[v],n[v+1],n[v+2],l.materialIndex):c(v,v+1,v+2,l.materialIndex);else if(void 0!==n)for(r=0;r<n.length;r+=3)c(n[r],n[r+1],n[r+2]);else for(r=0;r<i.length/3;r+=3)c(r,r+1,r+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(cr).negate(),this.translate(cr.x,cr.y,cr.z),this},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,n=this.boundingSphere.radius,e=0===n?1:1/n,n=new St;return n.set(e,0,0,-e*t.x,0,e,0,-e*t.y,0,0,e,-e*t.z,0,0,0,1),this.applyMatrix4(n),this},computeFaceNormals:function(){for(var t=new Et,n=new Et,e=0,i=this.faces.length;e<i;e++){var r=this.faces[e],o=this.vertices[r.a],s=this.vertices[r.b],a=this.vertices[r.c];t.subVectors(a,s),n.subVectors(o,s),t.cross(n),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var n,e,i;for(void 0===t&&(t=!0),i=new Array(this.vertices.length),n=0,e=this.vertices.length;n<e;n++)i[n]=new Et;if(t)for(var r,o,s,a=new Et,u=new Et,h=0,c=this.faces.length;h<c;h++)f=this.faces[h],r=this.vertices[f.a],o=this.vertices[f.b],s=this.vertices[f.c],a.subVectors(s,o),u.subVectors(r,o),a.cross(u),i[f.a].add(a),i[f.b].add(a),i[f.c].add(a);else for(this.computeFaceNormals(),h=0,c=this.faces.length;h<c;h++)i[(f=this.faces[h]).a].add(f.normal),i[f.b].add(f.normal),i[f.c].add(f.normal);for(n=0,e=this.vertices.length;n<e;n++)i[n].normalize();for(h=0,c=this.faces.length;h<c;h++){var f,l=(f=this.faces[h]).vertexNormals;3===l.length?(l[0].copy(i[f.a]),l[1].copy(i[f.b]),l[2].copy(i[f.c])):(l[0]=i[f.a].clone(),l[1]=i[f.b].clone(),l[2]=i[f.c].clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,n;for(this.computeFaceNormals(),t=0,n=this.faces.length;t<n;t++){var e,i=(e=this.faces[t]).vertexNormals;3===i.length?(i[0].copy(e.normal),i[1].copy(e.normal),i[2].copy(e.normal)):(i[0]=e.normal.clone(),i[1]=e.normal.clone(),i[2]=e.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,n,e;for(s=0,a=this.faces.length;s<a;s++)for((e=this.faces[s]).Rn?e.Rn.copy(e.normal):e.Rn=e.normal.clone(),e.An||(e.An=[]),t=0,n=e.vertexNormals.length;t<n;t++)e.An[t]?e.An[t].copy(e.vertexNormals[t]):e.An[t]=e.vertexNormals[t].clone();var i=new fr;for(i.faces=this.faces,t=0,n=this.morphTargets.length;t<n;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];for(var r=this.morphNormals[t].faceNormals,o=this.morphNormals[t].vertexNormals,s=0,a=this.faces.length;s<a;s++)u=new Et,h={a:new Et,b:new Et,c:new Et},r.push(u),o.push(h)}var u,h,c=this.morphNormals[t];for(i.vertices=this.morphTargets[t].vertices,i.computeFaceNormals(),i.computeVertexNormals(),s=0,a=this.faces.length;s<a;s++)e=this.faces[s],u=c.faceNormals[s],h=c.vertexNormals[s],u.copy(e.normal),h.a.copy(e.vertexNormals[0]),h.b.copy(e.vertexNormals[1]),h.c.copy(e.vertexNormals[2])}for(s=0,a=this.faces.length;s<a;s++)(e=this.faces[s]).normal=e.Rn,e.vertexNormals=e.An},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new $),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new it),this.boundingSphere.setFromPoints(this.vertices)},mergeVertices:function(){for(var t,n,e,i,r={},o=[],s=[],a=Math.pow(10,4),u=0,h=this.vertices.length;u<h;u++)t=this.vertices[u],void 0===r[t=Math.round(t.x*a)+"_"+Math.round(t.y*a)+"_"+Math.round(t.z*a)]?(r[t]=u,o.push(this.vertices[u]),s[u]=o.length-1):s[u]=s[r[t]];var c=[];for(u=0,h=this.faces.length;u<h;u++){(n=this.faces[u]).a=s[n.a],n.b=s[n.b],n.c=s[n.c];for(var f=[n.a,n.b,n.c],l=0;l<3;l++)if(f[l]===f[(l+1)%3]){c.push(u);break}}for(u=c.length-1;0<=u;u--){var d=c[u];for(this.faces.splice(d,1),e=0,i=this.faceVertexUvs.length;e<i;e++)this.faceVertexUvs[e].splice(d,1)}var v=this.vertices.length-o.length;return this.vertices=o,v},setFromPoints:function(t){this.vertices=[];for(var n=0,e=t.length;n<e;n++){var i=t[n];this.vertices.push(new Et(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,n=t.length,e=0;e<n;e++)t[e].Cn=e;t.sort(function(t,n){return t.materialIndex-n.materialIndex});var i,r,o=this.faceVertexUvs[0],s=this.faceVertexUvs[1];o&&o.length===n&&(i=[]),s&&s.length===n&&(r=[]);for(e=0;e<n;e++){var a=t[e].Cn;i&&i.push(o[a]),r&&r.push(s[a])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},dispose:function(){this.dispatchEvent({type:"dispose"})}});var lr=new Et;function dr(t,n,e){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=n,this.count=void 0!==t?t.length/n:0,this.normalized=!0===e,this.usage=ni,this.updateRange={offset:0,count:-1},this.version=0}function vr(t,n,e){dr.call(this,new Int8Array(t),n,e)}function pr(t,n,e){dr.call(this,new Uint8Array(t),n,e)}function mr(t,n,e){dr.call(this,new Uint8ClampedArray(t),n,e)}function gr(t,n,e){dr.call(this,new Int16Array(t),n,e)}function yr(t,n,e){dr.call(this,new Uint16Array(t),n,e)}function br(t,n,e){dr.call(this,new Int32Array(t),n,e)}function _r(t,n,e){dr.call(this,new Uint32Array(t),n,e)}function wr(t,n,e){dr.call(this,new Float32Array(t),n,e)}function xr(t,n,e){dr.call(this,new Float64Array(t),n,e)}function Mr(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function Er(t){if(0===t.length)return-1/0;for(var n=t[0],e=1,i=t.length;e<i;++e)t[e]>n&&(n=t[e]);return n}Object.defineProperty(dr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(dr.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,n,e){t*=this.itemSize,e*=n.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[t+i]=n.array[e+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),o=new _i),n[e++]=o.r,n[e++]=o.g,n[e++]=o.b}return this},copyVector2sArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new ii),n[e++]=o.x,n[e++]=o.y}return this},copyVector3sArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),o=new Et),n[e++]=o.x,n[e++]=o.y,n[e++]=o.z}return this},copyVector4sArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),o=new er),n[e++]=o.x,n[e++]=o.y,n[e++]=o.z,n[e++]=o.w}return this},applyMatrix3:function(t){for(var n=0,e=this.count;n<e;n++)lr.x=this.getX(n),lr.y=this.getY(n),lr.z=this.getZ(n),lr.applyMatrix3(t),this.setXYZ(n,lr.x,lr.y,lr.z);return this},applyMatrix4:function(t){for(var n=0,e=this.count;n<e;n++)lr.x=this.getX(n),lr.y=this.getY(n),lr.z=this.getZ(n),lr.applyMatrix4(t),this.setXYZ(n,lr.x,lr.y,lr.z);return this},applyNormalMatrix:function(t){for(var n=0,e=this.count;n<e;n++)lr.x=this.getX(n),lr.y=this.getY(n),lr.z=this.getZ(n),lr.applyNormalMatrix(t),this.setXYZ(n,lr.x,lr.y,lr.z);return this},transformDirection:function(t){for(var n=0,e=this.count;n<e;n++)lr.x=this.getX(n),lr.y=this.getY(n),lr.z=this.getZ(n),lr.transformDirection(t),this.setXYZ(n,lr.x,lr.y,lr.z);return this},set:function(t,n){return this.array.set(t,n=void 0===n?0:n),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,n){return this.array[t*this.itemSize]=n,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,n){return this.array[t*this.itemSize+1]=n,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,n){return this.array[t*this.itemSize+2]=n,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,n){return this.array[t*this.itemSize+3]=n,this},setXY:function(t,n,e){return t*=this.itemSize,this.array[t+0]=n,this.array[t+1]=e,this},setXYZ:function(t,n,e,i){return t*=this.itemSize,this.array[t+0]=n,this.array[t+1]=e,this.array[t+2]=i,this},setXYZW:function(t,n,e,i,r){return t*=this.itemSize,this.array[t+0]=n,this.array[t+1]=e,this.array[t+2]=i,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),(vr.prototype=Object.create(dr.prototype)).constructor=vr,(pr.prototype=Object.create(dr.prototype)).constructor=pr,(mr.prototype=Object.create(dr.prototype)).constructor=mr,(gr.prototype=Object.create(dr.prototype)).constructor=gr,yr.prototype=Object.create(dr.prototype),yr.prototype.constructor=yr,(br.prototype=Object.create(dr.prototype)).constructor=br,_r.prototype=Object.create(dr.prototype),_r.prototype.constructor=_r,(wr.prototype=Object.create(dr.prototype)).constructor=wr,(xr.prototype=Object.create(dr.prototype)).constructor=xr,Object.assign(Mr.prototype,{computeGroups:function(t){for(var n,e=[],i=void 0,r=t.faces,o=0;o<r.length;o++){var s=r[o];s.materialIndex!==i&&(i=s.materialIndex,void 0!==n&&(n.count=3*o-n.start,e.push(n)),n={start:3*o,materialIndex:i})}void 0!==n&&(n.count=3*o-n.start,e.push(n)),this.groups=e},fromGeometry:function(t){var n=t.faces,e=t.vertices,i=t.faceVertexUvs,r=i[0]&&0<i[0].length,o=i[1]&&0<i[1].length,s=t.morphTargets,a=s.length;if(0<a){for(var u=[],h=0;h<a;h++)u[h]={name:s[h].name,data:[]};this.morphTargets.position=u}var c=t.morphNormals,f=c.length;if(0<f){for(var l=[],h=0;h<f;h++)l[h]={name:c[h].name,data:[]};this.morphTargets.normal=l}var d=t.skinIndices,v=t.skinWeights,p=d.length===e.length,m=v.length===e.length;0<e.length&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(h=0;h<n.length;h++){var g=n[h];this.vertices.push(e[g.a],e[g.b],e[g.c]);var y=g.vertexNormals;3===y.length?this.normals.push(y[0],y[1],y[2]):(_=g.normal,this.normals.push(_,_,_));var b,_=g.vertexColors;3===_.length?this.colors.push(_[0],_[1],_[2]):(_=g.color,this.colors.push(_,_,_)),!0===r&&(void 0!==(b=i[0][h])?this.uvs.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",h),this.uvs.push(new ii,new ii,new ii))),!0===o&&(void 0!==(b=i[1][h])?this.uvs2.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",h),this.uvs2.push(new ii,new ii,new ii)));for(var w=0;w<a;w++){var x=s[w].vertices;u[w].data.push(x[g.a],x[g.b],x[g.c])}for(w=0;w<f;w++){var M=c[w].vertexNormals[h];l[w].data.push(M.a,M.b,M.c)}p&&this.skinIndices.push(d[g.a],d[g.b],d[g.c]),m&&this.skinWeights.push(v[g.a],v[g.b],v[g.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}});var Sr=1,Tr=new St,Lr=new Y,Or=new Et,Rr=new $,Ar=new $,Cr=new Et;function kr(){Object.defineProperty(this,"id",{value:Sr+=2}),this.uuid=Mt.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function Pr(t){return(Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Dr(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function jr(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Nr(t,n)}function Nr(t,n){return(Nr=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Ir(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Ur(e);return t=i?(t=Ur(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Pr(t)&&"function"!=typeof t?Fr(n):t}}function Fr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ur(t){return(Ur=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}kr.prototype=Object.assign(Object.create(g.prototype),{constructor:kr,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<Er(t)?_r:yr)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,n){return this.attributes[t]=n,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,n,e){this.groups.push({start:t,count:n,materialIndex:void 0!==e?e:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,n){this.drawRange.start=t,this.drawRange.count=n},applyMatrix4:function(t){var n=this.attributes.position;void 0!==n&&(n.applyMatrix4(t),n.needsUpdate=!0);var e=this.attributes.normal;void 0!==e&&(n=(new x).getNormalMatrix(t),e.applyNormalMatrix(n),e.needsUpdate=!0);e=this.attributes.tangent;return void 0!==e&&(e.transformDirection(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return Tr.makeRotationX(t),this.applyMatrix4(Tr),this},rotateY:function(t){return Tr.makeRotationY(t),this.applyMatrix4(Tr),this},rotateZ:function(t){return Tr.makeRotationZ(t),this.applyMatrix4(Tr),this},translate:function(t,n,e){return Tr.makeTranslation(t,n,e),this.applyMatrix4(Tr),this},scale:function(t,n,e){return Tr.makeScale(t,n,e),this.applyMatrix4(Tr),this},lookAt:function(t){return Lr.lookAt(t),Lr.updateMatrix(),this.applyMatrix4(Lr.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Or).negate(),this.translate(Or.x,Or.y,Or.z),this},setFromObject:function(t){var n,e,i=t.geometry;return t.isPoints||t.isLine?(n=new wr(3*i.vertices.length,3),e=new wr(3*i.colors.length,3),this.setAttribute("position",n.copyVector3sArray(i.vertices)),this.setAttribute("color",e.copyColorsArray(i.colors)),i.lineDistances&&i.lineDistances.length===i.vertices.length&&(e=new wr(i.lineDistances.length,1),this.setAttribute("lineDistance",e.copyArray(i.lineDistances))),null!==i.boundingSphere&&(this.boundingSphere=i.boundingSphere.clone()),null!==i.boundingBox&&(this.boundingBox=i.boundingBox.clone())):t.isMesh&&i&&i.isGeometry&&this.fromGeometry(i),this},setFromPoints:function(t){for(var n=[],e=0,i=t.length;e<i;e++){var r=t[e];n.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new wr(n,3)),this},updateFromObject:function(t){var n,e=t.geometry;if(t.isMesh){var i=e.kn;if(!0===e.elementsNeedUpdate&&(i=void 0,e.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(e);i.verticesNeedUpdate=e.verticesNeedUpdate,i.normalsNeedUpdate=e.normalsNeedUpdate,i.colorsNeedUpdate=e.colorsNeedUpdate,i.uvsNeedUpdate=e.uvsNeedUpdate,i.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=i}return!0===e.verticesNeedUpdate&&(void 0!==(n=this.attributes.position)&&(n.copyVector3sArray(e.vertices),n.needsUpdate=!0),e.verticesNeedUpdate=!1),!0===e.normalsNeedUpdate&&(void 0!==(n=this.attributes.normal)&&(n.copyVector3sArray(e.normals),n.needsUpdate=!0),e.normalsNeedUpdate=!1),!0===e.colorsNeedUpdate&&(void 0!==(n=this.attributes.color)&&(n.copyColorsArray(e.colors),n.needsUpdate=!0),e.colorsNeedUpdate=!1),e.uvsNeedUpdate&&(void 0!==(n=this.attributes.uv)&&(n.copyVector2sArray(e.uvs),n.needsUpdate=!0),e.uvsNeedUpdate=!1),e.lineDistancesNeedUpdate&&(void 0!==(n=this.attributes.lineDistance)&&(n.copyArray(e.lineDistances),n.needsUpdate=!0),e.lineDistancesNeedUpdate=!1),e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.kn=(new Mr).fromGeometry(t),this.fromDirectGeometry(t.kn)},fromDirectGeometry:function(t){var n,e,i,r,o=new Float32Array(3*t.vertices.length);for(i in this.setAttribute("position",new dr(o,3).copyVector3sArray(t.vertices)),0<t.normals.length&&(n=new Float32Array(3*t.normals.length),this.setAttribute("normal",new dr(n,3).copyVector3sArray(t.normals))),0<t.colors.length&&(n=new Float32Array(3*t.colors.length),this.setAttribute("color",new dr(n,3).copyColorsArray(t.colors))),0<t.uvs.length&&(e=new Float32Array(2*t.uvs.length),this.setAttribute("uv",new dr(e,2).copyVector2sArray(t.uvs))),0<t.uvs2.length&&(e=new Float32Array(2*t.uvs2.length),this.setAttribute("uv2",new dr(e,2).copyVector2sArray(t.uvs2))),this.groups=t.groups,t.morphTargets){for(var s=[],a=t.morphTargets[i],u=0,h=a.length;u<h;u++){var c=a[u],f=new wr(3*c.data.length,3);f.name=c.name,s.push(f.copyVector3sArray(c.data))}this.morphAttributes[i]=s}return 0<t.skinIndices.length&&(r=new wr(4*t.skinIndices.length,4),this.setAttribute("skinIndex",r.copyVector4sArray(t.skinIndices))),0<t.skinWeights.length&&(r=new wr(4*t.skinWeights.length,4),this.setAttribute("skinWeight",r.copyVector4sArray(t.skinWeights))),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new it);var t=this.attributes.position,n=this.morphAttributes.position;if(t){var e=this.boundingSphere.center;if(Rr.setFromBufferAttribute(t),n)for(var i=0,r=n.length;i<r;i++){var o=n[i];Ar.setFromBufferAttribute(o),this.morphTargetsRelative?(Cr.addVectors(Rr.min,Ar.min),Rr.expandByPoint(Cr),Cr.addVectors(Rr.max,Ar.max),Rr.expandByPoint(Cr)):(Rr.expandByPoint(Ar.min),Rr.expandByPoint(Ar.max))}Rr.getCenter(e);for(var s=0,i=0,r=t.count;i<r;i++)Cr.fromBufferAttribute(t,i),s=Math.max(s,e.distanceToSquared(Cr));if(n)for(i=0,r=n.length;i<r;i++)for(var o=n[i],a=this.morphTargetsRelative,u=0,h=o.count;u<h;u++)Cr.fromBufferAttribute(o,u),a&&(Or.fromBufferAttribute(t,u),Cr.add(Or)),s=Math.max(s,e.distanceToSquared(Cr));this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,n=this.attributes;if(n.position){var e=n.position.array;if(void 0===n.normal)this.setAttribute("normal",new dr(new Float32Array(e.length),3));else for(var i=n.normal.array,r=0,o=i.length;r<o;r++)i[r]=0;var s,a,u,h=n.normal.array,c=new Et,f=new Et,l=new Et,d=new Et,v=new Et;if(t)for(var p=t.array,r=0,o=t.count;r<o;r+=3)s=3*p[r+0],a=3*p[r+1],u=3*p[r+2],c.fromArray(e,s),f.fromArray(e,a),l.fromArray(e,u),d.subVectors(l,f),v.subVectors(c,f),d.cross(v),h[s]+=d.x,h[1+s]+=d.y,h[2+s]+=d.z,h[a]+=d.x,h[1+a]+=d.y,h[2+a]+=d.z,h[u]+=d.x,h[1+u]+=d.y,h[2+u]+=d.z;else for(r=0,o=e.length;r<o;r+=9)c.fromArray(e,r),f.fromArray(e,r+3),l.fromArray(e,r+6),d.subVectors(l,f),v.subVectors(c,f),d.cross(v),h[r]=d.x,h[r+1]=d.y,h[r+2]=d.z,h[r+3]=d.x,h[r+4]=d.y,h[r+5]=d.z,h[r+6]=d.x,h[r+7]=d.y,h[r+8]=d.z;this.normalizeNormals(),n.normal.needsUpdate=!0}},normalizeNormals:function(){for(var t=this.attributes.normal,n=0,e=t.count;n<e;n++)Cr.x=t.getX(n),Cr.y=t.getY(n),Cr.z=t.getZ(n),Cr.normalize(),t.setXYZ(n,Cr.x,Cr.y,Cr.z)},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Gr=function(){jr(h,kr);var u=Ir(h);function h(t,n,e,i,r,o){var s;Dr(this,h),(s=u.call(this)).type="BoxBufferGeometry",s.parameters={width:t,height:n,depth:e,widthSegments:i,heightSegments:r,depthSegments:o};var L=Fr(s);t=t||1,n=n||1,e=e||1,i=Math.floor(i)||1,r=Math.floor(r)||1,o=Math.floor(o)||1;var O=[],R=[],A=[],C=[],k=0,P=0;function a(t,n,e,i,r,o,s,a,u,h,c){for(var f=o/u,l=s/h,d=o/2,v=s/2,p=a/2,m=u+1,g=h+1,y=0,b=0,_=new Et,w=0;w<g;w++)for(var x=w*l-v,M=0;M<m;M++)_[t]=(M*f-d)*i,_[n]=x*r,_[e]=p,R.push(_.x,_.y,_.z),_[t]=0,_[n]=0,_[e]=0<a?1:-1,A.push(_.x,_.y,_.z),C.push(M/u),C.push(1-w/h),y+=1;for(w=0;w<h;w++)for(M=0;M<u;M++){var E=k+M+m*(w+1),S=k+(M+1)+m*(w+1),T=k+(M+1)+m*w;O.push(k+M+m*w,E,T),O.push(E,S,T),b+=6}L.addGroup(P,b,c),P+=b,k+=y}return a("z","y","x",-1,-1,e,n,t,o,r,0),a("z","y","x",1,-1,e,n,-t,o,r,1),a("x","z","y",1,1,t,e,n,i,o,2),a("x","z","y",1,-1,t,e,-n,i,o,3),a("x","y","z",1,-1,t,n,e,i,r,4),a("x","y","z",-1,-1,t,n,-e,i,r,5),s.setIndex(O),s.setAttribute("position",new wr(R,3)),s.setAttribute("normal",new wr(A,3)),s.setAttribute("uv",new wr(C,2)),s}return h}();function Br(t,n,e,i){kr.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:n,widthSegments:e,heightSegments:i};for(var r=(t=t||1)/2,o=(n=n||1)/2,s=Math.floor(e)||1,a=Math.floor(i)||1,u=s+1,h=a+1,c=t/s,f=n/a,l=[],d=[],v=[],p=[],m=0;m<h;m++)for(var g=m*f-o,y=0;y<u;y++)d.push(y*c-r,-g,0),v.push(0,0,1),p.push(y/s),p.push(1-m/a);for(m=0;m<a;m++)for(y=0;y<s;y++){var b=y+u*(m+1),_=y+1+u*(m+1),w=y+1+u*m;l.push(y+u*m,b,w),l.push(b,_,w)}this.setIndex(l),this.setAttribute("position",new wr(d,3)),this.setAttribute("normal",new wr(v,3)),this.setAttribute("uv",new wr(p,2))}(Br.prototype=Object.create(kr.prototype)).constructor=Br;var Hr=0;function Vr(){Object.defineProperty(this,"id",{value:Hr++}),this.uuid=Mt.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=_t,this.side=gt,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Ft,this.blendDst=Ut,this.blendEquation=Rt,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Zt,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=ti,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=$e,this.stencilZFail=$e,this.stencilZPass=$e,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function zr(t){var n,e={};for(n in t)for(var i in e[n]={},t[n]){var r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}return e}function Wr(t){for(var n={},e=0;e<t.length;e++){var i,r=zr(t[e]);for(i in r)n[i]=r[i]}return n}Vr.prototype=Object.assign(Object.create(g.prototype),{constructor:Vr,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var n in t){var e,i=t[n];void 0!==i?"shading"!==n?void 0!==(e=this[n])?e&&e.isColor?e.set(i):e&&e.isVector3&&i&&i.isVector3?e.copy(i):this[n]=i:console.warn("THREE."+this.type+": '"+n+"' is not a property of this material."):(console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===i):console.warn("THREE.Material: '"+n+"' parameter is undefined.")}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var n=t.clippingPlanes,e=null;if(null!==n)for(var i=n.length,e=new Array(i),r=0;r!==i;++r)e[r]=n[r].clone();return this.clippingPlanes=e,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Vr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}});var Xr={clone:zr,merge:Wr},Yr="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",Zr="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n";function qr(t){Vr.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=Yr,this.fragmentShader=Zr,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}((qr.prototype=Object.create(Vr.prototype)).constructor=qr).prototype.isShaderMaterial=!0,qr.prototype.copy=function(t){return Vr.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=zr(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this};var Kr=new Et,Jr=new Et,Qr=new Et,$r=new Et,to=new Et,no=new Et,eo=new Et,io=new Et,ro=new Et,oo=new Et;function so(t,n,e){this.a=void 0!==t?t:new Et,this.b=void 0!==n?n:new Et,this.c=void 0!==e?e:new Et}function ao(t){Vr.call(this),this.type="MeshBasicMaterial",this.color=new _i(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$t,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(t)}Object.assign(so,{getNormal:function(t,n,e,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new Et),i.subVectors(e,n),Kr.subVectors(t,n),i.cross(Kr);n=i.lengthSq();return 0<n?i.multiplyScalar(1/Math.sqrt(n)):i.set(0,0,0)},getBarycoord:function(t,n,e,i,r){Kr.subVectors(i,n),Jr.subVectors(e,n),Qr.subVectors(t,n);var o=Kr.dot(Kr),s=Kr.dot(Jr),i=Kr.dot(Qr),e=Jr.dot(Jr),t=Jr.dot(Qr),n=o*e-s*s;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new Et),0==n)return r.set(-2,-1,-1);n=1/n,e=(e*i-s*t)*n,n*=o*t-s*i;return r.set(1-e-n,n,e)},containsPoint:function(t,n,e,i){return so.getBarycoord(t,n,e,i,$r),0<=$r.x&&0<=$r.y&&$r.x+$r.y<=1},getUV:function(t,n,e,i,r,o,s,a){return this.getBarycoord(t,n,e,i,$r),a.set(0,0),a.addScaledVector(r,$r.x),a.addScaledVector(o,$r.y),a.addScaledVector(s,$r.z),a},isFrontFacing:function(t,n,e,i){return Kr.subVectors(e,n),Jr.subVectors(t,n),Kr.cross(Jr).dot(i)<0}}),Object.assign(so.prototype,{set:function(t,n,e){return this.a.copy(t),this.b.copy(n),this.c.copy(e),this},setFromPointsAndIndices:function(t,n,e,i){return this.a.copy(t[n]),this.b.copy(t[e]),this.c.copy(t[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return Kr.subVectors(this.c,this.b),Jr.subVectors(this.a,this.b),.5*Kr.cross(Jr).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new Et),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return so.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new ai),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,n){return so.getBarycoord(t,this.a,this.b,this.c,n)},getUV:function(t,n,e,i,r){return so.getUV(t,this.a,this.b,this.c,n,e,i,r)},containsPoint:function(t){return so.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return so.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,n){void 0===n&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),n=new Et);var e=this.a,i=this.b,r=this.c;to.subVectors(i,e),no.subVectors(r,e),io.subVectors(t,e);var o=to.dot(io),s=no.dot(io);if(o<=0&&s<=0)return n.copy(e);ro.subVectors(t,i);var a=to.dot(ro),u=no.dot(ro);if(0<=a&&u<=a)return n.copy(i);var h=o*u-a*s;if(h<=0&&0<=o&&a<=0)return f=o/(o-a),n.copy(e).addScaledVector(to,f);oo.subVectors(t,r);var c=to.dot(oo),t=no.dot(oo);if(0<=t&&c<=t)return n.copy(r);o=c*s-o*t;if(o<=0&&0<=s&&t<=0)return l=s/(s-t),n.copy(e).addScaledVector(no,l);s=a*t-c*u;if(s<=0&&0<=u-a&&0<=c-t)return eo.subVectors(r,i),l=(u-a)/(u-a+(c-t)),n.copy(i).addScaledVector(eo,l);var s=1/(s+o+h),f=o*s,l=h*s;return n.copy(e).addScaledVector(to,f).addScaledVector(no,l)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),((ao.prototype=Object.create(Vr.prototype)).constructor=ao).prototype.isMeshBasicMaterial=!0,ao.prototype.copy=function(t){return Vr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};var uo=new St,ho=new Bi,co=new it,fo=new Et,lo=new Et,vo=new Et,po=new Et,mo=new Et,go=new Et,yo=new Et,bo=new Et,_o=new Et,wo=new ii,xo=new ii,Mo=new ii,Eo=new Et,So=new Et;function To(t,n){Y.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new kr,this.material=void 0!==n?n:new ao,this.updateMorphTargets()}function Lo(t,n,e,i,r,o,s,a){n=n.side===Tt?i.intersectTriangle(s,o,r,!0,a):i.intersectTriangle(r,o,s,n.side!==yt,a);if(null===n)return null;So.copy(a),So.applyMatrix4(t.matrixWorld);a=e.ray.origin.distanceTo(So);return a<e.near||a>e.far?null:{distance:a,point:So.clone(),object:t}}function Oo(t,n,e,i,r,o,s,a,u,h,c,f){fo.fromBufferAttribute(r,h),lo.fromBufferAttribute(r,c),vo.fromBufferAttribute(r,f);var l=t.morphTargetInfluences;if(n.morphTargets&&o&&l){yo.set(0,0,0),bo.set(0,0,0),_o.set(0,0,0);for(var d=0,v=o.length;d<v;d++){var p=l[d],m=o[d];0!==p&&(po.fromBufferAttribute(m,h),mo.fromBufferAttribute(m,c),go.fromBufferAttribute(m,f),s?(yo.addScaledVector(po,p),bo.addScaledVector(mo,p),_o.addScaledVector(go,p)):(yo.addScaledVector(po.sub(fo),p),bo.addScaledVector(mo.sub(lo),p),_o.addScaledVector(go.sub(vo),p)))}fo.add(yo),lo.add(bo),vo.add(_o)}i=Lo(t,n,e,i,fo,lo,vo,Eo);return i&&(a&&(wo.fromBufferAttribute(a,h),xo.fromBufferAttribute(a,c),Mo.fromBufferAttribute(a,f),i.uv=so.getUV(Eo,fo,lo,vo,wo,xo,Mo,new ii)),u&&(wo.fromBufferAttribute(u,h),xo.fromBufferAttribute(u,c),Mo.fromBufferAttribute(u,f),i.uv2=so.getUV(Eo,fo,lo,vo,wo,xo,Mo,new ii)),u=new sr(h,c,f),so.getNormal(fo,lo,vo,u.normal),i.face=u),i}To.prototype=Object.assign(Object.create(Y.prototype),{constructor:To,isMesh:!0,copy:function(t){return Y.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,n,e,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(0<o.length){var s=r[o[0]];if(void 0!==s)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,n=s.length;t<n;t++)e=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}else{i=i.morphTargets;void 0!==i&&0<i.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,n){var e=this.geometry,i=this.material,r=this.matrixWorld;if(void 0!==i&&(null===e.boundingSphere&&e.computeBoundingSphere(),co.copy(e.boundingSphere),co.applyMatrix4(r),!1!==t.ray.intersectsSphere(co)&&(uo.getInverse(r),ho.copy(t.ray).applyMatrix4(uo),null===e.boundingBox||!1!==ho.intersectsBox(e.boundingBox))))if(e.isBufferGeometry){var o,s,a,u,h,c,f,l,d,v=e.index,p=e.attributes.position,m=e.morphAttributes.position,g=e.morphTargetsRelative,y=e.attributes.uv,b=e.attributes.uv2,_=e.groups,w=e.drawRange;if(null!==v)if(Array.isArray(i))for(u=0,c=_.length;u<c;u++)for(d=i[(l=_[u]).materialIndex],h=Math.max(l.start,w.start),f=Math.min(l.start+l.count,w.start+w.count);h<f;h+=3)o=v.getX(h),s=v.getX(h+1),a=v.getX(h+2),(C=Oo(this,d,t,ho,p,m,g,y,b,o,s,a))&&(C.faceIndex=Math.floor(h/3),C.face.materialIndex=l.materialIndex,n.push(C));else for(u=Math.max(0,w.start),c=Math.min(v.count,w.start+w.count);u<c;u+=3)o=v.getX(u),s=v.getX(u+1),a=v.getX(u+2),(C=Oo(this,i,t,ho,p,m,g,y,b,o,s,a))&&(C.faceIndex=Math.floor(u/3),n.push(C));else if(void 0!==p)if(Array.isArray(i))for(u=0,c=_.length;u<c;u++)for(d=i[(l=_[u]).materialIndex],h=Math.max(l.start,w.start),f=Math.min(l.start+l.count,w.start+w.count);h<f;h+=3)(C=Oo(this,d,t,ho,p,m,g,y,b,o=h,s=h+1,a=h+2))&&(C.faceIndex=Math.floor(h/3),C.face.materialIndex=l.materialIndex,n.push(C));else for(u=Math.max(0,w.start),c=Math.min(p.count,w.start+w.count);u<c;u+=3)(C=Oo(this,i,t,ho,p,m,g,y,b,o=u,s=u+1,a=u+2))&&(C.faceIndex=Math.floor(u/3),n.push(C))}else if(e.isGeometry){var x,M=Array.isArray(i),E=e.vertices,S=e.faces,e=e.faceVertexUvs[0];0<e.length&&(x=e);for(var T=0,L=S.length;T<L;T++){var O,R,A,C,k=S[T],P=M?i[k.materialIndex]:i;void 0!==P&&(O=E[k.a],R=E[k.b],A=E[k.c],(C=Lo(this,P,t,ho,O,R,A,Eo))&&(x&&x[T]&&(P=x[T],wo.copy(P[0]),xo.copy(P[1]),Mo.copy(P[2]),C.uv=so.getUV(Eo,O,R,A,wo,xo,Mo,new ii)),C.face=k,C.faceIndex=T,n.push(C)))}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Ro={alphamap_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",alphamap_pars_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",alphatest_fragment:"\n#ifdef ALPHATEST\n\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n",aomap_fragment:"\n#ifdef USE_AOMAP\n\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\n\t#endif\n\n#endif\n",aomap_pars_fragment:"\n#ifdef USE_AOMAP\n\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n\n#endif\n",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n\n#ifdef USE_TANGENT\n\n\tvec3 objectTangent = vec3( tangent.xyz );\n\n#endif\n",bsdfs:'\n\n// Analytical approximation of the DFG LUT, one half of the\n// split-sum approximation used in indirect specular lighting.\n// via \'environmentBRDF\' from "Physically Based Shading on Mobile"\n// https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nvec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\n\tvec4 r = roughness * c0 + c1;\n\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n}\n\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\n\t// based upon Frostbite 3 Moving to Physically-based Rendering\n\t// page 32, equation 26: E[window1]\n\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\n\t// this is intended to be used on spot and point lights who are represented as luminous intensity\n\t// but who must be converted to luminous irradiance for surface lighting calculation\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\n\tif( cutoffDistance > 0.0 ) {\n\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\n\t}\n\n\treturn distanceFalloff;\n\n#else\n\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\n\t}\n\n\treturn 1.0;\n\n#endif\n\n}\n\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\n\treturn RECIPROCAL_PI * diffuseColor;\n\n} // validated\n\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\n\t// Original approximation by Christophe Schlick \'94\n\t// float fresnel = pow( 1.0 - dotLH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH \'13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n\n} // validated\n\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\n\t// See F_Schlick\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\n\treturn Fr * fresnel + F0;\n\n}\n\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (34)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\t// geometry term (normalized) = G(l)⋅G(v) / 4(n⋅l)(n⋅v)\n\t// also see #12151\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\n\treturn 1.0 / ( gl * gv );\n\n} // validated\n\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\tfloat a2 = pow2( alpha );\n\n\t// dotNL and dotNV are explicitly swapped. This is not a mistake.\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\n\treturn 0.5 / max( gv + gl, EPSILON );\n\n}\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\n\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n\n}\n\n// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\n\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\n\tfloat D = D_GGX( alpha, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n// Rect Area Light\n\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\n// code: https://github.com/selfshadow/ltc_code/\n\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\n\tfloat dotNV = saturate( dot( N, V ) );\n\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\treturn uv;\n\n}\n\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\n\t// An approximation of the form factor of a horizon-clipped rectangle.\n\n\tfloat l = length( f );\n\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n\n}\n\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\n\tfloat x = dot( v1, v2 );\n\n\tfloat y = abs( x );\n\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\n\treturn cross( v1, v2 ) * theta_sintheta;\n\n}\n\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\n\t// bail if point is on back side of plane of light\n\t// assumes ccw winding order of light vertices\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\n\t// construct orthonormal basis around N\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\n\n\t// compute transform\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\n\t// transform rect\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\n\t// project rect onto sphere\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\n\t// calculate vector form factor\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\n\t// adjust for horizon clipping\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\n/*\n\t// alternate method of adjusting for horizon clipping (see referece)\n\t// refactoring required\n\tfloat len = length( vectorFormFactor );\n\tfloat z = vectorFormFactor.z / len;\n\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\n\t// tabulated horizon-clipped sphere, apparently...\n\tvec2 uv = vec2( z * 0.5 + 0.5, len );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\tfloat scale = texture2D( ltc_2, uv ).w;\n\n\tfloat result = len * scale;\n*/\n\n\treturn vec3( result );\n\n}\n\n// End Rect Area Light\n\n// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\n\treturn specularColor * brdf.x + brdf.y;\n\n} // validated\n\n// Fdez-Agüera\'s "Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting"\n// Approximates multiscattering in order to preserve energy.\n// http://www.jcgt.org/published/0008/01/03/\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; // 1/21\n\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n\n}\n\nfloat G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) {\n\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\n\treturn 0.25;\n\n}\n\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n\n}\n\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\n\t//float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\t//float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\n\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n\n#if defined( USE_SHEEN )\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L94\nfloat D_Charlie(float roughness, float NoH) {\n\t// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF"\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125); // 2^(-14/2), so sin2h^2 > 0 in fp16\n\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L136\nfloat V_Neubelt(float NoV, float NoL) {\n\t// Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886"\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\n\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n\n}\n\n#endif\n',bumpmap_pars_fragment:"\n#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen\n\t// http://api.unrealengine.com/attachments/Engine/Rendering/LightingAndShadows/BumpMappingWithoutTangentSpace/mm_sfgrad_bump.pdf\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n",clipping_planes_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvec4 plane;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\n\t\tbool clipped = true;\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t\tif ( clipped ) discard;\n\n\t#endif\n\n#endif\n",clipping_planes_pars_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n\n#endif\n",clipping_planes_pars_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n#endif\n",clipping_planes_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvClipPosition = - mvPosition.xyz;\n\n#endif\n",color_fragment:"\n#ifdef USE_COLOR\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif\n",color_pars_fragment:"\n#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n",color_pars_vertex:"\n#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n",color_vertex:"\n#ifdef USE_COLOR\n\n\tvColor.xyz = color.xyz;\n\n#endif\n",common:"\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n\n#ifndef saturate\n// <tonemapping_pars_fragment> may have defined saturate() already\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\n\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\n\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\n\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n}\n\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t// dir can be either a direction vector or a normal vector\n\t// upper-left 3x3 of matrix is assumed to be orthogonal\n\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n\n}\n\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\n\treturn - distance * planeNormal + point;\n\n}\n\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n\n}\n\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n\n}\n\nmat3 transposeMat3( const in mat3 m ) {\n\n\tmat3 tmp;\n\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\n\treturn tmp;\n\n}\n\n// https://en.wikipedia.org/wiki/Relative_luminance\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\n\treturn dot( weights, color.rgb );\n\n}\n\nbool isPerspectiveMatrix( mat4 m ) {\n\n return m[ 2 ][ 3 ] == - 1.0;\n\n}\n",cube_uv_reflection_fragment:"\n#ifdef ENVMAP_TYPE_CUBE_UV\n\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\n\n// These shader functions convert between the UV coordinates of a single face of\n// a cubemap, the 0-5 integer index of a cube face, and the direction vector for\n// sampling a textureCube (not generally normalized).\n\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\n\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x);\n } else if (face == 1.0) {\n uv = vec2(direction.x, -direction.z) / abs(direction.y);\n } else if (face == 2.0) {\n uv = direction.xy / abs(direction.z);\n } else if (face == 3.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x);\n } else if (face == 4.0) {\n uv = direction.xz / abs(direction.y);\n } else {\n uv = vec2(-direction.x, direction.y) / abs(direction.z);\n }\n return 0.5 * (uv + 1.0);\n}\n\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n\n// These defines must match with PMREMGenerator\n\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\n\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25\n }\n return mip;\n}\n\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif\n",defaultnormal_vertex:"\nvec3 transformedNormal = objectNormal;\n\n#ifdef USE_INSTANCING\n\n\t// this is in lieu of a per-instance normal-matrix\n\t// shear transforms in the instance matrix are not supported\n\n\tmat3 m = mat3( instanceMatrix );\n\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\n\ttransformedNormal = m * transformedNormal;\n\n#endif\n\ntransformedNormal = normalMatrix * transformedNormal;\n\n#ifdef FLIP_SIDED\n\n\ttransformedNormal = - transformedNormal;\n\n#endif\n\n#ifdef USE_TANGENT\n\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#ifdef FLIP_SIDED\n\n\t\ttransformedTangent = - transformedTangent;\n\n\t#endif\n\n#endif\n",displacementmap_pars_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n\n#endif\n",displacementmap_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n\n#endif\n",emissivemap_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n\n#endif\n",emissivemap_pars_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tuniform sampler2D emissiveMap;\n\n#endif\n",encodings_fragment:"\ngl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\n// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/\n\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\n\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\n\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\n\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\n\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\n\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\n\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n// return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 );\n}\n\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\n\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\n\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\n\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\t// NOTE: The implementation with min causes the shader to not compile on\n\t// a common Alcatel A502DL in Chrome 78/Android 8.1. Some research suggests \n\t// that the chipset is Mediatek MT6739 w/ IMG PowerVR GE8100 GPU.\n\t// D = min( floor( D ) / 255.0, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\n\n// LogLuv reference: http://graphicrants.blogspot.ca/2009/04/rgbm-color-encoding.html\n\n// M matrix, for encoding\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\n\n// Inverse M matrix, for decoding\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}\n",envmap_fragment:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\n\t\t}\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\n\t\tvec2 sampleUV;\n\n\t\treflectVec = normalize( reflectVec );\n\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\n\t\treflectVec = normalize( reflectVec );\n\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\n\t#else\n\n\t\tvec4 envColor = vec4( 0.0 );\n\n\t#endif\n\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\n\t\tenvColor = envMapTexelToLinear( envColor );\n\n\t#endif\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",envmap_common_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif\n",envmap_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n\n#endif\n",envmap_pars_vertex:"\n#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\n\t#endif\n\n#endif\n",envmap_physical_pars_fragment:"\n#if defined( USE_ENVMAP )\n\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\n\tvec3 getLightProbeIndirectIrradiance( /*const in SpecularLightProbe specularLightProbe,*/ const in GeometricContext geometry, const in int maxMIPLevel ) {\n\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\n\t\t\t// TODO: replace with properly filtered cubemaps and access the irradiance LOD level, be it the last LOD level\n\t\t\t// of a specular cubemap, or just the default level of a specially created irradiance cubemap.\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\n\t\t\t#else\n\n\t\t\t\t// force the bias high to get the last LOD level as it is the most blurred.\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\n\t\t#else\n\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\n\t\t#endif\n\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\n\t}\n\n\t// Trowbridge-Reitz distribution to Mip level, following the logic of http://casual-effects.blogspot.ca/2011/08/plausible-environment-lighting-in-two.html\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\n\t\t// clamp to allowable LOD ranges.\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\n\t}\n\n\tvec3 getLightProbeIndirectRadiance( /*const in SpecularLightProbe specularLightProbe,*/ const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\n\t\t // Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\n\t\t#else\n\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\n\t\t#endif\n\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#endif\n\n\t\treturn envMapColor.rgb * envMapIntensity;\n\n\t}\n\n#endif\n",envmap_vertex:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvWorldPosition = worldPosition.xyz;\n\n\t#else\n\n\t\tvec3 cameraToVertex;\n\n\t\tif ( isOrthographic ) { \n\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t\t}\n\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\n\n\tfogDepth = -mvPosition.z;\n\n#endif\n",fog_pars_vertex:"\n#ifdef USE_FOG\n\n\tvarying float fogDepth;\n\n#endif\n",fog_fragment:"\n#ifdef USE_FOG\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\n\t#endif\n\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n\n#endif\n",fog_pars_fragment:"\n#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\n\t#endif\n\n#endif\n",gradientmap_pars_fragment:"\n\n#ifdef USE_GRADIENTMAP\n\n\tuniform sampler2D gradientMap;\n\n#endif\n\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\n\t// dotNL will be from -1.0 to 1.0\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\n\t#ifdef USE_GRADIENTMAP\n\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\n\t#else\n\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\n\t#endif\n\n}\n\n",lightmap_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage\n\n#endif\n",lightmap_pars_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n\n#endif\n",lights_lambert_vertex:"\nvec3 diffuse = vec3( 1.0 );\n\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\n\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\n\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\n\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n\n#if NUM_POINT_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if NUM_SPOT_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n/*\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\t// TODO (abelnation): implement\n\n\t}\n\n#endif\n*/\n\n#if NUM_DIR_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if NUM_HEMI_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n",lights_pars_begin:"\nuniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\n\n// get the irradiance (radiance convolved with cosine lobe) at the point 'normal' on the unit sphere\n// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\n\t// normal is assumed to have unit length\n\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\n\t// band 0\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\n\t// band 1\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\n\t// band 2\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\n\treturn result;\n\n}\n\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\n\treturn irradiance;\n\n}\n\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\n\tvec3 irradiance = ambientLightColor;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI;\n\n\t#endif\n\n\treturn irradiance;\n\n}\n\n#if NUM_DIR_LIGHTS > 0\n\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\n\t}\n\n#endif\n\n\n#if NUM_POINT_LIGHTS > 0\n\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\n\t}\n\n#endif\n\n\n#if NUM_SPOT_LIGHTS > 0\n\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\n\t\tif ( angleCos > spotLight.coneCos ) {\n\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\n\t\t} else {\n\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\n\t\t}\n\t}\n\n#endif\n\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\n\t// BRDF approximation Texture is 64x64\n\tuniform sampler2D ltc_1; // RGBA Float\n\tuniform sampler2D ltc_2; // RGBA Float\n\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n\n#endif\n\n\n#if NUM_HEMI_LIGHTS > 0\n\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tirradiance *= PI;\n\n\t\t#endif\n\n\t\treturn irradiance;\n\n\t}\n\n#endif\n",lights_toon_fragment:"\nToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_toon_pars_fragment:"\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n\nstruct ToonMaterial {\n\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n\n};\n\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n\n}\n\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n\n#define Material_LightProbeLOD( material )\t(0)\n",lights_phong_fragment:"\nBlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n\nstruct BlinnPhongMaterial {\n\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n\n};\n\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n\n}\n\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"\nPhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\n\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\n\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.\nmaterial.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n\n#ifdef REFLECTIVITY\n\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\n#else\n\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n\n#endif\n\n#ifdef CLEARCOAT\n\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\n\t#ifdef USE_CLEARCOATMAP\n\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\n\t#endif\n\n\tmaterial.clearcoat = saturate( material.clearcoat ); // Burley clearcoat model\n\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n\n#endif\n\n#ifdef USE_SHEEN\n\n\tmaterial.sheenColor = sheen;\n\n#endif\n",lights_physical_pars_fragment:"\nstruct PhysicalMaterial {\n\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n\n};\n\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\n\n// Clear coat directional hemishperical reflectance (this approximation should be improved)\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n\n}\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight; // counterclockwise; light shines in local neg z direction\n\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\n\t\t// LTC Fresnel Approximation by Stephen Hill\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\n\t}\n\n#endif\n\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\n\tvec3 irradiance = dotNL * directLight.color;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\t#ifdef CLEARCOAT\n\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tccIrradiance *= PI; // punctual light\n\n\t\t#endif\n\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\n\t#else\n\n\t\tfloat clearcoatDHR = 0.0;\n\n\t#endif\n\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\n\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\n\t#ifdef CLEARCOAT\n\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\n\t#else\n\n\t\tfloat clearcoatDHR = 0.0;\n\n\t#endif\n\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\n\t// Both indirect specular and indirect diffuse light accumulate here\n\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n\n}\n",lights_fragment_begin:"\n/**\n * This is a template that can be used to light a material, it uses pluggable\n * RenderEquations (RE)for specific lighting scenarios.\n *\n * Instructions for use:\n * - Ensure that both RE_Direct, RE_IndirectDiffuse and RE_IndirectSpecular are defined\n * - If you have defined an RE_IndirectSpecular, you need to also provide a Material_LightProbeLOD. <---- ???\n * - Create a material parameter that is to be passed as the third parameter to your lighting functions.\n *\n * TODO:\n * - Add area light support.\n * - Add sphere light support.\n * - Add diffuse light probe (irradiance cubemap) support.\n */\n\nGeometricContext geometry;\n\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n#ifdef CLEARCOAT\n\n\tgeometry.clearcoatNormal = clearcoatNormal;\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",lights_fragment_maps:"\n#if defined( RE_IndirectDiffuse )\n\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\n\n\t\t#endif\n\n\t\tirradiance += lightMapIrradiance;\n\n\t#endif\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( /*lightProbe,*/ geometry, maxMipLevel );\n\n\t#endif\n\n#endif\n\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\n\tradiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\n\t#ifdef CLEARCOAT\n\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\n\t#endif\n\n#endif\n",lights_fragment_end:"\n#if defined( RE_IndirectDiffuse )\n\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n\n#endif\n",logdepthbuf_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\t// Doing a strict comparison with == 1.0 can cause noise artifacts\n\t// on some platforms. See issue #17623.\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n\n#endif\n",logdepthbuf_pars_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n\n#endif\n",logdepthbuf_pars_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\n\t#else\n\n\t\tuniform float logDepthBufFC;\n\n\t#endif\n\n#endif\n",logdepthbuf_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\n\t#else\n\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\n\t\t\tgl_Position.z *= gl_Position.w;\n\n\t\t}\n\n\t#endif\n\n#endif\n",map_fragment:"\n#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n\n#endif\n",map_fragment_1:"\n#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor = mapTexelToLinear( texelColor );\n\t\n\tif(mapMixColor){\n\t diffuseColor = texelColor*texelColor.a + diffuseColor*(1.0-texelColor.a);\n\t}else {\n\t diffuseColor *= texelColor;\n\t}\n\n#endif\n",map_pars_fragment:"\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n",map_particle_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\n#endif\n\n#ifdef USE_MAP\n\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n\n#endif\n",map_particle_pars_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\tuniform mat3 uvTransform;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",metalnessmap_fragment:"\nfloat metalnessFactor = metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n",metalnessmap_pars_fragment:"\n#ifdef USE_METALNESSMAP\n\n\tuniform sampler2D metalnessMap;\n\n#endif\n",morphnormal_vertex:"\n#ifdef USE_MORPHNORMALS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\n#endif\n",morphtarget_pars_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\tuniform float morphTargetBaseInfluence;\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif\n",morphtarget_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in position = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n#endif\n",normal_fragment_begin:"\n#ifdef FLAT_SHADED\n\n\t// Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...\n\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n\n#else\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t#endif\n\n\t#ifdef USE_TANGENT\n\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t\t#endif\n\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n\n// non perturbed normal for clearcoat among others\n\nvec3 geometryNormal = normal;\n\n",normal_fragment_maps:"\n\n#ifdef OBJECTSPACE_NORMALMAP\n\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals\n\n\t#ifdef FLIP_SIDED\n\n\t\tnormal = - normal;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t#endif\n\n\tnormal = normalize( normalMatrix * normal );\n\n#elif defined( TANGENTSPACE_NORMALMAP )\n\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\n\t#ifdef USE_TANGENT\n\n\t\tnormal = normalize( vTBN * mapN );\n\n\t#else\n\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\n\t#endif\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n",normalmap_pars_fragment:"\n#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n#endif\n\n#ifdef OBJECTSPACE_NORMALMAP\n\n\tuniform mat3 normalMatrix;\n\n#endif\n\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\n\t// Per-Pixel Tangent Space Normal Mapping\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s ); // we do not care about the magnitude\n\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\n\t\tmat3 tsn = mat3( S, T, N );\n\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t\treturn normalize( tsn * mapN );\n\n\t}\n\n#endif\n",clearcoat_normal_fragment_begin:"\n#ifdef CLEARCOAT\n\n\tvec3 clearcoatNormal = geometryNormal;\n\n#endif\n",clearcoat_normal_fragment_maps:"\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\n\t#ifdef USE_TANGENT\n\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\n\t#else\n\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\n\t#endif\n\n#endif\n",clearcoat_pars_fragment:"\n\n#ifdef USE_CLEARCOATMAP\n\n\tuniform sampler2D clearcoatMap;\n\n#endif\n\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tuniform sampler2D clearcoatRoughnessMap;\n\n#endif\n\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n\n#endif\n",packing:"\nvec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\n\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\n\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\n\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\n\nconst float ShiftRight8 = 1. / 256.;\n\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\n\treturn r * PackUpscale;\n}\n\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\n\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\n\n// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions\n\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\n\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"\n#ifdef PREMULTIPLIED_ALPHA\n\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\n\tgl_FragColor.rgb *= gl_FragColor.a;\n\n#endif\n",project_vertex:"\nvec4 mvPosition = vec4( transformed, 1.0 );\n\n#ifdef USE_INSTANCING\n\n\tmvPosition = instanceMatrix * mvPosition;\n\n#endif\n\nmvPosition = modelViewMatrix * mvPosition;\n\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"\n#ifdef DITHERING\n\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n\n#endif\n",dithering_pars_fragment:"\n#ifdef DITHERING\n\n\t// based on https://www.shadertoy.com/view/MslGR8\n\tvec3 dithering( vec3 color ) {\n\t\t//Calculate grid position\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\n\t\t//modify shift acording to grid position.\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\n\t\t//shift the color by dither_shift\n\t\treturn color + dither_shift_RGB;\n\t}\n\n#endif\n",roughnessmap_fragment:"\nfloat roughnessFactor = roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n",roughnessmap_pars_fragment:"\n#ifdef USE_ROUGHNESSMAP\n\n\tuniform sampler2D roughnessMap;\n\n#endif\n",shadowmap_pars_fragment:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): create uniforms for area light shadows\n\n\t#endif\n\t*/\n\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\n\t}\n\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\n\t}\n\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\n\t\tfloat occlusion = 1.0;\n\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\n\t\tfloat hard_shadow = step( compare , distribution.x ); // Hard Shadow\n\n\t\tif (hard_shadow != 1.0 ) {\n\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance ); // Chebeyshevs inequality\n\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed\n\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\n\t\t}\n\t\treturn occlusion;\n\n\t}\n\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\n\t\tfloat shadow = 1.0;\n\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\n\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t// if ( all( something, something ) ) using this instead\n\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#else // no percentage-closer filtering:\n\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#endif\n\n\t\t}\n\n\t\treturn shadow;\n\n\t}\n\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\n\t// 2D texture:\n\t//\n\t// xzXZ\n\t// y Y\n\t//\n\t// Y - Positive y direction\n\t// y - Negative y direction\n\t// X - Positive x direction\n\t// x - Negative x direction\n\t// Z - Positive z direction\n\t// z - Negative z direction\n\t//\n\t// Source and test bed:\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\n\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\n\t\t// Number of texels to avoid at the edge of each square\n\n\t\tvec3 absV = abs( v );\n\n\t\t// Intersect unit cube\n\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\n\t\t// Apply scale to avoid seams\n\n\t\t// two texels less per square (one texel will do for NEAREST)\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\n\t\t// Unwrap\n\n\t\t// space: -1 ... 1 range for each square\n\t\t//\n\t\t// #X##\t\tdim := ( 4 , 2 )\n\t\t// # #\t\tcenter := ( 1 , 1 )\n\n\t\tvec2 planar = v.xy;\n\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\n\t\tif ( absV.z >= almostOne ) {\n\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\n\t\t} else if ( absV.x >= almostOne ) {\n\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\n\t\t} else if ( absV.y >= almostOne ) {\n\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\n\t\t}\n\n\t\t// Transform to UV space\n\n\t\t// scale := 0.5 / dim\n\t\t// translate := ( center + 0.5 ) / dim\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\n\t}\n\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\n\t\t// the vector from the light to the world-space position of the fragment.\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\n\t\t// dp = normalized distance from light to fragment position\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\n\t\tdp += shadowBias;\n\n\t\t// bd3D = base direction 3D\n\t\tvec3 bd3D = normalize( lightToPosition );\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\n\t\t#else // no percentage-closer filtering\n\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\n\t\t#endif\n\n\t}\n\n#endif\n",shadowmap_pars_vertex:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): uniforms for area light shadows\n\n\t#endif\n\t*/\n\n#endif\n",shadowmap_vertex:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update vAreaShadowCoord with area light info\n\n\t#endif\n\t*/\n\n#endif\n",shadowmask_pars_fragment:"\nfloat getShadowMask() {\n\n\tfloat shadow = 1.0;\n\n\t#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\tDirectionalLightShadow directionalLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\tSpotLightShadow spotLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\tPointLightShadow pointLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update shadow for Area light\n\n\t#endif\n\t*/\n\n\t#endif\n\n\treturn shadow;\n\n}\n",skinbase_vertex:"\n#ifdef USE_SKINNING\n\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif\n",skinning_pars_vertex:"\n#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n",skinning_vertex:"\n#ifdef USE_SKINNING\n\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n\n#endif\n",skinnormal_vertex:"\n#ifdef USE_SKINNING\n\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\n\t#ifdef USE_TANGENT\n\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#endif\n\n#endif\n",specularmap_fragment:"\nfloat specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif\n",specularmap_pars_fragment:"\n#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif\n",tonemapping_fragment:"\n#if defined( TONE_MAPPING )\n\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n\n#endif\n",tonemapping_pars_fragment:"\n#ifndef saturate\n// <common> may have defined saturate() already\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\n\n// exposure only\nvec3 LinearToneMapping( vec3 color ) {\n\n\treturn toneMappingExposure * color;\n\n}\n\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\nvec3 ReinhardToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n\n}\n\n// source: http://filmicgames.com/archives/75\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\n\t// John Hable's filmic operator from Uncharted 2 video game\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n\n}\n\n// source: http://filmicgames.com/archives/75\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n\n}\n\n// source: https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n\n}\n",uv_pars_fragment:"\n#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\n\tvarying vec2 vUv;\n\n#endif\n",uv_pars_vertex:"\n#ifdef USE_UV\n\n\t#ifdef UVS_VERTEX_ONLY\n\n\t\tvec2 vUv;\n\n\t#else\n\n\t\tvarying vec2 vUv;\n\n\t#endif\n\n\tuniform mat3 uvTransform;\n\n#endif\n",uv_vertex:"\n#ifdef USE_UV\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n#endif\n",uv2_pars_fragment:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvarying vec2 vUv2;\n\n#endif\n",uv2_pars_vertex:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\n\tuniform mat3 uv2Transform;\n\n#endif\n",uv2_vertex:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n\n#endif\n",worldpos_vertex:"\n#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t#ifdef USE_INSTANCING\n\n\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t#endif\n\n\tworldPosition = modelMatrix * worldPosition;\n\n#endif\n",background_frag:"\nuniform sampler2D t2D;\n\nvarying vec2 vUv;\n\nvoid main() {\n\n\tvec4 texColor = texture2D( t2D, vUv );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",background_vert:"\nvarying vec2 vUv;\nuniform mat3 uvTransform;\n\nvoid main() {\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n\n}\n",cube_frag:"\n\n#include <envmap_common_pars_fragment>\nuniform float opacity;\n\nvarying vec3 vWorldDirection;\n\n#include <cube_uv_reflection_fragment>\n\nvoid main() {\n\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",cube_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n}\n",depth_frag:"\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n",depth_vert:"\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\n// This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.\n// Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for\n// depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n",distanceRGBA_frag:"\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main () {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\n\n\tgl_FragColor = packDepthToRGBA( dist );\n\n}\n",distanceRGBA_vert:"\n#define DISTANCE\n\nvarying vec3 vWorldPosition;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvWorldPosition = worldPosition.xyz;\n\n}\n",equirect_frag:"\nuniform sampler2D tEquirect;\n\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvec3 direction = normalize( vWorldDirection );\n\n\tvec2 sampleUV;\n\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",equirect_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n}\n",linedashed_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\nuniform float dashSize;\nuniform float totalSize;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\n\t\tdiscard;\n\n\t}\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\n\toutgoingLight = diffuseColor.rgb; // simple shader\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",linedashed_vert:"\nuniform float scale;\nattribute float lineDistance;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\tvLineDistance = scale * lineDistance;\n\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n}\n",meshbasic_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t// accumulation (baked indirect lighting only)\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",meshbasic_vert:"\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_ENVMAP\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshlambert_frag:"\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\n\t#endif\n\n\t#include <lightmap_fragment>\n\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\n\t#else\n\n\t\treflectedLight.directDiffuse = vLightFront;\n\n\t#endif\n\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshlambert_vert:"\n#define LAMBERT\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshmatcap_frag:"\n#define MATCAP\n\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks\n\n\t#ifdef USE_MATCAP\n\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\n\t#else\n\n\t\tvec4 matcapColor = vec4( 1.0 );\n\n\t#endif\n\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",meshmatcap_vert:"\n#define MATCAP\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\t\tvNormal = normalize( transformedNormal );\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n}\n",meshtoon_frag:"\n#define TOON\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshtoon_vert:"\n#define TOON\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshphong_frag:"\n#define PHONG\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshphong_vert:"\n#define PHONG\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshphysical_frag:"\n#define STANDARD\n\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t// this is a stub for the transparency model\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshphysical_vert:"\n#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",normal_frag:"\n#define NORMAL\n\nuniform float opacity;\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\n}\n",normal_vert:"\n#define NORMAL\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvViewPosition = - mvPosition.xyz;\n\n#endif\n\n}\n",points_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",points_vert:"\nuniform float size;\nuniform float scale;\n\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\n\tgl_PointSize = size;\n\n\t#ifdef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\n\t#endif\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n\n}\n",shadow_frag:"\nuniform vec3 color;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n\nvoid main() {\n\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",shadow_vert:"\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\n\nvoid main() {\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",sprite_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",sprite_vert:"\nuniform float rotation;\nuniform vec2 center;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\n\t#ifndef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\n\t#endif\n\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\n\tmvPosition.xy += rotatedPosition;\n\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n}\n"},Ao={basic:{uniforms:Wr([nr.common,nr.specularmap,nr.envmap,nr.aomap,nr.lightmap,nr.fog]),vertexShader:Ro.meshbasic_vert,fragmentShader:Ro.meshbasic_frag},lambert:{uniforms:Wr([nr.common,nr.specularmap,nr.envmap,nr.aomap,nr.lightmap,nr.emissivemap,nr.fog,nr.lights,{emissive:{value:new _i(0)}}]),vertexShader:Ro.meshlambert_vert,fragmentShader:Ro.meshlambert_frag},phong:{uniforms:Wr([nr.common,nr.specularmap,nr.envmap,nr.aomap,nr.lightmap,nr.emissivemap,nr.bumpmap,nr.normalmap,nr.displacementmap,nr.fog,nr.lights,{emissive:{value:new _i(0)},specular:{value:new _i(1118481)},shininess:{value:30}}]),vertexShader:Ro.meshphong_vert,fragmentShader:Ro.meshphong_frag},standard:{uniforms:Wr([nr.common,nr.envmap,nr.aomap,nr.lightmap,nr.emissivemap,nr.bumpmap,nr.normalmap,nr.displacementmap,nr.roughnessmap,nr.metalnessmap,nr.fog,nr.lights,{emissive:{value:new _i(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Ro.meshphysical_vert,fragmentShader:Ro.meshphysical_frag},toon:{uniforms:Wr([nr.common,nr.specularmap,nr.aomap,nr.lightmap,nr.emissivemap,nr.bumpmap,nr.normalmap,nr.displacementmap,nr.gradientmap,nr.fog,nr.lights,{emissive:{value:new _i(0)},specular:{value:new _i(1118481)},shininess:{value:30}}]),vertexShader:Ro.meshtoon_vert,fragmentShader:Ro.meshtoon_frag},matcap:{uniforms:Wr([nr.common,nr.bumpmap,nr.normalmap,nr.displacementmap,nr.fog,{matcap:{value:null}}]),vertexShader:Ro.meshmatcap_vert,fragmentShader:Ro.meshmatcap_frag},points:{uniforms:Wr([nr.points,nr.fog]),vertexShader:Ro.points_vert,fragmentShader:Ro.points_frag},dashed:{uniforms:Wr([nr.common,nr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ro.linedashed_vert,fragmentShader:Ro.linedashed_frag},depth:{uniforms:Wr([nr.common,nr.displacementmap]),vertexShader:Ro.depth_vert,fragmentShader:Ro.depth_frag},normal:{uniforms:Wr([nr.common,nr.bumpmap,nr.normalmap,nr.displacementmap,{opacity:{value:1}}]),vertexShader:Ro.normal_vert,fragmentShader:Ro.normal_frag},sprite:{uniforms:Wr([nr.sprite,nr.fog]),vertexShader:Ro.sprite_vert,fragmentShader:Ro.sprite_frag},background:{uniforms:{uvTransform:{value:new x},t2D:{value:null}},vertexShader:Ro.background_vert,fragmentShader:Ro.background_frag},cube:{uniforms:Wr([nr.envmap,{opacity:{value:1}}]),vertexShader:Ro.cube_vert,fragmentShader:Ro.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ro.equirect_vert,fragmentShader:Ro.equirect_frag},distanceRGBA:{uniforms:Wr([nr.common,nr.displacementmap,{referencePosition:{value:new Et},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ro.distanceRGBA_vert,fragmentShader:Ro.distanceRGBA_frag},shadow:{uniforms:Wr([nr.lights,nr.fog,{color:{value:new _i(0)},opacity:{value:1}}]),vertexShader:Ro.shadow_vert,fragmentShader:Ro.shadow_frag}};function Co(o,e,s,i){var a,u,h=new _i(0),c=0,f=null,l=0,d=null;function v(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,i)}return{getClearColor:function(){return h},setClearColor:function(t,n){h.set(t),v(h,c=void 0!==n?n:1)},getClearAlpha:function(){return c},setClearAlpha:function(t){v(h,c=t)},render:function(t,n,e,i){var r=n.background,n=(n=o.xr).getSession&&n.getSession();null===(r=n&&"additive"===n.environmentBlendMode?null:r)?v(h,c):r&&r.isColor&&(v(r,1),i=!0),(o.autoClear||i)&&o.clear(o.autoClearColor,o.autoClearDepth,o.autoClearStencil),r&&(r.isCubeTexture||r.isWebGLCubeRenderTarget||r.mapping===vn)?(void 0===u&&((u=new To(new Gr(1,1,1),new qr({type:"BackgroundCubeMaterial",uniforms:zr(Ao.cube.uniforms),vertexShader:Ao.cube.vertexShader,fragmentShader:Ao.cube.fragmentShader,side:Tt,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(t,n,e){this.matrixWorld.copyPosition(e.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),i=r.isWebGLCubeRenderTarget?r.texture:r,u.material.uniforms.envMap.value=i,u.material.uniforms.flipEnvMap.value=i.isCubeTexture?-1:1,f===r&&l===i.version&&d===o.toneMapping||(u.material.needsUpdate=!0,f=r,l=i.version,d=o.toneMapping),t.unshift(u,u.geometry,u.material,0,0,null)):r&&r.isTexture&&(void 0===a&&((a=new To(new Br(2,2),new qr({type:"BackgroundMaterial",uniforms:zr(Ao.background.uniforms),vertexShader:Ao.background.vertexShader,fragmentShader:Ao.background.fragmentShader,side:gt,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(a)),!0===(a.material.uniforms.t2D.value=r).matrixAutoUpdate&&r.updateMatrix(),a.material.uniforms.uvTransform.value.copy(r.matrix),f===r&&l===r.version&&d===o.toneMapping||(a.material.needsUpdate=!0,l=(f=r).version,d=o.toneMapping),t.unshift(a,a.geometry,a.material,0,0,null))}}}function ko(s,a,u,t){var h,c=t.isWebGL2;this.setMode=function(t){h=t},this.render=function(t,n){s.drawArrays(h,t,n),u.update(n,h)},this.renderInstances=function(t,n,e,i){if(0!==i){var r,o;if(c)r=s,o="drawArraysInstanced";else if(o="drawArraysInstancedANGLE",null===(r=a.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[o](h,n,e,i),u.update(e,h,i)}}}function Po(n,e,t){var i;function r(t){if("highp"===t){if(0<n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision&&0<n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision)return"highp";t="mediump"}return"mediump"===t&&0<n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision&&0<n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&n instanceof WebGL2ComputeRenderingContext,s=void 0!==t.precision?t.precision:"highp",a=r(s);a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a);var u=!0===t.logarithmicDepthBuffer,h=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),c=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_TEXTURE_SIZE),l=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),d=n.getParameter(n.MAX_VERTEX_ATTRIBS),v=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),p=n.getParameter(n.MAX_VARYING_VECTORS),m=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),a=0<c,t=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==i)return i;var t=e.get("EXT_texture_filter_anisotropic");return i=null!==t?n.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:s,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:c,maxTextureSize:f,maxCubemapSize:l,maxAttributes:d,maxVertexUniforms:v,maxVaryings:p,maxFragmentUniforms:m,vertexTextures:a,floatFragmentTextures:t,floatVertexTextures:a&&t,maxSamples:o?n.getParameter(n.MAX_SAMPLES):0}}function Do(){var h=this,c=null,f=0,l=!1,d=!1,v=new ai,p=new x,m={value:null,needsUpdate:!1};function g(){m.value!==c&&(m.value=c,m.needsUpdate=0<f),h.numPlanes=f,h.numIntersection=0}function y(t,n,e,i){var r=null!==t?t.length:0,o=null;if(0!==r){if(o=m.value,!0!==i||null===o){var i=e+4*r,s=n.matrixWorldInverse;p.getNormalMatrix(s),(null===o||o.length<i)&&(o=new Float32Array(i));for(var a=0,u=e;a!==r;++a,u+=4)v.copy(t[a]).applyMatrix4(s,p),v.normal.toArray(o,u),o[u+3]=v.constant}m.value=o,m.needsUpdate=!0}return h.numPlanes=r,h.numIntersection=0,o}this.uniform=m,this.numPlanes=0,this.numIntersection=0,this.init=function(t,n,e){var i=0!==t.length||n||0!==f||l;return l=n,c=y(t,e,0),f=t.length,i},this.beginShadows=function(){d=!0,y(null)},this.endShadows=function(){d=!1,g()},this.setState=function(t,n,e,i,r,o){if(!l||null===t||0===t.length||d&&!e)d?y(null):g();else{var e=d?0:f,s=4*e,a=r.clippingState||null;m.value=a;for(var a=y(t,i,s,o),u=0;u!==s;++u)a[u]=c[u];r.clippingState=a,this.numIntersection=n?this.numPlanes:0,this.numPlanes+=e}}}function jo(e){var i={};return{get:function(t){if(void 0!==i[t])return i[t];var n;switch(t){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(t)}return null===n&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),i[t]=n}}}function No(f,l,i){var r=new WeakMap,d=new WeakMap;function o(t){var n,t=t.target,e=r.get(t);for(n in null!==e.index&&l.remove(e.index),e.attributes)l.remove(e.attributes[n]);t.removeEventListener("dispose",o),r.delete(t);t=d.get(e);t&&(l.remove(t),d.delete(e)),i.memory.geometries--}function s(t){var n=[],e=t.index,i=t.attributes.position,r=0;if(null!==e)for(var o=e.array,r=e.version,s=0,a=o.length;s<a;s+=3){var u=o[s+0],h=o[s+1],c=o[s+2];n.push(u,h,h,c,c,u)}else{o=i.array;r=i.version;for(s=0,a=o.length/3-1;s<a;s+=3)n.push(u=s+0,h=s+1,h,c=s+2,c,u)}i=new(65535<Er(n)?_r:yr)(n,1);i.version=r,l.update(i,f.ELEMENT_ARRAY_BUFFER);r=d.get(t);r&&l.remove(r),d.set(t,i)}return{get:function(t,n){var e=r.get(n);return e||(n.addEventListener("dispose",o),n.isBufferGeometry?e=n:n.isGeometry&&(void 0===n.Pn&&(n.Pn=(new kr).setFromObject(t)),e=n.Pn),r.set(n,e),i.memory.geometries++,e)},update:function(t){var n=t.index,e=t.attributes;for(i in null!==n&&l.update(n,f.ELEMENT_ARRAY_BUFFER),e)l.update(e[i],f.ARRAY_BUFFER);var i,r=t.morphAttributes;for(i in r)for(var o=r[i],s=0,a=o.length;s<a;s++)l.update(o[s],f.ARRAY_BUFFER)},getWireframeAttribute:function(t){var n,e=d.get(t);return(!e||null!==(n=t.index)&&e.version<n.version)&&s(t),d.get(t)}}}function Io(s,a,u,t){var h,c,f,l=t.isWebGL2;this.setMode=function(t){h=t},this.setIndex=function(t){c=t.type,f=t.bytesPerElement},this.render=function(t,n){s.drawElements(h,n,c,t*f),u.update(n,h)},this.renderInstances=function(t,n,e,i){if(0!==i){var r,o;if(l)r=s,o="drawElementsInstanced";else if(o="drawElementsInstancedANGLE",null===(r=a.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[o](h,e,c,n*f,i),u.update(e,h,i)}}}function Fo(i){var r={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:r,programs:null,autoReset:!0,reset:function(){r.frame++,r.calls=0,r.triangles=0,r.points=0,r.lines=0},update:function(t,n,e){switch(e=e||1,r.calls++,n){case i.TRIANGLES:r.triangles+=e*(t/3);break;case i.LINES:r.lines+=e*(t/2);break;case i.LINE_STRIP:r.lines+=e*(t-1);break;case i.LINE_LOOP:r.lines+=e*t;break;case i.POINTS:r.points+=e*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function Uo(t,n){return Math.abs(n[1])-Math.abs(t[1])}function Go(v){var p={},m=new Float32Array(8);return{update:function(t,n,e,i){var r=t.morphTargetInfluences,o=void 0===r?0:r.length;if(void 0===(s=p[n.id])){for(var s=[],a=0;a<o;a++)s[a]=[a,0];p[n.id]=s}for(var u=e.morphTargets&&n.morphAttributes.position,h=e.morphNormals&&n.morphAttributes.normal,a=0;a<o;a++)0!==(c=s[a])[1]&&(u&&n.deleteAttribute("morphTarget"+a),h&&n.deleteAttribute("morphNormal"+a));for(a=0;a<o;a++)(c=s[a])[0]=a,c[1]=r[a];s.sort(Uo);for(var c,f=0,a=0;a<8;a++){if(c=s[a]){var l=c[0],d=c[1];if(d){u&&n.setAttribute("morphTarget"+a,u[l]),h&&n.setAttribute("morphNormal"+a,h[l]),f+=m[a]=d;continue}}m[a]=0}e=n.morphTargetsRelative?1:1-f,i.getUniforms().setValue(v,"morphTargetBaseInfluence",e),i.getUniforms().setValue(v,"morphTargetInfluences",m)}}}function Bo(r,o,s,a){var u=new WeakMap;return{update:function(t){var n=a.render.frame,e=t.geometry,i=o.get(t,e);return u.get(i)!==n&&(e.isGeometry&&i.updateFromObject(t),o.update(i),u.set(i,n)),t.isInstancedMesh&&s.update(t.instanceMatrix,r.ARRAY_BUFFER),i},dispose:function(){u=new WeakMap}}}function Ho(t,n,e,i,r,o,s,a,u,h){$i.call(this,t=void 0!==t?t:[],n=void 0!==n?n:hn,e,i,r,o,s=void 0!==s?s:Fn,a,u,h),this.flipY=!1}function Vo(t,n,e,i){$i.call(this,null),this.image={data:t||null,width:n||1,height:e||1,depth:i||1},this.magFilter=bn,this.minFilter=bn,this.wrapR=gn,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function zo(t,n,e,i){$i.call(this,null),this.image={data:t||null,width:n||1,height:e||1,depth:i||1},this.magFilter=bn,this.minFilter=bn,this.wrapR=gn,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}Ao.physical={uniforms:Wr([Ao.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new ii(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new _i(0)},transparency:{value:0}}]),vertexShader:Ro.meshphysical_vert,fragmentShader:Ro.meshphysical_frag},((Ho.prototype=Object.create($i.prototype)).constructor=Ho).prototype.isCubeTexture=!0,Object.defineProperty(Ho.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),((Vo.prototype=Object.create($i.prototype)).constructor=Vo).prototype.isDataTexture2DArray=!0,((zo.prototype=Object.create($i.prototype)).constructor=zo).prototype.isDataTexture3D=!0;var Wo=new $i,Xo=new Vo,Yo=new zo,Zo=new Ho,qo=[],Ko=[],Jo=new Float32Array(16),Qo=new Float32Array(9),$o=new Float32Array(4);function ts(t,n,e){var i=t[0];if(i<=0||0<i)return t;var r=n*e,o=qo[r];if(void 0===o&&(o=new Float32Array(r),qo[r]=o),0!==n){i.toArray(o,0);for(var s=1,a=0;s!==n;++s)t[s].toArray(o,a+=e)}return o}function ns(t,n){if(t.length===n.length){for(var e=0,i=t.length;e<i;e++)if(t[e]!==n[e])return;return 1}}function es(t,n){for(var e=0,i=n.length;e<i;e++)t[e]=n[e]}function is(t,n){var e=Ko[n];void 0===e&&(e=new Int32Array(n),Ko[n]=e);for(var i=0;i!==n;++i)e[i]=t.allocateTextureUnit();return e}function rs(t,n){var e=this.cache;e[0]!==n&&(t.uniform1f(this.addr,n),e[0]=n)}function os(t,n){var e=this.cache;void 0!==n.x?e[0]===n.x&&e[1]===n.y||(t.uniform2f(this.addr,n.x,n.y),e[0]=n.x,e[1]=n.y):ns(e,n)||(t.uniform2fv(this.addr,n),es(e,n))}function ss(t,n){var e=this.cache;void 0!==n.x?e[0]===n.x&&e[1]===n.y&&e[2]===n.z||(t.uniform3f(this.addr,n.x,n.y,n.z),e[0]=n.x,e[1]=n.y,e[2]=n.z):void 0!==n.r?e[0]===n.r&&e[1]===n.g&&e[2]===n.b||(t.uniform3f(this.addr,n.r,n.g,n.b),e[0]=n.r,e[1]=n.g,e[2]=n.b):ns(e,n)||(t.uniform3fv(this.addr,n),es(e,n))}function as(t,n){var e=this.cache;void 0!==n.x?e[0]===n.x&&e[1]===n.y&&e[2]===n.z&&e[3]===n.w||(t.uniform4f(this.addr,n.x,n.y,n.z,n.w),e[0]=n.x,e[1]=n.y,e[2]=n.z,e[3]=n.w):ns(e,n)||(t.uniform4fv(this.addr,n),es(e,n))}function us(t,n){var e=this.cache,i=n.elements;void 0===i?ns(e,n)||(t.uniformMatrix2fv(this.addr,!1,n),es(e,n)):ns(e,i)||($o.set(i),t.uniformMatrix2fv(this.addr,!1,$o),es(e,i))}function hs(t,n){var e=this.cache,i=n.elements;void 0===i?ns(e,n)||(t.uniformMatrix3fv(this.addr,!1,n),es(e,n)):ns(e,i)||(Qo.set(i),t.uniformMatrix3fv(this.addr,!1,Qo),es(e,i))}function cs(t,n){var e=this.cache,i=n.elements;void 0===i?ns(e,n)||(t.uniformMatrix4fv(this.addr,!1,n),es(e,n)):ns(e,i)||(Jo.set(i),t.uniformMatrix4fv(this.addr,!1,Jo),es(e,i))}function fs(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.safeSetTexture2D(n||Wo,r)}function ls(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.setTexture2DArray(n||Xo,r)}function ds(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.setTexture3D(n||Yo,r)}function vs(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.safeSetTextureCube(n||Zo,r)}function ps(t,n){var e=this.cache;e[0]!==n&&(t.uniform1i(this.addr,n),e[0]=n)}function ms(t,n){var e=this.cache;ns(e,n)||(t.uniform2iv(this.addr,n),es(e,n))}function gs(t,n){var e=this.cache;ns(e,n)||(t.uniform3iv(this.addr,n),es(e,n))}function ys(t,n){var e=this.cache;ns(e,n)||(t.uniform4iv(this.addr,n),es(e,n))}function bs(t,n){var e=this.cache;e[0]!==n&&(t.uniform1ui(this.addr,n),e[0]=n)}function _s(t,n){t.uniform1fv(this.addr,n)}function ws(t,n){t.uniform1iv(this.addr,n)}function xs(t,n){t.uniform2iv(this.addr,n)}function Ms(t,n){t.uniform3iv(this.addr,n)}function Es(t,n){t.uniform4iv(this.addr,n)}function Ss(t,n){n=ts(n,this.size,2);t.uniform2fv(this.addr,n)}function Ts(t,n){n=ts(n,this.size,3);t.uniform3fv(this.addr,n)}function Ls(t,n){n=ts(n,this.size,4);t.uniform4fv(this.addr,n)}function Os(t,n){n=ts(n,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function Rs(t,n){n=ts(n,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function As(t,n){n=ts(n,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Cs(t,n,e){var i=n.length,r=is(e,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)e.safeSetTexture2D(n[o]||Wo,r[o])}function ks(t,n,e){var i=n.length,r=is(e,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)e.safeSetTextureCube(n[o]||Zo,r[o])}function Ps(t,n,e){this.id=t,this.addr=e,this.cache=[],this.setValue=function(t){switch(t){case 5126:return rs;case 35664:return os;case 35665:return ss;case 35666:return as;case 35674:return us;case 35675:return hs;case 35676:return cs;case 5124:case 35670:return ps;case 35667:case 35671:return ms;case 35668:case 35672:return gs;case 35669:case 35673:return ys;case 5125:return bs;case 35678:case 36198:case 36298:case 36306:case 35682:return fs;case 35679:case 36299:case 36307:return ds;case 35680:case 36300:case 36308:case 36293:return vs;case 36289:case 36303:case 36311:case 36292:return ls}}(n.type)}function Ds(t,n,e){this.id=t,this.addr=e,this.cache=[],this.size=n.size,this.setValue=function(t){switch(t){case 5126:return _s;case 35664:return Ss;case 35665:return Ts;case 35666:return Ls;case 35674:return Os;case 35675:return Rs;case 35676:return As;case 5124:case 35670:return ws;case 35667:case 35671:return xs;case 35668:case 35672:return Ms;case 35669:case 35673:return Es;case 35678:case 36198:case 36298:case 36306:case 35682:return Cs;case 35680:case 36300:case 36308:case 36293:return ks}}(n.type)}function js(t){this.id=t,this.seq=[],this.map={}}Ds.prototype.updateCache=function(t){var n=this.cache;t instanceof Float32Array&&n.length!==t.length&&(this.cache=new Float32Array(t.length)),es(n,t)},js.prototype.setValue=function(t,n,e){for(var i=this.seq,r=0,o=i.length;r!==o;++r){var s=i[r];s.setValue(t,n[s.id],e)}};var Ns=/([\w\d_]+)(\])?(\[|\.)?/g;function Is(t,n){t.seq.push(n),t.map[n.id]=n}function Fs(t,n){this.seq=[],this.map={};for(var e=t.getProgramParameter(n,t.ACTIVE_UNIFORMS),i=0;i<e;++i){var r=t.getActiveUniform(n,i);!function(t,n,e){var i=t.name,r=i.length;for(Ns.lastIndex=0;;){var o=Ns.exec(i),s=Ns.lastIndex,a=o[1],u="]"===o[2],o=o[3];if(u&&(a|=0),void 0===o||"["===o&&s+2===r){Is(e,new(void 0===o?Ps:Ds)(a,t,n));break}o=e.map[a];void 0===o&&Is(e,o=new js(a)),e=o}}(r,t.getUniformLocation(n,r.name),this)}}function Us(t,n,e){n=t.createShader(n);return t.shaderSource(n,e),t.compileShader(n),n}Fs.prototype.setValue=function(t,n,e,i){n=this.map[n];void 0!==n&&n.setValue(t,e,i)},Fs.prototype.setOptional=function(t,n,e){n=n[e];void 0!==n&&this.setValue(t,e,n)},Fs.upload=function(t,n,e,i){for(var r=0,o=n.length;r!==o;++r){var s=n[r],a=e[s.id];!1!==a.needsUpdate&&s.setValue(t,a.value,i)}},Fs.seqWithValue=function(t,n){for(var e=[],i=0,r=t.length;i!==r;++i){var o=t[i];o.id in n&&e.push(o)}return e};var Gs=0;function Bs(t){switch(t){case Be:return["Linear","( value )"];case He:return["sRGB","( value )"];case ze:return["RGBE","( value )"];case Xe:return["RGBM","( value, 7.0 )"];case Ye:return["RGBM","( value, 16.0 )"];case Ze:return["RGBD","( value, 256.0 )"];case Ve:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case We:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+t)}}function Hs(t,n,e){var i=t.getShaderParameter(n,t.COMPILE_STATUS),r=t.getShaderInfoLog(n).trim();return i&&""===r?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+e+"\n"+r+function(t){for(var n=t.split("\n"),e=0;e<n.length;e++)n[e]=e+1+": "+n[e];return n.join("\n")}(t.getShaderSource(n))}function Vs(t,n){n=Bs(n);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function zs(t){return""!==t}function Ws(t,n){return t.replace(/NUM_DIR_LIGHTS/g,n.numDirLights).replace(/NUM_SPOT_LIGHTS/g,n.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,n.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,n.numPointLights).replace(/NUM_HEMI_LIGHTS/g,n.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,n.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,n.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,n.numPointLightShadows)}function Xs(t,n){return t.replace(/NUM_CLIPPING_PLANES/g,n.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,n.numClippingPlanes-n.numClipIntersection)}var Ys=/^[ \t]*#include +<([\w\d./]+)>/gm;function Zs(t){return t.replace(Ys,qs)}function qs(t,n){var e=Ro[n];if(void 0===e)throw new Error("Can not resolve #include <"+n+">");return Zs(e)}var Ks=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Js=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function Qs(t){return t.replace(Js,ta).replace(Ks,$s)}function $s(t,n,e,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),ta(0,n,e,i)}function ta(t,n,e,i){for(var r="",o=parseInt(n);o<parseInt(e);o++)r+=i.replace(/\[ i \]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return r}function na(t){var n="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?n+="\n#define HIGH_PRECISION":"mediump"===t.precision?n+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(n+="\n#define LOW_PRECISION"),n}function ea(t,n,e){var i,r,o,s=t.getContext(),a=e.defines,u=e.vertexShader,h=e.fragmentShader,c=(v="SHADOWMAP_TYPE_BASIC",(d=e).shadowMapType===vt?v="SHADOWMAP_TYPE_PCF":d.shadowMapType===pt?v="SHADOWMAP_TYPE_PCF_SOFT":d.shadowMapType===mt&&(v="SHADOWMAP_TYPE_VSM"),v),f=function(t){var n="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case hn:case cn:n="ENVMAP_TYPE_CUBE";break;case vn:case pn:n="ENVMAP_TYPE_CUBE_UV";break;case fn:case ln:n="ENVMAP_TYPE_EQUIREC";break;case dn:n="ENVMAP_TYPE_SPHERE"}return n}(e),l=function(t){var n="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case cn:case ln:n="ENVMAP_MODE_REFRACTION"}return n}(e),d=function(t){var n="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case $t:n="ENVMAP_BLENDING_MULTIPLY";break;case tn:n="ENVMAP_BLENDING_MIX";break;case nn:n="ENVMAP_BLENDING_ADD"}return n}(e),v=0<t.gammaFactor?t.gammaFactor:1,i=e.isWebGL2?"":[(i=e).extensionDerivatives||i.envMapCubeUV||i.bumpMap||i.tangentSpaceNormalMap||i.clearcoatNormalMap||i.flatShading||"physical"===i.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(i.extensionFragDepth||i.logarithmicDepthBuffer)&&i.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",i.extensionDrawBuffers&&i.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(i.extensionShaderTextureLOD||i.envMap)&&i.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(zs).join("\n"),a=function(t){var n,e=[];for(n in t){var i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(a),p=s.createProgram();e.isRawShaderMaterial?(0<(r=[a].filter(zs).join("\n")).length&&(r+="\n"),0<(o=[i,a].filter(zs).join("\n")).length&&(o+="\n")):(r=[na(e),"#define SHADER_NAME "+e.shaderName,a,e.instancing?"#define USE_INSTANCING":"",e.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+v,"#define MAX_BONES "+e.maxBones,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+l:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMap&&e.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",e.normalMap&&e.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.displacementMap&&e.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexTangents?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexUvs?"#define USE_UV":"",e.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&!1===e.flatShading?"#define USE_MORPHNORMALS":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.logarithmicDepthBuffer&&e.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(zs).join("\n"),o=[i,na(e),"#define SHADER_NAME "+e.shaderName,a,e.alphaTest?"#define ALPHATEST "+e.alphaTest+(e.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+v,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+f:"",e.envMap?"#define "+l:"",e.envMap?"#define "+d:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMap&&e.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",e.normalMap&&e.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.sheen?"#define USE_SHEEN":"",e.vertexTangents?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexUvs?"#define USE_UV":"",e.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.logarithmicDepthBuffer&&e.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==en?"#define TONE_MAPPING":"",e.toneMapping!==en?Ro.tonemapping_pars_fragment:"",e.toneMapping!==en?function(t,n){var e;switch(n){case rn:e="Linear";break;case on:e="Reinhard";break;case sn:e="Uncharted2";break;case an:e="OptimizedCineon";break;case un:e="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+n)}return"vec3 "+t+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.outputEncoding||e.mapEncoding||e.matcapEncoding||e.envMapEncoding||e.emissiveMapEncoding||e.lightMapEncoding?Ro.encodings_pars_fragment:"",e.mapEncoding?Vs("mapTexelToLinear",e.mapEncoding):"",e.matcapEncoding?Vs("matcapTexelToLinear",e.matcapEncoding):"",e.envMapEncoding?Vs("envMapTexelToLinear",e.envMapEncoding):"",e.emissiveMapEncoding?Vs("emissiveMapTexelToLinear",e.emissiveMapEncoding):"",e.lightMapEncoding?Vs("lightMapTexelToLinear",e.lightMapEncoding):"",e.outputEncoding?(w="linearToOutputTexel",m=Bs(m=e.outputEncoding),"vec4 "+w+"( vec4 value ) { return LinearTo"+m[0]+m[1]+"; }"):"",e.depthPacking?"#define DEPTH_PACKING "+e.depthPacking:"","\n"].filter(zs).join("\n")),u=Xs(u=Ws(u=Zs(u),e),e),h=Xs(h=Ws(h=Zs(h),e),e),u=Qs(u),h=Qs(h),e.isWebGL2&&!e.isRawShaderMaterial&&(y=!1,g=/^\s*#version\s+300\s+es\s*\n/,e.isShaderMaterial&&null!==u.match(g)&&null!==h.match(g)&&(y=!0,u=u.replace(g,""),h=h.replace(g,"")),r=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+r,o=["#version 300 es\n","#define varying in",y?"":"out highp vec4 pc_fragColor;",y?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+o);var m,g,y,b,_,d=o+h,c=Us(s,s.VERTEX_SHADER,r+u),w=Us(s,s.FRAGMENT_SHADER,d);return s.attachShader(p,c),s.attachShader(p,w),void 0!==e.index0AttributeName?s.bindAttribLocation(p,0,e.index0AttributeName):!0===e.morphTargets&&s.bindAttribLocation(p,0,"position"),s.linkProgram(p),t.debug.checkShaderErrors&&(m=s.getProgramInfoLog(p).trim(),g=s.getShaderInfoLog(c).trim(),y=s.getShaderInfoLog(w).trim(),!(u=h=!0)===s.getProgramParameter(p,s.LINK_STATUS)?(h=!1,d=Hs(s,c,"vertex"),t=Hs(s,w,"fragment"),console.error("THREE.WebGLProgram: shader error: ",s.getError(),"gl.VALIDATE_STATUS",s.getProgramParameter(p,s.VALIDATE_STATUS),"gl.getProgramInfoLog",m,d,t)):""!==m?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",m):""!==g&&""!==y||(u=!1),u&&(this.diagnostics={runnable:h,programLog:m,vertexShader:{log:g,prefix:r},fragmentShader:{log:y,prefix:o}})),s.detachShader(p,c),s.detachShader(p,w),s.deleteShader(c),s.deleteShader(w),this.getUniforms=function(){return b=void 0===b?new Fs(s,p):b},this.getAttributes=function(){return _=void 0===_?function(t,n){for(var e={},i=t.getProgramParameter(n,t.ACTIVE_ATTRIBUTES),r=0;r<i;r++){var o=t.getActiveAttrib(n,r).name;e[o]=t.getAttribLocation(n,o)}return e}(s,p):_},this.destroy=function(){s.deleteProgram(p),this.program=void 0},this.name=e.shaderName,this.id=Gs++,this.cacheKey=n,this.usedTimes=1,this.program=p,this.vertexShader=c,this.fragmentShader=w,this}function ia(l,d,v){var s=[],p=v.isWebGL2,m=v.logarithmicDepthBuffer,g=v.floatVertexTextures,y=v.precision,b=v.maxVertexUniforms,_=v.vertexTextures,w={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},r=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function x(t){var n;return t?t.isTexture?n=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=t.texture.encoding):n=Be,n}this.getParameters=function(t,n,e,i,r,o,s){var a=i.fog,u=t.isMeshStandardMaterial?i.environment:null,h=t.envMap||u,i=w[t.type],u=s.isSkinnedMesh?(f=(c=s).skeleton.bones,g?1024:(c=Math.floor((b-20)/4),(c=Math.min(c,f.length))<f.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+f.length+" bones. This GPU supports "+c+"."),0):c)):0;null!==t.precision&&(y=v.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",y,"instead.");var c,c=(f=t,(c=i)?(c=Ao[c],{name:f.type,uniforms:Xr.clone(c.uniforms),vertexShader:c.vertexShader,fragmentShader:c.fragmentShader}):{name:f.type,uniforms:f.uniforms,vertexShader:f.vertexShader,fragmentShader:f.fragmentShader});t.onBeforeCompile(c,l);var f=l.getRenderTarget();return{isWebGL2:p,shaderID:i,shaderName:c.name,uniforms:c.uniforms,vertexShader:c.vertexShader,fragmentShader:c.fragmentShader,defines:t.defines,isRawShaderMaterial:t.isRawShaderMaterial,isShaderMaterial:t.isShaderMaterial,precision:y,instancing:!0===s.isInstancedMesh,supportsVertexTextures:_,outputEncoding:null!==f?x(f.texture):l.outputEncoding,map:!!t.map,mapEncoding:x(t.map),matcap:!!t.matcap,matcapEncoding:x(t.matcap),envMap:!!h,envMapMode:h&&h.mapping,envMapEncoding:x(h),envMapCubeUV:!!h&&(h.mapping===vn||h.mapping===pn),lightMap:!!t.lightMap,lightMapEncoding:x(t.lightMap),aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:x(t.emissiveMap),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:t.normalMapType===Qe,tangentSpaceNormalMap:t.normalMapType===Je,clearcoatMap:!!t.clearcoatMap,clearcoatRoughnessMap:!!t.clearcoatRoughnessMap,clearcoatNormalMap:!!t.clearcoatNormalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,sheen:!!t.sheen,combine:t.combine,vertexTangents:t.normalMap&&t.vertexTangents,vertexColors:t.vertexColors,vertexUvs:!!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatMap||t.clearcoatRoughnessMap||t.clearcoatNormalMap||t.displacementMap),uvsVertexOnly:!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatNormalMap||!t.displacementMap),fog:!!a,useFog:t.fog,fogExp2:a&&a.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:m,skinning:t.skinning&&0<u,maxBones:u,useVertexTexture:g,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:l.maxMorphTargets,maxMorphNormals:l.maxMorphNormals,numDirLights:n.directional.length,numPointLights:n.point.length,numSpotLights:n.spot.length,numRectAreaLights:n.rectArea.length,numHemiLights:n.hemi.length,numDirLightShadows:n.directionalShadowMap.length,numPointLightShadows:n.pointShadowMap.length,numSpotLightShadows:n.spotShadowMap.length,numClippingPlanes:r,numClipIntersection:o,dithering:t.dithering,shadowMapEnabled:l.shadowMap.enabled&&0<e.length,shadowMapType:l.shadowMap.type,toneMapping:t.toneMapped?l.toneMapping:en,physicallyCorrectLights:l.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===yt,flipSided:t.side===Tt,depthPacking:void 0!==t.depthPacking&&t.depthPacking,index0AttributeName:t.index0AttributeName,extensionDerivatives:t.extensions&&t.extensions.derivatives,extensionFragDepth:t.extensions&&t.extensions.fragDepth,extensionDrawBuffers:t.extensions&&t.extensions.drawBuffers,extensionShaderTextureLOD:t.extensions&&t.extensions.shaderTextureLOD,rendererExtensionFragDepth:p||null!==d.get("EXT_frag_depth"),rendererExtensionDrawBuffers:p||null!==d.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:p||null!==d.get("EXT_shader_texture_lod"),onBeforeCompile:t.onBeforeCompile}},this.getProgramCacheKey=function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var e in t.defines)n.push(e),n.push(t.defines[e]);if(void 0===t.isRawShaderMaterial){for(var i=0;i<r.length;i++)n.push(t[r[i]]);n.push(l.outputEncoding),n.push(l.gammaFactor)}return n.push(t.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(t,n){for(var e,i=0,r=s.length;i<r;i++){var o=s[i];if(o.cacheKey===n){++(e=o).usedTimes;break}}return void 0===e&&(e=new ea(l,n,t),s.push(e)),e},this.releaseProgram=function(t){var n;0==--t.usedTimes&&(n=s.indexOf(t),s[n]=s[s.length-1],s.pop(),t.destroy())},this.programs=s}function ra(){var i=new WeakMap;return{get:function(t){var n=i.get(t);return void 0===n&&i.set(t,n={}),n},remove:function(t){i.delete(t)},update:function(t,n,e){i.get(t)[n]=e},dispose:function(){i=new WeakMap}}}function oa(t,n){return t.groupOrder!==n.groupOrder?t.groupOrder-n.groupOrder:t.renderOrder!==n.renderOrder?t.renderOrder-n.renderOrder:t.program!==n.program?t.program.id-n.program.id:t.material.id!==n.material.id?t.material.id-n.material.id:t.z!==n.z?t.z-n.z:t.id-n.id}function sa(t,n){return t.groupOrder!==n.groupOrder?t.groupOrder-n.groupOrder:t.renderOrder!==n.renderOrder?t.renderOrder-n.renderOrder:t.z!==n.z?n.z-t.z:t.id-n.id}function aa(){var a=[],u=0,s=[],h=[],c={id:-1};function f(t,n,e,i,r,o){var s=a[u];return void 0===s?(s={id:t.id,object:t,geometry:n,material:e,program:e.program||c,groupOrder:i,renderOrder:t.renderOrder,z:r,group:o},a[u]=s):(s.id=t.id,s.object=t,s.geometry=n,s.material=e,s.program=e.program||c,s.groupOrder=i,s.renderOrder=t.renderOrder,s.z=r,s.group=o),u++,s}return{opaque:s,transparent:h,init:function(){u=0,s.length=0,h.length=0},push:function(t,n,e,i,r,o){o=f(t,n,e,i,r,o),(!0===e.transparent?h:s).push(o)},unshift:function(t,n,e,i,r,o){o=f(t,n,e,i,r,o),(!0===e.transparent?h:s).unshift(o)},finish:function(){for(var t=u,n=a.length;t<n;t++){var e=a[t];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.program=null,e.group=null}},sort:function(t,n){1<s.length&&s.sort(t||oa),1<h.length&&h.sort(n||sa)}}}function ua(){var r=new WeakMap;function o(t){t=t.target;t.removeEventListener("dispose",o),r.delete(t)}return{get:function(t,n){var e,i=r.get(t);return void 0===i?(e=new aa,r.set(t,new WeakMap),r.get(t).set(n,e),t.addEventListener("dispose",o)):void 0===(e=i.get(n))&&(e=new aa,i.set(n,e)),e},dispose:function(){r=new WeakMap}}}function ha(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new Et,color:new _i};break;case"SpotLight":n={position:new Et,direction:new Et,color:new _i,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Et,color:new _i,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Et,skyColor:new _i,groundColor:new _i};break;case"RectAreaLight":n={color:new _i,position:new Et,halfWidth:new Et,halfHeight:new Et}}return e[t.id]=n}}}var ca=0;function fa(t,n){return(n.castShadow?1:0)-(t.castShadow?1:0)}function la(){for(var e,T=new ha,L=(e={},{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new ii};break;case"PointLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new ii,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n}}),O={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},t=0;t<9;t++)O.probe.push(new Et);var R=new Et,A=new St,C=new St;return{setup:function(t,n,e){for(var i=0,r=0,o=0,s=0;s<9;s++)O.probe[s].set(0,0,0);var a=0,u=0,h=0,c=0,f=0,l=0,d=0,v=0,p=e.matrixWorldInverse;t.sort(fa);for(var s=0,m=t.length;s<m;s++){var g,y,b,_=t[s],w=_.color,x=_.intensity,M=_.distance,E=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)i+=w.r*x,r+=w.g*x,o+=w.b*x;else if(_.isLightProbe)for(var S=0;S<9;S++)O.probe[S].addScaledVector(_.sh.coefficients[S],x);else _.isDirectionalLight?((b=T.get(_)).color.copy(_.color).multiplyScalar(_.intensity),b.direction.setFromMatrixPosition(_.matrixWorld),R.setFromMatrixPosition(_.target.matrixWorld),b.direction.sub(R),b.direction.transformDirection(p),_.castShadow&&(g=_.shadow,(y=L.get(_)).shadowBias=g.bias,y.shadowRadius=g.radius,y.shadowMapSize=g.mapSize,O.directionalShadow[a]=y,O.directionalShadowMap[a]=E,O.directionalShadowMatrix[a]=_.shadow.matrix,l++),O.directional[a]=b,a++):_.isSpotLight?((b=T.get(_)).position.setFromMatrixPosition(_.matrixWorld),b.position.applyMatrix4(p),b.color.copy(w).multiplyScalar(x),b.distance=M,b.direction.setFromMatrixPosition(_.matrixWorld),R.setFromMatrixPosition(_.target.matrixWorld),b.direction.sub(R),b.direction.transformDirection(p),b.coneCos=Math.cos(_.angle),b.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),b.decay=_.decay,_.castShadow&&(g=_.shadow,(y=L.get(_)).shadowBias=g.bias,y.shadowRadius=g.radius,y.shadowMapSize=g.mapSize,O.spotShadow[h]=y,O.spotShadowMap[h]=E,O.spotShadowMatrix[h]=_.shadow.matrix,v++),O.spot[h]=b,h++):_.isRectAreaLight?((b=T.get(_)).color.copy(w).multiplyScalar(x),b.position.setFromMatrixPosition(_.matrixWorld),b.position.applyMatrix4(p),C.identity(),A.copy(_.matrixWorld),A.premultiply(p),C.extractRotation(A),b.halfWidth.set(.5*_.width,0,0),b.halfHeight.set(0,.5*_.height,0),b.halfWidth.applyMatrix4(C),b.halfHeight.applyMatrix4(C),O.rectArea[c]=b,c++):_.isPointLight?((b=T.get(_)).position.setFromMatrixPosition(_.matrixWorld),b.position.applyMatrix4(p),b.color.copy(_.color).multiplyScalar(_.intensity),b.distance=_.distance,b.decay=_.decay,_.castShadow&&(g=_.shadow,(y=L.get(_)).shadowBias=g.bias,y.shadowRadius=g.radius,y.shadowMapSize=g.mapSize,y.shadowCameraNear=g.camera.near,y.shadowCameraFar=g.camera.far,O.pointShadow[u]=y,O.pointShadowMap[u]=E,O.pointShadowMatrix[u]=_.shadow.matrix,d++),O.point[u]=b,u++):_.isHemisphereLight&&((b=T.get(_)).direction.setFromMatrixPosition(_.matrixWorld),b.direction.transformDirection(p),b.direction.normalize(),b.skyColor.copy(_.color).multiplyScalar(x),b.groundColor.copy(_.groundColor).multiplyScalar(x),O.hemi[f]=b,f++)}O.ambient[0]=i,O.ambient[1]=r,O.ambient[2]=o,(e=O.hash).directionalLength===a&&e.pointLength===u&&e.spotLength===h&&e.rectAreaLength===c&&e.hemiLength===f&&e.numDirectionalShadows===l&&e.numPointShadows===d&&e.numSpotShadows===v||(O.directional.length=a,O.spot.length=h,O.rectArea.length=c,O.point.length=u,O.hemi.length=f,O.directionalShadow.length=l,O.directionalShadowMap.length=l,O.pointShadow.length=d,O.pointShadowMap.length=d,O.spotShadow.length=v,O.spotShadowMap.length=v,O.directionalShadowMatrix.length=l,O.pointShadowMatrix.length=d,O.spotShadowMatrix.length=v,e.directionalLength=a,e.pointLength=u,e.spotLength=h,e.rectAreaLength=c,e.hemiLength=f,e.numDirectionalShadows=l,e.numPointShadows=d,e.numSpotShadows=v,O.version=ca++)},state:O}}function da(){var n=new la,e=[],i=[];return{init:function(){e.length=0,i.length=0},state:{lightsArray:e,shadowsArray:i,lights:n},setupLights:function(t){n.setup(e,i,t)},pushLight:function(t){e.push(t)},pushShadow:function(t){i.push(t)}}}function va(){var i=new WeakMap;function r(t){t=t.target;t.removeEventListener("dispose",r),i.delete(t)}return{get:function(t,n){var e;return!1===i.has(t)?(e=new da,i.set(t,new WeakMap),i.get(t).set(n,e),t.addEventListener("dispose",r)):!1===i.get(t).has(n)?(e=new da,i.get(t).set(n,e)):e=i.get(t).get(n),e},dispose:function(){i=new WeakMap}}}function pa(t,n,e){this.width=t,this.height=n,this.scissor=new er(0,0,t,n),this.scissorTest=!1,this.viewport=new er(0,0,t,n),this.texture=new $i(void 0,(e=e||{}).mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=n,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:xn,this.depthBuffer=void 0===e.depthBuffer||e.depthBuffer,this.stencilBuffer=void 0===e.stencilBuffer||e.stencilBuffer,this.depthTexture=void 0!==e.depthTexture?e.depthTexture:null}function ma(t){Vr.call(this),this.type="MeshDepthMaterial",this.depthPacking=qe,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function ga(t){Vr.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Et,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}pa.prototype=Object.assign(Object.create(g.prototype),{constructor:pa,isWebGLRenderTarget:!0,setSize:function(t,n){this.width===t&&this.height===n||(this.width=t,this.height=n,this.texture.image.width=t,this.texture.image.height=n,this.dispose()),this.viewport.set(0,0,t,n),this.scissor.set(0,0,t,n)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),((ma.prototype=Object.create(Vr.prototype)).constructor=ma).prototype.isMeshDepthMaterial=!0,ma.prototype.copy=function(t){return Vr.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},((ga.prototype=Object.create(Vr.prototype)).constructor=ga).prototype.isMeshDistanceMaterial=!0,ga.prototype.copy=function(t){return Vr.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this};var ya="\nuniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n\n#include <packing>\n\nvoid main() {\n\n float mean = 0.0;\n float squared_mean = 0.0;\n\n\t// This seems totally useless but it's a crazy work around for a Adreno compiler bug\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\n #ifdef HORIZONAL_PASS\n\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\n #else\n\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n\n #endif\n\n }\n\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n\n float std_dev = sqrt( squared_mean - mean * mean );\n\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n\n}\n",ba="\n\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n\n";function _a(y,b,_){var w=new ci,x=new ii,M=new ii,E=new er,r=[],o=[],l={},d={0:Tt,1:gt,2:yt},S=new qr({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new ii},radius:{value:4}},vertexShader:ba,fragmentShader:ya}),T=S.clone();T.defines.HORIZONAL_PASS=1;var t=new kr;t.setAttribute("position",new dr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var L=new To(t,S),O=this;function v(t,n,e){var i=t<<0|n<<1|e<<2,e=r[i];return void 0===e&&(e=new ma({depthPacking:Ke,morphTargets:t,skinning:n}),r[i]=e),e}function p(t,n,e){var i=t<<0|n<<1|e<<2,e=o[i];return void 0===e&&(e=new ga({morphTargets:t,skinning:n}),o[i]=e),e}function R(t,n,e,i,r,o){var s,a,u=t.geometry,h=null,c=v,f=t.customDepthMaterial;return!0===e.isPointLight&&(c=p,f=t.customDistanceMaterial),h=void 0===f?(!(s=!1)===n.morphTargets&&(!0===u.isBufferGeometry?s=u.morphAttributes&&u.morphAttributes.position&&0<u.morphAttributes.position.length:!0===u.isGeometry&&(s=u.morphTargets&&0<u.morphTargets.length)),!(a=!1)===t.isSkinnedMesh&&(!0===n.skinning?a=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),c(s,a,!0===t.isInstancedMesh)):f,y.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length&&(a=h.uuid,t=n.uuid,void 0===(f=l[a])&&(l[a]=f={}),void 0===(a=f[t])&&(a=h.clone(),f[t]=a),h=a),h.visible=n.visible,h.wireframe=n.wireframe,h.side=o===mt?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:d[n.side],h.clipShadows=n.clipShadows,h.clippingPlanes=n.clippingPlanes,h.clipIntersection=n.clipIntersection,h.wireframeLinewidth=n.wireframeLinewidth,h.linewidth=n.linewidth,!0===e.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(e.matrixWorld),h.nearDistance=i,h.farDistance=r),h}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=vt,this.render=function(t,n,e){if(!1!==O.enabled&&(!1!==O.autoUpdate||!1!==O.needsUpdate)&&0!==t.length){var i=y.getRenderTarget(),r=y.getActiveCubeFace(),o=y.getActiveMipmapLevel(),s=y.state;s.setBlending(bt),s.buffers.color.setClear(1,1,1,1),s.buffers.depth.setTest(!0),s.setScissorTest(!1);for(var a,u,h=0,c=t.length;h<c;h++){var f=t[h],l=f.shadow;if(void 0!==l){x.copy(l.mapSize);var d,v=l.getFrameExtents();x.multiply(v),M.copy(l.mapSize),(x.x>_||x.y>_)&&(console.warn("THREE.WebGLShadowMap:",f,"has shadow exceeding max texture size, reducing"),x.x>_&&(M.x=Math.floor(_/v.x),x.x=M.x*v.x,l.mapSize.x=M.x),x.y>_&&(M.y=Math.floor(_/v.y),x.y=M.y*v.y,l.mapSize.y=M.y)),null!==l.map||l.isPointLightShadow||this.type!==mt||(l.map=new pa(x.x,x.y,d={minFilter:xn,magFilter:xn,format:Un}),l.map.texture.name=f.name+".shadowMap",l.mapPass=new pa(x.x,x.y,d),l.camera.updateProjectionMatrix()),null===l.map&&(l.map=new pa(x.x,x.y,d={minFilter:bn,magFilter:bn,format:Un}),l.map.texture.name=f.name+".shadowMap",l.camera.updateProjectionMatrix()),y.setRenderTarget(l.map),y.clear();for(var p=l.getViewportCount(),m=0;m<p;m++){var g=l.getViewport(m);E.set(M.x*g.x,M.y*g.y,M.x*g.z,M.y*g.w),s.viewport(E),l.updateMatrices(f,m),w=l.getFrustum(),function t(n,e,i,r,o){if(!1===n.visible)return;var s=n.layers.test(e.layers);if(s&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&o===mt)&&(!n.frustumCulled||w.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,n.matrixWorld);var a=b.update(n),u=n.material;if(Array.isArray(u))for(var h=a.groups,c=0,f=h.length;c<f;c++){var l,d=h[c],v=u[d.materialIndex];v&&v.visible&&(l=R(n,v,r,i.near,i.far,o),y.renderBufferDirect(i,null,a,l,n,d))}else u.visible&&(l=R(n,u,r,i.near,i.far,o),y.renderBufferDirect(i,null,a,l,n,null))}var p=n.children;for(var m=0,g=p.length;m<g;m++)t(p[m],e,i,r,o)}(n,e,l.camera,f,this.type)}l.isPointLightShadow||this.type!==mt||(a=l,u=e,v=void 0,v=b.update(L),S.uniforms.shadow_pass.value=a.map.texture,S.uniforms.resolution.value=a.mapSize,S.uniforms.radius.value=a.radius,y.setRenderTarget(a.mapPass),y.clear(),y.renderBufferDirect(u,null,v,S,L,null),T.uniforms.shadow_pass.value=a.mapPass.texture,T.uniforms.resolution.value=a.mapSize,T.uniforms.radius.value=a.radius,y.setRenderTarget(a.map),y.clear(),y.renderBufferDirect(u,null,v,T,L,null))}else console.warn("THREE.WebGLShadowMap:",f,"has no shadow.")}O.needsUpdate=!1,y.setRenderTarget(i,r,o)}}}function wa(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function xa(c,e,t){var i=t.isWebGL2;var r=new function(){var n=!1,o=new er,e=null,s=new er(0,0,0,0);return{setMask:function(t){e===t||n||(c.colorMask(t,t,t,t),e=t)},setLocked:function(t){n=t},setClear:function(t,n,e,i,r){!0===r&&(t*=i,n*=i,e*=i),o.set(t,n,e,i),!1===s.equals(o)&&(c.clearColor(t,n,e,i),s.copy(o))},reset:function(){n=!1,e=null,s.set(-1,0,0,0)}}},o=new function(){var n=!1,e=null,i=null,r=null;return{setTest:function(t){(t?N:I)(c.DEPTH_TEST)},setMask:function(t){e===t||n||(c.depthMask(t),e=t)},setFunc:function(t){if(i!==t){if(t)switch(t){case Wt:c.depthFunc(c.NEVER);break;case Xt:c.depthFunc(c.ALWAYS);break;case Yt:c.depthFunc(c.LESS);break;case Zt:c.depthFunc(c.LEQUAL);break;case qt:c.depthFunc(c.EQUAL);break;case Kt:c.depthFunc(c.GEQUAL);break;case Jt:c.depthFunc(c.GREATER);break;case Qt:c.depthFunc(c.NOTEQUAL);break;default:c.depthFunc(c.LEQUAL)}else c.depthFunc(c.LEQUAL);i=t}},setLocked:function(t){n=t},setClear:function(t){r!==t&&(c.clearDepth(t),r=t)},reset:function(){n=!1,r=i=e=null}}},s=new function(){var n=!1,e=null,i=null,r=null,o=null,s=null,a=null,u=null,h=null;return{setTest:function(t){n||(t?N:I)(c.STENCIL_TEST)},setMask:function(t){e===t||n||(c.stencilMask(t),e=t)},setFunc:function(t,n,e){i===t&&r===n&&o===e||(c.stencilFunc(t,n,e),i=t,r=n,o=e)},setOp:function(t,n,e){s===t&&a===n&&u===e||(c.stencilOp(t,n,e),s=t,a=n,u=e)},setLocked:function(t){n=t},setClear:function(t){h!==t&&(c.clearStencil(t),h=t)},reset:function(){n=!1,h=u=a=s=o=r=i=e=null}}},n=c.getParameter(c.MAX_VERTEX_ATTRIBS),a=new Uint8Array(n),u=new Uint8Array(n),h=new Uint8Array(n),f={},l=null,d=null,v=null,p=null,m=null,g=null,y=null,b=null,_=null,w=!1,x=null,M=null,E=null,S=null,T=null,L=c.getParameter(c.MAX_COMBINED_TEXTURE_IMAGE_UNITS),O=!1,t=0,n=c.getParameter(c.VERSION);-1!==n.indexOf("WebGL")?(t=parseFloat(/^WebGL\ ([0-9])/.exec(n)[1]),O=1<=t):-1!==n.indexOf("OpenGL ES")&&(t=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(n)[1]),O=2<=t);var R=null,A={},C=new er,k=new er;function P(t,n,e){var i=new Uint8Array(4),r=c.createTexture();c.bindTexture(t,r),c.texParameteri(t,c.TEXTURE_MIN_FILTER,c.NEAREST),c.texParameteri(t,c.TEXTURE_MAG_FILTER,c.NEAREST);for(var o=0;o<e;o++)c.texImage2D(n+o,0,c.RGBA,1,1,0,c.RGBA,c.UNSIGNED_BYTE,i);return r}var D={};function j(t,n){a[t]=1,0===u[t]&&(c.enableVertexAttribArray(t),u[t]=1),h[t]!==n&&((i?c:e.get("ANGLE_instanced_arrays"))[i?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](t,n),h[t]=n)}function N(t){!0!==f[t]&&(c.enable(t),f[t]=!0)}function I(t){!1!==f[t]&&(c.disable(t),f[t]=!1)}D[c.TEXTURE_2D]=P(c.TEXTURE_2D,c.TEXTURE_2D,1),D[c.TEXTURE_CUBE_MAP]=P(c.TEXTURE_CUBE_MAP,c.TEXTURE_CUBE_MAP_POSITIVE_X,6),r.setClear(0,0,0,1),o.setClear(1),s.setClear(0),N(c.DEPTH_TEST),o.setFunc(Zt),H(!1),V(lt),N(c.CULL_FACE),B(bt);var F,U=(wa(t={},Rt,c.FUNC_ADD),wa(t,At,c.FUNC_SUBTRACT),wa(t,Ct,c.FUNC_REVERSE_SUBTRACT),t);i?(U[kt]=c.MIN,U[Pt]=c.MAX):null!==(F=e.get("EXT_blend_minmax"))&&(U[kt]=F.MIN_EXT,U[Pt]=F.MAX_EXT);var G=(wa(F={},Dt,c.ZERO),wa(F,jt,c.ONE),wa(F,Nt,c.SRC_COLOR),wa(F,Ft,c.SRC_ALPHA),wa(F,zt,c.SRC_ALPHA_SATURATE),wa(F,Ht,c.DST_COLOR),wa(F,Gt,c.DST_ALPHA),wa(F,It,c.ONE_MINUS_SRC_COLOR),wa(F,Ut,c.ONE_MINUS_SRC_ALPHA),wa(F,Vt,c.ONE_MINUS_DST_COLOR),wa(F,Bt,c.ONE_MINUS_DST_ALPHA),F);function B(t,n,e,i,r,o,s,a){if(t!==bt){if(d||(N(c.BLEND),d=!0),t===Ot)r=r||n,o=o||e,s=s||i,n===p&&r===y||(c.blendEquationSeparate(U[n],U[r]),p=n,y=r),e===m&&i===g&&o===b&&s===_||(c.blendFuncSeparate(G[e],G[i],G[o],G[s]),m=e,g=i,b=o,_=s),v=t,w=null;else if(t!==v||a!==w){if(p===Rt&&y===Rt||(c.blendEquation(c.FUNC_ADD),y=p=Rt),a)switch(t){case _t:c.blendFuncSeparate(c.ONE,c.ONE_MINUS_SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA);break;case wt:c.blendFunc(c.ONE,c.ONE);break;case xt:c.blendFuncSeparate(c.ZERO,c.ZERO,c.ONE_MINUS_SRC_COLOR,c.ONE_MINUS_SRC_ALPHA);break;case Lt:c.blendFuncSeparate(c.ZERO,c.SRC_COLOR,c.ZERO,c.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case _t:c.blendFuncSeparate(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA);break;case wt:c.blendFunc(c.SRC_ALPHA,c.ONE);break;case xt:c.blendFunc(c.ZERO,c.ONE_MINUS_SRC_COLOR);break;case Lt:c.blendFunc(c.ZERO,c.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}_=b=g=m=null,v=t,w=a}}else d&&(I(c.BLEND),d=!1)}function H(t){x!==t&&(t?c.frontFace(c.CW):c.frontFace(c.CCW),x=t)}function V(t){t!==ft?(N(c.CULL_FACE),t!==M&&(t===lt?c.cullFace(c.BACK):t===dt?c.cullFace(c.FRONT):c.cullFace(c.FRONT_AND_BACK))):I(c.CULL_FACE),M=t}function z(t,n,e){t?(N(c.POLYGON_OFFSET_FILL),S===n&&T===e||(c.polygonOffset(n,e),S=n,T=e)):I(c.POLYGON_OFFSET_FILL)}function W(t){void 0===t&&(t=c.TEXTURE0+L-1),R!==t&&(c.activeTexture(t),R=t)}return{buffers:{color:r,depth:o,stencil:s},initAttributes:function(){for(var t=0,n=a.length;t<n;t++)a[t]=0},enableAttribute:function(t){j(t,0)},enableAttributeAndDivisor:j,disableUnusedAttributes:function(){for(var t=0,n=u.length;t!==n;++t)u[t]!==a[t]&&(c.disableVertexAttribArray(t),u[t]=0)},enable:N,disable:I,useProgram:function(t){return l!==t&&(c.useProgram(t),l=t,!0)},setBlending:B,setMaterial:function(t,n){(t.side===yt?I:N)(c.CULL_FACE);var e=t.side===Tt;H(e=n?!e:e),t.blending===_t&&!1===t.transparent?B(bt):B(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),r.setMask(t.colorWrite),e=t.stencilWrite,s.setTest(e),e&&(s.setMask(t.stencilWriteMask),s.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),s.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),z(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:H,setCullFace:V,setLineWidth:function(t){t!==E&&(O&&c.lineWidth(t),E=t)},setPolygonOffset:z,setScissorTest:function(t){(t?N:I)(c.SCISSOR_TEST)},activeTexture:W,bindTexture:function(t,n){null===R&&W();var e=A[R];void 0===e&&(A[R]=e={type:void 0,texture:void 0}),e.type===t&&e.texture===n||(c.bindTexture(t,n||D[t]),e.type=t,e.texture=n)},unbindTexture:function(){var t=A[R];void 0!==t&&void 0!==t.type&&(c.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{c.compressedTexImage2D.apply(c,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{c.texImage2D.apply(c,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{c.texImage3D.apply(c,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===C.equals(t)&&(c.scissor(t.x,t.y,t.z,t.w),C.copy(t))},viewport:function(t){!1===k.equals(t)&&(c.viewport(t.x,t.y,t.z,t.w),k.copy(t))},reset:function(){for(var t=0;t<u.length;t++)1===u[t]&&(c.disableVertexAttribArray(t),u[t]=0);f={},A={},M=x=v=l=R=null,r.reset(),o.reset(),s.reset()}}}function Ma(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function Ea(m,i,g,y,r,b,u){var t,o,_=r.isWebGL2,n=r.maxTextures,w=r.maxCubemapSize,l=r.maxTextureSize,e=r.maxSamples,s=new WeakMap,a=!1;try{a="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function h(t,n){return a?new OffscreenCanvas(t,n):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function x(t,n,e,i){var r=1;if((r=t.width>i||t.height>i?i/Math.max(t.width,t.height):r)<1||!0===n){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){i=n?Mt.floorPowerOfTwo:Math.floor,n=i(r*t.width),r=i(r*t.height);void 0===o&&(o=h(n,r));e=e?h(n,r):o;return e.width=n,e.height=r,e.getContext("2d").drawImage(t,0,0,n,r),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+n+"x"+r+")."),e}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function M(t){return Mt.isPowerOfTwo(t.width)&&Mt.isPowerOfTwo(t.height)}function E(t,n){return t.generateMipmaps&&n&&t.minFilter!==bn&&t.minFilter!==xn}function S(t,n,e,i){m.generateMipmap(t),y.get(n).Dn=Math.log(Math.max(e,i))*Math.LOG2E}function T(t,n,e){if(!1===_)return n;if(null!==t){if(void 0!==m[t])return m[t];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+t+"'")}t=n;return n===m.RED&&(e===m.FLOAT&&(t=m.R32F),e===m.HALF_FLOAT&&(t=m.R16F),e===m.UNSIGNED_BYTE&&(t=m.R8)),n===m.RGB&&(e===m.FLOAT&&(t=m.RGB32F),e===m.HALF_FLOAT&&(t=m.RGB16F),e===m.UNSIGNED_BYTE&&(t=m.RGB8)),n===m.RGBA&&(e===m.FLOAT&&(t=m.RGBA32F),e===m.HALF_FLOAT&&(t=m.RGBA16F),e===m.UNSIGNED_BYTE&&(t=m.RGBA8)),t!==m.R16F&&t!==m.R32F&&t!==m.RGBA16F&&t!==m.RGBA32F||i.get("EXT_color_buffer_float"),t}function c(t){return t===bn||t===_n||t===wn?m.NEAREST:m.LINEAR}function f(t){var n,e=t.target;e.removeEventListener("dispose",f),n=e,void 0!==(t=y.get(n)).jn&&(m.deleteTexture(t.Nn),y.remove(n)),e.isVideoTexture&&s.delete(e),u.memory.textures--}function d(t){t=t.target;t.removeEventListener("dispose",d),function(t){var n=y.get(t),e=y.get(t.texture);if(t){if(void 0!==e.Nn&&m.deleteTexture(e.Nn),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var i=0;i<6;i++)m.deleteFramebuffer(n.In[i]),n.Fn&&m.deleteRenderbuffer(n.Fn[i]);else m.deleteFramebuffer(n.In),n.Fn&&m.deleteRenderbuffer(n.Fn),n.Un&&m.deleteFramebuffer(n.Un),n.Gn&&m.deleteRenderbuffer(n.Gn),n.Bn&&m.deleteRenderbuffer(n.Bn);y.remove(t.texture),y.remove(t)}}(t),u.memory.textures--}var v=0;function p(t,n){var e,i=y.get(t);if(t.isVideoTexture&&(r=t,e=u.render.frame,s.get(r)!==e&&(s.set(r,e),r.update())),0<t.version&&i.Hn!==t.version){var r=t.image;if(void 0===r)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==r.complete)return void P(i,t,n);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_2D,i.Nn)}function L(t,n){if(6===t.image.length){var e=y.get(t);if(0<t.version&&e.Hn!==t.version){k(e,t),g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_CUBE_MAP,e.Nn),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var i=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),r=t.image[0]&&t.image[0].isDataTexture,o=[],s=0;s<6;s++)o[s]=i||r?r?t.image[s].image:t.image[s]:x(t.image[s],!1,!0,w);var a=o[0],u=M(a)||_,h=b.convert(t.format),c=b.convert(t.type),f=T(t.internalFormat,h,c);if(C(m.TEXTURE_CUBE_MAP,t,u),i){for(s=0;s<6;s++)for(var l=o[s].mipmaps,d=0;d<l.length;d++){var v=l[d];t.format!==Un&&t.format!==Fn?null!==h?g.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d,f,v.width,v.height,0,v.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d,f,v.width,v.height,0,h,c,v.data)}e.Dn=l.length-1}else{l=t.mipmaps;for(s=0;s<6;s++)if(r){g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,f,o[s].width,o[s].height,0,h,c,o[s].data);for(d=0;d<l.length;d++){var p=(v=l[d]).image[s].image;g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d+1,f,p.width,p.height,0,h,c,p.data)}}else{g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,f,h,c,o[s]);for(d=0;d<l.length;d++){v=l[d];g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d+1,f,h,c,v.image[s])}}e.Dn=l.length}E(t,u)&&S(m.TEXTURE_CUBE_MAP,t,a.width,a.height),e.Hn=t.version,t.onUpdate&&t.onUpdate(t)}else g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_CUBE_MAP,e.Nn)}}function O(t,n){g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_CUBE_MAP,y.get(t).Nn)}var R=(Ma(t={},mn,m.REPEAT),Ma(t,gn,m.CLAMP_TO_EDGE),Ma(t,yn,m.MIRRORED_REPEAT),t),A=(Ma(t={},bn,m.NEAREST),Ma(t,_n,m.NEAREST_MIPMAP_NEAREST),Ma(t,wn,m.NEAREST_MIPMAP_LINEAR),Ma(t,xn,m.LINEAR),Ma(t,Mn,m.LINEAR_MIPMAP_NEAREST),Ma(t,En,m.LINEAR_MIPMAP_LINEAR),t);function C(t,n,e){e?(m.texParameteri(t,m.TEXTURE_WRAP_S,R[n.wrapS]),m.texParameteri(t,m.TEXTURE_WRAP_T,R[n.wrapT]),t!==m.TEXTURE_3D&&t!==m.TEXTURE_2D_ARRAY||m.texParameteri(t,m.TEXTURE_WRAP_R,R[n.wrapR]),m.texParameteri(t,m.TEXTURE_MAG_FILTER,A[n.magFilter]),m.texParameteri(t,m.TEXTURE_MIN_FILTER,A[n.minFilter])):(m.texParameteri(t,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(t,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),t!==m.TEXTURE_3D&&t!==m.TEXTURE_2D_ARRAY||m.texParameteri(t,m.TEXTURE_WRAP_R,m.CLAMP_TO_EDGE),n.wrapS===gn&&n.wrapT===gn||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),m.texParameteri(t,m.TEXTURE_MAG_FILTER,c(n.magFilter)),m.texParameteri(t,m.TEXTURE_MIN_FILTER,c(n.minFilter)),n.minFilter!==bn&&n.minFilter!==xn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));e=i.get("EXT_texture_filter_anisotropic");e&&(n.type===Cn&&null===i.get("OES_texture_float_linear")||n.type===kn&&null===(_||i.get("OES_texture_half_float_linear"))||(1<n.anisotropy||y.get(n).Vn)&&(m.texParameterf(t,e.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(n.anisotropy,r.getMaxAnisotropy())),y.get(n).Vn=n.anisotropy))}function k(t,n){void 0===t.jn&&(t.jn=!0,n.addEventListener("dispose",f),t.Nn=m.createTexture(),u.memory.textures++)}function P(t,n,e){var i=m.TEXTURE_2D;n.isDataTexture2DArray&&(i=m.TEXTURE_2D_ARRAY),n.isDataTexture3D&&(i=m.TEXTURE_3D),k(t,n),g.activeTexture(m.TEXTURE0+e),g.bindTexture(i,t.Nn),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,n.flipY),m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),m.pixelStorei(m.UNPACK_ALIGNMENT,n.unpackAlignment);var e=(r=n,!_&&(r.wrapS!==gn||r.wrapT!==gn||r.minFilter!==bn&&r.minFilter!==xn)&&!1===M(n.image)),r=x(n.image,e,!1,l),e=M(r)||_,o=b.convert(n.format),s=b.convert(n.type),a=T(n.internalFormat,o,s);C(i,n,e);var u,h=n.mipmaps;if(n.isDepthTexture)a=m.DEPTH_COMPONENT,_?a=n.type===Cn?m.DEPTH_COMPONENT32F:n.type===An?m.DEPTH_COMPONENT24:n.type===Nn?m.DEPTH24_STENCIL8:m.DEPTH_COMPONENT16:n.type===Cn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===Hn&&a===m.DEPTH_COMPONENT&&n.type!==On&&n.type!==An&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=On,s=b.convert(n.type)),n.format===Vn&&a===m.DEPTH_COMPONENT&&(a=m.DEPTH_STENCIL,n.type!==Nn&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Nn,s=b.convert(n.type))),g.texImage2D(m.TEXTURE_2D,0,a,r.width,r.height,0,o,s,null);else if(n.isDataTexture)if(0<h.length&&e){for(var c=0,f=h.length;c<f;c++)u=h[c],g.texImage2D(m.TEXTURE_2D,c,a,u.width,u.height,0,o,s,u.data);n.generateMipmaps=!1,t.Dn=h.length-1}else g.texImage2D(m.TEXTURE_2D,0,a,r.width,r.height,0,o,s,r.data),t.Dn=0;else if(n.isCompressedTexture){for(c=0,f=h.length;c<f;c++)u=h[c],n.format!==Un&&n.format!==Fn?null!==o?g.compressedTexImage2D(m.TEXTURE_2D,c,a,u.width,u.height,0,u.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):g.texImage2D(m.TEXTURE_2D,c,a,u.width,u.height,0,o,s,u.data);t.Dn=h.length-1}else if(n.isDataTexture2DArray)g.texImage3D(m.TEXTURE_2D_ARRAY,0,a,r.width,r.height,r.depth,0,o,s,r.data),t.Dn=0;else if(n.isDataTexture3D)g.texImage3D(m.TEXTURE_3D,0,a,r.width,r.height,r.depth,0,o,s,r.data),t.Dn=0;else if(0<h.length&&e){for(c=0,f=h.length;c<f;c++)u=h[c],g.texImage2D(m.TEXTURE_2D,c,a,o,s,u);n.generateMipmaps=!1,t.Dn=h.length-1}else g.texImage2D(m.TEXTURE_2D,0,a,o,s,r),t.Dn=0;E(n,e)&&S(i,n,r.width,r.height),t.Hn=n.version,n.onUpdate&&n.onUpdate(n)}function D(t,n,e,i){var r=b.convert(n.texture.format),o=b.convert(n.texture.type),s=T(n.texture.internalFormat,r,o);g.texImage2D(i,0,s,n.width,n.height,0,r,o,null),m.bindFramebuffer(m.FRAMEBUFFER,t),m.framebufferTexture2D(m.FRAMEBUFFER,e,i,y.get(n.texture).Nn,0),m.bindFramebuffer(m.FRAMEBUFFER,null)}function j(t,n,e){var i,r,o;m.bindRenderbuffer(m.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer?(r=m.DEPTH_COMPONENT16,e?((i=n.depthTexture)&&i.isDepthTexture&&(i.type===Cn?r=m.DEPTH_COMPONENT32F:i.type===An&&(r=m.DEPTH_COMPONENT24)),o=I(n),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,r,n.width,n.height)):m.renderbufferStorage(m.RENDERBUFFER,r,n.width,n.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,t)):n.depthBuffer&&n.stencilBuffer?(e?(o=I(n),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,m.DEPTH24_STENCIL8,n.width,n.height)):m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,n.width,n.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,t)):(i=b.convert(n.texture.format),t=b.convert(n.texture.type),r=T(n.texture.internalFormat,i,t),e?(o=I(n),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,r,n.width,n.height)):m.renderbufferStorage(m.RENDERBUFFER,r,n.width,n.height)),m.bindRenderbuffer(m.RENDERBUFFER,null)}function N(t){var n=y.get(t),e=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(e)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(m.bindFramebuffer(m.FRAMEBUFFER,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(y.get(n.depthTexture).Nn&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),p(n.depthTexture,0),t=y.get(n.depthTexture).Nn,n.depthTexture.format===Hn)m.framebufferTexture2D(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.TEXTURE_2D,t,0);else{if(n.depthTexture.format!==Vn)throw new Error("Unknown depthTexture format");m.framebufferTexture2D(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.TEXTURE_2D,t,0)}}(n.In,t)}else if(e){n.Fn=[];for(var i=0;i<6;i++)m.bindFramebuffer(m.FRAMEBUFFER,n.In[i]),n.Fn[i]=m.createRenderbuffer(),j(n.Fn[i],t,!1)}else m.bindFramebuffer(m.FRAMEBUFFER,n.In),n.Fn=m.createRenderbuffer(),j(n.Fn,t,!1);m.bindFramebuffer(m.FRAMEBUFFER,null)}function I(t){return _&&t.isWebGLMultisampleRenderTarget?Math.min(e,t.samples):0}var F=!1,U=!1;this.allocateTextureUnit=function(){var t=v;return n<=t&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+n),v+=1,t},this.resetTextureUnits=function(){v=0},this.setTexture2D=p,this.setTexture2DArray=function(t,n){var e=y.get(t);0<t.version&&e.Hn!==t.version?P(e,t,n):(g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_2D_ARRAY,e.Nn))},this.setTexture3D=function(t,n){var e=y.get(t);0<t.version&&e.Hn!==t.version?P(e,t,n):(g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_3D,e.Nn))},this.setTextureCube=L,this.setTextureCubeDynamic=O,this.setupRenderTarget=function(t){var n=y.get(t),e=y.get(t.texture);t.addEventListener("dispose",d),e.Nn=m.createTexture(),u.memory.textures++;var i,r=!0===t.isWebGLCubeRenderTarget,o=!0===t.isWebGLMultisampleRenderTarget,s=M(t)||_;if(!_||t.texture.format!==Fn||t.texture.type!==Cn&&t.texture.type!==kn||(t.texture.format=Un,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),r){n.In=[];for(var a=0;a<6;a++)n.In[a]=m.createFramebuffer()}else n.In=m.createFramebuffer(),o&&(_?(n.Un=m.createFramebuffer(),n.Gn=m.createRenderbuffer(),m.bindRenderbuffer(m.RENDERBUFFER,n.Gn),i=b.convert(t.texture.format),o=b.convert(t.texture.type),i=T(t.texture.internalFormat,i,o),o=I(t),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,i,t.width,t.height),m.bindFramebuffer(m.FRAMEBUFFER,n.Un),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.RENDERBUFFER,n.Gn),m.bindRenderbuffer(m.RENDERBUFFER,null),t.depthBuffer&&(n.Bn=m.createRenderbuffer(),j(n.Bn,t,!0)),m.bindFramebuffer(m.FRAMEBUFFER,null)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."));if(r){g.bindTexture(m.TEXTURE_CUBE_MAP,e.Nn),C(m.TEXTURE_CUBE_MAP,t.texture,s);for(a=0;a<6;a++)D(n.In[a],t,m.COLOR_ATTACHMENT0,m.TEXTURE_CUBE_MAP_POSITIVE_X+a);E(t.texture,s)&&S(m.TEXTURE_CUBE_MAP,t.texture,t.width,t.height),g.bindTexture(m.TEXTURE_CUBE_MAP,null)}else g.bindTexture(m.TEXTURE_2D,e.Nn),C(m.TEXTURE_2D,t.texture,s),D(n.In,t,m.COLOR_ATTACHMENT0,m.TEXTURE_2D),E(t.texture,s)&&S(m.TEXTURE_2D,t.texture,t.width,t.height),g.bindTexture(m.TEXTURE_2D,null);t.depthBuffer&&N(t)},this.updateRenderTargetMipmap=function(t){var n,e,i=t.texture;E(i,M(t)||_)&&(n=t.isWebGLCubeRenderTarget?m.TEXTURE_CUBE_MAP:m.TEXTURE_2D,e=y.get(i).Nn,g.bindTexture(n,e),S(n,i,t.width,t.height),g.bindTexture(n,null))},this.updateMultisampleRenderTarget=function(t){var n,e,i,r;t.isWebGLMultisampleRenderTarget&&(_?(n=y.get(t),m.bindFramebuffer(m.READ_FRAMEBUFFER,n.Un),m.bindFramebuffer(m.DRAW_FRAMEBUFFER,n.In),e=t.width,i=t.height,r=m.COLOR_BUFFER_BIT,t.depthBuffer&&(r|=m.DEPTH_BUFFER_BIT),t.stencilBuffer&&(r|=m.STENCIL_BUFFER_BIT),m.blitFramebuffer(0,0,e,i,0,0,e,i,r,m.NEAREST),m.bindFramebuffer(m.FRAMEBUFFER,n.Un)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."))},this.safeSetTexture2D=function(t,n){t&&t.isWebGLRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),F=!0),t=t.texture),p(t,n)},this.safeSetTextureCube=function(t,n){t&&t.isWebGLCubeRenderTarget&&(!1===U&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),U=!0),t=t.texture),(t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?L:O)(t,n)}}function Sa(e,i,t){var r=t.isWebGL2;return{convert:function(t){var n;if(t===Sn)return e.UNSIGNED_BYTE;if(t===Pn)return e.UNSIGNED_SHORT_4_4_4_4;if(t===Dn)return e.UNSIGNED_SHORT_5_5_5_1;if(t===jn)return e.UNSIGNED_SHORT_5_6_5;if(t===Tn)return e.BYTE;if(t===Ln)return e.SHORT;if(t===On)return e.UNSIGNED_SHORT;if(t===Rn)return e.INT;if(t===An)return e.UNSIGNED_INT;if(t===Cn)return e.FLOAT;if(t===kn)return r?e.HALF_FLOAT:null!==(n=i.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(t===In)return e.ALPHA;if(t===Fn)return e.RGB;if(t===Un)return e.RGBA;if(t===Gn)return e.LUMINANCE;if(t===Bn)return e.LUMINANCE_ALPHA;if(t===Hn)return e.DEPTH_COMPONENT;if(t===Vn)return e.DEPTH_STENCIL;if(t===zn)return e.RED;if(t===Wn)return e.RED_INTEGER;if(t===Xn)return e.RG;if(t===Yn)return e.RG_INTEGER;if(t===Zn)return e.RGB_INTEGER;if(t===qn)return e.RGBA_INTEGER;if(t===Kn||t===Jn||t===Qn||t===$n){if(null===(n=i.get("WEBGL_compressed_texture_s3tc")))return null;if(t===Kn)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Jn)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Qn)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===$n)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===te||t===ne||t===ee||t===ie){if(null===(n=i.get("WEBGL_compressed_texture_pvrtc")))return null;if(t===te)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===ne)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===ee)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===ie)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===re)return null!==(n=i.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((t===oe||t===se)&&null!==(n=i.get("WEBGL_compressed_texture_etc"))){if(t===oe)return n.COMPRESSED_RGB8_ETC2;if(t===se)return n.COMPRESSED_RGBA8_ETC2_EAC}return t===ae||t===ue||t===he||t===ce||t===fe||t===le||t===de||t===ve||t===pe||t===me||t===ge||t===ye||t===be||t===_e||t===xe||t===Me||t===Ee||t===Se||t===Te||t===Le||t===Oe||t===Re||t===Ae||t===Ce||t===ke||t===Pe||t===De||t===je?null!==(n=i.get("WEBGL_compressed_texture_astc"))?t:null:t===we?null!==(n=i.get("EXT_texture_compression_bptc"))?t:null:t===Nn?r?e.UNSIGNED_INT_24_8:null!==(n=i.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function Ta(t){Z.call(this),this.cameras=t||[]}function La(){Y.call(this),this.type="Group"}function Oa(d,n){var e=this,v=null,i=1,p=null,r="local-floor",m=null,g=[],o=new Map,s=new Z;s.layers.enable(1),s.viewport=new er;var a=new Z;a.layers.enable(2),a.viewport=new er;var y=new Ta([s,a]);y.layers.enable(1),y.layers.enable(2);var u=null,h=null;function c(t){var n=o.get(t.inputSource);n&&(n.targetRay&&n.targetRay.dispatchEvent({type:t.type}),n.grip&&n.grip.dispatchEvent({type:t.type}))}function f(){o.forEach(function(t,n){t.targetRay&&(t.targetRay.dispatchEvent({type:"disconnected",data:n}),t.targetRay.visible=!1),t.grip&&(t.grip.dispatchEvent({type:"disconnected",data:n}),t.grip.visible=!1)}),o.clear(),d.setFramebuffer(null),d.setRenderTarget(d.getRenderTarget()),E.stop(),e.isPresenting=!1,e.dispatchEvent({type:"sessionend"})}function l(t){p=t,E.setContext(v),E.start(),e.isPresenting=!0,e.dispatchEvent({type:"sessionstart"})}function b(t){for(var n=v.inputSources,e=0;e<g.length;e++)o.set(n[e],g[e]);for(e=0;e<t.removed.length;e++){var i=t.removed[e];(r=o.get(i))&&(r.targetRay&&r.targetRay.dispatchEvent({type:"disconnected",data:i}),r.grip&&r.grip.dispatchEvent({type:"disconnected",data:i}),o.delete(i))}for(e=0;e<t.added.length;e++){var r,i=t.added[e];(r=o.get(i))&&(r.targetRay&&r.targetRay.dispatchEvent({type:"connected",data:i}),r.grip&&r.grip.dispatchEvent({type:"connected",data:i}))}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){var n=g[t];return void 0===n&&(g[t]=n={}),void 0===n.targetRay&&(n.targetRay=new La,n.targetRay.matrixAutoUpdate=!1,n.targetRay.visible=!1),n.targetRay},this.getControllerGrip=function(t){var n=g[t];return void 0===n&&(g[t]=n={}),void 0===n.grip&&(n.grip=new La,n.grip.matrixAutoUpdate=!1,n.grip.visible=!1),n.grip},this.setFramebufferScaleFactor=function(t){i=t,1==e.isPresenting&&console.warn("WebXRManager: Cannot change framebuffer scale while presenting VR content")},this.setReferenceSpaceType=function(t){r=t},this.getReferenceSpace=function(){return p},this.getSession=function(){return v},this.setSession=function(t){null!==(v=t)&&(v.addEventListener("select",c),v.addEventListener("selectstart",c),v.addEventListener("selectend",c),v.addEventListener("squeeze",c),v.addEventListener("squeezestart",c),v.addEventListener("squeezeend",c),v.addEventListener("end",f),t={antialias:(t=n.getContextAttributes()).antialias,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:i},t=new XRWebGLLayer(v,n,t),v.updateRenderState({baseLayer:t}),v.requestReferenceSpace(r).then(l),v.addEventListener("inputsourceschange",b))};var _=new Et,w=new Et;function x(t,n){null===n?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(n.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}this.getCamera=function(t){y.near=a.near=s.near=t.near,y.far=a.far=s.far=t.far,u===y.near&&h===y.far||(v.updateRenderState({depthNear:y.near,depthFar:y.far}),u=y.near,h=y.far);var n=t.parent,e=y.cameras;x(y,n);for(var i=0;i<e.length;i++)x(e[i],n);t.matrixWorld.copy(y.matrixWorld);for(var r=t.children,i=0,o=r.length;i<o;i++)r[i].updateMatrixWorld(!0);return function(t,n,e){_.setFromMatrixPosition(n.matrixWorld),w.setFromMatrixPosition(e.matrixWorld);var i=_.distanceTo(w),r=n.projectionMatrix.elements,o=e.projectionMatrix.elements,s=r[14]/(r[10]-1),a=r[14]/(r[10]+1),u=(r[9]+1)/r[5],h=(r[9]-1)/r[5],c=(r[8]-1)/r[0],e=(o[8]+1)/o[0],r=s*c,o=s*e,c=(e=i/(e-c))*-c;n.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(c),t.translateZ(e),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld),s+=e,e=a+e,t.projectionMatrix.makePerspective(r-c,i-c+o,u*a/e*s,h*a/e*s,s,e)}(y,s,a),y};var M=null;var E=new rr;E.setAnimationLoop(function(t,n){if(null!==(m=n.getViewerPose(p))){var e=m.views,i=v.renderState.baseLayer;d.setFramebuffer(i.framebuffer);for(var r=0;r<e.length;r++){var o=e[r],s=i.getViewport(o),a=y.cameras[r];a.matrix.fromArray(o.transform.matrix),a.projectionMatrix.fromArray(o.projectionMatrix),a.viewport.set(s.x,s.y,s.width,s.height),0===r&&y.matrix.copy(a.matrix)}}for(var u=v.inputSources,r=0;r<g.length;r++){var h=g[r],c=u[r],f=null,l=null;c&&(h.targetRay&&null!==(f=n.getPose(c.targetRaySpace,p))&&(h.targetRay.matrix.fromArray(f.transform.matrix),h.targetRay.matrix.decompose(h.targetRay.position,h.targetRay.rotation,h.targetRay.scale)),h.grip&&c.gripSpace&&null!==(l=n.getPose(c.gripSpace,p))&&(h.grip.matrix.fromArray(l.transform.matrix),h.grip.matrix.decompose(h.grip.position,h.grip.rotation,h.grip.scale))),h.targetRay&&(h.targetRay.visible=null!==f),h.grip&&(h.grip.visible=null!==l)}M&&M(t,n)}),this.setAnimationLoop=function(t){M=t},this.dispose=function(){}}function Ra(t){var i=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==t.context?t.context:null,e=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,s=void 0!==t.antialias&&t.antialias,a=void 0===t.premultipliedAlpha||t.premultipliedAlpha,u=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,h=void 0!==t.powerPreference?t.powerPreference:"default",c=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,v=null,y=null;this.domElement=i,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=Be,this.physicallyCorrectLights=!1,this.toneMapping=rn,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var _,w,x,M,p,b,E,S,f,m,l,d,g,T,L,O,R,A,C=this,k=!1,P=null,D=0,j=0,N=null,I=null,F=-1,U={geometry:null,program:null,wireframe:!1},G=null,B=null,H=new er,V=new er,z=null,W=i.width,X=i.height,Y=1,Z=null,q=null,K=new er(0,0,W,X),J=new er(0,0,W,X),Q=!1,$=new ci,tt=new Do,nt=!1,et=!1,it=new St,rt=new Et;function ot(){return null===N?Y:1}try{var st={alpha:e,depth:r,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:u,powerPreference:h,failIfMajorPerformanceCaveat:c,xrCompatible:!0};if(i.addEventListener("webglcontextlost",ct,!1),i.addEventListener("webglcontextrestored",ft,!1),null===(_=n||i.getContext("webgl",st)||i.getContext("experimental-webgl",st)))throw null!==i.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===_.getShaderPrecisionFormat&&(_.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function at(){w=new jo(_),!1===(x=new Po(_,w,t)).isWebGL2&&(w.get("WEBGL_depth_texture"),w.get("OES_texture_float"),w.get("OES_texture_half_float"),w.get("OES_texture_half_float_linear"),w.get("OES_standard_derivatives"),w.get("OES_element_index_uint"),w.get("ANGLE_instanced_arrays")),w.get("OES_texture_float_linear"),A=new Sa(_,w,x),(M=new xa(_,w,x)).scissor(V.copy(J).multiplyScalar(Y).floor()),M.viewport(H.copy(K).multiplyScalar(Y).floor()),p=new Fo(_),b=new ra,E=new Ea(_,w,M,b,x,A,p),S=new or(_,x),f=new No(_,S,p),m=new Bo(_,f,S,p),L=new Go(_),l=new ia(C,w,x),d=new ua,g=new va,T=new Co(C,M,m,a),O=new ko(_,w,p,x),R=new Io(_,w,p,x),p.programs=l.programs,C.capabilities=x,C.extensions=w,C.properties=b,C.renderLists=d,C.state=M,C.info=p}at();var ut=new Oa(C,_);this.xr=ut;var ht=new _a(C,m,x.maxTextureSize);function ct(t){t.preventDefault(),k=!0}function ft(){k=!1,at()}function lt(t){t=t.target;t.removeEventListener("dispose",lt),dt(t=t),b.remove(t)}function dt(t){var n=b.get(t).program;(t.program=void 0)!==n&&l.releaseProgram(n)}this.shadowMap=ht,this.getContext=function(){return _},this.getContextAttributes=function(){return _.getContextAttributes()},this.forceContextLoss=function(){var t=w.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=w.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return Y},this.setPixelRatio=function(t){void 0!==t&&(Y=t,this.setSize(W,X,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new ii),t.set(W,X)},this.setSize=function(t,n,e){ut.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(W=t,X=n,i.width=Math.floor(t*Y),i.height=Math.floor(n*Y),!1!==e&&(i.style.width=t+"px",i.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new ii),t.set(W*Y,X*Y).floor()},this.setDrawingBufferSize=function(t,n,e){W=t,X=n,Y=e,i.width=Math.floor(t*e),i.height=Math.floor(n*e),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new er),t.copy(H)},this.getViewport=function(t){return t.copy(K)},this.setViewport=function(t,n,e,i){t.isVector4?K.set(t.x,t.y,t.z,t.w):K.set(t,n,e,i),M.viewport(H.copy(K).multiplyScalar(Y).floor())},this.getScissor=function(t){return t.copy(J)},this.setScissor=function(t,n,e,i){t.isVector4?J.set(t.x,t.y,t.z,t.w):J.set(t,n,e,i),M.scissor(V.copy(J).multiplyScalar(Y).floor())},this.getScissorTest=function(){return Q},this.setScissorTest=function(t){M.setScissorTest(Q=t)},this.setOpaqueSort=function(t){Z=t},this.setTransparentSort=function(t){q=t},this.getClearColor=function(){return T.getClearColor()},this.setClearColor=function(){T.setClearColor.apply(T,arguments)},this.getClearAlpha=function(){return T.getClearAlpha()},this.setClearAlpha=function(){T.setClearAlpha.apply(T,arguments)},this.clear=function(t,n,e){var i=0;void 0!==t&&!t||(i|=_.COLOR_BUFFER_BIT),void 0!==n&&!n||(i|=_.DEPTH_BUFFER_BIT),void 0!==e&&!e||(i|=_.STENCIL_BUFFER_BIT),_.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){i.removeEventListener("webglcontextlost",ct,!1),i.removeEventListener("webglcontextrestored",ft,!1),d.dispose(),g.dispose(),b.dispose(),m.dispose(),ut.dispose(),mt.stop(),this.forceContextLoss()},this.renderBufferImmediate=function(t,n){M.initAttributes();var e=b.get(t);t.hasPositions&&!e.position&&(e.position=_.createBuffer()),t.hasNormals&&!e.normal&&(e.normal=_.createBuffer()),t.hasUvs&&!e.uv&&(e.uv=_.createBuffer()),t.hasColors&&!e.color&&(e.color=_.createBuffer());n=n.getAttributes();t.hasPositions&&(_.bindBuffer(_.ARRAY_BUFFER,e.position),_.bufferData(_.ARRAY_BUFFER,t.positionArray,_.DYNAMIC_DRAW),M.enableAttribute(n.position),_.vertexAttribPointer(n.position,3,_.FLOAT,!1,0,0)),t.hasNormals&&(_.bindBuffer(_.ARRAY_BUFFER,e.normal),_.bufferData(_.ARRAY_BUFFER,t.normalArray,_.DYNAMIC_DRAW),M.enableAttribute(n.normal),_.vertexAttribPointer(n.normal,3,_.FLOAT,!1,0,0)),t.hasUvs&&(_.bindBuffer(_.ARRAY_BUFFER,e.uv),_.bufferData(_.ARRAY_BUFFER,t.uvArray,_.DYNAMIC_DRAW),M.enableAttribute(n.uv),_.vertexAttribPointer(n.uv,2,_.FLOAT,!1,0,0)),t.hasColors&&(_.bindBuffer(_.ARRAY_BUFFER,e.color),_.bufferData(_.ARRAY_BUFFER,t.colorArray,_.DYNAMIC_DRAW),M.enableAttribute(n.color),_.vertexAttribPointer(n.color,3,_.FLOAT,!1,0,0)),M.disableUnusedAttributes(),_.drawArrays(_.TRIANGLES,0,t.count),t.count=0};var vt=new ir;this.renderBufferDirect=function(t,n,e,i,r,o){null===n&&(n=vt);var s=r.isMesh&&r.matrixWorld.determinant()<0,a=_t(t,n,i,r);M.setMaterial(i,s);var u=!1;U.geometry===e.id&&U.program===a.id&&U.wireframe===(!0===i.wireframe)||(U.geometry=e.id,U.program=a.id,U.wireframe=!0===i.wireframe,u=!0),(i.morphTargets||i.morphNormals)&&(L.update(r,e,i,a),u=!0);var h=e.index,t=e.attributes.position;if(null===h){if(void 0===t||0===t.count)return}else if(0===h.count)return;n=1;!0===i.wireframe&&(h=f.getWireframeAttribute(e),n=2);s=O;null!==h&&(c=S.get(h),(s=R).setIndex(c)),u&&(function(t,n,e,i){if(!1===x.isWebGL2&&(t.isInstancedMesh||n.isInstancedBufferGeometry)&&null===w.get("ANGLE_instanced_arrays"))return;M.initAttributes();var r,o=n.attributes,s=i.getAttributes(),a=e.defaultAttributeValues;for(r in s){var u=s[r];if(0<=u){var h=o[r];if(void 0!==h){var c,f,l,d,v,p,m,g=h.normalized,y=h.itemSize;void 0!==(c=S.get(h))&&(f=c.buffer,l=c.type,d=c.bytesPerElement,h.isInterleavedBufferAttribute?(v=h.data,p=v.stride,m=h.offset,v&&v.isInstancedInterleavedBuffer?(M.enableAttributeAndDivisor(u,v.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=v.meshPerAttribute*v.count)):M.enableAttribute(u),_.bindBuffer(_.ARRAY_BUFFER,f),_.vertexAttribPointer(u,y,l,g,p*d,m*d)):(h.isInstancedBufferAttribute?(M.enableAttributeAndDivisor(u,h.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=h.meshPerAttribute*h.count)):M.enableAttribute(u),_.bindBuffer(_.ARRAY_BUFFER,f),_.vertexAttribPointer(u,y,l,g,0,0)))}else if("instanceMatrix"===r)void 0!==(c=S.get(t.instanceMatrix))&&(f=c.buffer,l=c.type,M.enableAttributeAndDivisor(u+0,1),M.enableAttributeAndDivisor(u+1,1),M.enableAttributeAndDivisor(u+2,1),M.enableAttributeAndDivisor(u+3,1),_.bindBuffer(_.ARRAY_BUFFER,f),_.vertexAttribPointer(u+0,4,l,!1,64,0),_.vertexAttribPointer(u+1,4,l,!1,64,16),_.vertexAttribPointer(u+2,4,l,!1,64,32),_.vertexAttribPointer(u+3,4,l,!1,64,48));else if(void 0!==a){var b=a[r];if(void 0!==b)switch(b.length){case 2:_.vertexAttrib2fv(u,b);break;case 3:_.vertexAttrib3fv(u,b);break;case 4:_.vertexAttrib4fv(u,b);break;default:_.vertexAttrib1fv(u,b)}}}}M.disableUnusedAttributes()}(r,e,i,a),null!==h&&_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,c.buffer));var a=(null!==h?h:t).count,c=e.drawRange.start*n,h=e.drawRange.count*n,t=null!==o?o.start*n:0,o=null!==o?o.count*n:1/0,n=Math.max(c,t),o=Math.min(a,c+h,t+o)-1,o=Math.max(0,o-n+1);0!==o&&(r.isMesh?!0===i.wireframe?(M.setLineWidth(i.wireframeLinewidth*ot()),s.setMode(_.LINES)):s.setMode(_.TRIANGLES):r.isLine?(i=i.linewidth,M.setLineWidth((i=void 0===i?1:i)*ot()),r.isLineSegments?s.setMode(_.LINES):r.isLineLoop?s.setMode(_.LINE_LOOP):s.setMode(_.LINE_STRIP)):r.isPoints?s.setMode(_.POINTS):r.isSprite&&s.setMode(_.TRIANGLES),r.isInstancedMesh?s.renderInstances(e,n,o,r.count):e.isInstancedBufferGeometry?s.renderInstances(e,n,o,e.maxInstancedCount):s.render(n,o))},this.compile=function(e,t){(y=g.get(e,t)).init(),e.traverse(function(t){t.isLight&&(y.pushLight(t),t.castShadow&&y.pushShadow(t))}),y.setupLights(t);var i={};e.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var n=0;n<t.material.length;n++)t.material[n].uuid in i==!1&&(bt(t.material[n],e,t),i[t.material[n].uuid]=!0);else t.material.uuid in i==!1&&(bt(t.material,e,t),i[t.material.uuid]=!0)})};var pt=null;var mt=new rr;function gt(t,n,e,i){for(var r=0,o=t.length;r<o;r++){var s=t[r],a=s.object,u=s.geometry,h=void 0===i?s.material:i,c=s.group;if(e.isArrayCamera)for(var f=(B=e).cameras,l=0,d=f.length;l<d;l++){var v=f[l];a.layers.test(v.layers)&&(M.viewport(H.copy(v.viewport)),y.setupLights(v),yt(a,n,v,u,h,c))}else B=null,yt(a,n,e,u,h,c)}}function yt(t,n,e,i,r,o){var s,a;t.onBeforeRender(C,n,e,i,r,o),y=g.get(n,B||e),t.modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject?(s=_t(e,n,r,t),M.setMaterial(r),U.geometry=null,U.program=null,U.wireframe=!1,a=s,t.render(function(t){C.renderBufferImmediate(t,a)})):C.renderBufferDirect(e,n,i,r,t,o),t.onAfterRender(C,n,e,i,r,o),y=g.get(n,B||e)}function bt(t,n,e){var i=b.get(t),r=y.state.lights,o=y.state.shadowsArray,s=r.state.version,a=l.getParameters(t,r.state,o,n,tt.numPlanes,tt.numIntersection,e),u=l.getProgramCacheKey(a),o=i.program,e=!0;if(void 0===o)t.addEventListener("dispose",lt);else if(o.cacheKey!==u)dt(t);else if(i.lightsStateVersion!==s)i.lightsStateVersion=s,e=!1;else{if(void 0!==a.shaderID)return;e=!1}e&&(o=l.acquireProgram(a,u),i.program=o,i.uniforms=a.uniforms,i.environment=t.isMeshStandardMaterial?n.environment:null,i.outputEncoding=C.outputEncoding,t.program=o);var h=o.getAttributes();if(t.morphTargets)for(var c=t.numSupportedMorphTargets=0;c<C.maxMorphTargets;c++)0<=h["morphTarget"+c]&&t.numSupportedMorphTargets++;if(t.morphNormals)for(c=t.numSupportedMorphNormals=0;c<C.maxMorphNormals;c++)0<=h["morphNormal"+c]&&t.numSupportedMorphNormals++;o=i.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=tt.numPlanes,i.numIntersection=tt.numIntersection,o.clippingPlanes=tt.uniform),i.fog=n.fog,i.needsLights=(n=t).isMeshLambertMaterial||n.isMeshToonMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.isShadowMaterial||n.isShaderMaterial&&!0===n.lights,i.lightsStateVersion=s,i.needsLights&&(o.ambientLightColor.value=r.state.ambient,o.lightProbe.value=r.state.probe,o.directionalLights.value=r.state.directional,o.directionalLightShadows.value=r.state.directionalShadow,o.spotLights.value=r.state.spot,o.spotLightShadows.value=r.state.spotShadow,o.rectAreaLights.value=r.state.rectArea,o.pointLights.value=r.state.point,o.pointLightShadows.value=r.state.pointShadow,o.hemisphereLights.value=r.state.hemi,o.directionalShadowMap.value=r.state.directionalShadowMap,o.directionalShadowMatrix.value=r.state.directionalShadowMatrix,o.spotShadowMap.value=r.state.spotShadowMap,o.spotShadowMatrix.value=r.state.spotShadowMatrix,o.pointShadowMap.value=r.state.pointShadowMap,o.pointShadowMatrix.value=r.state.pointShadowMatrix);r=i.program.getUniforms(),o=Fs.seqWithValue(r.seq,o);i.uniformsList=o}function _t(t,n,e,i){E.resetTextureUnits();var r=n.fog,o=e.isMeshStandardMaterial?n.environment:null,s=b.get(e),a=y.state.lights;nt&&(!et&&t===G||(g=t===G&&e.id===F,tt.setState(e.clippingPlanes,e.clipIntersection,e.clipShadows,t,s,g))),e.version===s.Hn?(void 0===s.program||e.fog&&s.fog!==r||s.environment!==o||s.needsLights&&s.lightsStateVersion!==a.state.version||void 0!==s.numClippingPlanes&&(s.numClippingPlanes!==tt.numPlanes||s.numIntersection!==tt.numIntersection)||s.outputEncoding!==C.outputEncoding)&&bt(e,n,i):(bt(e,n,i),s.Hn=e.version);var u,h,c,f,l,d=!1,v=!1,p=!1,m=s.program,g=m.getUniforms(),a=s.uniforms;return M.useProgram(m.program)&&(p=v=d=!0),e.id!==F&&(F=e.id,v=!0),!d&&G===t||(g.setValue(_,"projectionMatrix",t.projectionMatrix),x.logarithmicDepthBuffer&&g.setValue(_,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),G!==t&&(G=t,p=v=!0),!(e.isShaderMaterial||e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshStandardMaterial||e.envMap)||void 0!==(u=g.map.cameraPosition)&&u.setValue(_,rt.setFromMatrixPosition(t.matrixWorld)),(e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshLambertMaterial||e.isMeshBasicMaterial||e.isMeshStandardMaterial||e.isShaderMaterial)&&g.setValue(_,"isOrthographic",!0===t.isOrthographicCamera),(e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshLambertMaterial||e.isMeshBasicMaterial||e.isMeshStandardMaterial||e.isShaderMaterial||e.skinning)&&g.setValue(_,"viewMatrix",t.matrixWorldInverse)),e.skinning&&(g.setOptional(_,i,"bindMatrix"),g.setOptional(_,i,"bindMatrixInverse"),(n=i.skeleton)&&(d=n.bones,x.floatVertexTextures?(void 0===n.boneTexture&&(u=Math.sqrt(4*d.length),u=Mt.ceilPowerOfTwo(u),u=Math.max(u,4),(t=new Float32Array(u*u*4)).set(n.boneMatrices),d=new tr(t,u,u,Un,Cn),n.boneMatrices=t,n.boneTexture=d,n.boneTextureSize=u),g.setValue(_,"boneTexture",n.boneTexture,E),g.setValue(_,"boneTextureSize",n.boneTextureSize)):g.setOptional(_,n,"boneMatrices"))),!v&&s.receiveShadow===i.receiveShadow||(s.receiveShadow=i.receiveShadow,g.setValue(_,"receiveShadow",i.receiveShadow)),v&&(g.setValue(_,"toneMappingExposure",C.toneMappingExposure),g.setValue(_,"toneMappingWhitePoint",C.toneMappingWhitePoint),s.needsLights&&(v=p,(p=a).ambientLightColor.needsUpdate=v,p.lightProbe.needsUpdate=v,p.directionalLights.needsUpdate=v,p.directionalLightShadows.needsUpdate=v,p.pointLights.needsUpdate=v,p.pointLightShadows.needsUpdate=v,p.spotLights.needsUpdate=v,p.spotLightShadows.needsUpdate=v,p.rectAreaLights.needsUpdate=v,p.hemisphereLights.needsUpdate=v),r&&e.fog&&(l=r,(f=a).fogColor.value.copy(l.color),l.isFog?(f.fogNear.value=l.near,f.fogFar.value=l.far):l.isFogExp2&&(f.fogDensity.value=l.density)),e.isMeshBasicMaterial?wt(a,e):e.isMeshLambertMaterial?(wt(a,e),f=a,(l=e).emissiveMap&&(f.emissiveMap.value=l.emissiveMap)):e.isMeshToonMaterial?(wt(a,e),function(t,n){t.specular.value.copy(n.specular),t.shininess.value=Math.max(n.shininess,1e-4),n.gradientMap&&(t.gradientMap.value=n.gradientMap);n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap);n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Tt&&(t.bumpScale.value*=-1));n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Tt&&t.normalScale.value.negate());n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias)}(a,e)):e.isMeshPhongMaterial?(wt(a,e),function(t,n){t.specular.value.copy(n.specular),t.shininess.value=Math.max(n.shininess,1e-4),n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap);n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Tt&&(t.bumpScale.value*=-1));n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Tt&&t.normalScale.value.negate());n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias)}(a,e)):e.isMeshStandardMaterial?(wt(a,e,o),(e.isMeshPhysicalMaterial?function(t,n,e){xt(t,n,e),t.reflectivity.value=n.reflectivity,t.clearcoat.value=n.clearcoat,t.clearcoatRoughness.value=n.clearcoatRoughness,n.sheen&&t.sheen.value.copy(n.sheen);n.clearcoatMap&&(t.clearcoatMap.value=n.clearcoatMap);n.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=n.clearcoatRoughnessMap);n.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(n.clearcoatNormalScale),t.clearcoatNormalMap.value=n.clearcoatNormalMap,n.side===Tt&&t.clearcoatNormalScale.value.negate());t.transparency.value=n.transparency}:xt)(a,e,o)):e.isMeshMatcapMaterial?(wt(a,e),function(t,n){n.matcap&&(t.matcap.value=n.matcap);n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Tt&&(t.bumpScale.value*=-1));n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Tt&&t.normalScale.value.negate());n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias)}(a,e)):e.isMeshDepthMaterial?(wt(a,e),h=a,(c=e).displacementMap&&(h.displacementMap.value=c.displacementMap,h.displacementScale.value=c.displacementScale,h.displacementBias.value=c.displacementBias)):e.isMeshDistanceMaterial?(wt(a,e),function(t,n){n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias);t.referencePosition.value.copy(n.referencePosition),t.nearDistance.value=n.nearDistance,t.farDistance.value=n.farDistance}(a,e)):e.isMeshNormalMaterial?(wt(a,e),function(t,n){n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Tt&&(t.bumpScale.value*=-1));n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Tt&&t.normalScale.value.negate());n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias)}(a,e)):e.isLineBasicMaterial?(h=e,(c=a).diffuse.value.copy(h.color),c.opacity.value=h.opacity,e.isLineDashedMaterial&&(c=e,(h=a).dashSize.value=c.dashSize,h.totalSize.value=c.dashSize+c.gapSize,h.scale.value=c.scale)):e.isPointsMaterial?function(t,n){t.diffuse.value.copy(n.color),t.opacity.value=n.opacity,t.size.value=n.size*Y,t.scale.value=.5*X,n.map&&(t.map.value=n.map);n.alphaMap&&(t.alphaMap.value=n.alphaMap);var e;n.map?e=n.map:n.alphaMap&&(e=n.alphaMap);void 0!==e&&(!0===e.matrixAutoUpdate&&e.updateMatrix(),t.uvTransform.value.copy(e.matrix))}(a,e):e.isSpriteMaterial?function(t,n){t.diffuse.value.copy(n.color),t.opacity.value=n.opacity,t.rotation.value=n.rotation,n.map&&(t.map.value=n.map);n.alphaMap&&(t.alphaMap.value=n.alphaMap);var e;n.map?e=n.map:n.alphaMap&&(e=n.alphaMap);void 0!==e&&(!0===e.matrixAutoUpdate&&e.updateMatrix(),t.uvTransform.value.copy(e.matrix))}(a,e):e.isShadowMaterial&&(a.color.value.copy(e.color),a.opacity.value=e.opacity),void 0!==a.ltc_1&&(a.ltc_1.value=nr.LTC_1),void 0!==a.ltc_2&&(a.ltc_2.value=nr.LTC_2),Fs.upload(_,s.uniformsList,a,E),e.isShaderMaterial&&(e.uniformsNeedUpdate=!1)),e.isShaderMaterial&&!0===e.uniformsNeedUpdate&&(Fs.upload(_,s.uniformsList,a,E),e.uniformsNeedUpdate=!1),e.isSpriteMaterial&&g.setValue(_,"center",i.center),g.setValue(_,"modelViewMatrix",i.modelViewMatrix),g.setValue(_,"normalMatrix",i.normalMatrix),g.setValue(_,"modelMatrix",i.matrixWorld),m}function wt(t,n,e){t.opacity.value=n.opacity,n.color&&t.diffuse.value.copy(n.color),n.emissive&&t.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(t.map.value=n.map),n.alphaMap&&(t.alphaMap.value=n.alphaMap),n.specularMap&&(t.specularMap.value=n.specularMap);var i,r,e=n.envMap||e;e&&(t.envMap.value=e,t.flipEnvMap.value=e.isCubeTexture?-1:1,t.reflectivity.value=n.reflectivity,t.refractionRatio.value=n.refractionRatio,t.maxMipLevel.value=b.get(e).Dn),n.lightMap&&(t.lightMap.value=n.lightMap,t.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(t.aoMap.value=n.aoMap,t.aoMapIntensity.value=n.aoMapIntensity),n.map?i=n.map:n.specularMap?i=n.specularMap:n.displacementMap?i=n.displacementMap:n.normalMap?i=n.normalMap:n.bumpMap?i=n.bumpMap:n.roughnessMap?i=n.roughnessMap:n.metalnessMap?i=n.metalnessMap:n.alphaMap?i=n.alphaMap:n.emissiveMap&&(i=n.emissiveMap),void 0!==i&&(!0===(i=i.isWebGLRenderTarget?i.texture:i).matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix)),n.aoMap?r=n.aoMap:n.lightMap&&(r=n.lightMap),void 0!==r&&(!0===(r=r.isWebGLRenderTarget?r.texture:r).matrixAutoUpdate&&r.updateMatrix(),t.uv2Transform.value.copy(r.matrix))}function xt(t,n,e){t.roughness.value=n.roughness,t.metalness.value=n.metalness,n.roughnessMap&&(t.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(t.metalnessMap.value=n.metalnessMap),n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap),n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Tt&&(t.bumpScale.value*=-1)),n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Tt&&t.normalScale.value.negate()),n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias),(n.envMap||e)&&(t.envMapIntensity.value=n.envMapIntensity)}mt.setAnimationLoop(function(t){ut.isPresenting||pt&&pt(t)}),"undefined"!=typeof window&&mt.setContext(window),this.setAnimationLoop=function(t){pt=t,ut.setAnimationLoop(t),mt.start()},this.render=function(t,n){var e,i,r;void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),i=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),n&&n.isCamera?k||(U.geometry=null,U.program=null,U.wireframe=!1,F=-1,!(G=null)===t.autoUpdate&&t.updateMatrixWorld(),null===n.parent&&n.updateMatrixWorld(),ut.enabled&&ut.isPresenting&&(n=ut.getCamera(n)),(y=g.get(t,n)).init(),t.onBeforeRender(C,t,n,i||N),it.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),$.setFromProjectionMatrix(it),et=this.localClippingEnabled,nt=tt.init(this.clippingPlanes,et,n),(v=d.get(t,n)).init(),function t(n,e,i,r){if(!1===n.visible)return;var o=n.layers.test(e.layers);if(o)if(n.isGroup)i=n.renderOrder;else if(n.isLOD)!0===n.autoUpdate&&n.update(e);else if(n.isLight)y.pushLight(n),n.castShadow&&y.pushShadow(n);else if(n.isSprite)n.frustumCulled&&!$.intersectsSprite(n)||(r&&rt.setFromMatrixPosition(n.matrixWorld).applyMatrix4(it),s=m.update(n),(a=n.material).visible&&v.push(n,s,a,i,rt.z,null));else if(n.isImmediateRenderObject)r&&rt.setFromMatrixPosition(n.matrixWorld).applyMatrix4(it),v.push(n,null,n.material,i,rt.z,null);else if((n.isMesh||n.isLine||n.isPoints)&&(n.isSkinnedMesh&&n.skeleton.frame!==p.render.frame&&(n.skeleton.update(),n.skeleton.frame=p.render.frame),!n.frustumCulled||$.intersectsObject(n))){r&&rt.setFromMatrixPosition(n.matrixWorld).applyMatrix4(it);var s=m.update(n),a=n.material;if(Array.isArray(a))for(var u=s.groups,h=0,c=u.length;h<c;h++){var f=u[h],l=a[f.materialIndex];l&&l.visible&&v.push(n,s,l,i,rt.z,f)}else a.visible&&v.push(n,s,a,i,rt.z,null)}var d=n.children;for(var h=0,c=d.length;h<c;h++)t(d[h],e,i,r)}(t,n,0,C.sortObjects),v.finish(),!0===C.sortObjects&&v.sort(Z,q),nt&&tt.beginShadows(),e=y.state.shadowsArray,ht.render(e,t,n),y.setupLights(n),nt&&tt.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==i&&this.setRenderTarget(i),T.render(v,t,n,r),e=v.opaque,i=v.transparent,t.overrideMaterial?(r=t.overrideMaterial,e.length&&gt(e,t,n,r),i.length&&gt(i,t,n,r)):(e.length&&gt(e,t,n),i.length&&gt(i,t,n)),t.onAfterRender(C,t,n),null!==N&&(E.updateRenderTargetMipmap(N),E.updateMultisampleRenderTarget(N)),M.buffers.depth.setTest(!0),M.buffers.depth.setMask(!0),M.buffers.color.setMask(!0),M.setPolygonOffset(!1),y=v=null):console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){P!==t&&null===N&&_.bindFramebuffer(_.FRAMEBUFFER,t),P=t},this.getActiveCubeFace=function(){return D},this.getActiveMipmapLevel=function(){return j},this.getRenderTarget=function(){return N},this.setRenderTarget=function(t,n,e){D=n,j=e,(N=t)&&void 0===b.get(t).In&&E.setupRenderTarget(t);var i,r=P,o=!1;z=t?(i=b.get(t).In,t.isWebGLCubeRenderTarget?(r=i[n||0],o=!0):r=t.isWebGLMultisampleRenderTarget?b.get(t).Un:i,H.copy(t.viewport),V.copy(t.scissor),t.scissorTest):(H.copy(K).multiplyScalar(Y).floor(),V.copy(J).multiplyScalar(Y).floor(),Q),I!==r&&(_.bindFramebuffer(_.FRAMEBUFFER,r),I=r),M.viewport(H),M.scissor(V),M.setScissorTest(z),o&&(t=b.get(t.texture),_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_CUBE_MAP_POSITIVE_X+(n||0),t.Nn,e||0))},this.readRenderTargetPixels=function(t,n,e,i,r,o,s){if(t&&t.isWebGLRenderTarget){var a=b.get(t).In;if(a=t.isWebGLCubeRenderTarget&&void 0!==s?a[s]:a){s=!1;a!==I&&(_.bindFramebuffer(_.FRAMEBUFFER,a),s=!0);try{var u=t.texture,h=u.format,c=u.type;if(h!==Un&&A.convert(h)!==_.getParameter(_.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(c===Sn||A.convert(c)===_.getParameter(_.IMPLEMENTATION_COLOR_READ_TYPE)||c===Cn&&(x.isWebGL2||w.get("OES_texture_float")||w.get("WEBGL_color_buffer_float"))||c===kn&&(x.isWebGL2?w.get("EXT_color_buffer_float"):w.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");_.checkFramebufferStatus(_.FRAMEBUFFER)===_.FRAMEBUFFER_COMPLETE?0<=n&&n<=t.width-i&&0<=e&&e<=t.height-r&&_.readPixels(n,e,i,r,A.convert(h),A.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&_.bindFramebuffer(_.FRAMEBUFFER,I)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,n,e){void 0===e&&(e=0);var i=Math.pow(2,-e),r=Math.floor(n.image.width*i),o=Math.floor(n.image.height*i),i=A.convert(n.format);E.setTexture2D(n,0),_.copyTexImage2D(_.TEXTURE_2D,e,i,t.x,t.y,r,o,0),M.unbindTexture()},this.copyTextureToTexture=function(t,n,e,i){var r=n.image.width,o=n.image.height,s=A.convert(e.format),a=A.convert(e.type);E.setTexture2D(e,0),n.isDataTexture?_.texSubImage2D(_.TEXTURE_2D,i||0,t.x,t.y,r,o,s,a,n.image.data):_.texSubImage2D(_.TEXTURE_2D,i||0,t.x,t.y,s,a,n.image),M.unbindTexture()},this.initTexture=function(t){E.setTexture2D(t,0),M.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Ta.prototype=Object.assign(Object.create(Z.prototype),{constructor:Ta,isArrayCamera:!0}),La.prototype=Object.assign(Object.create(Y.prototype),{constructor:La,isGroup:!0}),Object.assign(Oa.prototype,g.prototype);var Aa=e(27),Ca=e.n(Aa),ka={FOCUS:2,VISIBLE:4};Object.freeze(ka);var Pa=ka,Da=function(t,n,e){e=e||2;var i,r,o,s,a,u=n&&n.length,h=u?n[0]*e:t.length,c=ja(t,0,h,e,!0),f=[];if(!c||c.next===c.prev)return f;if(u&&(c=function(t,n,e,i){var r,o,s,a,u=[];for(r=0,o=n.length;r<o;r++)s=n[r]*i,a=r<o-1?n[r+1]*i:t.length,(a=ja(t,s,a,i,!1))===a.next&&(a.steiner=!0),u.push(function(t){var n=t,e=t;for(;(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next,n!==t;);return e}(a));for(u.sort(Fa),r=0;r<u.length;r++)!function(t,n){(n=function(t,n){var e,i=n,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&s<a){if((s=a)===r){if(o===i.y)return i;if(o===i.next.y)return i.next}e=i.x<i.next.x?i:i.next}}}while(i=i.next,i!==n);if(!e)return null;if(r===s)return e;var u,h=e,c=e.x,f=e.y,l=1/0;i=e;for(;r>=i.x&&i.x>=c&&r!==i.x&&Ga(o<f?r:s,o,c,f,o<f?s:r,o,i.x,i.y)&&(u=Math.abs(o-i.y)/(r-i.x),Xa(i,t)&&(u<l||u===l&&(i.x>e.x||i.x===e.x&&function(t,n){return Ba(t.prev,t,n.prev)<0&&Ba(n.next,t,t.next)<0}(e,i)))&&(e=i,l=u)),i=i.next,i!==h;);return e}(t,n))&&(t=Ya(n,t),Na(n,n.next),Na(t,t.next))}(u[r],e),e=Na(e,e.next);return e}(t,n,c,e)),t.length>80*e){for(var l=i=t[0],d=r=t[1],v=e;v<h;v+=e)(o=t[v])<l&&(l=o),(s=t[v+1])<d&&(d=s),i<o&&(i=o),r<s&&(r=s);a=0!==(a=Math.max(i-l,r-d))?1/a:0}return Ia(c,f,e,l,d,a),f};function ja(t,n,e,i,r){var o,s;if(r===0<function(t,n,e,i){for(var r=0,o=n,s=e-i;o<e;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}(t,n,e,i))for(o=n;o<e;o+=i)s=Za(o,t[o],t[o+1],s);else for(o=e-i;n<=o;o-=i)s=Za(o,t[o],t[o+1],s);return s&&Ha(s,s.next)&&(qa(s),s=s.next),s}function Na(t,n){if(!t)return t;n=n||t;var e,i=t;do{if(e=!1,i.steiner||!Ha(i,i.next)&&0!==Ba(i.prev,i,i.next))i=i.next;else{if(qa(i),(i=n=i.prev)===i.next)break;e=!0}}while(e||i!==n);return n}function Ia(t,n,e,i,r,o,s){if(t){!s&&o&&function(t,n,e,i){var r=t;for(;null===r.z&&(r.z=Ua(r.x,r.y,n,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next,r!==t;);r.prevZ.nextZ=null,r.prevZ=null,function(t){var n,e,i,r,o,s,a,u,h=1;do{for(e=t,o=t=null,s=0;e;){for(s++,i=e,n=a=0;n<h&&(a++,i=i.nextZ);n++);for(u=h;0<a||0<u&&i;)0!==a&&(0===u||!i||e.z<=i.z)?(e=(r=e).nextZ,a--):(i=(r=i).nextZ,u--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;e=i}}while(o.nextZ=null,h*=2,1<s)}(r)}(t,i,r,o);for(var a,u,h=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?function(t,n,e,i){var r=t.prev,o=t,s=t.next;if(0<=Ba(r,o,s))return!1;var a=(r.x<o.x?r.x<s.x?r:s:o.x<s.x?o:s).x,u=(r.y<o.y?r.y<s.y?r:s:o.y<s.y?o:s).y,h=(r.x>o.x?r.x>s.x?r:s:o.x>s.x?o:s).x,c=(r.y>o.y?r.y>s.y?r:s:o.y>s.y?o:s).y,f=Ua(a,u,n,e,i),l=Ua(h,c,n,e,i),d=t.prevZ,v=t.nextZ;for(;d&&d.z>=f&&v&&v.z<=l;){if(d!==t.prev&&d!==t.next&&Ga(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=Ba(d.prev,d,d.next))return!1;if(d=d.prevZ,v!==t.prev&&v!==t.next&&Ga(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=Ba(v.prev,v,v.next))return!1;v=v.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&Ga(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=Ba(d.prev,d,d.next))return!1;d=d.prevZ}for(;v&&v.z<=l;){if(v!==t.prev&&v!==t.next&&Ga(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=Ba(v.prev,v,v.next))return!1;v=v.nextZ}return!0}(t,i,r,o):function(t){var n=t.prev,e=t,i=t.next;if(0<=Ba(n,e,i))return!1;var r=t.next.next;for(;r!==t.prev;){if(Ga(n.x,n.y,e.x,e.y,i.x,i.y,r.x,r.y)&&0<=Ba(r.prev,r,r.next))return!1;r=r.next}return!0}(t))n.push(a.i/e),n.push(t.i/e),n.push(u.i/e),qa(t),t=u.next,h=u.next;else if((t=u)===h){s?1===s?Ia(t=function(t,n,e){var i=t;do{var r=i.prev,o=i.next.next}while(!Ha(r,o)&&Va(r,i,i.next,o)&&Xa(r,o)&&Xa(o,r)&&(n.push(r.i/e),n.push(i.i/e),n.push(o.i/e),qa(i),qa(i.next),i=t=o),i=i.next,i!==t);return Na(i)}(Na(t),n,e),n,e,i,r,o,2):2===s&&function(t,n,e,i,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&function(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&Va(e,e.next,t,n))return!0}while(e=e.next,e!==t);return!1}(t,n)&&(Xa(t,n)&&Xa(n,t)&&function(t,n){var e=t,i=!1,r=(t.x+n.x)/2,o=(t.y+n.y)/2;for(;e.y>o!=e.next.y>o&&e.next.y!==e.y&&r<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next,e!==t;);return i}(t,n)&&(Ba(t.prev,t,n.prev)||Ba(t,n.prev,n))||Ha(t,n)&&0<Ba(t.prev,t,t.next)&&0<Ba(n.prev,n,n.next))}(s,a)){var u=Ya(s,a);return s=Na(s,s.next),u=Na(u,u.next),Ia(s,n,e,i,r,o),Ia(u,n,e,i,r,o)}a=a.next}}while(s=s.next,s!==t)}(t,n,e,i,r,o):Ia(Na(t),n,e,i,r,o,1);break}}}function Fa(t,n){return t.x-n.x}function Ua(t,n,e,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-e)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-i)*r)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function Ga(t,n,e,i,r,o,s,a){return 0<=(r-s)*(n-a)-(t-s)*(o-a)&&0<=(t-s)*(i-a)-(e-s)*(n-a)&&0<=(e-s)*(o-a)-(r-s)*(i-a)}function Ba(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function Ha(t,n){return t.x===n.x&&t.y===n.y}function Va(t,n,e,i){var r=Wa(Ba(t,n,e)),o=Wa(Ba(t,n,i)),s=Wa(Ba(e,i,t)),a=Wa(Ba(e,i,n));return r!==o&&s!==a||(0===r&&za(t,e,n)||(0===o&&za(t,i,n)||(0===s&&za(e,t,i)||!(0!==a||!za(e,n,i)))))}function za(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function Wa(t){return 0<t?1:t<0?-1:0}function Xa(t,n){return Ba(t.prev,t,t.next)<0?0<=Ba(t,n,t.next)&&0<=Ba(t,t.prev,n):Ba(t,n,t.prev)<0||Ba(t,t.next,n)<0}function Ya(t,n){var e=new Ka(t.i,t.x,t.y),i=new Ka(n.i,n.x,n.y),r=t.next,o=n.prev;return(t.next=n).prev=t,(e.next=r).prev=e,(i.next=e).prev=i,(o.next=i).prev=o,i}function Za(t,n,e,i){e=new Ka(t,n,e);return i?(e.next=i.next,(e.prev=i).next.prev=e,i.next=e):(e.prev=e).next=e,e}function qa(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ka(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ja(t){return function(t){if(Array.isArray(t))return Qa(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return Qa(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Qa(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qa(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}var $a={area:function(t){for(var n=t.length,e=0,i=n-1,r=0;r<n;i=r++)e+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*e},isClockWise:function(t){return $a.area(t)<0},triangulateShape:function(t,n){var e=[],i=[],r=[];tu(t),nu(e,t);var o=t.length;n.forEach(tu);for(var s=0;s<n.length;s++)i.push(o),o+=n[s].length,nu(e,n[s]);for(var a=Da(e,i),u=0;u<a.length;u+=3)r.push(a.slice(u,u+3));return r},triangulate:function(t){(r=[]).push.apply(r,Ja(t[0]));for(var n=[],e=1;e<t.length;e++){var i=[];i.push.apply(i,Ja(t[e])),n.push(i)}if(!$a.isClockWise(r))for(var r=r.reverse(),o=0,s=n.length;o<s;o++){var a=n[o];$a.isClockWise(a)&&(n[o]=a.reverse())}return $a.triangulateShape(r,n)}};function tu(t){var n,e=t.length;2<e&&(n=t[e-1],e=t[0],n.x===e.x&&n.y===e.y)&&t.pop()}function nu(t,n){for(var e=0;e<n.length;e++)t.push(n[e].x),t.push(n[e].y)}var eu=1e-5,iu=Math.PI/180,ru=180/Math.PI,ou=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(ou.prototype,{zn:function(){return eu},Wn:function(){return iu},Xn:function(){return ru},Yn:function(t){return t<eu&&-eu<t},Zn:function(t){return eu<t},qn:function(t){return t<-eu},Kn:function(t,n,e){return(t.x-e.x)*(n.y-e.y)-(n.x-e.x)*(t.y-e.y)},distanceOfTwoPoints:function(t,n){return t&&n?Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y)):Number.NaN},distance:function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},isPolygonContainPoint:function(t,n){for(var e=0,i=0;i<t.length;i++){var r=t[i].x,o=t[i].y,s=0,a=0,a=i<t.length-1?(s=t[i+1].x,t[i+1].y):(s=t[0].x,t[0].y);if(r===n.x&&o===n.y||s===n.x&&a===n.y)return!0;if(a!==o){var u=r+(n.y-o)*(s-r)/(a-o);if(u===n.x)return!0;r!==s?u<=Math.max(r,s)&&u>=Math.min(r,s)&&u>n.x&&u!==r&&(u===s&&0<(o-n.y)*(a-n.y)?e+=2:e++):u<=Math.max(r,s)&&u>=Math.min(r,s)&&u>n.x&&(u===s&&0<(o-n.y)*(a-n.y)?e+=2:e++)}}return 0<e%2},isRectCross:function(t,n,e,i){return!(Math.max(t.x,n.x)<Math.min(e.x,i.x))&&(!(Math.max(t.y,n.y)<Math.min(e.y,i.y))&&(!(Math.max(e.x,i.x)<Math.min(t.x,n.x))&&!(Math.max(e.y,i.y)<Math.min(t.y,n.y))))},Jn:function(t,n,e,i){return!(Math.max(t.x,n.x)<Math.min(e.x,i.x))&&(!(Math.max(t.y,n.y)<Math.min(e.y,i.y))&&(!(Math.max(e.x,i.x)<Math.min(t.x,n.x))&&(!(Math.max(e.y,i.y)<Math.min(t.y,n.y))&&(!(this.Kn(e,n,t)*this.Kn(n,i,t)<0)&&!(this.Kn(t,i,e)*this.Kn(i,n,e)<0)))))},Qn:function(t,n,e){return!(t.x<n.x)&&(!(t.y<n.y)&&(!(t.x>e.x)&&!(t.y>e.y)))},$n:function(t,n,e){var i=Math.min(e.x,n.x),r=Math.max(e.x,n.x),o=Math.min(e.y,n.y),n=Math.max(e.y,n.y);return!(t.x<i||t.x>r||t.y<o||t.y>n)},te:function(t,n,e){for(var i,r,o=!1,s=0;s<e;s++)i=n[s],r=n[(s+1)%e],(i.y<t.y&&r.y>=t.y||r.y<t.y&&i.y>=t.y)&&(i.x<=t.x||r.x<=t.x)&&i.x+(t.y-i.y)/(r.y-i.y)*(r.x-i.x)<t.x&&(o=!o);return o},ne:function(t,n,e){return(t.x-n.x)*(e.y-n.y)==(e.x-n.x)*(t.y-n.y)&&Math.min(n.x,e.x)<=t.x&&t.x<=Math.max(n.x,e.x)&&Math.min(n.y,e.y)<=t.y&&t.y<=Math.max(n.y,e.y)},ee:function(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))},ie:function(t,n){return(t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y)},re:function(t,n,e){var i=n.x,r=n.y,o=e.x,s=e.y,a=t.x,u=t.y,h=o-i,c=s-r,f=h*h+c*c,n=a-i,e=u-r,t=n*n+e*e;if(this.Yn(f))return this.Yn(t)?0:t;f=Math.sqrt(f),h/=f,c/=f,e=h*n+c*e;if(!this.Zn(e))return t;if(!this.qn(e-f)){o=a-o,s=u-s;return o*o+s*s}h=a-(i+e*h),c=u-(r+e*c);return h*h+c*c},oe:function(t,n,e,i){var r=n.x,o=n.y,s=e.x,a=e.y,u=t.x,h=t.y,c=s-r,f=a-o,l=Math.sqrt(c*c+f*f),d=u-r,v=h-o,t=Math.sqrt(d*d+v*v);if(this.Yn(l))return i.x=n.x,i.y=n.y,this.Yn(t)?0:t;c/=l,f/=l,v=c*d+f*v;if(!this.Zn(v))return i.x=n.x,i.y=n.y,t;if(!this.qn(v-l)){s=u-s,a=h-a,a=Math.sqrt(s*s+a*a);return i.x=e.x,i.y=e.y,a}c=r+v*c,f=o+v*f,u-=c,h-=f,h=Math.sqrt(u*u+h*h);return i.x=c,i.y=f,h},se:function(t,n){for(var e=0,i=0,r=0,o=0;o<n;o++){var s=t[o],a=t[(o+1)%n],u=(s.x*a.y-s.y*a.x)/2;e+=u,i+=u*(s.x+a.x)/3,r+=u*(s.y+a.y)/3}return{x:i/=e,y:r/=e}},ae:function(t){for(var n=$a.triangulate([t]),e=0,i=0,r=0,o=0;o<n.length;o++){var s=t[n[o][0]],a=t[n[o][1]],u=t[n[o][2]],h=a.x-s.x,c=a.y-s.y,f=u.x-s.x,c=(h*(u.y-s.y)-f*c)/2;e+=c,i+=(s.x+a.x+u.x)/3*c,r+=(s.y+a.y+u.y)/3*c}return{x:i/e,y:r/e}},ue:function(t,n){if(n<3)return 0;for(var e=0,i=0;i<n;++i){var r=t[i],o=t[(i+1)%n];e+=r.x*o.y-r.y*o.x}return Math.abs(e/2)},he:function(t,n,e,i,r){if(this.Jn(t,n,e,i)){var o=(i.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-i.y),s=(t.y-e.y)*(n.x-t.x)*(i.x-e.x)+e.x*(i.y-e.y)*(n.x-t.x)-t.x*(n.y-t.y)*(i.x-e.x);return r.x=s/o,o=(t.x-n.x)*(i.y-e.y)-(n.y-t.y)*(e.x-i.x),s=n.y*(t.x-n.x)*(i.y-e.y)+(i.x-n.x)*(i.y-e.y)*(t.y-n.y)-i.y*(e.x-i.x)*(n.y-t.y),r.y=s/o,1}return 0},ce:function(t,n,e,i,r){var o=Math.min(e.x,i.x),s=Math.max(e.x,i.x),a=Math.min(e.y,i.y),u=Math.max(e.y,i.y),h=t.x,c=t.y,f=e.x,l=e.y,d=i.x,v=i.y;if(90==n){if(t.x<o||t.x>s)return!1;var p=(v-l)/(d-f)*(h-f)+l;return r.y=p,r.x=h,p<c?!1:!!this.$n(r,e,i)}if(270==n){if(t.x<o||t.x>s)return!1;t=(v-l)/(d-f)*(h-f)+l;return r.y=t,r.x=h,c<t?!1:!!this.$n(r,e,i)}if(270!=n&&90!=n&&s-o<.001){s=o,o=Math.tan(n/180*Math.PI)*(s-h)+c;if(r.y=o,r.x=s,this.$n(r,e,i)){s=s-h,o=o-c;return 0<s/Math.sqrt(s*s+o*o)*Math.cos(n/180*Math.PI)}}if(u-a<=1e-6){u=a,a=1/Math.tan(n/180*Math.PI)*(u-c)+h;if(r.x=a,r.y=u,this.$n(r,e,i)){var a=a-h,m=u-c;return 0<a/Math.sqrt(a*a+m*m)*Math.cos(n/180*Math.PI)}return!1}m=Math.tan(n/180*Math.PI),d=(v-l)/(d-f),d=(l-c-(d*f-m*h))/(m-d),m=c+m*(d-h);if(r.x=d,r.y=m,this.$n(r,e,i)){h=d-h,c=m-c;return 0<h/Math.sqrt(h*h+c*c)*Math.cos(n/180*Math.PI)}return!1},fe:function(t,n,e,i){var r=Math.min(n.x,e.x),o=Math.max(n.x,e.x),s=Math.min(n.y,e.y),a=Math.max(n.y,e.y),u=t.x,h=t.y,c=n.x,f=n.y,l=e.x,t=e.y;if(Math.abs(c-l)<1e-5)return i.x=c,s<=(i.y=h)&&h<=a;if(Math.abs(f-t)<1e-5)return i.x=u,i.y=f,r<=u&&u<=o;o=-1/((t-f)/(l-c)),l=(t-f)/(l-c),l=(f-h-(l*c-o*u))/(o-l),u=h+o*(l-u);return i.x=l,i.y=u,!!this.$n(i,n,e)},le:function(t,n){return{x:t.y*n.z-t.z*n.y,y:t.z*n.x-t.x*n.z,z:t.x*n.y-t.y*n.x}},de:function(t,n){return t.x*n.x+t.y*n.y+t.z*n.z},ve:function(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)},pe:function(t,n){return t.x*n.x+t.y*n.y},me:function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},ge:function(t,n){if(0==t.x&&0==t.y||0==n.x&&0==n.y)return 0;var e={x:t.x,y:t.y,z:0},i={x:n.x,y:n.y,z:0},e=this.le(e,i),i=this.pe(t,n),n=Math.acos(i/(this.me(t)*this.me(n)));return 0<e.z?n/Math.PI*180:360-n/Math.PI*180}});var su=new ou,au={vert:"\n \n uniform vec2 offset;\n uniform float rotation;\n uniform vec2 scale;\n varying vec2 vUv;\n void main() {\n vUv = uv;\n \n \n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\n rotatedPosition.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n \n \n rotatedPosition.x *= scale.x * abs(projectionMatrix[0][0] / projectionMatrix[1][1]);\n rotatedPosition.y *= scale.y;\n \n rotatedPosition.xy += offset;\n gl_Position = vec4(rotatedPosition,0.0,1.0);\n }\n ",frag:"\n uniform vec3 diffuse;\n uniform sampler2D mmap;\n #include <common>\n varying vec2 vUv;\n \n void main() {\n \n // vec2 muv = vec2(vUv.x , 1.0 - vUv.y);\n vec4 diffuseColor = texture2D( mmap, vUv );\n \n \n gl_FragColor = diffuseColor;\n }\n "},uu=au;function hu(t){return(hu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function cu(t,n){return(cu=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function fu(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=lu(e);return t=i?(t=lu(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==hu(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function lu(t){return(lu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var du=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&cu(t,n)}(e,qr);var n=fu(e);function e(t){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this,t)).uniforms.offset={value:new ii},t.uniforms.rotation={value:0},t.uniforms.scale={value:new ii(1,1)},t.depthTest=!1,t.vertexShader=uu.vert,t.fragmentShader=uu.frag,t}return e}();function vu(t,n){this.array=t,this.stride=n,this.count=void 0!==t?t.length/n:0,this.usage=ni,this.updateRange={offset:0,count:-1},this.version=0}Object.defineProperty(vu.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(vu.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,n,e){t*=this.stride,e*=n.stride;for(var i=0,r=this.stride;i<r;i++)this.array[t+i]=n.array[e+i];return this},set:function(t,n){return this.array.set(t,n=void 0===n?0:n),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}});var pu=new Et;function mu(t,n,e,i){this.data=t,this.itemSize=n,this.offset=e,this.normalized=!0===i}function gu(t){return(gu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yu(t,n){return(yu=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function bu(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=_u(e);return t=i?(t=_u(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==gu(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function _u(t){return(_u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Object.defineProperties(mu.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(mu.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(var n=0,e=this.data.count;n<e;n++)pu.x=this.getX(n),pu.y=this.getY(n),pu.z=this.getZ(n),pu.applyMatrix4(t),this.setXYZ(n,pu.x,pu.y,pu.z);return this},setX:function(t,n){return this.data.array[t*this.data.stride+this.offset]=n,this},setY:function(t,n){return this.data.array[t*this.data.stride+this.offset+1]=n,this},setZ:function(t,n){return this.data.array[t*this.data.stride+this.offset+2]=n,this},setW:function(t,n){return this.data.array[t*this.data.stride+this.offset+3]=n,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,n,e){return t=t*this.data.stride+this.offset,this.data.array[t+0]=n,this.data.array[t+1]=e,this},setXYZ:function(t,n,e,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=n,this.data.array[t+1]=e,this.data.array[t+2]=i,this},setXYZW:function(t,n,e,i,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=n,this.data.array[t+1]=e,this.data.array[t+2]=i,this.data.array[t+3]=r,this}});var wu=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&yu(t,n)}(i,kr);var e=bu(i);function i(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i);var t=e.call(this),n=new vu(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);return t.setIndex([0,1,2,0,2,3]),t.setAttribute("position",new mu(n,3,0,!1)),t.setAttribute("uv",new mu(n,2,3,!1)),t}return i}();function xu(t,n,e,i,r,o,s,a,u){$i.call(this,t,n,e,i,r,o,s,a,u),this.needsUpdate=!0}function Mu(t,n,e,i,r,o){var s=(t+e)/2,a=(n+i)/2,u=((t-e)*(t-e)+(n-i)*(n-i))/4,h=Math.sqrt(u),c=h*(h/Math.sqrt(r*r-u)),f=Math.PI/2,l=(e-t)/(n-i),h=(t-e)/(n-i),r=Math.sqrt(1+l*l),u=Math.sqrt(1+h*h),r={x:s+c*(1/r),y:a+c*(l/r),theta:f},f={x:s+c*(-1/u),y:a+c*(h/u),theta:f};return 0<(e-t)*(r.y-n)-(i-n)*(r.x-t)?0===o?r:f:0===o?f:r}function Eu(t,n,e,i){for(var r=0;r<t.length;r++)switch(t[r]){case"m":n.moveTo(i.x+parseFloat(t[r+1]),i.y+parseFloat(t[r+2])),e.x=i.x+parseFloat(t[r+1]),e.y=i.y+parseFloat(t[r+2]),i.x=e.x,i.y=e.y,r+=2;break;case"M":n.moveTo(parseFloat(t[r+1]),parseFloat(t[r+2])),e.x=parseFloat(t[r+1]),e.y=parseFloat(t[r+2]),i.x=e.x,i.y=e.y,r+=2;break;case"l":n.lineTo(e.x+parseFloat(t[r+1]),e.y+parseFloat(t[r+2])),e.x=e.x+parseFloat(t[r+1]),e.y=e.y+parseFloat(t[r+2]),r+=2;break;case"L":n.lineTo(parseFloat(t[r+1]),parseFloat(t[r+2])),e.x=parseFloat(t[r+1]),e.y=parseFloat(t[r+2]),r+=2;break;case"A":var o=parseFloat(t[r+1]),s=parseFloat(t[r+2]),a=(parseFloat(t[r+3]),Math.PI,parseFloat(t[r+4]),parseFloat(t[r+5])),u=e.x,h=e.y,c=parseFloat(t[r+6]),f=parseFloat(t[r+7]);o===s&&(l=Mu(u,h,c,f,o,a),n.arcTo(l.x,l.y,c,f,l.theta),e.x=c,e.y=f),r+=7;break;case"a":var l,o=parseFloat(t[r+1]),s=parseFloat(t[r+2]),a=(parseFloat(t[r+3]),Math.PI,parseFloat(t[r+4]),parseFloat(t[r+5])),u=e.x,h=e.y,c=u+parseFloat(t[r+6]),f=h+parseFloat(t[r+7]);o===s&&(l=Mu(u,h,c,f,o,a),n.arcTo(l.x,l.y,c,f,l.theta),e.x=c,e.y=f),r+=7;break;case"h":n.lineTo(e.x+parseFloat(t[r+1]),e.y),e.x=e.x+parseFloat(t[r+1]),r+=1;break;case"H":n.lineTo(parseFloat(t[r+1]),e.y),e.x=parseFloat(t[r+1]),r+=1;break;case"z":case"Z":n.lineTo(i.x,i.y)}}xu.prototype=Object.create($i.prototype);var Su=["M","0","15.07","L","0.69","1.92","A","2","2","0","0","1","2.66","0","L","11.8","0","l","-0.07","1.37","H","3.09","A","1.09","1.09","0","0","0","2","2.44","l","-0.2","4.44","h","9.37","l","-0.07","1.37","H","1.72","l","-0.36","6.82","Z"],Tu=["M","13.79","11","l","-0.08","1.63","a","1","1","0","0","0","1","1.08","h","8.53","l","-0.07","1.36","h","-9","A","1.84","1.84","0","0","1","12.31","13","l","0.48","-9.16","h","8.9","a","2","2","0","0","1","2","2","L","23.53","9","A","2.11","2.11","0","0","1","21.47","11","Z","m","8.4","-2.49","l","0.08","-2.16","a","1.07","1.07","0","0","0","-1.09","-1.09","H","14.09","l","-0.22","4.33","H","21","A","1.15","1.15","0","0","0","22.19","8.51","Z"],Lu=["M","33.94","3.86","a","1.93","1.93","0","0","1","2","1.95","l","-0.47","9.27","H","34.07","l","0.45","-8.72","a","1.09","1.09","0","0","0","-1.09","-1.1","H","26.3","l","-0.51","9.82","H","24.41","L","25","3.85","Z"],Ou=["M","36.48","17.72","H","45","a","1.16","1.16","0","0","0","1.16","-1.22","l","0.07","-1.43","H","38.72","a","2","2","0","0","1","-2","-2.06","l","0.37","-7.19","a","2","2","0","0","1","2.15","-2","H","48.2","l","-0.69","13.28","a","2.09","2.09","0","0","1","-2.06","2","h","-9","Z","m","9.85","-4.05","l","0.44","-8.45","H","39.53","a","1.07","1.07","0","0","0","-1.08","1.1","l","-0.32","6.27","a","1.16","1.16","0","0","0","1.1","1.1","Z"],Ru=["M","57.43","11.59","L","63.48","0","h","1.83","l","-0.79","15.05","H","63.15","l","0.67","-12.79","L","57.67","14","h","-0.75","L","52.07","2.34","l","-0.64","12.72","H","50","L","50.83","0","H","52.6","Z"],Au=["M","69.6","10.2","l","-2.37","4.87","h","-1.5","L","73.09","0","h","1.49","l","5.77","15.05","h","-1.5","L","77","10.2","Z","m","6.86","-1.39","L","73.74","1.73","L","70.28","8.81","Z"],Cu=["M","82.95","15.07","H","81.57","L","82.35","0","h","10","a","1.94","1.94","0","0","1","1.85","2","L","93.89","7.4","a","2","2","0","0","1","-2","1.92","H","83.25","Z","m","8.43","-7.15","a","1.13","1.13","0","0","0","1.09","-1.09","l","0.35","-4.37","a","1.1","1.1","0","0","0","-1.08","-1.06","H","83.66","l","-0.34","6.53","Z"];var ku={ye:(xu.prototype.constructor=xu).prototype.isCanvasTexture=!0,be:null},Pu={NONE:0,EXTRUDE_MARKER:2,GRADIENT_POLYGON_MARKER:4,IMAGE_MARKER:8,LOCATION_MARKER:16,POLYGON_MARKER:32,TEXT_MARKER:64,LINE_MARKER:128,EDGES_LINES_TYPE:256,EXTENT:1024,FLOOR:1024,EXTERNAL_MODEL:2048,EXTERANL_MODEL:2048,MODEL:4096,DYNMODEL:4096,FACILITY:8192,LABEL:16384};Object.freeze(Pu);var Du=Pu;function ju(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Nu=function(t){var n=function(){var t=document.createElement("canvas"),n=t.getContext("2d");t.width=500,t.height=120,t.style.width="500px",t.style.height="120px";var e={x:0,y:0},i={x:0,y:0};n.transform(5,0,0,5,10,10);var r=n.createLinearGradient(5.9,15.07,5.9,0);return r.addColorStop(0,"#232323"),r.addColorStop(1,"#585858"),n.fillStyle=r,n.beginPath(),Eu(Su,n,i,e),n.closePath(),n.fill(),n.beginPath(),Eu(Tu,n,i,e),n.closePath(),n.fill(),n.beginPath(),Eu(Lu,n,i,e),n.closePath(),n.fill(),n.beginPath(),Eu(Ou,n,i,e),n.closePath(),n.fill(),(r=n.createLinearGradient(57.68,15.07,57.68,0)).addColorStop(0,"#77bf00"),r.addColorStop(1,"#addc0c"),n.fillStyle=r,n.beginPath(),Eu(Ru,n,i,e),n.closePath(),n.fill(),n.beginPath(),Eu(Au,n,i,e),n.closePath(),n.fill(),n.beginPath(),Eu(Cu,n,i,e),n.closePath(),n.fill(),new xu(t)}(),e=new ii(.4,.096),i=new du,r=-1*(.5*e.x/t-1),t=-1*(1-.5*e.y);return n.minFilter=xn,n.generateMipmaps=!1,i.transparent=!0,i.depthTest=!1,i.uniforms={scale:{value:e},offset:{value:new ii(r,t)},mmap:{value:n}},i.needsUpdate=!0,new To(new wu,i)},Iu=function(){function i(t,n){var e=this;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i),this.gt=t,this.parent=t,this.renderer=this._e(n.container,n.logarithmicDepthBuffer),this.pn=new Map,this.we=new Map,this.we.set("firstTimeRender",function(){return e.xe()}),this.Me=0,this.Ee=!1,this.renderer.domElement.addEventListener("wheel",function(){return e.Se()},!1),this.Te=ku.ye,this.Le=Nu(this.renderer.domElement.clientWidth/this.renderer.domElement.clientHeight),this.Le.frustumCulled=!1,this.xx45f6=this.Le,this.G=this.renderer.domElement.clientWidth,this.Oe=this.renderer.domElement.clientHeight,this.type="basic",this.$=!0,this.stats=null,this.gt.Et.isStatDiplay&&(this.stats=new Ca.a,this.stats.showPanel(0),document.body.appendChild(this.stats.dom)),this.Re()}var t,n,e;return t=i,(n=[{key:"render",value:function(){var n=this;this.renderer&&(this.resize(),this.renderer.clear(),this.pn.forEach(function(t){return n.renderer.render(t,n.gt.wt)}),this.gt.Ae&&this.renderer.render(this.gt.Ae.Ce,this.gt.wt),this.Te&&this.Le&&this.renderer.render(this.Le,this.gt.wt))}},{key:"resize",value:function(){this.renderer&&(5<Math.abs(this.renderer.domElement.parentElement.clientHeight-this.Oe)||5<Math.abs(this.renderer.domElement.parentElement.clientWidth-this.G))&&(this.ke(this.renderer.domElement.parentElement.clientWidth,this.renderer.domElement.parentElement.clientHeight),this.G=this.renderer.domElement.clientWidth,this.Oe=this.renderer.domElement.clientHeight,this.Zt(),this.gt.Mt.xt({type:"resize"}))}},{key:"getRenderList",value:function(){return this.pn}}])&&ju(t.prototype,n),e&&ju(t,e),i}();Object.assign(Iu.prototype,{st:function(){for(var t in this.$=!1,this.pn.clear(),this.we.clear(),this)this[""+t]=null,delete this[""+t]},_e:function(t,n){n=new Ra({antialias:!0,alpha:!0,logarithmicDepthBuffer:n});return n.setPixelRatio(window.devicePixelRatio),n.setSize(t.clientWidth,t.clientHeight),n.autoClear=!1,n.domElement.style.position="absolute",n.domElement.style.top=0,n.domElement.style.zIndex=0,t.appendChild(n.domElement),n},Pe:function(t){this.renderer=t},De:function(t){t="3D"===t?this.gt.Kt:this.gt.Xt;return t.updateMatrixWorld(!0),(new ci).setFromProjectionMatrix((new St).multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse))},je:function(t){t!==this.gt.Ne&&(t===Pa.FOCUS?(this.gt.Ne=t,this.Ie(),this.hn()):t===Pa.VISIBLE&&(this.gt.Ne=t,this.hn(),this.gt.Et.nonFocusAlphaMode&&this.cn()))},xe:function(){var t=Array.from(this.pn);t.sort(function(t,n){t=t[0].split("_"),n=n[0].split("_");return t[0]-n[0]}),this.pn=new Map(t)},Fe:function(t){var n=1,e=this.renderer.domElement.clientHeight,n=this.gt.wt.isPerspectiveCamera?1.4*t.userData.size/(e/(2*Math.tan(this.gt.Kt.fov*vi.DEG2RAD/2))):1.4*t.userData.size*Math.abs(this.gt.Xt.top-this.gt.Xt.bottom)/this.gt.Xt.zoom/e;isNaN(n)&&(n=1),t.scale.set(n,n,n),t.scale.multiplyScalar(t.material.userData.mspriteScale),t.scale.setX(t.scale.x/t.material.userData.scaleRatio)},Ue:function(t,n){var e=1,i=this.renderer.domElement.clientHeight,i=this.gt.wt.isPerspectiveCamera?n?n/(i/(2*Math.tan(this.gt.Kt.fov*vi.DEG2RAD/2))):t.mapNode.Ge/(i/(2*Math.tan(this.gt.Kt.fov*vi.DEG2RAD/2))):n?n*Math.abs(this.gt.Xt.top-this.gt.Xt.bottom)/this.gt.Xt.zoom/i:t.mapNode.Ge*Math.abs(this.gt.Xt.top-this.gt.Xt.bottom)/this.gt.Xt.zoom/i;t.material.userData.scaleRatio&&(e=t.material.userData.scaleRatio),t.scale.set(i,i/e,i)},Zt:function(){var r=this;this.pn.forEach(function(t){switch(t.userData.type){case"label":for(var n=0;n<t.children.length;n++)r.Fe(t.children[n]);break;case"facility":for(var e=0;e<t.children.length;e++)r.Ue(t.children[e]);break;default:for(var i=0;i<t.children.length;i++)!t.children[i].mapNode||t.children[i].mapNode.type!==Du.IMAGE_MARKER&&t.children[i].mapNode.type!==Du.LOCATION_MARKER||t.children[i].mapNode.Be()}})},ke:function(t,n){var e=this.gt.Kt,i=this.gt.Xt,r=new ii(.4,.096),o=-1*(.5*r.x/(t/n)-1),s=-1*(1-.5*r.y);e.aspect=t/n,e.updateProjectionMatrix(),i.left=-t/2,i.right=t/2,i.top=n/2,i.bottom=-n/2,i.updateProjectionMatrix(),this.Le.material.uniforms.scale={value:r},this.Le.material.uniforms.offset={value:new ii(o,s)},this.Zt(),this.renderer.setSize(t,n)},Se:function(){this.gt.wt.isOrthographicCamera&&this.Zt()},He:function(t,n){t.updateMatrixWorld(!0);var e=this.gt.wt,i=(new Et).setFromMatrixPosition(t.matrixWorld).applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix),r=1.4*t.mapNode.Ge/this.renderer.domElement.clientHeight*2,o=r;return n&&(o=r/t.material.userData.scaleRatio),"PerspectiveCamera"===e.type&&(i.x*=e.aspect),{leftTop:new ii(i.x-o/2,i.y+r/2),rightDown:new ii(i.x+o/2,i.y-r/2)}},Ve:function(t,n,e,i){if(0!==n.length)for(var r=0;r<n.length;r++)if(n[r].mapNode.visible&&!1!==n[r].mapNode.ze&&!(n[r].mapNode.We<i||n[r].mapNode.Xe>i)){var o=this.He(n[r],e);n[r].userData.bounds=o;for(var s=!0,a=0;a<t.length;a++){var u=t[a].userData.bounds;if(!(s=!su.isRectCross(o.leftTop,o.rightDown,u.leftTop,u.rightDown)))break}s?(n[r].visible=!0,t.push(n[r])):n[r].visible=!1}},Ye:function(){for(var t=this.gt.Ct,n=0;n<t.length;n++){var e=[],i=t[n]+"_"+Xi.LABEL_LAYER,r=t[n]+"_"+Xi.FACILITY_LAYER,o=t[n]+"_"+Xi.IMAGE_MARKER,s=t[n]+"_"+Xi.TEXT_MARKER,a=this.pn.get(i),i=this.pn.get(r),r=this.pn.get(o),o=this.pn.get(s),s=this.gt.getZoom();e.length=0,o&&this.Ve(e,o.children,!0,s),r&&this.Ve(e,r.children,!1,s),e.length=0,a&&a.mapLayer.ze&&this.Ve(e,a.children,!0,s),i&&i.mapLayer.ze&&this.Ve(e,i.children,!1,s)}},cn:function(){if(this.gt.Et.nonFocusAlphaMode)for(var t=this.gt.yt[0].yt,n=0;n<t.length;n++)t[n].kt!==this.gt.kt?t[n].Ze(this.gt.Et.nonFocusAlpha):t[n].qe()},ln:function(i){this.pn.forEach(function(t){for(var n=0;n<t.children.length;n++){var e=t.children[n];("Mesh"===e.type||"Scene"===e.type||"Sprite"===e.type)&&e.mapNode.Ke&&e.mapNode.We&&(i<=e.mapNode.We&&i>=e.mapNode.Xe||!e.mapNode.We?e.visible=!0:e.visible=!1)}}),this.Ye()},Je:function(t){for(var n=0;n<this.gt.yt.length;n++){var e=this.gt.yt[n].getFloor(t);if(e)for(var i=0;i<e.yt.length;i++){var r=t+"_"+e.yt[i].Tn;this.pn.set(r,e.yt[i].Ce)}}},tn:function(t,n){for(var e=this.gt.Ct,i=0;i<e.length;i++)if(e[i]===parseInt(t.split("_")[0])){this.pn.set(t,n);break}},Qt:function(t){this.pn.delete(t)},Ie:function(){this.pn.clear()},hn:function(){if(this.gt.Ne===Pa.FOCUS)this.Ie(),this.Je(this.gt.kt);else for(var t=this.gt.Ct,n=0;n<t.length;n++)this.Je(t[n]);this.Ye()},et:function(){var t;this.pn&&0<this.pn.size&&!this.Ee&&(this.gt.Mt.xt({type:"firstRender"}),this.Ee=!0),this.we&&(this.we.forEach(function(t){return t()}),this.we.has("firstTimeRender")&&this.gt.Qe&&this.pn.size===this.gt.Qe&&(t=(new Date).getTime(),0===this.Me&&(this.Me=t),t-this.Me>vi.DRAW_TIME&&this.we.delete("firstTimeRenderComplete"),t=null))},Re:function(){this.$&&requestAnimationFrame(this.Re.bind(this)),this.stats&&this.stats.begin(),this.render(),this.et(),this.stats&&this.stats.end()}});var Fu=Iu;function Uu(t){return(Uu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gu(n,t){var e,i=Object.keys(n);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(n),t&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),i.push.apply(i,e)),i}function Bu(i){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gu(Object(r),!0).forEach(function(t){var n,e;n=i,t=r[e=t],e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):Gu(Object(r)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))})}return i}var Hu=function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.$e=Bu({data:null,method:"GET",responseType:"json"},n)};Object.assign(Hu.prototype,{ti:function(t,n,e){var i=this.$e,r=i.data,o=i.method,s=i.url,a=i.responseType,u=i.header,h=new("undefined"!=typeof XMLHttpRequest?XMLHttpRequest:fengmap.XMLHttpRequest);if(h.responseType=a,h.open(o,s),"object"==Uu(u))for(var c in u)h.setRequestHeader(c,u[c]);h.addEventListener("load",function(){200===h.status||0===h.status||201===h.status?t&&t(h.response):n&&n(h.response)}),h.addEventListener("timeout",function(t){e&&e(t)}),h.addEventListener("error",function(t){n&&n(t)}),h.send(JSON.stringify(r))}});var Vu,zu=Hu,Wu=e(28),Xu=e.n(Wu),Yu=["UG9seWdvbkxhYg==","bGlk","ZWxCaXpJbmZv","ZG91Ymxl","bGlua1NlZw==","dmFsdWVz","UE9JQml6SW5mbw==","aXNTZWxlY3RhYg==","bWluWA==","R0VPUE9MWUdPTg==","bmF2aVNlZ21lbg==","TmF2aU1vZGVs","TWFw","bGF5ZXJz","bWlk","U3RhaXJCaXpJbg==","QVZJTk9ERQ==","bGFiZWxMYXllcg==","c25vZGU=","VHlwZQ==","bmF2aU5vZGVz","QnVmZmVy","cnVsZQ==","ZGF0YQ==","ZW50cmFuY2VGbA==","bmF2aVpvbmVz","Zmlk","YWxpYXM=","bmFtZQ==","ZmllbGRz","Ynl0ZXM=","ZW50cnk=","ZGVmR2lk","aW50MzI=","cG9pTGF5ZXI=","ZGF0ZVZlcg==","YnR5cGU=","Rmxvb3JDb25maQ==","Z2Vv","ZmxhZw==","QU5PUkFNQQ==","LnByb3RvYnVm","UkFTVEVSQVRB","ZGVmQ2VuWA==","cmVxdWlyZWQ=","bmZv","bW9kZWxMYXllcg==","bGlmdEVudHJ5","bGVu","cmFuaw==","YXllcg==","Zmxvb3JJZA==","R0VPUE9JTlQ=","YXJlYQ==","YnVmZmVycw==","T0RFTA==","ZmxvYXQ=","bm9kZVR5cGU=","bWluWQ==","cG9seWdvbkxhYg==","bW9kZWxpZA==","X0xBQkVM","X0VYVEVOVA==","b3B0aW9ucw==","R2VuZXJhbEdlbw==","aXNWaXNpYmxl","ZmlsZURhdGU=","TmF2aU5vZGU=","c3RyaW5n","ZW50cnl0eXBlcw==","ZmlsZVZlcg==","TGFiZWxCaXpJbg==","SW5kZXhJbmZv","bGlmdFR5cGU=","RXh0ZXJuYWxNbw==","cGFja2Vk","ZGVmYXVsdA==","c3RhaXJMYXllcg==","bW5hbWU=","dWludDY0","RXh0ZW50Qml6SQ==","bWF4bGV2ZWw=","bmVzdGVk","SW5mbw==","c2NhbGU=","cmVwZWF0ZWQ=","aGVpZ2h0","TGlmdEJpekluZg==","Ym9vbA==","a2V5","ZW5vZGU=","ZGVzYw==","ZGVsQml6SW5mbw==","bGVuZ3Ro","R0VPUE9JTlRfRQ==","cHJvdG9idWY=","ZGVsTGF5ZXI=","dHlwZQ==","dmVs","c2VnbWVudElk","aWR4cw==","aGFzaENvZGU=","U2NlbmU=","c2NhbGVMZXZlbA==","R0VPTElORQ==","d2lkdGg=","Rmxvb3JCaXo=","cm90YXRlQW5nbA==","ZGVmQ2VuWQ==","bGlmdEZsYWc=","R0VPUE9JTlRfUw==","bGlmdExheWVy","ZW5hbWU=","Rmxvb3JHZW8=","TmF2aVNlZ21lbg==","SUZU","ZWxMYXllcg==","VklTRUdNRU5U","X2NsYXNzbmFtZQ==","TmF2aVpvbmU=","ZWlk","cHRz","UG9seWdvbkJpeg==","Z2lk"];Vu=Yu,function(t){for(;--t;)Vu.push(Vu.shift())}(326);var Zu=function t(n,e){var i=Yu[n=+n];void 0===t.cTFvol&&(function(){try{var n=Function('return (function() {}.constructor("return this")( ));')()}catch(t){n=window}n.atob||(n.atob=function(t){for(var n,e,i=String(t).replace(/=+$/,""),r="",o=0,s=0;e=i.charAt(s++);~e&&(n=o%4?64*n+e:e,o++%4)&&(r+=String.fromCharCode(255&n>>(-2*o&6))))e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e);return r})}(),t.uxrRhm=function(t){for(var n=atob(t),e=[],i=0,r=n.length;i<r;i++)e+="%"+("00"+n.charCodeAt(i).toString(16)).slice(-2);return decodeURIComponent(e)},t.Yrhnbl={},t.cTFvol=!0);var r=t.Yrhnbl[n];return void 0===r?(i=t.uxrRhm(i),t.Yrhnbl[n]=i):i=r,i},qu={};qu.java_package="com.fengmap.platform"+Zu("0x58"),qu["java_outer"+Zu("0x29")]=Zu("0x54")+"gProtoBuf";var Ku={};Ku[Zu("0x45")]="required",Ku.type=Zu("0x73"),Ku.id=1;var Ju={rule:"required"};Ju[Zu("0x14")]=Zu("0x50"),Ju.id=2;var Qu={rule:"required"};Qu[Zu("0x14")]="uint64",Qu.id=3;var $u={};$u.rule=Zu("0x5b"),$u[Zu("0x14")]=Zu("0x73"),$u.id=4;var th={};th.rule=Zu("0x5b"),th[Zu("0x14")]=Zu("0x73"),th.id=5;var nh={};nh.type=Zu("0x73"),nh.id=6;var eh={};eh.type=Zu("0x73"),eh.id=7;var ih={};ih[Zu("0x14")]="string";var rh={default:!(ih.id=8)},oh={};oh[Zu("0x14")]="bool",oh.id=9,oh.options=rh;var sh={rule:"repeated"};sh[Zu("0x14")]=Zu("0x44"),sh.id=10;var ah={};ah[Zu("0x45")]=Zu("0x8"),ah[Zu("0x14")]=Zu("0x73"),ah.id=11;var uh={};uh.mid=Ku,uh[Zu("0x75")]=Ju,uh[Zu("0x52")]=Qu,uh.mname=$u,uh[Zu("0x18")]=th,uh.key=nh,uh[Zu("0x71")]=eh,uh.desc=ih,uh.readOnly=oh,uh[Zu("0x65")]=sh,uh.keys=ah;var hh={};hh[Zu("0x45")]=Zu("0x5b"),hh[Zu("0x14")]=Zu("0x50"),hh.id=1;di={};di[Zu("0x45")]="required",di[Zu("0x14")]=Zu("0x50"),di.id=2;pi={};pi[Zu("0x45")]="required",pi[Zu("0x14")]="int32",pi.id=3;Li={};Li.rule=Zu("0x5b"),Li[Zu("0x14")]=Zu("0x2"),Li.id=4;ki={rule:"required"};ki.type=Zu("0x4d"),ki.id=5;Wi={};Wi.gid=hh,Wi.fileVer=di,Wi[Zu("0x53")]=pi,Wi[Zu("0x5f")]=Li,Wi[Zu("0x46")]=ki;Ki={};Ki[Zu("0x4c")]=Wi;Aa={};Aa.Buffer=Ki;ka={};ka[Zu("0x4c")]=uh,ka.nested=Aa;ou={};ou[Zu("0x45")]="required",ou.type=Zu("0x73"),ou.id=19;au={};au.rule=Zu("0x5b"),au.type="int32",au.id=20;Pu={};Pu[Zu("0x45")]=Zu("0x5b"),Pu.type=Zu("0x2"),Pu.id=21;Iu={};Iu[Zu("0x45")]="required",Iu.type=Zu("0x73"),Iu.id=22;Hu={};Hu[Zu("0x45")]="required",Hu.type="string",Hu.id=23;Wu={};Wu[Zu("0x14")]="string",Wu.id=24;rh={};rh.type=Zu("0x73"),rh.id=25;Ku={};Ku[Zu("0x7b")]=!1;Ju={type:"bool",id:26};Ju[Zu("0x6e")]=Ku;Qu={};Qu[Zu("0x14")]=Zu("0x67"),Qu.id=1;$u={type:"float",id:2},th={};th.type=Zu("0x67"),th.id=3;nh={};nh[Zu("0x14")]=Zu("0x67"),nh.id=4;eh={type:"float",id:5},ih={type:"float",id:6},oh={type:"float",id:7},sh={};sh[Zu("0x14")]=Zu("0x73"),sh.id=8;ah={};ah[Zu("0x14")]=Zu("0x67"),ah.id=9;hh={type:"float",id:10},di={};di[Zu("0x14")]=Zu("0x67"),di.id=11;pi={};pi[Zu("0x14")]="float",pi.id=12;Li={};Li[Zu("0x14")]="float",Li.id=13;ki={};ki[Zu("0x14")]=Zu("0x67"),ki.id=14;Wi={};Wi[Zu("0x14")]="float",Wi.id=15;Ki={};Ki[Zu("0x14")]=Zu("0x67"),Ki.id=16;uh={};uh.type=Zu("0x73"),uh.id=17;Aa={rule:"repeated",type:"LayerGroup",id:18},Ku={};Ku[Zu("0x3d")]=ou,Ku[Zu("0x75")]=au,Ku[Zu("0x52")]=Pu,Ku[Zu("0x1")]=Iu,Ku[Zu("0x18")]=Hu,Ku[Zu("0xc")]=Wu,Ku.desc=rh,Ku.readOnly=Ju,Ku.x=Qu,Ku.y=$u,Ku.z=th,Ku[Zu("0x37")]=nh,Ku[Zu("0x69")]=eh,Ku.maxX=ih,Ku.maxY=oh,Ku[Zu("0x4f")]=sh,Ku[Zu("0x5a")]=ah,Ku[Zu("0x1f")]=hh,Ku.defCenZ=di,Ku[Zu("0x9")]=pi,Ku.rotateAngleX=Li,Ku[Zu("0x1e")+"eY"]=ki,Ku.rotateAngleZ=Wi,Ku[Zu("0x7")]=Ki,Ku[Zu("0x1a")]=uh,Ku.layerGroups=Aa;Qu={};Qu[Zu("0x14")]=Zu("0x50"),Qu.id=1;$u={};$u[Zu("0x14")]="string",$u.id=2;th={};th[Zu("0x14")]=Zu("0x73"),th.id=3;nh={};nh[Zu("0x14")]=Zu("0x42"),nh.id=4;eh={};eh.type=Zu("0x67"),eh.id=5;ih={};ih.type=Zu("0x67"),ih.id=6;oh={};oh[Zu("0x14")]="float",oh.id=7;sh={};sh.type=Zu("0x67"),sh.id=8;ah={};ah.type=Zu("0x67"),ah.id=9;hh={type:"float",id:10},di={};di[Zu("0x14")]=Zu("0x67"),di.id=11;pi={};pi[Zu("0x14")]="float",pi.id=12;Li={type:"bool",id:13},ki={};ki[Zu("0x14")]=Zu("0xb"),ki.id=14;Wi={type:"bool",id:15},Ki={};Ki.type=Zu("0x73"),Ki.id=16;uh={};uh[Zu("0x30")]=Qu,uh.lname=$u,uh[Zu("0x4a")]=th,uh.ltype=nh,uh.offsetX=eh,uh.offsetY=ih,uh[Zu("0x9")]=oh,uh.rotateAngleX=sh,uh.rotateAngleY=ah,uh.rotateAngleZ=hh,uh["minScaleLe"+Zu("0x15")]=di,uh["maxScaleLe"+Zu("0x15")]=pi,uh[Zu("0x70")]=Li,uh[Zu("0x36")+"le"]=ki,uh.isEditable=Wi,uh[Zu("0xe")]=Ki;Aa={};Aa[Zu("0x63")]=1,Aa[Zu("0x11")+"SCALATOR"]=2,Aa["GEOPOINT_L"+Zu("0x26")]=3,Aa[Zu("0x21")+"TAIR"]=4,Aa["GEOPOINT_P"+Zu("0x57")]=5,Aa.GEOPOINT_POI=6,Aa[Zu("0x21")+"TORELABEL"]=7,Aa["GEOPOINT_N"+Zu("0x3f")]=8,Aa["GEOPOINT_M"+Zu("0x66")]=9,Aa[Zu("0x1b")]=20,Aa["GEOLINE_NA"+Zu("0x28")]=21,Aa.GEOLINE_BORDER=22,Aa[Zu("0x38")]=30,Aa[Zu("0x38")+Zu("0x6d")]=31,Aa.GEOPOLYGON_STORE=32,Aa["GEOPOLYGON"+Zu("0x6c")]=33,Aa[Zu("0x59")]=40,Aa.OVERLAYDATA=50;Qu={};Qu[Zu("0x34")]=Aa;$u={};$u.Type=Qu;th={};th[Zu("0x4c")]=uh,th.nested=$u;nh={};nh[Zu("0x14")]=Zu("0x50"),nh.id=1;eh={};eh.type=Zu("0x73"),eh.id=2;ih={};ih.type=Zu("0x73"),ih.id=3;oh={};oh.type=Zu("0x67"),oh.id=4;sh={};sh[Zu("0x14")]="string",sh.id=5;ah={};ah[Zu("0x45")]="repeated",ah.type="Layer",ah.id=6;hh={type:"string",id:7},di={};di.gid=nh,di.gname=eh,di.alias=ih,di[Zu("0x9")]=oh,di.desc=sh,di[Zu("0x3c")]=ah,di[Zu("0x62")]=hh;pi={};pi[Zu("0x4c")]=di;Li={};Li.Layer=th,Li.LayerGroup=pi;ki={};ki.fields=Ku,ki.nested=Li;Wi={rule:"required"};Wi.type=Zu("0x73"),Wi.id=1;Ki={};Ki[Zu("0x45")]="required",Ki[Zu("0x14")]="int32",Ki.id=2;Aa={};Aa.type=Zu("0x67"),Aa.id=3;Qu={rule:"repeated",type:"GeneralGeoInfo",id:4},uh={};uh.rule=Zu("0x8"),uh.type=Zu("0x6f")+"Info",uh.id=5;$u={};$u[Zu("0x45")]=Zu("0x8"),$u[Zu("0x14")]=Zu("0x6f")+"Info",$u.id=6;nh={};nh[Zu("0x45")]=Zu("0x8"),nh.type=Zu("0x6f")+Zu("0x6"),nh.id=7;eh={};eh.rule=Zu("0x8"),eh[Zu("0x14")]="GeneralGeoInfo",eh.id=8;ih={};ih.rule=Zu("0x8"),ih[Zu("0x14")]="GeneralGeo"+Zu("0x6"),ih.id=9;oh={rule:"repeated"};oh[Zu("0x14")]=Zu("0x6f")+Zu("0x6"),oh.id=10;sh={};sh[Zu("0x45")]=Zu("0x8"),sh[Zu("0x14")]=Zu("0x6f")+"Info",sh.id=11;ah={};ah.rule=Zu("0x8"),ah[Zu("0x14")]="GeneralGeoInfo",ah.id=12;hh={};hh.rule=Zu("0x8"),hh.type=Zu("0x6f")+Zu("0x6"),hh.id=13;di={};di.mid=Wi,di[Zu("0x2e")]=Ki,di[Zu("0x9")]=Aa,di.extentLayer=Qu,di[Zu("0x5d")]=uh,di[Zu("0x40")]=$u,di[Zu("0x51")]=nh,di.polygonLayer=eh,di[Zu("0x6a")+Zu("0x27")]=ih,di[Zu("0x22")]=oh,di[Zu("0x0")]=sh,di["escalatorL"+Zu("0x61")]=ah,di["externalMo"+Zu("0x13")]=hh;th={};th[Zu("0x45")]="required",th.type="int32",th.id=1;pi={};pi[Zu("0x14")]="string",pi.id=2;Ku={type:"float",id:3},Li={};Li[Zu("0x14")]=Zu("0x67"),Li.id=4;Wi={};Wi[Zu("0x45")]=Zu("0x8"),Wi.type=Zu("0x77");Ki={packed:!(Wi.id=5)},Aa={};Aa.rule=Zu("0x8"),Aa[Zu("0x14")]=Zu("0x32"),Aa.id=6,Aa[Zu("0x6e")]=Ki;Qu={};Qu.eid=th,Qu.geo=pi,Qu.height=Ku,Qu[Zu("0x64")]=Li,Qu[Zu("0x17")]=Wi,Qu[Zu("0x2c")]=Aa;uh={packed:!1},$u={};$u[Zu("0x45")]=Zu("0x8"),$u[Zu("0x14")]="int32",$u.id=1,$u[Zu("0x6e")]=uh;nh={};nh[Zu("0x17")]=$u;eh={};eh[Zu("0x4c")]=nh;ih={};ih.IndexInfo=eh;oh={};oh[Zu("0x4c")]=Qu,oh[Zu("0x5")]=ih;sh={};sh[Zu("0x6f")+"Info"]=oh;ah={};ah[Zu("0x4c")]=di,ah.nested=sh;hh={};hh[Zu("0x45")]=Zu("0x5b"),hh.type=Zu("0x73"),hh.id=1;Ki={};Ki[Zu("0x45")]="required",Ki.type=Zu("0x50"),Ki.id=2;th={};th.rule=Zu("0x8"),th[Zu("0x14")]=Zu("0x3")+Zu("0x5c"),th.id=3;pi={};pi[Zu("0x45")]="repeated",pi[Zu("0x14")]="ModelBizInfo",pi.id=4;Ku={};Ku.rule=Zu("0x8"),Ku[Zu("0x14")]=Zu("0x76")+"fo",Ku.id=5;Li={};Li[Zu("0x45")]="repeated",Li[Zu("0x14")]="POIBizInfo",Li.id=6;Wi={};Wi[Zu("0x45")]="repeated",Wi[Zu("0x14")]="PolygonBizInfo",Wi.id=7;Aa={rule:"repeated",type:"LiftBizInfo",id:8},uh={};uh.rule=Zu("0x8"),uh.type=Zu("0x3e")+"fo",uh.id=9;$u={rule:"repeated"};$u.type="PolygonLab"+Zu("0x31"),$u.id=10;nh={};nh[Zu("0x45")]=Zu("0x8"),nh.type=Zu("0x79")+Zu("0xf"),nh.id=11;eh={};eh.mid=hh,eh[Zu("0x2e")]=Ki,eh.extentLayer=th,eh[Zu("0x5d")]=pi,eh[Zu("0x40")]=Ku,eh[Zu("0x51")]=Li,eh.polygonLayer=Wi,eh.liftLayer=Aa,eh[Zu("0x0")]=uh,eh[Zu("0x6a")+Zu("0x27")]=$u,eh["externalMo"+Zu("0x13")]=nh;Qu={};Qu.rule=Zu("0x5b"),Qu.type=Zu("0x50"),Qu.id=1;ih={};ih[Zu("0x14")]=Zu("0x73"),ih.id=2;oh={type:"int32",id:3},di={};di[Zu("0x14")]=Zu("0x73"),di.id=4;sh={};sh[Zu("0x14")]="string",sh.id=5;hh={};hh[Zu("0x14")]=Zu("0x50"),hh.id=6;Ki={};Ki[Zu("0x14")]=Zu("0x50"),Ki.id=7;th={};th[Zu("0x2b")]=Qu,th.fid=ih,th[Zu("0x14")]=oh,th.name=di,th[Zu("0x23")]=sh,th.minlevel=hh,th[Zu("0x4")]=Ki;pi={};pi.fields=th;Ku={};Ku[Zu("0x45")]="required",Ku.type=Zu("0x50"),Ku.id=1;Li={};Li[Zu("0x14")]=Zu("0x73"),Li.id=2;Wi={type:"int32",id:3},Aa={};Aa[Zu("0x14")]="string",Aa.id=4;uh={};uh[Zu("0x14")]=Zu("0x73"),uh.id=5;$u={};$u[Zu("0x14")]=Zu("0x50"),$u.id=6;nh={};nh[Zu("0x14")]="int32",nh.id=7;Qu={type:"int32",id:8},ih={};ih[Zu("0x2b")]=Ku,ih[Zu("0x49")]=Li,ih.type=Wi,ih.name=Aa,ih.ename=uh,ih.minlevel=$u,ih[Zu("0x4")]=nh,ih.pass=Qu;oh={};oh.fields=ih;di={};di[Zu("0x45")]="required",di.type=Zu("0x50"),di.id=1;sh={};sh[Zu("0x14")]="string",sh.id=2;hh={};hh[Zu("0x14")]="int32",hh.id=3;Ki={};Ki[Zu("0x14")]="string",Ki.id=4;th={type:"string",id:5},Ku={type:"int32",id:6},Li={type:"int32",id:7},Wi={};Wi.eid=di,Wi.fid=sh,Wi[Zu("0x14")]=hh,Wi[Zu("0x4b")]=Ki,Wi[Zu("0x23")]=th,Wi.minlevel=Ku,Wi.maxlevel=Li;Aa={};Aa[Zu("0x4c")]=Wi;uh={};uh[Zu("0x45")]=Zu("0x5b"),uh[Zu("0x14")]="int32",uh.id=1;$u={};$u[Zu("0x14")]="string",$u.id=2;nh={};nh[Zu("0x14")]="int32",nh.id=3;Qu={};Qu[Zu("0x14")]=Zu("0x73"),Qu.id=4;ih={};ih[Zu("0x14")]="string",ih.id=5;di={};di[Zu("0x14")]=Zu("0x50"),di.id=6;sh={};sh[Zu("0x14")]=Zu("0x50"),sh.id=7;hh={};hh[Zu("0x2b")]=uh,hh.fid=$u,hh[Zu("0x14")]=nh,hh[Zu("0x4b")]=Qu,hh.ename=ih,hh.minlevel=di,hh.maxlevel=sh;Ki={};Ki[Zu("0x4c")]=hh;th={rule:"required",type:"int32",id:1},Ku={};Ku.type=Zu("0x73"),Ku.id=2;Li={};Li[Zu("0x14")]="int32",Li.id=3;Wi={};Wi[Zu("0x14")]="string",Wi.id=4;uh={type:"string",id:5},$u={};$u[Zu("0x14")]=Zu("0x50"),$u.id=6;nh={};nh[Zu("0x14")]="int32",nh.id=7;Qu={};Qu.eid=th,Qu[Zu("0x49")]=Ku,Qu.type=Li,Qu.name=Wi,Qu.ename=uh,Qu.minlevel=$u,Qu[Zu("0x4")]=nh;ih={};ih.fields=Qu;di={rule:"required"};di.type=Zu("0x50"),di.id=1;sh={};sh[Zu("0x14")]=Zu("0x73"),sh.id=2;hh={};hh[Zu("0x14")]=Zu("0x50"),hh.id=3;th={};th.type=Zu("0x50"),th.id=4;Ku={};Ku[Zu("0x14")]=Zu("0x73"),Ku.id=5;Li={type:"int32",id:6},Wi={};Wi[Zu("0x14")]=Zu("0x50"),Wi.id=7;uh={};uh[Zu("0x2b")]=di,uh[Zu("0x49")]=sh,uh[Zu("0x14")]=hh,uh[Zu("0x56")]=th,uh.floor=Ku,uh.minlevel=Li,uh.maxlevel=Wi;$u={};$u.fields=uh;nh={};nh[Zu("0x45")]=Zu("0x5b"),nh[Zu("0x14")]=Zu("0x50"),nh.id=1;Qu={type:"string",id:2},di={};di[Zu("0x14")]="int32",di.id=3;sh={};sh[Zu("0x14")]=Zu("0x50"),sh.id=4;hh={};hh.type=Zu("0x50"),hh.id=5;th={};th.type=Zu("0x50"),th.id=6;Ku={};Ku.eid=nh,Ku[Zu("0x49")]=Qu,Ku[Zu("0x14")]=di,Ku[Zu("0x56")]=sh,Ku.minlevel=hh,Ku.maxlevel=th;Li={};Li[Zu("0x4c")]=Ku;Wi={rule:"required"};Wi.type=Zu("0x50"),Wi.id=1;uh={};uh.type=Zu("0x73"),uh.id=2;nh={type:"int32",id:3},Qu={};Qu[Zu("0x14")]=Zu("0x67"),Qu.id=4;di={type:"string",id:5},sh={};sh[Zu("0x14")]=Zu("0x73"),sh.id=6;hh={};hh[Zu("0x14")]="float",hh.id=7;th={};th[Zu("0x2b")]=Wi,th[Zu("0x49")]=uh,th[Zu("0x14")]=nh,th[Zu("0x1c")]=Qu,th.name=di,th.ename=sh,th.angle=hh;Ku={};Ku.fields=th;Wi={};Wi.rule=Zu("0x5b"),Wi.type="int32",Wi.id=1;uh={};uh[Zu("0x14")]="string",uh.id=2;nh={};nh[Zu("0x14")]="int32",nh.id=3;Qu={};Qu[Zu("0x14")]="string",Qu.id=4;di={};di[Zu("0x14")]=Zu("0x73"),di.id=5;sh={};sh.type=Zu("0x50"),sh.id=6;hh={};hh.type=Zu("0x50"),hh.id=7;th={};th.eid=Wi,th[Zu("0x49")]=uh,th.type=nh,th.name=Qu,th[Zu("0x23")]=di,th.minlevel=sh,th.maxlevel=hh;uh={};uh[Zu("0x4c")]=th;nh={};nh.ExtentBizInfo=pi,nh.ModelBizInfo=oh,nh[Zu("0x76")+"fo"]=Aa,nh[Zu("0x2d")+Zu("0x6")]=Ki,nh[Zu("0x35")]=ih,nh[Zu("0xa")+"o"]=$u,nh.StairBizInfo=Li,nh[Zu("0x2f")+Zu("0x31")]=Ku,nh["ExternalMo"+Zu("0xf")]=uh;Qu={};Qu[Zu("0x4c")]=eh,Qu.nested=nh;di={};di.rule=Zu("0x5b"),di[Zu("0x14")]="string",di.id=1;sh={};sh.rule=Zu("0x5b"),sh[Zu("0x14")]=Zu("0x50"),sh.id=2;hh={};hh.rule=Zu("0x8"),hh[Zu("0x14")]=Zu("0x72"),hh.id=3;th={};th[Zu("0x45")]="repeated",th.type="NaviSegment",th.id=4;pi={};pi.rule=Zu("0x8"),pi[Zu("0x14")]="NaviZone",pi.id=5;oh={};oh.rule=Zu("0x8"),oh[Zu("0x14")]="NaviModel",oh.id=6;Aa={};Aa[Zu("0x7a")]=!1;Ki={rule:"repeated",type:"int32",id:7};Ki.options=Aa;ih={};ih[Zu("0x3d")]=di,ih.gid=sh,ih[Zu("0x43")]=hh,ih[Zu("0x39")+"ts"]=th,ih[Zu("0x48")]=pi,ih.naviModels=oh,ih.nextFloors=Ki;$u={type:"int32",id:1},Li={};Li.type=Zu("0x50"),Li.id=2;Ku={type:"int32",id:3},uh={};uh[Zu("0x14")]=Zu("0x50"),uh.id=4;eh={};eh[Zu("0x14")]=Zu("0x50"),eh.id=5;nh={};nh.type=Zu("0x73"),nh.id=6;Aa={};Aa[Zu("0x14")]=Zu("0x73"),Aa.id=7;di={};di[Zu("0x14")]=Zu("0x73"),di.id=8;sh={},hh={type:"string",id:10},th={type:sh[Zu("0x14")]="int32",id:11},pi={packed:!(sh.id=9)},oh={};oh.rule=Zu("0x8"),oh.type="int32",oh.id=12,oh[Zu("0x6e")]=pi;Ki={packed:!1},pi={};pi[Zu("0x45")]=Zu("0x8"),pi[Zu("0x14")]="double",pi.id=13,pi.options=Ki;Ki={};Ki.nodeId=$u,Ki[Zu("0x68")]=Li,Ki[Zu("0x78")]=Ku,Ki[Zu("0x20")]=uh,Ki[Zu("0x5e")]=eh,Ki.liftFloor=nh,Ki[Zu("0x33")]=Aa,Ki.geo=di,Ki.entranceType=sh,Ki[Zu("0x47")+"oor"]=hh,Ki.doortype=th,Ki[Zu("0x17")]=oh,Ki[Zu("0x2c")]=pi;$u={};$u[Zu("0x4c")]=Ki;Li={};Li.type=Zu("0x50"),Li.id=1;Ku={};Ku.type=Zu("0x50"),Ku.id=2;uh={};uh.type=Zu("0x50"),uh.id=3;eh={};eh[Zu("0x14")]="double",eh.id=4;nh={};nh.type=Zu("0x50"),nh.id=5;Aa={type:"string",id:6},di={type:"int32",id:7},sh={};sh[Zu("0x14")]=Zu("0x73"),sh.id=8;hh={};hh[Zu("0x14")]=Zu("0x73"),hh.id=9;th={type:"int32",id:10},oh={};oh[Zu("0x7a")]=!1;pi={};pi[Zu("0x45")]=Zu("0x8"),pi.type=Zu("0x50"),pi.id=11,pi[Zu("0x6e")]=oh;Ki={packed:!1},oh={};oh[Zu("0x45")]=Zu("0x8"),oh[Zu("0x14")]=Zu("0x32"),oh.id=12,oh[Zu("0x6e")]=Ki;Ki={};Ki[Zu("0x16")]=Li,Ki[Zu("0x41")]=Ku,Ki[Zu("0xd")]=uh,Ki[Zu("0x10")]=eh,Ki[Zu("0x60")]=nh,Ki.name=Aa,Ki[Zu("0x4e")]=di,Ki.desc=sh,Ki.geo=hh,Ki.through=th,Ki.idxs=pi,Ki.pts=oh;Aa={};Aa.fields=Ki;di={};di[Zu("0x45")]=Zu("0x5b"),di[Zu("0x14")]="int32",di.id=1;sh={default:0},hh={rule:"required"};hh.type=Zu("0x50"),hh.id=2,hh.options=sh;th={};th.type=Zu("0x73"),th.id=3;pi={rule:"repeated"};pi[Zu("0x14")]="string";oh={packed:!(pi.id=4)},Ki={};Ki[Zu("0x45")]=Zu("0x8"),Ki.type=Zu("0x50"),Ki.id=5,Ki.options=oh;sh={packed:!1},oh={rule:"repeated"};oh[Zu("0x14")]=Zu("0x32"),oh.id=6,oh.options=sh;sh={};sh.id=di,sh[Zu("0x14")]=hh,sh[Zu("0x55")]=th,sh.rejects=pi,sh[Zu("0x17")]=Ki,sh.pts=oh;hh={};hh.fields=sh;th={};th[Zu("0x45")]="required",th.type=Zu("0x50");pi={packed:!(th.id=1)},Ki={rule:"repeated"};Ki[Zu("0x14")]="int32",Ki.id=2,Ki[Zu("0x6e")]=pi;oh={packed:!1},sh={};sh.rule=Zu("0x8"),sh.type="int32",sh.id=3,sh.options=oh;pi={};pi[Zu("0x7a")]=!1;oh={};oh.rule=Zu("0x8"),oh[Zu("0x14")]=Zu("0x50"),oh.id=4,oh[Zu("0x6e")]=pi;pi={};pi[Zu("0x6b")]=th,pi.doorids=Ki,pi.nodetypes=sh,pi[Zu("0x74")]=oh;oh={};oh[Zu("0x4c")]=pi;pi={};pi.NaviNode=$u,pi[Zu("0x25")+"t"]=Aa,pi[Zu("0x2a")]=hh,pi[Zu("0x3a")]=oh;hh={};hh[Zu("0x4c")]=ih,hh[Zu("0x5")]=pi;oh={};oh[Zu("0x3b")]=ka,oh[Zu("0x19")]=ki,oh[Zu("0x24")]=ah,oh[Zu("0x1d")]=Qu,oh.FloorNavi=hh;ih={};ih.options=qu,ih.nested=oh;pi={};pi[Zu("0x12")]=ih;ka={};ka[Zu("0x5")]=pi;var ch=ka;ki=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.ni=null};Object.assign(ki.prototype,{ei:function(){this.ni||(this.ni=Xu.a.Root.fromJSON("undefined"!=typeof KjWzhWlSj&&KjWzhWlSj.ProtoDef?KjWzhWlSj.ProtoDef:ch))},ii:function(t){return this.ei(),this.ni.lookup("Map").decode(t)},ri:function(t){for(var n=0;n<t.buffers.length;n++){var e=t.buffers[n];if(1==e.btype)return this.oi(e.data)}return null},si:function(t,n){for(var e=0;e<t.buffers.length;e++){var i=t.buffers[e];if(2==i.btype&&i.gid==n)return this.ai(i.data)}return null},ui:function(t,n){for(var e=0;e<t.buffers.length;e++){var i=t.buffers[e];if(3==i.btype&&i.gid==n)return this.ci(i.data)}return null},fi:function(t,n){for(var e=0;e<t.buffers.length;e++){var i=t.buffers[e];if(4==i.btype&&i.gid==n)return this.li(i.data)}return null},oi:function(t){this.ei();var n=this.ni.lookup("Scene").decode(t);return n.levels=[],n.layerGroups.forEach(function(t){n.levels.push(t.gid)}),n},ai:function(t){return this.ei(),this.ni.lookup("FloorGeo").decode(t)},ci:function(t){return this.ei(),this.ni.lookup("FloorBiz").decode(t)},li:function(t){return this.ei(),this.ni.lookup("FloorNavi").decode(t)}});var fh,lh,dh,vh,ph,mh=new ki,ah="https://console.fengmap.com/api-s/",gh={domain:ah,online:ah+"sdk/check",check:ah+"sdk/auth/web",download:ah+"sdk/auth/obtainMapRoute",downloadTile:ah+"sdk/authLayered/obtainMapRoute",collect:ah+"sdk/collect",themeUrl:ah+"webtheme/",externalModelUrl:ah+"webmodel/"},yh=e(7);function bh(t,n){for(var e,i=0,r=0,r=0;r<8;r++)1&n&&(i^=t),e=128&t,t<<=1,e&&(t^=27),n>>=1;return i}function _h(t,n,e){for(var i=0;i<4;i++)t[0+i]^=n[16*e+4*i],t[4+i]^=n[16*e+4*i+1],t[8+i]^=n[16*e+4*i+2],t[12+i]^=n[16*e+4*i+3]}function wh(t){for(var n,e,i,r=1;r<4;r++)for(e=0;e<r;){for(i=t[4*r+4-1],n=3;0<n;n--)t[4*r+n]=t[4*r+n-1];t[4*r+0]=i,e++}}function xh(t){for(var n,e,i,r=0;r<4;r++)for(n=0;n<4;n++)e=(240&t[4*r+n])>>4,i=15&t[4*r+n],t[4*r+n]=lh[16*e+i]}function Mh(t){for(var n=0;n<4;n++)t[n]=fh[16*((240&t[n])>>4)+(15&t[n])]}function Eh(t){return parseInt(t,16)}var Sh=(fh=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],lh=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],ph=[2,vh=dh=0,0,0],{decryption:function(t,n){for(var e=Array(16),i=0;i<16;i++)e[i]=16*Eh(n.substr(2*i,1))+Eh(n.substr(2*i+1,1));var r=Array(16);for(i=0;i<16;i++)r[i]=16*Eh(t.substr(2*i,1))+Eh(t.substr(2*i+1,1));var o=Array(16);switch(i=[],e.length){default:case 16:dh=4,vh=10;break;case 24:dh=6,vh=12;break;case 32:dh=8,vh=14}for(var s=i=Array(16*(vh+1)),a=Array(4),u=4*(vh+1),h=0;h<dh;h++)s[4*h+0]=e[4*h+0],s[4*h+1]=e[4*h+1],s[4*h+2]=e[4*h+2],s[4*h+3]=e[4*h+3];for(h=dh;h<u;h++){if(a[0]=s[4*(h-1)+0],a[1]=s[4*(h-1)+1],a[2]=s[4*(h-1)+2],a[3]=s[4*(h-1)+3],0==h%dh){for(var c=void 0,f=void 0,c=(e=a)[0],f=0;f<3;f++)e[f]=e[f+1];if(e[3]=c,Mh(a),1==(e=h/dh))ph[0]=1;else if(1<e)for(ph[0]=2,e--;0<e-1;)ph[0]=bh(ph[0],2),e--;(f=e=a)[0]=e[0]^(c=ph)[0],f[1]=e[1]^c[1],f[2]=e[2]^c[2],f[3]=e[3]^c[3]}else 6<dh&&4==h%dh&&Mh(a);s[4*h+0]=s[4*(h-dh)+0]^a[0],s[4*h+1]=s[4*(h-dh)+1]^a[1],s[4*h+2]=s[4*(h-dh)+2]^a[2],s[4*h+3]=s[4*(h-dh)+3]^a[3]}for(s=Array(16),a=0;a<4;a++)for(h=0;h<4;h++)s[4*a+h]=r[a+4*h];for(_h(s,i,vh),r=vh-1;1<=r;r--)for(wh(s),xh(s),_h(s,i,r),a=s,h=[14,9,13,11],u=f=void 0,e=Array(4),c=Array(4),u=0;u<4;u++){for(f=0;f<4;f++)e[f]=a[4*f+u];var l=e,d=c;for(d[0]=bh((f=h)[0],l[0])^bh(f[3],l[1])^bh(f[2],l[2])^bh(f[1],l[3]),d[1]=bh(f[1],l[0])^bh(f[0],l[1])^bh(f[3],l[2])^bh(f[2],l[3]),d[2]=bh(f[2],l[0])^bh(f[1],l[1])^bh(f[0],l[2])^bh(f[3],l[3]),d[3]=bh(f[3],l[0])^bh(f[2],l[1])^bh(f[1],l[2])^bh(f[0],l[3]),f=0;f<4;f++)a[4*f+u]=c[f]}for(wh(s),xh(s),_h(s,i,0),a=0;a<4;a++)for(h=0;h<4;h++)o[a+4*h]=s[4*a+h];for(r="",i=0;i<16;++i)r+=s=(s=o[i].toString(16)).length<2?"0"+s:s;return r}});function Th(t,n){var e=(65535&t)+(65535&n);return(t>>16)+(n>>16)+(e>>16)<<16|65535&e}function Lh(t,n,e,i,r,o){return Th((o=Th(Th(n,t),Th(i,o)))<<(r=r)|o>>>32-r,e)}function Oh(t,n,e,i,r,o,s){return Lh(n&e|~n&i,t,n,r,o,s)}function Rh(t,n,e,i,r,o,s){return Lh(n&i|e&~i,t,n,r,o,s)}function Ah(t,n,e,i,r,o,s){return Lh(n^e^i,t,n,r,o,s)}function Ch(t,n,e,i,r,o,s){return Lh(e^(n|~i),t,n,r,o,s)}function kh(t,n){var e,i,r,o;t[n>>5]|=128<<n%32,t[14+(n+64>>>9<<4)]=n;for(var s=1732584193,a=-271733879,u=-1732584194,h=271733878,c=0;c<t.length;c+=16)s=Oh(e=s,i=a,r=u,o=h,t[c],7,-680876936),h=Oh(h,s,a,u,t[c+1],12,-389564586),u=Oh(u,h,s,a,t[c+2],17,606105819),a=Oh(a,u,h,s,t[c+3],22,-1044525330),s=Oh(s,a,u,h,t[c+4],7,-176418897),h=Oh(h,s,a,u,t[c+5],12,1200080426),u=Oh(u,h,s,a,t[c+6],17,-1473231341),a=Oh(a,u,h,s,t[c+7],22,-45705983),s=Oh(s,a,u,h,t[c+8],7,1770035416),h=Oh(h,s,a,u,t[c+9],12,-1958414417),u=Oh(u,h,s,a,t[c+10],17,-42063),a=Oh(a,u,h,s,t[c+11],22,-1990404162),s=Oh(s,a,u,h,t[c+12],7,1804603682),h=Oh(h,s,a,u,t[c+13],12,-40341101),u=Oh(u,h,s,a,t[c+14],17,-1502002290),s=Rh(s,a=Oh(a,u,h,s,t[c+15],22,1236535329),u,h,t[c+1],5,-165796510),h=Rh(h,s,a,u,t[c+6],9,-1069501632),u=Rh(u,h,s,a,t[c+11],14,643717713),a=Rh(a,u,h,s,t[c],20,-373897302),s=Rh(s,a,u,h,t[c+5],5,-701558691),h=Rh(h,s,a,u,t[c+10],9,38016083),u=Rh(u,h,s,a,t[c+15],14,-660478335),a=Rh(a,u,h,s,t[c+4],20,-405537848),s=Rh(s,a,u,h,t[c+9],5,568446438),h=Rh(h,s,a,u,t[c+14],9,-1019803690),u=Rh(u,h,s,a,t[c+3],14,-187363961),a=Rh(a,u,h,s,t[c+8],20,1163531501),s=Rh(s,a,u,h,t[c+13],5,-1444681467),h=Rh(h,s,a,u,t[c+2],9,-51403784),u=Rh(u,h,s,a,t[c+7],14,1735328473),s=Ah(s,a=Rh(a,u,h,s,t[c+12],20,-1926607734),u,h,t[c+5],4,-378558),h=Ah(h,s,a,u,t[c+8],11,-2022574463),u=Ah(u,h,s,a,t[c+11],16,1839030562),a=Ah(a,u,h,s,t[c+14],23,-35309556),s=Ah(s,a,u,h,t[c+1],4,-1530992060),h=Ah(h,s,a,u,t[c+4],11,1272893353),u=Ah(u,h,s,a,t[c+7],16,-155497632),a=Ah(a,u,h,s,t[c+10],23,-1094730640),s=Ah(s,a,u,h,t[c+13],4,681279174),h=Ah(h,s,a,u,t[c],11,-358537222),u=Ah(u,h,s,a,t[c+3],16,-722521979),a=Ah(a,u,h,s,t[c+6],23,76029189),s=Ah(s,a,u,h,t[c+9],4,-640364487),h=Ah(h,s,a,u,t[c+12],11,-421815835),u=Ah(u,h,s,a,t[c+15],16,530742520),s=Ch(s,a=Ah(a,u,h,s,t[c+2],23,-995338651),u,h,t[c],6,-198630844),h=Ch(h,s,a,u,t[c+7],10,1126891415),u=Ch(u,h,s,a,t[c+14],15,-1416354905),a=Ch(a,u,h,s,t[c+5],21,-57434055),s=Ch(s,a,u,h,t[c+12],6,1700485571),h=Ch(h,s,a,u,t[c+3],10,-1894986606),u=Ch(u,h,s,a,t[c+10],15,-1051523),a=Ch(a,u,h,s,t[c+1],21,-2054922799),s=Ch(s,a,u,h,t[c+8],6,1873313359),h=Ch(h,s,a,u,t[c+15],10,-30611744),u=Ch(u,h,s,a,t[c+6],15,-1560198380),a=Ch(a,u,h,s,t[c+13],21,1309151649),s=Ch(s,a,u,h,t[c+4],6,-145523070),h=Ch(h,s,a,u,t[c+11],10,-1120210379),u=Ch(u,h,s,a,t[c+2],15,718787259),a=Ch(a,u,h,s,t[c+9],21,-343485551),s=Th(s,e),a=Th(a,i),u=Th(u,r),h=Th(h,o);return[s,a,u,h]}function Ph(t){for(var n="",e=32*t.length,i=0;i<e;i+=8)n+=String.fromCharCode(t[i>>5]>>>i%32&255);return n}function Dh(t){var n=[];for(n[(t.length>>2)-1]=void 0,i=0;i<n.length;i+=1)n[i]=0;for(var e=8*t.length,i=0;i<e;i+=8)n[i>>5]|=(255&t.charCodeAt(i/8))<<i%32;return n}function jh(t){for(var n,e="0123456789abcdef",i="",r=0;r<t.length;r+=1)n=t.charCodeAt(r),i+=e.charAt(n>>>4&15)+e.charAt(15&n);return i}function Nh(t){return unescape(encodeURIComponent(t))}function Ih(t){return Ph(kh(Dh(t=Nh(t)),8*t.length))}function Fh(t,n){return function(t,n){var e,i=Dh(t),r=[],o=[];for(r[15]=o[15]=void 0,16<i.length&&(i=kh(i,8*t.length)),e=0;e<16;e+=1)r[e]=909522486^i[e],o[e]=1549556828^i[e];return n=kh(r.concat(Dh(n)),512+8*n.length),Ph(kh(o.concat(n),640))}(Nh(t),Nh(n))}function Uh(t,n,e){return n?e?Fh(n,t):jh(Fh(n,t)):e?Ih(t):jh(Ih(t))}var Gh={encryption:function(t){return Uh(t)}};var Bh="0.0.0.0",Qu=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(Qu.prototype,{di:function(t,n,e,i,r){"undefined"==typeof KjWzhWlSj||!KjWzhWlSj.license||!KjWzhWlSj.license?i&&i():"string"==typeof n&&0!=n.length?(n=Sh.decryption(n,"026685bf295f587b5dffc1f18d5dc27c"),e=Gh.encryption(e),n=Sh.decryption(n,e),-1!==t.indexOf(n)?i&&i():r&&r()):r&&r()},vi:function(t,n,e,i){var r;-1===n.indexOf("")&&-1===n.indexOf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")?(r=Gh.encryption("fengmap.localhost:"+t.appName),r=Sh.decryption(t.key,r),-1!==n.indexOf(r)?this.di(n,t.license,t.buildingID,function(){e&&e()},function(){i&&i()}):i&&i()):e&&e()},pi:function(t,n,e){var i=this;void 0===t.mapURL?(this.mi(t),this.gi(function(){new zu({method:"POST",url:gh.check,header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:i.yi(t)}).ti(function(){n&&n()},function(t){e&&e(t)},function(){n&&n()})},function(){n&&n()})):n&&n()},gi:function(t,n){new zu({method:"GET",url:gh.online}).ti(function(){t&&t()},function(){n&&n()},function(){n&&n()})},yi:function(t,n){var e=yh.a.global().location.host,i=e.indexOf(":");-1!=i&&(e=e.slice(0,i));i={mapId:t.buildingID,appName:t.appName};return n?i.keyValue=t.key:i.appKey=t.key,n?i.webUrl=e||Bh:i.webURL=e||Bh,i},mi:function(t){if("undefined"!=typeof navigator&&"undefined"!=typeof document){var n={};-1!=navigator.userAgent.indexOf("Opera")?n.userAgent="Opera":-1!=navigator.userAgent.indexOf("Firefox")?n.userAgent="FF":-1!=navigator.userAgent.indexOf("Chrome")?n.userAgent="Chrome":-1!=navigator.userAgent.indexOf("Safari")&&0===navigator.userAgent.indexOf("Chrome")?n.userAgent="Safari":-1!=navigator.userAgent.indexOf("compatible")&&-1!=navigator.userAgent.indexOf("MSIE")?n.userAgent="IE":-1!=navigator.userAgent.indexOf("Trident")&&(n.userAgent="Edge"),n.product="JS",n.sdkVersion=a+"."+h,n.appName=t.appName,n.appkey=t.key;var e=document.createElement("canvas").getContext("experimental-webgl"),t=e.getExtension("WEBGL_debug_renderer_info");n.gpu=t?e.getParameter(t.UNMASKED_RENDERER_WEBGL):null,n.os=navigator.platform;for(var i=!0,r=navigator.userAgent,o=new Array("Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"),s=0;s<o.length;s++)if(0<r.indexOf(o[s])){i=!1;break}n.device=i?"pc":"mobile",new zu({method:"POST",url:gh.collect,header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:n}).ti()}}});var Hh=new Qu;function Vh(t){return function(t){if(Array.isArray(t))return zh(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return zh(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?zh(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zh(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}hh=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(hh.prototype,{st:function(){},bi:function(t,n,e,i){var r;t.mapURL?(r=t.isPreview?t.mapURL+t.buildingID+n+".fmap":t.mapURL+t.buildingID+"/"+t.buildingID+n+".fmap",e&&e(r)):new zu({method:"POST",url:""==n?gh.download:gh.downloadTile+"/"+t.buildingID+n+".fmap",header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:Object.assign({newFlag:"2",keyType:3,isSeparate:!1},Hh.yi(t,!0))}).ti(function(t){e&&e(t.replace('"',"").replace('"',""))},function(t){i&&i(t)},function(t){i&&i(t)})},_i:function(e,i,r){var t=this;Hh.pi(e,function(){t.bi(e,"",function(t){new zu({method:"GET",responseType:"arraybuffer",url:t}).ti(function(t){var t=new Uint8Array(t),n=mh.ii(t),t=[];n.keys&&0!=n.keys.length?t.push.apply(t,Vh(n.keys)):t.push(n.key),Hh.vi(e,t,function(){i&&i(n)},function(t){r&&r(t)})},function(t){r&&r(t)},function(t){r&&r(t)})},function(t){r&&r(t)})},function(t){r&&r(t)})},wi:function(e,i,r){var t=this;Hh.pi(e,function(){t.bi(e,".scene",function(t){new zu({method:"GET",responseType:"arraybuffer",url:t}).ti(function(t){var t=new Uint8Array(t),n=mh.oi(t),t=[];n.keys&&0!=n.keys.length?t.push.apply(t,Vh(n.keys)):t.push(n.key),Hh.vi(e,t,function(){i&&i(n)},function(t){r&&r(t)})},function(t){r&&r(t)},function(t){r&&r(t)})},function(t){r&&r(t)})},function(t){r&&r(t)})},xi:function(t,n,e,i){this.bi(t,".floor."+n+".geo",function(t){new zu({method:"GET",responseType:"arraybuffer",url:t}).ti(function(t){t=new Uint8Array(t),t=mh.ai(t);e&&e(t)},function(t){i&&i(t)},function(t){i&&i(t)})},function(t){i&&i(t)})},Mi:function(t,n,e,i){this.bi(t,".floor."+n+".biz",function(t){new zu({method:"GET",responseType:"arraybuffer",url:t}).ti(function(t){t=new Uint8Array(t),t=mh.ci(t);e&&e(t)},function(t){i&&i(t)},function(t){i&&i(t)})},function(t){i&&i(t)})},Ei:function(t,n,e,i){this.bi(t,".floor."+n+".navi",function(t){new zu({method:"GET",responseType:"arraybuffer",url:t}).ti(function(t){t=new Uint8Array(t),t=mh.li(t);e&&e(t)},function(t){i&&i(t)})},function(t){i&&i(t)},function(t){i&&i(t)})}});var Wh=new hh;qu=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(qu.prototype,{Si:function(t,n){for(var e=[],i=0,r=0;r<t.length;r++){var o=t[r].idxs;if("number"==typeof(o=o||t[r]))for(;i<o;)e.push({x:n[i],y:n[i+1]}),i+=2;else for(var s=0;s<o.length;s++)for(var a=o[s];i<a;)e.push({x:n[i],y:n[i+1]}),i+=2}return e},Ti:function(t,n){for(var e=[],i=0,r=0;r<t.length;r++){var o=t[r].idxs;if("number"==typeof(o=o||t[r])){for(var s=[];i<o;)s.push({x:n[i],y:n[i+1]}),i+=2;e.push(s)}else for(var a=0;a<o.length;a++){for(var u=o[a],h=[];i<u;)h.push({x:n[i],y:n[i+1]}),i+=2;e.push(h)}}return e},Li:function(t,n){for(var e=[],i=[],r=0,o=0;o<t.length;o++){var s=t[o].idxs;if("number"==typeof(s=s||t[o]))for(;r<s;)e.push({x:n[r],y:n[r+1]}),r+=2;else for(var a=0;a<s.length;a++)if(0===a)for(var u=s[a];r<u;)e.push({x:n[r],y:n[r+1]}),r+=2;else{for(var h=[],c=s[a];r<c;)h.push({x:n[r],y:n[r+1]}),r+=2;i.push(h)}}var f=[];return f.push(e),f.push.apply(f,i),f},Oi:function(t){for(var n=[],e=t.length,i=0;i<e;i++){for(var r=t[i],o={x:this.Ri(r.x),y:this.Ri(r.y)},s=n.length,a=!1,u=0;u<s;u++){var h=n[u];if(h.x==o.x&&h.y==o.y){a=!0;break}}a||n.push(o)}return n},Ri:function(t){return+t.toFixed(2)}});var Xh=new qu;var Yh=Yh||{};Yh.G1="MULTIPOLYGON(((",Yh.G2="POINT(",Yh.G3="MULTILINESTRING((",Yh.GLEN1="MULTIPOLYGON(((".length,Yh.GLEN2="POINT(".length,Yh.GLEN3="MULTILINESTRING((".length;oh=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(oh.prototype,{Si:function(t){var n=[];if(0!=t.indexOf(Yh.G2))return[];t=t.substring(Yh.GLEN2,t.length-1).split(" ");return n.push({x:parseFloat(t[0]),y:parseFloat(t[1])}),n},Ti:function(t){if(0!=t.indexOf(Yh.G3))return[];for(var n=t.substring(Yh.GLEN3,t.length-2).split(","),e=[],i=0;i<n.length;i++){var r=n[i].split(" ");e.push({x:parseFloat(r[0]),y:parseFloat(r[1])})}return[e]},Li:function(t){var n=[],e=[];if(0!=t.indexOf(Yh.G1))return[];for(var i=t.substring(Yh.GLEN1,t.length-3).split(/\),\(/),r=0;r<i.length;r++){var o=i[r].split(/,/);if(0==r)for(var s=0;s<o.length;s++){var a=o[s].split(" ");n.push({x:parseFloat(a[0]),y:parseFloat(a[1])})}else{for(var u=[],h=0;h<o.length;h++){var c=o[h].split(" ");u.push({x:parseFloat(c[0]),y:parseFloat(c[1])})}e.push(u)}}t=[];return t.push(n),t.push.apply(t,e),t},Oi:function(t){for(var n=[],e=t.length,i=0;i<e;i++){for(var r=t[i],o={x:this.Ri(r.x),y:this.Ri(r.y)},s=n.length,a=!1,u=0;u<s;u++){var h=n[u];if(h.x==o.x&&h.y==o.y){a=!0;break}}a||n.push(o)}return n},Ri:function(t){return+t.toFixed(2)}});var Zh=new oh,ih={NONE:0,POINT:1,LINE:2,POLYGON:4,MULTIPOINT:8,MULTILINE:16,MULTIPOLYGON:32,GROUP:64,EXTENT:1024,EXTERNALMODEL:2048,MODEL:4096,FACILITY:8192,LABEL:16384,EXTENTGROUP:1<<20,EXTERNALMODELGROUP:1<<21,MODELGROUP:1<<22,FACILITYGROUP:1<<23,LABELGROUP:1<<24};Object.freeze(ih);var qh=ih,Zu={STOP:0,PASS:1,PUSH:2};Object.freeze(Zu);var Kh=Zu;function Jh(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}pi=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Ai={x:Number.MAX_VALUE,y:Number.MAX_VALUE},this.Ci={x:-Number.MAX_VALUE,y:-Number.MAX_VALUE}}var n,e,i;return n=t,(e=[{key:"min",get:function(){return this.Ai}},{key:"max",get:function(){return this.Ci}},{key:"center",get:function(){var t={x:Number.NaN,y:Number.NaN};return this.ki()&&(t.x=(this.Ai.x+this.Ci.x)/2,t.y=(this.Ai.y+this.Ci.y)/2),t}},{key:"size",get:function(){var t={x:Number.NaN,y:Number.NaN};return this.ki()&&(t.x=this.Ci.x-this.Ai.x,t.y=this.Ci.y-this.Ai.y),t}},{key:"toObject",value:function(){return{min:this.Ai,max:this.Ci,center:this.center,size:this.size}}}])&&Jh(n.prototype,e),i&&Jh(n,i),t}();Object.assign(pi.prototype,{ki:function(){return!(this.Ai.x>this.Ci.x||this.Ai.y>this.Ci.y)},Pi:function(t){t&&t.ki()&&(t.Ai.x<this.Ai.x&&(this.Ai.x=t.Ai.x),t.Ai.y<this.Ai.y&&(this.Ai.y=t.Ai.y),t.Ci.x>this.Ci.x&&(this.Ci.x=t.Ci.x),t.Ci.y>this.Ci.y&&(this.Ci.y=t.Ci.y))},Di:function(t){var n=this;t&&0!=t.length&&t.forEach(function(t){t.x<n.Ai.x&&(n.Ai.x=t.x),t.y<n.Ai.y&&(n.Ai.y=t.y),t.x>n.Ci.x&&(n.Ci.x=t.x),t.y>n.Ci.y&&(n.Ci.y=t.y)})}});var Qh=pi;function $h(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return tc(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?tc(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function tc(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function nc(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}ka=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.Tn=qh.GROUP,this.yt=new Map,this.Cn=-1,this.ji=null,this.Ni=null,Object.assign(this,t)}var t,e,i;return t=n,(e=[{key:"getType",value:function(){return this.Tn}},{key:"getCoordinates",value:function(){return this.ji}},{key:"getBound",value:function(){return this.Ni||this.Ii(),this.Ni}},{key:"getChildren",value:function(){return this.yt}}])&&nc(t.prototype,e),i&&nc(t,i),n}();Object.assign(ka.prototype,{st:function(){var t,n=$h(this.yt.values());try{for(n.s();!(t=n.n()).done;){var e=t.value;e.st&&e.st()}}catch(t){n.e(t)}finally{n.f()}this.yt.clear()},Fi:function(n){var t=n.Ui(this);t==Kh.PASS?this.yt.forEach(function(t){t.Fi(n)}):t==Kh.PUSH&&n.Gi.push(this)},Ii:function(){var n=this;this.Ni=new Qh,0!=this.yt.size&&this.yt.forEach(function(t){n.Ni.Pi(t.getBound())})}});var ec=ka;function ic(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}ki=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.Cn=t.eid,this.Tn=qh.POINT,this.ji=null,this.Ni=null,Object.assign(this,t)}var t,e,i;return t=n,(e=[{key:"getType",value:function(){return this.Tn}},{key:"getCoordinates",value:function(){return this.ji}},{key:"getBound",value:function(){return this.Ni||this.Ii(),this.Ni}}])&&ic(t.prototype,e),i&&ic(t,i),n}();Object.assign(ki.prototype,{Ii:function(){this.Ni=new Qh,this.ji&&this.Ni.Di(this.ji)},Fi:function(t){t.Ui(this)==Kh.PUSH&&t.Gi.push(this)}});var rc=ki;function oc(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}ah=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.Cn=t.eid,this.Tn=qh.POLYGON,this.Nt=null,this.ji=null,this.Ni=null,Object.assign(this,t)}var t,e,i;return t=n,(e=[{key:"getType",value:function(){return this.Tn}},{key:"getCenter",value:function(){return this.Nt}},{key:"getCoordinates",value:function(){return this.ji}},{key:"getBound",value:function(){return this.Ni||this.Ii(),this.Ni}}])&&oc(t.prototype,e),i&&oc(t,i),n}();Object.assign(ah.prototype,{Ii:function(){var n=this;this.Ni=new Qh,this.ji&&this.ji.forEach(function(t){n.Ni.Di(t)})},Fi:function(t){t.Ui(this)==Kh.PUSH&&t.Gi.push(this)}});var sc=ah;function ac(t,n){if(null==t)return{};var e,i=function(t,n){if(null==t)return{};var e,i,r={},o=Object.keys(t);for(i=0;i<o.length;i++)e=o[i],0<=n.indexOf(e)||(r[e]=t[e]);return r}(t,n);if(Object.getOwnPropertySymbols)for(var r=Object.getOwnPropertySymbols(t),o=0;o<r.length;o++)e=r[o],0<=n.indexOf(e)||Object.prototype.propertyIsEnumerable.call(t,e)&&(i[e]=t[e]);return i}e=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Bi=[1,2,3,4],this.Hi=[6,7,9],this.Vi=[31,32],this.zi=new Map,this.zi.set(31,qh.EXTENTGROUP),this.zi.set(32,qh.MODELGROUP),this.zi.set(6,qh.FACILITYGROUP),this.zi.set(7,qh.LABELGROUP),this.zi.set(9,qh.EXTERNALMODELGROUP),this.Wi=new Map,this.Wi.set(31,["extentLayer",null]),this.Wi.set(32,["modelLayer","labelLayer"]),this.Wi.set(6,["poiLayer",null]),this.Wi.set(7,["labelLayer",null]),this.Wi.set(9,["externalModelLayer",null])};Object.assign(e.prototype,{Xi:function(t){if(!t.buffers||0===t.buffers.length)return null;var n=mh.ri(t);return this.Yi(n,t)},Yi:function(e,i){var r=this,t=e.layerGroups,n=ac(e,["layerGroups"]),o=new ec(n);return t.forEach(function(t){var n=r.Zi(t,i,e.fileVer);o.yt.set(t.gid,n)}),o},Zi:function(t,n,e){var i=this,r=t.layers,o=ac(t,["layers"]),s=new ec(o),a=n?mh.si(n,t.gid):null,u=n?mh.ui(n,t.gid):null;return r.forEach(function(t){var n=i.qi(t,a,u,e);null!=n&&s.yt.set(i.zi.get(t.ltype),n)}),this.Ki(s),s},Ki:function(t){var n=Array.from(t.yt);n.sort(function(t,n){return t[0]-n[0]}),t.yt=new Map(n)},qi:function(t,n,e,i){if(-1!=this.Bi.indexOf(t.ltype))return null;if(!this.Wi.get(t.ltype))return null;var r=new ec(t);return this.Ji(r,n,e,i),r&&(r.Tn=this.zi.get(t.ltype)),r},Ji:function(t,n,e,i){if(t){var r=this.Wi.get(t.ltype);if(r){var o=n?n[r[0]]:[],s=e?e[r[0]]:[];switch(t.ltype){case 6:this.Qi(t,o,s,i,qh.FACILITY);break;case 7:this.Qi(t,o,s,i,qh.LABEL);break;case 9:this.Qi(t,o,s,i,qh.EXTERNALMODEL);break;case 31:this.$i(t,o,s,i,qh.EXTENT,null);break;case 32:this.$i(t,o,s,i,qh.MODEL,n?n[r[1]]:null)}}}},Qi:function(t,n,e,i,r){for(var o=0;o<n.length;o++){var s=this.tr(n[o],e[o],i);s.Tn=r,t.yt.set(n[o].eid,s)}},tr:function(t,n,e){n=Object.assign({},n,{area:t.area,eid:t.eid,height:t.height}),n=new rc(n);return t.coordinates?n.ji=t.coordinates:(n.ji=1==e?Zh.Si(t.geo):Xh.Si(t.idxs,t.pts),t.coordinates=n.ji),n},$i:function(t,n,e,i,r,o){for(var s=0;s<n.length;s++){var a=this.nr(n[s],e[s],i,o?o[s]:null);a.Tn=r,t.yt.set(n[s].eid,a)}},nr:function(t,n,e,i){n=Object.assign({},n,{area:t.area,eid:t.eid,height:t.height}),n=new sc(n);return n.ji=1==e?Zh.Li(t.geo):Xh.Li(t.idxs,t.pts),i&&(i.coordinates||(i.coordinates=1==e?Zh.Si(i.geo):Xh.Si(i.idxs,i.pts)),n.Nt=i.coordinates[0]),n}});var uc=new e;function hc(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Qu=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.er=new Map,this.ir=new Map,this.$e=new Map,this.rr=new Map,this.or=new Map,this.sr=new Map,this.ar=[2,3],this.ur=!1}var n,e,i;return n=t,(e=[{key:"load",value:function(t,n){this.hr(t,n)}},{key:"loadWhole",value:function(t,n){this.cr(t,n)}},{key:"getDecode",value:function(t){t=void 0!==t.buildingID?t.buildingID:t.mapID;return this.fr({buildingID:t})}},{key:"getData",value:function(t){t=void 0!==t.buildingID?t.buildingID:t.mapID;return this.er.get(t)}}])&&hc(n.prototype,e),i&&hc(n,i),t}();Object.assign(Qu.prototype,{st:function(){this.er.clear(),this.er=null,this.ir.clear(),this.ir=null,this.$e.clear(),this.$e=null,this.rr.clear(),this.rr=null,this.or.clear(),this.or=null,this.sr.clear(),this.sr=null},lr:function(t){this.rr.set(t.buildingID,null),this.or.set(t.buildingID,null),this.sr.set(t.buildingID,0)},hr:function(a,u){var h=this;this.lr(a),this.wi(a,function(t,n){u&&u(t,n);var e=h.dr(a),i=a.level||parseInt(e.defGid);h.vr(a,i,u);for(var r=a.visibleLevels||e.levels,o=0;o<r.length;o++)r[o]!=i&&h.vr(a,r[o],u);if(a.preLoad)for(var s=0;s<e.levels.length;s++)e.levels[s]!=i&&-1==r.indexOf(e.levels[s])&&h.vr(a,e.levels[s],u)},function(t,n){u&&u(t,n)})},wi:function(n,e,i){var r=this,t=this.dr(n);t?(e&&e("scene",t),n.justDecode||(t=this.er.get(n.buildingID),e&&e("building",t))):Wh.wi(n,function(t){r.ir.set(n.buildingID,{scene:t}),e&&e("scene",t),n.justDecode||(t=uc.Yi(t),r.er.set(n.buildingID,t),e&&e("building",t))},function(t){i&&i("error",t)})},vr:function(t,n,e,i){var r=this.rr.get(t.buildingID);r||this.rr.set(t.buildingID,r=[]),i?r.unshift(n):r.push(n),this.ur&&1!=r.length||this.pr(t,e)},pr:function(i,r){var o=this,s=this.dr(i);if(s){var a=this.rr.get(i.buildingID),t=this.or.get(i.buildingID);if(a&&0!=a.length){var u=a[0];if(t||this.or.set(i.buildingID,t=[]),-1!=t.indexOf(u))return a.splice(a.indexOf(u),1),void this.pr(i,r);t.push(u),this.mr(i,u,function(t,n){var e=o.sr.get(i.buildingID);"layerGroup"==t&&(r&&r(t,n),o.sr.set(i.buildingID,++e),e==s.layerGroups.length&&r&&r("decode",o.fr(i)),a.splice(a.indexOf(u),1),o.pr(i,r)),"layer"==t&&r&&r(t,n),"floor"==t&&(r&&r(t,n),e==s.layerGroups.length&&r&&r("complete",o.gr(i)))},function(t,n){r&&r(t,n)})}}},mr:function(n,e,i,r){function o(t){u==++h&&(i&&i("layerGroup",c),n.justDecode||((t=t.Ft(n,e)).yt.forEach(function(t){uc.Ji(t,c.get("geo"),c.get("biz"),a.fileVer),i&&i("layer",t)}),i&&i("floor",t)))}var s=this,a=this.dr(n),t=this.yr(a,e).gname,u=n.loadNavi?this.ar[1]:this.ar[0],h=0,c=new Map;this.xi(n,e,t,function(t,n){c.set(t,n),i&&i(t,n),o(s)},function(t){r&&r(t)}),this.Mi(n,e,t,function(t,n){c.set(t,n),i&&i(t,n),o(s)},function(t){r&&r(t)}),n.loadNavi&&this.Ei(n,e,t,function(t,n){c.set(t,n),i&&i(t,n),o(s)},function(t){r&&r(t)})},xi:function(n,e,t,i,r){var o=this,s=this.br(n,e,"geo");s?i&&i("geo",s):Wh.xi(n,t,function(t){o._r(n,e,"geo",t),i&&i("geo",t)},function(t){r&&r("error",t)})},Mi:function(n,e,t,i,r){var o=this,s=this.br(n,e,"biz");s?i&&i("biz",s):Wh.Mi(n,t,function(t){o._r(n,e,"biz",t),i&&i("biz",t)},function(t){r&&r("error",t)})},Ei:function(n,e,t,i,r){var o=this,s=this.br(n,e,"navi");s?i&&i("navi",s):Wh.Ei(n,t,function(t){o._r(n,e,"navi",t),i&&i("navi",t)},function(t){r&&r("error",t)})},cr:function(t,e){this._i(t,function(t,n){e&&e(t,n)},function(t,n){e&&e(t,n)})},_i:function(n,e,i){var r=this,t=this.fr(n);t?e&&e("decode",t):Wh._i(n,function(t){r.wr(n,t),e&&e("decode",r.fr(n)),n.justDecode||(t=uc.Xi(t),r.er.set(n.buildingID,t),e&&e("complete",t))},function(t){i&&i("error",t)})},gr:function(t){if(this.er){t=this.er.get(t.buildingID);return t||null}},Ft:function(t,n){t=this.er.get(t.buildingID);return t?t.yt.get(n):null},wr:function(t,n){var e={scene:null,floors:new Map},i=mh.ri(n);e.scene=i;for(var r=0;r<i.layerGroups.length;r++){var o=i.layerGroups[r],s=mh.si(n,o.gid),a=mh.ui(n,o.gid),u=mh.fi(n,o.gid),h=new Map;h.set("geo",s),h.set("biz",a),h.set("navi",u),e.floors.set(o.gid,h)}this.ir.set(t.buildingID,e)},fr:function(t){var n=this.ir.get(t.buildingID);if(!n)return null;for(var e=n.scene,i=new Map,n={scene:e,floors:i},r=0;r<e.layerGroups.length;r++){var o=e.layerGroups[r],s=o.gid,a={gid:s,gname:o.gname,level:s,geo:[],biz:[],navi:[]};a.geo.push(this.br(t,s,"geo")),a.biz.push(this.br(t,s,"biz")),a.navi.push(this.br(t,s,"navi")),i.set(o.gid,a)}return n},dr:function(t){t=this.ir.get(t.buildingID);return t?t.scene:null},_r:function(t,n,e,i){var r=this.ir.get(t.buildingID);r&&((t=r.floors)||(t=new Map,r.floors=t),(r=t.get(n))||(r=new Map,t.set(n,r)),r.set(e,i))},br:function(t,n,e){t=this.ir.get(t.buildingID);if(!t)return null;t=t.floors;if(!t)return null;n=t.get(n);return n?n.get(e):null},yr:function(t,n){if(null==t)return null;for(var e=t.layerGroups,i=0;i<e.length;i++)if(e[i].gid==n)return e[i];return null}});var cc=Qu;nr.fmcommon={diffuse:{value:new _i(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new x}},nr.line={lineWidth:{value:1},resolution:{value:new ii(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},mmap:{value:null},offset:{value:new ii(0,0)},repeat:{value:new ii(1,1)},miny:{value:0},pcolor:{value:new _i(11447982)}},Ao.line={uniforms:Xr.merge([nr.fmcommon,nr.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\n\t\tuniform float lineWidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute float uvyStart;\n\t\tattribute float uvyEnd;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\t\tattribute vec2 uv2;\n\n\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vUv2;\n\t\tvarying float uvScale;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\t\t\t\n\t\t\tfloat duvy = uvyEnd - uvyStart;\n\t\t\tfloat uvy = uvyStart + duvy * uv2.y;\n\t\t\t// vUv2 = vec2(uv2.x ,uvy);\n\t\t\tvUv2 = ( position.y < 0.5 ) ? vec2(uv2.x ,uvyStart) : vec2(uv2.x ,uvyEnd);\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tfloat scaleDir = length(dir);\n\t\t\tuvScale = 0.05/scaleDir;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for lineWidth\n\t\t\toffset *= lineWidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform vec2 repeat;\n\t\tuniform vec2 offset;\n\t\tuniform float miny;\n\t\tuniform vec3 pcolor;\n\t\t\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\t\tuniform sampler2D mmap;\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\n\t\tvarying float uvScale;\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vUv2;\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\n\t\t\t#ifdef USE_MMAP\n\t\t\t\n\t\t\t\tif(vUv2.y>=miny){\t\t\t\n\t\t\t\t vec4 texColor = texture2D( mmap, vUv2 * repeat + offset );\n\t\t\t\t\tdiffuseColor = vec4(texColor.xyz,min(texColor.w, opacity));\n\t\t\t\t}else{\n\t\t\t\t\tdiffuseColor = vec4(pcolor,opacity);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t#endif\n\n\t\t\tgl_FragColor = diffuseColor;\n\n\t\t\t#include <encodings_fragment>\n\n\t\t}\n\t\t"};hh=function(t){qr.call(this,{type:"FMLineMaterial",uniforms:Xr.clone(Ao.line.uniforms),vertexShader:Ao.line.vertexShader,fragmentShader:Ao.line.fragmentShader}),this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value.copy(t)}},lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},pcolor:{enumerable:!0,get:function(){return this.uniforms.pcolor.value},set:function(t){this.uniforms.pcolor.value.copy(t)}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}}}),this.setValues(t)};((hh.prototype=Object.create(qr.prototype)).constructor=hh).prototype.isFMLineMaterial=!0,hh.prototype.copy=function(t){return qr.prototype.copy.call(this,t),this.color.copy(t.color),this.lineWidth=t.lineWidth,this.resolution=t.resolution,this};var fc=hh;function lc(t){Vr.call(this),this.type="SpriteMaterial",this.color=new _i(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}function dc(t){qr.call(this,t),this.type="RawShaderMaterial"}((lc.prototype=Object.create(Vr.prototype)).constructor=lc).prototype.isSpriteMaterial=!0,lc.prototype.copy=function(t){return Vr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this},((dc.prototype=Object.create(qr.prototype)).constructor=dc).prototype.isRawShaderMaterial=!0;qu=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Mr=!1,this.Er=new Map,this.Sr=new Map};Object.assign(qu.prototype,{Tr:function(t,n){this.Sr.has(t)||this.Sr.set(t,new Set),this.Sr.get(t).add(n)},Ie:function(){this.Er.clear(),this.Er=null,this.Sr.clear(),this.Sr=null}});var vc=qu;function pc(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var mc=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"getBrowser",value:function(){var t=navigator.userAgent,n=-1<t.indexOf("Opera"),e=-1<t.indexOf("compatible")&&-1<t.indexOf("MSIE")&&!n,i=-1<t.indexOf("Edge"),r=-1<t.indexOf("Firefox"),o=-1<t.indexOf("Safari")&&-1===t.indexOf("Chrome"),s=-1<t.indexOf("Chrome")&&-1<t.indexOf("Safari");if(e){new RegExp("MSIE (\\d+\\.\\d+);").test(t);t=parseFloat(RegExp.$1);return 7===t?"IE7":8===t?"IE8":9===t?"IE9":10===t?"IE10":11===t?"IE11":"IE"}return n?"Opera":i?"Edge":r?"FF":o?"Safari":s?"Chrome":void 0}}],(e=null)&&pc(n.prototype,e),i&&pc(n,i),t}().getBrowser();function gc(t){return(gc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yc(t,n){return(yc=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function bc(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=_c(e);return t=i?(t=_c(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==gc(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function _c(t){return(_c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}oh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&yc(t,n)}(n,vc);var t=bc(n);function n(){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this)}return n}();Object.assign(oh.prototype,{Lr:function(t,n){var e;return this.Er.has(t)?(e=this.Er.get(t),n&&(e.complete?n(e):this.Tr(t,n))):e=this.Or(t,n),e},Or:function(t,n){var e=this,i=new Image;return i.crossOrigin="Anonymous",i.onload="IE11"===mc?new function(){e.Rr(t,i)}:function(){e.Rr(t,i)},i.src=t,this.Er.set(t,i),n&&this.Tr(t,n),i},Rr:function(t,i){this.Sr.has(t)&&(this.Sr.get(t).forEach(function(t,n,e){n(i),e.delete(t)}),this.Sr.delete(t))}});var wc=new oh,xc={Left:0,Center:2,Right:4};function Mc(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Ec(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ec(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Ec(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}ih=function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.gt=n};Object.assign(ih.prototype,{Ar:function(t,n,e,i,r){var o=r,s={x:r.x+n,y:r.y},a={x:r.x,y:r.y+e},u={x:r.x+n,y:r.y+e},h={x:o.x+i,y:o.y},c={x:s.x-i,y:s.y},f={x:s.x,y:s.y+i},l={x:u.x,y:u.y-i},d={x:u.x-i,y:u.y},n={x:a.x+i,y:a.y},r={x:a.x,y:a.y-i},e={x:o.x,y:o.y+i};t.beginPath(),t.moveTo(h.x,h.y),t.lineTo(c.x,c.y),t.arcTo(s.x,s.y,f.x,f.y,i),t.lineTo(l.x,l.y),t.arcTo(u.x,u.y,d.x,d.y,i),t.lineTo(n.x,n.y),t.arcTo(a.x,a.y,r.x,r.y,i),t.lineTo(e.x,e.y),t.arcTo(o.x,o.y,h.x,h.y,i),t.closePath()},Cr:function(t,n,e,i){var r,o=void 0!==i.needSize&&i.needSize,s=this.kr(i.family),a=4,u=0,h=0,c=2*e.fontsize*1.2,f=c+"px "+s,l=1.2*e.fontsize*2,d=1;n||(l=0,a=10);var v=document.createElement("canvas"),p=v.getContext("2d");p.font=f;var m=-1<t.indexOf("%rn%");if(m){var g,y,b=Mc(g=t.split("%rn%"));try{for(b.s();!(y=b.n()).done;){var _=y.value,u=Math.max(p.measureText(_).width,u);h+=c}}catch(t){b.e(t)}finally{b.f()}h+=4*(g.length-1),r=u+a+l+12,d=(S=Math.max(h,l)+12)/(12+c)}else r=12+l+a+(u=p.measureText(t).width),S=12+Math.max(c,l);v.spriteScale=d,v.width=r,v.height=S,v.style.width=r+"px",v.style.height=S+"px",p.clearRect(0,0,v.width,v.height),(e.plateColor||e.plateStrokeColor)&&(e.plateColor&&(p.fillStyle=e.plateColor),p.lineWidth=2,this.Ar(p,r-l,S,10,{x:l,y:0}),e.plateColor&&p.fill(),e.plateStrokeColor&&(p.strokeStyle=e.plateStrokeColor,p.stroke()),p.beginPath()),n&&p.drawImage(n,6,(S-l)/2,l,l);var w=l+a,s=(S-c)/2;p.font=f,p.textBaseline="top";p.lineWidth=4*(e.strokeWidth||1);d=1;e.strokeWidth&&(d=parseFloat(e.strokeWidth));var x,l=0,M=!1,E=navigator.mimeTypes;for(x in E)"application/vnd.chromium.remoting-viewer"==E[x].type&&(M=!0);M&&(l=-4-(c-28)/6);var a=!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),S=navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS");(-1<navigator.userAgent.indexOf("Edge")||a||S)&&(l=-4-(c-28)/6),(-1<navigator.userAgent.indexOf("QQBrowser")||a||S)&&(l=-4-(c-28)/6),(-1<navigator.userAgent.indexOf(".NET4.0C")||a||S)&&(l=-4-(c-28)/6),l*=2;f=0;if(!this.is_Weixin||this.is_WeixinMini||a||S||(f=10),e.strokeColor&&0!==d)if(p.strokeStyle=e.strokeColor,m)for(var T=6,L=0;L<g.length;L++)L&&(T+=4+c),n?p.strokeText(g[L],w,T):i.textAlign===xc.Left?(p.textAlign="left",p.strokeText(g[L],0,T)):i.textAlign===xc.Right?(p.textAlign="right",p.strokeText(g[L],r,T)):(p.textAlign="center",p.strokeText(g[L],r/2,T));else n?p.strokeText(t,w,3+s+l+f):i.textAlign===xc.Left?p.strokeText(t,0,3+s+l+f):i.textAlign===xc.Right?(p.textAlign="right",p.strokeText(t,r,3+s+l+f)):(p.textAlign="center",p.strokeText(t,r/2,3+s+l+f));if(p.fillStyle=e.fillColor,m)for(var O=6,R=0;R<g.length;R++)R&&(O+=4+c),n?p.fillText(g[R],w,O):i.textAlign===xc.Left?(p.textAlign="left",p.fillText(g[R],0,O)):i.textAlign===xc.Right?(p.textAlign="right",p.fillText(g[R],r,O)):(p.textAlign="center",p.fillText(g[R],r/2,O));else n?p.fillText(t,w,3+s+l+f):i.textAlign===xc.Left?(p.textAlign="left",p.fillText(t,0,3+s+l+f)):i.textAlign===xc.Right?(p.textAlign="right",p.fillText(t,r,3+s+l+f)):(p.textAlign="center",p.fillText(t,r/2,3+s+l+f));f=0;return o&&(f=m?e.fontsize+(4*(g.length-1)+6)/g.length:e.fontsize+6,v.size=f),v},Pr:function(t){var n=t.width,e=t.height,i=t.arrowWidth||10,r=document.createElement("canvas"),o=r.getContext("2d");r.width=n,r.height=e,r.style.width=n+"px",r.style.height=e+"px",o.fillStyle=t.godEdgeColor,o.fillRect(0,0,n,e);var s=n*(1-t.godEdgePercent);o.fillStyle=t.godColor,o.fillRect((n-s)/2,0,s,e),o.fillStyle="#ffffff",o.shadowOffsetX=-2,o.shadowOffsetY=2,o.shadowBlur=4,o.shadowColor="rgba(0,0,0,0.5)";var a=e*t.godArrowPercent,s=s*t.godArrowWidthPercent,n=n/2-s/2,e=e/2+a/2;return o.beginPath(),o.moveTo(n,e),o.lineTo(n,e+i),o.lineTo(n+s/2,e-a+i),o.lineTo(n+s,e+i),o.lineTo(n+s,e),o.lineTo(n+s/2,e-a),o.closePath(),o.fillStyle=t.godArrowColor,o.fill(),r},Dr:function(t){var n=t.width,e=t.height,i=document.createElement("canvas"),r=i.getContext("2d");i.width=n,i.height=e,i.style.width=n+"px",i.style.height=e+"px";var o=new x;o.set(Math.cos(Math.PI/2),-Math.sin(Math.PI/2),+n/2,Math.sin(Math.PI/2),Math.cos(Math.PI/2),+e/2,0,0,1);var s=new x;s.set(1,0,-n/2,0,1,-e/2,0,0,1),o.multiply(s);e=o.elements;r.transform(e[0],e[3],e[1],e[4],e[2],e[6]);s=t.height*t.arrowHeightPercent,o=(1-t.arrowHeightPercent)*t.height/2,e=t.width*(t.arrowWidthPercent-t.arrowPercent);return r.beginPath(),r.moveTo(0,o),r.lineTo(e,o),r.lineTo(t.width*t.arrowWidthPercent,o+s/2),r.lineTo(e,o+s),r.lineTo(0,o+s),r.lineTo(t.width*t.arrowPercent,o+s/2),r.closePath(),r.fillStyle=t.color,r.fill(),i},jr:function(e){var t=e.width,n=e.height,i=e.dashArray,r=document.createElement("canvas"),o=r.getContext("2d");r.width=t,r.height=n,r.style.width=t+"px",r.style.height=n+"px";var s=new x;s.set(Math.cos(Math.PI/2),-Math.sin(Math.PI/2),+t/2,Math.sin(Math.PI/2),Math.cos(Math.PI/2),+n/2,0,0,1);var a=new x;a.set(1,0,-t/2,0,1,-n/2,0,0,1),s.multiply(a);s=s.elements;o.transform(s[0],s[3],s[1],s[4],s[2],s[6]);var u=i.reduce(function(t,n){return t+n}),h=0;return i.forEach(function(t,n){n%2==0&&(o.fillStyle=e.color,o.fillRect(h/u*e.width,0,t/u*e.width,e.height)),h+=t}),r},Nr:function(t){for(var n=this.gt;n;){if(n instanceof t)return n;n=n.gt}return null},kr:function(t){var n=this.Nr(Xm);return void 0!==t?t+","+n.Et.fontFamily:n.Et.fontFamily},st:function(){}});var Sc=ih;function Tc(t){return(Tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lc(t,n){return(Lc=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Oc(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Rc(e);return t=i?(t=Rc(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Tc(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Rc(t){return(Rc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Zu=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Lc(t,n)}(n,vc);var t=Oc(n);function n(){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this)}return n}();Object.assign(Zu.prototype,{Ir:function(t){var n,e=[];for(n in t)e.push(t[n]);return e.join()}});var Ac=Zu;function Cc(t){return(Cc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kc(t,n){return(kc=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Pc(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Dc(e);return t=i?(t=Dc(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Cc(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Dc(t){return(Dc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}pi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&kc(t,n)}(n,Ac);var t=Pc(n);function n(){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this)}return n}();Object.assign(pi.prototype,{Fr:function(t){t=new xu(t);return t.minFilter=xn,t.generateMipmaps=!1,t},Ur:function(t){var n=new $i;return n.minFilter=xn,n.generateMipmaps=!1,n.flipY=t.flipY,n},Gr:function(t,n){var i,e=this;void 0===t.flipY&&(t.flipY=!0);var r=this.Ir(t);return this.Er.has(r)?this.Sr.has(r)?this.Tr(r,n):n(i=this.Er.get(r)):(i=this.Ur(t),this.Er.set(r,i),this.Tr(r,n),wc.Lr(t.url,function(t){i.image=t,i.needsUpdate=!0,e.Sr.get(r).forEach(function(t,n,e){n(i),e.delete(t)}),e.Sr.delete(r)})),i},Br:function(t,n){var e=this.Fr(t);return e.scaleRatio=t.height/t.width,e.mspriteScale=t.spriteScale,n.needSize&&(e.size=t.size),e},st:function(){this.Er.forEach(function(t,n,e){n.dispose(),e.delete(t)}),this.Er.clear(),this.Er=null,this.Sr.forEach(function(t,n,e){n.forEach(function(t,n,e){t.dispose(),e.delete(n)}),e.delete(t)}),this.Sr.clear(),this.Sr=null}});var jc=pi;nr.fmcommon={diffuse:{value:new _i(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new x}},Ao.fmLambert={uniforms:Xr.merge([nr.fmcommon,nr.lights,{emissive:{value:new _i(0)},mapMixColor:{value:!1}}]),vertexShader:"\n#define LAMBERT\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n \n#include <common> \n#include <uv_pars_vertex> \n#include <bsdfs> \n#include <lights_pars_begin> \n\nvoid main() {\n\n\t#include <uv_vertex> \n\n\t#include <beginnormal_vertex> \n\t#include <morphnormal_vertex> \n\t#include <defaultnormal_vertex> \n\n\t#include <begin_vertex> \n\t#include <project_vertex> \n\n\t#include <worldpos_vertex> \n\t#include <lights_lambert_vertex> \n}\n",fragmentShader:"\nuniform bool mapMixColor;\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n\n#include <common> \n#include <packing> \n#include <uv_pars_fragment> \n#include <map_pars_fragment> \n#include <bsdfs> \n#include <lights_pars_begin> \n\nvoid main() {\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <map_fragment_1> \n\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\n\t#endif\n\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\n\t#else\n\n\t\treflectedLight.directDiffuse = vLightFront;\n\n\t#endif\n\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}\n"};ka=function(t){qr.call(this),this.type="FMMeshLambertMaterial",this.uniforms=Xr.clone(Ao.fmLambert.uniforms),this.vertexShader=Ao.fmLambert.vertexShader,this.fragmentShader=Ao.fmLambert.fragmentShader,this.lights=!0,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},emissive:{enumerable:!0,get:function(){return this.uniforms.emissive.value},set:function(t){this.uniforms.emissive.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},mapMixColor:{enumerable:!0,get:function(){return this.uniforms.mapMixColor.value},set:function(t){this.uniforms.mapMixColor.value=t}}}),this.setValues(t)};((ka.prototype=Object.create(qr.prototype)).constructor=ka).prototype.isFMMeshLambertMaterial=!0,ka.prototype.copy=function(t){return qr.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Xr.clone(t.uniforms),this.lights=t.lights,this};var Nc=ka;function Ic(t){qr.call(this),this.type="FMMeshBasicMaterial",this.uniforms=Xr.clone(Ao.fmBasic.uniforms),this.vertexShader=Ao.fmBasic.vertexShader,this.fragmentShader=Ao.fmBasic.fragmentShader,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}}}),this.setValues(t)}nr.fmcommon={diffuse:{value:new _i(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new x}},Ao.fmBasic={uniforms:Xr.merge([nr.fmcommon]),vertexShader:"\n#include <common> \n#include <uv_pars_vertex> \n\nvoid main() {\n\n\t#include <uv_vertex> \n\n\t#include <begin_vertex> \n\t#include <project_vertex> \n\n\t#include <worldpos_vertex> \n}\n",fragmentShader:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common> \n#include <uv_pars_fragment> \n#include <map_pars_fragment> \n\nvoid main() {\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <map_fragment> \n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t#ifdef USE_LIGHTMAP\n\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n \n}\n"},((Ic.prototype=Object.create(qr.prototype)).constructor=Ic).prototype.isFMMeshBasicMaterial=!0,Ic.prototype.copy=function(t){return qr.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Xr.clone(t.uniforms),this};ki=function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.gt=n,this.Hr=new Sc(this),this.Vr=new jc,this.zr={},this.Wr=new Map,this.Xr=new Map,this.Yr=new Map,this.Zr=new Map};Object.assign(ki.prototype,{qr:function(t){var n,e=[];for(n in t)e.push(t[n]);return e.join()},Kr:function(t){var n=this.qr(t);return this.Wr.has(n)||(t=this.Jr(t),this.Wr.set(n,t)),this.Wr.get(n)},Jr:function(t,n){var e=new Ic;void 0!==t.color&&(e.color=new _i(t.color)),void 0!==t.opacity&&(e.opacity=t.opacity),void 0!==t.url&&this.Vr.Gr({url:t.url,flipY:t.flipY},function(t){e.map=t,e.needsUpdate=!0,n&&n()});t=void 0!==t.needDepth&&t.needDepth;return e.transparent=!0,e.depthTest=t,e.depthWrite=t,e},Qr:function(t){var n=this.qr(t);return this.Xr.has(n)||(t=this.$r(t),this.Xr.set(n,t)),this.Xr.get(n)},$r:function(t){var n=new Nc;return n.color=new _i(t.color),n.opacity=t.alpha,n.transparent=!0,void 0!==t.url&&this.Vr.Gr({url:t.url},function(t){n.map=t,n.needsUpdate=!0}),n},to:function(t,n){var e={color:"#ff0000",opacity:1};return void 0!==t.strokeColor&&(e.color=t.strokeColor),void 0!==t.alpha&&(e.opacity=t.alpha),e.needDepth=n,this.Kr(e)},no:function(t){var n=void 0===t.needDepth||t.needDepth,t=new fc({color:t.color,opacity:t.opacity,lineWidth:t.lineWidth,vertexColors:2,dashed:!1,transparent:!0});t.depthWrite=n,t.depthTest=n;n=this.Nr(Xm);return t.resolution.set(n.qt.renderer.domElement.clientWidth,n.qt.renderer.domElement.clientHeight),t},eo:function(t){var n=this.qr(t);return this.Yr.has(n)||(t=this.no(t),this.Yr.set(n,t)),this.Yr.get(n)},io:function(t,n,e){var i=new lc;i.sizeAttenuation=!1,i.depthTest=!1,i.depthWrite=!1,i.transparent=!0,i.opacity=e.opacity,i.side=yt;n=this.ro(t,null,n,e);return i.map=n,e.needSize&&(i.size=n.size),i.userData.scaleRatio=n.scaleRatio,i.userData.mspriteScale=n.mspriteScale,i.needsUpdate=!0,i},oo:function(n,e,i,r){var t,o=this,s=new lc;return s.sizeAttenuation=!1,s.depthTest=!1,s.depthWrite=!1,s.side=yt,s.opacity=1,s.transparent=!0,s.visible=!1,i.imageUrl?wc.Lr(i.imageUrl,function(t){t=o.ro(n,t,e,i);s.map=t,s.visible=!0,s.needsUpdate=!0,s.userData.scaleRatio=t.scaleRatio,s.userData.mspriteScale=t.mspriteScale,r&&r(s)}):(t=this.ro(n,null,e,i),s.visible=!0,s.map=t,s.needsUpdate=!0,s.userData.scaleRatio=t.scaleRatio,s.userData.mspriteScale=t.mspriteScale,r&&r(s)),s},ro:function(t,n,e,i){e=this.Hr.Cr(t,n,e,i);return this.Vr.Br(e,{needSize:i.needSize})},so:function(t,n){var e=this.qr(t);return this.Zr.has(e)||(n=this.ao(t,n),this.Zr.set(e,n)),this.Zr.get(e)},ao:function(t,n){var e=void 0!==t.opacity?t.opacity:1,i=new lc;return i.sizeAttenuation=!1,i.depthTest=t.needDepth,i.depthWrite=t.needDepth,i.transparent=!0,i.opacity=e,i.visible=!1,this.Vr.Gr({url:t.url},function(t){i.map=t,i.needsUpdate=!0,i.visible=!0,i.userData.scaleRatio=t.image.width/t.image.height,n&&n(i)}),i},createArrowWidthBackTexture:function(t){return new xu(this.Hr.Pr(t))},createNormalLineTexture:function(t){return new xu(this.Hr.jr(t))},uo:function(t){return new xu(this.Hr.Dr(t))},Nr:function(t){for(var n=this.gt;n;){if(n instanceof t)return n;n=n.gt}return null},ho:function(t,n){if(this.zr[t+n])return this.zr[t+n];var e=new dc({uniforms:{color:{value:new _i(t)},alpha:{value:n}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\n\nattribute vec3 position;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n ",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\n\nuniform vec3 color;\nuniform float alpha;\n\nvoid main() {\n gl_FragColor = vec4(color,alpha);\n}\n "});return e.transparent=!0,this.zr[t+n]=e},co:function(t,n){n=new qr({uniforms:{color:{value:new _i(t)},alpha:{value:n}},vertexShader:"\nattribute float gradientAlpha;\n\nvarying float v_gradientAlpha;\n\nvoid main() {\n v_gradientAlpha = gradientAlpha;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n ",fragmentShader:"\n\nuniform vec3 color;\nuniform float alpha;\n\nvarying float v_gradientAlpha;\n\nvoid main() {\n gl_FragColor = vec4(color, alpha * v_gradientAlpha);\n}\n "});return n.depthTest=!0,n.depthWrite=!1,n.transparent=!0,n},fo:function(t,n){var e=new $i;return e.minFilter=xn,e.generateMipmaps=!1,e.anisotropy=4,e.wrapS=mn,e.wrapT=mn,wc.Lr(t,function(t){e.image=t,e.needsUpdate=!0,n(e)}),e},st:function(){wc.Ie(),this.Hr.st(),this.Hr=null,this.Vr.st(),this.Vr=null,this.Wr.clear(),this.Xr.clear(),this.Yr.clear(),this.Zr.clear()}});var Fc=ki;ah=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(ah.prototype,{ti:function(t,n,e){new zu({method:"GET",url:t+n+"/"+n+".theme"}).ti(function(t){e(t)})}});var Uc=new ah;function Gc(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Bc(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Bc(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Bc(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Hc(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}e=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.do={clearColor:16777215,clearAlpha:1},this.vo=new Map,this.po=new Map,this.mo=new Map,this.go=new Map,this.yo=new Map,this.bo=new Map,this._o=new Map,this.wo=new Map,this.xo=new Map,this.Mo=new Map,this.Eo=new Map,this.So=new Map,this.To=new Map}var n,e,i;return n=t,(e=[{key:"resize",value:function(){this.do={clearColor:16777215,clearAlpha:1},this.vo.clear(),this.po.clear(),this.mo.clear(),this.go.clear(),this.yo.clear(),this.bo.clear(),this._o.clear(),this.wo.clear(),this.xo.clear(),this.Mo.clear(),this.Eo.clear(),this.So.clear(),this.To.clear()}}])&&Hc(n.prototype,e),i&&Hc(n,i),t}();Object.assign(e.prototype,{pt:function(t,n,e){for(var i in n)t[i]=n[i];if(e)for(var r in e){var o=t[r];if(o){if(e[r].type)switch(e[r].type){case"toColor":o=Si.toColor(o);break;case"toFloat":o=parseFloat(o);break;case"toRgba":o=Si.toRgba(o);break;case"toString":o+=""}e[r].name?(t[e[r].name]=o,delete t[r]):t[r]=o}}return t},Lo:function(t){this.resize(),t&&(this.sysPath=t.sysPath,this.userPath=t.userPath,this.logoPath=t.logoPath,this.sysModelPath=t.sysModelPath,this.userModelPath=t.userModelPath,this.Oo(t),this.Ro(t.extenttheme,Xi.EXTENT),this.Ro(t.storetheme,Xi.MODEL),this.Ao(t.floorapply,Xi.MODEL),this.Co(t.storeapply,Xi.MODEL),this.Ro(t.storelabeltheme,Xi.LABEL),this.Ao(t.floorstorelabelapply,Xi.LABEL),this.Co(t.storelabelapply,Xi.LABEL),this.Ro(t.poiimagetheme,Xi.FACILITY),this.Ao(t.floorpoiimageapply,Xi.FACILITY),this.Co(t.poiimageapply,Xi.FACILITY),this.Ro(t.externalmodeltheme,Xi.EXTERNAL_MODEL),this.Ao(t.floorexternalapply,Xi.EXTERNAL_MODEL),this.Co(t.externalmodelapply,Xi.EXTERNAL_MODEL))},Oo:function(t){t.viewtheme&&((t=t.viewtheme).clearcolor&&(this.do.clearColor=Si.toColor(t.clearcolor)),t.clearalpha&&(this.do.clearAlpha=parseFloat(t.clearalpha)))},Ro:function(t,n){if(t){var e,i=Gc(t);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.id)switch(n){case Xi.EXTERNAL_MODEL:this.Eo.set(r.id,this.pt({},r));break;case Xi.FACILITY:if(!r.imagename)break;this.wo.set(r.id,this.pt({},r,{imagename:{name:"imageName"}}));break;case Xi.LABEL:this.yo.set(r.id,this.pt({},r,{alpha:{type:"toFloat"},fillcolor:{name:"fillColor",type:"toRgba"},strokecolor:{name:"strokeColor",type:"toRgba"},platesize:{name:"plateSize"},platestorkcolor:{name:"plateStorkColor",type:"toRgba"},platecolor:{name:"plateColor",type:"toRgba"}}));break;case Xi.MODEL:this.vo.set(r.id,this.pt({},r,{color:{type:"toColor"},alpha:{type:"toFloat"},strokecolor:{name:"strokeColor",type:"toColor"},strokewidth:{name:"strokeWidth"}}));break;case Xi.EXTENT:this.go.set(r.id,this.pt({},r,{color:{type:"toColor"},alpha:{type:"toFloat"}}))}}}catch(t){i.e(t)}finally{i.f()}}},Ao:function(t,n){if(t){var e,i=Gc(t);try{for(i.s();!(e=i.n()).done;){var r,o=Gc(e.value.typeapply);try{for(o.s();!(r=o.n()).done;){var s,a=r.value,u=this.pt({},a,{normalid:{name:"normalID",type:"toString"},selectedid:{name:"selectID",type:"toString"}}),h=Gc(a.type.split(","));try{for(h.s();!(s=h.n()).done;){var c=s.value;this.ko(n).set(c,u)}}catch(t){h.e(t)}finally{h.f()}}}catch(t){o.e(t)}finally{o.f()}}}catch(t){i.e(t)}finally{i.f()}}},Co:function(t,n){if(t){var e,i=Gc(t);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.fids){var o,s=this.pt({},r,{normalid:{name:"normalID",type:"toString"},selectedid:{name:"selectID",type:"toString"}}),a=Gc(r.fids.split(","));try{for(a.s();!(o=a.n()).done;){var u=o.value;this.Po(n).set(u,s)}}catch(t){a.e(t)}finally{a.f()}}}}catch(t){i.e(t)}finally{i.f()}}},Po:function(t){switch(t){case Xi.LABEL:return this._o;case Xi.FACILITY:return this.Mo;case Xi.MODEL:return this.mo;case Xi.EXTERNAL_MODEL:return this.To}},ko:function(t){switch(t){case Xi.LABEL:return this.bo;case Xi.FACILITY:return this.xo;case Xi.MODEL:return this.po;case Xi.EXTERNAL_MODEL:return this.So}},Do:function(t){switch(t){case Xi.LABEL:return this.yo;case Xi.FACILITY:return this.wo;case Xi.MODEL:return this.vo;case Xi.EXTERNAL_MODEL:return this.Eo}}});var Vc=e;function zc(t){return(zc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wc(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Xc(t,n,e){return(Xc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=qc(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Yc(t,n){return(Yc=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Zc(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=qc(e);return t=i?(t=qc(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==zc(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function qc(t){return(qc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Kc=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Yc(t,n)}(r,Vc);var t,n,e,i=Zc(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).do={},t}return t=r,(n=[{key:"resize",value:function(){Xc(qc(r.prototype),"resize",this).call(this),this.do={}}}])&&Wc(t.prototype,n),e&&Wc(t,e),r}();Qu=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.jo=new Vc,this.No=new Kc};Object.assign(Qu.prototype,{hr:function(t,n,e){var i=this;Uc.ti(t,n,function(t){i.Lo(t),e(!0)})},Lo:function(t){this.jo.Lo(t)},Io:function(t){this.No.Lo(t=t||{})},Fo:function(){return Object.assign({},this.jo.do,this.No.do)},Uo:function(){return Object.assign({},this.jo.go.get("0"),this.No.go.get("0"))},Go:function(t){return this.Bo(Xi.MODEL,t)},Ho:function(t){return this.Bo(Xi.FACILITY,t)},Vo:function(t){return this.Bo(Xi.LABEL,t)},zo:function(t){return this.Bo(Xi.EXTERNAL_MODEL,t)},Bo:function(t,n){var e,i,r={},o={},s=this.No.Po(t).get(n.fid),a=this.jo.Po(t).get(n.fid);return(s||a)&&(Object.assign(o,a,s),e=this.No.Do(t).get(o.normalID),i=this.jo.Do(t).get(o.normalID),e||i)||(s=this.No.ko(t).get(n.typeID),a=this.jo.ko(t).get(n.typeID),(s||a)&&Object.assign(r,a,s),r.normalID||(s=this.No.ko(t).get("0"),a=this.jo.ko(t).get("0"),Object.assign(r,s,a)),e=this.No.Do(t).get(r.normalID),i=this.jo.Do(t).get(r.normalID)),Object.assign(o,i,e)}});var Jc=Qu;function Qc(t,n,e){var i=this,r=!1,o=0,s=0,a=void 0,u=[];this.onStart=void 0,this.onLoad=t,this.onProgress=n,this.onError=e,this.itemStart=function(t){s++,!1===r&&void 0!==i.onStart&&i.onStart(t,o,s),r=!0},this.itemEnd=function(t){o++,void 0!==i.onProgress&&i.onProgress(t,o,s),o===s&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return a?a(t):t},this.setURLModifier=function(t){return a=t,this},this.addHandler=function(t,n){return u.push(t,n),this},this.removeHandler=function(t){t=u.indexOf(t);return-1!==t&&u.splice(t,2),this},this.getHandler=function(t){for(var n=0,e=u.length;n<e;n+=2){var i=u[n],r=u[n+1];if(i.global&&(i.lastIndex=0),i.test(t))return r}return null}}var $c=new Qc,tf=function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var n="",e=0,i=t.length;e<i;e++)n+=String.fromCharCode(t[e]);try{return decodeURIComponent(escape(n))}catch(t){return n}},nf=function(t){var n=t.lastIndexOf("/");return-1===n?"./":t.substr(0,n+1)},ef={enabled:!1,files:{},add:function(t,n){!1!==this.enabled&&(this.files[t]=n)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function rf(t){xf.call(this,t)}function of(t){xf.call(this,t)}function sf(t){Vr.call(this),this.type="ShadowMaterial",this.color=new _i(0),this.transparent=!0,this.setValues(t)}function af(t){Vr.call(this),this.type="PointsMaterial",this.color=new _i(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}function uf(t){Vr.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new _i(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _i(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Je,this.normalScale=new ii(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(t)}function hf(t){uf.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new ii(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(t)}function cf(t){Vr.call(this),this.type="MeshPhongMaterial",this.color=new _i(16777215),this.specular=new _i(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _i(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Je,this.normalScale=new ii(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$t,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ff(t){Vr.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new _i(16777215),this.specular=new _i(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _i(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Je,this.normalScale=new ii(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function lf(t){Vr.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Je,this.normalScale=new ii(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function df(t){Vr.call(this),this.type="MeshLambertMaterial",this.color=new _i(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _i(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$t,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function vf(t){Vr.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new _i(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Je,this.normalScale=new ii(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function pf(t){Vr.call(this),this.type="LineBasicMaterial",this.color=new _i(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(t)}function mf(t){pf.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}function gf(t){xf.call(this,t),this.textures={}}rf.prototype=Object.assign(Object.create(xf.prototype),{constructor:rf,load:function(n,t,e,i){void 0!==this.path&&(n=this.path+n),n=this.manager.resolveURL(n);var r=this,o=ef.get(n);if(void 0!==o)return r.manager.itemStart(n),setTimeout(function(){t&&t(o),r.manager.itemEnd(n)},0),o;var s=document.createElementNS("http://www.w3.org/1999/xhtml","img");function a(){s.removeEventListener("load",a,!1),s.removeEventListener("error",u,!1),ef.add(n,this),t&&t(this),r.manager.itemEnd(n)}function u(t){s.removeEventListener("load",a,!1),s.removeEventListener("error",u,!1),i&&i(t),r.manager.itemError(n),r.manager.itemEnd(n)}return s.addEventListener("load",a,!1),s.addEventListener("error",u,!1),"data:"!==n.substr(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),r.manager.itemStart(n),s.src=n,s}}),of.prototype=Object.assign(Object.create(xf.prototype),{constructor:of,load:function(n,e,t,i){var r=new $i,o=new rf(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(n,function(t){r.image=t;t=0<n.search(/\.jpe?g($|\?)/i)||0===n.search(/^data\:image\/jpeg/);r.format=t?Fn:Un,r.needsUpdate=!0,void 0!==e&&e(r)},t,i),r}}),((sf.prototype=Object.create(Vr.prototype)).constructor=sf).prototype.isShadowMaterial=!0,sf.prototype.copy=function(t){return Vr.prototype.copy.call(this,t),this.color.copy(t.color),this},((af.prototype=Object.create(Vr.prototype)).constructor=af).prototype.isPointsMaterial=!0,af.prototype.copy=function(t){return Vr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this},((uf.prototype=Object.create(Vr.prototype)).constructor=uf).prototype.isMeshStandardMaterial=!0,uf.prototype.copy=function(t){return Vr.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},((hf.prototype=Object.create(uf.prototype)).constructor=hf).prototype.isMeshPhysicalMaterial=!0,hf.prototype.copy=function(t){return uf.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new _i).copy(t.sheen):this.sheen=null,this.transparency=t.transparency,this},((cf.prototype=Object.create(Vr.prototype)).constructor=cf).prototype.isMeshPhongMaterial=!0,cf.prototype.copy=function(t){return Vr.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((ff.prototype=Object.create(Vr.prototype)).constructor=ff).prototype.isMeshToonMaterial=!0,ff.prototype.copy=function(t){return Vr.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((lf.prototype=Object.create(Vr.prototype)).constructor=lf).prototype.isMeshNormalMaterial=!0,lf.prototype.copy=function(t){return Vr.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((df.prototype=Object.create(Vr.prototype)).constructor=df).prototype.isMeshLambertMaterial=!0,df.prototype.copy=function(t){return Vr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((vf.prototype=Object.create(Vr.prototype)).constructor=vf).prototype.isMeshMatcapMaterial=!0,vf.prototype.copy=function(t){return Vr.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((pf.prototype=Object.create(Vr.prototype)).constructor=pf).prototype.isLineBasicMaterial=!0,pf.prototype.copy=function(t){return Vr.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},((mf.prototype=Object.create(pf.prototype)).constructor=mf).prototype.isLineDashedMaterial=!0,mf.prototype.copy=function(t){return pf.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this},gf.prototype=Object.assign(Object.create(xf.prototype),{constructor:gf,load:function(t,n,e,i){var r=this,o=new Ef(r.manager);o.setPath(r.path),o.load(t,function(t){n(r.parse(JSON.parse(t)))},e,i)},parse:function(t){var n=this.textures;function e(t){return void 0===n[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),n[t]}var i,r=new u[t.type];if(void 0!==t.uuid&&(r.uuid=t.uuid),void 0!==t.name&&(r.name=t.name),void 0!==t.color&&r.color.setHex(t.color),void 0!==t.roughness&&(r.roughness=t.roughness),void 0!==t.metalness&&(r.metalness=t.metalness),void 0!==t.sheen&&(r.sheen=(new _i).setHex(t.sheen)),void 0!==t.emissive&&r.emissive.setHex(t.emissive),void 0!==t.specular&&r.specular.setHex(t.specular),void 0!==t.shininess&&(r.shininess=t.shininess),void 0!==t.clearcoat&&(r.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(r.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.flatShading&&(r.flatShading=t.flatShading),void 0!==t.blending&&(r.blending=t.blending),void 0!==t.combine&&(r.combine=t.combine),void 0!==t.side&&(r.side=t.side),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.transparent&&(r.transparent=t.transparent),void 0!==t.alphaTest&&(r.alphaTest=t.alphaTest),void 0!==t.depthTest&&(r.depthTest=t.depthTest),void 0!==t.depthWrite&&(r.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(r.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(r.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(r.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(r.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(r.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(r.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(r.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(r.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(r.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(r.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(r.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(r.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(r.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(r.rotation=t.rotation),1!==t.linewidth&&(r.linewidth=t.linewidth),void 0!==t.dashSize&&(r.dashSize=t.dashSize),void 0!==t.gapSize&&(r.gapSize=t.gapSize),void 0!==t.scale&&(r.scale=t.scale),void 0!==t.polygonOffset&&(r.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(r.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(r.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(r.skinning=t.skinning),void 0!==t.morphTargets&&(r.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(r.morphNormals=t.morphNormals),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.vertexTangents&&(r.vertexTangents=t.vertexTangents),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.toneMapped&&(r.toneMapped=t.toneMapped),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?r.vertexColors=0<t.vertexColors:r.vertexColors=t.vertexColors),void 0!==t.uniforms)for(var o in t.uniforms){var s=t.uniforms[o];switch(r.uniforms[o]={},s.type){case"t":r.uniforms[o].value=e(s.value);break;case"c":r.uniforms[o].value=(new _i).setHex(s.value);break;case"v2":r.uniforms[o].value=(new ii).fromArray(s.value);break;case"v3":r.uniforms[o].value=(new Et).fromArray(s.value);break;case"v4":r.uniforms[o].value=(new er).fromArray(s.value);break;case"m3":r.uniforms[o].value=(new x).fromArray(s.value);case"m4":r.uniforms[o].value=(new St).fromArray(s.value);break;default:r.uniforms[o].value=s.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var a in t.extensions)r.extensions[a]=t.extensions[a];return void 0!==t.shading&&(r.flatShading=1===t.shading),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=e(t.map)),void 0!==t.matcap&&(r.matcap=e(t.matcap)),void 0!==t.alphaMap&&(r.alphaMap=e(t.alphaMap)),void 0!==t.bumpMap&&(r.bumpMap=e(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=e(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale&&(i=t.normalScale,!1===Array.isArray(i)&&(i=[i,i]),r.normalScale=(new ii).fromArray(i)),void 0!==t.displacementMap&&(r.displacementMap=e(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=e(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=e(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=e(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=e(t.specularMap)),void 0!==t.envMap&&(r.envMap=e(t.envMap)),void 0!==t.envMapIntensity&&(r.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(r.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(r.lightMap=e(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=e(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=e(t.gradientMap)),void 0!==t.clearcoatMap&&(r.clearcoatMap=e(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=e(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(r.clearcoatNormalMap=e(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(r.clearcoatNormalScale=(new ii).fromArray(t.clearcoatNormalScale)),r},setTextures:function(t){return this.textures=t,this}});var yf,bf,_f,wf;function xf(t){this.manager=void 0!==t?t:$c,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(xf.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this}}),Object.assign(xf.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,n,e){for(var i=[],r=0;r<t.length;++r)i[r]=this.createMaterial(t[r],n,e);return i},createMaterial:(yf={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},bf=new _i,_f=new of,wf=new gf,function(t,s,a){var u={};function n(t,n,e,i,r){var o=s+t,t=(new Qc).getHandler(o),o=null!==t?t.load(o):(_f.setCrossOrigin(a),_f.load(o));void 0!==n&&(o.repeat.fromArray(n),1!==n[0]&&(o.wrapS=1e3),1!==n[1]&&(o.wrapT=1e3)),void 0!==e&&o.offset.fromArray(e),void 0!==i&&("repeat"===i[0]&&(o.wrapS=1e3),"mirror"===i[0]&&(o.wrapS=1002),"repeat"===i[1]&&(o.wrapT=1e3),"mirror"===i[1]&&(o.wrapT=1002)),void 0!==r&&(o.anisotropy=r);r=Mt.generateUUID();return u[r]=o,r}var e,i={uuid:Mt.generateUUID(),type:"MeshLambertMaterial"};for(e in t){var r=t[e];switch(e){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":i.name=r;break;case"blending":i.blending=yf[r];break;case"colorAmbient":case"mapAmbient":break;case"colorDiffuse":i.color=bf.fromArray(r).getHex();break;case"colorSpecular":i.specular=bf.fromArray(r).getHex();break;case"colorEmissive":i.emissive=bf.fromArray(r).getHex();break;case"specularCoef":i.shininess=r;break;case"shading":"basic"===r.toLowerCase()&&(i.type="MeshBasicMaterial"),"phong"===r.toLowerCase()&&(i.type="MeshPhongMaterial"),"standard"===r.toLowerCase()&&(i.type="MeshStandardMaterial");break;case"mapDiffuse":i.map=n(r,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":i.emissiveMap=n(r,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":i.lightMap=n(r,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":i.aoMap=n(r,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":i.bumpMap=n(r,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":i.bumpScale=r;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":i.normalMap=n(r,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":i.normalScale=r;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":i.specularMap=n(r,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":i.metalnessMap=n(r,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":i.roughnessMap=n(r,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":i.alphaMap=n(r,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":i.side=1;break;case"doubleSided":i.side=2;break;case"transparency":i.opacity=r;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":i[e]=r;break;case"vertexColors":!0===r&&(i.vertexColors=2),"face"===r&&(i.vertexColors=1)}}return"MeshBasicMaterial"===i.type&&delete i.emissive,"MeshPhongMaterial"!==i.type&&delete i.specular,i.opacity<1&&(i.transparent=!0),wf.setTextures(u),wf.parse(i)})});var Mf={};function Ef(t){xf.call(this,t)}Ef.prototype=Object.assign(Object.create(xf.prototype),{constructor:Ef,load:function(s,t,n,e){void 0===s&&(s=""),void 0!==this.path&&(s=this.path+s),s=this.manager.resolveURL(s);var a=this,i=ef.get(s);if(void 0!==i)return a.manager.itemStart(s),setTimeout(function(){t&&t(i),a.manager.itemEnd(s)},0),i;if(void 0===Mf[s]){var r=s.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){var o=r[1],u=!!r[2],h=r[3],h=decodeURIComponent(h);u&&(h=atob(h));try{var c=(this.responseType||"").toLowerCase();switch(c){case"arraybuffer":case"blob":for(var f=new Uint8Array(h.length),l=0;l<h.length;l++)f[l]=h.charCodeAt(l);d="blob"===c?new Blob([f.buffer],{type:o}):f.buffer;break;case"document":var d=(new DOMParser).parseFromString(h,o);break;case"json":d=JSON.parse(h);break;default:d=h}setTimeout(function(){t&&t(d),a.manager.itemEnd(s)},0)}catch(t){setTimeout(function(){e&&e(t),a.manager.itemError(s),a.manager.itemEnd(s)},0)}}else{Mf[s]=[],Mf[s].push({onLoad:t,onProgress:n,onError:e});var v,p=new XMLHttpRequest;for(v in p.open("GET",s,!0),p.addEventListener("load",function(t){var n=this.response,e=Mf[s];if(delete Mf[s],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),ef.add(s,n);for(var i=0,r=e.length;i<r;i++)(o=e[i]).onLoad&&o.onLoad(n);a.manager.itemEnd(s)}else{for(var o,i=0,r=e.length;i<r;i++)(o=e[i]).onError&&o.onError(t);a.manager.itemError(s),a.manager.itemEnd(s)}},!1),p.addEventListener("progress",function(t){for(var n=Mf[s],e=0,i=n.length;e<i;e++){var r=n[e];r.onProgress&&r.onProgress(t)}},!1),p.addEventListener("error",function(t){var n=Mf[s];delete Mf[s];for(var e=0,i=n.length;e<i;e++){var r=n[e];r.onError&&r.onError(t)}a.manager.itemError(s),a.manager.itemEnd(s)},!1),p.addEventListener("abort",function(t){var n=Mf[s];delete Mf[s];for(var e=0,i=n.length;e<i;e++){var r=n[e];r.onError&&r.onError(t)}a.manager.itemError(s),a.manager.itemEnd(s)},!1),void 0!==this.responseType&&(p.responseType=this.responseType),void 0!==this.withCredentials&&(p.withCredentials=this.withCredentials),p.overrideMimeType&&p.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)p.setRequestHeader(v,this.requestHeader[v]);p.send(null)}return a.manager.itemStart(s),p}Mf[s].push({onLoad:t,onProgress:n,onError:e})},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}});var Sf={arraySlice:function(t,n,e){return Sf.isTypedArray(t)?new t.constructor(t.subarray(n,void 0!==e?e:t.length)):t.slice(n,e)},convertArray:function(t,n,e){return!t||!e&&t.constructor===n?t:"number"==typeof n.BYTES_PER_ELEMENT?new n(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),i=0;i!==t;++i)n[i]=i;return n.sort(function(t,n){return e[t]-e[n]}),n},sortedArray:function(t,n,e){for(var i=t.length,r=new t.constructor(i),o=0,s=0;s!==i;++o)for(var a=e[o]*n,u=0;u!==n;++u)r[s++]=t[a+u];return r},flattenJSON:function(t,n,e,i){for(var r=1,o=t[0];void 0!==o&&void 0===o[i];)o=t[r++];if(void 0!==o){var s=o[i];if(void 0!==s)if(Array.isArray(s))for(;void 0!==(s=o[i])&&(n.push(o.time),e.push.apply(e,s)),o=t[r++],void 0!==o;);else if(void 0!==s.toArray)for(;void 0!==(s=o[i])&&(n.push(o.time),s.toArray(e,e.length)),o=t[r++],void 0!==o;);else for(;void 0!==(s=o[i])&&(n.push(o.time),e.push(s)),o=t[r++],void 0!==o;);}},subclip:function(t,n,e,i,r){r=r||30;var o=t.clone();o.name=n;for(var s=[],a=0;a<o.tracks.length;++a){for(var u=o.tracks[a],h=u.getValueSize(),c=[],f=[],l=0;l<u.times.length;++l){var d=u.times[l]*r;if(!(d<e||i<=d)){c.push(u.times[l]);for(var v=0;v<h;++v)f.push(u.values[l*h+v])}}0!==c.length&&(u.times=Sf.convertArray(c,u.times.constructor),u.values=Sf.convertArray(f,u.values.constructor),s.push(u))}o.tracks=s;for(var p=1/0,a=0;a<o.tracks.length;++a)p>o.tracks[a].times[0]&&(p=o.tracks[a].times[0]);for(a=0;a<o.tracks.length;++a)o.tracks[a].shift(-1*p);return o.resetDuration(),o}};function Tf(t,n,e,i){this.parameterPositions=t,this.Wo=0,this.resultBuffer=void 0!==i?i:new n.constructor(e),this.sampleValues=n,this.valueSize=e}function Lf(t,n,e,i){Tf.call(this,t,n,e,i),this.Xo=-0,this.Yo=-0,this.Zo=-0,this.qo=-0}function Of(t,n,e,i){Tf.call(this,t,n,e,i)}function Rf(t,n,e,i){Tf.call(this,t,n,e,i)}function Af(t,n,e,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===n||0===n.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Sf.convertArray(n,this.TimeBufferType),this.values=Sf.convertArray(e,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function Cf(t,n,e){Af.call(this,t,n,e)}function kf(t,n,e,i){Af.call(this,t,n,e,i)}function Pf(t,n,e,i){Af.call(this,t,n,e,i)}function Df(t,n,e,i){Tf.call(this,t,n,e,i)}function jf(t,n,e,i){Af.call(this,t,n,e,i)}function Nf(t,n,e,i){Af.call(this,t,n,e,i)}function If(t,n,e,i){Af.call(this,t,n,e,i)}function Ff(t,n,e){this.name=t,this.tracks=e,this.duration=void 0!==n?n:-1,this.uuid=Mt.generateUUID(),this.duration<0&&this.resetDuration()}function Uf(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var n,e,i=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Pf;case"vector":case"vector2":case"vector3":case"vector4":return If;case"color":return kf;case"quaternion":return jf;case"bool":case"boolean":return Cf;case"string":return Nf}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);return void 0===t.times&&(Sf.flattenJSON(t.keys,n=[],e=[],"value"),t.times=n,t.values=e),void 0!==i.parse?i.parse(t):new i(t.name,t.times,t.values,t.interpolation)}function Gf(t){"boolean"==typeof t&&(console.warn("JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:$c,this.withCredentials=!1}Object.assign(Tf.prototype,{evaluate:function(t){var n,e=this.parameterPositions,i=this.Wo,r=e[i],o=e[i-1];t:{n:{e:{i:if(!(t<r)){for(var s=i+2;;){if(void 0===r){if(t<o)break i;return i=e.length,this.Wo=i,this.afterEnd_(i-1,t,o)}if(i===s)break;if(o=r,t<(r=e[++i]))break n}n=e.length;break e}if(o<=t)break t;var a=e[1];t<a&&(i=2,o=a);for(s=i-2;;){if(void 0===o)return this.Wo=0,this.beforeStart_(0,t,r);if(i===s)break;if(r=o,(o=e[--i-1])<=t)break n}n=i,i=0}for(;i<n;){var u=i+n>>>1;t<e[u]?n=u:i=1+u}if(r=e[i],void 0===(o=e[i-1]))return this.Wo=0,this.beforeStart_(0,t,r);if(void 0===r)return i=e.length,this.Wo=i,this.afterEnd_(i-1,o,t)}this.Wo=i,this.intervalChanged_(i,o,r)}return this.interpolate_(i,o,t,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var n=this.resultBuffer,e=this.sampleValues,i=this.valueSize,r=t*i,o=0;o!==i;++o)n[o]=e[r+o];return n},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Tf.prototype,{beforeStart_:Tf.prototype.copySampleValue_,afterEnd_:Tf.prototype.copySampleValue_}),Lf.prototype=Object.assign(Object.create(Tf.prototype),{constructor:Lf,DefaultSettings_:{endingStart:Fe,endingEnd:Fe},intervalChanged_:function(t,n,e){var i=this.parameterPositions,r=t-2,o=t+1,s=i[r],a=i[o];if(void 0===s)switch(this.getSettings_().endingStart){case Ue:r=t,s=2*n-e;break;case 2402:s=n+i[r=i.length-2]-i[r+1];break;default:r=t,s=e}if(void 0===a)switch(this.getSettings_().endingEnd){case Ue:o=t,a=2*e-n;break;case 2402:a=e+i[o=1]-i[0];break;default:o=t-1,a=n}var u=.5*(e-n),h=this.valueSize;this.Xo=u/(n-s),this.Zo=u/(a-e),this.Yo=r*h,this.qo=o*h},interpolate_:function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,u=a-s,h=this.Yo,c=this.qo,f=this.Xo,t=this.Zo,e=(e-n)/(i-n),i=e*e,n=i*e,l=-f*n+2*f*i-f*e,d=(1+f)*n+(-1.5-2*f)*i+(-.5+f)*e+1,v=(-1-t)*n+(1.5+t)*i+.5*e,p=t*n-t*i,m=0;m!==s;++m)r[m]=l*o[h+m]+d*o[u+m]+v*o[a+m]+p*o[c+m];return r}}),Of.prototype=Object.assign(Object.create(Tf.prototype),{constructor:Of,interpolate_:function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,u=a-s,h=(e-n)/(i-n),c=1-h,f=0;f!==s;++f)r[f]=o[u+f]*c+o[a+f]*h;return r}}),Rf.prototype=Object.assign(Object.create(Tf.prototype),{constructor:Rf,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(Af.prototype,{constructor:Af,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:Ie,InterpolantFactoryMethodDiscrete:function(t){return new Rf(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new Of(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Lf(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var n;switch(t){case Ne:n=this.InterpolantFactoryMethodDiscrete;break;case Ie:n=this.InterpolantFactoryMethodLinear;break;case 2302:n=this.InterpolantFactoryMethodSmooth}if(void 0!==n)return this.createInterpolant=n,this;var e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Ne;case this.InterpolantFactoryMethodLinear:return Ie;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var n=this.times,e=0,i=n.length;e!==i;++e)n[e]+=t;return this},scale:function(t){if(1!==t)for(var n=this.times,e=0,i=n.length;e!==i;++e)n[e]*=t;return this},trim:function(t,n){for(var e,i=this.times,r=i.length,o=0,s=r-1;o!==r&&i[o]<t;)++o;for(;-1!==s&&i[s]>n;)--s;return++s,0===o&&s===r||(s<=o&&(o=(s=Math.max(s,1))-1),e=this.getValueSize(),this.times=Sf.arraySlice(i,o,s),this.values=Sf.arraySlice(this.values,o*e,s*e)),this},validate:function(){var t=!0,n=this.getValueSize();n-Math.floor(n)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var e=this.times,i=this.values,r=e.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,s=0;s!==r;s++){var a=e[s];if("number"==typeof a&&isNaN(a)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,a),t=!1;break}if(null!==o&&a<o){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,a,o),t=!1;break}o=a}if(void 0!==i&&Sf.isTypedArray(i))for(var s=0,u=i.length;s!==u;++s){var h=i[s];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,h),t=!1;break}}return t},optimize:function(){for(var t=Sf.arraySlice(this.times),n=Sf.arraySlice(this.values),e=this.getValueSize(),i=2302===this.getInterpolation(),r=1,o=t.length-1,s=1;s<o;++s){var a=!1,u=t[s];if(u!==t[s+1]&&(1!==s||u!==u[0]))if(i)a=!0;else for(var h=s*e,c=h-e,f=h+e,l=0;l!==e;++l){var d=n[h+l];if(d!==n[c+l]||d!==n[f+l]){a=!0;break}}if(a){if(s!==r){t[r]=t[s];for(var v=s*e,p=r*e,l=0;l!==e;++l)n[p+l]=n[v+l]}++r}}if(0<o){t[r]=t[o];for(v=o*e,p=r*e,l=0;l!==e;++l)n[p+l]=n[v+l];++r}return r!==t.length?(this.times=Sf.arraySlice(t,0,r),this.values=Sf.arraySlice(n,0,r*e)):(this.times=t,this.values=n),this},clone:function(){var t=Sf.arraySlice(this.times,0),n=Sf.arraySlice(this.values,0),n=new this.constructor(this.name,t,n);return n.createInterpolant=this.createInterpolant,n}}),Cf.prototype=Object.assign(Object.create(Af.prototype),{constructor:Cf,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Ne,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),kf.prototype=Object.assign(Object.create(Af.prototype),{constructor:kf,ValueTypeName:"color"}),Pf.prototype=Object.assign(Object.create(Af.prototype),{constructor:Pf,ValueTypeName:"number"}),Df.prototype=Object.assign(Object.create(Tf.prototype),{constructor:Df,interpolate_:function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,u=(e-n)/(i-n),h=a+s;a!==h;a+=4)et.slerpFlat(r,0,o,a-s,o,a,u);return r}}),jf.prototype=Object.assign(Object.create(Af.prototype),{constructor:jf,ValueTypeName:"quaternion",DefaultInterpolation:Ie,InterpolantFactoryMethodLinear:function(t){return new Df(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Nf.prototype=Object.assign(Object.create(Af.prototype),{constructor:Nf,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Ne,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),If.prototype=Object.assign(Object.create(Af.prototype),{constructor:If,ValueTypeName:"vector"}),Object.assign(Ff,{parse:function(t){for(var n=[],e=t.tracks,i=1/(t.fps||1),r=0,o=e.length;r!==o;++r)n.push(Uf(e[r]).scale(i));return new Ff(t.name,t.duration,n)},CreateFromMorphTargetSequence:function(t,n,e,i){for(var r=n.length,o=[],s=0;s<r;s++){var a=[];(h=[]).push((s+r-1)%r,s,(s+1)%r),a.push(0,1,0);var u=Sf.getKeyframeOrder(h),h=Sf.sortedArray(h,1,u),a=Sf.sortedArray(a,1,u);i||0!==h[0]||(h.push(r),a.push(a[0])),o.push(new Pf(".morphTargetInfluences["+n[s].name+"]",h,a).scale(1/e))}return new Ff(t,-1,o)},findByName:function(t,n){var e=t;Array.isArray(t)||(e=t.geometry&&t.geometry.animations||t.animations);for(var i=0;i<e.length;i++)if(e[i].name===n)return e[i];return null},CreateClipsFromMorphTargetSequences:function(t,n,e){for(var i={},r=/^([\w-]*?)([\d]+)$/,o=0,s=t.length;o<s;o++){var a=t[o],u=a.name.match(r);u&&1<u.length&&((u=i[h=u[1]])||(i[h]=u=[]),u.push(a))}var h,c=[];for(h in i)c.push(Ff.CreateFromMorphTargetSequence(h,i[h],n,e));return c},parseAnimation:function(t,n){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var e=function(t,n,e,i,r){var o;0!==e.length&&(Sf.flattenJSON(e,o=[],e=[],i),0!==o.length&&r.push(new t(n,o,e)))},i=[],r=t.name||"default",o=t.length||-1,s=t.fps||30,a=t.hierarchy||[],u=0;u<a.length;u++){var h=a[u].keys;if(h&&0!==h.length)if(h[0].morphTargets){for(var c,f={},l=0;l<h.length;l++)if(h[l].morphTargets)for(var d=0;d<h[l].morphTargets.length;d++)f[h[l].morphTargets[d]]=-1;for(c in f){for(var v=[],p=[],d=0;d!==h[l].morphTargets.length;++d){var m=h[l];v.push(m.time),p.push(m.morphTarget===c?1:0)}i.push(new Pf(".morphTargetInfluence["+c+"]",v,p))}o=f.length*(s||1)}else{var g=".bones["+n[u].name+"]";e(If,g+".position",h,"pos",i),e(jf,g+".quaternion",h,"rot",i),e(If,g+".scale",h,"scl",i)}}return 0===i.length?null:new Ff(r,o,i)}}),Object.assign(Ff.prototype,{resetDuration:function(){for(var t=0,n=0,e=this.tracks.length;n!==e;++n)var i=this.tracks[n],t=Math.max(t,i.times[i.times.length-1]);return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,n=0;n<this.tracks.length;n++)t=t&&this.tracks[n].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){for(var t=[],n=0;n<this.tracks.length;n++)t.push(this.tracks[n].clone());return new Ff(this.name,this.duration,t)}}),Object.assign(Gf.prototype,{crossOrigin:"anonymous",load:function(e,i,t,n){var r=this,o=void 0===this.path?nf(e):this.path;this.resourcePath=o+"maps/";var s=new Ef(this.manager);s.setPath(this.path),s.setWithCredentials(this.withCredentials),s.load(e,function(t){var n=JSON.parse(t),t=n.metadata;if(void 0!==t){t=t.type;if(void 0!==t&&"object"===t.toLowerCase())return void console.error("JSONLoader: "+e+" should be loaded with ObjectLoader instead.")}n=r.parse(n,o);i(n.geometry,n.materials)},t,n)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,n){void 0!==(t=void 0!==t.data?t.data:t).scale?t.scale=1/t.scale:t.scale=1;var e=new fr;return function(t,n){var e,i,r,o,s,a,u,h,c,f,l,d,v,p,m,g,y,b,_,w,x,M,E,S,T=t.faces,L=t.vertices,O=t.normals,R=t.colors,A=t.scale,C=0;if(void 0!==t.uvs){for(e=0;e<t.uvs.length;e++)t.uvs[e].length&&C++;for(e=0;e<C;e++)n.faceVertexUvs[e]=[]}for(o=0,s=L.length;o<s;)(y=new Et).x=L[o++]*A,y.y=L[o++]*A,y.z=L[o++]*A,n.vertices.push(y);for(o=0,s=T.length;o<s;)if(l=(f=T[o++])&2,d=f&8,v=f&16,p=f&32,m=f&64,g=f&128,f&1){if((_=new sr).a=T[o],_.b=T[o+1],_.c=T[o+3],(w=new sr).a=T[o+1],w.b=T[o+2],w.c=T[o+3],o+=4,l&&(c=T[o++],_.materialIndex=c,w.materialIndex=c),r=n.faces.length,d)for(e=0;e<C;e++)for(E=t.uvs[e],n.faceVertexUvs[e][r]=[],n.faceVertexUvs[e][r+1]=[],i=0;i<4;i++)S=new ii(E[2*(h=T[o++])],E[2*h+1]),2!==i&&n.faceVertexUvs[e][r].push(S),0!==i&&n.faceVertexUvs[e][r+1].push(S);if(v&&(u=3*T[o++],_.normal.set(O[u++],O[u++],O[u]),w.normal.copy(_.normal)),p)for(e=0;e<4;e++)u=3*T[o++],M=new Et(O[u++],O[u++],O[u]),2!==e&&_.vertexNormals.push(M),0!==e&&w.vertexNormals.push(M);if(m&&(x=R[a=T[o++]],_.color.setHex(x),w.color.setHex(x)),g)for(e=0;e<4;e++)x=R[a=T[o++]],2!==e&&_.vertexColors.push(new _i(x)),0!==e&&w.vertexColors.push(new _i(x));n.faces.push(_),n.faces.push(w)}else{if((b=new sr).a=T[o++],b.b=T[o++],b.c=T[o++],l&&(c=T[o++],b.materialIndex=c),r=n.faces.length,d)for(e=0;e<C;e++)for(E=t.uvs[e],n.faceVertexUvs[e][r]=[],i=0;i<3;i++)S=new ii(E[2*(h=T[o++])],E[2*h+1]),n.faceVertexUvs[e][r].push(S);if(v&&(u=3*T[o++],b.normal.set(O[u++],O[u++],O[u])),p)for(e=0;e<3;e++)u=3*T[o++],M=new Et(O[u++],O[u++],O[u]),b.vertexNormals.push(M);if(m&&(a=T[o++],b.color.setHex(R[a])),g)for(e=0;e<3;e++)a=T[o++],b.vertexColors.push(new _i(R[a]));n.faces.push(b)}}(t,e),function(t,n){var e=void 0!==t.influencesPerVertex?t.influencesPerVertex:2;if(t.skinWeights)for(var i=0,r=t.skinWeights.length;i<r;i+=e){var o=t.skinWeights[i],s=1<e?t.skinWeights[i+1]:0,a=2<e?t.skinWeights[i+2]:0,u=3<e?t.skinWeights[i+3]:0;n.skinWeights.push(new er(o,s,a,u))}if(t.skinIndices)for(i=0,r=t.skinIndices.length;i<r;i+=e){var h=t.skinIndices[i],c=1<e?t.skinIndices[i+1]:0,f=2<e?t.skinIndices[i+2]:0,l=3<e?t.skinIndices[i+3]:0;n.skinIndices.push(new er(h,c,f,l))}n.bones=t.bones,n.bones&&0<n.bones.length&&(n.skinWeights.length!==n.skinIndices.length||n.skinIndices.length!==n.vertices.length)&&console.warn("When skinning, number of vertices ("+n.vertices.length+"), skinIndices ("+n.skinIndices.length+"), and skinWeights ("+n.skinWeights.length+") should match.")}(t,e),function(t,n){var e=t.scale;if(void 0!==t.morphTargets)for(var i=0,r=t.morphTargets.length;i<r;i++){n.morphTargets[i]={},n.morphTargets[i].name=t.morphTargets[i].name,n.morphTargets[i].vertices=[];for(var o=n.morphTargets[i].vertices,s=t.morphTargets[i].vertices,a=0,u=s.length;a<u;a+=3){var h=new Et;h.x=s[a]*e,h.y=s[a+1]*e,h.z=s[a+2]*e,o.push(h)}}if(void 0!==t.morphColors&&0<t.morphColors.length){console.warn('fm.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var c=n.faces,f=t.morphColors[0].colors,i=0,r=c.length;i<r;i++)c[i].color.fromArray(f,3*i)}}(t,e),function(t,n){var e=[],i=[];void 0!==t.animation&&i.push(t.animation),void 0!==t.animations&&(t.animations.length?i=i.concat(t.animations):i.push(t.animations));for(var r=0;r<i.length;r++){var o=Ff.parseAnimation(i[r],n.bones);o&&e.push(o)}n.morphTargets&&(t=Ff.CreateClipsFromMorphTargetSequences(n.morphTargets,10),e=e.concat(t)),0<e.length&&(n.animations=e)}(t,e),e.computeFaceNormals(),e.computeBoundingSphere(),void 0===t.materials||0===t.materials.length?{geometry:e}:{geometry:e,materials:xf.prototype.initMaterials(t.materials,this.resourcePath||n,this.crossOrigin)}}});var Bf=Gf;function Hf(t,n){Y.call(this),this.type="Light",this.color=new _i(t),this.intensity=void 0!==n?n:1,this.receiveShadow=void 0}function Vf(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new ii(512,512),this.map=null,this.mapPass=null,this.matrix=new St,this.Ko=new ci,this.Jo=new ii(1,1),this.Qo=1,this.$o=[new er(0,0,1,1)]}function zf(){Vf.call(this,new q(-5,5,5,-5,.5,500))}function Wf(t,n){Hf.call(this,t,n),this.type="DirectionalLight",this.position.copy(Y.DefaultUp),this.updateMatrix(),this.target=new Y,this.shadow=new zf}function Xf(){Vf.call(this,new Z(90,1,.5,500)),this.Jo=new ii(4,2),this.Qo=6,this.$o=[new er(2,1,1,1),new er(0,1,1,1),new er(3,1,1,1),new er(1,1,1,1),new er(3,0,1,1),new er(1,0,1,1)],this.ts=[new Et(1,0,0),new Et(-1,0,0),new Et(0,0,1),new Et(0,0,-1),new Et(0,1,0),new Et(0,-1,0)],this.ns=[new Et(0,1,0),new Et(0,1,0),new Et(0,1,0),new Et(0,1,0),new Et(0,0,1),new Et(0,0,-1)]}function Yf(t,n,e,i){Hf.call(this,t,n),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==e?e:0,this.decay=void 0!==i?i:1,this.shadow=new Xf}function Zf(){Vf.call(this,new Z(50,1,.5,500))}function qf(t,n,e,i,r,o){Hf.call(this,t,n),this.type="SpotLight",this.position.copy(Y.DefaultUp),this.updateMatrix(),this.target=new Y,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==e?e:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new Zf}function Kf(t,n){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),To.call(this,t,n),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new St,this.bindMatrixInverse=new St}Hf.prototype=Object.assign(Object.create(Y.prototype),{constructor:Hf,isLight:!0,copy:function(t){return Y.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this}}),Object.assign(Vf.prototype,{es:new St,rs:new Et,ss:new Et,getViewportCount:function(){return this.Qo},getFrustum:function(){return this.Ko},updateMatrices:function(t){var n=this.camera,e=this.matrix,i=this.es,r=this.ss,o=this.rs;o.setFromMatrixPosition(t.matrixWorld),n.position.copy(o),r.setFromMatrixPosition(t.target.matrixWorld),n.lookAt(r),n.updateMatrixWorld(),i.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this.Ko.setFromProjectionMatrix(i),e.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),e.multiply(n.projectionMatrix),e.multiply(n.matrixWorldInverse)},getViewport:function(t){return this.$o[t]},getFrameExtents:function(){return this.Jo},copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)}}),zf.prototype=Object.assign(Object.create(Vf.prototype),{constructor:zf,isDirectionalLightShadow:!0,updateMatrices:function(t){Vf.prototype.updateMatrices.call(this,t)}}),Wf.prototype=Object.assign(Object.create(Hf.prototype),{constructor:Wf,isDirectionalLight:!0,copy:function(t){return Hf.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Xf.prototype=Object.assign(Object.create(Vf.prototype),{constructor:Xf,isPointLightShadow:!0,updateMatrices:function(t,n){void 0===n&&(n=0);var e=this.camera,i=this.matrix,r=this.rs,o=this.ss,s=this.es;r.setFromMatrixPosition(t.matrixWorld),e.position.copy(r),o.copy(e.position),o.add(this.ts[n]),e.up.copy(this.ns[n]),e.lookAt(o),e.updateMatrixWorld(),i.makeTranslation(-r.x,-r.y,-r.z),s.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this.Ko.setFromProjectionMatrix(s)}}),Yf.prototype=Object.assign(Object.create(Hf.prototype),{constructor:Yf,isPointLight:!0,copy:function(t){return Hf.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Zf.prototype=Object.assign(Object.create(Vf.prototype),{constructor:Zf,isSpotLightShadow:!0,updateMatrices:function(t){var n=this.camera,e=2*Mt.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,r=t.distance||n.far;e===n.fov&&i===n.aspect&&r===n.far||(n.fov=e,n.aspect=i,n.far=r,n.updateProjectionMatrix()),Vf.prototype.updateMatrices.call(this,t)}}),qf.prototype=Object.assign(Object.create(Hf.prototype),{constructor:qf,isSpotLight:!0,copy:function(t){return Hf.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Kf.prototype=Object.assign(Object.create(To.prototype),{constructor:Kf,isSkinnedMesh:!0,bind:function(t,n){this.skeleton=t,void 0===n&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),n=this.matrixWorld),this.bindMatrix.copy(n),this.bindMatrixInverse.getInverse(n)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new er,n=this.geometry.attributes.skinWeight,e=0,i=n.count;e<i;e++){t.x=n.getX(e),t.y=n.getY(e),t.z=n.getZ(e),t.w=n.getW(e);var r=1/t.manhattanLength();r!=1/0?t.multiplyScalar(r):t.set(1,0,0,0),n.setXYZW(e,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){To.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Jf=new Et,Qf=new Et,$f=new St,tl=new Bi,nl=new it;function el(t,n,e){1===e&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Y.call(this),this.type="Line",this.geometry=void 0!==t?t:new kr,this.material=void 0!==n?n:new pf}el.prototype=Object.assign(Object.create(Y.prototype),{constructor:el,isLine:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var n=t.attributes.position,e=[0],i=1,r=n.count;i<r;i++)Jf.fromBufferAttribute(n,i-1),Qf.fromBufferAttribute(n,i),e[i]=e[i-1],e[i]+=Jf.distanceTo(Qf);t.setAttribute("lineDistance",new wr(e,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var o=t.vertices;(e=t.lineDistances)[0]=0;for(i=1,r=o.length;i<r;i++)e[i]=e[i-1],e[i]+=o[i-1].distanceTo(o[i])}return this},raycast:function(t,n){var e=this.geometry,i=this.matrixWorld,r=t.params.Line.threshold;if(null===e.boundingSphere&&e.computeBoundingSphere(),nl.copy(e.boundingSphere),nl.applyMatrix4(i),nl.radius+=r,!1!==t.ray.intersectsSphere(nl)){$f.getInverse(i),tl.copy(t.ray).applyMatrix4($f);var r=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=r*r,s=new Et,a=new Et,u=new Et,h=new Et,c=this&&this.isLineSegments?2:1;if(e.isBufferGeometry){var r=e.index,f=e.attributes.position.array;if(null!==r)for(var l=r.array,d=0,v=l.length-1;d<v;d+=c){var p=l[d],m=l[d+1];s.fromArray(f,3*p),a.fromArray(f,3*m),o<tl.distanceSqToSegment(s,a,h,u)||(h.applyMatrix4(this.matrixWorld),(g=t.ray.origin.distanceTo(h))<t.near||g>t.far||n.push({distance:g,point:u.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}else for(d=0,v=f.length/3-1;d<v;d+=c)s.fromArray(f,3*d),a.fromArray(f,3*d+3),o<tl.distanceSqToSegment(s,a,h,u)||(h.applyMatrix4(this.matrixWorld),(g=t.ray.origin.distanceTo(h))<t.near||g>t.far||n.push({distance:g,point:u.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}else if(e.isGeometry)for(var g,y=e.vertices,b=y.length,d=0;d<b-1;d+=c)o<tl.distanceSqToSegment(y[d],y[d+1],h,u)||(h.applyMatrix4(this.matrixWorld),(g=t.ray.origin.distanceTo(h))<t.near||g>t.far||n.push({distance:g,point:u.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var il=new Et,rl=new Et;function ol(t,n){el.call(this,t,n),this.type="LineSegments"}function sl(t,n){el.call(this,t,n),this.type="LineLoop"}ol.prototype=Object.assign(Object.create(el.prototype),{constructor:ol,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var n=t.attributes.position,e=[],i=0,r=n.count;i<r;i+=2)il.fromBufferAttribute(n,i),rl.fromBufferAttribute(n,i+1),e[i]=0===i?0:e[i-1],e[i+1]=e[i]+il.distanceTo(rl);t.setAttribute("lineDistance",new wr(e,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry)for(var o=t.vertices,e=t.lineDistances,i=0,r=o.length;i<r;i+=2)il.copy(o[i]),rl.copy(o[i+1]),e[i]=0===i?0:e[i-1],e[i+1]=e[i]+il.distanceTo(rl);return this}}),sl.prototype=Object.assign(Object.create(el.prototype),{constructor:sl,isLineLoop:!0});var al=new St,ul=new Bi,hl=new it,cl=new Et;function fl(t,n){Y.call(this),this.type="Points",this.geometry=void 0!==t?t:new kr,this.material=void 0!==n?n:new af,this.updateMorphTargets()}function ll(t,n,e,i,r,o,s){var a=ul.distanceSqToPoint(t);a<e&&(e=new Et,ul.closestPointToPoint(t,e),e.applyMatrix4(i),(i=r.ray.origin.distanceTo(e))<r.near||i>r.far||o.push({distance:i,distanceToRay:Math.sqrt(a),point:e,index:n,face:null,object:s}))}function dl(){Y.call(this),this.type="Bone"}fl.prototype=Object.assign(Object.create(Y.prototype),{constructor:fl,isPoints:!0,raycast:function(t,n){var e=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold;if(null===e.boundingSphere&&e.computeBoundingSphere(),hl.copy(e.boundingSphere),hl.applyMatrix4(i),hl.radius+=r,!1!==t.ray.intersectsSphere(hl)){al.getInverse(i),ul.copy(t.ray).applyMatrix4(al);var r=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=r*r;if(e.isBufferGeometry){var r=e.index,s=e.attributes.position.array;if(null!==r)for(var a=r.array,u=0,h=a.length;u<h;u++){var c=a[u];cl.fromArray(s,3*c),ll(cl,c,o,i,t,n,this)}else for(var u=0,f=s.length/3;u<f;u++)cl.fromArray(s,3*u),ll(cl,u,o,i,t,n,this)}else for(var l=e.vertices,u=0,f=l.length;u<f;u++)ll(l[u],u,o,i,t,n,this)}},updateMorphTargets:function(){var t,n,e,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(0<o.length){var s=r[o[0]];if(void 0!==s)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,n=s.length;t<n;t++)e=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}else{i=i.morphTargets;void 0!==i&&0<i.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),dl.prototype=Object.assign(Object.create(Y.prototype),{constructor:dl,isBone:!0});var hh="\\[\\]\\.:\\/",vl=new RegExp("["+hh+"]","g"),qu="[^"+hh+"]",oh="[^"+hh.replace("\\.","")+"]",ih=/((?:WC+[\/:])*)/.source.replace("WC",qu),Zu=/(WCOD+)?/.source.replace("WCOD",oh),pi=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",qu),ka=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",qu),pl=new RegExp("^"+ih+Zu+pi+ka+"$"),ml=["material","materials","bones"];function gl(t,n,e){e=e||yl.parseTrackName(n);this.as=t,this.us=t.subscribe_(n,e)}function yl(t,n,e){this.path=n,this.parsedPath=e||yl.parseTrackName(n),this.node=yl.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}Object.assign(gl.prototype,{getValue:function(t,n){this.bind();var e=this.as.nCachedObjects_,e=this.us[e];void 0!==e&&e.getValue(t,n)},setValue:function(t,n){for(var e=this.us,i=this.as.nCachedObjects_,r=e.length;i!==r;++i)e[i].setValue(t,n)},bind:function(){for(var t=this.us,n=this.as.nCachedObjects_,e=t.length;n!==e;++n)t[n].bind()},unbind:function(){for(var t=this.us,n=this.as.nCachedObjects_,e=t.length;n!==e;++n)t[n].unbind()}}),Object.assign(yl,{Composite:gl,create:function(t,n,e){return new(t&&t.isAnimationObjectGroup?yl.Composite:yl)(t,n,e)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(vl,"")},parseTrackName:function(t){var n=pl.exec(t);if(!n)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var e={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=e.nodeName&&e.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i&&(n=e.nodeName.substring(i+1),-1!==ml.indexOf(n)&&(e.nodeName=e.nodeName.substring(0,i),e.objectName=n)),null===e.propertyName||0===e.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return e},findNode:function(t,r){if(!r||""===r||"."===r||-1===r||r===t.name||r===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(r);if(void 0!==n)return n}if(t.children){t=function t(n){for(var e=0;e<n.length;e++){var i=n[e];if(i.name===r||i.uuid===r)return i;i=t(i.children);if(i)return i}return null}(t.children);if(t)return t}return null}}),Object.assign(yl.prototype,{hs:function(){},cs:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,n){t[n]=this.node[this.propertyName]},function(t,n){for(var e=this.resolvedProperty,i=0,r=e.length;i!==r;++i)t[n++]=e[i]},function(t,n){t[n]=this.resolvedProperty[this.propertyIndex]},function(t,n){this.resolvedProperty.toArray(t,n)}],SetterByBindingTypeAndVersioning:[[function(t,n){this.targetObject[this.propertyName]=t[n]},function(t,n){this.targetObject[this.propertyName]=t[n],this.targetObject.needsUpdate=!0},function(t,n){this.targetObject[this.propertyName]=t[n],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){for(var e=this.resolvedProperty,i=0,r=e.length;i!==r;++i)e[i]=t[n++]},function(t,n){for(var e=this.resolvedProperty,i=0,r=e.length;i!==r;++i)e[i]=t[n++];this.targetObject.needsUpdate=!0},function(t,n){for(var e=this.resolvedProperty,i=0,r=e.length;i!==r;++i)e[i]=t[n++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){this.resolvedProperty[this.propertyIndex]=t[n]},function(t,n){this.resolvedProperty[this.propertyIndex]=t[n],this.targetObject.needsUpdate=!0},function(t,n){this.resolvedProperty[this.propertyIndex]=t[n],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){this.resolvedProperty.fromArray(t,n)},function(t,n){this.resolvedProperty.fromArray(t,n),this.targetObject.needsUpdate=!0},function(t,n){this.resolvedProperty.fromArray(t,n),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,n){this.bind(),this.getValue(t,n)},setValue:function(t,n){this.bind(),this.setValue(t,n)},bind:function(){var t=this.node,n=this.parsedPath,e=n.objectName,i=n.propertyName,r=n.propertyIndex;if(t||(t=yl.findNode(this.rootNode,n.nodeName)||this.rootNode,this.node=t),this.getValue=this.hs,this.setValue=this.cs,t){if(e){var o=n.objectIndex;switch(e){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);for(var t=t.skeleton.bones,s=0;s<t.length;s++)if(t[s].name===o){o=s;break}break;default:if(void 0===t[e])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[e]}if(void 0!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var a=t[i];if(void 0!==a){var u=this.Versioning.None;void 0!==(this.targetObject=t).needsUpdate?u=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(u=this.Versioning.MatrixWorldNeedsUpdate);var h=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(s=0;s<this.node.geometry.morphAttributes.position.length;s++)if(t.geometry.morphAttributes.position[s].name===r){r=s;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(s=0;s<this.node.geometry.morphTargets.length;s++)if(t.geometry.morphTargets[s].name===r){r=s;break}}}h=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(h=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(h=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][u]}else{n=n.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+i+" but it wasn't found.",t)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this.ls,this.setValue=this.ds}}),Object.assign(yl.prototype,{ls:yl.prototype.getValue,ds:yl.prototype.setValue});var bl=new St,_l=new St;function wl(t,n){if(this.bones=(t=t||[]).slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===n)this.calculateInverses();else if(this.bones.length===n.length)this.boneInverses=n.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var e=0,i=this.bones.length;e<i;e++)this.boneInverses.push(new St)}}function xl(t){return(xl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.assign(wl.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,n=this.bones.length;t<n;t++){var e=new St;this.bones[t]&&e.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(e)}},pose:function(){for(var t,n=0,e=this.bones.length;n<e;n++)(t=this.bones[n])&&t.matrixWorld.getInverse(this.boneInverses[n]);for(n=0,e=this.bones.length;n<e;n++)(t=this.bones[n])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){for(var t=this.bones,n=this.boneInverses,e=this.boneMatrices,i=this.boneTexture,r=0,o=t.length;r<o;r++){var s=t[r]?t[r].matrixWorld:_l;bl.multiplyMatrices(s,n[r]),bl.toArray(e,16*r)}void 0!==i&&(i.needsUpdate=!0)},clone:function(){return new wl(this.bones,this.boneInverses)},getBoneByName:function(t){for(var n=0,e=this.bones.length;n<e;n++){var i=this.bones[n];if(i.name===t)return i}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}});var Ml=function(){function t(t){xf.call(this,t),this.dracoLoader=null,this.ddsLoader=null}function i(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}t.prototype=Object.assign(Object.create(xf.prototype),{constructor:t,load:function(n,e,t,i){var r=this,o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:nf(n);r.manager.itemStart(n);function s(t){i?i(t):console.error(t),r.manager.itemError(n),r.manager.itemEnd(n)}var a=new Ef(r.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),"use-credentials"===r.crossOrigin&&a.setWithCredentials(!0),a.load(n,function(t){try{r.parse(t,o,function(t){e(t),r.manager.itemEnd(n)},s)}catch(t){s(t)}},t,s)},setDRACOLoader:function(t){return this.dracoLoader=t,this},setDDSLoader:function(t){return this.ddsLoader=t,this},parse:function(t,n,e,i){var r,o={};if("string"==typeof t)r=t;else if(tf(new Uint8Array(t,0,4))===p){try{o[f.KHR_BINARY_GLTF]=new m(t)}catch(t){return void(i&&i(t))}r=o[f.KHR_BINARY_GLTF].content}else r=tf(new Uint8Array(t));var s=JSON.parse(r);if(void 0===s.asset||s.asset.version[0]<2)i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{if(s.extensionsUsed)for(var a=0;a<s.extensionsUsed.length;++a){var u=s.extensionsUsed[a],h=s.extensionsRequired||[];switch(u){case f.KHR_LIGHTS_PUNCTUAL:o[u]=new l(s);break;case f.KHR_MATERIALS_CLEARCOAT:o[u]=new v;break;case f.KHR_MATERIALS_UNLIT:o[u]=new d;break;case f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:o[u]=new b;break;case f.KHR_DRACO_MESH_COMPRESSION:o[u]=new g(s,this.dracoLoader);break;case f.MSFT_TEXTURE_DDS:o[u]=new c(this.ddsLoader);break;case f.KHR_TEXTURE_TRANSFORM:o[u]=new y;break;case f.KHR_MESH_QUANTIZATION:o[u]=new _;break;default:0<=h.indexOf(u)&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}new z(s,o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse(e,i)}}});var f={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function c(t){if(!t)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=f.MSFT_TEXTURE_DDS,this.ddsLoader=t}function l(t){this.name=f.KHR_LIGHTS_PUNCTUAL;t=t.extensions&&t.extensions[f.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function d(){this.name=f.KHR_MATERIALS_UNLIT}function v(){this.name=f.KHR_MATERIALS_CLEARCOAT}l.prototype.loadLight=function(t){var n,e=this.lightDefs[t],i=new _i(16777215);void 0!==e.color&&i.fromArray(e.color);var r=void 0!==e.range?e.range:0;switch(e.type){case"directional":(n=new Wf(i)).target.position.set(0,0,-1),n.add(n.target);break;case"point":(n=new Yf(i)).distance=r;break;case"spot":(n=new qf(i)).distance=r,e.spot=e.spot||{},e.spot.innerConeAngle=void 0!==e.spot.innerConeAngle?e.spot.innerConeAngle:0,e.spot.outerConeAngle=void 0!==e.spot.outerConeAngle?e.spot.outerConeAngle:Math.PI/4,n.angle=e.spot.outerConeAngle,n.penumbra=1-e.spot.innerConeAngle/e.spot.outerConeAngle,n.target.position.set(0,0,-1),n.add(n.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+e.type+'".')}return n.position.set(0,0,0),n.decay=2,void 0!==e.intensity&&(n.intensity=e.intensity),n.name=e.name||"light_"+t,Promise.resolve(n)},d.prototype.getMaterialType=function(){return ao},d.prototype.extendParams=function(t,n,e){var i=[];t.color=new _i(1,1,1),t.opacity=1;var r=n.pbrMetallicRoughness;return r&&(Array.isArray(r.baseColorFactor)&&(n=r.baseColorFactor,t.color.fromArray(n),t.opacity=n[3]),void 0!==r.baseColorTexture&&i.push(e.assignTexture(t,"map",r.baseColorTexture))),Promise.all(i)},v.prototype.getMaterialType=function(){return hf},v.prototype.extendParams=function(t,n,e){var i=[],n=n.extensions[this.name];return void 0!==n.clearcoatFactor&&(t.clearcoat=n.clearcoatFactor),void 0!==n.clearcoatTexture&&i.push(e.assignTexture(t,"clearcoatMap",n.clearcoatTexture)),void 0!==n.clearcoatRoughnessFactor&&(t.clearcoatRoughness=n.clearcoatRoughnessFactor),void 0!==n.clearcoatRoughnessTexture&&i.push(e.assignTexture(t,"clearcoatRoughnessMap",n.clearcoatRoughnessTexture)),void 0!==n.clearcoatNormalTexture&&(i.push(e.assignTexture(t,"clearcoatNormalMap",n.clearcoatNormalTexture)),void 0!==n.clearcoatNormalTexture.scale&&(n=n.clearcoatNormalTexture.scale,t.clearcoatNormalScale=new ii(n,n))),Promise.all(i)};var p="glTF",a=12,u={JSON:1313821514,BIN:5130562};function m(t){this.name=f.KHR_BINARY_GLTF,this.content=null,this.body=null;var n=new DataView(t,0,a);if(this.header={magic:tf(new Uint8Array(t.slice(0,4))),version:n.getUint32(4,!0),length:n.getUint32(8,!0)},this.header.magic!==p)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var e=new DataView(t,a),i=0;i<e.byteLength;){var r=e.getUint32(i,!0);i+=4;var o,s=e.getUint32(i,!0);i+=4,s===u.JSON?(o=new Uint8Array(t,a+i,r),this.content=tf(o)):s===u.BIN&&(this.body=t.slice(s=a+i,s+r)),i+=r}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function g(t,n){if(!n)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=f.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=n,this.dracoLoader.preload()}function y(){this.name=f.KHR_TEXTURE_TRANSFORM}function h(t){uf.call(this),this.isGLTFSpecularGlossinessMaterial=!0;["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n");var e=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),i=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),r=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),s={specular:{value:(new _i).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this.vs=s,this.onBeforeCompile=function(t){for(var n in s)t.uniforms[n]=s[n];t.fragmentShader=t.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),t.fragmentShader=t.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),t.fragmentShader=t.fragmentShader.replace("#include <metalnessmap_pars_fragment>",e),t.fragmentShader=t.fragmentShader.replace("#include <roughnessmap_fragment>",i),t.fragmentShader=t.fragmentShader.replace("#include <metalnessmap_fragment>",r),t.fragmentShader=t.fragmentShader.replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(t){s.specular.value=t}},specularMap:{get:function(){return s.specularMap.value},set:function(t){s.specularMap.value=t}},glossiness:{get:function(){return s.glossiness.value},set:function(t){s.glossiness.value=t}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(t){(s.glossinessMap.value=t)?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}function b(){return{name:f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return h},extendParams:function(t,n,e){var i=n.extensions[this.name];t.color=new _i(1,1,1),t.opacity=1;var r=[];return Array.isArray(i.diffuseFactor)&&(n=i.diffuseFactor,t.color.fromArray(n),t.opacity=n[3]),void 0!==i.diffuseTexture&&r.push(e.assignTexture(t,"map",i.diffuseTexture)),t.emissive=new _i(0,0,0),t.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,t.specular=new _i(1,1,1),Array.isArray(i.specularFactor)&&t.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture&&(i=i.specularGlossinessTexture,r.push(e.assignTexture(t,"glossinessMap",i)),r.push(e.assignTexture(t,"specularMap",i))),Promise.all(r)},createMaterial:function(t){var n=new h(t);return n.fog=!0,n.color=t.color,n.map=void 0===t.map?null:t.map,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=void 0===t.aoMap?null:t.aoMap,n.aoMapIntensity=1,n.emissive=t.emissive,n.emissiveIntensity=1,n.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,n.bumpMap=void 0===t.bumpMap?null:t.bumpMap,n.bumpScale=1,n.normalMap=void 0===t.normalMap?null:t.normalMap,n.normalMapType=Je,t.normalScale&&(n.normalScale=t.normalScale),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.specularMap=void 0===t.specularMap?null:t.specularMap,n.specular=t.specular,n.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,n.glossiness=t.glossiness,n.alphaMap=null,n.envMap=void 0===t.envMap?null:t.envMap,n.envMapIntensity=1,n.refractionRatio=.98,n}}}function _(){this.name=f.KHR_MESH_QUANTIZATION}function T(t,n,e,i){Tf.call(this,t,n,e,i)}g.prototype.decodePrimitive=function(t,n){var e,i=this.json,r=this.dracoLoader,o=t.extensions[this.name].bufferView,s=t.extensions[this.name].attributes,a={},u={},h={};for(e in s){var c=P[e]||e.toLowerCase();a[c]=s[e]}for(e in t.attributes){var f,l,c=P[e]||e.toLowerCase();void 0!==s[e]&&(f=i.accessors[t.attributes[e]],l=R[f.componentType],h[c]=l,u[c]=!0===f.normalized)}return n.getDependency("bufferView",o).then(function(t){return new Promise(function(i){r.decodeDracoFile(t,function(t){for(var n in t.attributes){var e=t.attributes[n],n=u[n];void 0!==n&&(e.normalized=n)}i(t)},a,h)})})},y.prototype.extendTexture=function(t,n){return t=t.clone(),void 0!==n.offset&&t.offset.fromArray(n.offset),void 0!==n.rotation&&(t.rotation=n.rotation),void 0!==n.scale&&t.repeat.fromArray(n.scale),void 0!==n.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),t.needsUpdate=!0,t},((h.prototype=Object.create(uf.prototype)).constructor=h).prototype.copy=function(t){return uf.prototype.copy.call(this,t),this.specularMap=t.specularMap,this.specular.copy(t.specular),this.glossinessMap=t.glossinessMap,this.glossiness=t.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},((T.prototype=Object.create(Tf.prototype)).constructor=T).prototype.beforeStart_=T.prototype.copySampleValue_=function(t){for(var n=this.resultBuffer,e=this.sampleValues,i=this.valueSize,r=t*i*3+i,o=0;o!==i;o++)n[o]=e[r+o];return n},T.prototype.afterEnd_=T.prototype.copySampleValue_,T.prototype.interpolate_=function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=2*s,u=3*s,h=i-n,i=(e-n)/h,e=i*i,n=e*i,c=t*u,f=c-u,l=-2*n+3*e,d=n-e,v=1-l,p=d-e+i,m=0;m!==s;m++){var g=o[f+m+s],y=o[f+m+a]*h,b=o[c+m+s],_=o[c+m]*h;r[m]=v*g+p*y+l*b+d*_}return r};var w=0,x=1,M=2,E=3,S=4,L=5,O=6,R={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},A={9728:bn,9729:xn,9984:_n,9985:Mn,9986:wn,9987:En},C={33071:gn,33648:yn,10497:mn},k={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},P={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},D={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},j={CUBICSPLINE:void 0,LINEAR:Ie,STEP:Ne},N="OPAQUE",I="MASK",F="BLEND",U={"image/png":Un,"image/jpeg":Fn};function G(t,n){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(n)&&/^\//.test(t)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:n+t)}function B(t,n,e){for(var i in e.extensions)void 0===t[i]&&(n.userData.gltfExtensions=n.userData.gltfExtensions||{},n.userData.gltfExtensions[i]=e.extensions[i])}function H(t,n){void 0!==n.extras&&("object"===xl(n.extras)?Object.assign(t.userData,n.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+n.extras))}function V(t){for(var n="",e=Object.keys(t).sort(),i=0,r=e.length;i<r;i++)n+=e[i]+":"+t[e[i]]+";";return n}function z(t,n,e){this.json=t||{},this.extensions=n||{},this.options=e||{},this.cache=new i,this.primitiveCache={},this.textureLoader=new of(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new Ef(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function W(e,t,i){var n,r,o=t.attributes,s=[];for(n in o){var a=P[n]||n.toLowerCase();a in e.attributes||s.push(function(t,n){return i.getDependency("accessor",t).then(function(t){e.setAttribute(n,t)})}(o[n],a))}return void 0===t.indices||e.index||(r=i.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)}),s.push(r)),H(e,t),function(t,n,e){var i=n.attributes,r=new $;if(void 0!==i.POSITION){var o=(l=e.json.accessors[i.POSITION]).min,s=l.max;if(void 0!==o&&void 0!==s){r.set(new Et(o[0],o[1],o[2]),new Et(s[0],s[1],s[2]));var a=n.targets;if(void 0!==a){for(var u=new Et,h=new Et,c=0,f=a.length;c<f;c++){var l,d=a[c];void 0!==d.POSITION&&(o=(l=e.json.accessors[d.POSITION]).min,s=l.max,void 0!==o&&void 0!==s?(h.setX(Math.max(Math.abs(o[0]),Math.abs(s[0]))),h.setY(Math.max(Math.abs(o[1]),Math.abs(s[1]))),h.setZ(Math.max(Math.abs(o[2]),Math.abs(s[2]))),u.max(h)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."))}r.expandByVector(u)}t.boundingBox=r;n=new it;r.getCenter(n.center),n.radius=r.min.distanceTo(r.max)/2,t.boundingSphere=n}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(e,t,i),Promise.all(s).then(function(){return void 0!==t.targets?function(e,t,n){for(var i=!1,r=!1,o=0,s=t.length;o<s;o++)if(void 0!==(c=t[o]).POSITION&&(i=!0),void 0!==c.NORMAL&&(r=!0),i&&r)break;if(!i&&!r)return Promise.resolve(e);for(var a=[],u=[],o=0,s=t.length;o<s;o++){var h,c=t[o];i&&(h=void 0!==c.POSITION?n.getDependency("accessor",c.POSITION):e.attributes.position,a.push(h)),r&&(h=void 0!==c.NORMAL?n.getDependency("accessor",c.NORMAL):e.attributes.normal,u.push(h))}return Promise.all([Promise.all(a),Promise.all(u)]).then(function(t){var n=t[0],t=t[1];return i&&(e.morphAttributes.position=n),r&&(e.morphAttributes.normal=t),e.morphTargetsRelative=!0,e})}(e,t.targets,i):e})}function X(t,n){var e=t.getIndex();if(null===e){var i=[],r=t.getAttribute("position");if(void 0===r)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(var o=0;o<r.count;o++)i.push(o);t.setIndex(i),e=t.getIndex()}var s=e.count-2,a=[];if(n===Ge)for(o=1;o<=s;o++)a.push(e.getX(0)),a.push(e.getX(o)),a.push(e.getX(o+1));else for(o=0;o<s;o++)o%2==0?(a.push(e.getX(o)),a.push(e.getX(o+1)),a.push(e.getX(o+2))):(a.push(e.getX(o+2)),a.push(e.getX(o+1)),a.push(e.getX(o)));a.length/3!=s&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");t=t.clone();return t.setIndex(a),t}return z.prototype.parse=function(n,t){var e=this,i=this.json,r=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then(function(t){t={scene:t[0][i.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:i.asset,parser:e,userData:{}};B(r,t,i),H(t,i),n(t)}).catch(t)},z.prototype.markDefs=function(){for(var t=this.json.nodes||[],n=this.json.skins||[],e=this.json.meshes||[],i={},r={},o=0,s=n.length;o<s;o++)for(var a=n[o].joints,u=0,h=a.length;u<h;u++)t[a[u]].isBone=!0;for(var c=0,f=t.length;c<f;c++){var l=t[c];void 0!==l.mesh&&(void 0===i[l.mesh]&&(i[l.mesh]=r[l.mesh]=0),i[l.mesh]++,void 0!==l.skin&&(e[l.mesh].isSkinnedMesh=!0))}this.json.meshReferences=i,this.json.meshUses=r},z.prototype.getDependency=function(t,n){var e=t+":"+n,i=this.cache.get(e);if(!i){switch(t){case"scene":i=this.loadScene(n);break;case"node":i=this.loadNode(n);break;case"mesh":i=this.loadMesh(n);break;case"accessor":i=this.loadAccessor(n);break;case"bufferView":i=this.loadBufferView(n);break;case"buffer":i=this.loadBuffer(n);break;case"material":i=this.loadMaterial(n);break;case"texture":i=this.loadTexture(n);break;case"skin":i=this.loadSkin(n);break;case"animation":i=this.loadAnimation(n);break;case"camera":i=this.loadCamera(n);break;case"light":i=this.extensions[f.KHR_LIGHTS_PUNCTUAL].loadLight(n);break;default:throw new Error("Unknown type: "+t)}this.cache.add(e,i)}return i},z.prototype.getDependencies=function(e){var i,t,n=this.cache.get(e);return n||(t=(i=this).json[e+("mesh"===e?"es":"s")]||[],n=Promise.all(t.map(function(t,n){return i.getDependency(e,n)})),this.cache.add(e,n)),n},z.prototype.loadBuffer=function(t){var e=this.json.buffers[t],i=this.fileLoader;if(e.type&&"arraybuffer"!==e.type)throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(void 0===e.uri&&0===t)return Promise.resolve(this.extensions[f.KHR_BINARY_GLTF].body);var r=this.options;return new Promise(function(t,n){i.load(G(e.uri,r.path),t,void 0,function(){n(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})},z.prototype.loadBufferView=function(t){var i=this.json.bufferViews[t];return this.getDependency("buffer",i.buffer).then(function(t){var n=i.byteLength||0,e=i.byteOffset||0;return t.slice(e,e+n)})},z.prototype.loadAccessor=function(t){var g=this,y=this.json,b=this.json.accessors[t];if(void 0===b.bufferView&&void 0===b.sparse)return Promise.resolve(null);t=[];return void 0!==b.bufferView?t.push(this.getDependency("bufferView",b.bufferView)):t.push(null),void 0!==b.sparse&&(t.push(this.getDependency("bufferView",b.sparse.indices.bufferView)),t.push(this.getDependency("bufferView",b.sparse.values.bufferView))),Promise.all(t).then(function(t){var n,e,i,r=t[0],o=k[b.type],s=R[b.componentType],a=s.BYTES_PER_ELEMENT,u=b.byteOffset||0,h=void 0!==b.bufferView?y.bufferViews[b.bufferView].byteStride:void 0,c=!0===b.normalized,f=h&&h!==a*o?(n=Math.floor(u/h),e="InterleavedBuffer:"+b.bufferView+":"+b.componentType+":"+n+":"+b.count,(i=g.cache.get(e))||(i=new vu(new s(r,n*h,b.count*h/a),h/a),g.cache.add(e,i)),new mu(i,o,u%h/a,c)):new dr(null===r?new s(b.count*o):new s(r,u,b.count*o),o,c);if(void 0!==b.sparse){var a=R[b.sparse.indices.componentType],u=b.sparse.indices.byteOffset||0,c=b.sparse.values.byteOffset||0,l=new a(t[1],u,b.sparse.count*k.SCALAR),d=new s(t[2],c,b.sparse.count*o);null!==r&&(f=new dr(f.array.slice(),f.itemSize,f.normalized));for(var v=0,p=l.length;v<p;v++){var m=l[v];if(f.setX(m,d[v*o]),2<=o&&f.setY(m,d[v*o+1]),3<=o&&f.setZ(m,d[v*o+2]),4<=o&&f.setW(m,d[v*o+3]),5<=o)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return f})},z.prototype.loadTexture=function(t){var n=this,e=this.json,r=this.options,o=this.textureLoader,i=self.URL||self.webkitURL,s=e.textures[t],a=s.extensions||{},u=a[f.MSFT_TEXTURE_DDS]?e.images[a[f.MSFT_TEXTURE_DDS].source]:e.images[s.source],h=u.uri,c=!1;return void 0!==u.bufferView&&(h=n.getDependency("bufferView",u.bufferView).then(function(t){c=!0;t=new Blob([t],{type:u.mimeType});return h=i.createObjectURL(t)})),Promise.resolve(h).then(function(e){var i=(i=r.manager.getHandler(e))||(a[f.MSFT_TEXTURE_DDS]?n.extensions[f.MSFT_TEXTURE_DDS].ddsLoader:o);return new Promise(function(t,n){i.load(G(e,r.path),t,void 0,n)})}).then(function(t){!0===c&&i.revokeObjectURL(h),t.flipY=!1,s.name&&(t.name=s.name),u.mimeType in U&&(t.format=U[u.mimeType]);var n=(e.samplers||{})[s.sampler]||{};return t.magFilter=A[n.magFilter]||xn,t.minFilter=A[n.minFilter]||En,t.wrapS=C[n.wrapS]||mn,t.wrapT=C[n.wrapT]||mn,t})},z.prototype.assignTexture=function(e,i,r){var o=this;return this.getDependency("texture",r.index).then(function(t){if(!t.isCompressedTexture)switch(i){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":t.format=Fn}var n;void 0===r.texCoord||0==r.texCoord||"aoMap"===i&&1==r.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+r.texCoord+" for texture "+i+" not yet supported."),!o.extensions[f.KHR_TEXTURE_TRANSFORM]||(n=void 0!==r.extensions?r.extensions[f.KHR_TEXTURE_TRANSFORM]:void 0)&&(t=o.extensions[f.KHR_TEXTURE_TRANSFORM].extendTexture(t,n)),e[i]=t})},z.prototype.assignFinalMaterial=function(t){var n,e,i,r=t.geometry,o=t.material,s=void 0!==r.attributes.tangent,a=void 0!==r.attributes.color,u=void 0===r.attributes.normal,h=!0===t.isSkinnedMesh,c=0<Object.keys(r.morphAttributes).length,f=c&&void 0!==r.morphAttributes.normal;t.isPoints?(e="PointsMaterial:"+o.uuid,(n=this.cache.get(e))||(n=new af,Vr.prototype.copy.call(n,o),n.color.copy(o.color),n.map=o.map,n.sizeAttenuation=!1,this.cache.add(e,n)),o=n):t.isLine&&(e="LineBasicMaterial:"+o.uuid,(i=this.cache.get(e))||(i=new pf,Vr.prototype.copy.call(i,o),i.color.copy(o.color),this.cache.add(e,i)),o=i),(s||a||u||h||c)&&(e="ClonedMaterial:"+o.uuid+":",o.isGLTFSpecularGlossinessMaterial&&(e+="specular-glossiness:"),h&&(e+="skinning:"),s&&(e+="vertex-tangents:"),a&&(e+="vertex-colors:"),u&&(e+="flat-shading:"),c&&(e+="morph-targets:"),f&&(e+="morph-normals:"),(i=this.cache.get(e))||(i=o.clone(),h&&(i.skinning=!0),s&&(i.vertexTangents=!0),a&&(i.vertexColors=!0),u&&(i.flatShading=!0),c&&(i.morphTargets=!0),f&&(i.morphNormals=!0),this.cache.add(e,i)),o=i),o.aoMap&&void 0===r.attributes.uv2&&void 0!==r.attributes.uv&&r.setAttribute("uv2",new dr(r.attributes.uv.array,2)),o.normalScale&&!s&&(o.normalScale.y=-o.normalScale.y),o.clearcoatNormalScale&&!s&&(o.clearcoatNormalScale.y=-o.clearcoatNormalScale.y),t.material=o},z.prototype.loadMaterial=function(t){var n,e,i=this.json,r=this.extensions,o=i.materials[t],s={},a=o.extensions||{},i=[];a[f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]?(t=r[f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS],n=t.getMaterialType(),i.push(t.extendParams(s,o,this))):a[f.KHR_MATERIALS_UNLIT]?(e=r[f.KHR_MATERIALS_UNLIT],n=e.getMaterialType(),i.push(e.extendParams(s,o,this))):(n=uf,u=o.pbrMetallicRoughness||{},s.color=new _i(1,1,1),s.opacity=1,Array.isArray(u.baseColorFactor)&&(s.color.fromArray(e=u.baseColorFactor),s.opacity=e[3]),void 0!==u.baseColorTexture&&i.push(this.assignTexture(s,"map",u.baseColorTexture)),s.metalness=void 0!==u.metallicFactor?u.metallicFactor:1,s.roughness=void 0!==u.roughnessFactor?u.roughnessFactor:1,void 0!==u.metallicRoughnessTexture&&(i.push(this.assignTexture(s,"metalnessMap",u.metallicRoughnessTexture)),i.push(this.assignTexture(s,"roughnessMap",u.metallicRoughnessTexture)))),!0===o.doubleSided&&(s.side=yt);var u=o.alphaMode||N;return u===F?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,u===I&&(s.alphaTest=void 0!==o.alphaCutoff?o.alphaCutoff:.5)),void 0!==o.normalTexture&&n!==ao&&(i.push(this.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new ii(1,1),void 0!==o.normalTexture.scale&&s.normalScale.set(o.normalTexture.scale,o.normalTexture.scale)),void 0!==o.occlusionTexture&&n!==ao&&(i.push(this.assignTexture(s,"aoMap",o.occlusionTexture)),void 0!==o.occlusionTexture.strength&&(s.aoMapIntensity=o.occlusionTexture.strength)),void 0!==o.emissiveFactor&&n!==ao&&(s.emissive=(new _i).fromArray(o.emissiveFactor)),void 0!==o.emissiveTexture&&n!==ao&&i.push(this.assignTexture(s,"emissiveMap",o.emissiveTexture)),a[f.KHR_MATERIALS_CLEARCOAT]&&(u=r[f.KHR_MATERIALS_CLEARCOAT],n=u.getMaterialType(),i.push(u.extendParams(s,{extensions:a},this))),Promise.all(i).then(function(){var t=n===h?r[f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new n(s);return o.name&&(t.name=o.name),t.map&&(t.map.encoding=He),t.emissiveMap&&(t.emissiveMap.encoding=He),H(t,o),o.extensions&&B(r,t,o),t})},z.prototype.loadGeometries=function(t){var e=this,i=this.extensions,n=this.primitiveCache;for(var r=[],o=0,s=t.length;o<s;o++){var a=t[o],u=(u=void 0,h=(u=(h=a).extensions&&h.extensions[f.KHR_DRACO_MESH_COMPRESSION])?"draco:"+u.bufferView+":"+u.indices+":"+V(u.attributes):h.indices+":"+V(h.attributes)+":"+h.mode),h=n[u];h?r.push(h.promise):(h=a.extensions&&a.extensions[f.KHR_DRACO_MESH_COMPRESSION]?function(n){return i[f.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(n,e).then(function(t){return W(t,n,e)})}(a):W(new kr,a,e),n[u]={primitive:a,promise:h},r.push(h))}return Promise.all(r)},z.prototype.loadMesh=function(f){for(var l=this,d=this.json.meshes[f],v=d.primitives,t=[],n=0,e=v.length;n<e;n++){var i=void 0===v[n].material?(void 0===(i=this.cache).DefaultMaterial&&(i.DefaultMaterial=new uf({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:gt})),i.DefaultMaterial):this.getDependency("material",v[n].material);t.push(i)}return t.push(l.loadGeometries(v)),Promise.all(t).then(function(t){for(var n=t.slice(0,t.length-1),e=t[t.length-1],i=[],r=0,o=e.length;r<o;r++){var s,a=e[r],u=v[r],h=n[r];if(u.mode===S||u.mode===L||u.mode===O||void 0===u.mode)!0!==(s=new(!0===d.isSkinnedMesh?Kf:To)(a,h)).isSkinnedMesh||s.geometry.attributes.skinWeight.normalized||s.normalizeSkinWeights(),u.mode===L?s.geometry=X(s.geometry,1):u.mode===O&&(s.geometry=X(s.geometry,Ge));else if(u.mode===x)s=new ol(a,h);else if(u.mode===E)s=new el(a,h);else if(u.mode===M)s=new sl(a,h);else{if(u.mode!==w)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);s=new fl(a,h)}0<Object.keys(s.geometry.morphAttributes).length&&function(t,n){if(t.updateMorphTargets(),void 0!==n.weights)for(var e=0,i=n.weights.length;e<i;e++)t.morphTargetInfluences[e]=n.weights[e];if(n.extras&&Array.isArray(n.extras.targetNames)){var r=n.extras.targetNames;if(t.morphTargetInfluences.length===r.length){t.morphTargetDictionary={};for(e=0,i=r.length;e<i;e++)t.morphTargetDictionary[r[e]]=e}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}(s,d),s.name=d.name||"mesh_"+f,1<e.length&&(s.name+="_"+r),H(s,d),l.assignFinalMaterial(s),i.push(s)}if(1===i.length)return i[0];for(var c=new La,r=0,o=i.length;r<o;r++)c.add(i[r]);return c})},z.prototype.loadCamera=function(t){var n,e=this.json.cameras[t],t=e[e.type];if(t)return"perspective"===e.type?n=new Z(Mt.radToDeg(t.yfov),t.aspectRatio||1,t.znear||1,t.zfar||2e6):"orthographic"===e.type&&(n=new q(t.xmag/-2,t.xmag/2,t.ymag/2,t.ymag/-2,t.znear,t.zfar)),e.name&&(n.name=e.name),H(n,e),Promise.resolve(n);console.warn("THREE.GLTFLoader: Missing camera parameters.")},z.prototype.loadSkin=function(t){var t=this.json.skins[t],n={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then(function(t){return n.inverseBindMatrices=t,n})},z.prototype.loadAnimation=function(E){for(var S=this.json.animations[E],t=[],n=[],e=[],i=[],r=[],o=0,s=S.channels.length;o<s;o++){var a=S.channels[o],u=S.samplers[a.sampler],h=a.target,c=void 0!==h.node?h.node:h.id,f=void 0!==S.parameters?S.parameters[u.input]:u.input,a=void 0!==S.parameters?S.parameters[u.output]:u.output;t.push(this.getDependency("node",c)),n.push(this.getDependency("accessor",f)),e.push(this.getDependency("accessor",a)),i.push(u),r.push(h)}return Promise.all([Promise.all(t),Promise.all(n),Promise.all(e),Promise.all(i),Promise.all(r)]).then(function(t){for(var n=t[0],e=t[1],i=t[2],r=t[3],o=t[4],s=[],a=0,u=n.length;a<u;a++){var h,c=n[a],f=e[a],l=i[a],d=r[a],v=o[a];if(void 0!==c){switch(c.updateMatrix(),c.matrixAutoUpdate=!0,D[v.path]){case D.weights:h=Pf;break;case D.rotation:h=jf;break;case D.position:case D.scale:default:h=If}var p=c.name||c.uuid,m=void 0!==d.interpolation?j[d.interpolation]:Ie,g=[];D[v.path]===D.weights?c.traverse(function(t){!0===t.isMesh&&t.morphTargetInfluences&&g.push(t.name||t.uuid)}):g.push(p);var y,b=l.array;if(l.normalized){if(b.constructor===Int8Array)y=1/127;else if(b.constructor===Uint8Array)y=1/255;else if(b.constructor==Int16Array)y=1/32767;else{if(b.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");y=1/65535}for(var _=new Float32Array(b.length),w=0,x=b.length;w<x;w++)_[w]=b[w]*y;b=_}for(w=0,x=g.length;w<x;w++){var M=new h(g[w]+"."+D[v.path],f.array,b,m);"CUBICSPLINE"===d.interpolation&&(M.createInterpolant=function(t){return new T(this.times,this.values,this.getValueSize()/3,t)},M.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),s.push(M)}}}return new Ff(S.name||"animation_"+E,void 0,s)})},z.prototype.loadNode=function(t){var n=this.json,o=this.extensions,e=this,i=n.meshReferences,r=n.meshUses,s=n.nodes[t];return t=[],void 0!==s.mesh&&t.push(e.getDependency("mesh",s.mesh).then(function(t){var n,e;return 1<i[s.mesh]?(n=r[s.mesh]++,(e=t.clone()).name+="_instance_"+n):e=t,void 0!==s.weights&&e.traverse(function(t){if(t.isMesh)for(var n=0,e=s.weights.length;n<e;n++)t.morphTargetInfluences[n]=s.weights[n]}),e})),void 0!==s.camera&&t.push(e.getDependency("camera",s.camera)),s.extensions&&s.extensions[f.KHR_LIGHTS_PUNCTUAL]&&void 0!==s.extensions[f.KHR_LIGHTS_PUNCTUAL].light&&t.push(e.getDependency("light",s.extensions[f.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(t).then(function(t){var n,e=!0===s.isBone?new dl:1<t.length?new La:1===t.length?t[0]:new Y;if(e!==t[0])for(var i=0,r=t.length;i<r;i++)e.add(t[i]);return s.name&&(e.userData.name=s.name,e.name=yl.sanitizeNodeName(s.name)),H(e,s),s.extensions&&B(o,e,s),void 0!==s.matrix?((n=new St).fromArray(s.matrix),e.applyMatrix4(n)):(void 0!==s.translation&&e.position.fromArray(s.translation),void 0!==s.rotation&&e.quaternion.fromArray(s.rotation),void 0!==s.scale&&e.scale.fromArray(s.scale)),e})},z.prototype.loadScene=function(t){var n=this.json,e=this.extensions,t=this.json.scenes[t],i=new ir;t.name&&(i.name=t.name),H(i,t),t.extensions&&B(e,i,t);for(var r=t.nodes||[],o=[],s=0,a=r.length;s<a;s++)o.push(function s(t,a,u,h){var c=u.nodes[t];return h.getDependency("node",t).then(function(t){return void 0===c.skin?t:h.getDependency("skin",c.skin).then(function(t){for(var n=[],e=0,i=(a=t).joints.length;e<i;e++)n.push(h.getDependency("node",a.joints[e]));return Promise.all(n)}).then(function(s){return t.traverse(function(t){if(t.isMesh){for(var n=[],e=[],i=0,r=s.length;i<r;i++){var o=s[i];o?(n.push(o),o=new St,void 0!==a.inverseBindMatrices&&o.fromArray(a.inverseBindMatrices.array,16*i),e.push(o)):console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',a.joints[i])}t.bind(new wl(n,e),t.matrixWorld)}}),t});var a}).then(function(t){a.add(t);var n=[];if(c.children)for(var e=c.children,i=0,r=e.length;i<r;i++){var o=e[i];n.push(s(o,t,u,h))}return Promise.all(n)})}(r[s],i,n,this));return Promise.all(o).then(function(){return i})},t}();function El(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}ki=function(){function i(t,n,e){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i),this.ps=t,this.ms=n,this.gs=e,this.preLoadModels={},this.waitingBacks={},this.ys=new Bf,this.bs=new Ml}var t,n,e;return t=i,(n=[{key:"path",get:function(){return this.ps},set:function(t){this.ps=t}},{key:"load",value:function(t,n,e){var i=this,r=t.normalID,o=this._s(r,t.model),s=this.preLoadModels[r].modelUrl.split("."),a="js"===s[1]?this.ys:this.bs;o.loaded?e(o.geometry,o.material,o.isGltf):(this.ws(t.normalID,e,n),o.isLoading||(o=this.ms?s[0]+"/"+this.preLoadModels[r].modelUrl+"?keyValue="+this.gs:this.preLoadModels[r].modelUrl+"?keyValue="+this.gs,a.setPath(this.ps),this.preLoadModels[r].isLoading=!0,a.load(o,function(t,n){if(i.preLoadModels[r]){for(var e in i.preLoadModels[r].isGltf="js"!==s[1],i.preLoadModels[r].geometry=t,i.preLoadModels[r].material=n,i.preLoadModels[r].isLoading=!1,i.preLoadModels[r].loaded=!0,i.waitingBacks[r])i.waitingBacks[r][e](t,n,i.preLoadModels[r].isGltf);i.waitingBacks[r].length=0}},function(t){},function(t){console.error(t),i.preLoadModels[r].isLoading=!1})))}}])&&El(t.prototype,n),e&&El(t,e),i}();Object.assign(ki.prototype,{_s:function(t,n){return this.preLoadModels[t]||(this.preLoadModels[t]={loaded:!1,isLoading:!1,modelUrl:n,model:null,geometry:null,material:null}),this.preLoadModels[t]},ws:function(t,n,e){this.waitingBacks[t]||(this.waitingBacks[t]={}),this.waitingBacks[t][e]||(this.waitingBacks[t][e]=n)},st:function(){this.preLoadModels={},this.waitingBacks={},this.ys=null,this.bs=null}});var Sl=ki;function Tl(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}ah=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Cn=-1,this.Tn=Xi.NONE,this.Ke=!0,this.gt=null}var n,e,i;return n=t,(e=[{key:"type",get:function(){return this.Tn}},{key:"visible",get:function(){return this.Ke},set:function(t){this.Ke=t}},{key:"parent",get:function(){return this.gt}}])&&Tl(n.prototype,e),i&&Tl(n,i),t}();Object.assign(ah.prototype,{Nr:function(t){for(var n=this.gt;n;){if(n instanceof t)return n;n=n.gt}return null}});var Ll=ah;function Ol(t){return(Ol="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rl(t,n){return(Rl=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Al(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Cl(e);return t=i?(t=Cl(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Ol(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Cl(t){return(Cl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}e=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Rl(t,n)}(e,Ll);var n=Al(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).yt=[],t}return e}();Object.assign(e.prototype,{});var kl=e;function Pl(t,n){Hf.call(this,t,n),this.type="AmbientLight",this.castShadow=void 0}function Dl(t){return(Dl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jl(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Nl(t,n){return(Nl=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Il(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Fl(e);return t=i?(t=Fl(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Dl(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Fl(t){return(Fl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Pl.prototype=Object.assign(Object.create(Hf.prototype),{constructor:Pl,isAmbientLight:!0});var Ul=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Nl(t,n)}(r,kl);var t,n,e,i=Il(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Ce=new ir,t}return t=r,(n=[{key:"getScene",value:function(){return this.Ce}}])&&jl(t.prototype,n),e&&jl(t,e),r}();function Gl(t){return(Gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bl(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Hl(t,n){return(Hl=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Vl(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=zl(e);return t=i?(t=zl(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Gl(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function zl(t){return(zl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Qu=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Hl(t,n)}(r,Ul);var t,n,e,i=Vl(r);function r(){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),i.call(this)}return t=r,(n=[{key:"removeLight",value:function(){this.xs&&this.xs()}}])&&Bl(t.prototype,n),e&&Bl(t,e),r}();Object.assign(Qu.prototype,{Ms:function(t,n,e,i){this.Ce.userData.level=e,this.Ce.position.y=n.Es*e;for(var r=0;r<this.yt.length;r++)t.Ss(this.Tn,this.yt[r],n);i&&i()}});var Wl=Qu;function Xl(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}hh=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.Tn=Xi.EXTENT,this.Ln=null,this.Ts=void 0,this.It=void 0!==t.height?t.height:1,this.On=t,this.Ke=!0,this.Cn=-1,this.gt=null,this.Ls=this.Ls.bind(this),this.Os=0,this.Rs=null,this.et=this.et.bind(this)}var t,e,i;return t=n,(e=[{key:"getData",value:function(){var t=this.On;return{typeID:null,area:t.area,eid:t.eid,bound:t.Ni,coordinates:t.ji,id:t.Cn}}},{key:"getPosition",value:function(){var t=this.On.Ni;return{x:(t.Ci.x+t.Ai.x)/2,y:(t.Ci.y+t.Ai.y)/2,z:this.It}}},{key:"getBound",value:function(){var t=this.On.Ni;return{minX:t.Ai.x,maxX:t.Ci.x,minY:t.Ai.y,maxY:t.Ci.y}}},{key:"visible",get:function(){return this.Ke},set:function(t){this.Ke=t,this.Ln?this.Ln.visible=this.Ke:this.Nr(Xm).Ut.gt.on("update",this.Ls)}},{key:"x",get:function(){return this.getPosition().x}},{key:"y",get:function(){return this.getPosition().y}},{key:"level",get:function(){return this.gt.gt.kt}},{key:"ID",get:function(){return this.Cn}},{key:"height",get:function(){return this.It}},{key:"type",get:function(){return this.Tn}}])&&Xl(t.prototype,e),i&&Xl(t,i),n}();Object.assign(hh.prototype,{Ls:function(){var t;this.Ln&&(t=this.Nr(Xm).Ut,10<this.Os&&t.gt.off("update",this.Ls),this.Ln.visible=this.Ke,this.Os++)},Nr:function(t){for(var n=this.gt;n;){if(n instanceof t)return n;n=n.gt}return null},As:function(t,n){this.Ts&&(this.Ln||(t.userData.opacity=t.opacity,this.Ln=new To(this.Ts.geometry,t),t.opacity=1,t.userData.opacity=1,t.transparent=!0,this.Ln.rotation.set(-Math.PI/2,0,0,"XYZ"),this.Ln.position.copy(n),this.Ln.receiveShadow=!0,(this.Ln.mapNode=this).Ts=null,this.gt.Ce.add(this.Ln)))},Cs:function(t,n){this.Ln&&(n=n.Uo(),n=t.ks.Qr(n),this.Ln.material.dispose(),this.Ln.material=n)},st:function(){for(var t in this.Ln&&(this.Ln.parent.remove(this.Ln),this.Ln.material.dispose(),this.Ln.geometry.dispose(),this.Ln.material=void 0,this.Ln.geometry=void 0,this.Ts=void 0,this.Ln.mapNode=void 0,this.Ln=void 0),this.gt=null,delete this.gt,this)this[""+t]&&this[""+t].st&&this[""+t].st(),this[""+t]=null,delete this[""+t]},Ps:function(t){var n,e=this.Nr(Xm).Ut;this.Ln?(n={color:this.Ln.material.color,alpha:this.Ln.material.opacity,url:t},n=e.ks.Qr(n),this.Ln.material=n):(this.Rs=t,e.gt.on("update",this.et))},et:function(){var t,n=this.Nr(Xm).Ut;this.Ln&&null!==this.Rs&&(n.gt.off("update",this.et),t={color:this.Ln.material.color,alpha:this.Ln.material.opacity,url:this.Rs},t=n.ks.Qr(t),this.Ln.material=t,this.Rs=null)}});var Yl=hh;function Zl(t){return(Zl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ql(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||Kl(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kl(t,n){if(t){if("string"==typeof t)return Jl(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Jl(t,n):void 0}}function Jl(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Ql(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function $l(t,n){return($l=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function td(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=nd(e);return t=i?(t=nd(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Zl(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function nd(t){return(nd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}oh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&$l(t,n)}(r,Wl);var t,n,e,i=td(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Tn=Xi.EXTENT_LAYER,n.Ce.name="extent",n.Ce.userData.type="extent",n.Ds={},n.js=t.alias,n.Ns=t.desc,n.It=t.height,n.On=t,n.Is(t),n.Ke=!0,n.Fs(),n.Us(),n.Ni=null,n}return t=r,(n=[{key:"getFeatures",value:function(){return this.yt}},{key:"level",get:function(){return this.gt.kt}},{key:"type",get:function(){return this.Tn}},{key:"getBound",value:function(){if(null!==this.Ni)return this.Ni;for(var t=0;t<this.yt.length;t++){var n=this.yt[t].getBound();null===this.Ni?this.Ni={minX:n.minX,maxX:n.maxX,minY:n.minY,maxY:n.maxY}:(this.Ni.minX>n.minX&&(this.Ni.minX=n.minX),this.Ni.maxX<n.maxX&&(this.Ni.maxX=n.maxX),this.Ni.minY>n.minY&&(this.Ni.minY=n.minY),this.Ni.maxY<n.maxY&&(this.Ni.maxY=n.maxY))}return this.Ni}},{key:"visible",get:function(){return this.Ke},set:function(t){this.Ke=t,this.Ce.visible=t}}])&&Ql(t.prototype,n),e&&Ql(t,e),r}();Object.assign(oh.prototype,{Is:function(t){var n,e=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=Kl(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.yt);try{for(e.s();!(n=e.n()).done;){var i=ql(n.value,2),r=(i[0],i[1]),o=new Yl(r);(o.gt=this).yt.push(o)}}catch(t){e.e(t)}finally{e.f()}},Fs:function(){this.Gs=new Pl(7631988),this.Bs=new Y,this.Hs=new Wf(8947848,1.2),this.Hs.position.set(-1,1,1).normalize(),this.Hs.castShadow=!1,this.Hs.target=this.Bs,this.Vs=new Wf(3355443),this.Vs.position.set(-.5,1,-1).normalize(),this.Vs.target=this.Bs},Us:function(){this.Ce.add(this.Hs),this.Ce.add(this.Gs),this.Ce.add(this.Vs),this.Ce.add(this.Bs)},xs:function(){this.Ce.remove(this.Hs),this.Ce.remove(this.Gs),this.Ce.remove(this.Vs)},zs:function(){this.Hs=void 0,this.Gs=void 0,this.Vs=void 0},st:function(){this.xs(),this.zs();for(var t,n=0;n<this.yt.length;n++)this.yt[n].st();for(t in this.yt.length=0,this.Ce.length=0,this.gt=null,delete this.gt,this)this[""+t]&&this[""+t].st&&this[""+t].st(),this[""+t]=null,delete this[""+t]}});var ed=oh;function id(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}qu=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.Tn=Xi.MODEL,this.Ws=t.fid,this.We=t.maxlevel,this.Xe=t.minlevel,this.Xs=t.name,this.Ys=t.pass,this.Nt=t.Nt,this.On=t,this.It=t.height,this.Ln=null,this.Ts=void 0,this.Zs=null,this.qs=new _i("#FF0000"),this.bt=null,this.Ni=null,this.Ke=!0,this.Ks=null,this.Js={top:null,left:null,right:null,front:null,back:null},this.Cn=-1,this.gt=null,this.Qs=this.Qs.bind(this),this.$s=this.$s.bind(this),this.Ls=this.Ls.bind(this),this.ta=null,this.Os=0,this.jo=null}var t,e,i;return t=n,(e=[{key:"getData",value:function(){var t=this.On;return{typeID:t.type||null,FID:t.fid||null,height:t.height||null,name:t.name||null,eName:t.ename||null,minLevel:t.minlevel||null,maxLevel:t.maxlevel||null,pass:t.pass||null}}},{key:"setColor",value:function(t,n){var e,i=this.Nr(Xm).Ut;this.Ln?(e=i.ks.Qr({color:t,alpha:n}),this.Ln.material=e.clone()):(n=i.ks.Qr({color:t,alpha:n}),this.ta=n.clone(),i.gt.on("update",this.Qs))}},{key:"resetColor",value:function(){var t=this.Nr(Xm).Ut.ks.Qr(this.jo);this.Ln.material=t.clone()}},{key:"setBorderColor",value:function(t,n){var e=this.Nr(Xm).Ut;if(this.Zs){var i=e.ks.to({strokeColor:t,opacity:n},!0);this.Zs.material=i.clone();for(var r=0;r<this.Zs.children.length;r++)this.Zs.children[r].material=i.clone()}else{n=e.ks.to({strokeColor:t,opacity:n},!0);this.na=n.clone(),e.gt.on("update",this.et)}}},{key:"resetBorderColor",value:function(){if(this.jo){var t=this.Nr(Xm).Ut.ks.to(this.jo,!0);if(this.Zs){this.Zs.material=t.clone();for(var n=0;n<this.Zs.children.length;n++)this.Zs.children[n].material=t.clone()}}}},{key:"setTopImage",value:function(t){var n=this.Nr(Xm).Ut,e=this.gt.gt.gt,i=e.I,r=e.F,o=t.mapCoord||this.Nt;t=Object.assign({size:[5,5],height:this.It+.1,angle:0,offset:[0,0]},t),this.Js.top&&this.clearTopImage();var e=new Br(1,1,1,1),s=new df({transparent:!0,depthWrite:!1,visible:!1});n.ks.fo(t.image,function(t){t.anisotropy=4,t.minFilter=xn,s.map=t,s.needsUpdate=!0,s.visible=!0});e=new To(e,s);e.scale.set(t.size[0],t.size[1],1),e.position.set(t.offset[0]+o.x-i,t.offset[1]+o.y-r,t.height),e.rotation.z=-t.angle*Math.PI/180,e.renderOrder=10,this.Ln?this.Ln.add(e):(this.ea=e,n.gt.on("update",this.$s)),this.Js.top=e}},{key:"clearTopImage",value:function(){this.Js.top&&this.Js.top.parent&&(this.Js.top.parent.remove(this.Js.top),this.Js.top.geometry.dispose(),this.Js.top.material.map&&this.Js.top.material.map.dispose(),this.Js.top.material.dispose(),this.Js.top=null)}},{key:"flash",value:function(t){var n=this;this.ia(t);var e=this.qs,i=this.Nr(Xm).Ut;this.ra||(t=this.Ln.material.clone(),this.ra={color:t.color,opacity:t.opacity});var r=0,o=i.ks.Qr({color:e,alpha:this.ra.opacity}).clone();!function t(){o.color=r%2==0?e:n.ra.color,n.Ln.material=o,r++,n.Ks=setTimeout(t,100)}()}},{key:"stopFlash",value:function(){this.Ks&&(this.Ln.material.color=this.ra.color,clearTimeout(this.Ks),this.Ks=null)}},{key:"getPosition",value:function(){return{x:this.Nt.x,y:this.Nt.y,z:this.It}}},{key:"getBound",value:function(){if(null!==this.Ni)return this.Ni;var t=this.On.ji[0];this.Ni={};for(var n=0;n<t.length;n++)(!this.Ni.minX||this.Ni.minX>t[n].x)&&(this.Ni.minX=t[n].x),(!this.Ni.maxX||this.Ni.maxX<t[n].x)&&(this.Ni.maxX=t[n].x),(!this.Ni.minY||this.Ni.minY>t[n].y)&&(this.Ni.minY=t[n].y),(!this.Ni.maxY||this.Ni.maxY<t[n].y)&&(this.Ni.maxY=t[n].y);return this.Ni}},{key:"x",get:function(){return this.Nt.x}},{key:"y",get:function(){return this.Nt.y}},{key:"visible",get:function(){return this.Ke},set:function(t){this.Ke=t,this.Ln?this.Ln.visible=this.Ke:this.Nr(Xm).Ut.gt.on("update",this.Ls)}},{key:"zoomRange",get:function(){return{maxlevel:this.We,minlevel:this.Xe}}},{key:"type",get:function(){return this.Tn}},{key:"name",get:function(){return this.Xs}},{key:"FID",get:function(){return this.Ws}},{key:"level",get:function(){return this.gt.gt.kt}},{key:"height",get:function(){return this.It}},{key:"ID",get:function(){return this.Cn}}])&&id(t.prototype,e),i&&id(t,i),n}();Object.assign(qu.prototype,{Qs:function(){var t=this.Nr(Xm).Ut;if(this.Ln){if(10<this.Os&&t.gt.off("update",this.Qs),this.ta&&(this.Ln.material=this.ta),this.Zs&&this.na){this.Zs.material=this.na;for(var n=0;n<this.Zs.children.length;n++)this.Zs.children[n].material=this.na}this.Os++}},$s:function(){var t;this.Ln&&(t=this.Nr(Xm).Ut,10<this.Os&&t.gt.off("update",this.$s),this.Ln.add(this.ea),this.Os++)},Ls:function(){var t;this.Ln&&(t=this.Nr(Xm).Ut,10<this.Os&&t.gt.off("update",this.Ls),this.Ln.visible=this.Ke,this.Os++)},Nr:function(t){for(var n=this.gt;n;){if(n instanceof t)return n;n=n.gt}return null},ia:function(t){this.qs=new _i(t)},As:function(t,n){this.Ts&&(this.Ln||(this.Ln=new To(this.Ts.geometry,t),this.Ln.mapNode=this,t.userData.opacity=t.opacity,this.Ln.rotation.set(-Math.PI/2,0,0,"XYZ"),this.Ln.position.copy(n),this.gt.Ce.add(this.Ln)))},oa:function(r,o){if(this.Ts){var t=(new fr).setFromPoints(this.Ts.shape.getPoints());t&&0<t.vertices.length&&t.vertices.push(t.vertices[0]);for(var n=[],e=t.vertices.length,i=0;i<e;i++)t.vertices[i].z=o,0==i||i==e-1?n.push(t.vertices[i]):n.push(t.vertices[i],t.vertices[i]);t.vertices=n;var s=new ol(t,r);if(s.castShadow=!1,s.geometry.computeBoundingSphere(),this.Zs=s,this.Zs.frustumCulled=!1,this.Zs.matrixAutoUpdate=!1,this.Ln.add(s),this.Ts.shape.holes)for(var a=0;a<this.Ts.shape.holes.length;a++)!function(t,n){for(var e=0;e<n.length;e++){var i=[];i.push(new Et(n[e].v1.x,n[e].v1.y,o)),i.push(new Et(n[e].v2.x,n[e].v2.y,o));i=new ol((new kr).setFromPoints(i),r);t.add(i)}}(s,this.Ts.shape.holes[a].curves)}},Cs:function(t,n){if(this.Ln){var e=n.Go({fid:this.Ws+"",typeID:this.getData().typeID+""}),i=t.ks.Qr(e);this.Ln.material=i;var r=t.ks.to(e,!0);if(this.Zs){this.Zs.material=r;for(var o=0;o<this.Zs.children.length;o++)this.Zs.children[o].material=r}this.clearTopImage(),(this.jo=e).image&&""!==e.image&&e.sizes&&(n=e.sizes.split(","),i=[],e.coords&&(i=e.coords.split(",")),this.setTopImage({image:e.image?t.gt.Et.themeURL+"/"+t.gt.Et.themeName+"/"+e.image:"",angle:e.angle||0,size:[parseFloat(n[0]),parseFloat(n[1])],mapCoord:e.coords?new ii(parseFloat(i[0]),parseFloat(i[1])):void 0}))}},st:function(){for(var t in this.Ln&&(this.Zs&&(this.Ln.remove(this.Zs),this.Zs.material.dispose(),this.Zs.geometry.dispose(),this.Zs=void 0),this.clearTopImage(),this.Ln.parent.remove(this.Ln),this.Ln.material.dispose(),this.Ln.geometry.dispose(),this.Ln.material=void 0,this.Ln.geometry=void 0,this.Ts=void 0,this.On=void 0,this.Ln.mapNode=void 0,this.Ln=void 0),this.gt=null,delete this.gt,this)this[""+t]&&this[""+t].st&&this[""+t].st(),this[""+t]=null,delete this[""+t]}});var rd=qu;function od(t){return(od="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sd(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||ad(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ad(t,n){if(t){if("string"==typeof t)return ud(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?ud(t,n):void 0}}function ud(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function hd(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function cd(t,n){return(cd=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function fd(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=ld(e);return t=i?(t=ld(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==od(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function ld(t){return(ld=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ih=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&cd(t,n)}(r,Wl);var t,n,e,i=fd(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Tn=Xi.MODEL_LAYER,n.Ce.name="model",n.Ce.userData.type="model",n.js="model",n.sa={},n.Ni=null,n.Is(t),n.Ke=!0,n.Fs(),n.Us(),n}return t=r,(n=[{key:"getBound",value:function(){if(null!==this.Ni)return this.Ni;for(var t=0;t<this.yt.length;t++){var n=this.yt[t].getBound();null===this.Ni?this.Ni={minX:n.minX,maxX:n.maxX,minY:n.minY,maxY:n.maxY}:(this.Ni.minX>n.minX&&(this.Ni.minX=n.minX),this.Ni.maxX<n.maxX&&(this.Ni.maxX=n.maxX),this.Ni.minY>n.minY&&(this.Ni.minY=n.minY),this.Ni.maxY<n.maxY&&(this.Ni.maxY=n.maxY))}return this.Ni}},{key:"getFeatures",value:function(){return this.yt}},{key:"level",get:function(){return this.gt.kt}},{key:"height",get:function(){return this.gt.It}},{key:"type",get:function(){return this.Tn}},{key:"visible",get:function(){return this.Ke},set:function(t){this.Ke=t,this.Ce.visible=t}}])&&hd(t.prototype,n),e&&hd(t,e),r}();Object.assign(ih.prototype,{Is:function(t){var n,e=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=ad(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.yt);try{for(e.s();!(n=e.n()).done;){var i=sd(n.value,2),r=(i[0],i[1]),o=new rd(r);(o.gt=this).yt.push(o)}}catch(t){e.e(t)}finally{e.f()}},Fs:function(){this.Gs=new Pl(7631988),this.Bs=new Y,this.Hs=new Wf(8947848,1.2),this.Hs.position.set(-1,1,1).normalize(),this.Hs.castShadow=!1,this.Hs.target=this.Bs,this.Vs=new Wf(3355443),this.Vs.position.set(-.5,1,-1).normalize(),this.Vs.target=this.Bs},Us:function(){this.Ce.add(this.Hs),this.Ce.add(this.Gs),this.Ce.add(this.Vs),this.Ce.add(this.Bs)},xs:function(){this.Ce.remove(this.Hs),this.Ce.remove(this.Gs),this.Ce.remove(this.Vs)},zs:function(){this.Hs=void 0,this.Gs=void 0,this.Vs=void 0},st:function(){this.xs(),this.zs();for(var t,n=0;n<this.yt.length;n++)this.yt[n].st();for(t in this.yt.length=0,this.Ce.length=0,this.gt=null,delete this.gt,this)this[""+t]&&this[""+t].st&&this[""+t].st(),this[""+t]=null,delete this[""+t]}});var dd,vd=ih,pd=new Et,md=new Et,gd=new Et,yd=new ii,bd=new ii,_d=new St,wd=new Et,xd=new Et,Md=new Et,Ed=new ii,Sd=new ii,Td=new ii;function Ld(t){var n;Y.call(this),this.type="Sprite",void 0===dd&&(dd=new kr,n=new vu(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5),dd.setIndex([0,1,2,0,2,3]),dd.setAttribute("position",new mu(n,3,0,!1)),dd.setAttribute("uv",new mu(n,2,3,!1))),this.geometry=dd,this.material=void 0!==t?t:new lc,this.center=new ii(.5,.5)}function Od(t,n,e,i,r,o){yd.subVectors(t,e).addScalar(.5).multiply(i),void 0!==r?(bd.x=o*yd.x-r*yd.y,bd.y=r*yd.x+o*yd.y):bd.copy(yd),t.copy(n),t.x+=bd.x,t.y+=bd.y,t.applyMatrix4(_d)}function Rd(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Ld.prototype=Object.assign(Object.create(Y.prototype),{constructor:Ld,isSprite:!0,raycast:function(t,n){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),md.setFromMatrixScale(this.matrixWorld),_d.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),gd.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&md.multiplyScalar(-gd.z);var e,i,r=this.material.rotation;0!==r&&(i=Math.cos(r),e=Math.sin(r));var o=this.center;Od(wd.set(-.5,-.5,0),gd,o,md,e,i),Od(xd.set(.5,-.5,0),gd,o,md,e,i),Od(Md.set(.5,.5,0),gd,o,md,e,i),Ed.set(0,0),Sd.set(1,0),Td.set(1,1);r=t.ray.intersectTriangle(wd,xd,Md,!1,pd);null===r&&(Od(xd.set(-.5,.5,0),gd,o,md,e,i),Sd.set(0,1),null===(r=t.ray.intersectTriangle(wd,Md,xd,!1,pd)))||((r=t.ray.origin.distanceTo(pd))<t.near||r>t.far||n.push({distance:r,point:pd.clone(),uv:so.getUV(pd,wd,xd,Md,Ed,Sd,Td,new ii),face:null,object:this}))},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return Y.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});Zu=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.Tn=Xi.LABEL,this.On=t,this.aa=t.eid,this.ua=t.fid,this.It=t.height,this.We=t.maxlevel,this.Xe=t.minlevel,this.Xs=t.name,this.ha=t.name,this.ca=t.ename,this.fa=null,this.Ge=0,this.la=null,this.jo=null,this.Cn=-1,this.Ke=!0,this.gt=null,this.da=this.da.bind(this),this.Ls=this.Ls.bind(this),this.Os=0}var t,e,i;return t=n,(e=[{key:"getData",value:function(){var t=this.On;return{typeID:t.type||null,FID:t.fid||null,height:t.height||null,name:t.name||null,eName:t.ename||null,minLevel:t.minlevel||null,maxLevel:t.maxlevel||null,pass:t.pass||null}}},{key:"setText",value:function(t){var n=this;this.ha=t;var e,i=this.Nr(Xm).Ut;this.Ln?(e={needSize:!0},this.Ln.userData.size=this.Ge,this.Ln.userData.textLength=this.ha.length,this.jo.image?(e.imageUrl=this.fa+this.jo.image,i.ks.oo(t,this.jo,e,function(t){n.Ln.material.map&&n.Ln.material.map.dispose(),n.Ln.material&&n.Ln.material.dispose(),n.Ln.material=t;t=i.va(1.4*n.Ge);n.Ln.scale.set(t,t,t),n.Ln.scale.multiplyScalar(n.Ln.material.userData.mspriteScale),n.Ln.scale.setX(n.Ln.scale.x/n.Ln.material.userData.scaleRatio)}).side=0):((e=i.ks.oo(t,this.jo,e)).side=0,this.Ln.material=e,e=i.va(1.4*this.Ge),this.Ln.scale.set(e,e,e),this.Ln.scale.multiplyScalar(this.Ln.material.userData.mspriteScale),this.Ln.scale.setX(this.Ln.scale.x/this.Ln.material.userData.scaleRatio))):i.gt.on("update",this.da)}},{key:"getPosition",value:function(){return{x:this.On.ji[0].x,y:this.On.ji[0].y,z:this.It}}},{key:"FID",get:function(){return this.ua}},{key:"level",get:function(){return this.gt.gt.kt}},{key:"height",get:function(){return this.It}},{key:"type",get:function(){return this.Tn}},{key:"zoomRange",get:function(){return{maxlevel:this.We,minlevel:this.Xe}}},{key:"ename",get:function(){return this.On.ca}},{key:"name",get:function(){return this.Xs}},{key:"x",get:function(){return this.On.ji[0].x}},{key:"y",get:function(){return this.On.ji[0].y}},{key:"visible",get:function(){return this.Ke},set:function(t){this.Ke=t,this.Ln?this.Ln.visible=this.Ke:this.Nr(Xm).Ut.gt.on("update",this.Ls)}}])&&Rd(t.prototype,e),i&&Rd(t,i),n}();Object.assign(Zu.prototype,{da:function(){var n,t,e=this;this.Ln&&(n=this.Nr(Xm).Ut,0<this.Os?n.gt.off("update",this.da):(t={needSize:!0},this.Ln.userData.size=this.Ge,this.Ln.userData.textLength=this.ha.length,this.jo.image?(t.imageUrl=this.fa+this.jo.image,n.ks.oo(this.ha,this.jo,t,function(t){e.Ln.material.map&&e.Ln.material.map.dispose(),e.Ln.material&&e.Ln.material.dispose(),e.Ln.material=t;t=n.va(1.4*e.Ge);e.Ln.scale.set(t,t,t),e.Ln.scale.multiplyScalar(e.Ln.material.userData.mspriteScale),e.Ln.scale.setX(e.Ln.scale.x/e.Ln.material.userData.scaleRatio)}),this.Ln.material.side=0):(this.Ln.material=n.ks.oo(this.ha,this.jo,t),this.Ln.material.side=0,t=n.va(1.4*this.Ge),this.Ln.scale.set(t,t,t),this.Ln.scale.multiplyScalar(this.Ln.material.userData.mspriteScale),this.Ln.scale.setX(this.Ln.scale.x/this.Ln.material.userData.scaleRatio)),this.visible=!0,this.Os++))},Ls:function(){var t;this.Ln&&(t=this.Nr(Xm).Ut,10<this.Os&&t.gt.off("update",this.Ls),this.Ln.visible=this.Ke,this.Os++)},Nr:function(t){for(var n=this.gt;n;){if(n instanceof t)return n;n=n.gt}return null},pa:function(t,n,e){t&&(this.Ln||(t.userData.opacity=t.opacity,this.Ln=new Ld(t),this.Ln.position.copy(n),this.Ln.userData.size=this.Ge,this.ha?this.Ln.userData.textLength=this.ha.length:this.Ln.userData.textLength=0,(this.Ln.mapNode=this).Ln.scale.set(e,e,e),this.Ln.scale.multiplyScalar(this.Ln.material.userData.mspriteScale),this.Ln.scale.setX(this.Ln.scale.x/this.Ln.material.userData.scaleRatio),this.Xs||(this.Ln.visible=!1),this.gt.Ce.add(this.Ln)))},Cs:function(t,n){var e,i,r,o,s=this;this.Ln&&(e=n.Vo({fid:this.ua,typeID:this.getData().typeID+""}),this.jo=e,i=t.gt.Et.themeURL+"/"+t.gt.Et.themeName+"/",this.fa=i,o={needSize:!0},void 0===(n=e.fontsize)?n=20:("string"==typeof n&&(n=parseInt(n)),isNaN(n)&&(n=20)),this.Ge=n,r=t.va(1.4*e.fontsize),e.image?(o.imageUrl=i+e.image,t.ks.oo(this.Xs,e,o,function(t){s.Ln.material.dispose(),s.Ln.material=t,s.Ln.scale.set(r,r,r),s.Ln.scale.multiplyScalar(s.Ln.material.userData.mspriteScale),s.Ln.scale.setX(s.Ln.scale.x/s.Ln.material.userData.scaleRatio)}).side=2):((o=t.ks.oo(this.Xs,e,o)).side=2,this.Ln.material.dispose(),this.Ln.material=o,this.Ln.scale.set(r,r,r),this.Ln.scale.multiplyScalar(this.Ln.material.userData.mspriteScale),this.Ln.scale.setX(this.Ln.scale.x/this.Ln.material.userData.scaleRatio)))},st:function(){for(var t in this.Ln&&(this.Ln.parent.remove(this.Ln),this.Ln.material.dispose(),this.Ln.geometry.dispose(),this.Ln.material=void 0,this.Ln.geometry=void 0,this.Ln.mapNode=void 0,this.Ln=void 0),this.gt=null,delete this.gt,this)this[""+t]&&this[""+t].st&&this[""+t].st(),this[""+t]=null,delete this[""+t]}});var Ad=Zu;function Cd(t){return(Cd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kd(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||Pd(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pd(t,n){if(t){if("string"==typeof t)return Dd(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Dd(t,n):void 0}}function Dd(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function jd(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Nd(t,n){return(Nd=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Id(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Ud(e);return t=i?(t=Ud(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Cd(t)&&"function"!=typeof t?Fd(n):t}}function Fd(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ud(t){return(Ud=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}pi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Nd(t,n)}(r,Wl);var t,n,e,i=Id(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Tn=Xi.LABEL_LAYER,n.Ce.userData.type="label",n.Ce.name="label",n.Ce.mapLayer=Fd(n),n.js="label",n.ma={},n.Is(t),n.ze=!0,n.Ke=!0,n.Ni=null,n}return t=r,(n=[{key:"getFeatures",value:function(){return this.yt}},{key:"getBound",value:function(){if(null!==this.Ni)return this.Ni;for(var t=0;t<this.yt.length;t++){var n=this.yt[t];null===this.Ni?this.Ni={minX:n.x,maxX:n.x,minY:n.minY,maxY:n.maxY}:(this.Ni.minX>n.x&&(this.Ni.minX=n.x),this.Ni.maxX<n.x&&(this.Ni.maxX=n.x),this.Ni.minY>n.y&&(this.Ni.minY=n.y),this.Ni.maxY<n.y&&(this.Ni.maxY=n.y))}return this.Ni}},{key:"type",get:function(){return this.Tn}},{key:"visible",get:function(){return this.Ke},set:function(t){this.Ke=t,this.Ce.visible=t}},{key:"level",get:function(){return this.gt.kt}},{key:"collision",get:function(){return this.ze},set:function(t){if(!(this.ze=t))for(var n=0;n<this.yt.length;n++)this.yt[n].visible=!0}}])&&jd(t.prototype,n),e&&jd(t,e),r}();Object.assign(pi.prototype,{Is:function(t){var n,e=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=Pd(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.yt);try{for(e.s();!(n=e.n()).done;){var i,r=kd(n.value,2),o=(r[0],r[1]);(o.name||o.ename)&&((i=new Ad(o)).gt=this).yt.push(i)}}catch(t){e.e(t)}finally{e.f()}},st:function(){for(var t,n=0;n<this.yt.length;n++)this.yt[n].st();for(t in this.yt.length=0,this.Ce.length=0,this.gt=null,delete this.gt,this)this[""+t]&&this[""+t].st&&this[""+t].st(),this[""+t]=null,delete this[""+t]}});var Gd=pi;function Bd(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}ka=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.On=t,this.Tn=Xi.FACILITY,this.aa=t.eid,this.ua=t.fid,this.It=t.height,this.We=t.maxlevel,this.Xe=t.minlevel,this.Xs=t.name,this.Ge=0,this.la=null,this.bt=new Map,this.Ke=!0,this.Cn=-1,this.gt=null,this.Ls=this.Ls.bind(this),this.Os=0}var t,e,i;return t=n,(e=[{key:"getData",value:function(){var t=this.On;return{typeID:t.type||null,FID:t.fid||null,height:t.height||null,name:t.name||null,eName:t.ename||null,minLevel:t.minlevel||null,maxLevel:t.maxlevel||null,pass:t.pass||null}}},{key:"jump",value:function(t){var n=this,e=1,i=this.Nr(Xm),r=t.times||void 0,o=t.delay||0,s=new Oi({src:[this.It],dest:[this.It+t.height]});t&&t.duration&&s.ct(t.duration),i.$t.tn(s.lt(function(t){return n.Ln.position.y=t.destination[0]}).dt(function(){var t;Number.isFinite(r)&&r<e||(t=0<e%1?0:o,s.mt().ft(t).ot(),e+=.5)})),this.bt.set("jump",s)}},{key:"stopJump",value:function(){this.Nr(Xm).$t.Qt(this.bt.get("jump")),this.Ln.position.y=this.It}},{key:"boost",value:function(t){var n=this,e=1,i=this.Nr(Xm),r={size:8,duration:1,delay:0,times:5};t&&(void 0!==t.size&&(r.size=t.size),void 0!==t.duration&&(r.duration=t.duration),void 0!==t.delay&&(r.delay=t.delay),void 0!==t.times&&(r.times=t.times));var o=new Oi({src:[this.Ge],dest:[this.Ge+r.size]});o.ct(r.duration),i.$t.tn(o.lt(function(t){i.qt.Ue(n.Ln,t.destination[0])}).dt(function(){var t;Number.isFinite(r.times)&&e>r.times||(t=r.delay,0<e%1&&(t=0),o.mt().ft(t).ot(),e+=.5)})),this.bt.set("boost",o)}},{key:"stopBoost",value:function(){var t=this.Nr(Xm);t.$t.Qt(this.bt.get("boost")),t.qt.Ue(this.Ln,this.Ge)}},{key:"getPosition",value:function(){return{x:this.On.ji[0].x,y:this.On.ji[0].y,z:this.It}}},{key:"ename",get:function(){return this.On.ca}},{key:"name",get:function(){return this.Xs}},{key:"level",get:function(){return this.gt.gt.kt}},{key:"height",get:function(){return this.It}},{key:"x",get:function(){return this.On.ji[0].x}},{key:"y",get:function(){return this.On.ji[0].y}},{key:"type",get:function(){return this.Tn}},{key:"visible",get:function(){return this.Ke},set:function(t){this.Ke=t,this.Ln?this.Ln.visible=this.Ke:this.Nr(Xm).Ut.gt.on("update",this.Ls)}},{key:"zoomRange",get:function(){return{maxlevel:this.We,minlevel:this.Xe}}},{key:"FID",get:function(){return this.ua}},{key:"ID",get:function(){return this.Cn}}])&&Bd(t.prototype,e),i&&Bd(t,i),n}();Object.assign(ka.prototype,{Ls:function(){var t;this.Ln&&(t=this.Nr(Xm).Ut,10<this.Os&&t.gt.off("update",this.Ls),this.Ln.visible=this.Ke,this.Os++)},Nr:function(t){for(var n=this.gt;n;){if(n instanceof t)return n;n=n.gt}return null},pa:function(t,n,e){if(!this.Ln){t.userData.opacity=t.opacity,t.side=0,this.Ln=new Ld(t),this.Ln.position.copy(n);n=1;return this.Ln.material.userData.scaleRatio&&(n=this.Ln.material.userData.scaleRatio),this.Ln.userData.size=this.Ge,this.Ln.scale.set(e,e/n,e),(this.Ln.mapNode=this).gt.Ce.add(this.Ln),!0}},Cs:function(t,n){var e,i,r,o=this;this.Ln&&(i=this.Nr(Xm),r=n.Ho({fid:this.ua,typeID:""+this.getData().typeID}),n=t.gt.Et.themeURL+"/"+t.gt.Et.themeName+"/",e=t.ks.so({needDepth:!1,url:n+r.imageName},function(){o.Ln.material=e}),this.Ln.material=e,i=i.Ut.va(r.height),r=1,this.Ln.material.userData.scaleRatio&&(r=this.Ln.material.userData.scaleRatio),this.Ln.userData.size=this.Ge,this.Ln.scale.set(i,i/r,i))},st:function(){for(var t in this.Ln&&(this.Ln.parent.remove(this.Ln),this.Ln.geometry.dispose(),this.Ln.material=void 0,this.Ln.geometry=void 0,this.Ln.mapNode=void 0,this.Ln=void 0),this.gt=null,delete this.gt,this)this[""+t]&&this[""+t].st&&this[""+t].st(),this[""+t]=null,delete this[""+t]}});var Hd=ka;function Vd(t){return(Vd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zd(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||Wd(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wd(t,n){if(t){if("string"==typeof t)return Xd(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Xd(t,n):void 0}}function Xd(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Yd(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Zd(t,n){return(Zd=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function qd(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Jd(e);return t=i?(t=Jd(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Vd(t)&&"function"!=typeof t?Kd(n):t}}function Kd(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Jd(t){return(Jd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ki=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Zd(t,n)}(r,Wl);var t,n,e,i=qd(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Tn=Xi.FACILITY_LAYER,n.Ce.userData.type="facility",n.Ce.name="facility",n.Ce.mapLayer=Kd(n),n.js="facility",n.ga={},n.ze=!0,n.Ni=null,n.Is(t),n.Ke=!0,n}return t=r,(n=[{key:"getFeatures",value:function(){return this.yt}},{key:"getBound",value:function(){if(null!==this.Ni)return this.Ni;for(var t=0;t<this.yt.length;t++){var n=this.yt[t];null===this.Ni?this.Ni={minX:n.x,maxX:n.x,minY:n.minY,maxY:n.maxY}:(this.Ni.minX>n.x&&(this.Ni.minX=n.x),this.Ni.maxX<n.x&&(this.Ni.maxX=n.x),this.Ni.minY>n.y&&(this.Ni.minY=n.y),this.Ni.maxY<n.y&&(this.Ni.maxY=n.y))}return this.Ni}},{key:"type",get:function(){return this.Tn}},{key:"visible",get:function(){return this.Ke},set:function(t){this.Ke=t,this.Ce.visible=t}},{key:"level",get:function(){return this.gt.kt}},{key:"collision",get:function(){return this.ze},set:function(t){if(!(this.ze=t))for(var n=0;n<this.yt.length;n++)this.yt[n].visible=!0}}])&&Yd(t.prototype,n),e&&Yd(t,e),r}();Object.assign(ki.prototype,{Is:function(t){var n,e=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=Wd(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.yt);try{for(e.s();!(n=e.n()).done;){var i=zd(n.value,2),r=(i[0],i[1]),o=new Hd(r);(o.gt=this).yt.push(o)}}catch(t){e.e(t)}finally{e.f()}},st:function(){for(var t,n=0;n<this.yt.length;n++)this.yt[n].st();for(t in this.yt.length=0,this.Ce.length=0,this.gt=null,delete this.gt,this)this[""+t]&&this[""+t].st&&this[""+t].st(),this[""+t]=null,delete this[""+t]}});var Qd=ki;new $;function $d(t,n){this.object=t,void 0===n&&(n=16776960);var e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),t=new kr;t.setIndex(new dr(e,1)),t.setAttribute("position",new dr(i,3)),ol.call(this,t,new pf({color:n,toneMapped:!1})),this.matrixAutoUpdate=!1,this.update()}var tv="\n\t#extension GL_OES_standard_derivatives : enable\n\n\t#define STANDARD\n\t\n\t#ifdef PHYSICAL\n\t\t#define REFLECTIVITY\n\t\t#define CLEARCOAT\n\t\t#define TRANSPARENCY\n\t#endif\n\t\n\tvarying vec3 v_position;\t\n\n\tuniform bool isRect;\n\tuniform bool isAnnulus;\n\n\tuniform float sweepW;\n\tuniform float sweepH;\n\tuniform vec2 se2N;\n\tuniform vec2 se2RN;\n\tuniform vec2 moveP;\n\tuniform vec3 color_r;\n\t\n\tuniform vec2 circleC;\n\tuniform float maxR;\n\tuniform float minR;\n\tuniform vec3 color_a;\n\n\tbool isInRectW(vec2 v, vec2 a, float w){\n\t\tfloat a1 = abs(dot(v,a));\n\t\treturn a1 < w;\n\t}\n\tbool isInRectH(vec2 v, vec2 a, float h){\n\t\tfloat a1 = abs(dot(v,a));\n\t\treturn a1 < h;\n\t}\n\n\tbool isMaxCircle(vec3 a, vec2 b, float r){\n\t\tfloat c = pow((a.x-b.x),2.0)+pow((a.z-b.y),2.0);\n\t\treturn c <= pow(r,2.0);\n\t}\n\t\n\tbool isMinCircle(vec3 a, vec2 b, float r){\n\t\tfloat c = pow((a.x-b.x),2.0)+pow((a.z-b.y),2.0);\n\t\treturn c > pow(r,2.0);\n\t}\n\n\tuniform vec3 diffuse;\n\tuniform vec3 emissive;\n\tuniform float roughness;\n\tuniform float metalness;\n\tuniform float opacity;\n\t\n\t#ifdef TRANSPARENCY\n\t\tuniform float transparency;\n\t#endif\n\t\n\t#ifdef REFLECTIVITY\n\t\tuniform float reflectivity;\n\t#endif\n\t\n\t#ifdef CLEARCOAT\n\t\tuniform float clearcoat;\n\t\tuniform float clearcoatRoughness;\n\t#endif\n\t\n\t#ifdef USE_SHEEN\n\t\tuniform vec3 sheen;\n\t#endif\n\t\n\tvarying vec3 vViewPosition;\n\t\n\t#ifndef FLAT_SHADED\n\t\n\t\tvarying vec3 vNormal;\n\t\n\t\t#ifdef USE_TANGENT\n\t\n\t\t\tvarying vec3 vTangent;\n\t\t\tvarying vec3 vBitangent;\n\t\n\t\t#endif\n\t\n\t#endif\n\t\n\t#include <common>\n\t#include <packing>\n\t#include <dithering_pars_fragment>\n\t#include <color_pars_fragment>\n\t#include <uv_pars_fragment>\n\t#include <uv2_pars_fragment>\n\t#include <map_pars_fragment>\n\t#include <alphamap_pars_fragment>\n\t#include <aomap_pars_fragment>\n\t#include <lightmap_pars_fragment>\n\t#include <emissivemap_pars_fragment>\n\t#include <bsdfs>\n\t#include <cube_uv_reflection_fragment>\n\t#include <envmap_common_pars_fragment>\n\t#include <envmap_physical_pars_fragment>\n\t#include <fog_pars_fragment>\n\t#include <lights_pars_begin>\n\t#include <lights_physical_pars_fragment>\n\t#include <shadowmap_pars_fragment>\n\t#include <bumpmap_pars_fragment>\n\t#include <normalmap_pars_fragment>\n\t#include <clearcoat_pars_fragment>\n\t#include <roughnessmap_pars_fragment>\n\t#include <metalnessmap_pars_fragment>\n\t#include <logdepthbuf_pars_fragment>\n\t#include <clipping_planes_pars_fragment>\n\t\n\tvoid main() {\n\t\n\t\t#include <clipping_planes_fragment>\n\t\n\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t\tvec3 totalEmissiveRadiance = emissive;\n\t\n\t\t#include <logdepthbuf_fragment>\n\t\t#include <map_fragment>\n\t\t#include <color_fragment>\n\t\t#include <alphamap_fragment>\n\t\t#include <alphatest_fragment>\n\t\t#include <roughnessmap_fragment>\n\t\t#include <metalnessmap_fragment>\n\t\t#include <normal_fragment_begin>\n\t\t#include <normal_fragment_maps>\n\t\t#include <clearcoat_normal_fragment_begin>\n\t\t#include <clearcoat_normal_fragment_maps>\n\t\t#include <emissivemap_fragment>\n\t\n\t\t// accumulation\n\t\t#include <lights_physical_fragment>\n\t\t#include <lights_fragment_begin>\n\t\t#include <lights_fragment_maps>\n\t\t#include <lights_fragment_end>\n\t\n\t\t// modulation\n\t\t#include <aomap_fragment>\n\t\n\t\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t\n\t\t// this is a stub for the transparency model\n\t\t#ifdef TRANSPARENCY\n\t\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t\t#endif\n\t\n\t\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t\tif(isRect){\n \n\t\t\tvec2 v = vec2(v_position.x-moveP.x,v_position.z-moveP.y);\n\t\t\tif(float(isInRectW(v,se2N,sweepW) && isInRectH(v,se2RN,sweepH)) != 0.0){\n\t\t\t\tgl_FragColor = vec4(color_r.r, color_r.g, color_r.b, 1.0);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(isAnnulus){\n\t\t\n\t\t\tif(float(isMaxCircle(v_position.xyz,circleC,maxR) && isMinCircle(v_position.xyz,circleC,minR)) != 0.0){\n\t\t\t\tgl_FragColor = vec4(color_a.r, color_a.g, color_a.b, 1.0);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\t\n\t\t#include <tonemapping_fragment>\n\t\t#include <encodings_fragment>\n\t\t#include <fog_fragment>\n\t\t#include <premultiplied_alpha_fragment>\n\t\t#include <dithering_fragment>\n\t}\n",nv="\n#define STANDARD\n\nvarying vec3 vViewPosition;\nvarying vec3 v_position;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\tvec4 pos = vec4(position, 1.0);\n\tv_position = vec3(modelMatrix * vec4( position, 1.0 ));\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n ";function ev(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var iv=Xr.merge([{sweepW:{value:0},sweepH:{value:0},se2N:{value:new ii(0,0)},se2RN:{value:new ii(0,0)},moveP:{value:new ii(0,0)},color_r:{value:new _i(16711935)},color_a:{value:new _i(16776960)},isRect:{value:!1},isAnnulus:{value:!1},circleC:{value:new ii(0,0)},maxR:{value:0},minR:{value:0}},Ao.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new ii(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new _i(0)},transparency:{value:0}}]),ah=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),qr.call(this),this.type="FMMeshStandardMaterial",this.uniforms=Xr.clone(iv),this.vertexShader=nv,this.fragmentShader=tv,this.lights=!0}var n,e,i;return n=t,(e=[{key:"copy",value:function(t){return qr.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Xr.clone(t.uniforms),this.lights=t.lights,this}}])&&ev(n.prototype,e),i&&ev(n,i),t}();ah.prototype=Object.create(qr.prototype),ah.prototype.isFMMeshStandardMaterial=!0;var rv=ah;function ov(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return sv(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?sv(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function sv(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function av(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}e=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.On=t,this.ya=t.type,this.aa=t.eid,this.ca=t.ename,this.ua=t.fid,this.It=t.height,this.We=t.maxlevel,this.Xe=t.minlevel,this.Xs=t.name,this.Tn=Xi.EXTERNAL_MODEL,this.ba=t.ji[0],this.Ln=null,this.Ni=null,this.Ke=!0,this.Cn=-1,this.gt=null,this.Ls=this.Ls.bind(this),this.Os=0}var t,e,i;return t=n,(e=[{key:"getData",value:function(){var t=this.On;return{typeID:t.type||null,FID:t.fid||null,height:t.height||null,name:t.name||null,eName:t.ename||null,minLevel:t.minlevel||null,maxLevel:t.maxlevel||null,pass:t.pass||null}}},{key:"level",get:function(){return this.gt.gt.kt}},{key:"height",get:function(){return this.It}},{key:"zoomRange",get:function(){return{maxlevel:this.We,minlevel:this.Xe}}},{key:"ID",get:function(){return this.Cn}},{key:"FID",get:function(){return this.ua}},{key:"x",get:function(){return this.ba.x}},{key:"y",get:function(){return this.ba.y}},{key:"type",get:function(){return this.Tn}},{key:"visible",get:function(){return this.Ke},set:function(t){this.Ke=t,this.Ln?this.Ln.visible=this.Ke:this.Nr(Xm).Ut.gt.on("update",this.Ls)}},{key:"getBound",value:function(){if(null!==this.Ni)return this.Ni;this.Ni={};for(var t=new $d(this.Ln,16776960),n=t.geometry.attributes.position.array,e=t.geometry.attributes.position.count,i=0;i<e;i++){var r=n[3*i],o=n[3*i+2];(!this.Ni.minX||this.Ni.minX>r)&&(this.Ni.minX=r),(!this.Ni.maxX||this.Ni.maxX<r)&&(this.Ni.maxX=r),(!this.Ni.minY||this.Ni.minY>o)&&(this.Ni.minY=o),(!this.Ni.maxY||this.Ni.maxY<o)&&(this.Ni.maxY=o)}return t.material.dispose(),t.geometry.dispose(),t.material=void 0,t.geometry=void 0,t=void 0,this.Ni}}])&&av(t.prototype,e),i&&av(t,i),n}();Object.assign(e.prototype,{Ls:function(){var t;this.Ln&&(t=this.Nr(Xm).Ut,10<this.Os&&t.gt.off("update",this.Ls),this.Ln.visible=this.Ke,this.Os++)},Nr:function(t){for(var n=this.gt;n;){if(n instanceof t)return n;n=n.gt}return null},_a:function(t){var n=t.material.clone();t.material=new rv,t.material.defines.USE_UV=!0,t.material.defines.USE_EMISSIVEMAP=!!n.emissiveMap,t.material.defines.USE_MAP=!!n.map,t.material.uniforms.diffuse.value=n.color,t.material.uniforms.map.value=n.map,t.material.uniforms.emissiveMap.value=n.emissiveMap,t.material.uniforms.emissive.value=n.emissive,t.material.uniforms.metalness.value=n.metalness,t.material.uniforms.roughness.value=n.roughness,t.material.uniforms.opacity.value=n.opacity,t.material.uniforms.normalScale.value=n.normalScale,t.material.transparent=n.transparent,t.material.side=n.side,t.material.vertexColors=n.vertexColors,t.material.needsUpdate=!0},wa:function(t){if("number"==typeof t)return t;var n=t.split(",");return 3<=n.length?parseInt(n[0])<<16|parseInt(n[1])<<8|parseInt(n[2]):(console.error("color format error",t),0)},xa:function(t,n,e,i){if(!this.Ln){if(Array.isArray(n)){var r,o=ov(n);try{for(o.s();!(r=o.n()).done;){var s=r.value;s.color=new _i(this.wa(e.color)),s.transparent=!0,s.map&&(s.map.wrapS=mn,s.map.wrapT=mn,s.color.setScalar(1)),s.userData.opacity=s.opacity}}catch(t){o.e(t)}finally{o.f()}}else n.color=new _i(this.wa(e.color)),n.transparent=!0,n.map&&(n.map.wrapS=mn,n.map.wrapT=mn,n.color.setScalar(1)),n.userData.opacity=n.opacity;var a=[];if(void 0!==n.length)for(var u=0;u<n.length;u++)a.push(n[u].clone());else a.push(n.clone());this.Ln=new To(t,a);var h=e.scale.split(","),c=e.rotate.split(","),f=e.translate.split(",");this.Ln.scale.set(parseFloat(h[0]),parseFloat(h[2]),parseFloat(h[1]));t=new Et,h=Math.PI/180;t.set(parseFloat(c[0])*h,parseFloat(c[2])*h,parseFloat(c[1])*h),this.Ln.rotation.setFromVector3(t,"YXZ");i=new Et(this.ba.x-i.x,this.ba.y-i.y,0).applyEuler(new _(-Math.PI/2,0,0,"XYZ")).add(new Et(0,-1===this.It?2.2:this.It,0));i.add(new Et(parseFloat(f[0]),parseFloat(f[2]),parseFloat(f[1]))),this.Ln.position.set(i.x,i.y,i.z),this.Ln.renderOrder=this.aa,(this.Ln.mapNode=this).gt.Ce.add(this.Ln)}},Ma:function(t,e,n){var i,r,o,s,a,u=this;this.Ln||((i=t.scene.clone()).traverse(function(t){if("Mesh"===t.type){if(t.isGltf=!0,void 0!==t.material.length)for(var n=0;n<t.material.length;n++)t.material[n]=t.material[n].clone(),t.material[n].color=new _i(u.wa(e.color)),t.material[n].userData.opacity=t.material[n].opacity,t.material[n].depthWrite=!0;else t.material=t.material.clone(),t.material.transparent=!0,t.material.color=new _i(u.wa(e.color)),t.material.userData.opacity=t.material.opacity,t.material.depthWrite=!0;t.renderOrder=u.aa,4===u.Nr(Xm).Et.shadingMode&&u._a(t)}}),r=e.scale.split(","),o=e.rotate.split(","),s=e.translate.split(","),a=new Et,t=Math.PI/180,a.set(parseFloat(o[0])*t,parseFloat(o[2])*t,parseFloat(o[1])*t),i.rotation.setFromVector3(a,"YXZ"),i.scale.set(parseFloat(r[0]),parseFloat(r[2]),parseFloat(r[1])),(n=new Et(this.ba.x-n.x,this.ba.y-n.y,0).applyEuler(new _(-Math.PI/2,0,0,"XYZ")).add(new Et(0,-1===this.It?2.2:this.It,0))).add(new Et(parseFloat(s[0]),parseFloat(s[2]),parseFloat(s[1]))),i.position.set(n.x,n.y,n.z),(this.Ln=i).rotation.setFromVector3(a,"YXZ"),(this.Ln.mapNode=this).gt.Ce.add(this.Ln))},st:function(){if(this.Ln&&"Mesh"===this.Ln.type){if(this.Ln.parent.remove(this.Ln),Array.isArray(this.Ln.material)){var t,n=ov(this.Ln.material);try{for(n.s();!(t=n.n()).done;)t.value.dispose()}catch(t){n.e(t)}finally{n.f()}}else this.Ln.material.dispose();this.Ln.geometry.dispose(),this.Ln.material=void 0,this.Ln.geometry=void 0,this.Ln.mapNode=void 0,this.Ln=void 0}else this.Ln&&"Scene"===this.Ln.type&&(this.Ln.parent.remove(this.Ln),this.Ln.mapNode=void 0,this.Ln=void 0);for(var e in this.gt=null,delete this.gt,this)this[""+e]&&this[""+e].st&&this[""+e].st(),this[""+e]=null,delete this[""+e]}});var uv=e;function hv(t){return(hv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function cv(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||fv(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fv(t,n){if(t){if("string"==typeof t)return lv(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?lv(t,n):void 0}}function lv(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function dv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function vv(t,n){return(vv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function pv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=mv(e);return t=i?(t=mv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==hv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function mv(t){return(mv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Qu=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&vv(t,n)}(r,Wl);var t,n,e,i=pv(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Tn=Xi.EXTERNAL_MODEL_LAYER,n.Ce.name="externalModel",n.Ce.userData.type="externalModel",n.js="externalModel",n.sa={},n.Ni=null,n.Is(t),n.Ke=!0,n.Fs(),n.Us(),n}return t=r,(n=[{key:"getBound",value:function(){if(null!==this.Ni)return this.Ni;for(var t=0;t<this.yt.length;t++){var n=this.yt[t].getBound();null===this.Ni?this.Ni={minX:n.minX,maxX:n.maxX,minY:n.minY,maxY:n.maxY}:(this.Ni.minX>n.minX&&(this.Ni.minX=n.minX),this.Ni.maxX<n.maxX&&(this.Ni.maxX=n.maxX),this.Ni.minY>n.minY&&(this.Ni.minY=n.minY),this.Ni.maxY<n.maxY&&(this.Ni.maxY=n.maxY))}return this.Ni}},{key:"getFeatures",value:function(){return this.yt}},{key:"level",get:function(){return this.gt.kt}},{key:"height",get:function(){return this.gt.It}},{key:"type",get:function(){return this.Tn}},{key:"visible",get:function(){return this.Ke},set:function(t){this.Ke=t,this.Ce.visible=t}}])&&dv(t.prototype,n),e&&dv(t,e),r}();Object.assign(Qu.prototype,{Is:function(t){var n,e=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=fv(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.yt);try{for(e.s();!(n=e.n()).done;){var i=cv(n.value,2),r=(i[0],i[1]),o=new uv(r);(o.gt=this).yt.push(o)}}catch(t){e.e(t)}finally{e.f()}},Fs:function(){this.Gs=new Pl(16777215,.46),this.Bs=new Y,this.Hs=new Wf(8947848,1.2),this.Hs.position.set(-1,1,1).normalize(),this.Hs.castShadow=!1,this.Hs.target=this.Bs,this.Vs=new Wf(3355443),this.Vs.position.set(-.5,1,-1).normalize(),this.Vs.target=this.Bs},Us:function(){this.Ce.add(this.Hs),this.Ce.add(this.Gs),this.Ce.add(this.Vs),this.Ce.add(this.Bs)},xs:function(){this.Ce.remove(this.Hs),this.Ce.remove(this.Gs),this.Ce.remove(this.Vs)},zs:function(){this.Hs=void 0,this.Gs=void 0,this.Vs=void 0},st:function(){this.xs(),this.zs();for(var t,n=0;n<this.yt.length;n++)this.yt[n].st();for(t in this.yt.length=0,this.Ce.length=0,this.gt=null,delete this.gt,this)this[""+t]&&this[""+t].st&&this[""+t].st(),this[""+t]=null,delete this[""+t]}});var gv=Qu;function yv(t){return(yv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bv(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return _v(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?_v(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function _v(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function wv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function xv(t,n){return(xv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Mv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Ev(e);return t=i?(t=Ev(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==yv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Ev(t){return(Ev=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}hh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&xv(t,n)}(r,Ul);var t,n,e,i=Mv(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Ea=[],t}return t=r,(n=[{key:"getScene",value:function(){return this.Ce}},{key:"getMarkers",value:function(){return this.yt}},{key:"add",value:function(t){t.gt=this,t.Sa||t.Lo()?this.R(t):this.Ea.push(t)}},{key:"remove",value:function(t){this.Ta(t),t.dispose();t=this.yt.indexOf(t);-1<t&&this.yt.splice(t,1)}},{key:"clear",value:function(){var t,n=bv(this.yt);try{for(n.s();!(t=n.n()).done;){var e=t.value;this.Ta(e),e.dispose()}}catch(t){n.e(t)}finally{n.f()}this.yt.length=0}},{key:"traverse",value:function(t){var n,e=bv(this.yt);try{for(e.s();!(n=e.n()).done;){var i=n.value;t&&t(i)}}catch(t){e.e(t)}finally{e.f()}}},{key:"dispose",value:function(){var t,n=bv(this.yt);try{for(n.s();!(t=n.n()).done;){var e=t.value;this.Ta(e),e.dispose()}}catch(t){n.e(t)}finally{n.f()}this.yt.length=0,this.Ce=void 0}}])&&wv(t.prototype,n),e&&wv(t,e),r}();Object.assign(hh.prototype,{La:function(){var t,n=bv(this.Ea);try{for(n.s();!(t=n.n()).done;){var e,i=t.value;i.Lo()&&(-1<(e=this.Ea.indexOf(i))&&this.Ea.splice(e,1),this.R(i))}}catch(t){n.e(t)}finally{n.f()}},R:function(t){this.yt.push(t),t.Ln&&this.Ce.add(t.Ln)},Ta:function(t){t.gt=void 0,this.Ce.remove(t.Ln)}});var Sv=hh;function Tv(t){return(Tv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lv(t,n){return(Lv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Ov(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Rv(e);return t=i?(t=Rv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Tv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Rv(t){return(Rv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Av=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Lv(t,n)}(e,Sv);var n=Ov(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Tn=Xi.IMAGE_MARKER,t.Oa=!0,t}return e}();function Cv(t){return(Cv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kv(t,n){return(kv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Pv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Dv(e);return t=i?(t=Dv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Cv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Dv(t){return(Dv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var jv=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&kv(t,n)}(e,Sv);var n=Pv(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Tn=Xi.TEXT_MARKER,t}return e}();function Nv(t){return(Nv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Iv(t,n){return(Iv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Fv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Uv(e);return t=i?(t=Uv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Nv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Uv(t){return(Uv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Gv=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Iv(t,n)}(e,Sv);var n=Fv(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Tn=Xi.POLYGON_MARKER,t}return e}();function Bv(t){return(Bv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hv(t,n){return(Hv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Vv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=zv(e);return t=i?(t=zv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Bv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function zv(t){return(zv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Wv=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Hv(t,n)}(e,Sv);var n=Vv(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Tn=Xi.EXTRUDE_MARKER,t}return e}();function Xv(t){return(Xv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yv(t,n){return(Yv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Zv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=qv(e);return t=i?(t=qv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Xv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function qv(t){return(qv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Kv=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Yv(t,n)}(e,Sv);var n=Zv(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Tn=Xi.GRADIENT_POLYGON_MARKER,t}return e}();function Jv(t){return(Jv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qv(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return $v(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?$v(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function $v(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function tp(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function np(t,n,e){return(np="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=op(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function ep(t,n){return(ep=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function ip(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=op(e);return t=i?(t=op(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Jv(t)&&"function"!=typeof t?rp(n):t}}function rp(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function op(t){return(op=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}oh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&ep(t,n)}(r,Sv);var t,n,e,i=ip(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Tn=Xi.HEAT_MAP_MARKER,t.Ra=!1,t.Aa=t.Aa.bind(rp(t)),t}return t=r,(n=[{key:"add",value:function(t){np(op(r.prototype),"add",this).call(this,t),t.Sa&&!t.Ca&&this.ka(t.Pa),0<this.Ea.length&&map.on("update",this.Aa)}},{key:"remove",value:function(t){np(op(r.prototype),"remove",this).call(this,t),this.Ra&&this.ka(null)}}])&&tp(t.prototype,n),e&&tp(t,e),r}();Object.assign(oh.prototype,{La:function(){var t,n=Qv(this.Ea);try{for(n.s();!(t=n.n()).done;){var e,i=t.value;i.Lo()&&(-1<(e=this.Ea.indexOf(i))&&this.Ea.splice(e,1),this.R(i),i.Ca||this.ka(i.Pa))}}catch(t){n.e(t)}finally{n.f()}},ka:function(i){var t=this.Nr(Np),n=t.getExtendMesh(),e=n.material.map;(n.material.map=i)?(n.material.mapMixColor=!0,n.material.map.needsUpdate=!0):n.material.mapMixColor=!1,n.material.needsUpdate=!0,t.getModelMeshs().forEach(function(t){if("MultiMaterial"===t.material.type)for(var n=t.material.materials.length,e=0;e<n;)(t.material.materials[e].map=i)?(t.material.materials[e].map.needsUpdate=!0,t.material.materials[e].mapMixColor=!0):(t.material.materials[e].mapMixColor=!1,t.material.materials[e].transparent=!0),t.material.materials[e].needsUpdate=!0,e+=0===e?3:2;else(t.material.map=i)?(t.material.mapMixColor=!0,t.material.map.needsUpdate=!0,1===t.material.opacity&&(t.material.transparent=!1)):(t.material.mapMixColor=!1,t.material.transparent=!0),t.material.needsUpdate=!0}),e&&(e.dispose(),e=null),this.Ra=!0},Aa:function(){this.La(),0===this.Ea.length&&map.off("update",this.Aa)}});var sp=oh;function ap(t){return(ap="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function up(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function hp(t,n){return(hp=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function cp(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=fp(e);return t=i?(t=fp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==ap(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function fp(t){return(fp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}qu=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&hp(t,n)}(r,Sv);var t,n,e,i=cp(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Tn=Xi.DYNAMIC_MODEL_MARKER,t.Fs(),t.Us(),t}return t=r,(n=[{key:"remove",value:function(e){var i;e.Da?(e.gt=void 0,i=this,e.Ln.traverse(function(t){var n;t instanceof To&&(t.material.transparent=!0,n=setInterval(function(){.05<t.material.opacity?t.material.opacity-=.05:(clearInterval(n),i.Ce.remove(e.Ln),e.dispose())},200))})):(this.Ta(e),e.dispose());var t=this.yt.indexOf(e);-1<t&&this.yt.splice(t,1)}}])&&up(t.prototype,n),e&&up(t,e),r}();Object.assign(qu.prototype,{Fs:function(){this.Gs=new Pl(7631988),this.Bs=new Y,this.Hs=new Wf(8947848,1.2),this.Hs.position.set(-1,1,1).normalize(),this.Hs.target=this.Bs,this.Vs=new Wf(3355443),this.Vs.position.set(-.5,1,-1).normalize(),this.Vs.target=this.Bs},Us:function(){var t=this;this.Ce.add(this.Hs),this.Ce.add(this.Gs),this.Ce.add(this.Vs),this.Ce.add(this.Bs),this.Ce.removeLight=function(){t.xs()}},xs:function(){this.Ce.remove(this.Hs),this.Ce.remove(this.Gs),this.Ce.remove(this.Vs)}});var lp=qu;function dp(t){return(dp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vp(t,n){return(vp=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function pp(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=mp(e);return t=i?(t=mp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==dp(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function mp(t){return(mp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ih=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&vp(t,n)}(e,Sv);var n=pp(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Tn=Xi.DOM_MARKER,t}return e}();Object.assign(ih.prototype,{R:function(t){this.yt.push(t)},Ta:function(t){var n=this.Nr(Xm);if(!n)return console.warn("marker没有添加到中!"),!1;n.$t.ja(t.Na),n.off("levelChanged",t.Ia),n.off("visibleLevelsChanged",t.Ia),t.gt=void 0,t.Ln&&t.Ln.parentNode&&t.Ln.parentNode.removeChild(t.Ln)}});var gp=ih;function yp(t){return(yp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bp(t,n){return(bp=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function _p(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=wp(e);return t=i?(t=wp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==yp(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function wp(t){return(wp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var xp=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&bp(t,n)}(e,Sv);var n=_p(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Tn=Xi.LINE_MARKER,t}return e}();function Mp(t){return(Mp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ep(t,n){return(Ep=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Sp(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Tp(e);return t=i?(t=Tp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Mp(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Tp(t){return(Tp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Lp=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Ep(t,n)}(e,Sv);var n=Sp(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Tn=Xi.LOCATION_MARKER,t}return e}();function Op(t){return(Op="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rp(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||Ap(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ap(t,n){if(t){if("string"==typeof t)return Cp(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Cp(t,n):void 0}}function Cp(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function kp(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Pp(t,n){return(Pp=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Dp(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=jp(e);return t=i?(t=jp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Op(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function jp(t){return(jp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Zu=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Pp(t,n)}(r,kl);var t,n,e,i=Dp(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Fa=null,n.gt=t.building,n.On=t.data,n.kt=n.On.gid,n.Ua=n.On.gname,n.Ga=n.On.alias,n.Ba=n.On.desc,n.Ke=n.On.Ke,n.It=n.gt.Es*n.kt,n.Ha=!1,n.Va=[Xi.EXTENT_LAYER,Xi.EXTERNAL_MODEL_LAYER,Xi.MODEL_LAYER,Xi.LABEL_LAYER,Xi.FACILITY_LAYER],n}return t=r,(n=[{key:"height",get:function(){return this.It}},{key:"type",get:function(){return this.On.Tn}},{key:"center",get:function(){var t=this.Fa;return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}},{key:"x",get:function(){return this.center.x}},{key:"y",get:function(){return this.center.y}},{key:"visible",get:function(){return this.Ke},set:function(t){this.Ke=t;for(var n=0;n<this.yt.length;n++)this.yt[n].Ce.visible=t}},{key:"level",get:function(){return this.kt}},{key:"name",get:function(){return this.Ua}},{key:"ID",get:function(){return this.Cn}},{key:"alias",get:function(){return this.Ga}},{key:"floorID",get:function(){return this.On.floorId}},{key:"getLayers",value:function(){return this.yt}},{key:"getExtendMesh",value:function(){return this.za(Xi.EXTENT_LAYER).yt[0].Ln}},{key:"getModelMeshs",value:function(){for(var t=this.za(Xi.MODEL_LAYER),n=[],e=0;e<t.yt.length;e++)n.push(t.yt[e].Ln);return n}},{key:"getBound",value:function(){return this.On.getBound().toObject()}},{key:"setExtentImage",value:function(t){for(var n=this.za(Xi.EXTENT_LAYER),e=0;e<n.yt.length;e++)n.yt[e].Ps(t)}},{key:"clearExtentImage",value:function(){for(var t=this.za(Xi.EXTENT_LAYER),n=0;n<t.yt.length;n++){var e=t.yt[n];e.Ln.material.map&&(e.Ln.material.map.dispose(),e.Ln.material.map=null,e.Ln.material.needsUpdate=!0)}}},{key:"getOrCreateLayer",value:function(t){var n=this.za(t);return null!==n||(t===Xi.IMAGE_MARKER?(n=new Av).Ce.position.y=this.It:t===Xi.TEXT_MARKER?(n=new jv).Ce.position.y=this.It:t===Xi.POLYGON_MARKER?(n=new Gv).Ce.position.y=this.It:t===Xi.EXTRUDE_MARKER?(n=new Wv).Ce.position.y=this.It:t===Xi.GRADIENT_POLYGON_MARKER?(n=new Kv).Ce.position.y=this.It:t===Xi.HEAT_MAP_MARKER?(n=new sp).Ce.position.y=this.It:t===Xi.DYNAMIC_MODEL_MARKER?(n=new lp).Ce.position.y=this.It:t===Xi.DOM_MARKER?n=new gp:t===Xi.LINE_MARKER?n=new xp:t===Xi.LOCATION_MARKER&&(n=new Lp),n.gt=this,n.Ce.rotation.y=this.gt.gt.vn,this.yt.push(n),n.Ce&&this.gt.gt.qt.tn(this.kt+"_"+t,n.Ce)),n}},{key:"getMapCoordsRange",value:function(){return this.Fa}}])&&kp(t.prototype,n),e&&kp(t,e),r}();Object.assign(Zu.prototype,{st:function(){for(var t=0;t<this.yt.length;t++)this.yt[t]&&this.yt[t].st&&this.yt[t].st();for(var n,e=0;e<this.yt.length;e++)this.yt[e]&&this.yt[e].dispose&&this.yt[e].dispose();for(n in this.yt.length=0,this.gt=null,delete this.gt,this)this[""+n]&&this[""+n].st&&this[""+n].st(),this[""+n]=null,delete this[""+n]},Ze:function(e){for(var t=0;t<this.yt.length;t++)if("externalModel"===this.yt[t].js)this.yt[t].Ce.traverse(function(t){if("Mesh"===t.type&&t.material.length)for(var n=0;n<t.material.length;n++)t.material[n].userData.oldAlpha||(t.material[n].userData.oldAlpha=t.material[n].opacity),t.material[n].opacity=e});else for(var n=this.yt[t].Ce.children,i=0;i<n.length;i++)n[i].material&&(n[i].material.userData.oldAlpha||(n[i].material=n[i].material.clone(),n[i].material.userData.oldAlpha=n[i].material.opacity),n[i].material.opacity=e)},qe:function(){for(var t=0;t<this.yt.length;t++)if("externalModel"===this.yt[t].js)this.yt[t].Ce.traverse(function(t){if("Mesh"===t.type)if(t.material.length)for(var n=0;n<t.material.length;n++)t.material[n].userData.oldAlpha&&(t.material[n].opacity=t.material[n].userData.oldAlpha);else t.material.userData.oldAlpha&&(t.material.opacity=t.material.userData.oldAlpha)});else for(var n=this.yt[t].Ce.children,e=0;e<n.length;e++)n[e].material&&n[e].material.userData.oldAlpha&&(n[e].material.opacity=n[e].material.userData.oldAlpha)},za:function(t){for(var n=null,e=0;e<this.yt.length;e++)if(this.yt[e].Tn===t){n=this.yt[e];break}return n},Wa:function(){var n=this;this.gt.gt.Xa.er.get(this.gt.Ya).yt.forEach(function(t){t.gid===n.kt&&(t=t.yt.get(Xi.EXTENT_LAYER).getBound(),n.Fa={minX:t.Ai.x,minY:t.Ai.y,maxX:t.Ci.x,maxY:t.Ci.y})})},Za:function(t){t.gt=this,t.Ce.userData.level=this.kt,t.Ce.position.y=this.It,this.yt.push(t)},qa:function(){var t,n=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=Ap(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(this.On.yt);try{for(n.s();!(t=n.n()).done;){var e,i,r,o,s,a=Rp(t.value,2),u=a[0],h=a[1];u===Xi.EXTENT_LAYER?(e=new ed(h),this.Za(e)):u===Xi.MODEL_LAYER?(i=new vd(h),this.Za(i)):u===Xi.LABEL_LAYER?(r=new Gd(h),this.Za(r)):u===Xi.FACILITY_LAYER?(o=new Qd(h),this.Za(o)):u===Xi.EXTERNAL_MODEL_LAYER&&(s=new gv(h),this.Za(s))}}catch(t){n.e(t)}finally{n.f()}},Ka:function(t,n){for(var e=null,i=0;i<t.length;i++)if(""+t[i].Tn==""+n){e=t[i];break}return e}});var Np=Zu;function Ip(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}pi=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.gt=null,this.yt=[],this.Ya=t.buildingID,this.Xs=t.name,this.Ja=null,this.I=t.x,this.F=t.y,this.It=t.height,this.Qa=new $(new Et(t.bounds.minX,t.bounds.minY),new Et(t.bounds.maxX,t.bounds.maxY)),this.$a=t.zoom,this.tu=t.levels,this.nu=null,this.Es=50,this.Va=[],this.Ct=[]}var t,e,i;return t=n,(e=[{key:"getFloorsInfo",value:function(){var n=this;return null===this.nu&&(this.nu=[],this.gt.Xa.er.get(this.Ya).yt.forEach(function(t){n.nu.push(t)})),this.nu}},{key:"getFloors",value:function(){return this.yt}},{key:"getFloor",value:function(t){for(var n=0;n<this.yt.length;n++)if(this.yt[n].kt===t)return this.yt[n]}},{key:"getFloorSpace",value:function(){return this.Es}},{key:"setFloorSpace",value:function(t){this.Es=t;for(var n=0;n<this.yt.length;n++){var e=this.yt[n].yt;this.yt[n].It=t*this.yt[n].kt;for(var i=0;i<e.length;i++)Xi.LINE_MARKER!==e[i].Tn&&Xi.LOCATION_MARKER!==e[i].Tn&&(e[i].Ce.position.y=t*this.yt[n].kt)}this.gt.eu.un({level:this.gt.kt})}},{key:"getBuildingBound",value:function(){var t=this.Qa,n=new Et,n=t.getSize(n);return{max:{x:t.max.x,y:t.max.y},min:{x:t.min.x,y:t.min.y},center:{x:(t.max.x+t.min.x)/2,y:(t.max.y+t.min.y)/2},size:{x:n.x,y:n.y}}}},{key:"height",get:function(){return this.It}},{key:"x",get:function(){return this.I}},{key:"y",get:function(){return this.F}}])&&Ip(t.prototype,e),i&&Ip(t,i),n}();Object.assign(pi.prototype,{st:function(){for(var t,n=0;n<this.yt.length;n++)this.yt[n]&&this.yt[n].st&&this.yt[n].st();for(t in this.yt.length=0,this.gt=null,delete this.gt,this)this[""+t]&&this[""+t].st&&this[""+t].st(),this[""+t]=null,delete this[""+t]}});var Fp=pi,ka={NAME:2,ENAME:4,FID:8};Object.freeze(ka);var Up=ka;function Gp(){this.type="Curve",this.arcLengthDivisions=200}function Bp(t,n,e,i,r,o,s,a){Gp.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=n||0,this.xRadius=e||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=s||!1,this.aRotation=a||0}function Hp(t,n,e,i,r,o){Bp.call(this,t,n,e,e,i,r,o),this.type="ArcCurve"}function Vp(){var r=0,o=0,s=0,a=0;function u(t,n,e,i){s=-3*(r=t)+3*n-2*(o=e)-i,a=2*t-2*n+e+i}return{initCatmullRom:function(t,n,e,i,r){u(n,e,r*(e-t),r*(i-n))},initNonuniformCatmullRom:function(t,n,e,i,r,o,s){r=(n-t)/r-(e-t)/(r+o)+(e-n)/o,s=(e-n)/o-(i-n)/(o+s)+(i-e)/s;u(n,e,r*=o,s*=o)},calc:function(t){var n=t*t;return r+o*t+s*n+a*(n*t)}}}Object.assign(Gp.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,n){t=this.getUtoTmapping(t);return this.getPoint(t,n)},getPoints:function(t){void 0===t&&(t=5);for(var n=[],e=0;e<=t;e++)n.push(this.getPoint(e/t));return n},getSpacedPoints:function(t){void 0===t&&(t=5);for(var n=[],e=0;e<=t;e++)n.push(this.getPointAt(e/t));return n},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var n,e,i=[],r=this.getPoint(0),o=0;for(i.push(0),e=1;e<=t;e++)o+=(n=this.getPoint(e/t)).distanceTo(r),i.push(o),r=n;return this.cacheArcLengths=i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,n){for(var e,i=this.getLengths(),r=0,o=i.length,s=n||t*i[o-1],a=0,u=o-1;a<=u;)if((e=i[r=Math.floor(a+(u-a)/2)]-s)<0)a=r+1;else{if(!(0<e)){u=r;break}u=r-1}if(i[r=u]===s)return r/(o-1);t=i[r];return(r+(s-t)/(i[r+1]-t))/(o-1)},getTangent:function(t){var n=t-1e-4,t=t+1e-4;1<t&&(t=1);n=this.getPoint(n=n<0?0:n);return this.getPoint(t).clone().sub(n).normalize()},getTangentAt:function(t){t=this.getUtoTmapping(t);return this.getTangent(t)},computeFrenetFrames:function(t,n){for(var e,i=new Et,r=[],o=[],s=[],a=new Et,u=new St,h=0;h<=t;h++)r[h]=this.getTangentAt(h/t),r[h].normalize();o[0]=new Et,s[0]=new Et;var c=Number.MAX_VALUE,f=Math.abs(r[0].x),l=Math.abs(r[0].y),d=Math.abs(r[0].z);for(f<=c&&(c=f,i.set(1,0,0)),l<=c&&(c=l,i.set(0,1,0)),d<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),o[0].crossVectors(r[0],a),s[0].crossVectors(r[0],o[0]),h=1;h<=t;h++)o[h]=o[h-1].clone(),s[h]=s[h-1].clone(),a.crossVectors(r[h-1],r[h]),a.length()>Number.EPSILON&&(a.normalize(),e=Math.acos(Mt.clamp(r[h-1].dot(r[h]),-1,1)),o[h].applyMatrix4(u.makeRotationAxis(a,e))),s[h].crossVectors(r[h],o[h]);if(!0===n)for(e=Math.acos(Mt.clamp(o[0].dot(o[t]),-1,1)),e/=t,0<r[0].dot(a.crossVectors(o[0],o[t]))&&(e=-e),h=1;h<=t;h++)o[h].applyMatrix4(u.makeRotationAxis(r[h],e*h)),s[h].crossVectors(r[h],o[h]);return{tangents:r,normals:o,binormals:s}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),((Bp.prototype=Object.create(Gp.prototype)).constructor=Bp).prototype.isEllipseCurve=!0,Bp.prototype.getPoint=function(t,n){for(var e=n||new ii,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,o=Math.abs(r)<Number.EPSILON;r<0;)r+=i;for(;i<r;)r-=i;r<Number.EPSILON&&(r=o?0:i),!0!==this.aClockwise||o||(r===i?r=-i:r-=i);var s=this.aStartAngle+t*r,a=this.aX+this.xRadius*Math.cos(s),u=this.aY+this.yRadius*Math.sin(s);return 0!==this.aRotation&&(n=Math.cos(this.aRotation),o=Math.sin(this.aRotation),a=(t=a-this.aX)*n-(s=u-this.aY)*o+this.aX,u=t*o+s*n+this.aY),e.set(a,u)},Bp.prototype.copy=function(t){return Gp.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},((Hp.prototype=Object.create(Bp.prototype)).constructor=Hp).prototype.isArcCurve=!0;var zp=new Et,Wp=new Vp,Xp=new Vp,Yp=new Vp;function Zp(t,n,e,i){Gp.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=n||!1,this.curveType=e||"centripetal",this.tension=i||.5}function qp(t,n,e,i,r){var o=.5*(i-n),n=.5*(r-e),r=t*t;return(2*e-2*i+o+n)*(t*r)+(-3*e+3*i-2*o-n)*r+o*t+e}function Kp(t,n,e,i){return(r=1-(r=t))*r*n+2*(1-(n=t))*n*e+(t=t)*t*i;var r}function Jp(t,n,e,i,r){return(o=1-(o=t))*o*o*n+3*(n=1-(o=t))*n*o*e+3*(1-(e=t))*e*e*i+(t=t)*t*t*r;var o}function Qp(t,n,e,i){Gp.call(this),this.type="CubicBezierCurve",this.v0=t||new ii,this.v1=n||new ii,this.v2=e||new ii,this.v3=i||new ii}function $p(t,n,e,i){Gp.call(this),this.type="CubicBezierCurve3",this.v0=t||new Et,this.v1=n||new Et,this.v2=e||new Et,this.v3=i||new Et}function tm(t,n){Gp.call(this),this.type="LineCurve",this.v1=t||new ii,this.v2=n||new ii}function nm(t,n){Gp.call(this),this.type="LineCurve3",this.v1=t||new Et,this.v2=n||new Et}function em(t,n,e){Gp.call(this),this.type="QuadraticBezierCurve",this.v0=t||new ii,this.v1=n||new ii,this.v2=e||new ii}function im(t,n,e){Gp.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new Et,this.v1=n||new Et,this.v2=e||new Et}function rm(t){Gp.call(this),this.type="SplineCurve",this.points=t||[]}function om(){Gp.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function sm(t){om.call(this),this.type="Path",this.currentPoint=new ii,t&&this.setFromPoints(t)}function am(t){sm.call(this,t),this.uuid=Mt.generateUUID(),this.type="Shape",this.holes=[]}((Zp.prototype=Object.create(Gp.prototype)).constructor=Zp).prototype.isCatmullRomCurve3=!0,Zp.prototype.getPoint=function(t,n){var e,i=n||new Et,r=this.points,o=r.length,s=(o-(this.closed?0:1))*t,a=Math.floor(s),u=s-a;return this.closed?a+=0<a?0:(Math.floor(Math.abs(a)/o)+1)*o:0===u&&a===o-1&&(a=o-2,u=1),e=this.closed||0<a?r[(a-1)%o]:(zp.subVectors(r[0],r[1]).add(r[0]),zp),n=r[a%o],t=r[(a+1)%o],s=this.closed||a+2<o?r[(a+2)%o]:(zp.subVectors(r[o-1],r[o-2]).add(r[o-1]),zp),"centripetal"===this.curveType||"chordal"===this.curveType?(a="chordal"===this.curveType?.5:.25,r=Math.pow(e.distanceToSquared(n),a),o=Math.pow(n.distanceToSquared(t),a),a=Math.pow(t.distanceToSquared(s),a),o<1e-4&&(o=1),Wp.initNonuniformCatmullRom(e.x,n.x,t.x,s.x,r=r<1e-4?o:r,o,a=a<1e-4?o:a),Xp.initNonuniformCatmullRom(e.y,n.y,t.y,s.y,r,o,a),Yp.initNonuniformCatmullRom(e.z,n.z,t.z,s.z,r,o,a)):"catmullrom"===this.curveType&&(Wp.initCatmullRom(e.x,n.x,t.x,s.x,this.tension),Xp.initCatmullRom(e.y,n.y,t.y,s.y,this.tension),Yp.initCatmullRom(e.z,n.z,t.z,s.z,this.tension)),i.set(Wp.calc(u),Xp.calc(u),Yp.calc(u)),i},Zp.prototype.copy=function(t){Gp.prototype.copy.call(this,t),this.points=[];for(var n=0,e=t.points.length;n<e;n++){var i=t.points[n];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},((Qp.prototype=Object.create(Gp.prototype)).constructor=Qp).prototype.isCubicBezierCurve=!0,Qp.prototype.getPoint=function(t,n){var e=n||new ii,i=this.v0,r=this.v1,o=this.v2,n=this.v3;return e.set(Jp(t,i.x,r.x,o.x,n.x),Jp(t,i.y,r.y,o.y,n.y)),e},Qp.prototype.copy=function(t){return Gp.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},(($p.prototype=Object.create(Gp.prototype)).constructor=$p).prototype.isCubicBezierCurve3=!0,$p.prototype.getPoint=function(t,n){var e=n||new Et,i=this.v0,r=this.v1,o=this.v2,n=this.v3;return e.set(Jp(t,i.x,r.x,o.x,n.x),Jp(t,i.y,r.y,o.y,n.y),Jp(t,i.z,r.z,o.z,n.z)),e},$p.prototype.copy=function(t){return Gp.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},((tm.prototype=Object.create(Gp.prototype)).constructor=tm).prototype.isLineCurve=!0,tm.prototype.getPoint=function(t,n){n=n||new ii;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},tm.prototype.getPointAt=function(t,n){return this.getPoint(t,n)},tm.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},tm.prototype.copy=function(t){return Gp.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},((nm.prototype=Object.create(Gp.prototype)).constructor=nm).prototype.isLineCurve3=!0,nm.prototype.getPoint=function(t,n){n=n||new Et;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},nm.prototype.getPointAt=function(t,n){return this.getPoint(t,n)},nm.prototype.copy=function(t){return Gp.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},((em.prototype=Object.create(Gp.prototype)).constructor=em).prototype.isQuadraticBezierCurve=!0,em.prototype.getPoint=function(t,n){var e=n||new ii,i=this.v0,r=this.v1,n=this.v2;return e.set(Kp(t,i.x,r.x,n.x),Kp(t,i.y,r.y,n.y)),e},em.prototype.copy=function(t){return Gp.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},im.prototype.getPoint=function(t,n){var e=n||new Et,i=this.v0,r=this.v1,n=this.v2;return e.set(Kp(t,i.x,r.x,n.x),Kp(t,i.y,r.y,n.y),Kp(t,i.z,r.z,n.z)),e},((rm.prototype=Object.create(Gp.prototype)).constructor=rm).prototype.isSplineCurve=!0,rm.prototype.getPoint=function(t,n){var e=n||new ii,i=this.points,r=(i.length-1)*t,o=Math.floor(r),s=r-o,n=i[0===o?o:o-1],t=i[o],r=i[o>i.length-2?i.length-1:o+1],o=i[o>i.length-3?i.length-1:o+2];return e.set(qp(s,n.x,t.x,r.x,o.x),qp(s,n.y,t.y,r.y,o.y)),e},rm.prototype.copy=function(t){Gp.prototype.copy.call(this,t),this.points=[];for(var n=0,e=t.points.length;n<e;n++){var i=t.points[n];this.points.push(i.clone())}return this},om.prototype=Object.assign(Object.create(Gp.prototype),{constructor:om,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),n=this.curves[this.curves.length-1].getPoint(1);t.equals(n)||this.curves.push(new tm(n,t))},getPoint:function(t){for(var n=t*this.getLength(),e=this.getCurveLengths(),i=0;i<e.length;){if(e[i]>=n){var r=e[i]-n,o=this.curves[i],s=o.getLength();return o.getPointAt(0===s?0:1-r/s)}i++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],n=0,e=0,i=this.curves.length;e<i;e++)n+=this.curves[e].getLength(),t.push(n);return this.cacheLengths=t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var n=[],e=0;e<=t;e++)n.push(this.getPoint(e/t));return this.autoClose&&n.push(n[0]),n},getPoints:function(t){t=t||12;for(var n,e=[],i=0,r=this.curves;i<r.length;i++)for(var o=r[i],s=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,a=o.getPoints(s),u=0;u<a.length;u++){var h=a[u];n&&n.equals(h)||(e.push(h),n=h)}return this.autoClose&&1<e.length&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},copy:function(t){Gp.prototype.copy.call(this,t),this.curves=[];for(var n=0,e=t.curves.length;n<e;n++){var i=t.curves[n];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this}}),sm.prototype=Object.assign(Object.create(om.prototype),{constructor:sm,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var n=1,e=t.length;n<e;n++)this.lineTo(t[n].x,t[n].y);return this},moveTo:function(t,n){return this.currentPoint.set(t,n),this},lineTo:function(t,n){var e=new tm(this.currentPoint.clone(),new ii(t,n));return this.curves.push(e),this.currentPoint.set(t,n),this},quadraticCurveTo:function(t,n,e,i){n=new em(this.currentPoint.clone(),new ii(t,n),new ii(e,i));return this.curves.push(n),this.currentPoint.set(e,i),this},bezierCurveTo:function(t,n,e,i,r,o){i=new Qp(this.currentPoint.clone(),new ii(t,n),new ii(e,i),new ii(r,o));return this.curves.push(i),this.currentPoint.set(r,o),this},splineThru:function(t){var n=new rm([this.currentPoint.clone()].concat(t));return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,n,e,i,r,o){var s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(t+s,n+a,e,i,r,o),this},absarc:function(t,n,e,i,r,o){return this.absellipse(t,n,e,e,i,r,o),this},ellipse:function(t,n,e,i,r,o,s,a){var u=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(t+u,n+h,e,i,r,o,s,a),this},absellipse:function(t,n,e,i,r,o,s,a){s=new Bp(t,n,e,i,r,o,s,a);0<this.curves.length&&((a=s.getPoint(0)).equals(this.currentPoint)||this.lineTo(a.x,a.y)),this.curves.push(s);s=s.getPoint(1);return this.currentPoint.copy(s),this},copy:function(t){return om.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this}}),am.prototype=Object.assign(Object.create(sm.prototype),{constructor:am,getPointsHoles:function(t){for(var n=[],e=0,i=this.holes.length;e<i;e++)n[e]=this.holes[e].getPoints(t);return n},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){sm.prototype.copy.call(this,t),this.holes=[];for(var n=0,e=t.holes.length;n<e;n++){var i=t.holes[n];this.holes.push(i.clone())}return this}});var um=function(t,n,e){e=e||2;var i,r,o,s,a,u=n&&n.length,h=u?n[0]*e:t.length,c=hm(t,0,h,e,!0),f=[];if(!c||c.next===c.prev)return f;if(u&&(c=function(t,n,e,i){var r,o,s,a,u=[];for(r=0,o=n.length;r<o;r++)s=n[r]*i,a=r<o-1?n[r+1]*i:t.length,(a=hm(t,s,a,i,!1))===a.next&&(a.steiner=!0),u.push(function(t){var n=t,e=t;for(;(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next,n!==t;);return e}(a));for(u.sort(lm),r=0;r<u.length;r++)!function(t,n){(n=function(t,n){var e,i=n,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&s<a){if((s=a)===r){if(o===i.y)return i;if(o===i.next.y)return i.next}e=i.x<i.next.x?i:i.next}}}while(i=i.next,i!==n);if(!e)return null;if(r===s)return e.prev;var u,h=e,c=e.x,f=e.y,l=1/0;i=e.next;for(;i!==h;)r>=i.x&&i.x>=c&&r!==i.x&&vm(o<f?r:s,o,c,f,o<f?s:r,o,i.x,i.y)&&((u=Math.abs(o-i.y)/(r-i.x))<l||u===l&&i.x>e.x)&&ym(i,t)&&(e=i,l=u),i=i.next;return e}(t,n))&&cm(t=bm(n,t),t.next)}(u[r],e),e=cm(e,e.next);return e}(t,n,c,e)),t.length>80*e){for(var l=i=t[0],d=r=t[1],v=e;v<h;v+=e)(o=t[v])<l&&(l=o),(s=t[v+1])<d&&(d=s),i<o&&(i=o),r<s&&(r=s);a=0!==(a=Math.max(i-l,r-d))?1/a:0}return fm(c,f,e,l,d,a),f};function hm(t,n,e,i,r){var o,s;if(r===0<function(t,n,e,i){for(var r=0,o=n,s=e-i;o<e;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}(t,n,e,i))for(o=n;o<e;o+=i)s=_m(o,t[o],t[o+1],s);else for(o=e-i;n<=o;o-=i)s=_m(o,t[o],t[o+1],s);return s&&mm(s,s.next)&&(wm(s),s=s.next),s}function cm(t,n){if(!t)return t;n=n||t;var e,i=t;do{if(e=!1,i.steiner||!mm(i,i.next)&&0!==pm(i.prev,i,i.next))i=i.next;else{if(wm(i),(i=n=i.prev)===i.next)break;e=!0}}while(e||i!==n);return n}function fm(t,n,e,i,r,o,s){if(t){!s&&o&&function(t,n,e,i){var r=t;for(;null===r.z&&(r.z=dm(r.x,r.y,n,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next,r!==t;);r.prevZ.nextZ=null,r.prevZ=null,function(t){var n,e,i,r,o,s,a,u,h=1;do{for(e=t,o=t=null,s=0;e;){for(s++,i=e,n=a=0;n<h&&(a++,i=i.nextZ);n++);for(u=h;0<a||0<u&&i;)0!==a&&(0===u||!i||e.z<=i.z)?(e=(r=e).nextZ,a--):(i=(r=i).nextZ,u--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;e=i}}while(o.nextZ=null,h*=2,1<s)}(r)}(t,i,r,o);for(var a,u,h=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?function(t,n,e,i){var r=t.prev,o=t,s=t.next;if(0<=pm(r,o,s))return!1;var a=(r.x<o.x?r.x<s.x?r:s:o.x<s.x?o:s).x,u=(r.y<o.y?r.y<s.y?r:s:o.y<s.y?o:s).y,h=(r.x>o.x?r.x>s.x?r:s:o.x>s.x?o:s).x,c=(r.y>o.y?r.y>s.y?r:s:o.y>s.y?o:s).y,f=dm(a,u,n,e,i),l=dm(h,c,n,e,i),d=t.prevZ,v=t.nextZ;for(;d&&d.z>=f&&v&&v.z<=l;){if(d!==t.prev&&d!==t.next&&vm(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=pm(d.prev,d,d.next))return!1;if(d=d.prevZ,v!==t.prev&&v!==t.next&&vm(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=pm(v.prev,v,v.next))return!1;v=v.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&vm(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=pm(d.prev,d,d.next))return!1;d=d.prevZ}for(;v&&v.z<=l;){if(v!==t.prev&&v!==t.next&&vm(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=pm(v.prev,v,v.next))return!1;v=v.nextZ}return!0}(t,i,r,o):function(t){var n=t.prev,e=t,i=t.next;if(0<=pm(n,e,i))return!1;var r=t.next.next;for(;r!==t.prev;){if(vm(n.x,n.y,e.x,e.y,i.x,i.y,r.x,r.y)&&0<=pm(r.prev,r,r.next))return!1;r=r.next}return!0}(t))n.push(a.i/e),n.push(t.i/e),n.push(u.i/e),wm(t),t=u.next,h=u.next;else if((t=u)===h){s?1===s?fm(t=function(t,n,e){var i=t;do{var r=i.prev,o=i.next.next}while(!mm(r,o)&&gm(r,i,i.next,o)&&ym(r,o)&&ym(o,r)&&(n.push(r.i/e),n.push(i.i/e),n.push(o.i/e),wm(i),wm(i.next),i=t=o),i=i.next,i!==t);return i}(t,n,e),n,e,i,r,o,2):2===s&&function(t,n,e,i,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&function(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&gm(e,e.next,t,n))return!0}while(e=e.next,e!==t);return!1}(t,n)&&ym(t,n)&&ym(n,t)&&function(t,n){var e=t,i=!1,r=(t.x+n.x)/2,o=(t.y+n.y)/2;for(;e.y>o!=e.next.y>o&&e.next.y!==e.y&&r<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next,e!==t;);return i}(t,n)}(s,a)){var u=bm(s,a);return s=cm(s,s.next),u=cm(u,u.next),fm(s,n,e,i,r,o),fm(u,n,e,i,r,o)}a=a.next}}while(s=s.next,s!==t)}(t,n,e,i,r,o):fm(cm(t),n,e,i,r,o,1);break}}}function lm(t,n){return t.x-n.x}function dm(t,n,e,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-e)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-i)*r)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function vm(t,n,e,i,r,o,s,a){return 0<=(r-s)*(n-a)-(t-s)*(o-a)&&0<=(t-s)*(i-a)-(e-s)*(n-a)&&0<=(e-s)*(o-a)-(r-s)*(i-a)}function pm(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function mm(t,n){return t.x===n.x&&t.y===n.y}function gm(t,n,e,i){return mm(t,e)&&mm(n,i)||mm(t,i)&&mm(e,n)||0<pm(t,n,e)!=0<pm(t,n,i)&&0<pm(e,i,t)!=0<pm(e,i,n)}function ym(t,n){return pm(t.prev,t,t.next)<0?0<=pm(t,n,t.next)&&0<=pm(t,t.prev,n):pm(t,n,t.prev)<0||pm(t,t.next,n)<0}function bm(t,n){var e=new xm(t.i,t.x,t.y),i=new xm(n.i,n.x,n.y),r=t.next,o=n.prev;return(t.next=n).prev=t,(e.next=r).prev=e,(i.next=e).prev=i,(o.next=i).prev=o,i}function _m(t,n,e,i){e=new xm(t,n,e);return i?(e.next=i.next,(e.prev=i).next.prev=e,i.next=e):(e.prev=e).next=e,e}function wm(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function xm(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Mm={area:function(t){for(var n=t.length,e=0,i=n-1,r=0;r<n;i=r++)e+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*e},isClockWise:function(t){return Mm.area(t)<0},triangulateShape:function(t,n){var e=[],i=[],r=[];Em(t),Sm(e,t);var o=t.length;n.forEach(Em);for(var s=0;s<n.length;s++)i.push(o),o+=n[s].length,Sm(e,n[s]);for(var a=um(e,i),s=0;s<a.length;s+=3)r.push(a.slice(s,s+3));return r}};function Em(t){var n=t.length;2<n&&t[n-1].equals(t[0])&&t.pop()}function Sm(t,n){for(var e=0;e<n.length;e++)t.push(n[e].x),t.push(n[e].y)}function Tm(t){return(Tm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lm(t,n){fr.call(this),this.type="ShapeGeometry","object"===Tm(n)&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),n=n.curveSegments),this.parameters={shapes:t,curveSegments:n},this.fromBufferGeometry(new Om(t,n)),this.mergeVertices()}function Om(t,l){kr.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:l},l=l||12;var d=[],v=[],p=[],m=[],n=0,g=0;if(!1===Array.isArray(t))i(t);else for(var e=0;e<t.length;e++)i(t[e]),this.addGroup(n,g,e),n+=g,g=0;function i(t){var n,e=v.length/3,t=t.extractPoints(l),i=t.shape,r=t.holes;for(!1===Mm.isClockWise(i)&&(i=i.reverse()),s=0,a=r.length;s<a;s++)n=r[s],!0===Mm.isClockWise(n)&&(r[s]=n.reverse());for(var o=Mm.triangulateShape(i,r),s=0,a=r.length;s<a;s++)n=r[s],i=i.concat(n);for(s=0,a=i.length;s<a;s++){var u=i[s];v.push(u.x,u.y,0),p.push(0,0,1),m.push(u.x,u.y)}for(s=0,a=o.length;s<a;s++){var h=o[s],c=h[0]+e,f=h[1]+e,h=h[2]+e;d.push(c,f,h),g+=3}}this.setIndex(d),this.setAttribute("position",new wr(v,3)),this.setAttribute("normal",new wr(p,3)),this.setAttribute("uv",new wr(m,2))}function Rm(t,n){fr.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:n},this.fromBufferGeometry(new Am(t,n)),this.mergeVertices()}function Am(t,q){kr.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:q},t=Array.isArray(t)?t:[t];for(var K=this,J=[],Q=[],n=0,e=t.length;n<e;n++)!function(t){var i=[],n=void 0!==q.curveSegments?q.curveSegments:12,u=void 0!==q.steps?q.steps:1,e=void 0!==q.depth?q.depth:100,r=void 0===q.bevelEnabled||q.bevelEnabled,o=void 0!==q.bevelThickness?q.bevelThickness:6,s=void 0!==q.bevelSize?q.bevelSize:o-2,a=void 0!==q.bevelOffset?q.bevelOffset:0,h=void 0!==q.bevelSegments?q.bevelSegments:3,c=q.extrudePath,f=void 0!==q.UVGenerator?q.UVGenerator:Cm;void 0!==q.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),e=q.amount);var l,d,v,p,m,g,y,b,_=!1;c&&(l=c.getSpacedPoints(u),r=!(_=!0),d=c.computeFrenetFrames(u,!1),v=new Et,p=new Et,m=new Et);r||(a=s=o=h=0);var n=t.extractPoints(n),w=n.shape,x=n.holes;if(!Mm.isClockWise(w))for(w=w.reverse(),y=0,b=x.length;y<b;y++)g=x[y],Mm.isClockWise(g)&&(x[y]=g.reverse());var M=Mm.triangulateShape(w,x),E=w;for(y=0,b=x.length;y<b;y++)g=x[y],w=w.concat(g);function S(t,n,e){return n||console.error("THREE.ExtrudeGeometry: vec does not exist"),n.clone().multiplyScalar(e).add(t)}var T,L,O,R,A,C,k=w.length,P=M.length;function D(t,n,e){var i=t.x-n.x,r=t.y-n.y,o=e.x-t.x,s=e.y-t.y,a=i*i+r*r;if(Math.abs(i*s-r*o)>Number.EPSILON){var u=Math.sqrt(a),h=Math.sqrt(o*o+s*s),c=n.x-r/u,f=n.y+i/u,u=((e.x-s/h-c)*s-(e.y+o/h-f)*o)/(i*s-r*o),f=(h=c+i*u-t.x)*h+(c=f+r*u-t.y)*c;if(f<=2)return new ii(h,c);u=Math.sqrt(f/2)}else{f=!1;i>Number.EPSILON?o>Number.EPSILON&&(f=!0):i<-Number.EPSILON?o<-Number.EPSILON&&(f=!0):Math.sign(r)===Math.sign(s)&&(f=!0),u=f?(h=-r,c=i,Math.sqrt(a)):(h=i,c=r,Math.sqrt(a/2))}return new ii(h/u,c/u)}for(var j=[],N=0,I=E.length,F=I-1,U=N+1;N<I;N++,F++,U++)F===I&&(F=0),U===I&&(U=0),j[N]=D(E[N],E[F],E[U]);var G,B,H=[],V=j.concat();for(y=0,b=x.length;y<b;y++){for(g=x[y],G=[],N=0,I=g.length,F=I-1,U=N+1;N<I;N++,F++,U++)F===I&&(F=0),U===I&&(U=0),G[N]=D(g[N],g[F],g[U]);H.push(G),V=V.concat(G)}for(T=0;T<h;T++){for(O=T/h,R=o*Math.cos(O*Math.PI/2),L=s*Math.sin(O*Math.PI/2)+a,N=0,I=E.length;N<I;N++)W((A=S(E[N],j[N],L)).x,A.y,-R);for(y=0,b=x.length;y<b;y++)for(g=x[y],G=H[y],N=0,I=g.length;N<I;N++)W((A=S(g[N],G[N],L)).x,A.y,-R)}for(L=s+a,N=0;N<k;N++)A=r?S(w[N],V[N],L):w[N],_?(p.copy(d.normals[0]).multiplyScalar(A.x),v.copy(d.binormals[0]).multiplyScalar(A.y),m.copy(l[0]).add(p).add(v),W(m.x,m.y,m.z)):W(A.x,A.y,0);for(B=1;B<=u;B++)for(N=0;N<k;N++)A=r?S(w[N],V[N],L):w[N],_?(p.copy(d.normals[B]).multiplyScalar(A.x),v.copy(d.binormals[B]).multiplyScalar(A.y),m.copy(l[B]).add(p).add(v),W(m.x,m.y,m.z)):W(A.x,A.y,e/u*B);for(T=h-1;0<=T;T--){for(O=T/h,R=o*Math.cos(O*Math.PI/2),L=s*Math.sin(O*Math.PI/2)+a,N=0,I=E.length;N<I;N++)W((A=S(E[N],j[N],L)).x,A.y,e+R);for(y=0,b=x.length;y<b;y++)for(g=x[y],G=H[y],N=0,I=g.length;N<I;N++)A=S(g[N],G[N],L),_?W(A.x,A.y+l[u-1].y,l[u-1].x+R):W(A.x,A.y,e+R)}function z(t,n){var e,i;for(N=t.length;0<=--N;){(i=(e=N)-1)<0&&(i=t.length-1);for(var r=0,o=u+2*h,r=0;r<o;r++){var s=k*r,a=k*(r+1);!function(t,n,e,i){Y(t),Y(n),Y(i),Y(n),Y(e),Y(i);i=J.length/3,i=f.generateSideWallUV(K,J,i-6,i-3,i-2,i-1);Z(i[0]),Z(i[1]),Z(i[3]),Z(i[1]),Z(i[2]),Z(i[3])}(n+e+s,n+i+s,n+i+a,n+e+a)}}}function W(t,n,e){i.push(t),i.push(n),i.push(e)}function X(t,n,e){Y(t),Y(n),Y(e);e=J.length/3,e=f.generateTopUV(K,J,e-3,e-2,e-1);Z(e[0]),Z(e[1]),Z(e[2])}function Y(t){J.push(i[3*t+0]),J.push(i[3*t+1]),J.push(i[3*t+2])}function Z(t){Q.push(t.x),Q.push(t.y)}(function(){var t=J.length/3;if(r){var n=0*k;for(N=0;N<P;N++)X((C=M[N])[2]+n,C[1]+n,C[0]+n);for(n=k*(u+2*h),N=0;N<P;N++)X((C=M[N])[0]+n,C[1]+n,C[2]+n)}else{for(N=0;N<P;N++)X((C=M[N])[2],C[1],C[0]);for(N=0;N<P;N++)X((C=M[N])[0]+k*u,C[1]+k*u,C[2]+k*u)}K.addGroup(t,J.length/3-t,0)})(),function(){var t=J.length/3,n=0;for(z(E,n),n+=E.length,y=0,b=x.length;y<b;y++)z(g=x[y],n),n+=g.length;K.addGroup(t,J.length/3-t,1)}()}(t[n]);this.setAttribute("position",new wr(J,3)),this.setAttribute("uv",new wr(Q,2)),this.computeVertexNormals()}(Lm.prototype=Object.create(fr.prototype)).constructor=Lm,(Om.prototype=Object.create(kr.prototype)).constructor=Om,(Rm.prototype=Object.create(fr.prototype)).constructor=Rm,(Am.prototype=Object.create(kr.prototype)).constructor=Am;var Cm={generateTopUV:function(t,n,e,i,r){var o=n[3*e],s=n[3*e+1],a=n[3*i],e=n[3*i+1],i=n[3*r],r=n[3*r+1];return[new ii(o,s),new ii(a,e),new ii(i,r)]},generateSideWallUV:function(t,n,e,i,r,o){var s=n[3*e],a=n[3*e+1],u=n[3*e+2],h=n[3*i],c=n[3*i+1],f=n[3*i+2],l=n[3*r],d=n[3*r+1],e=n[3*r+2],i=n[3*o],r=n[3*o+1],o=n[3*o+2];return Math.abs(a-c)<.01?[new ii(s,1-u),new ii(h,1-f),new ii(l,1-e),new ii(i,1-o)]:[new ii(a,1-u),new ii(c,1-f),new ii(d,1-e),new ii(r,1-o)]}};ki=function t(n,e,i){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.gt=n,this.ks=new Fc(this),this.On=null,this.$e=i,this.$e.mapID=this.$e.buildingID,this.Et=e,this.gt.Et.mapURL&&(this.$e.mapURL=this.gt.Et.mapURL),this.iu=new Sl(null,!1,i.key),this.Ya=i.mapID,this.ru=null,this.ou=!0,this.Ct=this.gt.Ct.concat(),this.su=!1,this.au=!1,this.uu=!1,this.hu=new Map,this.cu=[],this.fu=this.fu.bind(this),n.on("visibleLevelsLoaded",this.et.bind(this)),n.on("loaded",this.et.bind(this)),n.on("update",this.fu)};Object.assign(ki.prototype,{lu:function(t){t=this.gr(t);return null!==t?t.yt:[]},du:function(e,i,r){var t,o=this;!this.gt.Et.tile||this.$e.preLoad||this.gt.getFloor(i)?r&&r():(t=this.gt.Xa,this.$e.visibleLevels=[i],t.hr(this.$e,function(t,n){"floor"===t&&(t=o.gr(e),(n=o.Zi(t,n,i)).qa(),o.vu(t,null,n,n.kt,!1,function(){r&&r()}))}))},pu:function(t,r,o){var e=this,i=this.gr(t);if(this.gt.Et.tile&&!this.$e.preLoad){for(var n=[],s=0;s<r.length;s++)this.gt.getFloor(r[s])||n.push(r[s]);0!==n.length?(t=this.gt.Xa,this.$e.visibleLevels=n,t.hr(this.$e,function(t,n){"floor"===t&&((n=e.Zi(i,n,n.gid)).qa(),e.vu(i,null,n,n.kt,!1,function(t,n,e,i){n===r[r.length-1]&&o&&o()}))})):o&&o()}else o&&o()},gr:function(t){for(var n=null,e=0;e<this.gt.yt.length;e++)if(this.gt.yt[e].Ya===t){n=this.gt.yt[e];break}return n},Ft:function(t,n){var e=this.gr(t);if(null===e)return null;for(var i=null,r=0;r<e.yt.length;r++){var o=e.yt[r];if(""+o.kt==""+n){i=o;break}}return i},mu:function(t,n){var e=this.gu(t.On.ji,n.I,n.F,t.It,n);t.Ts=e;var i=n.Ja.Go({fid:t.Ws,typeID:t.getData().typeID+""}),e=this.ks.Qr(i);t.As(e,new Et(0,0,0));n=this.ks.to(i,!0),e=t.It&&-1!==t.It?t.It:2;t.jo=i,t.oa(n,e),i.image&&i.sizes&&(n=i.sizes.split(","),e=[],i.coords&&(e=i.coords.split(",")),t.setTopImage({image:this.yu(i,"logoPath")+i.image,angle:i.angle||0,size:[parseFloat(n[0]),parseFloat(n[1])],mapCoord:i.coords?new ii(parseFloat(e[0]),parseFloat(e[1])):void 0}))},bu:function(t,n){var e=t.On,e=this.gu(e.ji,n.I,n.F,t.It,n);t.Ts=e;n=n.Ja.Uo(),n=this.ks.Qr(n);t.As(n,new Et(0,-t.It,0))},_u:function(n,t,e){var i,r,o,s,a;(n.Xs||n.ca)&&(a=(r=n.On).height,o=r.ji[0],i=new Et(o.x-t.I,-o.y+t.F,0).applyEuler(new _(Math.PI/2,0,0,"XYZ")).add(new Et(0,a,0)),r=n.ha,n.Xs||(r=""),n.It=a,n.la=i,o=t.Ja.Vo({fid:n.ua,typeID:n.getData().typeID+""}),n.jo=o,n.fa=this.yu(o,"path"),a={needSize:!0},void 0===(t=o.fontsize)?t=20:("string"==typeof t&&(t=parseInt(t)),isNaN(t)&&(t=20)),n.Ge=t,s=this.va(1.4*o.fontsize),o.image?(a.imageUrl=this.yu(o,"path")+o.image,this.ks.oo(r,o,a,function(t){n.pa(t,(new Et).copy(i),s),e()}).side=2):((a=this.ks.oo(r,o,a)).side=2,n.pa(a,(new Et).copy(i),s),e()))},wu:function(){this.Ya||(this.Ya=this.gt.yt[0].Ya);for(var t=this.lu(this.Ya).concat(),n=0;n<t.length;n++){var e=t[n].za(Xi.LABEL_LAYER);if(!e)return;for(var i=0;i<e.yt.length;i++){var r=e.yt[i];this.ru===Up.FID?(r.setText(r.ua),r.visible=!0):this.ru===Up.ENAME?r.ca?(r.setText(r.ca),r.visible=!0):r.visible=!1:r.Xs?(r.setText(r.Xs),r.visible=!0):r.visible=!1}}},va:function(t){var n=0,n=this.gt.wt.isPerspectiveCamera?t/(this.gt.qt.renderer.domElement.clientHeight/(2*Math.tan(this.gt.wt.fov*vi.DEG2RAD/2))):t*Math.abs(this.gt.wt.top-this.gt.wt.bottom)/this.gt.wt.zoom/this.gt.qt.renderer.domElement.clientHeight;return n=isNaN(n)?1:n},xu:function(t,n){if(this.gt.wt.isPerspectiveCamera){var e=new St;e.multiplyMatrices(this.gt.Kt.matrixWorldInverse,t.matrixWorld);e=(new Et).applyMatrix4(e);return this.va(n)*Math.abs(e.z)}return this.va(n)},Mu:function(t){var n,e,i=(new Et).copy(this.gt.eu._t.target),r=new ii(0,0);return i.y=this.gt.getFloor(t).It+r.y,10/("PerspectiveCamera"===this.gt.wt.type?(e=this.gt.wt.near,r=this.gt.wt.fov,n=this.gt.eu._t.object.position.distanceTo(i),10*e*Math.tan(r/2*vi.DEG2RAD)*2/this.gt.qt.renderer.domElement.clientHeight*n/e):(n=this.gt.wt.top,e=this.gt.wt.bottom,10*Math.abs(n-e)/this.gt.qt.renderer.domElement.clientHeight/this.gt.wt.zoom))},Eu:function(t,n){var e=t.On,i=e.height,e=e.ji[0],e=new Et(e.x-n.I,-e.y+n.F,0).applyEuler(new _(Math.PI/2,0,0,"XYZ")).add(new Et(0,i,0));t.It=i,t.la=e;i=n.Ja.Ho({fid:t.ua,typeID:""+t.getData().typeID}),n=this.ks.so({needDepth:!1,url:this.yu(i,"path")+i.imageName});n.side=2,t.Ge=i.height,"string"==typeof t.Ge&&(t.Ge=parseInt(t.Ge));i=this.va(i.height);t.pa(n,(new Et).copy(e),i)},Ss:function(t,n,e,i){n.Ln?i():t===Xi.EXTENT?(this.bu(n,e),i()):t===Xi.MODEL?(this.mu(n,e),i()):t===Xi.LABEL?this._u(n,e,i):t===Xi.FACILITY?(this.Eu(n,e),i()):t===Xi.EXTERNAL_MODEL&&this.Su(n,e,i)},Su:function(i,r,o){var s=this,a=r.Ja.zo({fid:i.ua,typeID:i.ya});a&&a.normalID&&(this.iu.path=this.yu(a,"model"),this.iu.load(a,i.ua,function(t,n,e){s.Tu(i,t,n,a,r,e),o()},i.ua))},Tu:function(t,n,e,i,r,o){o?t.Ma(n,i,r):t.xa(n,e,i,r)},fu:function(){var r=this;0<this.cu.length&&function(){for(var e=r.gt.getZoom(),i=0,n=0;n<r.cu.length;n++)if(r.cu[n][0]+1===r.gt.kt)if("break"===function(){i++;var t=r.cu[n][1];if(r.Ss(t.Tn,t,r.gt.yt[0],function(){return e<=t.We&&e>=t.Xe||!t.We?t.Ln.visible=!0:t.Ln.visible=!1}),r.cu.splice(n,1),50<i)return"break"}())break;for(var t=0;t<r.cu.length;t++)if("break"===function(t){i++;var n=r.cu[t][1];if(r.Ss(n.Tn,n,r.gt.yt[0],function(){return e<=n.We&&e>=n.Xe||!n.We?n.Ln.visible=!0:n.Ln.visible=!1}),r.cu.splice(t,1),50<i)return"break"}(t))break;r.gt.qt.Ye()}()},Lu:function(){var i=this;this.Bo(function(t){var n=new Jc,e=i.gt.yt[0];n.Lo(t),n.Io(i.gt.Et.themeExtension),i.gt.Et.themeExtension=null,i.hu.set(i.$e.buildingID,n),e&&(e.Ja=n),void 0===i.gt.Et.backgroundColor&&void 0===i.gt.Et.backgroundAlpha?(n=n.Fo(),i.gt.setBackgroundColor(n.clearColor,n.clearAlpha)):i.gt.setBackgroundColor(i.gt.Et.backgroundColor,i.gt.Et.backgroundAlpha),i.uu=!0,i.su&&i.$e.callback(null,null,i.su,!1,i.au,!0)}),this.Ou()},Bo:function(t){this.gt.Et.jo?t(this.gt.Et.jo):Uc.ti(this.gt.Et.themeURL,this.gt.Et.themeName,t)},Ou:function(){var s=this;this.gt.Et.tile?(this.$e.level=this.gt.kt,this.$e.visibleLevels=this.gt.Ct,this.$e.preLoad=this.gt.Et.preLoad,this.Ru()):this.gt.Xa.cr(this.$e,function(t,n){if("complete"===t){var e=s.Yi(n),i=n.yt;s.gt.Qe=s.Au(i,s.gt.Et.visibleLevels);for(var r=0;r<e.Va.length;r++){var o=i.get(e.Va[r]),o=s.Zi(e,o,e.Va[r]);o.qa(),s.Ct.length=0,s.vu(e,null,o,o.kt)}}})},Au:function(t,n){for(var e=0,i=0;i<n.length;i++)e+=t.get(n[i]).yt.size;return e},Ru:function(){var a=this,u=0,h={},c=null;this.gt.Xa.hr(this.$e,function(t,n){if(c){if("layer"===t)switch(n.Tn){case Xi.EXTENT_LAYER:h[Xi.EXTENT_LAYER]=new ed(n);break;case Xi.MODEL_LAYER:h[Xi.MODEL_LAYER]=new vd(n);break;case Xi.EXTERNAL_MODEL_LAYER:h[Xi.EXTERNAL_MODEL_LAYER]=new gv(n);break;case Xi.LABEL_LAYER:h[Xi.LABEL_LAYER]=new Gd(n);break;case Xi.FACILITY_LAYER:h[Xi.FACILITY_LAYER]=new Qd(n)}if("floor"===t){for(var e=null,i=0;i<c.yt.length;i++)if(n.gid===c.yt[i].kt){e=c.yt[i];break}for(var r=0;r<a.Ct.length;r++)if(n.gid===a.Ct[r]){a.Ct.splice(r,1);break}e.Wa(),a.vu(c,h,e,c.Va[u]),h={},u++}}else if("building"===t){c=a.Yi(n);for(var o=n.yt,s=0;s<c.Va.length;s++)a.Zi(c,o.get(c.Va[s]),c.Va[s]);a.gt.Qe=a.Au(o,a.gt.Et.visibleLevels)}})},vu:function(t,n,e,i){var r=this.$e.callback,o=!1;this.ou&&0===this.Ct.length&&(this.su=o=!0,this.ou=!1);for(var s,a=0;a<e.Va.length;a++)n&&((s=n[e.Va[a]]).gt=e,s.Ce.position.y=t.Es*e.kt,e.yt.push(s)),this.uu&&!t.Ja&&(t.Ja=this.hu.get(t.Ya)),r(e.Va[a],i,o,!1,!1,this.uu);this.au=i===t.Va[t.Va.length-1],r(e.Va[e.Va.length-1],i,o,!0,this.au,this.uu)},et:function(){for(var t=this.gt.yt[0].yt,n=0;n<t.length;n++)for(var e=0;e<t[n].yt.length;e++)for(var i=0;i<t[n].yt[e].yt.length;i++)this.cu.push([n,t[n].yt[e].yt[i]])},Zi:function(t,n,e){e=new Np({building:t,data:n,key:e});return t.yt.push(e),e},Yi:function(t){var n={buildingID:this.$e.mapID,bounds:{maxX:t.maxX,maxY:t.maxY,minX:t.minX,minY:t.minY},height:t.height,scaleLevel:t.scaleLevel,name:t.mname,levels:t.levels,x:t.x,y:t.y},e=new Fp(n);e.Es=this.gt.Et.floorSpace,e.gt=this.gt;n=this.gt.Et.state.level||this.gt.Et.level;return e.Ct=i(n,this.gt.Et.visibleLevels),this.gt.Et.tile&&!this.Et.preLoad?e.Va=i(n,this.gt.Et.visibleLevels):e.Va=i(n,this.gt.Et.visibleLevels,t.levels),this.gt.yt.push(e),e;function i(t,n,e){var i=[];i.push(t);for(var r=0;r<n.length;r++)n[r]!==t&&i.push(n[r]);if(e)for(var o=0;o<e.length;o++)!function(t,n){for(var e=!0,i=0;i<t.length;i++)if(t[i]===n){e=!1;break}return e}(i,e[o])||i.push(e[o]);return i}},gu:function(t,n,e,i,r){for(var o=new am,s=t[0],a=0;a<s.length;a++)0===a?o.moveTo(s[a].x-n,s[a].y-e):o.lineTo(s[a].x-n,s[a].y-e);if(1<t.length)for(var u=1;u<t.length;u++){for(var h=t[u],c=new sm,f=0;f<h.length;f++)0===f?c.moveTo(h[f].x-n,h[f].y-e):c.lineTo(h[f].x-n,h[f].y-e);o.holes.push(c)}for(var l=null,l=0===i?new Lm(o):new Rm(o,{depth:i,bevelEnabled:!1}),d=r.Qa.min.x-n,v=r.Qa.min.y-e,p=r.Qa.max.x-n-d,m=r.Qa.max.y-e-v,g=l.faces,y=g.length,b=0;b<y;b++){var _=l.vertices[g[b].a],w=l.vertices[g[b].b],x=l.vertices[g[b].c];l.faceVertexUvs[0][b][0].x=(_.x-d)/p,l.faceVertexUvs[0][b][0].y=(_.y-v)/m,l.faceVertexUvs[0][b][1].x=(w.x-d)/p,l.faceVertexUvs[0][b][1].y=(w.y-v)/m,l.faceVertexUvs[0][b][2].x=(x.x-d)/p,l.faceVertexUvs[0][b][2].y=(x.y-v)/m}return l.computeBoundingSphere(),{geometry:l,shape:o}},Cu:function(t){t=this.gr(t);if(null===t)return-1;t=t.bounds;return Math.sqrt((t.maxX-t.minX)*(t.maxX-t.minX)+(t.maxY-t.minY)*(t.maxY-t.minY))},ku:function(n){var e=this;Uc.ti(this.gt.Et.themeURL,n,function(t){e.gt.Et.themeName=n,e.gt.yt[0].Ja.Lo(t),e.Pu()})},Du:function(t){this.gt.yt[0].Ja.No.Lo(t),this.Pu()},Pu:function(){var t,n=this.gt.yt[0].Ja;void 0===this.gt.Et.backgroundColor&&void 0===this.gt.Et.backgroundAlpha?(t=n.Fo(),this.gt.setBackgroundColor(t.clearColor,t.clearAlpha)):this.gt.setBackgroundColor(this.gt.Et.backgroundColor,this.gt.Et.backgroundAlpha);for(var e=this.gt.yt[0].yt,i=0;i<e.length;i++)for(var r=0;r<e[i].yt.length;r++)for(var o=e[i].yt[r],s=0;s<o.yt.length;s++)o.yt[s].Cs&&o.yt[s].Cs(this,n)},yu:function(t,n){var e=this.gt.Et,i=this.gt.yt[0].Ja.jo;if(e.ju){var r=e.themeURL;return"path"===n?("1"===t.isuser?r+=i.userPath+"/":r+=i.sysPath+"/",r):"logoPath"===n?r+=i.logoPath+"/":"model"===n?("1"===t.isuser?r+=i.userModelPath+"/":r+=i.sysModelPath+"/",r):void 0}if("model"!==n)return e.themeURL+e.themeName+"/";n=gh.externalModelUrl;return n=e.mapURL?e.mapURL+this.$e.buildingID+"/models/":n},st:function(){this.gt.off("visibleLevelsLoaded",this.et.bind(this)),this.gt.off("loaded",this.et.bind(this)),this.gt.off("update",this.fu),this.hu.clear(),this.cu=[],this.iu.st(),this.iu=null,this.gt=null}});var km=ki;ah=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.yt=new Map,this.Nu=[],this.Iu=(new Date).getTime(),this.Fu=new Map,this.Re()};Object.assign(ah.prototype,{tn:function(t){if(Array.isArray(t)){this.yt.set(t[0].rt,t[0]);for(var n=0;n<t.length-1;n++)t[n+1].Z=t[n].Z+t[n].Q,t[n+1].K=t[n].K+t[n].Q,this.yt.set(t[n+1].rt,t[n+1])}else this.yt.has(t.rt)||this.yt.set(t.rt,t)},Qt:function(t){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.yt.delete(t[n].rt);else this.yt.delete(t.rt)},Uu:function(t){this.Nu.push(t)},Gu:function(t){this.Fu.set(t.rt=Si.generateUUID(),t)},ja:function(t){this.Fu.delete(t.rt)},et:function(t,n,e){for(var i=[],r=[],o=0;o<t.W.length;o++)void 0===t.Y[o]&&(t.Y[o]=0),1<=n?(i.push(t.X[o]),r.push(t.X[o]-t.W[o]-t.Y[o])):(i.push((t.X[o]-t.W[o])*n+t.W[o]),r.push((t.X[o]-t.W[o])*e),t.Y[o]+=(t.X[o]-t.W[o])*e);t.et({destination:i,delta:r}),i.length=0,r.length=0},Re:function(){var i=this;requestAnimationFrame(this.Re.bind(this));var r=(new Date).getTime(),o=r-this.Iu;this.Fu.forEach(function(t){return t(o)});for(var t=0;t<this.Nu.length;t++)this.Nu[t].update(o/1e3);this.yt.forEach(function(t){var n,e;t.nt||(t.tt?t.J+=o:(n=(r-t.Z)/t.Q,e=o/t.Q,i.et(t,n,e),e=r-t.Z-t.K,t.Q<e&&(t.Y=[],t.$?(t.Z=r,t.it&&t.it()):(e=t.nt,t.nt=!0,!e&&t.it&&t.it()))))}),this.Iu=r},st:function(){this.yt.forEach(function(t){t.st()}),this.yt.clear(),this.Nu=[],this.Fu.clear()}});var Pm=ah;e=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(e.prototype,{Bu:function(t,n){void 0===this.N&&(this.N={});var e=this.N;void 0===e[t]&&(e[t]=[]),-1===e[t].indexOf(n)&&e[t].push(n)},Hu:function(t,n){if(void 0===this.N)return!1;var e=this.N;return void 0!==e[t]&&-1!==e[t].indexOf(n)},Vu:function(t,n){void 0!==this.N&&(void 0===(t=this.N[t])||-1!==(n=t.indexOf(n))&&t.splice(n,1))},xt:function(t){if(void 0!==this.N){var n=this.N[t.type];if(void 0!==n)for(var e=n.slice(0),i=0,r=e.length;i<r;i++)e[i].call(this,t)}}});var Dm=e,Qu={RIGHT:2,LEFT:4,BOTTOM:8,TOP:16,RIGHT_BOTTOM:32,LEFT_BOTTOM:64,RIGHT_TOP:128,LEFT_TOP:256,CENTER:512};Object.freeze(Qu);var jm=Qu;function Nm(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Im=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"convertPointCoordsByCenter",value:function(t,n){return t.x=t.x-n.x,t.y=t.y-n.y,void 0!==t.z&&void 0!==n.z&&(t.z=t.z-n.z),t}},{key:"convertPointsCoordsByCenter",value:function(t,n){for(var e=0;e<t.length;e++)this.convertPointCoordsByCenter(t[e],n);return t}},{key:"getMapScaleInfo",value:function(){var t,n;return window.screen.deviceXDPI?t=window.screen.deviceXDPI:((n=document.createElement("DIV")).style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(n),t=parseInt(n.offsetWidth),n.parentNode.removeChild(n)),t/2.54}},{key:"getCenterByAnchor",value:function(t){var n=new ii(.5,.5);switch(t){case jm.LEFT:n.setX(0);break;case jm.RIGHT:n.setX(1);break;case jm.TOP:n.setY(1);break;case jm.BOTTOM:n.setY(0);break;case jm.LEFT_TOP:n.set(0,1);break;case jm.RIGHT_TOP:n.set(1,1);break;case jm.LEFT_BOTTOM:n.set(0,0);break;case jm.RIGHT_BOTTOM:n.set(1,0)}return n}}],(e=null)&&Nm(n.prototype,e),i&&Nm(n,i),t}();function Fm(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Um=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.container=t.container,this.appName=t.appName,this.key=t.key,this.license=t.license,this.mapID=t.mapID,this.mapURL=t.mapURL,this.themeURL=t.themeURL||gh.themeUrl,this.themeID=t.themeID||"2001",this.themeName=this.themeID,this.jo=t.theme,this.themeExtension=t.themeExtension,this.jo&&this.jo.sysPath&&(this.ju=!0),this.state={center:t.state&&t.state.center,zoom:t.state&&t.state.zoom,rotation:t.state&&t.state.rotation,tilt:t.state&&t.state.tilt,level:t.state&&t.state.level,floorSpace:t.state&&t.state.floorSpace,viewMode:t.state&&t.state.viewMode},this.backgroundColor=t.backgroundColor||void 0,this.backgroundAlpha="number"==typeof t.backgroundAlpha?t.backgroundAlpha:void 0,this.nonFocusAlphaMode=!1===t.nonFocusAlphaMode&&t.nonFocusAlphaMode,this.nonFocusAlpha=t.nonFocusAlpha||.1,this.tiltAngle=void 0!==t.tiltAngle?t.tiltAngle:30,this.maxTiltAngle=t.maxTiltAngle||90,this.minTiltAngle=void 0!==t.minTiltAngle?t.minTiltAngle:30,this.highlightColor=t.highlightColor||16212530,this.zoomRange=t.zoomRange||[16,23],this.mapZoom=t.mapZoom||20,this.visibleLevels=t.visibleLevels||[1],this.level=t.level||1,this.logarithmicDepthBuffer=t.logarithmicDepthBuffer||!1,this.tile=!1!==t.tile||t.tile,this.preLoad=!1!==t.preLoad||t.preLoad,this.floorSpace=t.floorSpace||50,this.loadLayerWaitingTime=t.loadLayerWaitingTime||.002,this.floorMode=t.floorMode||4,this.viewMode=t.viewMode||2,this.highlightMode=t.highlightMode||"click",this.fontFamily=t.fontFamily||'"Microsoft Yahei","微软雅黑",Tahoma,Arial',this.isStatDiplay=t.isStatDiplay||!1,this.shadingMode=t.shadingMode||4,this.lock=void 0!==t.lock&&t.lock}var t,e,i;return t=n,(e=[{key:"isPreview",get:function(){return this.ju}}])&&Fm(t.prototype,e),i&&Fm(t,i),n}();function Gm(t){return(Gm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bm(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Hm(t,n){return(Hm=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Vm(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Wm(e);return t=i?(t=Wm(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Gm(t)&&"function"!=typeof t?zm(n):t}}function zm(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Wm(t){return(Wm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}hh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Hm(t,n)}(r,Ll);var t,n,e,i=Vm(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).yt=[],n.Gt=[],n.Et=new Um(t),n.zu=n.Et.mapURL,n.Wu=t.appName,n.gs=t.key,n.Xu=t.license,n.jt=n.Et.mapZoom,n.Yu=n.jt,n.Zu=new Et,n.En=n.Et.highlightMode,n.qu=n.Et.zoomRange,n.Bt=n.Et.viewMode,n.Ct=n.Et.visibleLevels,n.kt=n.Et.state.level||n.Et.level,n.Ne=n.Et.floorMode,n.vn=0,n.Qe=0,n.in=[295829355.45,147914677.73,73957338.86,36978669.43,18489334.72,9244667.36,4622333.68,2311166.84,1155583.42,577791.71,288895.85,144447.93,72223.96,36111.98,18056,9028,4514,2257,1128,564,282,141,70,35,17,8,4,2,1],n.Kt=null,n.Xt=null,n.wt=n.Ku(t.container.clientWidth,t.container.clientHeight),n.eu=new Pi(zm(n),t.container),n.qt=new Fu(zm(n),{container:t.container,logarithmicDepthBuffer:n.Et.logarithmicDepthBuffer}),n.Ae=new Sv,n.Ae.gt=zm(n),n.Xa=null,n.Ut=null,n.Mt=new Dm,n.yn=new Ji(zm(n)),n.$t=new Pm,n.Nt=new Et,n.Ju=n.Ju.bind(zm(n)),n.Qu=n.Qu.bind(zm(n)),n.$u=[Xi.IMAGE_MARKER,Xi.TEXT_MARKER],n.th=t.container,n.setZoomRange(n.qu),n.nh(t.mapID),n}return t=r,(n=[{key:"setControlTarget",value:function(t){this.eu.Vt(t)}},{key:"dispose",value:function(){this.th.children[0].removeEventListener("mousedown",this.yn.it,!1),this.th.children[0].removeEventListener("mouseup",this.yn.it,!1),this.th.children[0].removeEventListener("touchstart",this.yn.it,!1),this.th.children[0].removeEventListener("mousemove",this.yn.it,!1),this.th.children[0].removeEventListener("touchmove",this.yn.it,!1),this.th.removeChild(this.th.children[0]);for(var t,n=0;n<this.yt.length;n++)this.yt[n]&&this.yt[n].st&&this.yt[n].st();for(t in this.yt.length=0,this.yt=null,delete this.yt,this)this[""+t]&&this[""+t].st&&this[""+t].st(),this[""+t]=null,delete this[""+t]}},{key:"resize",value:function(t,n){this.qt.ke(t,n)}},{key:"getMarkerGroup",value:function(){return this.Ae}},{key:"getVisibleLevels",value:function(){return this.Ct}},{key:"setTheme",value:function(t){this.Ut.ku(t)}},{key:"setThemeExtension",value:function(t){this.Ut.Du(t)}},{key:"clearThemeExtension",value:function(){this.Ut.Du()}},{key:"getRenderOrder",value:function(){return this.$u}},{key:"setRenderOrder",value:function(t){var e=this;this.$u=t;for(var n=0;n<this.yt.length;n++)for(var i=0;i<this.yt[n].yt.length;i++){var r=this.yt[n].yt[i];r&&r.yt.sort(function(t,n){return e.$u.indexOf(t.type)-e.$u.indexOf(n.type)})}this.qt.Ie(),this.qt.hn()}},{key:"setVisibleLevels",value:function(t,n){var e=this;t.sort(),this.Ct=t,this.Ut.pu(this.yt[0].Ya,t,function(){e.qt.Ie(),e.qt.hn(),e.Et.nonFocusAlphaMode&&e.qt.cn(),e.Mt.xt({type:"visibleLevelsChanged",levels:t}),e.qt.Zt(),n&&n()})}},{key:"getRenderManager",value:function(){return this.qt}},{key:"setRenderManager",value:function(t){for(var n in this.qt.render=t.render,t)this.qt[n]=t[n]}},{key:"getFloorMode",value:function(){return this.Ne}},{key:"setFloorMode",value:function(t){this.qt.je(t),this.Mt.xt({type:"visibleLevelsChanged",levels:this.Ct})}},{key:"getBuilding",value:function(){return this.yt[0]}},{key:"getCamera",value:function(){return this.wt}},{key:"getX",value:function(){return this.yt[0].x}},{key:"getY",value:function(){return this.yt[0].y}},{key:"getCenter",value:function(){return this.eu.rn()}},{key:"setCenter",value:function(t){this.eu.sn(t)}},{key:"zoomIn",value:function(){this.eu.nn(1.02)}},{key:"zoomOut",value:function(){this.eu.nn(.98)}},{key:"getZoomRange",value:function(){return this.qu}},{key:"setZoomRange",value:function(t){var n=Math.pow(2,vi.ZOOM_UPPER_BOUND-t[0]-1),e=Math.pow(2,vi.ZOOM_UPPER_BOUND-t[1]-1),i=this.eu._t;i.maxDistance=this.Dt(n),i.minDistance=this.Dt(e),i.minZoom=1/this.Ht(n),i.maxZoom=1/this.Ht(e),this.qu=t}},{key:"getZoom",value:function(){for(var t=this.wt.isPerspectiveCamera?this.Yt():this.Jt(),n=0,e=.1,i=0;i<this.in.length-1;i++)if(t<=this.in[i]&&t>this.in[i+1]){e=(this.in[n=i]-t)/(this.in[i]-this.in[i+1]);break}return parseFloat((n+1+e).toFixed(2))}},{key:"setZoom",value:function(t){this.eu.en(t)}},{key:"getRotation",value:function(){var t=Si.round(-this.eu._t.getAzimuthalAngle()*vi.RAD2DEG);return 360<(t=t<0?360+t:t)&&(t%=360),t}},{key:"setRotation",value:function(t){this.eu.dn(t)}},{key:"autoRotate",value:function(t){return this.eu.vn(t)}},{key:"stopAutoRotate",value:function(){this.$t.Qt(this.eu.bt.get("autoRotate")),this.eu.bt.delete("autoRotate")}},{key:"getTilt",value:function(){return Si.round(90-this.eu._t.getPolarAngle()*vi.RAD2DEG)}},{key:"setTilt",value:function(t){this.eu.Wt(t)}},{key:"getFloor",value:function(t){return this.yt[0].getFloor(t)}},{key:"getLevel",value:function(){return this.kt}},{key:"getLevels",value:function(){for(var t=[],n=0;n<this.yt[0].getFloors().length;n++)t.push(n+1);return t}},{key:"setLevel",value:function(t){this.eu.an(t)}},{key:"getFloorSpace",value:function(){return this.yt[0].getFloorSpace()}},{key:"setFloorSpace",value:function(t){this.yt[0].setFloorSpace(t),this.Mt.xt({type:"floorSpaceChanged"});for(var n=this.Ae.yt,e=0;e<n.length;e++)n[e].Na()}},{key:"getViewMode",value:function(){return this.wt.isPerspectiveCamera?mi.MODE_3D:mi.MODE_2D}},{key:"setViewMode",value:function(t){this.eu.zt(t)}},{key:"getInteracations",value:function(){return this.eu}},{key:"getMapBounds",value:function(){return this.getBound()}},{key:"getMapBound",value:function(){return this.getBound()}},{key:"getBound",value:function(){return this.yt[0].getBuildingBound()}},{key:"getState",value:function(){return{center:this.getCenter(),zoom:this.getZoom(),rotation:this.getRotation(),tilt:this.getTilt(),viewMode:this.getViewMode(),level:this.getLevel(),floorSpace:this.getFloorSpace()}}},{key:"setState",value:function(t,n){var e=this,i=!1!==n;this.setCenter({animate:i,x:t.center.x,y:t.center.y}),this.setZoom({animate:i,zoom:t.zoom}),this.setRotation({animate:i,rotation:t.rotation,finish:function(){e.setTilt({animate:i,tilt:t.tilt,finish:function(){e.setViewMode({animate:i,mode:t.viewMode})}})}}),this.setLevel({animate:i,level:t.level}),this.setFloorSpace(t.floorSpace)}},{key:"getNodes",value:function(t){for(var n=[],e=this.yt[0],i=0;i<t.length;i++){var r=t[i].level,o=t[i].eid,s=t[i].type;t:for(var a=0;a<e.yt.length;a++)if(e.yt[a].kt===r)for(var u=e.yt[a].yt,h=0;h<u.length;h++)for(var c=0;c<u[h].yt.length;c++)if(u[h].yt[c].On.Cn===o&&u[h].yt[c].Tn===s){n.push(u[h].yt[c]);break t}}return n}},{key:"getDataManager",value:function(){return this.Xa}},{key:"getMapOptions",value:function(){return this.Et}},{key:"getContainer",value:function(){return this.th}},{key:"setFitView",value:function(t){for(var n,e=this.eh({x:t.min.x,y:t.min.y},{x:t.max.x,y:t.max.y}),i=0,r=.1,o=0;o<this.in.length-1;o++)if(e<=this.in[o]&&e>this.in[o+1]){r=(this.in[i=o]-e)/(this.in[o]-this.in[o+1]);break}n=parseFloat((i+1+r).toFixed(2)),this.setCenter({animate:!0,x:t.center.x,y:t.center.y}),this.setZoom({animate:!0,zoom:n})}},{key:"setBackgroundColor",value:function(t,n){this.qt.renderer.setClearColor("string"===t?parseInt(t.slice(1),16):t,n)}},{key:"setLabelField",value:function(t){this.Ut.ru=t,this.Ut.wu(),this.qt.Ye()}},{key:"loadFloor",value:function(t,n,e){this.Ut.du(t,n,e)}},{key:"on",value:function(t,n){this.ih(t,!0),this.Mt.Bu(t,n)}},{key:"off",value:function(t,n){this.ih(t,!1),this.Mt.Vu(t,n)}},{key:"event",value:function(){}},{key:"event2",value:function(){}},{key:"event3",value:function(){}},{key:"event4",value:function(){}},{key:"event5",value:function(){}},{key:"event6",value:function(){}},{key:"event7",value:function(){}},{key:"event8",value:function(){}},{key:"event9",value:function(){}},{key:"event10",value:function(){}},{key:"event11",value:function(){}},{key:"pickFilterFunction",value:function(){return!0}},{key:"collisionCheck",value:function(){this.qt.Ye()}}])&&Bm(t.prototype,n),e&&Bm(t,e),r}();Object.assign(hh.prototype,{nh:function(t,n){this.rh(t,n)},Ku:function(t,n){return this.Kt=new Z(vi.FOV,t/n,vi.CAMERA_NEAR,vi.CAMERA_FAR),this.Xt=new q(-t/2,t/2,n/2,-n/2,vi.CAMERA_NEAR,vi.CAMERA_FAR),this.Bt===mi.MODE_3D?this.Kt:this.Xt},Yt:function(){return(new Et).copy(this.eu._t.object.position).sub(this.eu._t.target).length()*(100*Math.tan(vi.FOV/2*vi.DEG2RAD)*2/(this.qt.renderer.domElement.clientHeight/Im.getMapScaleInfo()))},Dt:function(t){return t/100*(this.qt.renderer.domElement.clientHeight/Im.getMapScaleInfo())/2/Math.tan(vi.FOV/2*vi.DEG2RAD)},Ht:function(t){var n=this.Xt.top,e=this.Xt.bottom;return t/(Math.abs(n-e)*Im.getMapScaleInfo()*100/this.qt.renderer.domElement.clientHeight)},Jt:function(){var t=this.Xt.top,n=this.Xt.bottom;return Math.abs(t-n)*Im.getMapScaleInfo()*100/this.qt.renderer.domElement.clientHeight/this.Xt.zoom},eh:function(t,n){var e=Math.abs(n.x-t.x),i=Math.abs(n.y-t.y),n=this.qt.renderer.domElement.clientHeight,t=this.qt.renderer.domElement.clientWidth;return e/i<=t/n?100*i/(n/+Im.getMapScaleInfo()):100*e/(t/+Im.getMapScaleInfo())},Ju:function(){var t=this.getZoom();Math.abs(t-this.Yu)>vi.EPS&&(this.Mt.xt({type:"zoom",zoom:t}),this.Yu=t,this.qt.ln(t))},Qu:function(){var t;!this.oh||(t=this.eu._t.target).distanceToSquared(this.Zu)>vi.EPS&&(this.Mt.xt({type:"move",center:this.getCenter()}),this.Zu=t.clone(),t=null)},ih:function(t,n){switch(t){case"zoom":this.ah=n;break;case"move":this.oh=n;break;case"hover":this._n=n}},rh:function(t){var n,e,s=this,a=!0;e=(n=this).Et,t={appName:this.Wu,key:this.gs,license:this.Xu,buildingID:t,isPreview:this.Et.ju,callback:function(t,n,e,i,r,o){a&&(a=s.eu.At(),s.Et.state.center&&s.setState(s.Et.state,!1)),s.qt.hn(),e&&o&&(s.qt.cn(),s.qt.ln(s.getZoom()),s.eu.tn([s.qt.Ye,s.Ju,s.Qu]),s.Mt.xt({type:"visibleLevelsLoaded"}),s.qt.we.set("update",function(){s.Mt.xt({type:"update"})})),r&&o&&s.Mt.xt({type:"loaded"})}},n.Xa=new cc,n.Ut=new km(n,e,t),n.Ut.Lu(),n.Gt.push(t.buildingID)}});var Xm=hh;function Ym(t){return(Ym="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zm(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function qm(t,n){return(qm=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Km(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Jm(e);return t=i?(t=Jm(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Ym(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Jm(t){return(Jm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}oh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&qm(t,n)}(r,Ll);var t,n,e,i=Km(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).It=void 0!==(t=t||{}).height?t.height:1,n.I=t.x,n.F=t.y,n.Ln=null,n.Sa=!1,n}return t=r,(n=[{key:"x",get:function(){return this.I}},{key:"y",get:function(){return this.F}},{key:"height",get:function(){return this.It},set:function(t){this.It=t,this.Na()}},{key:"level",get:function(){var t=this.Nr(Np);return t?t.level:null}},{key:"visible",get:function(){return this.Ke},set:function(t){this.Ke=t,this.Ln&&(this.Ln.visible=this.Ke)}},{key:"opacity",get:function(){return this.uh},set:function(t){this.uh=t,this.Ln&&(this.Ln.material.opacity=this.uh)}},{key:"addTo",value:function(t){t.getOrCreateLayer(this.Tn).add(this)}},{key:"remove",value:function(){this.gt&&this.gt.remove(this)}},{key:"dispose",value:function(){this.remove(),this.Ln&&(this.Ln.traverse(function(t){t instanceof To&&(t.geometry.dispose(),t.material=void 0,t.geometry=void 0)}),this.Ln.mapNode=void 0,this.Ln=void 0),this.Sa=!1}}])&&Zm(t.prototype,n),e&&Zm(t,e),r}();Object.assign(oh.prototype,{hh:function(){var t;void 0!==this.I&&void 0!==this.F||(t=this.Nr(Np),this.I=t.center.x,this.F=t.center.y)},Lo:function(){return!1},Na:function(){}});var Qm=oh;function $m(t){return($m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ng(t,n,e){return(ng="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=og(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function eg(t,n){return(eg=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function ig(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=og(e);return t=i?(t=og(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==$m(t)&&"function"!=typeof t?rg(n):t}}function rg(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function og(t){return(og=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}qu=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&eg(t,n)}(r,Qm);var t,n,e,i=ig(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Tn=Xi.IMAGE_MARKER,n.ch=t.url,n.Ge=void 0!==t.size?t.size:32,n.fh=void 0!==t.depth&&t.depth,n.uh=void 0!==t.opacity?t.opacity:1,n.ze=void 0===t.collision||t.collision,n.Nt=Im.getCenterByAnchor(t.anchor),n.bt=null,n.lh=null,n.dh=new Map,n.Be=n.Be.bind(rg(n)),n}return t=r,(n=[{key:"collision",get:function(){return this.ze},set:function(t){this.ze=t}},{key:"url",get:function(){return this.ch},set:function(t){this.ch=t,this.vh()}},{key:"opacity",get:function(){return this.uh},set:function(t){this.uh=t,this.vh()}},{key:"moveTo",value:function(t){var n=this,e=void 0!==t.animate&&t.animate,i=t.duration||.5;if(e){e=this.Nr(Xm);if(e)return this.bt?(this.bt.ut([this.I,this.F]),this.bt.ht([t.x,t.y])):this.bt=new Oi({src:[this.I,this.F],dest:[t.x,t.y]}),this.bt.ct(i).lt(function(t){n.I=t.destination[0],n.F=t.destination[1],n.Na()}).dt(function(){n.bt.stop(),t.finished&&t.finished()}),e.$t.tn(this.bt.ot()),this.bt}else this.I=t.x,this.F=t.y,this.Na()}},{key:"stop",value:function(){var t=this.Nr(Xm);t&&(this.bt&&(t.$t.Qt(this.bt),this.bt=null),this.lh&&(t.$t.Qt(this.lh),this.lh=null),this.ph&&(t.$t.Qt(this.ph),this.ph=null))}},{key:"jump",value:function(t){var n=this;if(this.Ln){var e=this.Nr(Xm);if(e){var i=void 0!==t.duration?t.duration:1,r=void 0!==t.times?t.times:1,o=void 0!==t.delay?t.delay:0,s=0;return this.lh?(this.lh.ut([this.It]),this.lh.ht([this.It+t.height])):(this.lh=new Oi({src:[this.It],dest:[this.It+t.height]}),e.$t.tn(this.lh)),this.lh.ct(i).ft(0).lt(function(t){n.It=t.destination[0],n.Ln.position.y=n.It}).dt(function(){var t;(s+=.5)<r&&(t=s%1==0?0:o,n.lh.mt().ft(t),n.lh.ot())}),this.lh.ot(),this.lh}}}},{key:"stopJump",value:function(){var t;!this.Ln||(t=this.Nr(Xm))&&(this.lh&&(t.$t.Qt(this.lh),this.lh=null),this.Ln.position.y=this.It)}},{key:"addTo",value:function(t){ng(og(r.prototype),"addTo",this).call(this,t);t=this.Nr(Xm);t&&(t.on("viewModeChanged",this.Be),t.on("zoom",this.Be),t.on("resize",this.Be))}},{key:"remove",value:function(){this.stop();var t=this.Nr(Xm);t&&(t.off("viewModeChanged",this.Be),t.off("zoom",this.Be),t.off("resize",this.Be),ng(og(r.prototype),"remove",this).call(this))}}])&&tg(t.prototype,n),e&&tg(t,e),r}();Object.assign(qu.prototype,{Lo:function(){var n=this;if(!this.ch)return!1;var t=this.Nr(Xm);if(!t)return!1;t=t.Ut;this.mh=1;t.va(this.Ge);t=t.ks.so({url:this.ch,needDepth:this.fh,opacity:this.uh},function(t){t.userData.scaleRatio&&n.Ln&&(n.mh=t.userData.scaleRatio,n.Be())});return t.userData.scaleRatio&&(this.mh=t.userData.scaleRatio),this.Ln=new Ld(t),this.Ln.center.set(this.Nt.x,this.Nt.y),this.Ln.visible=this.Ke,this.Be(),this.Na(),(this.Ln.mapNode=this).Sa=!0},Na:function(){var t=this.Nr(Xm);if(!t)return!1;this.Ln.position.set(this.I-t.getX(),this.It,-this.F+t.getY())},Be:function(){var t=this.Nr(Xm);t&&(t=t.Ut.va(this.Ge),this.Ln.scale.set(t,t/this.mh,t))},vh:function(){var t=this.Nr(Xm);t&&(this.Ln.material=t.Ut.ks.so({url:this.ch,needDepth:this.fh,opacity:this.uh}))}});ih=qu;function sg(t){return(sg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ag(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ug(t,n,e){return(ug="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=lg(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function hg(t,n){return(hg=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function cg(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=lg(e);return t=i?(t=lg(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==sg(t)&&"function"!=typeof t?fg(n):t}}function fg(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function lg(t){return(lg=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Zu=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&hg(t,n)}(r,Qm);var t,n,e,i=cg(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Tn=Xi.TEXT_MARKER,n.ha=void 0!==t.text?t.text:"",n.gh=void 0!==t.fontsize?t.fontsize:20,n.yh=t.fontFamily,n.bh=void 0!==t.fillColor?t.fillColor:"0,0,0",n._h=void 0!==t.strokeColor?t.strokeColor:"255,225,255",n.wh=t.plateColor,n.xh=t.plateStrokeColor,n.fh=void 0!==t.depth&&t.depth,n.ze=void 0===t.collision||t.collision,n.uh=void 0!==t.opacity?t.opacity:1,n.Mh=void 0!==t.textAlign?t.textAlign:xc.Center,n.Nt=Im.getCenterByAnchor(t.anchor),n.Ge=0,n.bt=null,n.ze=!0,n.Be=n.Be.bind(fg(n)),n}return t=r,(n=[{key:"collision",get:function(){return this.ze},set:function(t){this.ze=t}},{key:"text",get:function(){return this.ha},set:function(t){this.ha=t}},{key:"fillColor",get:function(){return this.bh},set:function(t){this.bh=t}},{key:"strokeColor",get:function(){return this._h},set:function(t){this._h=t}},{key:"fontsize",get:function(){return this.gh}},{key:"plateColor",get:function(){return this.wh},set:function(t){this.wh=t}},{key:"plateStrokeColor",get:function(){return this.xh},set:function(t){this.xh=t}},{key:"moveTo",value:function(t){var n=this,e=void 0!==t.animate&&t.animate,i=void 0!==t.duration?t.duration:.5;if(e){e=this.Nr(Xm);if(!e)return!1;this.bt?(this.bt.ut([this.I,this.F]),this.bt.ht([t.x,t.y])):this.bt=new Oi({src:[this.I,this.F],dest:[t.x,t.y]}),this.bt.ct(i).lt(function(t){n.I=t.destination[0],n.F=t.destination[1],n.Na()}).dt(function(){t.finish&&t.finish()}),e.$t.tn(this.bt.ot())}else this.I=t.x,this.F=t.y,this.Na();return this.bt}},{key:"stop",value:function(){var t;!this.bt||(t=this.Nr(Xm))&&(t.$t.Qt(this.bt),this.bt=null,this.Eh=!1)}},{key:"update",value:function(){var t=this.Nr(Xm);if(!t)return!1;var n=t.Ut,t=n.ks.io(this.ha,{fontsize:this.gh,fillColor:Si.toRgba(this.bh),strokeColor:Si.toRgba(this._h),plateColor:Si.toRgba(this.wh),plateStrokeColor:Si.toRgba(this.xh)},{needSize:!0,opacity:this.uh,textAlign:this.Mh});this.Ge=t.size,this.Ln.material.dispose(),this.Ln.material=void 0,this.Ln.material=t;n=n.va(this.Ge);this.Ln.scale.set(n,n,n),this.Ln.scale.multiplyScalar(t.userData.mspriteScale),this.Ln.scale.setX(this.Ln.scale.x/t.userData.scaleRatio)}},{key:"addTo",value:function(t){ug(lg(r.prototype),"addTo",this).call(this,t);t=this.Nr(Xm);t&&(t.on("viewModeChanged",this.Be),t.on("zoom",this.Be),t.on("resize",this.Be))}},{key:"remove",value:function(){this.stop();var t=this.Nr(Xm);t&&(t.off("viewModeChanged",this.Be),t.off("zoom",this.Be),t.off("resize",this.Be),ug(lg(r.prototype),"remove",this).call(this))}}])&&ag(t.prototype,n),e&&ag(t,e),r}();Object.assign(Zu.prototype,{Lo:function(){var t=this.Nr(Xm);if(!t)return console.warn("marker没有添加到中!"),!1;var n=t.Ut,t=n.ks.io(this.ha,{fontsize:this.gh,fillColor:Si.toRgba(this.bh),strokeColor:Si.toRgba(this._h),plateColor:Si.toRgba(this.wh),plateStrokeColor:Si.toRgba(this.xh)},{family:this.yh,needSize:!0,opacity:this.uh,textAlign:this.Mh});this.Ge=t.size,this.Ln=new Ld(t),this.Ln.center.set(this.Nt.x,this.Nt.y);n=n.va(this.Ge);return this.Ln.scale.set(n,n,n),this.Ln.scale.multiplyScalar(t.userData.mspriteScale),this.Ln.scale.setX(this.Ln.scale.x/t.userData.scaleRatio),this.Na(),(this.Ln.mapNode=this).Sa=!0,this.Ln.userData.textLength=this.ha.length,!0},Na:function(){var t=this.Nr(Xm);if(!t)return!1;this.Ln.position.set(this.I-t.getX(),this.It,-this.F+t.getY())},Be:function(){var t=this.Nr(Xm);if(!t)return console.warn("marker没有添加到中!"),!1;t=t.Ut.va(this.Ge);this.Ln.scale.set(t,t,t),this.Ln.scale.multiplyScalar(this.Ln.material.userData.mspriteScale),this.Ln.scale.setX(this.Ln.scale.x/this.Ln.material.userData.scaleRatio)}});pi=Zu;function dg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var vg=function(){function i(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i)}var t,n,e;return t=i,e=[{key:"createShape",value:function(t,n){var e=new am;e.moveTo(t[0].x-n.x,t[0].y-n.y);for(var i=1;i<t.length;i++)e.lineTo(t[i].x-n.x,t[i].y-n.y);return e}},{key:"createShapeBufferGeometryByCenter",value:function(t,n){return new Om(this.createShape(t,n))}},{key:"createExtrudeBufferGeometry",value:function(t,n){return new Am(t,{steps:1,depth:n.depth,bevelEnabled:!1,bevelThickness:0,bevelSize:0,bevelOffset:0,bevelSegments:1})}},{key:"closedPoints",value:function(t){var n=t.length;return!(n<3)&&(t[0].x===t[n-1].x&&t[0].y===t[n-1].y||(t[n]={x:t[n-1].x,y:t[n-1].y}),!0)}},{key:"createReactShape",value:function(t,n){var e=new am,n=n/2,t=t/2;return e.moveTo(-t,-n),e.lineTo(-t,n),e.lineTo(t,n),e.lineTo(t,-n),e}},{key:"createCircleShape",value:function(t,n){var e=new am;return e.absarc(0,0,t,0,2*Math.PI,!1),e}},{key:"createReactExtrudeBufferGeometry",value:function(t,n,e){n=i.createReactShape(t,n);return this.createExtrudeBufferGeometry(n,e)}},{key:"createCircleExtrudeBufferGeometry",value:function(t,n,e){n=i.createCircleShape(t,n);return this.createExtrudeBufferGeometry(n,e)}},{key:"createCenterBufferGeometry",value:function(t,n){for(var e=[],i=0;i<t.length-1;i++)for(var r=2;r<10;r+=2)e.push({x:t[i].x+(t[i+1].x-t[i].x)*r*.1,y:t[i].y+(t[i+1].y-t[i].y)*r*.1,z:t[i].z+(t[i+1].z-t[i].z)*r*.1});e.push({x:e[0].x,y:e[0].y,z:e[0].z});for(var o=new kr,s=[],a=[],u=0;u<e.length-1;u++)s.push(e[u].x),s.push(e[u].y),s.push(e[u].z),s.push(e[u+1].x),s.push(e[u+1].y),s.push(e[u+1].z),s.push(n.x),s.push(n.y),s.push(n.z),a.push(0,0,1);var h=new Float32Array(s);return o.setAttribute("position",new wr(h,3)),o.setAttribute("gradientAlpha",new wr(a,1)),o}},{key:"scalePoints",value:function(t,n,e){for(var i=[],r=0;r<t.length;r++){var o=t[r].x,s=t[r].y,a=t[r].z;i.push({x:o+(o-n.x)*(e-1),y:s+(s-n.y)*(e-1),z:a})}return i}},{key:"scaleValuePoints",value:function(t,n,e){for(var i=[],r=0;r<t.length;r++){var o={x:t[r].x,y:t[r].y,z:t[r].z};o.x-n.x<0?o.x-=e:o.x+=e,o.y-n.y<0?o.y-=e:o.y+=e,i.push(o)}return i}}],(n=null)&&dg(t.prototype,n),e&&dg(t,e),i}();function pg(){kr.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function mg(t,n,e){vu.call(this,t,n),this.meshPerAttribute=e||1}function gg(t){kr.call(this),this.type="WireframeGeometry";var n,e,i,r,o,s,a=[],u=[0,0],h={},c=["a","b","c"];if(t&&t.isGeometry){for(var f=t.faces,l=0,d=f.length;l<d;l++)for(var v=f[l],p=0;p<3;p++)r=v[c[p]],o=v[c[(p+1)%3]],u[0]=Math.min(r,o),u[1]=Math.max(r,o),void 0===h[s=u[0]+","+u[1]]&&(h[s]={index1:u[0],index2:u[1]});for(s in h)i=h[s],_=t.vertices[i.index1],a.push(_.x,_.y,_.z),_=t.vertices[i.index2],a.push(_.x,_.y,_.z)}else if(t&&t.isBufferGeometry){var m,g,y,b,_=new Et;if(null!==t.index){for(m=t.attributes.position,g=t.index,e=(y=(n=0)===(y=t.groups).length?[{start:0,count:g.count,materialIndex:0}]:y).length;n<e;++n)for(d=(l=(b=y[n]).start)+b.count;l<d;l+=3)for(p=0;p<3;p++)r=g.getX(l+p),o=g.getX(l+(p+1)%3),u[0]=Math.min(r,o),u[1]=Math.max(r,o),void 0===h[s=u[0]+","+u[1]]&&(h[s]={index1:u[0],index2:u[1]});for(s in h)i=h[s],_.fromBufferAttribute(m,i.index1),a.push(_.x,_.y,_.z),_.fromBufferAttribute(m,i.index2),a.push(_.x,_.y,_.z)}else for(l=0,d=(m=t.attributes.position).count/3;l<d;l++)for(p=0;p<3;p++)_.fromBufferAttribute(m,3*l+p),a.push(_.x,_.y,_.z),_.fromBufferAttribute(m,3*l+(p+1)%3),a.push(_.x,_.y,_.z)}this.setAttribute("position",new wr(a,3))}function yg(t){return(yg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _g(t,n){return(_g=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function wg(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=xg(e);return t=i?(t=xg(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==yg(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function xg(t){return(xg=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}pg.prototype=Object.assign(Object.create(kr.prototype),{constructor:pg,isInstancedBufferGeometry:!0,copy:function(t){return kr.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),mg.prototype=Object.assign(Object.create(vu.prototype),{constructor:mg,isInstancedInterleavedBuffer:!0,copy:function(t){return vu.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),(gg.prototype=Object.create(kr.prototype)).constructor=gg;var Mg=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&_g(t,n)}(r,pg);var t,n,e,i=wg(r);function r(){var t;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).type="LineSegmentsGeometry";return t.isLineSegmentsGeometry=!0,t.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),t.setAttribute("position",new wr([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),t.setAttribute("uv",new wr([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),t.setAttribute("uv2",new wr([0,0,1,0,0,1/3,1,1/3,0,2/3,1,2/3,0,1,1,1],2)),t}return t=r,(n=[{key:"applyMatrix",value:function(t){var n=this.attributes.instanceStart,e=this.attributes.instanceEnd;return void 0!==n&&(t.applyToBufferAttribute(n),t.applyToBufferAttribute(e),n.data.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"setPositions",value:function(t){t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));var n=new mg(n,6,1);return this.setAttribute("instanceStart",new mu(n,3,0)),this.setAttribute("instanceEnd",new mu(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}},{key:"setColors",value:function(t){t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));var n=new mg(n,6,1);return this.addAttribute("instanceColorStart",new mu(n,3,0)),this.addAttribute("instanceColorEnd",new mu(n,3,3)),this}},{key:"setUvys",value:function(t){t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));var n=new mg(n,2,1);return this.setAttribute("uvyStart",new mu(n,1,0)),this.setAttribute("uvyEnd",new mu(n,1,1)),this}},{key:"fromWireframeGeometry",value:function(t){return this.setPositions(t.attributes.position.array),this}},{key:"fromEdgesGeometry",value:function(t){return this.setPositions(t.attributes.position.array),this}},{key:"fromMesh",value:function(t){return this.fromWireframeGeometry(new gg(t.geometry)),this}},{key:"fromLineSegements",value:function(t){t=t.geometry;return t.isGeometry?this.setPositions(t.vertices):t.isBufferGeometry&&this.setPositions(t.position.array),this}},{key:"computeBoundingBox",value:function(){var t=new $;null===this.boundingBox&&(this.boundingBox=new $);var n=this.attributes.instanceStart,e=this.attributes.instanceEnd;void 0!==n&&void 0!==e&&(this.boundingBox.setFromBufferAttribute(n),t.setFromBufferAttribute(e),this.boundingBox.union(t))}},{key:"computeBoundingSphere",value:function(){var t=new Et;null===this.boundingSphere&&(this.boundingSphere=new it),null===this.boundingBox&&this.computeBoundingBox();var n=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==n&&void 0!==e){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var r=0,o=0,s=n.count;o<s;o++)t.fromBufferAttribute(n,o),r=Math.max(r,i.distanceToSquared(t)),t.fromBufferAttribute(e,o),r=Math.max(r,i.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("fm.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}},{key:"toJSON",value:function(){}},{key:"clone",value:function(){}},{key:"copy",value:function(t){return this}}])&&bg(t.prototype,n),e&&bg(t,e),r}();function Eg(t){return(Eg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Tg(t,n){return(Tg=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Lg(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Og(e);return t=i?(t=Og(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Eg(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Og(t){return(Og=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Rg=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Tg(t,n)}(r,Mg);var t,n,e,i=Lg(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).type="LineGeometry",t.isLineGeometry=!0,t}return t=r,(n=[{key:"setPositions",value:function(t){for(var n=t.length-3,e=new Float32Array(2*n),i=0;i<n;i+=3)e[2*i]=t[i],e[2*i+1]=t[i+1],e[2*i+2]=t[i+2],e[2*i+3]=t[i+3],e[2*i+4]=t[i+4],e[2*i+5]=t[i+5];return this.test="ddd",(new Mg).setPositions.call(this,e),this}},{key:"setColors",value:function(t){for(var n=t.length-3,e=new Float32Array(2*n),i=0;i<n;i+=3)e[2*i]=t[i],e[2*i+1]=t[i+1],e[2*i+2]=t[i+2],e[2*i+3]=t[i+3],e[2*i+4]=t[i+4],e[2*i+5]=t[i+5];return(new Mg).setColors.call(this,e),this}},{key:"fromLine",value:function(t){t=t.geometry;return t.isGeometry?this.setPositions(t.vertices):t.isBufferGeometry&&this.setPositions(t.position.array),this}},{key:"copy",value:function(t){return this}}])&&Sg(t.prototype,n),e&&Sg(t,e),r}();function Ag(t){return(Ag="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function kg(t,n){return(kg=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Pg(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Dg(e);return t=i?(t=Dg(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Ag(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Dg(t){return(Dg=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var jg=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&kg(t,n)}(r,To);var t,n,e,i=Pg(r);function r(t,n){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t,n)).type="LineSegments2",n.isLineSegments2=!0,n}return t=r,(n=[{key:"computeLineDistances",value:function(){for(var t=new Et,n=new Et,e=this.geometry,i=e.attributes.instanceStart,r=e.attributes.instanceEnd,o=new Float32Array(2*i.data.count),s=0,a=0,u=i.data.count;s<u;s++,a+=2)t.fromBufferAttribute(i,s),n.fromBufferAttribute(r,s),o[a]=0===a?0:o[a-1],o[a+1]=o[a]+t.distanceTo(n);var h=new mg(o,2,1);return e.setAttribute("instanceDistanceStart",new mu(h,1,0)),e.setAttribute("instanceDistanceEnd",new mu(h,1,1)),this}},{key:"copy",value:function(t){return this}}])&&Cg(t.prototype,n),e&&Cg(t,e),r}();function Ng(t){return(Ng="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ig(t,n){return(Ig=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Fg(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Ug(e);return t=i?(t=Ug(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Ng(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Ug(t){return(Ug=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Gg=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Ig(t,n)}(i,jg);var e=Fg(i);function i(t,n){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i),(n=e.call(this,t,n)).type="Line2",n.isLine2=!0,n}return i}();function Bg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Hg=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,(e=[{key:"calculatePoint",value:function(t,n,e){return(new Et).copy(e).add((new Et).copy(t).sub(e).normalize().multiplyScalar(n))}},{key:"computerArcLineByPoints",value:function(t,n,e,i,r){var o=[],t=this.calculatePoint(t,i,n),i=this.calculatePoint(e,i,n),s=new im(t,n,i);o.push(t);for(var a=0;a<r-1;a++){var u=s.getPoint((a+1)/r);o.push(u)}return o.push(i),o}}])&&Bg(n.prototype,e),i&&Bg(n,i),t}();function Vg(t){return function(t){if(Array.isArray(t))return zg(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return zg(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?zg(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zg(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Wg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}ka=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Sh=null,this.kt=0,this.Th=!0,this.Lh=1,this.Oh=[],this.Rh=!1,this.Ah=null,this.Ch=null,this.kh=[],this.Ph=[],this.Dh=[],this.jh=null,this.Nh=null}var n,e,i;return n=t,(e=[{key:"points",get:function(){return this.Sh},set:function(t){this.Sh=t}},{key:"level",get:function(){return this.kt},set:function(t){this.kt=t}},{key:"length",get:function(){return this.Ih(this.kh.length)}},{key:"linePoints",get:function(){return this.Ah}},{key:"uvys",get:function(){return this.Ch}},{key:"resize",value:function(){this.kh=[],this.Rh=!1}}])&&Wg(n.prototype,e),i&&Wg(n,i),t}();Object.assign(ka.prototype,{Fh:function(t,n){"number"!=typeof n&&(n=this.Lh),this.Ah=this.Uh(t,n),this.Ch=this.Gh()},Uh:function(t,n){this.Th?this.Rh||this.Bh(n):((n=[]).push.apply(n,Vg(this.Sh)),this.Oh=n);for(var e=[],i=0;i<this.Oh.length;i++){var r=this.Oh[i].x-t.x,o=this.Oh[i].z,s=-this.Oh[i].y+t.y;e.push(r,o,s),0!==i&&(o=new Et(this.Oh[i].x,this.Oh[i].y,this.Oh[i].z),s=new Et(this.Oh[i-1].x,this.Oh[i-1].y,this.Oh[i-1].z),this.kh.push(o.distanceTo(s)))}return e},Bh:function(t){for(var n,e,i=[],r=new Hg,o=0;o<this.Sh.length;o++)0===o&&this.Nh?(n=this.Hh(t,this.Nh,this.Sh[o],this.Sh[o+1]),this.isCross?i.push.apply(i,Vg(r.computerArcLineByPoints(this.Nh,this.Sh[o],this.Sh[o+1],n,12))):i.push(r.calculatePoint(this.Sh[o+1],n,this.Sh[o]))):o===this.Sh.length-1&&this.jh?(e=this.Hh(t,i[i.length-1],this.Sh[o],this.jh),this.isCross?i.push.apply(i,Vg(r.computerArcLineByPoints(i[i.length-1],this.Sh[o],this.jh,e,12))):i.push(r.calculatePoint(i[i.length-1],e,this.Sh[o]))):0<o&&o<this.Sh.length-1?(e=this.Hh(t,i[i.length-1],this.Sh[o],this.Sh[o+1]),i.push.apply(i,Vg(r.computerArcLineByPoints(i[i.length-1],this.Sh[o],this.Sh[o+1],e,12)))):i.push(this.Sh[o]);this.Oh=i,this.Rh=!0},Hh:function(t,n,e,i){return Math.min(.5*su.distanceOfTwoPoints(n,e),.5*su.distanceOfTwoPoints(e,i),t)},Gh:function(){for(var t,n=[],e=this.Ih(this.kh.length),i=0;i<this.Oh.length;i++)0===i?n.push(0):i===this.Oh.length-1?n.push(1):(t=this.Ih(i)/e,n.push(t),n.push(t));return n},Ih:function(t){for(var n=0,e=0;e<this.kh.length;e++)e<t&&(n+=this.kh[e]);return n}});var Xg=ka,Yg={FULL:0,DOTTED:2,DOT_DASH:4,CENTER:8,DASH:16,DOUBLE_DOT_DASH:32,TRI_DOT_DASH:64,FMARROW:128,ARROW:256};function Zg(t){return(Zg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qg(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Kg(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Kg(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Kg(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Jg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Qg(t,n,e){return(Qg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=ey(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function $g(t,n){return($g=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function ty(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=ey(e);return t=i?(t=ey(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Zg(t)&&"function"!=typeof t?ny(n):t}}function ny(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ey(t){return(ey=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ki=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&$g(t,n)}(r,Qm);var t,n,e,i=ty(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),n=i.call(this,t),t=t||{},n.Tn=Xi.LINE_MARKER,n.ch=t.url,n.Vh=void 0!==t.width?t.width:6,n.zh=void 0!==t.color?t.color:"#33cc61",n.Th=void 0===t.smooth||t.smooth,n.Wh=void 0!==t.radius?t.radius:1,n.Re=void 0===t.animate||t.animate,n.uh=void 0!==t.opacity?t.opacity:1,n.Xh=void 0!==t.type?t.type:Yg.FMARROW,n.Yh=void 0!==t.borderColor?t.borderColor:"#4a82d2",n.Zh=void 0!==t.segments?t.segments:[],n.qh=[],n.Kh=60,n.Jh=10,n.Qh="#aeaeae",n.$h=n.$h.bind(ny(n)),n.tc=n.tc.bind(ny(n)),n.nc=n.nc.bind(ny(n)),n.ec=n.ec.bind(ny(n)),n.Na=n.Na.bind(ny(n)),n}return t=r,(n=[{key:"level",get:function(){return null}},{key:"width",get:function(){return this.Vh},set:function(t){0!==t&&t!==this.Vh&&(this.Vh=t,this.vh())}},{key:"color",get:function(){return this.zh},set:function(t){this.zh!==t&&(this.zh=t,this.vh())}},{key:"opacity",get:function(){return this.uh},set:function(t){this.uh!==t&&(this.uh=t,this.vh())}},{key:"passedColor",get:function(){return this.Qh},set:function(t){this.Qh!==t&&(this.Qh=t,this.vh())}},{key:"update",value:function(){var t;this.Ln&&this.Ln.material&&((t=this.Nr(Xm))&&(this.Ln.material=t.Ut.ks.eo({color:this.zh,lineWidth:this.Vh,opacity:this.uh,needDepth:!1})))}},{key:"moveProportion",value:function(t){for(var n=0,e=this.qh.length-1;-1<e;e--)this.qh[e].isCross||(n+=this.qh[e].seg.length);for(var i=0,r=this.qh.length-1;-1<r;r--){var o=i/n;this.qh[r].isCross||(i+=this.qh[r].seg.length);var s=i/n;s<t?this.qh[r].line.material.uniforms.miny.value=1:t<=s&&(this.qh[r].line.material.uniforms.miny.value=(t-o)/(s-o))}}},{key:"addTo",value:function(t){t.Ae.add(this),this.ic(t.getVisibleLevels()),t.on("visibleLevelsChanged",this.ec),t.on("zoom",this.tc),t.on("resize",this.nc),t.on("floorSpaceChanged",this.Na),this.Re&&t.$t.Gu(this.$h)}},{key:"remove",value:function(){var t=this.Nr(Xm);if(t){t.off("visibleLevelsChanged",this.ec),t.off("zoom",this.tc),t.off("resize",this.ke),t.off("floorSpaceChanged",this.Na);for(var n=0;n<this.qh.length;n++)t.getFloor(this.qh[n].gid).getOrCreateLayer(this.Tn).Ce.remove(this.qh[n].line);this.qh=[],this.Re&&t.$t.ja(this.$h),t.Ae.remove(this)}}},{key:"dispose",value:function(){Qg(ey(r.prototype),"dispose",this).call(this);for(var t=0;t<this.Zh.length;t++)this.Zh[t].resize()}}])&&Jg(t.prototype,n),e&&Jg(t,e),r}();Object.assign(ki.prototype,{rc:function(t,n){var e=new Rg;e.setPositions(t);n=n.Ut.ks.eo({color:this.zh,lineWidth:this.Vh,opacity:this.opacity,needDepth:!1});this.Ln=new Gg(e,n),this.Ln.computeLineDistances()},Lo:function(){var t=this.Nr(Xm);if(t){for(var n=this.oc(),e=this.Zh.length-1;-1<e;e--){var i=t.getFloor(this.Zh[e].level),r=void 0,o=void 0;0<e&&this.Zh[e].kt!==this.Zh[e-1].kt&&(r=t.getFloor(this.Zh[e-1].kt),o=this.Zh[e-1].points,this.Zh[e].Nh=Object.assign({},o[o.length-1]),this.Zh[e].Nh.z+=r.It-i.It),e<this.Zh.length-1&&this.Zh[e].kt!==this.Zh[e+1].kt&&(s=t.getFloor(this.Zh[e+1].kt),this.Zh[e].jh=Object.assign({},this.Zh[e+1].points[0]),this.Zh[e].jh.z+=s.It-i.It);var s,a=this.sc(this.Zh[e],n);this.qh.push({line:a,gid:this.Zh[e].level,seg:this.Zh[e],isCross:!1}),i.getOrCreateLayer(this.Tn).Ce.add(a),0<e&&this.Zh[e].kt!==this.Zh[e-1].kt&&((s=new Xg).kt=this.Zh[e].kt,s.isCross=!0,a=this.Zh[e].points,this.ac(s,o,a,r,i),i=this.sc(s,n),this.qh.push({line:i,seg:s,gid:this.Zh[e-1].level,gidAn:s.level,isCross:!0}),r.getOrCreateLayer(this.Tn).Ce.add(i))}return this.Sa=!0,this.Sa}console.warn("marker没有添加到地图中!")},ac:function(t,n,e,i,r){var o=Object.assign({},n[n.length-1]),s=Object.assign({},e[0]);o.z+=i.It-r.It,t.points=[o,s],t.Nh=Object.assign({},n[n.length-2]),t.Nh.z+=i.It-r.It,t.jh=Object.assign({},e[1])},sc:function(t,n){var e=this.Nr(Xm);if(e){var i=new ii(e.getX(),e.getY());t.Th=this.Th,t.Fh(i,this.Wh);for(var r=e.getFloor(t.kt),o=[],s=0;s<t.linePoints.length;s++)o.push(t.linePoints[s]);var a=t.Ch,i=new Rg;i.setPositions(o),i.setUvys(a);a=new fc({color:this.zh,lineWidth:this.Vh,vertexColors:2,dashed:!1,transparent:!0,pcolor:this.Qh,opacity:this.uh});a.transparent=!0,a.resolution=new ii(e.qt.renderer.domElement.clientWidth,e.qt.renderer.domElement.clientHeight),n.useMap&&(a.defines.USE_MMAP=!0,a.uniforms.mmap.value=n.texture,this.uc(a,t,this.Kh),a.needsUpdate=!0);a=new Gg(i,a);return a.computeLineDistances(),a.position.set(0,r.It,0),a}},$h:function(t){for(var n=0;n<this.qh.length;n++)this.qh[n].line.material.uniforms.offset.value.y-=.001*t},tc:function(){for(var t=0;t<this.qh.length;t++)this.uc(this.qh[t].line.material,this.qh[t].seg,this.Kh)},uc:function(t,n,e){var i=this.Nr(Xm);i&&(n=n.length*i.Ut.Mu(n.kt),t.uniforms.repeat.value.y=Math.floor(n*window.devicePixelRatio/e))},nc:function(){var t=this.Nr(Xm);if(t)for(var n=0;n<this.qh.length;n++)this.qh[n].line.material.resolution=new ii(t.qt.renderer.domElement.clientWidth,t.qt.renderer.domElement.clientHeight)},ic:function(t){var n,e=qg(this.qh);try{for(e.s();!(n=e.n()).done;){var i=n.value;i.isCross?t.indexOf(i.gid)<0||t.indexOf(i.gidAn)<0?i.line.visible=!1:i.line.visible=!0:-1<t.indexOf(i.gid)?i.line.visible=!0:i.line.visible=!1}}catch(t){e.e(t)}finally{e.f()}},ec:function(){var t=this.Nr(Xm);t&&this.ic(t.getVisibleLevels())},hc:function(){this.Kh=this.Vh*this.Jh;var t={type:"normal",width:128,height:128,color:this.zh,arrowHeightPercent:.6,arrowWidthPercent:1,arrowPercent:.1,lineType:null,dashArray:[2,1],textureCommand:"createNormalLineTexture",godHeightPercent:1,godEdgePercent:.2,godArrowPercent:.15,arrowWidth:20,godColor:this.zh,godEdgeColor:this.Yh,godArrowColor:"#F4FEFB",godArrowXScale:4,godArrowWidthPercent:.9,useMap:!0};switch(this.Xh){case Yg.FULL:t.useMap=!1;break;case Yg.DOTTED:t.dashArray=[1,1];break;case Yg.DOT_DASH:t.dashArray=[2.5,1,.5,1];break;case Yg.CENTER:t.dashArray=[3,1,1.5,1];break;case Yg.DASH:t.dashArray=[2,1];break;case Yg.DOUBLE_DOT_DASH:t.dashArray=[2.5,.5,.5,.5,.5,.5];break;case Yg.TRI_DOT_DASH:t.dashArray=[2.5,.5,.5,.5,.5,.5,.5,.5];break;case Yg.FMARROW:case Yg.ARROW:t.width=5*this.Vh,t.height=5*this.Kh,t.arrowWidth=t.height/12,t.dashArray=[7,0],t.textureCommand="createArrowWidthBackTexture";break;default:t.useMap=!1}return t},oc:function(){var t=this.Nr(Xm);if(t){var n=this.hc(),e=null;return this.ch?{useMap:!0,texture:t.Ut.ks.fo(this.ch,function(t){t.needsUpdate=!0})}:(n.useMap&&((e=t.Ut.ks[n.textureCommand](n)).minFilter=xn,e.wrapS=mn,e.wrapT=mn,e.generateMipmaps=!1,e.anisotropy=4),{useMap:n.useMap,texture:e})}},vh:function(){if(0<this.qh.length)for(var t=this.oc(),n=0;n<this.qh.length;n++)this.qh[n].line.material.lineWidth=this.Vh,this.qh[n].line.material.color=new _i(this.zh),this.qh[n].line.material.pcolor=new _i(this.Qh),this.qh[n].line.material.opacity=this.uh,t.useMap&&(this.qh[n].line.material.uniforms.mmap.value=t.texture)},Na:function(){var t=this.Nr(Xm);if(t&&0<this.qh.length)for(var n=0;n<this.qh.length;n++){var e,i,r=this.qh[n];r.isCross?(e=t.getFloor(r.gid),i=t.getFloor(r.gidAn),r.seg.resize(),this.ac(r.seg,this.qh[n+1].seg.points,this.qh[n-1].seg.points,e,i),i=this.oc(),i=this.sc(r.seg,i),(e=e.getOrCreateLayer(this.Tn)).Ce.add(i),e.Ce.remove(r.line),r.line.geometry.dispose(),r.line.material.dispose(),r.line=i):(i=t.getFloor(r.seg.kt),r.line.position.y=i.It)}}});var iy=ki;function ry(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var oy=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"distance",value:function(t,n){return su.distance(t,n)}},{key:"isContain",value:function(t,n){return su.isPolygonContainPoint(t,n)}},{key:"bound",value:function(t){for(var n=t[0].x,e=t[0].y,i=t[0].x,r=t[0].y,o=1;o<t.length;o++)t[o].x>n&&(n=t[o].x),t[o].y>e&&(e=t[o].y),t[o].x<i&&(e=t[o].x),t[o].y<r&&(e=t[o].y);return{max:{x:n,y:e},min:{x:i,y:r},size:{x:n-i,y:e-r},center:{x:n-i/2,y:e-r/2}}}},{key:"rectangleBuilder",value:function(t,n,e){var i=[];return i.push({x:e.x-t/2,y:e.y+n/2}),i.push({x:e.x+t/2,y:e.y+n/2}),i.push({x:e.x+t/2,y:e.y-n/2}),i.push({x:e.x-t/2,y:e.y-n/2}),i}},{key:"circleBuilder",value:function(t,n,e){for(var i=[],r=0;r<=e;r++){var o=r/e*Math.PI*2;i.push({x:n.x+t*Math.cos(o),y:n.y+t*Math.sin(o)})}return i}},{key:"area",value:function(t){return su.ue(t,t.length)}},{key:"latlngToMapCoordinate",value:function(t){return{x:20037508.34*parseFloat(t.x)/180,y:Math.log(Math.tan((90+parseFloat(t.y))*Math.PI/360))/(Math.PI/180)*20037508.34/180}}},{key:"mapCoordinateToLatlng",value:function(t){var n=parseFloat(t.y)/20037508.34*180;return{x:parseFloat(t.x)/20037508.34*180,y:180/Math.PI*(2*Math.atan(Math.exp(n*Math.PI/180))-Math.PI/2)}}}],(e=null)&&ry(n.prototype,e),i&&ry(n,i),t}();function sy(t){return(sy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ay(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function uy(t,n){return(uy=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function hy(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=cy(e);return t=i?(t=cy(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==sy(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function cy(t){return(cy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ah=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&uy(t,n)}(r,Qm);var t,n,e,i=hy(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Tn=Xi.POLYGON_MARKER,n.zh=void 0!==t.color?t.color:"#FF0000",n.uh=void 0!==t.opacity?t.opacity:1,n.cc=t.borderColor||t.borderColor||"#00ff00",n.Vh="number"==typeof t.borderWidth?t.borderWidth:2,n.It=void 0!==t.height?t.height:0,n.Sh=void 0!==t.points?t.points:[],n}return t=r,(n=[{key:"x",get:function(){return this.I}},{key:"y",get:function(){return this.F}},{key:"points",get:function(){return this.Sh}},{key:"color",get:function(){return this.zh},set:function(t){this.zh=t,this.vh()}},{key:"borderColor",get:function(){return this.cc},set:function(t){this.cc=t,this.Zs.color=t,this.Zs.update()}},{key:"borderWidth",get:function(){return this.Vh},set:function(t){this.Vh=t,this.Zs.width=t,this.Zs.update()}},{key:"opacity",get:function(){return this.uh},set:function(t){this.uh=t,this.vh()}},{key:"getBound",value:function(){return oy.bound(this.Sh)}}])&&ay(t.prototype,n),e&&ay(t,e),r}();Object.assign(ah.prototype,{Lo:function(){if(!this.Sh)return!1;var t=this.Nr(Xm);if(!t)return!1;for(var n=t.Ut.ks.Kr({color:this.zh,opacity:this.uh}),e=new ii(t.getX(),t.getY()),i=vg.createShapeBufferGeometryByCenter(this.Sh,e),r=i.attributes.position.array.length,o=new Float32Array(r+3),s=0;s<r;s++)o[s]=i.attributes.position.array[s];o[r]=i.attributes.position.array[0],o[r+1]=i.attributes.position.array[1],o[r+2]=i.attributes.position.array[2],this.Ln=new To(i,n),this.Ln.rotation.set(-Math.PI/2,0,0,"XYZ"),this.Ln.position.set(0,this.It,0),this.Ln.mapNode=this;n=new iy({color:this.cc,width:this.Vh});return n.rc(o,t),(n.gt=this).Ah=o,this.Zs=n,this.Ln.add(n.Ln),!0},Na:function(){var t=this.Nr(Xm);if(!t)return!1;var n=t.getX(),t=t.getY();this.Ln.position.set(this.I-n,this.It,-this.F+t)},vh:function(){var t=this.Nr(Xm);if(!t)return!1;t=t.Ut;this.Ln.material=t.ks.Kr({color:this.zh,opacity:this.uh})}});e=ah;function fy(t){return(fy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ly(t,n){return(ly=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function dy(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=vy(e);return t=i?(t=vy(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==fy(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function vy(t){return(vy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var py=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&ly(t,n)}(i,kr);var e=dy(i);function i(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i);var t=e.call(this),n=new vu(new Float32Array([-.5,0,-.5,0,0,.5,0,-.5,1,0,.5,0,.5,1,1,-.5,0,.5,0,1]),5);return t.setIndex([0,1,2,0,2,3]),t.setAttribute("position",new mu(n,3,0,!1)),t.setAttribute("uv",new mu(n,2,3,!1)),t}return i}();function my(t){return(my="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function yy(t,n,e){return(yy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=xy(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function by(t,n){return(by=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function _y(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=xy(e);return t=i?(t=xy(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==my(t)&&"function"!=typeof t?wy(n):t}}function wy(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xy(t){return(xy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Qu=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&by(t,n)}(r,Qm);var t,n,e,i=_y(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Tn=Xi.LOCATION_MARKER,n.ch=t.url,n.Ge=void 0!==t.size?t.size:20,n.kt=void 0!==t.level?t.level:1,n.uh=void 0!==t.opacity?t.opacity:1,n.bt=null,n.fc=null,n.Be=n.Be.bind(wy(n)),n.Na=n.Na.bind(wy(n)),n}return t=r,(n=[{key:"level",get:function(){return this.kt},set:function(t){this.kt!==t&&(this.kt=t,t=this.Nr(Xm),this.remove(),this.addTo(t))}},{key:"opacity",get:function(){return this.uh},set:function(t){this.uh=t,this.Sa&&this.vh()}},{key:"url",get:function(){return this.ch},set:function(t){this.ch=t,this.vh()}},{key:"size",get:function(){return this.Ge},set:function(t){this.Ge=t,this.Be()}},{key:"moveTo",value:function(t){var n=this,e=t.animate||!1,i=t.duration||.5;if(t.level&&(this.level=t.level),e){e=this.Nr(Xm);if(!e)return!1;this.bt?(this.bt.ut([this.I,this.F]),this.bt.ht([t.x,t.y])):this.bt=new Oi({src:[this.I,this.F],dest:[t.x,t.y]}),this.bt.ct(i).lt(function(t){n.I=t.destination[0],n.F=t.destination[1],n.Na()}).dt(function(){t.finish&&t.finish()}),e.$t.tn(this.bt.ot())}else this.I=t.x,this.F=t.y,this.Na();return this.bt}},{key:"stop",value:function(){var t;this.bt||this.fc||(t=this.Nr(Xm))&&(this.bt&&(t.$t.Qt(this.bt),this.bt=null),this.fc&&(t.$t.Qt(this.fc),this.fc=null),this.Eh=!1)}},{key:"rotateTo",value:function(t){var n=this,e=this.Nr(Xm);if(!e)return!1;var i=t.duration||.5,r=this.Ln.rotation.y,o=t.heading%360*vi.DEG2RAD,s=0,s=r+(s=o-r!=0?Math.sin(o-r)/Math.abs(Math.sin(o-r))*Math.acos(Math.cos(o-r)):s);t.animate?(this.fc?(this.fc.ut([r]),this.fc.ht([o])):this.fc=new Oi({src:[r],dest:[s]}),this.fc.ct(i).lt(function(t){n.Ln&&(n.Ln.rotation.y=t.destination[0])}).dt(function(){e.$t.Qt(n.fc),n.fc=null,t.finish&&t.finish()}),e.$t.tn(this.fc.ot())):this.Ln&&(this.Ln.rotation.y=s)}},{key:"addTo",value:function(t){var n=t.getFloor(this.kt);yy(xy(r.prototype),"addTo",this).call(this,n),t.on("zoom",this.Be),t.on("resize",this.Be),t.on("floorSpaceChanged",this.Na)}},{key:"remove",value:function(){this.stop();var t=this.Nr(Xm);if(!t)return!1;t.off("zoom",this.Be),t.off("resize",this.Be),t.off("floorSpaceChanged",this.Na),yy(xy(r.prototype),"remove",this).call(this)}}])&&gy(t.prototype,n),e&&gy(t,e),r}();Object.assign(Qu.prototype,{Lo:function(){var n=this,e=this.Nr(Xm);if(!e)return!1;var t=new py,i=e.Ut.ks.Jr({url:this.ch,opacity:this.uh,flipY:!1},function(){var t;n.Ln&&(t=e.Ut.xu(n.Ln,n.Ge),n.Ln.scale.set(t,t,t))});this.Ln=new To(t,i),this.Ln.renderOrder=1,(this.Ln.mapNode=this).Na(),this.Ln.rotation.set(0,0,-Math.PI,"XYZ"),this.Ln.updateMatrixWorld(!0);i=e.Ut.xu(this.Ln,this.Ge);return this.Ln.scale.set(i,i,i),this.gt.Ce.add(this.Ln),this.Sa=!0},Be:function(){var t=this.Nr(Xm);t&&(t=t.Ut.xu(this.Ln,this.Ge),this.Ln.scale.set(t,t,t))},hh:function(){var t;void 0!==this.I&&void 0!==this.F||(t=this.Nr(Xm).getBound().center,this.I=t.x,this.F=t.y)},Na:function(){var t,n=this.Nr(Xm);n&&(t=n.getFloor(this.kt),this.Ln.position.set(this.I-n.getX(),t.It+this.It,-this.F+n.getY()))},vh:function(){var t=this.Nr(Xm);if(!t)return!1;this.Ln.material=t.Ut.ks.Jr({url:this.ch,flipY:!1,opacity:this.uh}),this.Ln.material.needsUpdate=!0}});hh=Qu;function My(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Ey=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"findNearNthPowerOfTwo",value:function(t){t-=1;return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,(t|=t>>16)<0?1:1+t}},{key:"polygonArea",value:function(t){if(t.length<3)return 0;var n=t.length;if(t[0].x===t[n-1].x&&t[0].y===t[n-1].y&&--n,n<3)return 0;t[0].y,t[n-1].x,t[1].x;for(var e=1;e<n-1;++e)t[e].y,t[e-1].x,t[e+1].x;return.5*(t[n-1].y*(t[n-2].x-t[0].x))}},{key:"closedPoints",value:function(t){var n=t.length;return!(n<3)&&(t[0].x===t[n-1].x&&t[0].y===t[n-1].y||(t[n]={x:t[n-1].x,y:t[n-1].y}),!0)}}],(e=null)&&My(n.prototype,e),i&&My(n,i),t}(),Sy={NONE:0,ALL:1,TOP:2};function Ty(t,n){kr.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:n},n=void 0!==n?n:1;var e,i,r,o,s=[],a=Math.cos(Mt.DEG2RAD*n),u=[0,0],h={},c=["a","b","c"];t.isBufferGeometry?(o=new fr).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var f=o.vertices,l=o.faces,d=0,v=l.length;d<v;d++)for(var p=l[d],m=0;m<3;m++)e=p[c[m]],i=p[c[(m+1)%3]],u[0]=Math.min(e,i),u[1]=Math.max(e,i),void 0===h[r=u[0]+","+u[1]]?h[r]={index1:u[0],index2:u[1],face1:d,face2:void 0}:h[r].face2=d;for(r in h){var g,y=h[r];(void 0===y.face2||l[y.face1].normal.dot(l[y.face2].normal)<=a)&&(g=f[y.index1],s.push(g.x,g.y,g.z),g=f[y.index2],s.push(g.x,g.y,g.z))}this.setAttribute("position",new wr(s,3))}function Ly(t){return(Ly="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Oy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ry(t,n){return(Ry=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Ay(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Cy(e);return t=i?(t=Cy(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Ly(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Cy(t){return(Cy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}(Ty.prototype=Object.create(kr.prototype)).constructor=Ty;oh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Ry(t,n)}(r,Qm);var t,n,e,i=Ay(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Tn=Xi.EDGES_LINES_TYPE,n.Xh=void 0!==t.lineType?t.lineType:Sy.TOP,n.lc=void 0!==t.lineAlpha?t.lineAlpha:1,n.cc=void 0!==t.lineColor?t.lineColor:"#FF0000",n}return t=r,(n=[{key:"lineColor",get:function(){return this.cc},set:function(t){this.cc!==t&&(this.cc=t,this.vh())}},{key:"lineAlpha",get:function(){return this.lc},set:function(t){this.lc!==t&&(this.lc=t,this.vh())}}])&&Oy(t.prototype,n),e&&Oy(t,e),r}();Object.assign(oh.prototype,{sc:function(t){var n=new Ty(t),t=this.Nr(Xm);if(!t)return!1;t=t.Ut.ks.ho(this.cc,this.lc);this.Ln=new ol(n,t),this.Sa=!0},vh:function(){var t=this.Nr(Xm);t&&(this.Ln.material=t.Ut.ks.ho(this.cc,this.lc))}});var ky=oh;function Py(t){return(Py="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Dy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function jy(t,n,e){return(jy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Uy(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Ny(t,n){return(Ny=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Iy(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Uy(e);return t=i?(t=Uy(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Py(t)&&"function"!=typeof t?Fy(n):t}}function Fy(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Uy(t){return(Uy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}qu=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Ny(t,n)}(r,Qm);var t,n,e,i=Iy(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Tn=Xi.EXTRUDE_MARKER,n.uh=void 0!==t.opacity?t.opacity:1,n.zh=void 0!==t.color?t.color:"#FF0000",n.dc=void 0!==t.extrudeHeight?t.extrudeHeight:1,n.fh=n.dc,n.Sh=void 0!==t.points?Object.assign(t.points):[],n.Sh.constructor===Array&&(Ey.polygonArea(n.Sh)<0&&n.Sh.reverse(),Ey.closedPoints(n.Sh)),n.vc=new ky({lineType:t.edgeMode,lineColor:void 0!==t.edgeColor?t.edgeColor:n.zh,lineAlpha:void 0!==t.edgeOpacity?t.edgeOpacity:n.uh}),n.vc.gt=Fy(n),n}return t=r,(n=[{key:"x",get:function(){return this.I}},{key:"y",get:function(){return this.F}},{key:"color",get:function(){return this.zh},set:function(t){this.zh!==t&&(this.zh=t,this.updateMaterial())}},{key:"opacity",get:function(){return this.uh},set:function(t){this.uh!==t&&(this.uh=t,this.vh())}},{key:"edgeColor",get:function(){return this.vc.cc},set:function(t){this.vc.lineColor=t}},{key:"edgeOpacity",get:function(){return this.vc.lc},set:function(t){this.vc.lineAlpha=t}},{key:"extrudeHeight",get:function(){return this.dc},set:function(t){this.dc!==t&&(this.dc=t,this.Ln.scale.setZ(this.dc/this.fh))}},{key:"dispose",value:function(){this.vc&&this.vc.dispose(),jy(Uy(r.prototype),"dispose",this).call(this)}}])&&Dy(t.prototype,n),e&&Dy(t,e),r}();Object.assign(qu.prototype,{Lo:function(){var t=this.Nr(Xm);if(!t)return!1;var n=t.Ut,e=new ii(t.getX(),t.getY()),i=vg.createShape(this.Sh,e),t={depth:this.fh},t=vg.createExtrudeBufferGeometry(i,t),n=n.ks.ho(this.zh,this.uh);return this.Ln=new To(t,n),(this.Ln.mapNode=this).Ln.rotation.set(-Math.PI/2,0,0,"XYZ"),this.Ln.position.set(0,this.It,0),this.vc.Xh===Sy.TOP?this.pc(e):this.vc.Xh===Sy.ALL&&this.oa(t),this.Sa=!0,this.Sa},pc:function(t){t=new Om(vg.createShape(this.Sh,t));this.oa(t),this.vc.Ln.position.setZ(this.fh),t.dispose()},oa:function(t){this.vc.sc(t),this.Ln.add(this.vc.Ln)},updateMaterial:function(){var t=this.Nr(Xm);t&&(this.Ln.material=t.Ut.ks.ho(this.zh,this.uh))},Na:function(){this.Ln.position.set(0,this.It,0)}});Zu=qu;function Gy(t){return(Gy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function By(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Hy(t,n,e){return(Hy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Wy(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Vy(t,n){return(Vy=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function zy(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Wy(e);return t=i?(t=Wy(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Gy(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Wy(t){return(Wy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ka=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Vy(t,n)}(r,Qm);var t,n,e,i=zy(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,n=n||{})).Tn=Xi.HEAT_MAP_MARKER,e.mc=t,e.uh=n.opacity?255*n.opacity:25500,e.Wh=void 0!==n.radius?n.radius:30,e.gc=void 0!==n.valueRange?void 0!==n.valueRange.max?void 0!==n.valueRange.min?n.valueRange:{max:n.valueRange.max,min:0}:void 0!==n.valueRange.min?{max:100,min:n.valueRange.min}:{max:100,min:0}:{max:100,min:0},e.gc.min>=e.gc.max&&(e.gc={max:100,min:0}),e.yc=void 0!==n.quality?n.quality:1024,e.Ca=void 0===n.isPlane||n.isPlane,e.bc=void 0!==n.gradient?n.gradient:{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},e._c=Math.ceil(+e.Wh),e.wc=15e3,e.Sh=[],e.xc=e.Mc(),e.Ec=document.createElement("canvas"),e.Ec.width=e.xc.width,e.Ec.height=e.xc.height,e.Sc=e.Ec.getContext("2d"),e.Tc=null,e.Pa=null,e}return t=r,(n=[{key:"x",get:function(){return this.I}},{key:"y",get:function(){return this.F}},{key:"opacity",get:function(){return this.uh/255},set:function(t){this.uh=255*t}},{key:"simulate",value:function(t){this.Lc();for(var n=0;n<t;n++){var e=Math.floor(Math.random()*this.xc.width+1),i=Math.floor(Math.random()*this.xc.height+1),r=Math.floor(Math.random()*(this.gc.max-this.gc.min)+1);this.Oc(e,i,r)}this.Rc()}},{key:"clearDataSource",value:function(){this.Sh=[],this.Lc()}},{key:"addPoint",value:function(t,n,e){if(t&&n&&e){n=this.Ac(t,n);if(n){this.Lc();for(var i=0;i<this.Sh.length;i++)this.Oc(this.Sh[i][0],this.Sh[i][1],this.Sh[i][2],!0);this.Oc(n.x,n.y,e,!1),this.Rc()}}}},{key:"addDataSource",value:function(t){this.Lc();for(var n=0;n<this.Sh.length;n++)this.Oc(this.Sh[n][0],this.Sh[n][1],this.Sh[n][2],!0);for(var e=0;e<t.length;e++){var i=this.Ac(t[e].x,t[e].y);if(!i)return!0;this.Oc(i.x,i.y,t[e].value,!1)}this.Rc()}},{key:"update",value:function(){var t;this.Pa=new $i(this.Ec),this.Ca?(t=this.Ln.material.map,this.Ln.material.map=this.Pa,this.Ln.material.map.needsUpdate=!0,this.Ln.material.needsUpdate=!0,t.dispose()):this.gt.ka(this.Pa)}},{key:"addTo",value:function(t){this.Tc=t,Hy(Wy(r.prototype),"addTo",this).call(this,t)}},{key:"dispose",value:function(){Hy(Wy(r.prototype),"dispose",this).call(this),this.Tc=null,this.Pa&&this.Pa.dispose(),this.Pa=null}}])&&By(t.prototype,n),e&&By(t,e),r}();Object.assign(ka.prototype,{Lo:function(){var n=this;if(this.Sa)return this.Sa;var t,e,i=this.Tc.getExtendMesh();return i&&(this.Pa=new $i(this.Ec),this.Ca?(e=i.userData,i.userData={},t=i.clone(),i.userData=e,t.name="heatMap",t.scale.z=.001,t.position.y+=this.It,(e=new ao(16777215)).opacity=1,e.transparent=!0,e.map=this.Pa,e.map.needsUpdate=!0,e.depthTest=!1,e.needsUpdate=!0,t.material=e,this.Ln=t,(this.Ln.mapNode=this).Sa=!0):(this.Sa=!0,this.Tc.getModelMeshs().forEach(function(t){t||(n.Sa=!1)}))),this.Sa},Na:function(){this.Ln.position.y=this.It},Ac:function(t,n){var e=this.mc.getBound(),e={x:(t-e.min.x)/(e.max.x-e.min.x),y:(e.max.y-n)/(e.max.y-e.min.y)};return e.x=e.x*this.xc.width,e.y=e.y*this.xc.height,e},Cc:function(t,n,e){this.Sh.push([t,n,e])},Lc:function(){this.Sc.clearRect(0,0,this.xc.width,this.xc.height)},Rc:function(){for(var t=this.Sc.getImageData(0,0,this.xc.width,this.xc.height),n=t.data,e=this.kc(),i=3;i<n.length;i+=4){var r=n[i],o=4*r;o&&(o=Math.floor(o),(r=this.uh<r?this.uh:r)<.8&&(r=.8),n[i-3]=e[o],n[i-2]=e[o+1],n[i-1]=e[o+2],n[i]=r)}this.Sc.putImageData(t,0,0)},kc:function(){var t=document.createElement("canvas"),n=t.getContext("2d");t.width=1,t.height=256;var e,i=n.createLinearGradient(0,0,1,256);for(e in this.bc)i.addColorStop(e,this.bc[e]);return n.fillStyle=i,n.fillRect(0,0,1,256),n.getImageData(0,0,1,256).data},Oc:function(t,n,e,i){var r=this.Sc,o=parseFloat(e/(this.gc.max-this.gc.min),10);r.save(),r.shadowColor="rgba(0, 0, 0, "+o+")",r.shadowOffsetX=this.wc,r.shadowOffsetY=this.wc,r.shadowBlur=this._c,r.beginPath(),r.arc(t-this.wc,n-this.wc,this.Wh,0,2*Math.PI,!0),r.closePath(),r.fill(),r.restore(),i||this.Cc(t,n,e)},Pc:function(){var t,n=[];return void 0!==window.screen.deviceXDPI?(n[0]=window.screen.deviceXDPI,n[1]=window.screen.deviceYDPI):((t=document.createElement("DIV")).style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(t),n[0]=parseInt(t.offsetWidth),n[1]=parseInt(t.offsetHeight),t.parentNode.removeChild(t)),n},Mc:function(){var t=this.mc.getBound(),n=t.max.x-t.min.x,t=t.max.y-t.min.y,n={width:Math.round(n),height:Math.round(t)},t=this.Pc();n.width=parseInt(n.width*t[0]/25.4),n.height=parseInt(n.height*t[1]/25.4);t=1;return(n.width>=this.yc||n.height>=this.yc)&&(n.width>=n.height?(t=n.height/n.width,n.width=this.yc,n.height=parseInt(this.yc*t)):(t=n.width/n.height,n.height=this.yc,n.width=parseInt(this.yc*t))),n}});ki=ka,ah={CLASSIC:2,REAL:4};Object.freeze(ah);Qu=ah,oh={NONE:"none",BY_CLICK:"click",BY_HOVER:"hover"};Object.freeze(oh);qu=oh;function Xy(t,n,e){this.Dc=t,this.jc=n,this.Nc=e||null;for(var i=n.tracks,r=i.length,o=new Array(r),s={endingStart:Fe,endingEnd:Fe},a=0;a!==r;++a){var u=i[a].createInterpolant(null);(o[a]=u).settings=s}this.Ic=s,this.Fc=o,this.Uc=new Array(r),this.Gc=null,this.Bc=null,this.Hc=null,this.Vc=null,this.loop=2201,this.zc=-1,this.Wc=null,this.time=0,this.timeScale=1,this.Xc=1,this.weight=1,this.Yc=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Yy(t,n,e){this.binding=t,this.valueSize=e;var i,r=Float64Array;switch(n){case"quaternion":i=this.Zc;break;case"string":case"bool":r=Array,i=this.qc;break;default:i=this.Kc}this.buffer=new r(4*e),this.Jc=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Zy(t){this.ni=t,this.Qc(),this.$c=0,this.time=0,this.timeScale=1}function qy(t){return(qy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ky(t,n){return(Ky=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Jy(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Qy(e);return t=i?(t=Qy(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==qy(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Qy(t){return(Qy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Object.assign(Xy.prototype,{play:function(){return this.Dc.tf(this),this},stop:function(){return this.Dc.nf(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this.zc=-1,this.Wc=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this.Wc&&this.Dc.ef(this)},isScheduled:function(){return this.Dc.ef(this)},startAt:function(t){return this.Wc=t,this},setLoop:function(t,n){return this.loop=t,this.repetitions=n,this},setEffectiveWeight:function(t){return this.weight=t,this.Yc=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this.Yc},fadeIn:function(t){return this.if(t,0,1)},fadeOut:function(t){return this.if(t,1,0)},crossFadeFrom:function(t,n,e){var i,r;return t.fadeOut(n),this.fadeIn(n),e&&(e=(i=this.jc.duration)/(r=t.jc.duration),t.warp(1,r/i,n),this.warp(e,1,n)),this},crossFadeTo:function(t,n,e){return t.crossFadeFrom(this,n,e)},stopFading:function(){var t=this.Vc;return null!==t&&(this.Vc=null,this.Dc.rf(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this.Xc=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this.Xc},setDuration:function(t){return this.timeScale=this.jc.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this.Xc,0,t)},warp:function(t,n,e){var i=this.Dc,r=i.time,o=this.Hc,s=this.timeScale;null===o&&(o=i.sf(),this.Hc=o);i=o.parameterPositions,o=o.sampleValues;return i[0]=r,i[1]=r+e,o[0]=t/s,o[1]=n/s,this},stopWarping:function(){var t=this.Hc;return null!==t&&(this.Hc=null,this.Dc.rf(t)),this},getMixer:function(){return this.Dc},getClip:function(){return this.jc},getRoot:function(){return this.Nc||this.Dc.ni},et:function(t,n,e,i){if(this.enabled){var r=this.Wc;if(null!==r){r=(t-r)*e;if(r<0||0===e)return;this.Wc=null,n=e*r}n*=this.af(t);var o=this.uf(n),s=this.hf(t);if(0<s)for(var a=this.Fc,u=this.Uc,h=0,c=a.length;h!==c;++h)a[h].evaluate(o),u[h].accumulate(i,s)}else this.hf(t)},hf:function(t){var n,e,i=0;return this.enabled&&(i=this.weight,null!==(n=this.Vc)&&(i*=e=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopFading(),0===e&&(this.enabled=!1)))),this.Yc=i},af:function(t){var n,e=0;return this.paused||(e=this.timeScale,null!==(n=this.Hc)&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))),this.Xc=e},uf:function(t){var n,e=this.time+t,i=this.jc.duration,r=this.loop,o=this.zc,s=2202===r;if(0===t)return-1!==o&&s&&1==(1&o)?i-e:e;if(2200===r){-1===o&&(this.zc=0,this.cf(!0,!0,!1));t:{if(i<=e)e=i;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this.Dc.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else if(-1===o&&(0<=t?this.cf(!(o=0),0===this.repetitions,s):this.cf(0===this.repetitions,!0,s)),i<=e||e<0?(e-=i*(n=Math.floor(e/i)),o+=Math.abs(n),(r=this.repetitions-o)<=0?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e=0<t?i:0,this.Dc.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1})):(1==r?this.cf(r=t<0,!r,s):this.cf(!1,!1,s),this.zc=o,this.time=e,this.Dc.dispatchEvent({type:"loop",action:this,loopDelta:n}))):this.time=e,s&&1==(1&o))return i-e;return e},cf:function(t,n,e){var i=this.Ic;e?(i.endingStart=Ue,i.endingEnd=Ue):(i.endingStart=t?this.zeroSlopeAtStart?Ue:Fe:2402,i.endingEnd=n?this.zeroSlopeAtEnd?Ue:Fe:2402)},if:function(t,n,e){var i=this.Dc,r=i.time,o=this.Vc;null===o&&(o=i.sf(),this.Vc=o);i=o.parameterPositions,o=o.sampleValues;return i[0]=r,o[0]=n,i[1]=r+t,o[1]=e,this}}),Object.assign(Yy.prototype,{accumulate:function(t,n){var e=this.buffer,i=this.valueSize,r=t*i+i,t=this.cumulativeWeight;if(0===t){for(var o=0;o!==i;++o)e[r+o]=e[o];t=n}else this.Jc(e,r,0,n/(t+=n),i);this.cumulativeWeight=t},apply:function(t){var n=this.valueSize,e=this.buffer,i=t*n+n,t=this.cumulativeWeight,r=this.binding;this.cumulativeWeight=0,t<1&&this.Jc(e,i,3*n,1-t,n);for(var o=n,s=n+n;o!==s;++o)if(e[o]!==e[o+n]){r.setValue(e,i);break}},saveOriginalState:function(){var t=this.binding,n=this.buffer,e=this.valueSize,i=3*e;t.getValue(n,i);for(var r=e,o=i;r!==o;++r)n[r]=n[i+r%e];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},qc:function(t,n,e,i,r){if(.5<=i)for(var o=0;o!==r;++o)t[n+o]=t[e+o]},Zc:function(t,n,e,i){et.slerpFlat(t,n,t,n,t,e,i)},Kc:function(t,n,e,i,r){for(var o=1-i,s=0;s!==r;++s){var a=n+s;t[a]=t[a]*o+t[e+s]*i}}}),Zy.prototype=Object.assign(Object.create(g.prototype),{constructor:Zy,ff:function(t,n){var e=t.Nc||this.ni,i=t.jc.tracks,r=i.length,o=t.Uc,s=t.Fc,a=e.uuid,t=this.lf,u=t[a];void 0===u&&(t[a]=u={});for(var h=0;h!==r;++h){var c=i[h],f=c.name;if(void 0!==(l=u[f]))o[h]=l;else{if(void 0!==(l=o[h])){null===l.Gc&&(++l.referenceCount,this.df(l,a,f));continue}var l,d=n&&n.Uc[h].binding.parsedPath;++(l=new Yy(yl.create(e,f,d),c.ValueTypeName,c.getValueSize())).referenceCount,this.df(l,a,f),o[h]=l}s[h].resultBuffer=l.buffer}},tf:function(t){if(!this.ef(t)){var n,e,i;null===t.Gc&&(n=(t.Nc||this.ni).uuid,e=t.jc.uuid,i=this.vf[e],this.ff(t,i&&i.knownActions[0]),this.pf(t,e,n));for(var r=t.Uc,o=0,s=r.length;o!==s;++o){var a=r[o];0==a.useCount++&&(this.mf(a),a.saveOriginalState())}this.gf(t)}},nf:function(t){if(this.ef(t)){for(var n=t.Uc,e=0,i=n.length;e!==i;++e){var r=n[e];0==--r.useCount&&(r.restoreOriginalState(),this.yf(r))}this.bf(t)}},Qc:function(){this._f=[],this.wf=0,this.vf={},this.us=[],this.xf=0,this.lf={},this.Mf=[],this.Ef=0;var t=this;this.stats={actions:{get total(){return t._f.length},get inUse(){return t.wf}},bindings:{get total(){return t.us.length},get inUse(){return t.xf}},controlInterpolants:{get total(){return t.Mf.length},get inUse(){return t.Ef}}}},ef:function(t){t=t.Gc;return null!==t&&t<this.wf},pf:function(t,n,e){var i=this._f,r=this.vf,o=r[n];void 0===o?(o={knownActions:[t],actionByRoot:{}},t.Bc=0,r[n]=o):(n=o.knownActions,t.Bc=n.length,n.push(t)),t.Gc=i.length,i.push(t),o.actionByRoot[e]=t},Sf:function(t){var n=this._f,e=n[n.length-1],i=t.Gc;n[e.Gc=i]=e,n.pop(),t.Gc=null;var r=t.jc.uuid,o=this.vf,s=o[r],i=s.knownActions,e=i[i.length-1],n=t.Bc;i[e.Bc=n]=e,i.pop(),t.Bc=null,delete s.actionByRoot[(t.Nc||this.ni).uuid],0===i.length&&delete o[r],this.Tf(t)},Tf:function(t){for(var n=t.Uc,e=0,i=n.length;e!==i;++e){var r=n[e];0==--r.referenceCount&&this.Lf(r)}},gf:function(t){var n=this._f,e=t.Gc,i=this.wf++,r=n[i];n[t.Gc=i]=t,n[r.Gc=e]=r},bf:function(t){var n=this._f,e=t.Gc,i=--this.wf,r=n[i];n[t.Gc=i]=t,n[r.Gc=e]=r},df:function(t,n,e){var i=this.lf,r=i[n],o=this.us;void 0===r&&(i[n]=r={}),(r[e]=t).Gc=o.length,o.push(t)},Lf:function(t){var n=this.us,e=t.binding,i=e.rootNode.uuid,r=e.path,o=this.lf,s=o[i],e=n[n.length-1],t=t.Gc;n[e.Gc=t]=e,n.pop(),delete s[r],0===Object.keys(s).length&&delete o[i]},mf:function(t){var n=this.us,e=t.Gc,i=this.xf++,r=n[i];n[t.Gc=i]=t,n[r.Gc=e]=r},yf:function(t){var n=this.us,e=t.Gc,i=--this.xf,r=n[i];n[t.Gc=i]=t,n[r.Gc=e]=r},sf:function(){var t=this.Mf,n=this.Ef++,e=t[n];return void 0===e&&(t[(e=new Of(new Float32Array(2),new Float32Array(2),1,this.Rf)).Of=n]=e),e},rf:function(t){var n=this.Mf,e=t.Of,i=--this.Ef,r=n[i];n[t.Of=i]=t,n[r.Of=e]=r},Rf:new Float32Array(1),clipAction:function(t,n){var e=n||this.ni,i=e.uuid,r="string"==typeof t?Ff.findByName(e,t):t,o=null!==r?r.uuid:t,s=this.vf[o],e=null;if(void 0!==s){t=s.actionByRoot[i];if(void 0!==t)return t;e=s.knownActions[0],null===r&&(r=e.jc)}if(null===r)return null;n=new Xy(this,r,n);return this.ff(n,e),this.pf(n,o,i),n},existingAction:function(t,n){var e=n||this.ni,n=e.uuid,e="string"==typeof t?Ff.findByName(e,t):t,t=e?e.uuid:t,t=this.vf[t];return void 0!==t&&t.actionByRoot[n]||null},stopAllAction:function(){var t=this._f,n=this.wf,e=this.us,i=this.xf;this.wf=0;for(var r=this.xf=0;r!==n;++r)t[r].reset();for(r=0;r!==i;++r)e[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var n=this._f,e=this.wf,i=this.time+=t,r=Math.sign(t),o=this.$c^=1,s=0;s!==e;++s)n[s].et(i,t,r,o);for(var a=this.us,u=this.xf,s=0;s!==u;++s)a[s].apply(o);return this},setTime:function(t){for(var n=this.time=0;n<this._f.length;n++)this._f[n].time=0;return this.update(t)},getRoot:function(){return this.ni},uncacheClip:function(t){var n=this._f,e=t.uuid,i=this.vf,t=i[e];if(void 0!==t){for(var r=t.knownActions,o=0,s=r.length;o!==s;++o){var a=r[o];this.nf(a);var u=a.Gc,h=n[n.length-1];a.Gc=null,a.Bc=null,n[h.Gc=u]=h,n.pop(),this.Tf(a)}delete i[e]}},uncacheRoot:function(t){var n,e=t.uuid,i=this.vf;for(n in i){var r=i[n].actionByRoot[e];void 0!==r&&(this.nf(r),this.Sf(r))}var o=this.lf[e];if(void 0!==o)for(var s in o){s=o[s];s.restoreOriginalState(),this.Lf(s)}},uncacheAction:function(t,n){n=this.existingAction(t,n);null!==n&&(this.nf(n),this.Sf(n))}});ka=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Ky(t,n)}(e,vc);var n=Jy(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Er=new Map,t.loader=new Ml,t}return e}();Object.assign(ka.prototype,{hr:function(e,i,n){var r=this;this.Er.has(e)?!1===this.Er.get(e).loadComplete?this.Tr(e,{success:i,fail:n}):this.loader.parse(this.Er.get(e).data,nf(e),function(t){i&&i(t)},function(t){n&&n(t)}):(this.Er.set(e,{data:null,loadComplete:!1}),this.loader.load(e,function(t,n){r.Er.set(e,{data:n,loadComplete:!0}),i&&i(t),r.Rr(e,t,!0)},void 0,function(t){r.Er.delete(e),r.Rr(e,t,!1)}))},Rr:function(i,r,o){var s=this;this.Sr.has(i)&&(this.Sr.get(i).forEach(function(t,n,e){o?s.loader.parse(s.Er.get(i).data,nf(i),function(t){n.success&&n.success(t)},function(t){n.fail&&n.fail(t)}):n.fail(r),e.delete(t)}),this.Sr.delete(i))}});var $y=ka;function tb(t){return(tb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nb(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return eb(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?eb(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function eb(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function ib(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function rb(t,n,e){return(rb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=ab(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function ob(t,n){return(ob=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function sb(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=ab(e);return t=i?(t=ab(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==tb(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function ab(t){return(ab=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ah=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&ob(t,n)}(r,Qm);var t,n,e,i=sb(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Tn=Xi.DYNAMIC_MODEL_MARKER,n.Cn=void 0!==t.id?t.id:Mt.generateUUID(),n.Af=void 0!==t.fadeIn&&t.fadeIn,n.Da=void 0!==t.fadeOut&&t.fadeOut,n.uh=void 0!==t.opacity&&t.opacity,n.ch=t.url,n.zh=t.color,n.Cf=t.scale,n.kf=t.heading,n.it=t.callback,n.Dc=null,n._f=[],n.bt=null,n.Pf=new $y,n}return t=r,(n=[{key:"color",get:function(){return this.zh},set:function(t){var n;this.zh=t,this.Ln&&(n=new _i(this.zh),this.Ln.traverse(function(t){t instanceof To&&(t.material.color.r=n.r,t.material.color.g=n.g,t.material.color.b=n.b)}))}},{key:"scale",get:function(){return this.Cf},set:function(t){for(var n=this.Ln.children,e=0;e<n.length;e++)n[e].scale.x*=t,n[e].scale.y*=t,n[e].scale.z*=t}},{key:"heading",get:function(){return this.kf}},{key:"opacity",get:function(){return this.uh},set:function(n){this.uh=n,this.Sa&&this.Ln.traverse(function(t){t instanceof To&&(t.material.opacity=n)})}},{key:"setRotate",value:function(t){this.Ln.rotation.y=t%360*vi.DEG2RAD}},{key:"moveTo",value:function(t){var n=this,e=void 0!==t.animate&&t.animate,i=t.duration||.5;if(e){e=this.Nr(Xm);if(!e)return;this.bt?(this.bt.ut([this.I,this.F]),this.bt.ht([t.x,t.y])):this.bt=new Oi({src:[this.I,this.F],dest:[t.x,t.y]}),this.bt.ct(i).lt(function(t){n.I=t.destination[0],n.F=t.destination[1],n.Na()}).dt(function(){t.finish&&t.finish()}),e.$t.tn(this.bt.ot())}else this.I=t.x,this.F=t.y,this.Na();return this.bt}},{key:"stop",value:function(){var t;!this.bt||(t=this.Nr(Xm))&&(t.$t.Qt(this.bt),this.bt=null)}},{key:"rotateTo",value:function(t){var n=this,e=this.Nr(Xm);if(!e)return!1;var i,r,o=t.heading%360*vi.DEG2RAD;return t.animate?(i=t.duration||.5,r=this.Ln.rotation.y,this.fc?(this.fc.ut([r]),this.fc.ht([o])):this.fc=new Oi({src:[r],dest:[o]}),this.fc.ct(i).lt(function(t){n.Ln.rotation.y=t.destination[0],n.kf=t.destination[0]*vi.RAD2DEG}).dt(function(){t.finish&&t.finish()}),e.$t.tn(this.fc.ot())):(this.Ln.rotation.y=o,this.kf=t.heading),this.fc}},{key:"startAction",value:function(t,n){t=this._f[t];t&&(n&&(t.clampWhenFinished=!0,t.loop=2200),t.reset().setEffectiveTimeScale(1).setEffectiveWeight(1).play())}},{key:"stopAction",value:function(t){t=this._f[t];t&&t.stop()}},{key:"getActionNames",value:function(){return Object.keys(this._f)}},{key:"remove",value:function(){this.stop(),rb(ab(r.prototype),"remove",this).call(this)}},{key:"dispose",value:function(){this.remove(),this.Ln&&(this.Ln.traverse(function(t){t instanceof To&&(t.material.map&&t.material.map.dispose(),t.material.map=null,t.material.dispose(),t.material=void 0,t.geometry.dispose(),t.geometry=void 0)}),this.Ln.mapNode=void 0,this.Ln=void 0),this.Sa=!1}}])&&ib(t.prototype,n),e&&ib(t,e),r}();Object.assign(ah.prototype,{Lo:function(){var r=this,o=this.Nr(Xm);return!!o&&(this.Pf.hr(this.ch,function(t){r.Ln=t.scene,r.Af&&r.Df(),r.zh&&(r.color=r.zh),r.uh&&(r.opacity=r.uh),r.Cf&&(r.scale=r.Cf),r.kf&&r.setRotate(r.kf),(r.Ln.mapNode=r).Dc=new Zy(r.Ln);var n,e=nb(t.animations);try{for(e.s();!(n=e.n()).done;){var i=n.value;r._f[i.name]=r.Dc.clipAction(i)}}catch(t){e.e(t)}finally{e.f()}o.$t.Uu(r.Dc),r.Na(),r.gt.Ce.add(r.Ln),r.it&&r.it(r)},function(){}),this.Sa=!0)},Df:function(){this.Ln.traverse(function(t){var n;t instanceof To&&(t.material.transparent=!0,t.material.opacity=0,n=setInterval(function(){t.material.opacity<1?t.material.opacity+=.05:clearInterval(n)},200))})},Na:function(){if(this.Ln){var t=this.Nr(Xm);if(!t)return!1;this.Ln.position.set(this.I-t.getX(),this.It,-this.F+t.getY())}}});oh=ah;function ub(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var hb=!1,cb=0,fb=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"coordsMapToScreen",value:function(t,n){return this.coordsMapToScreen_(t,{x:n.x,y:n.y,z:n.height+n.level*t.getFloorSpace()})}},{key:"coordsScreenToMap",value:function(t,n){var e,i=t.yt[0],r=t.eu._t.object,o=t.qt.renderer.domElement.clientWidth,s=t.qt.renderer.domElement.clientHeight,a=i.getFloor(t.kt).It,u=new Et,h=new Et;r.isPerspectiveCamera?(u.setFromMatrixPosition(r.matrixWorld),e=n.x/o*2-1,t=-n.y/s*2+1,h.set(e,t,-1).unproject(r).sub(u).normalize()):(o=n.x/o*2-1,s=-n.y/s*2+1,u.set(o,s,(r.near+r.far)/(r.near-r.far)).unproject(r),h.set(0,0,-1).transformDirection(r.matrixWorld));r=(-u.y+a)/h.y,r=(new Et).copy(u).add((new Et).copy(h).multiplyScalar(r));return{x:r.x+i.x,y:i.y-r.z,z:a}}},{key:"screenshot",value:function(t,n,e,i,s,a){var u=e.x-n.x,h=e.y-n.y,r=(e.x+n.x)/2,o=(e.y+n.y)/2,c=t.qt.renderer.domElement.style.width,f=t.qt.renderer.domElement.style.height,l=c.split("p")[0],d=f.split("p")[0],v=null,v=(e.x-n.x)/(e.y-n.y)>l/d?l/(e.x-n.x):d/(e.y-n.y),n=r-l/2,r=o-d/2,o=document.getElementsByTagName("canvas")[0],p=document.createElement("canvas"),m=document.createElement("canvas"),g=document.createElement("canvas"),y=window.devicePixelRatio,b=new Image;t.getViewMode(),t.wt.setViewOffset(l*v,d*v,l*(v-1)/2+n*v,d*(v-1)/2+r*v,l,d),t.qt.render(),p.width=u*v*y,p.height=h*v*y,p.style.width=u*v*y+"px",p.style.height=h*v*y+"px",i?(m.width=1240*Math.pow(1.414,s-1),m.height=1754*Math.pow(1.414,s-1),m.style.width=1240*Math.pow(1.414,s-1)+"px",m.style.height=1754*Math.pow(1.414,s-1)+"px"):(m.height=1240*Math.pow(1.414,s-1),m.width=1754*Math.pow(1.414,s-1),m.style.height=1240*Math.pow(1.414,s-1)+"px",m.style.width=1754*Math.pow(1.414,s-1)+"px"),g.height=h*Math.pow(1.414,s-1),g.width=u*Math.pow(1.414,s-1),g.style.height=h*Math.pow(1.414,s-1)+"px",g.style.width=u*Math.pow(1.414,s-1)+"px",b.src=o.toDataURL("image/png"),(t.getViewMode()===mi.PERSPECTIVE?t.Kt:t.Xt).clearViewOffset();var _=p.getContext("2d"),w=m.getContext("2d"),x=g.getContext("2d");b.onload=function(){t.getViewMode(),_.drawImage(b,-(l*y-u*v*y)/2,-(d*y-h*v*y)/2);var o=new Image;o.src=p.toDataURL("image/png"),o.onload=function(){var t=Math.min(1240*Math.pow(1.414,s-1)/(u*v),1754*Math.pow(1.414,s-1)/(h*v)),n=(m.width-u*v*t)/2,e=(m.height-h*v*t)/2;w.drawImage(o,n,e,u*v*t,h*v*t),x.drawImage(o,0,0,u*Math.pow(1.414,s-1),h*Math.pow(1.414,s-1));var i=m.toDataURL("image/png"),r=g.toDataURL("image/png");-1<navigator.userAgent.indexOf("Edge")||-1<navigator.userAgent.indexOf(".NET4.0C")?a(i,null,r,null):m.toBlob(function(n){return g.toBlob(function(t){return a(i,n,r,t)})})}}}},{key:"print",value:function(t,n){var e=this;hb=!0;var i=t.getZoom();t.setZoom({animate:!0,zoom:29});var r=t.eu._t.target.x,o=t.eu._t.target.z;t.eu._t.panAdd({x:-r,z:-o,y:0});var s=t.getTilt(),a=t.getRotation(),u=document.createElement("canvas");u.width=6*t.qt.renderer.domElement.width,u.height=6*t.qt.renderer.domElement.height,t.setTilt({tilt:90,finish:function(){t.setRotation({rotation:0})}}),t.getViewMode()===mi.MODE_3D?t.setViewMode({mode:mi.MODE_2D,callback:function(){return e.shot_(t,u,u.getContext("2d"),0,t.Xt.zoom,r,o,i,mi.MODE_3D,s,a,n)}}):this.shot_(t,u,u.getContext("2d"),0,t.Xt.zoom,r,o,i,mi.MODE_2D,s,a,n)}},{key:"coordsMapToScreen_",value:function(t,n){var e=t.yt[0],i=t.eu._t.object,e=new Et(n.x-e.x,n.z,-n.y+e.y).project(i),i=t.qt.renderer.domElement.clientWidth,t=t.qt.renderer.domElement.clientHeight;return{x:Math.round(i/2*e.x+i/2),y:Math.round(-t/2*e.y+t/2)}}},{key:"shot_",value:function(n,e,i,t,r,o,s,a,u,h,c,f){if(hb&&t<36){var l=null,d=null;t<6?(l=0,d=+t):t<12?(l=1,d=t-6):t<18?(l=2,d=t-12):t<24?(l=3,d=t-18):t<30?(l=4,d=t-24):t<36&&(l=5,d=t-30);var v=n.qt.renderer.domElement.width,p=n.qt.renderer.domElement.height,m=new Image;return m.indexI=l,m.indexJ=d,n.Xt.setViewOffset(v,p,2.5*-v+v*l,2.5*-p+p*d,v,p),n.Xt.updateProjectionMatrix(),m.onload=function(t){cb++,i.drawImage(t.path[0],v*t.path[0].indexI,p*t.path[0].indexJ),36===cb&&(e.toBlob(function(t){n.Xt.zoom=6*r,n.Xt.updateProjectionMatrix(),n.setViewMode({mode:u,callback:function(){n.setRotation({rotation:c,finish:function(){n.setTilt({tilt:h})}})}}),n.setZoom({zoom:a}),n.Xt.clearViewOffset(),n.qt.hn(),n.eu._t.panAdd({x:o,z:s,y:0}),n.qt.Zt(),n.eu._t.update(),n.qt.render(),hb=!1,f(t)}),cb=0)},n.qt.Zt(),n.eu._t.update(),n.qt.render(),m.src=n.qt.renderer.domElement.toDataURL(),this.shot_(n,e,i,++t,r,o,s,a,u,h,c,f)}}}],(e=null)&&ub(n.prototype,e),i&&ub(n,i),t}();function lb(t){return(lb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function db(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function vb(t,n,e,i){return(vb="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,n,e,i){var r,t=mb(t,n);if(t){if((r=Object.getOwnPropertyDescriptor(t,n)).set)return r.set.call(i,e),!0;if(!r.writable)return!1}if(r=Object.getOwnPropertyDescriptor(i,n)){if(!r.writable)return!1;r.value=e,Object.defineProperty(i,n,r)}else e=e,!void((n=n)in(i=i)?Object.defineProperty(i,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[n]=e);return!0})(t,n,e,i)}function pb(t,n,e){return(pb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=mb(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function mb(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=_b(t)););return t}function gb(t,n){return(gb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function yb(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=_b(e);return t=i?(t=_b(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==lb(t)&&"function"!=typeof t?bb(n):t}}function bb(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _b(t){return(_b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ka=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&gb(t,n)}(r,Qm);var t,n,e,i=yb(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Cn=Mt.generateUUID(),n.Tn=Xi.DOM_MARKER,n.jf=void 0!==t.fontsize?t.fontsize:16,n.Nf=t.content,n.If=void 0!==t.domWidth?t.domWidth:30,n.Ff=void 0!==t.domHeight?t.domHeight:30,n.Uf=void 0!==t.anchor?t.anchor:jm.CENTER,n.uh=void 0!==t.opacity?t.opacity:1,n.Na=n.Na.bind(bb(n)),n.Gf=n.Gf.bind(bb(n)),n}return t=r,(n=[{key:"content",get:function(){return this.Nf},set:function(t){this.Nf=t,this.domNode.innerHTML=this.Nf}},{key:"visible",get:function(){return pb(_b(r.prototype),"visible",this)},set:function(t){this.Ke=t,this.Ln&&(this.Ke?this.Gf():this.domNode.style.display="none")}},{key:"opacity",get:function(){return pb(_b(r.prototype),"opacity",this)},set:function(t){!function(t,n,e,i,r){if(!vb(t,n,e,i||t)&&r)throw new Error("failed to set property")}(_b(r.prototype),"opacity",t,this,!0),this.Sa&&(this.domNode.style.opacity=this.uh)}},{key:"moveTo",value:function(t){var n=this,e=void 0!==t.animate&&t.animate,i=t.duration||.5;if(e){e=this.Nr(Xm);if(e)return this.bt?(this.bt.ut([this.I,this.F]),this.bt.ht([t.x,t.y])):this.bt=new Oi({src:[this.I,this.F],dest:[t.x,t.y]}),this.bt.ct(i).lt(function(t){n.I=t.destination[0],n.F=t.destination[1],n.Na()}).dt(function(){t.finish&&t.finish()}),e.$t.tn(this.bt.ot()),this.bt}else this.I=t.x,this.F=t.y,this.Na()}},{key:"stop",value:function(){var t;!this.bt||(t=this.Nr(Xm))&&(t.$t.Qt(this.bt),this.bt=null)}},{key:"remove",value:function(){this.stop(),pb(_b(r.prototype),"remove",this).call(this)}},{key:"dispose",value:function(){this.remove(),this.Ln&&(this.Ln.mapNode=void 0,this.Ln=void 0),this.Sa=!1}}])&&db(t.prototype,n),e&&db(t,e),r}();Object.assign(ka.prototype,{Lo:function(){var t=this.Nr(Xm);if(!t)return console.warn("marker没有添加到中!"),!1;var n=document.createElement("div");n.id=this.Cn,n.name="domMarker",n.setAttribute("class","domMarker"),n.style.fontSize=this.jf,n.style.width=this.If+"px",n.style.height=this.Ff+"px",n.style.position="absolute",n.style.opacity=this.uh,n.innerHTML=this.Nf;var e=t.qt.renderer.domElement.parentNode;return e.style.position="absolute",e.appendChild(n),this.domNode=n,this.Na(),this.Gf(),this.Ln=n,t.$t.Gu(this.Na),t.on("levelChanged",this.Gf),t.on("visibleLevelsChanged",this.Gf),this.Sa=!0},Bf:function(t){var n,e;switch(this.Uf){case jm.CENTER:n=t.x-this.If/2+"px",e=t.y-this.Ff/2+"px";break;case jm.RIGHT_BOTTOM:n=t.x+"px",e=t.y+"px";break;case jm.LEFT_BOTTOM:n=t.x-this.If+"px",e=t.y+"px";break;case jm.RIGHT_TOP:n=t.x+"px",e=t.y-this.Ff+"px";break;case jm.LEFT_TOP:n=t.x-this.If+"px",e=t.y-this.Ff+"px";break;case jm.RIGHT:n=t.x+"px",e=t.y-this.Ff/2+"px";break;case jm.LEFT:n=t.x-this.If+"px",e=t.y-this.Ff/2+"px";break;case jm.BOTTOM:n=t.x-this.If/2+"px",e=t.y+"px";break;case jm.TOP:n=t.x-this.If/2+"px",e=t.y-this.Ff+"px"}return{left:n,top:e}},Na:function(){var t,n=this.Nr(Xm);if(!n)return console.warn("marker没有添加到中!"),!1;this.domNode&&(t=this.Nr(Np),t=fb.coordsMapToScreen_(n,{x:this.I,y:this.F,z:this.It+t.It}),this.domNode.style.left=this.Bf(t).left,this.domNode.style.top=this.Bf(t).top)},Gf:function(){if(this.Ke){var t=this.Nr(Xm);if(!t)return console.warn("marker没有添加到中!"),!1;var n=this.Nr(Np);n.kt===t.kt?(this.domNode.style.display="block",this.domNode.style.opacity=this.uh):t.Ct.indexOf(n.kt)?(this.domNode.style.display="block",this.domNode.style.opacity=t.Et.nonFocusAlphaMode+""):this.domNode.style.display="none"}}});ah=ka;function wb(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}ka=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.Hf=t.origon,this.Bs=t.target,this.Vf=null,this.zf=null,this.Wf=null,this.Xf=null,this.Yf=null,this.Zf=null,this.qf=null,this.Kf=null,this.Lo()}var t,e,i;return t=n,(e=[{key:"transform",value:function(t){var n=t.x-this.Vf.x,e=t.y-this.Vf.y,t=this.zf.x*n+this.zf.y*e,e=this.Wf.x*n+this.Wf.y*e,t=t/this.Xf.x,e=e/this.Xf.y,t=t*this.Kf.x,e=e*this.Kf.y;return{x:this.Yf.x+this.Zf.x*t+this.qf.x*e,y:this.Yf.y+this.Zf.y*t+this.qf.y*e}}}])&&wb(t.prototype,e),i&&wb(t,i),n}();Object.assign(ka.prototype,{Lo:function(){!Array.isArray(this.Hf)||!Array.isArray(this.Bs)||this.Hf.length<3||this.Bs.length<3||(this.Vf=this.Hf[0],this.zf={x:this.Hf[1].x-this.Hf[0].x,y:this.Hf[1].y-this.Hf[0].y},this.Wf={x:this.Hf[2].x-this.Hf[0].x,y:this.Hf[2].y-this.Hf[0].y},this.Xf={x:su.me(this.zf),y:su.me(this.Wf)},this.Yf=this.Bs[0],this.Zf={x:this.Bs[1].x-this.Bs[0].x,y:this.Bs[1].y-this.Bs[0].y},this.qf={x:this.Bs[2].x-this.Bs[0].x,y:this.Bs[2].y-this.Bs[0].y},this.Kf={x:su.me(this.Zf),y:su.me(this.qf)},this.zf.x/=this.Xf.x,this.zf.y/=this.Xf.x,this.Wf.x/=this.Xf.y,this.Wf.y/=this.Xf.y,this.Zf.x/=this.Kf.x,this.Zf.y/=this.Kf.x,this.qf.x/=this.Kf.y,this.qf.y/=this.Kf.y)}});var xb,Mb={VERSION:a,BUILD:h,FMMap:Xm,FMType:Xi,FMViewMode:mi,FMHighlightMode:qu,FMShadingMode:Qu,FMTextAlign:xc,FMLineType:Yg,FMLabelField:Up,FMMarkerAnchor:jm,FMEdgeMode:Sy,FMUtil:fb,FMCalculator:oy,FMCoordsTransformer:ka,FMImageMarker:ih,FMTextMarker:pi,FMPolygonMarker:e,FMLocationMarker:hh,FMHeatMap:ki,FMDynamicModel:oh,FMLineMarker:iy,FMDomMarker:ah,FMExtrudeMarker:Zu,FMSegment:Xg},Zu=yh.a.global(),Eb=void 0!==Zu?Zu.fengmap:{};for(xb in void 0===Eb&&(Eb={}),Mb)Eb[xb]=Mb[xb];void 0!==Zu&&(Zu.fengmap=Eb);n.default=Eb}],f={},g.m=d,g.c=f,g.d=function(t,n,e){g.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},g.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"Jf",{value:!0})},g.t=function(n,t){if(1&t&&(n=g(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.Jf)return n;var e=Object.create(null);if(g.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var i in n)g.d(e,i,function(t){return n[t]}.bind(null,i));return e},g.n=function(t){var n=t&&t.Jf?function(){return t.default}:function(){return t};return g.d(n,"a",n),n},g.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},g.p="",g(g.s=43).default;function g(t){if(f[t])return f[t].exports;var n=f[t]={i:t,l:!1,exports:{}};return d[t].call(n.exports,n,n.exports,g),n.l=!0,n.exports}var d,f});