yanchengPowerSupply/node_modules/mxdraw/dist/mxdraw.es.js

1 line
1.3 MiB
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function __awaiter(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})}function dynamicImport(t){return __awaiter(this,void 0,void 0,function*(){let e;switch(t){case"jquery":e=yield dynamicImportJquery();break;case"element-resize-event-polyfill":e=yield dynamicImportResize()}return e})}function dynamicImportResize(){return __awaiter(this,void 0,void 0,function*(){try{const t=yield Promise.resolve().then(function(){return elementResizeEventPolyfill_umd_min$2});return t.default?t.default:t}catch(t){console.log("import动态导入element-resize-event-polyfill失败",t)}})}function dynamicImportJquery(){return __awaiter(this,void 0,void 0,function*(){try{const t=yield Promise.resolve().then(function(){return jquery$1});return t.default?t.default:t}catch(t){console.log("import动态导入jquery失败",t)}})}let _mapDynamicCreate=null;function intiDynamicCreateMxObject(){_mapDynamicCreate||((_mapDynamicCreate={}).MxDbArea=(()=>Promise.resolve().then(function(){return index$8})),_mapDynamicCreate.MxDbLeadTag=(()=>Promise.resolve().then(function(){return index$7})),_mapDynamicCreate.MxDbCoord=(()=>Promise.resolve().then(function(){return index$c})),_mapDynamicCreate.MxDb2LineAngularDimension=(()=>Promise.resolve().then(function(){return index$e})),_mapDynamicCreate.Mx3PointArc=(()=>Promise.resolve().then(function(){return index$d})),_mapDynamicCreate.MxDbAnyLine=(()=>Promise.resolve().then(function(){return index$6})),_mapDynamicCreate.MxDbCloudLine=(()=>Promise.resolve().then(function(){return index$5})),_mapDynamicCreate.MxDbLeadComment=(()=>Promise.resolve().then(function(){return index$3})),_mapDynamicCreate.MxDbRectBoxLeadComment=(()=>Promise.resolve().then(function(){return index$2})),_mapDynamicCreate.MxDbEllipse=(()=>Promise.resolve().then(function(){return index$1})),_mapDynamicCreate.MxDbText=(()=>Promise.resolve().then(function(){return index})),_mapDynamicCreate.MxDbRegularPolygon=(()=>Promise.resolve().then(function(){return index$4})),_mapDynamicCreate.MxDbHatch=(()=>Promise.resolve().then(function(){return index$9})),_mapDynamicCreate.MxDbHatch=(()=>Promise.resolve().then(function(){return index$9})))}function dynamicCreateMxObject(t){return __awaiter(this,void 0,void 0,function*(){let e;switch(intiDynamicCreateMxObject(),t){case"MxDbSVG":try{e=yield Promise.resolve().then(function(){return index$g})}catch(e){console.log("import"+t+"error",e)}break;case"MxDbImage":try{e=yield Promise.resolve().then(function(){return index$i})}catch(e){console.log("import"+t+"error",e)}break;case"MxDbRect":try{e=yield Promise.resolve().then(function(){return index$b})}catch(e){console.log("import"+t+"error",e)}break;case"MxDbSVGText":try{e=yield Promise.resolve().then(function(){return index$h})}catch(e){console.log("import"+t+"error",e)}break;case"MxDbPolyline":try{e=yield Promise.resolve().then(function(){return index$f})}catch(e){console.log("import"+t+"error",e)}break;case"MxDbAlignedDimension":try{e=yield Promise.resolve().then(function(){return index$a})}catch(e){console.log("import"+t+"error",e)}}if(!e&&_mapDynamicCreate[t])try{e=yield _mapDynamicCreate[t]()}catch(e){console.log("import"+t+"error",e)}return e?e.default?e.default:e:(console.log("mx dynmac load:"+t+" failed"),null)})}class PubSub{constructor(){this.events={}}on(t,e){let n=this;return n.events.hasOwnProperty(t)||(n.events[t]=[]),n.events[t].push(e)}emit(t,...e){return this.events.hasOwnProperty(t)?this.events[t].map(t=>t(...e)):[]}off(t,e){if(this.events[t]){const n=this.events[t].indexOf(e);this.events[t].splice(n,1)}}}class Store{constructor(t){let e=this;e.actions={},e.mutations={},e.state=t.state,e.status="resting",e.events=new PubSub,t.hasOwnProperty("actions")&&(e.actions=t.actions),t.hasOwnProperty("mutations")&&(e.mutations=t.mutations)}dispatch(t,e){let n=this;return"function"!=typeof n.actions[t]?(console.error(`Action "${t} doesn't exist.`),!1):(console.groupCollapsed(`ACTION: ${t}`),n.status="action",n.actions[t](n,e),console.groupEnd(),!0)}commit(t,e){let n=this;if("function"!=typeof n.mutations[t])return console.log(`Mutation "${t}" doesn't exist`),!1;n.status="mutation";let r=n.mutations[t](n.state,e);return n.state=Object.assign(n.state,r),!0}}const options={state:{MxFun:null,Mxassembly:null,isCreateDrawObj:!1},actions:{},mutations:{}};for(let t in options.state){const e=t.charAt(0).toUpperCase()+t.slice(1);options.mutations["set"+e]=((e,n)=>{e[t]=n})}const store=new Store(options);function mxfun(){!function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){return i(e[a][1][t]||t)},u,u.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e,n){var r={};(0,t("./lib/utils/common").assign)(r,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=r},{"./lib/deflate":2,"./lib/inflate":3,"./lib/utils/common":4,"./lib/zlib/constants":7}],2:[function(t,e,n){var r=t("./zlib/deflate"),i=t("./utils/common"),o=t("./utils/strings"),a=t("./zlib/messages"),s=t("./zlib/zstream"),l=Object.prototype.toString;function c(t){if(!(this instanceof c))return new c(t);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==n)throw new Error(a[n]);if(e.header&&r.deflateSetHeader(this.strm,e.header),e.dictionary){var u;if(u="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(n=r.deflateSetDictionary(this.strm,u)))throw new Error(a[n]);this._dict_set=!0}}function u(t,e){var n=new c(e);if(n.push(t,!0),n.err)throw n.msg||a[n.err];return n.result}c.prototype.push=function(t,e){var n,a,s=this.strm,c=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:!0===e?4:0,"string"==typeof t?s.input=o.string2buf(t):"[object ArrayBuffer]"===l.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(c),s.next_out=0,s.avail_out=c),1!==(n=r.deflate(s,a))&&0!==n)return this.onEnd(n),!(this.ended=!0);0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==n);return 4===a?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==a||(this.onEnd(0),!(s.avail_out=0))},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Deflate=c,n.deflate=u,n.deflateRaw=function(t,e){return(e=e||{}).raw=!0,u(t,e)},n.gzip=function(t,e){return(e=e||{}).gzip=!0,u(t,e)}},{"./utils/common":4,"./utils/strings":5,"./zlib/deflate":9,"./zlib/messages":14,"./zlib/zstream":16}],3:[function(t,e,n){var r=t("./zlib/inflate"),i=t("./utils/common"),o=t("./utils/strings"),a=t("./zlib/constants"),s=t("./zlib/messages"),l=t("./zlib/zstream"),c=t("./zlib/gzheader"),u=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,e.windowBits);if(n!==a.Z_OK)throw new Error(s[n]);if(this.header=new c,r.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=r.inflateSetDictionary(this.strm,e.dictionary))!==a.Z_OK))throw new Error(s[n])}function d(t,e){var n=new h(e);if(n.push(t,!0),n.err)throw n.msg||s[n.err];return n.result}h.prototype.push=function(t,e){var n,s,l,c,h,d=this.strm,p=this.options.chunkSize,f=this.options.dictionary,m=!1;if(this.ended)return!1;s=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?d.input=o.binstring2buf(t):"[object ArrayBuffer]"===u.call(t)?d.input=new Uint8Array(t):d.input=t,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new i.Buf8(p),d.next_out=0,d.avail_out=p),(n=r.inflate(d,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&f&&(n=r.inflateSetDictionary(this.strm,f)),n===a.Z_BUF_ERROR&&!0===m&&(n=a.Z_OK,m=!1),n!==a.Z_STREAM_END&&n!==a.Z_OK)return this.onEnd(n),!(this.ended=!0);d.next_out&&(0!==d.avail_out&&n!==a.Z_STREAM_END&&(0!==d.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(d.output,d.next_out),c=d.next_out-l,h=o.buf2string(d.output,l),d.next_out=c,d.avail_out=p-c,c&&i.arraySet(d.output,d.output,l,c,0),this.onData(h)):this.onData(i.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((0<d.avail_in||0===d.avail_out)&&n!==a.Z_STREAM_END);return n===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(d.avail_out=0))},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Inflate=h,n.inflate=d,n.inflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},n.ungzip=d},{"./utils/common":4,"./utils/strings":5,"./zlib/constants":7,"./zlib/gzheader":10,"./zlib/inflate":12,"./zlib/messages":14,"./zlib/zstream":16}],4:[function(t,e,n){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(t){for(var e,n,r=Array.prototype.slice.call(arguments,1);r.length;){var i=r.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var o in i)e=i,n=o,Object.prototype.hasOwnProperty.call(e,n)&&(t[o]=i[o])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+r),i);else for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){var e,n,r,i,o,a;for(e=r=0,n=t.length;e<n;e++)r+=t[e].length;for(a=new Uint8Array(r),e=i=0,n=t.length;e<n;e++)o=t[e],a.set(o,i),i+=o.length;return a}},o={arraySet:function(t,e,n,r,i){for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(r)},{}],5:[function(t,e,n){var r=t("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var a=new r.Buf8(256),s=0;s<256;s++)a[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function l(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(t,e));for(var n="",a=0;a<e;a++)n+=String.fromCharCode(t[a]);return n}a[254]=a[254]=1,n.string2buf=function(t){var e,n,i,o,a,s=t.length,l=0;for(o=0;o<s;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),l+=n<128?1:n<2048?2:n<65536?3:4;for(e=new r.Buf8(l),o=a=0;a<l;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?e[a++]=n:(n<2048?e[a++]=192|n>>>6:(n<65536?e[a++]=224|n>>>12:(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63),e[a++]=128|n>>>6&63),e[a++]=128|63&n);return e},n.buf2binstring=function(t){return l(t,t.length)},n.binstring2buf=function(t){for(var e=new r.Buf8(t.length),n=0,i=e.length;n<i;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){var n,r,i,o,s=e||t.length,c=new Array(2*s);for(n=r=0;n<s;)if((i=t[n++])<128)c[r++]=i;else if(4<(o=a[i]))c[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&n<s;)i=i<<6|63&t[n++],o--;1<o?c[r++]=65533:i<65536?c[r++]=i:(i-=65536,c[r++]=55296|i>>10&1023,c[r++]=56320|1023&i)}return l(c,r)},n.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;0<=n&&128==(192&t[n]);)n--;return!(n<0)&&0!==n&&n+a[t[n]]>e?n:e}},{"./common":4}],6:[function(t,e,n){e.exports=function(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,a=0;0!==n;){for(n-=a=2e3<n?2e3:n;o=o+(i=i+e[r++]|0)|0,--a;);i%=65521,o%=65521}return i|o<<16|0}},{}],7:[function(t,e,n){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],8:[function(t,e,n){var r=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e,n,i){var o=r,a=i+n;t^=-1;for(var s=i;s<a;s++)t=t>>>8^o[255&(t^e[s])];return-1^t}},{}],9:[function(t,e,n){var r,i=t("../utils/common"),o=t("./trees"),a=t("./adler32"),s=t("./crc32"),l=t("./messages"),c=-2,u=258,h=262,d=113;function p(t,e){return t.msg=l[e],e}function f(t){return(t<<1)-(4<t?9:0)}function m(t){for(var e=t.length;0<=--e;)t[e]=0}function g(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(i.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function y(t,e){o._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,g(t.strm)}function v(t,e){t.pending_buf[t.pending++]=e}function x(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function b(t,e){var n,r,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,l=t.strstart>t.w_size-h?t.strstart-(t.w_size-h):0,c=t.window,d=t.w_mask,p=t.prev,f=t.strstart+u,m=c[o+a-1],g=c[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(c[(n=e)+a]===g&&c[n+a-1]===m&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do{}while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&o<f);if(r=u-(f-o),o=f-u,a<r){if(t.match_start=e,s<=(a=r))break;m=c[o+a-1],g=c[o+a]}}}while((e=p[e&d])>l&&0!=--i);return a<=t.lookahead?a:t.lookahead}function w(t){var e,n,r,o,l,c,u,d,p,f,m=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-h)){for(i.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=n=t.hash_size;r=t.head[--e],t.head[e]=m<=r?r-m:0,--n;);for(e=n=m;r=t.prev[--e],t.prev[e]=m<=r?r-m:0,--n;);o+=m}if(0===t.strm.avail_in)break;if(c=t.strm,u=t.window,d=t.strstart+t.lookahead,f=void 0,(p=o)<(f=c.avail_in)&&(f=p),n=0===f?0:(c.avail_in-=f,i.arraySet(u,c.input,c.next_in,f,d),1===c.state.wrap?c.adler=a(c.adler,u,f,d):2===c.state.wrap&&(c.adler=s(c.adler,u,f,d)),c.next_in+=f,c.total_in+=f,f),t.lookahead+=n,t.lookahead+t.insert>=3)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+3-1])&t.hash_mask,t.prev[l&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=l,l++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<h&&0!==t.strm.avail_in)}function M(t,e){for(var n,r;;){if(t.lookahead<h){if(w(t),t.lookahead<h&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-h&&(t.match_length=b(t,n)),t.match_length>=3)if(r=o._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}function _(t,e){for(var n,r,i;;){if(t.lookahead<h){if(w(t),t.lookahead<h&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-h&&(t.match_length=b(t,n),t.match_length<=5&&(1===t.strategy||3===t.match_length&&4096<t.strstart-t.match_start)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){for(i=t.strstart+t.lookahead-3,r=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=i&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((r=o._tr_tally(t,0,t.window[t.strstart-1]))&&y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=o._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}function C(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}function S(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:d,t.adler=2===e.wrap?0:1,e.last_flush=0,o._tr_init(e),0):p(t,c)}function T(t){var e,n=S(t);return 0===n&&((e=t.state).window_size=2*e.w_size,m(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),n}function E(t,e,n,r,o,a){if(!t)return c;var s=1;if(-1===e&&(e=6),r<0?(s=0,r=-r):15<r&&(s=2,r-=16),o<1||9<o||8!==n||r<8||15<r||e<0||9<e||a<0||4<a)return p(t,c);8===r&&(r=9);var l=new function(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),m(this.dyn_ltree),m(this.dyn_dtree),m(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),m(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),m(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0};return(t.state=l).strm=t,l.wrap=s,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=o+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new i.Buf8(2*l.w_size),l.head=new i.Buf16(l.hash_size),l.prev=new i.Buf16(l.w_size),l.lit_bufsize=1<<o+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new i.Buf8(l.pending_buf_size),l.d_buf=+l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=a,l.method=n,T(t)}r=[new C(0,0,0,0,function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(w(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-h&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(y(t,!1),t.strm.avail_out),1)}),new C(4,4,8,4,M),new C(4,5,16,8,M),new C(4,6,32,32,M),new C(4,4,16,16,_),new C(8,16,32,32,_),new C(8,16,128,128,_),new C(8,32,128,256,_),new C(32,128,258,1024,_),new C(32,258,258,4096,_)],n.deflateInit=function(t,e){return E(t,e,8,15,8,0)},n.deflateInit2=E,n.deflateReset=T,n.deflateResetKeep=S,n.deflateSetHeader=function(t,e){return t&&t.state&&2===t.state.wrap?(t.state.gzhead=e,0):c},n.deflate=function(t,e){var n,i,a,l;if(!t||!t.state||5<e||e<0)return t?p(t,c):c;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||666===i.status&&4!==e)return p(t,0===t.avail_out?-5:c);if(i.strm=t,n=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,v(i,31),v(i,139),v(i,8),i.gzhead?(v(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),v(i,255&i.gzhead.time),v(i,i.gzhead.time>>8&255),v(i,i.gzhead.time>>16&255),v(i,i.gzhead.time>>24&255),v(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),v(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(v(i,255&i.gzhead.extra.length),v(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(v(i,0),v(i,0),v(i,0),v(i,0),v(i,0),v(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),v(i,3),i.status=d);else{var h=8+(i.w_bits-8<<4)<<8;h|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(h|=32),h+=31-h%31,i.status=d,x(i,h),0!==i.strstart&&(x(i,t.adler>>>16),x(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),g(t),a=i.pending,i.pending!==i.pending_buf_size));)v(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),g(t),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,v(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),g(t),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,v(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&g(t),i.pending+2<=i.pending_buf_size&&(v(i,255&t.adler),v(i,t.adler>>8&255),t.adler=0,i.status=d)):i.status=d),0!==i.pending){if(g(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&f(e)<=f(n)&&4!==e)return p(t,-5);if(666===i.status&&0!==t.avail_in)return p(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var b=2===i.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(w(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var n,r,i,a,s=t.window;;){if(t.lookahead<=u){if(w(t),t.lookahead<=u&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0<t.strstart&&(r=s[i=t.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){a=t.strstart+u;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<a);t.match_length=u-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=o._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}(i,e):r[i.level].func(i,e);if(3!==b&&4!==b||(i.status=666),1===b||3===b)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===b&&(1===e?o._tr_align(i):5!==e&&(o._tr_stored_block(i,0,0,!1),3===e&&(m(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),g(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(v(i,255&t.adler),v(i,t.adler>>8&255),v(i,t.adler>>16&255),v(i,t.adler>>24&255),v(i,255&t.total_in),v(i,t.total_in>>8&255),v(i,t.total_in>>16&255),v(i,t.total_in>>24&255)):(x(i,t.adler>>>16),x(i,65535&t.adler)),g(t),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?0:1)},n.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&e!==d&&666!==e?p(t,c):(t.state=null,e===d?p(t,-3):0):c},n.deflateSetDictionary=function(t,e){var n,r,o,s,l,u,h,d,p=e.length;if(!t||!t.state)return c;if(2===(s=(n=t.state).wrap)||1===s&&42!==n.status||n.lookahead)return c;for(1===s&&(t.adler=a(t.adler,e,p,0)),n.wrap=0,p>=n.w_size&&(0===s&&(m(n.head),n.strstart=0,n.block_start=0,n.insert=0),d=new i.Buf8(n.w_size),i.arraySet(d,e,p-n.w_size,n.w_size,0),e=d,p=n.w_size),l=t.avail_in,u=t.next_in,h=t.input,t.avail_in=p,t.next_in=0,t.input=e,w(n);n.lookahead>=3;){for(r=n.strstart,o=n.lookahead-2;n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+3-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,--o;);n.strstart=r,n.lookahead=2,w(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=u,t.input=h,t.avail_in=l,n.wrap=s,0},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":4,"./adler32":6,"./crc32":8,"./messages":14,"./trees":15}],10:[function(t,e,n){e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],11:[function(t,e,n){e.exports=function(t,e){var n,r,i,o,a,s,l,c,u,h,d,p,f,m,g,y,v,x,b,w,M,_,C,S,T;n=t.state,r=t.next_in,S=t.input,i=r+(t.avail_in-5),o=t.next_out,T=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),l=n.dmax,c=n.wsize,u=n.whave,h=n.wnext,d=n.window,p=n.hold,f=n.bits,m=n.lencode,g=n.distcode,y=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;t:do{f<15&&(p+=S[r++]<<f,f+=8,p+=S[r++]<<f,f+=8),x=m[p&y];e:for(;;){if(p>>>=b=x>>>24,f-=b,0==(b=x>>>16&255))T[o++]=65535&x;else{if(!(16&b)){if(0==(64&b)){x=m[(65535&x)+(p&(1<<b)-1)];continue e}if(32&b){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}w=65535&x,(b&=15)&&(f<b&&(p+=S[r++]<<f,f+=8),w+=p&(1<<b)-1,p>>>=b,f-=b),f<15&&(p+=S[r++]<<f,f+=8,p+=S[r++]<<f,f+=8),x=g[p&v];n:for(;;){if(p>>>=b=x>>>24,f-=b,!(16&(b=x>>>16&255))){if(0==(64&b)){x=g[(65535&x)+(p&(1<<b)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(M=65535&x,f<(b&=15)&&(p+=S[r++]<<f,(f+=8)<b&&(p+=S[r++]<<f,f+=8)),l<(M+=p&(1<<b)-1)){t.msg="invalid distance too far back",n.mode=30;break t}if(p>>>=b,f-=b,(b=o-a)<M){if(u<(b=M-b)&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(C=d,(_=0)===h){if(_+=c-b,b<w){for(w-=b;T[o++]=d[_++],--b;);_=o-M,C=T}}else if(h<b){if(_+=c+h-b,(b-=h)<w){for(w-=b;T[o++]=d[_++],--b;);if(_=0,h<w){for(w-=b=h;T[o++]=d[_++],--b;);_=o-M,C=T}}}else if(_+=h-b,b<w){for(w-=b;T[o++]=d[_++],--b;);_=o-M,C=T}for(;2<w;)T[o++]=C[_++],T[o++]=C[_++],T[o++]=C[_++],w-=3;w&&(T[o++]=C[_++],1<w&&(T[o++]=C[_++]))}else{for(_=o-M;T[o++]=T[_++],T[o++]=T[_++],T[o++]=T[_++],2<(w-=3););w&&(T[o++]=T[_++],1<w&&(T[o++]=T[_++]))}break}}break}}while(r<i&&o<s);r-=w=f>>3,p&=(1<<(f-=w<<3))-1,t.next_in=r,t.next_out=o,t.avail_in=r<i?i-r+5:5-(r-i),t.avail_out=o<s?s-o+257:257-(o-s),n.hold=p,n.bits=f}},{}],12:[function(t,e,n){var r=t("../utils/common"),i=t("./adler32"),o=t("./crc32"),a=t("./inffast"),s=t("./inftrees"),l=-2;function c(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new r.Buf32(852),e.distcode=e.distdyn=new r.Buf32(592),e.sane=1,e.back=-1,0):l}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,h(t)):l}function p(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?l:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,d(t))):l}function f(t,e){var n,r;return t?(r=new u,(t.state=r).window=null,0!==(n=p(t,e))&&(t.state=null),n):l}var m,g,y=!0;function v(t){if(y){var e;for(m=new r.Buf32(512),g=new r.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(1,t.lens,0,288,m,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(2,t.lens,0,32,g,0,t.work,{bits:5}),y=!1}t.lencode=m,t.lenbits=9,t.distcode=g,t.distbits=5}function x(t,e,n,i){var o,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new r.Buf8(a.wsize)),i>=a.wsize?(r.arraySet(a.window,e,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(o=a.wsize-a.wnext)&&(o=i),r.arraySet(a.window,e,n-i,o,a.wnext),(i-=o)?(r.arraySet(a.window,e,n-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}n.inflateReset=d,n.inflateReset2=p,n.inflateResetKeep=h,n.inflateInit=function(t){return f(t,15)},n.inflateInit2=f,n.inflate=function(t,e){var n,u,h,d,p,f,m,g,y,b,w,M,_,C,S,T,E,D,A,O,P,L,R,I,k=0,F=new r.Buf8(4),B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return l;12===(n=t.state).mode&&(n.mode=13),p=t.next_out,h=t.output,m=t.avail_out,d=t.next_in,u=t.input,f=t.avail_in,g=n.hold,y=n.bits,b=f,w=m,L=0;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;y<16;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}if(2&n.wrap&&35615===g){F[n.check=0]=255&g,F[1]=g>>>8&255,n.check=o(n.check,F,2,0),y=g=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",n.mode=30;break}if(y-=4,P=8+(15&(g>>>=4)),0===n.wbits)n.wbits=P;else if(P>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<P,t.adler=n.check=1,n.mode=512&g?10:12,y=g=0;break;case 2:for(;y<16;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}if(n.flags=g,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=g>>8&1),512&n.flags&&(F[0]=255&g,F[1]=g>>>8&255,n.check=o(n.check,F,2,0)),y=g=0,n.mode=3;case 3:for(;y<32;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}n.head&&(n.head.time=g),512&n.flags&&(F[0]=255&g,F[1]=g>>>8&255,F[2]=g>>>16&255,F[3]=g>>>24&255,n.check=o(n.check,F,4,0)),y=g=0,n.mode=4;case 4:for(;y<16;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}n.head&&(n.head.xflags=255&g,n.head.os=g>>8),512&n.flags&&(F[0]=255&g,F[1]=g>>>8&255,n.check=o(n.check,F,2,0)),y=g=0,n.mode=5;case 5:if(1024&n.flags){for(;y<16;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}n.length=g,n.head&&(n.head.extra_len=g),512&n.flags&&(F[0]=255&g,F[1]=g>>>8&255,n.check=o(n.check,F,2,0)),y=g=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(f<(M=n.length)&&(M=f),M&&(n.head&&(P=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,u,d,M,P)),512&n.flags&&(n.check=o(n.check,u,M,d)),f-=M,d+=M,n.length-=M),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===f)break t;for(M=0;P=u[d+M++],n.head&&P&&n.length<65536&&(n.head.name+=String.fromCharCode(P)),P&&M<f;);if(512&n.flags&&(n.check=o(n.check,u,M,d)),f-=M,d+=M,P)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===f)break t;for(M=0;P=u[d+M++],n.head&&P&&n.length<65536&&(n.head.comment+=String.fromCharCode(P)),P&&M<f;);if(512&n.flags&&(n.check=o(n.check,u,M,d)),f-=M,d+=M,P)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;y<16;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}if(g!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}y=g=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;y<32;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}t.adler=n.check=c(g),y=g=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=p,t.avail_out=m,t.next_in=d,t.avail_in=f,n.hold=g,n.bits=y,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break t;case 13:if(n.last){g>>>=7&y,y-=7&y,n.mode=27;break}for(;y<3;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}switch(n.last=1&g,--y,3&(g>>>=1)){case 0:n.mode=14;break;case 1:if(v(n),n.mode=20,6!==e)break;g>>>=2,y-=2;break t;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}g>>>=2,y-=2;break;case 14:for(g>>>=7&y,y-=7&y;y<32;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}if((65535&g)!=(g>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&g,y=g=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(M=n.length){if(f<M&&(M=f),m<M&&(M=m),0===M)break t;r.arraySet(h,u,d,M,p),f-=M,d+=M,m-=M,p+=M,n.length-=M;break}n.mode=12;break;case 17:for(;y<14;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}if(n.nlen=257+(31&g),g>>>=5,y-=5,n.ndist=1+(31&g),g>>>=5,y-=5,n.ncode=4+(15&g),g>>>=4,y-=4,286<n.nlen||30<n.ndist){t.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;y<3;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}n.lens[B[n.have++]]=7&g,g>>>=3,y-=3}for(;n.have<19;)n.lens[B[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,R={bits:n.lenbits},L=s(0,n.lens,0,19,n.lencode,0,n.work,R),n.lenbits=R.bits,L){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;T=(k=n.lencode[g&(1<<n.lenbits)-1])>>>16&255,E=65535&k,!((S=k>>>24)<=y);){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}if(E<16)g>>>=S,y-=S,n.lens[n.have++]=E;else{if(16===E){for(I=S+2;y<I;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}if(g>>>=S,y-=S,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}P=n.lens[n.have-1],M=3+(3&g),g>>>=2,y-=2}else if(17===E){for(I=S+3;y<I;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}y-=S,P=0,M=3+(7&(g>>>=S)),g>>>=3,y-=3}else{for(I=S+7;y<I;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}y-=S,P=0,M=11+(127&(g>>>=S)),g>>>=7,y-=7}if(n.have+M>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;M--;)n.lens[n.have++]=P}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,R={bits:n.lenbits},L=s(1,n.lens,0,n.nlen,n.lencode,0,n.work,R),n.lenbits=R.bits,L){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,R={bits:n.distbits},L=s(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,R),n.distbits=R.bits,L){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(6<=f&&258<=m){t.next_out=p,t.avail_out=m,t.next_in=d,t.avail_in=f,n.hold=g,n.bits=y,a(t,w),p=t.next_out,h=t.output,m=t.avail_out,d=t.next_in,u=t.input,f=t.avail_in,g=n.hold,y=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;T=(k=n.lencode[g&(1<<n.lenbits)-1])>>>16&255,E=65535&k,!((S=k>>>24)<=y);){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}if(T&&0==(240&T)){for(D=S,A=T,O=E;T=(k=n.lencode[O+((g&(1<<D+A)-1)>>D)])>>>16&255,E=65535&k,!(D+(S=k>>>24)<=y);){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}g>>>=D,y-=D,n.back+=D}if(g>>>=S,y-=S,n.back+=S,n.length=E,0===T){n.mode=26;break}if(32&T){n.back=-1,n.mode=12;break}if(64&T){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&T,n.mode=22;case 22:if(n.extra){for(I=n.extra;y<I;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}n.length+=g&(1<<n.extra)-1,g>>>=n.extra,y-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;T=(k=n.distcode[g&(1<<n.distbits)-1])>>>16&255,E=65535&k,!((S=k>>>24)<=y);){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}if(0==(240&T)){for(D=S,A=T,O=E;T=(k=n.distcode[O+((g&(1<<D+A)-1)>>D)])>>>16&255,E=65535&k,!(D+(S=k>>>24)<=y);){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}g>>>=D,y-=D,n.back+=D}if(g>>>=S,y-=S,n.back+=S,64&T){t.msg="invalid distance code",n.mode=30;break}n.offset=E,n.extra=15&T,n.mode=24;case 24:if(n.extra){for(I=n.extra;y<I;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}n.offset+=g&(1<<n.extra)-1,g>>>=n.extra,y-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===m)break t;if(M=w-m,n.offset>M){if((M=n.offset-M)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}_=M>n.wnext?(M-=n.wnext,n.wsize-M):n.wnext-M,M>n.length&&(M=n.length),C=n.window}else C=h,_=p-n.offset,M=n.length;for(m<M&&(M=m),m-=M,n.length-=M;h[p++]=C[_++],--M;);0===n.length&&(n.mode=21);break;case 26:if(0===m)break t;h[p++]=n.length,m--,n.mode=21;break;case 27:if(n.wrap){for(;y<32;){if(0===f)break t;f--,g|=u[d++]<<y,y+=8}if(w-=m,t.total_out+=w,n.total+=w,w&&(t.adler=n.check=(n.flags?o:i)(n.check,h,w,p-w)),w=m,(n.flags?g:c(g))!==n.check){t.msg="incorrect data check",n.mode=30;break}y=g=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;y<32;){if(0===f)break t;f--,g+=u[d++]<<y,y+=8}if(g!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}y=g=0}n.mode=29;case 29:L=1;break t;case 30:L=-3;break t;case 31:return-4;default:return l}return t.next_out=p,t.avail_out=m,t.next_in=d,t.avail_in=f,n.hold=g,n.bits=y,(n.wsize||w!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&x(t,t.output,t.next_out,w-t.avail_out)?(n.mode=31,-4):(b-=t.avail_in,w-=t.avail_out,t.total_in+=b,t.total_out+=w,n.total+=w,n.wrap&&w&&(t.adler=n.check=(n.flags?o:i)(n.check,h,w,t.next_out-w)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==b&&0===w||4===e)&&0===L&&(L=-5),L)},n.inflateEnd=function(t){if(!t||!t.state)return l;var e=t.state;return e.window&&(e.window=null),t.state=null,0},n.inflateGetHeader=function(t,e){var n;return t&&t.state&&0!=(2&(n=t.state).wrap)?((n.head=e).done=!1,0):l},n.inflateSetDictionary=function(t,e){var n,r=e.length;return!t||!t.state||0!==(n=t.state).wrap&&11!==n.mode?l:11===n.mode&&i(1,e,r,0)!==n.check?-3:x(t,e,r,r)?(n.mode=31,-4):(n.havedict=1,0)},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":4,"./adler32":6,"./crc32":8,"./inffast":11,"./inftrees":13}],13:[function(t,e,n){var r=t("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,n,l,c,u,h,d){var p,f,m,g,y,v,x,b,w,M=d.bits,_=0,C=0,S=0,T=0,E=0,D=0,A=0,O=0,P=0,L=0,R=null,I=0,k=new r.Buf16(16),F=new r.Buf16(16),B=null,j=0;for(_=0;_<=15;_++)k[_]=0;for(C=0;C<l;C++)k[e[n+C]]++;for(E=M,T=15;1<=T&&0===k[T];T--);if(T<E&&(E=T),0===T)return c[u++]=20971520,c[u++]=20971520,d.bits=1,0;for(S=1;S<T&&0===k[S];S++);for(E<S&&(E=S),_=O=1;_<=15;_++)if(O<<=1,(O-=k[_])<0)return-1;if(0<O&&(0===t||1!==T))return-1;for(F[1]=0,_=1;_<15;_++)F[_+1]=F[_]+k[_];for(C=0;C<l;C++)0!==e[n+C]&&(h[F[e[n+C]]++]=C);if(v=0===t?(R=B=h,19):1===t?(R=i,I-=257,B=o,j-=257,256):(R=a,B=s,-1),_=S,y=u,A=C=L=0,m=-1,g=(P=1<<(D=E))-1,1===t&&852<P||2===t&&592<P)return 1;for(;;){for(x=_-A,w=h[C]<v?(b=0,h[C]):h[C]>v?(b=B[j+h[C]],R[I+h[C]]):(b=96,0),p=1<<_-A,S=f=1<<D;c[y+(L>>A)+(f-=p)]=x<<24|b<<16|w|0,0!==f;);for(p=1<<_-1;L&p;)p>>=1;if(0!==p?(L&=p-1,L+=p):L=0,C++,0==--k[_]){if(_===T)break;_=e[n+h[C]]}if(E<_&&(L&g)!==m){for(0===A&&(A=E),y+=S,O=1<<(D=_-A);D+A<T&&!((O-=k[D+A])<=0);)D++,O<<=1;if(P+=1<<D,1===t&&852<P||2===t&&592<P)return 1;c[m=L&g]=E<<24|D<<16|y-u|0}}return 0!==L&&(c[y+L]=_-A<<24|64<<16|0),d.bits=E,0}},{"../utils/common":4}],14:[function(t,e,n){e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],15:[function(t,e,n){var r=t("../utils/common");function i(t){for(var e=t.length;0<=--e;)t[e]=0}var o=256,a=286,s=30,l=15,c=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],u=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],d=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],p=new Array(576);i(p);var f=new Array(60);i(f);var m=new Array(512);i(m);var g=new Array(256);i(g);var y=new Array(29);i(y);var v,x,b,w=new Array(s);function M(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}function _(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function C(t){return t<256?m[t]:m[256+(t>>>7)]}function S(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function T(t,e,n){t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,S(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function E(t,e,n){T(t,n[2*e],n[2*e+1])}function D(t,e){for(var n=0;n|=1&t,t>>>=1,n<<=1,0<--e;);return n>>>1}function A(t,e,n){var r,i,o=new Array(16),a=0;for(r=1;r<=l;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=D(o[s]++,s))}}function O(t){var e;for(e=0;e<a;e++)t.dyn_ltree[2*e]=0;for(e=0;e<s;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function P(t){8<t.bi_valid?S(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function L(t,e,n,r){var i=2*e,o=2*n;return t[i]<t[o]||t[i]===t[o]&&r[e]<=r[n]}function R(t,e,n){for(var r=t.heap[n],i=n<<1;i<=t.heap_len&&(i<t.heap_len&&L(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!L(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r}function I(t,e,n){var r,i,a,s,l=0;if(0!==t.last_lit)for(;r=t.pending_buf[t.d_buf+2*l]<<8|t.pending_buf[t.d_buf+2*l+1],i=t.pending_buf[t.l_buf+l],l++,0===r?E(t,i,e):(E(t,(a=g[i])+o+1,e),0!==(s=c[a])&&T(t,i-=y[a],s),E(t,a=C(--r),n),0!==(s=u[a])&&T(t,r-=w[a],s)),l<t.last_lit;);E(t,256,e)}function k(t,e){var n,r,i,o=e.dyn_tree,a=e.stat_desc.static_tree,s=e.stat_desc.has_stree,c=e.stat_desc.elems,u=-1;for(t.heap_len=0,t.heap_max=573,n=0;n<c;n++)0!==o[2*n]?(t.heap[++t.heap_len]=u=n,t.depth[n]=0):o[2*n+1]=0;for(;t.heap_len<2;)o[2*(i=t.heap[++t.heap_len]=u<2?++u:0)]=1,t.depth[i]=0,t.opt_len--,s&&(t.static_len-=a[2*i+1]);for(e.max_code=u,n=t.heap_len>>1;1<=n;n--)R(t,o,n);for(i=c;n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],R(t,o,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,o[2*i]=o[2*n]+o[2*r],t.depth[i]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,o[2*n+1]=o[2*r+1]=i,t.heap[1]=i++,R(t,o,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,r,i,o,a,s,c=e.dyn_tree,u=e.max_code,h=e.stat_desc.static_tree,d=e.stat_desc.has_stree,p=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(o=0;o<=l;o++)t.bl_count[o]=0;for(c[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<573;n++)m<(o=c[2*c[2*(r=t.heap[n])+1]+1]+1)&&(o=m,g++),c[2*r+1]=o,u<r||(t.bl_count[o]++,a=0,f<=r&&(a=p[r-f]),s=c[2*r],t.opt_len+=s*(o+a),d&&(t.static_len+=s*(h[2*r+1]+a)));if(0!==g){do{for(o=m-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[m]--,g-=2}while(0<g);for(o=m;0!==o;o--)for(r=t.bl_count[o];0!==r;)u<(i=t.heap[--n])||(c[2*i+1]!==o&&(t.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),r--)}}(t,e),A(o,u,t.bl_count)}function F(t,e,n){var r,i,o=-1,a=e[1],s=0,l=7,c=4;for(0===a&&(l=138,c=3),e[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=e[2*(r+1)+1],++s<l&&i===a||(s<c?t.bl_tree[2*i]+=s:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[32]++):s<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=i,c=(s=0)===a?(l=138,3):i===a?(l=6,3):(l=7,4))}function B(t,e,n){var r,i,o=-1,a=e[1],s=0,l=7,c=4;for(0===a&&(l=138,c=3),r=0;r<=n;r++)if(i=a,a=e[2*(r+1)+1],!(++s<l&&i===a)){if(s<c)for(;E(t,i,t.bl_tree),0!=--s;);else 0!==i?(i!==o&&(E(t,i,t.bl_tree),s--),E(t,16,t.bl_tree),T(t,s-3,2)):s<=10?(E(t,17,t.bl_tree),T(t,s-3,3)):(E(t,18,t.bl_tree),T(t,s-11,7));o=i,c=(s=0)===a?(l=138,3):i===a?(l=6,3):(l=7,4)}}i(w);var j=!1;function N(t,e,n,i){var o,a,s;T(t,0+(i?1:0),3),a=e,s=n,P(o=t),S(o,s),S(o,~s),r.arraySet(o.pending_buf,o.window,a,s,o.pending),o.pending+=s}n._tr_init=function(t){j||(function(){var t,e,n,r,i,o=new Array(16);for(r=n=0;r<28;r++)for(y[r]=n,t=0;t<1<<c[r];t++)g[n++]=r;for(g[n-1]=r,r=i=0;r<16;r++)for(w[r]=i,t=0;t<1<<u[r];t++)m[i++]=r;for(i>>=7;r<s;r++)for(w[r]=i<<7,t=0;t<1<<u[r]-7;t++)m[256+i++]=r;for(e=0;e<=l;e++)o[e]=0;for(t=0;t<=143;)p[2*t+1]=8,t++,o[8]++;for(;t<=255;)p[2*t+1]=9,t++,o[9]++;for(;t<=279;)p[2*t+1]=7,t++,o[7]++;for(;t<=287;)p[2*t+1]=8,t++,o[8]++;for(A(p,287,o),t=0;t<s;t++)f[2*t+1]=5,f[2*t]=D(t,5);v=new M(p,c,257,a,l),x=new M(f,u,0,s,l),b=new M(new Array(0),h,0,19,7)}(),j=!0),t.l_desc=new _(t.dyn_ltree,v),t.d_desc=new _(t.dyn_dtree,x),t.bl_desc=new _(t.bl_tree,b),t.bi_buf=0,t.bi_valid=0,O(t)},n._tr_stored_block=N,n._tr_flush_block=function(t,e,n,r){var i,a,s=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<o;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),k(t,t.l_desc),k(t,t.d_desc),s=function(t){var e;for(F(t,t.dyn_ltree,t.l_desc.max_code),F(t,t.dyn_dtree,t.d_desc.max_code),k(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*d[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(a=t.static_len+3+7>>>3)<=i&&(i=a)):i=a=n+5,n+4<=i&&-1!==e?N(t,e,n,r):4===t.strategy||a===i?(T(t,2+(r?1:0),3),I(t,p,f)):(T(t,4+(r?1:0),3),function(t,e,n,r){var i;for(T(t,e-257,5),T(t,n-1,5),T(t,r-4,4),i=0;i<r;i++)T(t,t.bl_tree[2*d[i]+1],3);B(t,t.dyn_ltree,e-1),B(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),I(t,t.dyn_ltree,t.dyn_dtree)),O(t),r&&P(t)},n._tr_tally=function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(g[n]+o+1)]++,t.dyn_dtree[2*C(e)]++),t.last_lit===t.lit_bufsize-1},n._tr_align=function(t){var e;T(t,2,3),E(t,256,p),16===(e=t).bi_valid?(S(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":4}],16:[function(t,e,n){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],17:[function(t,e,n){var r=t("three");r.OrbitControls=function(t,e){var n,i,o,a,s;void 0===e&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.domElement=e,this.enabled=!0,this.target=new r.Vector3,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=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,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:r.MOUSE.ROTATE,MIDDLE:r.MOUSE.DOLLY,RIGHT:r.MOUSE.PAN},this.touches={ONE:r.TOUCH.ROTATE,TWO:r.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.resetStatusValue=function(){p=d.NONE},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(c),l.update(),p=d.NONE},this.update=(n=new r.Vector3,i=(new r.Quaternion).setFromUnitVectors(t.up,new r.Vector3(0,1,0)),o=i.clone().inverse(),a=new r.Vector3,s=new r.Quaternion,function(){var t=l.object.position;return n.copy(t).sub(l.target),n.applyQuaternion(i),m.setFromVector3(n),l.autoRotate&&p===d.NONE&&O(2*Math.PI/60/60*l.autoRotateSpeed),l.enableDamping?(m.theta+=g.theta*l.dampingFactor,m.phi+=g.phi*l.dampingFactor):(m.theta+=g.theta,m.phi+=g.phi),m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=y,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),!0===l.enableDamping?l.target.addScaledVector(v,l.dampingFactor):l.target.add(v),n.setFromSpherical(m),n.applyQuaternion(o),t.copy(l.target).add(n),l.object.lookAt(l.target),!0===l.enableDamping?(g.theta*=1-l.dampingFactor,g.phi*=1-l.dampingFactor,v.multiplyScalar(1-l.dampingFactor)):(g.set(0,0,0),v.set(0,0,0)),y=1,!(!(x||a.distanceToSquared(l.object.position)>f||8*(1-s.dot(l.object.quaternion))>f)||(l.dispatchEvent(c),a.copy(l.object.position),s.copy(l.object.quaternion),x=!1))}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",nt,!1),l.domElement.removeEventListener("mousedown",X,!1),l.domElement.removeEventListener("wheel",$,!1),l.domElement.removeEventListener("touchstart",Q,!1),l.domElement.removeEventListener("touchend",et,!1),l.domElement.removeEventListener("touchmove",tt,!1),document.removeEventListener("mousemove",Y,!1),document.removeEventListener("mouseup",Z,!1),l.domElement.removeEventListener("keydown",K,!1)};var l=this,c={type:"change"},u={type:"start"},h={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},p=d.NONE,f=1e-6,m=new r.Spherical,g=new r.Spherical,y=1,v=new r.Vector3,x=!1,b=new r.Vector2,w=new r.Vector2,M=new r.Vector2,_=new r.Vector2,C=new r.Vector2,S=new r.Vector2,T=new r.Vector2,E=new r.Vector2,D=new r.Vector2;function A(){return Math.pow(.95,l.zoomSpeed)}function O(t){g.theta-=t}function P(t){g.phi-=t}var L,R,I,k=(L=new r.Vector3,function(t,e){L.setFromMatrixColumn(e,0),L.multiplyScalar(-t),v.add(L)}),F=(R=new r.Vector3,function(t,e){!0===l.screenSpacePanning?R.setFromMatrixColumn(e,1):(R.setFromMatrixColumn(e,0),R.crossVectors(l.object.up,R)),R.multiplyScalar(t),v.add(R)}),B=(I=new r.Vector3,function(t,e){var n=l.domElement;if(l.object.isPerspectiveCamera){var r=l.object.position;I.copy(r).sub(l.target);var i=I.length();i*=Math.tan(l.object.fov/2*Math.PI/180),k(2*t*i/n.clientHeight,l.object.matrix),F(2*e*i/n.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(k(t*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),F(e*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)});function j(t){l.object.isPerspectiveCamera?y/=t:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*t)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function N(t){l.object.isPerspectiveCamera?y*=t:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/t)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function z(t){b.set(t.clientX,t.clientY)}function V(t){_.set(t.clientX,t.clientY)}function G(t){if(1==t.touches.length)b.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);b.set(e,n)}}function H(t){if(1==t.touches.length)_.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);_.set(e,n)}}function U(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(e*e+n*n);T.set(0,r)}function W(t){if(1==t.touches.length)w.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);w.set(e,n)}M.subVectors(w,b).multiplyScalar(l.rotateSpeed);var r=l.domElement;O(2*Math.PI*M.x/r.clientHeight),P(2*Math.PI*M.y/r.clientHeight),b.copy(w)}function J(t){if(1==t.touches.length)C.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);C.set(e,n)}S.subVectors(C,_).multiplyScalar(l.panSpeed),B(S.x,S.y),_.copy(C)}function q(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(e*e+n*n);E.set(0,r),D.set(0,Math.pow(E.y/T.y,l.zoomSpeed)),j(D.y),T.copy(E)}function X(t){if(!1!==l.enabled){switch(t.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),t.button){case 0:switch(l.mouseButtons.LEFT){case r.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===l.enablePan)return;V(t),p=d.PAN}else{if(!1===l.enableRotate)return;z(t),p=d.ROTATE}break;case r.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===l.enableRotate)return;z(t),p=d.ROTATE}else{if(!1===l.enablePan)return;V(t),p=d.PAN}break;default:p=d.NONE}break;case 1:switch(l.mouseButtons.MIDDLE){case r.MOUSE.DOLLY:if(!1===l.enableZoom)return;e=t,T.set(e.clientX,e.clientY),p=d.DOLLY;break;case r.MOUSE.PAN:if(!1===l.enablePan)return;V(t),p=d.PAN;break;default:p=d.NONE}break;case 2:switch(l.mouseButtons.RIGHT){case r.MOUSE.ROTATE:if(!1===l.enableRotate)return;z(t),p=d.ROTATE;break;case r.MOUSE.PAN:if(!1===l.enablePan)return;V(t),p=d.PAN;break;default:p=d.NONE}}var e;p!==d.NONE&&(document.addEventListener("mousemove",Y,!1),document.addEventListener("mouseup",Z,!1),l.dispatchEvent(u))}}function Y(t){var e,n;if(!1!==l.enabled)switch(t.preventDefault(),p){case d.ROTATE:if(!1===l.enableRotate)return;!function(t){w.set(t.clientX,t.clientY),M.subVectors(w,b).multiplyScalar(l.rotateSpeed);var e=l.domElement;O(2*Math.PI*M.x/e.clientHeight),P(2*Math.PI*M.y/e.clientHeight),b.copy(w),l.update()}(t);break;case d.DOLLY:if(!1===l.enableZoom)return;n=t,E.set(n.clientX,n.clientY),D.subVectors(E,T),0<D.y?j(A()):D.y<0&&N(A()),T.copy(E),l.update();break;case d.PAN:if(!1===l.enablePan)return;e=t,C.set(e.clientX,e.clientY),S.subVectors(C,_).multiplyScalar(l.panSpeed),B(S.x,S.y),_.copy(C),l.update()}}function Z(t){!1!==l.enabled&&(document.removeEventListener("mousemove",Y,!1),document.removeEventListener("mouseup",Z,!1),l.dispatchEvent(h),p=d.NONE)}function $(t){var e;!1===l.enabled||!1===l.enableZoom||p!==d.NONE&&p!==d.ROTATE||(t.preventDefault(),t.stopPropagation(),l.dispatchEvent(u),(e=t).deltaY<0?N(A()):0<e.deltaY&&j(A()),l.update(),l.dispatchEvent(h))}function K(t){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(t){var e=!1;switch(t.keyCode){case l.keys.UP:B(0,l.keyPanSpeed),e=!0;break;case l.keys.BOTTOM:B(0,-l.keyPanSpeed),e=!0;break;case l.keys.LEFT:B(l.keyPanSpeed,0),e=!0;break;case l.keys.RIGHT:B(-l.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),l.update())}(t)}function Q(t){if(!1!==l.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(l.touches.ONE){case r.TOUCH.ROTATE:if(!1===l.enableRotate)return;G(t),p=d.TOUCH_ROTATE;break;case r.TOUCH.PAN:if(!1===l.enablePan)return;H(t),p=d.TOUCH_PAN;break;default:p=d.NONE}break;case 2:switch(l.touches.TWO){case r.TOUCH.DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;n=t,l.enableZoom&&U(n),l.enablePan&&H(n),p=d.TOUCH_DOLLY_PAN;break;case r.TOUCH.DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;e=t,l.enableZoom&&U(e),l.enableRotate&&G(e),p=d.TOUCH_DOLLY_ROTATE;break;default:p=d.NONE}break;default:p=d.NONE}var e,n;p!==d.NONE&&l.dispatchEvent(u)}}function tt(t){var e,n;if(!1!==l.enabled)switch(t.preventDefault(),t.stopPropagation(),p){case d.TOUCH_ROTATE:if(!1===l.enableRotate)return;W(t),l.update();break;case d.TOUCH_PAN:if(!1===l.enablePan)return;J(t),l.update();break;case d.TOUCH_DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;n=t,l.enableZoom&&q(n),l.enablePan&&J(n),l.update();break;case d.TOUCH_DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;e=t,l.enableZoom&&q(e),l.enableRotate&&W(e),l.update();break;default:p=d.NONE}}function et(t){!1!==l.enabled&&(l.dispatchEvent(h),p=d.NONE)}function nt(t){!1!==l.enabled&&t.preventDefault()}l.domElement.addEventListener("contextmenu",nt,!1),l.domElement.addEventListener("mousedown",X,!1),l.domElement.addEventListener("wheel",$,!1),l.domElement.addEventListener("touchstart",Q,!1),l.domElement.addEventListener("touchend",et,!1),l.domElement.addEventListener("touchmove",tt,!1),l.domElement.addEventListener("keydown",K,!1),-1===l.domElement.tabIndex&&(l.domElement.tabIndex=0),this.update()},r.OrbitControls.prototype=Object.create(r.EventDispatcher.prototype),r.OrbitControls.prototype.constructor=r.OrbitControls,r.MapControls=function(t,e){r.OrbitControls.call(this,t,e),this.mouseButtons.LEFT=r.MOUSE.PAN,this.mouseButtons.RIGHT=r.MOUSE.ROTATE,this.touches.ONE=r.TOUCH.PAN,this.touches.TWO=r.TOUCH.DOLLY_ROTATE},r.MapControls.prototype=Object.create(r.EventDispatcher.prototype),r.MapControls.prototype.constructor=r.MapControls,void 0!==n&&(void 0!==e&&e.exports&&(n=e.exports={OrbitControls:r.OrbitControls,MapControls:r.MapControls}),n.OrbitControls=r.OrbitControls,n.MapControls=r.MapControls)},{three:19}],18:[function(t,e,n){(function(){var r,i,o,a=void 0!==t,s=this.THREE||a&&t("three");if(!s)throw new Error("MeshLine requires three.js");function l(){this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this.geometry=new s.BufferGeometry,this.widthCallback=null,this.matrixWorld=new s.Matrix4}function c(t,e,n,r,i){var o;if(t=t.subarray||t.slice?t:t.buffer,n=n.subarray||n.slice?n:n.buffer,t=e?t.subarray?t.subarray(e,i&&e+i):t.slice(e,i&&e+i):t,n.set)n.set(t,r);else for(o=0;o<t.length;o++)n[o+r]=t[o];return n}function u(t){s.ShaderMaterial.call(this,{uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.Vector2(1,1)},sizeAttenuation:{value:1},near:{value:1},far:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new s.Vector2(1,1)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},near:{enumerable:!0,get:function(){return this.uniforms.near.value},set:function(t){this.uniforms.near.value=t}},far:{enumerable:!0,get:function(){return this.uniforms.far.value},set:function(t){this.uniforms.far.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=0!==t?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}}}),this.setValues(t)}l.prototype.setMatrixWorld=function(t){this.matrixWorld=t},l.prototype.setGeometry=function(t,e){if(this.widthCallback=e,this.positions=[],this.counters=[],t instanceof s.Geometry)for(var n=0;n<t.vertices.length;n++){var r=t.vertices[n];e=n/t.vertices.length,this.positions.push(r.x,r.y,r.z),this.positions.push(r.x,r.y,r.z),this.counters.push(e),this.counters.push(e)}if(s.BufferGeometry,t instanceof Float32Array||t instanceof Array)for(n=0;n<t.length;n+=3)e=n/t.length,this.positions.push(t[n],t[n+1],t[n+2]),this.positions.push(t[n],t[n+1],t[n+2]),this.counters.push(e),this.counters.push(e);this.process()},l.prototype.raycast=(r=new s.Matrix4,i=new s.Ray,o=new s.Sphere,function(t,e){var n=t.linePrecision,a=n*n,l=this.geometry;if(null===l.boundingSphere&&l.computeBoundingSphere(),o.copy(l.boundingSphere),o.applyMatrix4(this.matrixWorld),!1!==t.ray.intersectSphere(o)){r.getInverse(this.matrixWorld),i.copy(t.ray).applyMatrix4(r);var c=new s.Vector3,u=new s.Vector3,h=new s.Vector3,d=new s.Vector3,p=this instanceof s.LineSegments?2:1;if(l instanceof s.BufferGeometry){var f=l.index,m=l.attributes;if(null!==f)for(var g=f.array,y=m.position.array,v=0,x=g.length-1;v<x;v+=p){var b=g[v],w=g[v+1];c.fromArray(y,3*b),u.fromArray(y,3*w),a<i.distanceSqToSegment(c,u,d,h)||(d.applyMatrix4(this.matrixWorld),(C=t.ray.origin.distanceTo(d))<t.near||C>t.far||e.push({distance:C,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}))}else for(v=0,x=(y=m.position.array).length/3-1;v<x;v+=p)c.fromArray(y,3*v),u.fromArray(y,3*v+3),a<i.distanceSqToSegment(c,u,d,h)||(d.applyMatrix4(this.matrixWorld),(C=t.ray.origin.distanceTo(d))<t.near||C>t.far||e.push({distance:C,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}))}else if(l instanceof s.Geometry){var M=l.vertices,_=M.length;for(v=0;v<_-1;v+=p){var C;a<i.distanceSqToSegment(M[v],M[v+1],d,h)||(d.applyMatrix4(this.matrixWorld),(C=t.ray.origin.distanceTo(d))<t.near||C>t.far||e.push({distance:C,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}))}}}}),l.prototype.compareV3=function(t,e){var n=6*t,r=6*e;return this.positions[n]===this.positions[r]&&this.positions[1+n]===this.positions[1+r]&&this.positions[2+n]===this.positions[2+r]},l.prototype.copyV3=function(t){var e=6*t;return[this.positions[e],this.positions[1+e],this.positions[2+e]]},l.prototype.process=function(){var t,e,n=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];for(var r=0;r<n;r++)this.side.push(1),this.side.push(-1);for(r=0;r<n;r++)t=this.widthCallback?this.widthCallback(r/(n-1)):1,this.width.push(t),this.width.push(t);for(r=0;r<n;r++)this.uvs.push(r/(n-1),0),this.uvs.push(r/(n-1),1);for(e=this.compareV3(0,n-1)?this.copyV3(n-2):this.copyV3(0),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]),r=0;r<n-1;r++)e=this.copyV3(r),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);for(r=1;r<n;r++)e=this.copyV3(r),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]);for(e=this.compareV3(n-1,0)?this.copyV3(1):this.copyV3(n-1),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]),r=0;r<n-1;r++){var i=2*r;this.indices_array.push(i,1+i,2+i),this.indices_array.push(2+i,1+i,3+i)}this.attributes?(this.attributes.position.copyArray(new Float32Array(this.positions)),this.attributes.position.needsUpdate=!0,this.attributes.previous.copyArray(new Float32Array(this.previous)),this.attributes.previous.needsUpdate=!0,this.attributes.next.copyArray(new Float32Array(this.next)),this.attributes.next.needsUpdate=!0,this.attributes.side.copyArray(new Float32Array(this.side)),this.attributes.side.needsUpdate=!0,this.attributes.width.copyArray(new Float32Array(this.width)),this.attributes.width.needsUpdate=!0,this.attributes.uv.copyArray(new Float32Array(this.uvs)),this.attributes.uv.needsUpdate=!0,this.attributes.index.copyArray(new Uint16Array(this.indices_array)),this.attributes.index.needsUpdate=!0):this.attributes={position:new s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)},this.geometry.setAttribute("position",this.attributes.position),this.geometry.setAttribute("previous",this.attributes.previous),this.geometry.setAttribute("next",this.attributes.next),this.geometry.setAttribute("side",this.attributes.side),this.geometry.setAttribute("width",this.attributes.width),this.geometry.setAttribute("uv",this.attributes.uv),this.geometry.setAttribute("counters",this.attributes.counters),this.geometry.setIndex(this.attributes.index)},l.prototype.advance=function(t){var e=this.attributes.position.array,n=this.attributes.previous.array,r=this.attributes.next.array,i=e.length;c(e,0,n,0,i),c(e,6,e,0,i-6),e[i-6]=t.x,e[i-5]=t.y,e[i-4]=t.z,e[i-3]=t.x,e[i-2]=t.y,e[i-1]=t.z,c(e,6,r,0,i-6),r[i-6]=t.x,r[i-5]=t.y,r[i-4]=t.z,r[i-3]=t.x,r[i-2]=t.y,r[i-1]=t.z,this.attributes.position.needsUpdate=!0,this.attributes.previous.needsUpdate=!0,this.attributes.next.needsUpdate=!0},s.ShaderChunk.meshline_vert=["",s.ShaderChunk.logdepthbuf_pars_vertex,s.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;","\t vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",s.ShaderChunk.logdepthbuf_vertex,s.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",s.ShaderChunk.fog_vertex,"}"].join("\n"),s.ShaderChunk.meshline_frag=["",s.ShaderChunk.fog_pars_fragment,s.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",s.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",s.ShaderChunk.fog_fragment,"}"].join("\n"),((u.prototype=Object.create(s.ShaderMaterial.prototype)).constructor=u).prototype.isMeshLineMaterial=!0,u.prototype.copy=function(t){return s.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.near=t.near,this.far=t.far,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this},void 0!==n?(void 0!==e&&e.exports&&(n=e.exports={MeshLine:l,MeshLineMaterial:u}),n.MeshLine=l,n.MeshLineMaterial=u):(this.MeshLine=l,this.MeshLineMaterial=u)}).call(this)},{three:19}],19:[function(t,e,n){var r,i;r=this,i=function(t){void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:0<t?1:+t}),"name"in Function.prototype==0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e});var e=100,n=301,r=302,i=304,o=306,a=307,s=1e3,l=1001,c=1002,u=1003,h=1004,d=1005,p=1006,f=1007,m=1008,g=1009,y=1012,v=1014,x=1015,b=1016,w=1020,M=1022,_=1023,C=1026,S=1027,T=33776,E=33777,D=33778,A=33779,O=35840,P=35841,L=35842,R=35843,I=2300,k=2301,F=2400,B=2401,j=2402,N=3e3,z=3001,V=3007,G=3002,H=3004,U=3005,W=3006,J=7680,q=35044,X=35048;function Y(){}Object.assign(Y.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(void 0!==n){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var n=e.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,t)}}}});for(var Z=[],$=0;$<256;$++)Z[$]=($<16?"0":"")+$.toString(16);var K,Q={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(Z[255&t]+Z[t>>8&255]+Z[t>>16&255]+Z[t>>24&255]+"-"+Z[255&e]+Z[e>>8&255]+"-"+Z[e>>16&15|64]+Z[e>>24&255]+"-"+Z[63&n|128]+Z[n>>8&255]+"-"+Z[n>>16&255]+Z[n>>24&255]+Z[255&r]+Z[r>>8&255]+Z[r>>16&255]+Z[r>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Q.DEG2RAD},radToDeg:function(t){return t*Q.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,e,n,r,i){var o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),c=o((e+r)/2),u=a((e+r)/2),h=o((e-r)/2),d=a((e-r)/2),p=o((r-e)/2),f=a((r-e)/2);"XYX"===i?t.set(s*u,l*h,l*d,s*c):"YZY"===i?t.set(l*d,s*u,l*h,s*c):"ZXZ"===i?t.set(l*h,l*d,s*u,s*c):"XZX"===i?t.set(s*u,l*f,l*p,s*c):"YXY"===i?t.set(l*p,s*u,l*f,s*c):"ZYZ"===i?t.set(l*f,l*p,s*u,s*c):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function tt(t,e){this.x=t||0,this.y=e||0}function et(){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.")}Object.defineProperties(tt.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(tt.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,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,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;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,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.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 e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[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,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},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(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},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,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,o=this.y-t.y;return this.x=i*n-o*r+t.x,this.y=i*r+o*n+t.y,this}}),Object.assign(et.prototype,{isMatrix3:!0,set:function(t,e,n,r,i,o,a,s,l){var c=this.elements;return c[0]=t,c[1]=r,c[2]=a,c[3]=e,c[4]=i,c[5]=s,c[6]=n,c[7]=o,c[8]=l,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 e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,r=e.elements,i=this.elements,o=n[0],a=n[3],s=n[6],l=n[1],c=n[4],u=n[7],h=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],y=r[1],v=r[4],x=r[7],b=r[2],w=r[5],M=r[8];return i[0]=o*f+a*y+s*b,i[3]=o*m+a*v+s*w,i[6]=o*g+a*x+s*M,i[1]=l*f+c*y+u*b,i[4]=l*m+c*v+u*w,i[7]=l*g+c*x+u*M,i[2]=h*f+d*y+p*b,i[5]=h*m+d*v+p*w,i[8]=h*g+d*x+p*M,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],l=t[7],c=t[8];return e*o*c-e*a*l-n*i*c+n*a*s+r*i*l-r*o*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=t.elements,r=this.elements,i=n[0],o=n[1],a=n[2],s=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],p=d*l-c*h,f=c*u-d*s,m=h*s-l*u,g=i*p+o*f+a*m;if(0==g){var y="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(y);return console.warn(y),this.identity()}var v=1/g;return r[0]=p*v,r[1]=(a*h-d*o)*v,r[2]=(c*o-a*l)*v,r[3]=f*v,r[4]=(d*i-a*u)*v,r[5]=(a*s-c*i)*v,r[6]=m*v,r[7]=(o*u-h*i)*v,r[8]=(l*i-o*s)*v,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,r,i,o,a){var s=Math.cos(i),l=Math.sin(i);this.set(n*s,n*l,-n*(s*o+l*a)+o+t,-r*l,r*s,-r*(-l*o+s*a)+a+e,0,0,1)},scale:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],l=r[4],c=r[7];return r[0]=e*i+n*s,r[3]=e*o+n*l,r[6]=e*a+n*c,r[1]=-n*i+e*s,r[4]=-n*o+e*l,r[7]=-n*a+e*c,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});var nt={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===K&&(K=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),K.width=t.width,K.height=t.height;var n=K.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=K}return 2048<e.width||2048<e.height?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},rt=0;function it(t,e,n,r,i,o,a,s,c,u){Object.defineProperty(this,"id",{value:rt++}),this.uuid=Q.generateUUID(),this.name="",this.image=void 0!==t?t:it.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:it.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:l,this.wrapT=void 0!==r?r:l,this.magFilter=void 0!==i?i:p,this.minFilter=void 0!==o?o:m,this.anisotropy=void 0!==c?c:1,this.format=void 0!==a?a:_,this.internalFormat=null,this.type=void 0!==s?s:g,this.offset=new tt(0,0),this.repeat=new tt(1,1),this.center=new tt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new et,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:N,this.version=0,this.onUpdate=null}function ot(t,e,n,r){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==r?r:1}function at(t,e,n){this.width=t,this.height=e,this.scissor=new ot(0,0,t,e),this.scissorTest=!1,this.viewport=new ot(0,0,t,e),n=n||{},this.texture=new it(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:p,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function st(t,e,n){at.call(this,t,e,n),this.samples=4}function lt(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==r?r:1}it.DEFAULT_IMAGE=void 0,it.DEFAULT_MAPPING=300,it.prototype=Object.assign(Object.create(Y.prototype),{constructor:it,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},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=Q.generateUUID()),!e&&void 0===t.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var o=0,a=r.length;o<a;o++)i.push(nt.getDataURL(r[o]))}else i=nt.getDataURL(r);t.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return e||(t.textures[this.uuid]=n),n},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 s:t.x=t.x-Math.floor(t.x);break;case l:t.x=t.x<0?0:1;break;case c: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 s:t.y=t.y-Math.floor(t.y);break;case l:t.y=t.y<0?0:1;break;case c: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(it.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(ot.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(ot.prototype,{isVector4:!0,set:function(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,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,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;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,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(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,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(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,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,i=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*e+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*e+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*e+o[7]*n+o[11]*r+o[15]*i,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,r,i,o=t.elements,a=o[0],s=o[4],l=o[8],c=o[1],u=o[5],h=o[9],d=o[2],p=o[6],f=o[10];if(Math.abs(s-c)<.01&&Math.abs(l-d)<.01&&Math.abs(h-p)<.01){if(Math.abs(s+c)<.1&&Math.abs(l+d)<.1&&Math.abs(h+p)<.1&&Math.abs(a+u+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(a+1)/2,g=(u+1)/2,y=(f+1)/2,v=(s+c)/4,x=(l+d)/4,b=(h+p)/4;return g<m&&y<m?i=m<.01?(n=0,r=.707106781):(r=v/(n=Math.sqrt(m)),x/n):y<g?i=g<.01?(r=0,n=.707106781):(n=v/(r=Math.sqrt(g)),b/r):y<.01?(r=n=.707106781,i=0):(n=x/(i=Math.sqrt(y)),r=b/i),this.set(n,r,i,e),this}var w=Math.sqrt((p-h)*(p-h)+(l-d)*(l-d)+(c-s)*(c-s));return Math.abs(w)<.001&&(w=1),this.x=(p-h)/w,this.y=(l-d)/w,this.z=(c-s)/w,this.w=Math.acos((a+u+f-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,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},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,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).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,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),at.prototype=Object.assign(Object.create(Y.prototype),{constructor:at,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},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"})}}),st.prototype=Object.assign(Object.create(at.prototype),{constructor:st,isWebGLMultisampleRenderTarget:!0,copy:function(t){return at.prototype.copy.call(this,t),this.samples=t.samples,this}}),Object.assign(lt,{slerp:function(t,e,n,r){return n.copy(t).slerp(e,r)},slerpFlat:function(t,e,n,r,i,o,a){var s=n[r+0],l=n[r+1],c=n[r+2],u=n[r+3],h=i[o+0],d=i[o+1],p=i[o+2],f=i[o+3];if(u!==f||s!==h||l!==d||c!==p){var m=1-a,g=s*h+l*d+c*p+u*f,y=0<=g?1:-1,v=1-g*g;if(v>Number.EPSILON){var x=Math.sqrt(v),b=Math.atan2(x,g*y);m=Math.sin(m*b)/x,a=Math.sin(a*b)/x}var w=a*y;if(s=s*m+h*w,l=l*m+d*w,c=c*m+p*w,u=u*m+f*w,m===1-a){var M=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=M,l*=M,c*=M,u*=M}}t[e]=s,t[e+1]=l,t[e+2]=c,t[e+3]=u}}),Object.defineProperties(lt.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}}),Object.assign(lt.prototype,{isQuaternion:!0,set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this},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=t.w,this._onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,r=t._y,i=t._z,o=t.order,a=Math.cos,s=Math.sin,l=a(n/2),c=a(r/2),u=a(i/2),h=s(n/2),d=s(r/2),p=s(i/2);return"XYZ"===o?(this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p):"YXZ"===o?(this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p):"ZXY"===o?(this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p):"ZYX"===o?(this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p):"YZX"===o?(this._x=h*c*u+l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u-h*d*p):"XZY"===o&&(this._x=h*c*u-l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u+h*d*p),!1!==e&&this._onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],l=n[9],c=n[2],u=n[6],h=n[10],d=r+s+h;return 0<d?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(u-l)*e,this._y=(o-c)*e,this._z=(a-i)*e):s<r&&h<r?(e=2*Math.sqrt(1+r-s-h),this._w=(u-l)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(o+c)/e):h<s?(e=2*Math.sqrt(1+s-r-h),this._w=(o-c)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(l+u)/e):(e=2*Math.sqrt(1+h-r-s),this._w=(a-i)/e,this._x=(o+c)/e,this._y=(l+u)/e,this._z=.25*e),this._onChangeCallback(),this},setFromUnitVectors:function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0):(this._x=0,this._y=-t.z,this._z=t.y)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x),this._w=n,this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(Q.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;var r=Math.min(1,e/n);return this.slerp(t,r),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),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)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,r=t._y,i=t._z,o=t._w,a=e._x,s=e._y,l=e._z,c=e._w;return this._x=n*c+o*a+r*l-i*s,this._y=r*c+o*s+i*a-n*l,this._z=i*c+o*l+n*s-r*a,this._w=o*c-n*a-r*s-i*l,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*t._w+n*t._x+r*t._y+i*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),1<=a)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var l=1-e;return this._w=l*o+e*this._w,this._x=l*n+e*this._x,this._y=l*r+e*this._y,this._z=l*i+e*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),u=Math.atan2(c,a),h=Math.sin((1-e)*u)/c,d=Math.sin(e*u)/c;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=r*h+this._y*d,this._z=i*h+this._z*d,this._onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});var ct=new ht,ut=new lt;function ht(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}Object.assign(ht.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,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,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;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,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(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,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(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,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(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,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.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(ut.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(ut.setFromAxisAngle(t,e))},applyMatrix3:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements,o=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*o,this},applyQuaternion:function(t){var e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,a=t.z,s=t.w,l=s*e+o*r-a*n,c=s*n+a*e-i*r,u=s*r+i*n-o*e,h=-i*e-o*n-a*r;return this.x=l*s+h*-i+c*-a-u*-o,this.y=c*s+h*-o+u*-i-l*-a,this.z=u*s+h*-a+l*-o-c*-i,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 e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,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,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},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,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var n=t.x,r=t.y,i=t.z,o=e.x,a=e.y,s=e.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this},projectOnVector:function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)},projectOnPlane:function(t){return ct.copy(this).projectOnVector(t),this.sub(ct)},reflect:function(t){return this.sub(ct.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var n=this.dot(t)/e;return Math.acos(Q.clamp(n,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r},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,e,n){var r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},setFromMatrix3Column:function(t,e){return this.fromArray(t.elements,3*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}});var dt=new ht,pt=new xt,ft=new ht(0,0,0),mt=new ht(1,1,1),gt=new ht,yt=new ht,vt=new ht;function xt(){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.")}Object.assign(xt.prototype,{isMatrix4:!0,set:function(t,e,n,r,i,o,a,s,l,c,u,h,d,p,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=r,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,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 xt).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:function(t){var e=this.elements,n=t.elements,r=1/dt.setFromMatrixColumn(t,0).length(),i=1/dt.setFromMatrixColumn(t,1).length(),o=1/dt.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[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 e=this.elements,n=t.x,r=t.y,i=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===t.order){var h=o*c,d=o*u,p=a*c,f=a*u;e[0]=s*c,e[4]=-s*u,e[8]=l,e[1]=d+p*l,e[5]=h-f*l,e[9]=-a*s,e[2]=f-h*l,e[6]=p+d*l,e[10]=o*s}else if("YXZ"===t.order){var m=s*c,g=s*u,y=l*c,v=l*u;e[0]=m+v*a,e[4]=y*a-g,e[8]=o*l,e[1]=o*u,e[5]=o*c,e[9]=-a,e[2]=g*a-y,e[6]=v+m*a,e[10]=o*s}else if("ZXY"===t.order)m=s*c,g=s*u,y=l*c,v=l*u,e[0]=m-v*a,e[4]=-o*u,e[8]=y+g*a,e[1]=g+y*a,e[5]=o*c,e[9]=v-m*a,e[2]=-o*l,e[6]=a,e[10]=o*s;else if("ZYX"===t.order)h=o*c,d=o*u,p=a*c,f=a*u,e[0]=s*c,e[4]=p*l-d,e[8]=h*l+f,e[1]=s*u,e[5]=f*l+h,e[9]=d*l-p,e[2]=-l,e[6]=a*s,e[10]=o*s;else if("YZX"===t.order){var x=o*s,b=o*l,w=a*s,M=a*l;e[0]=s*c,e[4]=M-x*u,e[8]=w*u+b,e[1]=u,e[5]=o*c,e[9]=-a*c,e[2]=-l*c,e[6]=b*u+w,e[10]=x-M*u}else"XZY"===t.order&&(x=o*s,b=o*l,w=a*s,M=a*l,e[0]=s*c,e[4]=-u,e[8]=l*c,e[1]=x*u+M,e[5]=o*c,e[9]=b*u-w,e[2]=w*u-b,e[6]=a*c,e[10]=M*u+x);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(ft,t,mt)},lookAt:function(t,e,n){var r=this.elements;return vt.subVectors(t,e),0===vt.lengthSq()&&(vt.z=1),vt.normalize(),gt.crossVectors(n,vt),0===gt.lengthSq()&&(1===Math.abs(n.z)?vt.x+=1e-4:vt.z+=1e-4,vt.normalize(),gt.crossVectors(n,vt)),gt.normalize(),yt.crossVectors(vt,gt),r[0]=gt.x,r[4]=yt.x,r[8]=vt.x,r[1]=gt.y,r[5]=yt.y,r[9]=vt.y,r[2]=gt.z,r[6]=yt.z,r[10]=vt.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,r=e.elements,i=this.elements,o=n[0],a=n[4],s=n[8],l=n[12],c=n[1],u=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],y=n[3],v=n[7],x=n[11],b=n[15],w=r[0],M=r[4],_=r[8],C=r[12],S=r[1],T=r[5],E=r[9],D=r[13],A=r[2],O=r[6],P=r[10],L=r[14],R=r[3],I=r[7],k=r[11],F=r[15];return i[0]=o*w+a*S+s*A+l*R,i[4]=o*M+a*T+s*O+l*I,i[8]=o*_+a*E+s*P+l*k,i[12]=o*C+a*D+s*L+l*F,i[1]=c*w+u*S+h*A+d*R,i[5]=c*M+u*T+h*O+d*I,i[9]=c*_+u*E+h*P+d*k,i[13]=c*C+u*D+h*L+d*F,i[2]=p*w+f*S+m*A+g*R,i[6]=p*M+f*T+m*O+g*I,i[10]=p*_+f*E+m*P+g*k,i[14]=p*C+f*D+m*L+g*F,i[3]=y*w+v*S+x*A+b*R,i[7]=y*M+v*T+x*O+b*I,i[11]=y*_+v*E+x*P+b*k,i[15]=y*C+v*D+x*L+b*F,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],o=t[1],a=t[5],s=t[9],l=t[13],c=t[2],u=t[6],h=t[10],d=t[14];return t[3]*(i*s*u-r*l*u-i*a*h+n*l*h+r*a*d-n*s*d)+t[7]*(e*s*d-e*l*h+i*o*h-r*o*d+r*l*c-i*s*c)+t[11]*(e*l*u-e*a*d-i*o*u+n*o*d+i*a*c-n*l*c)+t[15]*(-r*a*c-e*s*u+e*a*h+r*o*u-n*o*h+n*s*c)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t,e,n){var r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this},getInverse:function(t,e){var n=this.elements,r=t.elements,i=r[0],o=r[1],a=r[2],s=r[3],l=r[4],c=r[5],u=r[6],h=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],y=r[13],v=r[14],x=r[15],b=p*v*h-y*f*h+y*u*m-c*v*m-p*u*x+c*f*x,w=g*f*h-d*v*h-g*u*m+l*v*m+d*u*x-l*f*x,M=d*y*h-g*p*h+g*c*m-l*y*m-d*c*x+l*p*x,_=g*p*u-d*y*u-g*c*f+l*y*f+d*c*v-l*p*v,C=i*b+o*w+a*M+s*_;if(0==C){var S="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(S);return console.warn(S),this.identity()}var T=1/C;return n[0]=b*T,n[1]=(y*f*s-p*v*s-y*a*m+o*v*m+p*a*x-o*f*x)*T,n[2]=(c*v*s-y*u*s+y*a*h-o*v*h-c*a*x+o*u*x)*T,n[3]=(p*u*s-c*f*s-p*a*h+o*f*h+c*a*m-o*u*m)*T,n[4]=w*T,n[5]=(d*v*s-g*f*s+g*a*m-i*v*m-d*a*x+i*f*x)*T,n[6]=(g*u*s-l*v*s-g*a*h+i*v*h+l*a*x-i*u*x)*T,n[7]=(l*f*s-d*u*s+d*a*h-i*f*h-l*a*m+i*u*m)*T,n[8]=M*T,n[9]=(g*p*s-d*y*s-g*o*m+i*y*m+d*o*x-i*p*x)*T,n[10]=(l*y*s-g*c*s+g*o*h-i*y*h-l*o*x+i*c*x)*T,n[11]=(d*c*s-l*p*s-d*o*h+i*p*h+l*o*m-i*c*m)*T,n[12]=_*T,n[13]=(d*y*a-g*p*a+g*o*f-i*y*f-d*o*v+i*p*v)*T,n[14]=(g*c*a-l*y*a-g*o*u+i*y*u+l*o*v-i*c*v)*T,n[15]=(l*p*a-d*c*a+d*o*u-i*p*u-l*o*f+i*c*f)*T,this},scale:function(t){var e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var n=Math.cos(e),r=Math.sin(e),i=1-n,o=t.x,a=t.y,s=t.z,l=i*o,c=i*a;return this.set(l*o+n,l*a-r*s,l*s+r*a,0,l*a+r*s,c*a+n,c*s-r*o,0,l*s-r*a,c*s+r*o,i*s*s+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){var r=this.elements,i=e._x,o=e._y,a=e._z,s=e._w,l=i+i,c=o+o,u=a+a,h=i*l,d=i*c,p=i*u,f=o*c,m=o*u,g=a*u,y=s*l,v=s*c,x=s*u,b=n.x,w=n.y,M=n.z;return r[0]=(1-(f+g))*b,r[1]=(d+x)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(d-x)*w,r[5]=(1-(h+g))*w,r[6]=(m+y)*w,r[7]=0,r[8]=(p+v)*M,r[9]=(m-y)*M,r[10]=(1-(h+f))*M,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this},decompose:function(t,e,n){var r=this.elements,i=dt.set(r[0],r[1],r[2]).length(),o=dt.set(r[4],r[5],r[6]).length(),a=dt.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],pt.copy(this);var s=1/i,l=1/o,c=1/a;return pt.elements[0]*=s,pt.elements[1]*=s,pt.elements[2]*=s,pt.elements[4]*=l,pt.elements[5]*=l,pt.elements[6]*=l,pt.elements[8]*=c,pt.elements[9]*=c,pt.elements[10]*=c,e.setFromRotationMatrix(pt),n.x=i,n.y=o,n.z=a,this},makePerspective:function(t,e,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(e-t),l=2*i/(n-r),c=(e+t)/(e-t),u=(n+r)/(n-r),h=-(o+i)/(o-i),d=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(t,e,n,r,i,o){var a=this.elements,s=1/(e-t),l=1/(n-r),c=1/(o-i),u=(e+t)*s,h=(n+r)*l,d=(o+i)*c;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(t){for(var e=this.elements,n=t.elements,r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}});var bt=new xt,wt=new lt;function Mt(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._order=r||Mt.DefaultOrder}function _t(){this.mask=1}Mt.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Mt.DefaultOrder="XYZ",Object.defineProperties(Mt.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}}),Object.assign(Mt.prototype,{isEuler:!0,set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._order=r||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var r=Q.clamp,i=t.elements,o=i[0],a=i[4],s=i[8],l=i[1],c=i[5],u=i[9],h=i[2],d=i[6],p=i[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,c),this._z=0)):"YXZ"===e?(this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o))):"ZYX"===e?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c))):"YZX"===e?(this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===e?(this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,n){return bt.makeRotationFromQuaternion(t),this.setFromRotationMatrix(bt,e,n)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return wt.setFromEuler(this),this.setFromQuaternion(wt,t)},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new ht(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(_t.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)}});var Ct=0,St=new ht,Tt=new lt,Et=new xt,Dt=new ht,At=new ht,Ot=new ht,Pt=new lt,Lt=new ht(1,0,0),Rt=new ht(0,1,0),It=new ht(0,0,1),kt={type:"added"},Ft={type:"removed"};function Bt(){Object.defineProperty(this,"id",{value:Ct++}),this.uuid=Q.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Bt.DefaultUp.clone();var t=new ht,e=new Mt,n=new lt,r=new ht(1,1,1);e._onChange(function(){n.setFromEuler(e,!1)}),n._onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new xt},normalMatrix:{value:new et}}),this.matrix=new xt,this.matrixWorld=new xt,this.matrixAutoUpdate=Bt.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new _t,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function jt(){Bt.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}))}Bt.DefaultUp=new ht(0,1,0),Bt.DefaultMatrixAutoUpdate=!0,Bt.prototype=Object.assign(Object.create(Y.prototype),{constructor:Bt,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,e){this.quaternion.setFromAxisAngle(t,e)},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,e){return Tt.setFromAxisAngle(t,e),this.quaternion.multiply(Tt),this},rotateOnWorldAxis:function(t,e){return Tt.setFromAxisAngle(t,e),this.quaternion.premultiply(Tt),this},rotateX:function(t){return this.rotateOnAxis(Lt,t)},rotateY:function(t){return this.rotateOnAxis(Rt,t)},rotateZ:function(t){return this.rotateOnAxis(It,t)},translateOnAxis:function(t,e){return St.copy(t).applyQuaternion(this.quaternion),this.position.add(St.multiplyScalar(e)),this},translateX:function(t){return this.translateOnAxis(Lt,t)},translateY:function(t){return this.translateOnAxis(Rt,t)},translateZ:function(t){return this.translateOnAxis(It,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(Et.getInverse(this.matrixWorld))},lookAt:function(t,e,n){t.isVector3?Dt.copy(t):Dt.set(t,e,n);var r=this.parent;this.updateWorldMatrix(!0,!1),At.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Et.lookAt(At,Dt,this.up):Et.lookAt(Dt,At,this.up),this.quaternion.setFromRotationMatrix(Et),r&&(Et.extractRotation(r.matrixWorld),Tt.setFromRotationMatrix(Et),this.quaternion.premultiply(Tt.inverse()))},add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);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(kt)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this},remove:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,this.children.splice(n,1),t.dispatchEvent(Ft)),this},attach:function(t){return this.updateWorldMatrix(!0,!1),Et.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Et.multiply(t.parent.matrixWorld)),t.applyMatrix4(Et),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,e){if(this[t]===e)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(t,e);if(void 0!==i)return i}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new ht),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 lt),this.updateMatrixWorld(!0),this.matrixWorld.decompose(At,t,Ot),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new ht),this.updateMatrixWorld(!0),this.matrixWorld.decompose(At,Pt,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new ht),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.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 e=this.children,n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var r=this.children,i=0,o=r.length;i<o;i++)r[i].updateWorldMatrix(!1,!0)},toJSON:function(t){var e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){r.geometry=i(t.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var a=o.shapes;if(Array.isArray(a))for(var s=0,l=a.length;s<l;s++){var c=a[s];i(t.shapes,c)}else i(t.shapes,a)}}if(void 0!==this.material)if(Array.isArray(this.material)){var u=[];for(s=0,l=this.material.length;s<l;s++)u.push(i(t.materials,this.material[s]));r.material=u}else r.material=i(t.materials,this.material);if(0<this.children.length)for(r.children=[],s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(t).object);if(e){var h=m(t.geometries),d=m(t.materials),p=m(t.textures),f=m(t.images);a=m(t.shapes),0<h.length&&(n.geometries=h),0<d.length&&(n.materials=d),0<p.length&&(n.textures=p),0<f.length&&(n.images=f),0<a.length&&(n.shapes=a)}return n.object=r,n;function m(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!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===e)for(var n=0;n<t.children.length;n++){var r=t.children[n];this.add(r.clone())}return this}}),jt.prototype=Object.assign(Object.create(Bt.prototype),{constructor:jt,isScene:!0,copy:function(t,e){return Bt.prototype.copy.call(this,t,e),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},toJSON:function(t){var e=Bt.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Nt=[new ht,new ht,new ht,new ht,new ht,new ht,new ht,new ht],zt=new ht,Vt=new Kt,Gt=new ht,Ht=new ht,Ut=new ht,Wt=new ht,Jt=new ht,qt=new ht,Xt=new ht,Yt=new ht,Zt=new ht,$t=new ht;function Kt(t,e){this.min=void 0!==t?t:new ht(1/0,1/0,1/0),this.max=void 0!==e?e:new ht(-1/0,-1/0,-1/0)}function Qt(t,e,n,r,i){var o,a;for(o=0,a=t.length-3;o<=a;o+=3){$t.fromArray(t,o);var s=i.x*Math.abs($t.x)+i.y*Math.abs($t.y)+i.z*Math.abs($t.z),l=e.dot($t),c=n.dot($t),u=r.dot($t);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}Object.assign(Kt.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,l=t.length;s<l;s+=3){var c=t[s],u=t[s+1],h=t[s+2];c<e&&(e=c),u<n&&(n=u),h<r&&(r=h),i<c&&(i=c),o<u&&(o=u),a<h&&(a=h)}return this.min.set(e,n,r),this.max.set(i,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,l=t.count;s<l;s++){var c=t.getX(s),u=t.getY(s),h=t.getZ(s);c<e&&(e=c),u<n&&(n=u),h<r&&(r=h),i<c&&(i=c),o<u&&(o=u),a<h&&(a=h)}return this.min.set(e,n,r),this.max.set(i,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){var n=zt.copy(e).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 ht),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 ht),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 e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),Vt.copy(e.boundingBox),Vt.applyMatrix4(t.matrixWorld),this.expandByPoint(Vt.min),this.expandByPoint(Vt.max));for(var n=t.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);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,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new ht),e.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,zt),zt.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var e,n;return n=0<t.normal.x?(e=t.normal.x*this.min.x,t.normal.x*this.max.x):(e=t.normal.x*this.max.x,t.normal.x*this.min.x),0<t.normal.y?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),0<t.normal.z?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(Xt),Yt.subVectors(this.max,Xt),Gt.subVectors(t.a,Xt),Ht.subVectors(t.b,Xt),Ut.subVectors(t.c,Xt),Wt.subVectors(Ht,Gt),Jt.subVectors(Ut,Ht),qt.subVectors(Gt,Ut);var e=[0,-Wt.z,Wt.y,0,-Jt.z,Jt.y,0,-qt.z,qt.y,Wt.z,0,-Wt.x,Jt.z,0,-Jt.x,qt.z,0,-qt.x,-Wt.y,Wt.x,0,-Jt.y,Jt.x,0,-qt.y,qt.x,0];return!!Qt(e,Gt,Ht,Ut,Yt)&&!!Qt(e=[1,0,0,0,1,0,0,0,1],Gt,Ht,Ut,Yt)&&(Zt.crossVectors(Wt,Jt),Qt(e=[Zt.x,Zt.y,Zt.z],Gt,Ht,Ut,Yt))},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new ht),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return zt.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(zt).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()||(Nt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Nt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Nt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Nt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Nt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Nt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Nt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Nt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Nt)),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 te=new Kt;function ee(t,e){this.center=void 0!==t?t:new ht,this.radius=void 0!==e?e:0}Object.assign(ee.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){var n=this.center;void 0!==e?n.copy(e):te.setFromPoints(t).getCenter(n);for(var r=0,i=0,o=t.length;i<o;i++)r=Math.max(r,n.distanceToSquared(t[i]));return this.radius=Math.sqrt(r),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 e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new ht),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new Kt),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 ne=new ht,re=new ht,ie=new ht,oe=new ht,ae=new ht,se=new ht,le=new ht;function ce(t,e){this.origin=void 0!==t?t:new ht,this.direction=void 0!==e?e:new ht(0,0,-1)}Object.assign(ce.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),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,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new ht),e.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,ne)),this},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new ht),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var e=ne.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ne.copy(this.direction).multiplyScalar(e).add(this.origin),ne.distanceToSquared(t))},distanceSqToSegment:function(t,e,n,r){re.copy(t).add(e).multiplyScalar(.5),ie.copy(e).sub(t).normalize(),oe.copy(this.origin).sub(re);var i,o,a,s,l=.5*t.distanceTo(e),c=-this.direction.dot(ie),u=oe.dot(this.direction),h=-oe.dot(ie),d=oe.lengthSq(),p=Math.abs(1-c*c);if(0<p)if(o=c*u-h,s=l*p,0<=(i=c*h-u))if(-s<=o)if(o<=s){var f=1/p;a=(i*=f)*(i+c*(o*=f)+2*u)+o*(c*i+o+2*h)+d}else o=l,a=-(i=Math.max(0,-(c*o+u)))*i+o*(o+2*h)+d;else o=-l,a=-(i=Math.max(0,-(c*o+u)))*i+o*(o+2*h)+d;else a=o<=-s?-(i=Math.max(0,-(-c*l+u)))*i+(o=0<i?-l:Math.min(Math.max(-l,-h),l))*(o+2*h)+d:o<=s?(i=0,(o=Math.min(Math.max(-l,-h),l))*(o+2*h)+d):-(i=Math.max(0,-(c*l+u)))*i+(o=0<i?l:Math.min(Math.max(-l,-h),l))*(o+2*h)+d;else o=0<c?-l:l,a=-(i=Math.max(0,-(c*o+u)))*i+o*(o+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(ie).multiplyScalar(o).add(re),a},intersectSphere:function(t,e){ne.subVectors(t.center,this.origin);var n=ne.dot(this.direction),r=ne.dot(ne)-n*n,i=t.radius*t.radius;if(i<r)return null;var o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,e):this.at(a,e)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return 0<=n?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,r,i,o,a,s,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return r=0<=l?(n=(t.min.x-h.x)*l,(t.max.x-h.x)*l):(n=(t.max.x-h.x)*l,(t.min.x-h.x)*l),(o=0<=c?(i=(t.min.y-h.y)*c,(t.max.y-h.y)*c):(i=(t.max.y-h.y)*c,(t.min.y-h.y)*c))<n||r<i?null:((n<i||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),(s=0<=u?(a=(t.min.z-h.z)*u,(t.max.z-h.z)*u):(a=(t.max.z-h.z)*u,(t.min.z-h.z)*u))<n||r<a?null:((n<a||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0?null:this.at(0<=n?n:r,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,ne)},intersectTriangle:function(t,e,n,r,i){ae.subVectors(e,t),se.subVectors(n,t),le.crossVectors(ae,se);var o,a=this.direction.dot(le);if(0<a){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}oe.subVectors(this.origin,t);var s=o*this.direction.dot(se.crossVectors(oe,se));if(s<0)return null;var l=o*this.direction.dot(ae.cross(oe));if(l<0)return null;if(a<s+l)return null;var c=-o*oe.dot(le);return c<0?null:this.at(c/a,i)},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)}});var ue=new ht,he=new ht,de=new et;function pe(t,e){this.normal=void 0!==t?t:new ht(1,0,0),this.constant=void 0!==e?e:0}Object.assign(pe.prototype,{isPlane:!0,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(t,e,n){var r=ue.subVectors(n,e).cross(he.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,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,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new ht),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new ht);var n=t.delta(ue),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;var i=-(t.start.dot(this.normal)+this.constant)/r;return i<0||1<i?void 0:e.copy(n).multiplyScalar(i).add(t.start)},intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&0<n||n<0&&0<e},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 ht),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){var n=e||de.getNormalMatrix(t),r=this.coplanarPoint(ue).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),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 fe=new ht,me=new ht,ge=new ht,ye=new ht,ve=new ht,xe=new ht,be=new ht,we=new ht,Me=new ht,_e=new ht;function Ce(t,e,n){this.a=void 0!==t?t:new ht,this.b=void 0!==e?e:new ht,this.c=void 0!==n?n:new ht}Object.assign(Ce,{getNormal:function(t,e,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new ht),r.subVectors(n,e),fe.subVectors(t,e),r.cross(fe);var i=r.lengthSq();return 0<i?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},getBarycoord:function(t,e,n,r,i){fe.subVectors(r,e),me.subVectors(n,e),ge.subVectors(t,e);var o=fe.dot(fe),a=fe.dot(me),s=fe.dot(ge),l=me.dot(me),c=me.dot(ge),u=o*l-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new ht),0==u)return i.set(-2,-1,-1);var h=1/u,d=(l*s-a*c)*h,p=(o*c-a*s)*h;return i.set(1-d-p,p,d)},containsPoint:function(t,e,n,r){return Ce.getBarycoord(t,e,n,r,ye),0<=ye.x&&0<=ye.y&&ye.x+ye.y<=1},getUV:function(t,e,n,r,i,o,a,s){return this.getBarycoord(t,e,n,r,ye),s.set(0,0),s.addScaledVector(i,ye.x),s.addScaledVector(o,ye.y),s.addScaledVector(a,ye.z),s},isFrontFacing:function(t,e,n,r){return fe.subVectors(n,e),me.subVectors(t,e),fe.cross(me).dot(r)<0}}),Object.assign(Ce.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),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 fe.subVectors(this.c,this.b),me.subVectors(this.a,this.b),.5*fe.cross(me).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new ht),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return Ce.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 pe),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return Ce.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,n,r,i){return Ce.getUV(t,this.a,this.b,this.c,e,n,r,i)},containsPoint:function(t){return Ce.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return Ce.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new ht);var n,r,i=this.a,o=this.b,a=this.c;ve.subVectors(o,i),xe.subVectors(a,i),we.subVectors(t,i);var s=ve.dot(we),l=xe.dot(we);if(s<=0&&l<=0)return e.copy(i);Me.subVectors(t,o);var c=ve.dot(Me),u=xe.dot(Me);if(0<=c&&u<=c)return e.copy(o);var h=s*u-c*l;if(h<=0&&0<=s&&c<=0)return n=s/(s-c),e.copy(i).addScaledVector(ve,n);_e.subVectors(t,a);var d=ve.dot(_e),p=xe.dot(_e);if(0<=p&&d<=p)return e.copy(a);var f=d*l-s*p;if(f<=0&&0<=l&&p<=0)return r=l/(l-p),e.copy(i).addScaledVector(xe,r);var m=c*p-d*u;if(m<=0&&0<=u-c&&0<=d-p)return be.subVectors(a,o),r=(u-c)/(u-c+(d-p)),e.copy(o).addScaledVector(be,r);var g=1/(m+f+h);return n=f*g,r=h*g,e.copy(i).addScaledVector(ve,n).addScaledVector(xe,r)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});var Se={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},Te={h:0,s:0,l:0},Ee={h:0,s:0,l:0};function De(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}function Ae(t,e,n){return n<0&&(n+=1),1<n&&--n,n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function Oe(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Pe(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Le(t,e,n,r,i,o){this.a=t,this.b=e,this.c=n,this.normal=r&&r.isVector3?r:new ht,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new De,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==o?o:0}Object.assign(De.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,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(t,e,n){if(t=Q.euclideanModulo(t,1),e=Q.clamp(e,0,1),n=Q.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=Ae(i,r,t+1/3),this.g=Ae(i,r,t),this.b=Ae(i,r,t-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var r,i=n[1],o=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,e(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,e(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,l=parseInt(r[3],10)/100;return e(r[5]),this.setHSL(a,s,l)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var c=n[1],u=c.length;if(3===u)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return t&&0<t.length?this.setColorName(t):this},setColorName:function(t){var e=Se[t];return void 0!==e?this.setHex(e):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,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=0<e?1/e: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=Oe(t.r),this.g=Oe(t.g),this.b=Oe(t.b),this},copyLinearToSRGB:function(t){return this.r=Pe(t.r),this.g=Pe(t.g),this.b=Pe(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 e,n,r=this.r,i=this.g,o=this.b,a=Math.max(r,i,o),s=Math.min(r,i,o),l=(s+a)/2;if(s===a)n=e=0;else{var c=a-s;switch(n=l<=.5?c/(a+s):c/(2-a-s),a){case r:e=(i-o)/c+(i<o?6:0);break;case i:e=(o-r)/c+2;break;case o:e=(r-i)/c+4}e/=6}return t.h=e,t.s=n,t.l=l,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,n){return this.getHSL(Te),Te.h+=t,Te.s+=e,Te.l+=n,this.setHSL(Te.h,Te.s,Te.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.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,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:function(t,e){this.getHSL(Te),t.getHSL(Ee);var n=Q.lerp(Te.h,Ee.h,e),r=Q.lerp(Te.s,Ee.s,e),i=Q.lerp(Te.l,Ee.l,e);return this.setHSL(n,r,i),this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}}),De.NAMES=Se,Object.assign(Le.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 e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});var Re=0;function Ie(){Object.defineProperty(this,"id",{value:Re++}),this.uuid=Q.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=0,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=e,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=J,this.stencilZFail=J,this.stencilZPass=J,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 ke(t){Ie.call(this),this.type="MeshBasicMaterial",this.color=new De(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=0,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)}Ie.prototype=Object.assign(Object.create(Y.prototype),{constructor:Ie,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),0!==this.side&&(n.side=this.side),0!==this.vertexColors&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),0<this.alphaTest&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),1<this.wireframeLinewidth&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var i=r(t.textures),o=r(t.images);0<i.length&&(n.textures=i),0<o.length&&(n.images=o)}return n},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.vertexTangents=t.vertexTangents,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 e=t.clippingPlanes,n=null;if(null!==e){var r=e.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,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(Ie.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),((ke.prototype=Object.create(Ie.prototype)).constructor=ke).prototype.isMeshBasicMaterial=!0,ke.prototype.copy=function(t){return Ie.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 Fe=new ht;function Be(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=q,this.updateRange={offset:0,count:-1},this.version=0}function je(t,e,n){Be.call(this,new Int8Array(t),e,n)}function Ne(t,e,n){Be.call(this,new Uint8Array(t),e,n)}function ze(t,e,n){Be.call(this,new Uint8ClampedArray(t),e,n)}function Ve(t,e,n){Be.call(this,new Int16Array(t),e,n)}function Ge(t,e,n){Be.call(this,new Uint16Array(t),e,n)}function He(t,e,n){Be.call(this,new Int32Array(t),e,n)}function Ue(t,e,n){Be.call(this,new Uint32Array(t),e,n)}function We(t,e,n){Be.call(this,new Float32Array(t),e,n)}function Je(t,e,n){Be.call(this,new Float64Array(t),e,n)}function qe(){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 Xe(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,r=t.length;n<r;++n)t[n]>e&&(e=t[n]);return e}Object.defineProperty(Be.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Be.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,e,n){t*=this.itemSize,n*=e.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[t+r]=e.array[n+r];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),o=new De),e[n++]=o.r,e[n++]=o.g,e[n++]=o.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new tt),e[n++]=o.x,e[n++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),o=new ht),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new ot),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.w}return this},applyMatrix3:function(t){for(var e=0,n=this.count;e<n;e++)Fe.x=this.getX(e),Fe.y=this.getY(e),Fe.z=this.getZ(e),Fe.applyMatrix3(t),this.setXYZ(e,Fe.x,Fe.y,Fe.z);return this},applyMatrix4:function(t){for(var e=0,n=this.count;e<n;e++)Fe.x=this.getX(e),Fe.y=this.getY(e),Fe.z=this.getZ(e),Fe.applyMatrix4(t),this.setXYZ(e,Fe.x,Fe.y,Fe.z);return this},applyNormalMatrix:function(t){for(var e=0,n=this.count;e<n;e++)Fe.x=this.getX(e),Fe.y=this.getY(e),Fe.z=this.getZ(e),Fe.applyNormalMatrix(t),this.setXYZ(e,Fe.x,Fe.y,Fe.z);return this},transformDirection:function(t){for(var e=0,n=this.count;e<n;e++)Fe.x=this.getX(e),Fe.y=this.getY(e),Fe.z=this.getZ(e),Fe.transformDirection(t),this.setXYZ(e,Fe.x,Fe.y,Fe.z);return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.itemSize<3?0:this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this},setXYZW:function(t,e,n,r,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=i,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),(je.prototype=Object.create(Be.prototype)).constructor=je,(Ne.prototype=Object.create(Be.prototype)).constructor=Ne,(ze.prototype=Object.create(Be.prototype)).constructor=ze,(Ve.prototype=Object.create(Be.prototype)).constructor=Ve,(Ge.prototype=Object.create(Be.prototype)).constructor=Ge,(He.prototype=Object.create(Be.prototype)).constructor=He,(Ue.prototype=Object.create(Be.prototype)).constructor=Ue,(We.prototype=Object.create(Be.prototype)).constructor=We,(Je.prototype=Object.create(Be.prototype)).constructor=Je,Object.assign(qe.prototype,{computeGroups:function(t){for(var e,n=[],r=void 0,i=t.faces,o=0;o<i.length;o++){var a=i[o];a.materialIndex!==r&&(r=a.materialIndex,void 0!==e&&(e.count=3*o-e.start,n.push(e)),e={start:3*o,materialIndex:r})}void 0!==e&&(e.count=3*o-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,r=t.vertices,i=t.faceVertexUvs,o=i[0]&&0<i[0].length,a=i[1]&&0<i[1].length,s=t.morphTargets,l=s.length;if(0<l){e=[];for(var c=0;c<l;c++)e[c]={name:s[c].name,data:[]};this.morphTargets.position=e}var u,h=t.morphNormals,d=h.length;if(0<d){for(u=[],c=0;c<d;c++)u[c]={name:h[c].name,data:[]};this.morphTargets.normal=u}var p=t.skinIndices,f=t.skinWeights,m=p.length===r.length,g=f.length===r.length;for(0<r.length&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported."),c=0;c<n.length;c++){var y=n[c];this.vertices.push(r[y.a],r[y.b],r[y.c]);var v=y.vertexNormals;if(3===v.length)this.normals.push(v[0],v[1],v[2]);else{var x=y.normal;this.normals.push(x,x,x)}var b,w=y.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var M=y.color;this.colors.push(M,M,M)}!0===o&&(void 0!==(b=i[0][c])?this.uvs.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",c),this.uvs.push(new tt,new tt,new tt))),!0===a&&(void 0!==(b=i[1][c])?this.uvs2.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",c),this.uvs2.push(new tt,new tt,new tt)));for(var _=0;_<l;_++){var C=s[_].vertices;e[_].data.push(C[y.a],C[y.b],C[y.c])}for(_=0;_<d;_++){var S=h[_].vertexNormals[c];u[_].data.push(S.a,S.b,S.c)}m&&this.skinIndices.push(p[y.a],p[y.b],p[y.c]),g&&this.skinWeights.push(f[y.a],f[y.b],f[y.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 Ye=2147483647,Ze=new xt,$e=new Bt,Ke=new ht,Qe=new Kt,tn=new Kt,en=new ht;function nn(){Object.defineProperty(this,"id",{value:Ye+=2}),this.uuid=Q.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={}}nn.prototype=Object.assign(Object.create(Y.prototype),{constructor:nn,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<Xe(t)?Ue:Ge)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new et).getNormalMatrix(t);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return Ze.makeRotationX(t),this.applyMatrix4(Ze),this},rotateY:function(t){return Ze.makeRotationY(t),this.applyMatrix4(Ze),this},rotateZ:function(t){return Ze.makeRotationZ(t),this.applyMatrix4(Ze),this},translate:function(t,e,n){return Ze.makeTranslation(t,e,n),this.applyMatrix4(Ze),this},scale:function(t,e,n){return Ze.makeScale(t,e,n),this.applyMatrix4(Ze),this},lookAt:function(t){return $e.lookAt(t),$e.updateMatrix(),this.applyMatrix4($e.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ke).negate(),this.translate(Ke.x,Ke.y,Ke.z),this},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new We(3*e.vertices.length,3),r=new We(3*e.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(e.vertices)),this.setAttribute("color",r.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var i=new We(e.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];e.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new We(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(n.vertices),e.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(n.normals),e.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(n.colors),e.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(n.uvs),e.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(n.lineDistances),e.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new qe).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.setAttribute("position",new Be(e,3).copyVector3sArray(t.vertices)),0<t.normals.length){var n=new Float32Array(3*t.normals.length);this.setAttribute("normal",new Be(n,3).copyVector3sArray(t.normals))}if(0<t.colors.length){var r=new Float32Array(3*t.colors.length);this.setAttribute("color",new Be(r,3).copyColorsArray(t.colors))}if(0<t.uvs.length){var i=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new Be(i,2).copyVector2sArray(t.uvs))}if(0<t.uvs2.length){var o=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new Be(o,2).copyVector2sArray(t.uvs2))}for(var a in this.groups=t.groups,t.morphTargets){for(var s=[],l=t.morphTargets[a],c=0,u=l.length;c<u;c++){var h=l[c],d=new We(3*h.data.length,3);d.name=h.name,s.push(d.copyVector3sArray(h.data))}this.morphAttributes[a]=s}if(0<t.skinIndices.length){var p=new We(4*t.skinIndices.length,4);this.setAttribute("skinIndex",p.copyVector4sArray(t.skinIndices))}if(0<t.skinWeights.length){var f=new We(4*t.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Kt);var t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var n=0,r=e.length;n<r;n++){var i=e[n];Qe.setFromBufferAttribute(i),this.morphTargetsRelative?(en.addVectors(this.boundingBox.min,Qe.min),this.boundingBox.expandByPoint(en),en.addVectors(this.boundingBox.max,Qe.max),this.boundingBox.expandByPoint(en)):(this.boundingBox.expandByPoint(Qe.min),this.boundingBox.expandByPoint(Qe.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new ee);var t=this.attributes.position,e=this.morphAttributes.position;if(t){var n=this.boundingSphere.center;if(Qe.setFromBufferAttribute(t),e)for(var r=0,i=e.length;r<i;r++){var o=e[r];tn.setFromBufferAttribute(o),this.morphTargetsRelative?(en.addVectors(Qe.min,tn.min),Qe.expandByPoint(en),en.addVectors(Qe.max,tn.max),Qe.expandByPoint(en)):(Qe.expandByPoint(tn.min),Qe.expandByPoint(tn.max))}Qe.getCenter(n);var a=0;for(r=0,i=t.count;r<i;r++)en.fromBufferAttribute(t,r),a=Math.max(a,n.distanceToSquared(en));if(e)for(r=0,i=e.length;r<i;r++){o=e[r];for(var s=this.morphTargetsRelative,l=0,c=o.count;l<c;l++)en.fromBufferAttribute(o,l),s&&(Ke.fromBufferAttribute(t,l),en.add(Ke)),a=Math.max(a,n.distanceToSquared(en))}this.boundingSphere.radius=Math.sqrt(a),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,e=this.attributes;if(e.position){var n=e.position.array;if(void 0===e.normal)this.setAttribute("normal",new Be(new Float32Array(n.length),3));else for(var r=e.normal.array,i=0,o=r.length;i<o;i++)r[i]=0;var a,s,l,c=e.normal.array,u=new ht,h=new ht,d=new ht,p=new ht,f=new ht;if(t){var m=t.array;for(i=0,o=t.count;i<o;i+=3)a=3*m[i+0],s=3*m[i+1],l=3*m[i+2],u.fromArray(n,a),h.fromArray(n,s),d.fromArray(n,l),p.subVectors(d,h),f.subVectors(u,h),p.cross(f),c[a]+=p.x,c[1+a]+=p.y,c[2+a]+=p.z,c[s]+=p.x,c[1+s]+=p.y,c[2+s]+=p.z,c[l]+=p.x,c[1+l]+=p.y,c[2+l]+=p.z}else for(i=0,o=n.length;i<o;i+=9)u.fromArray(n,i),h.fromArray(n,i+3),d.fromArray(n,i+6),p.subVectors(d,h),f.subVectors(u,h),p.cross(f),c[i]=p.x,c[i+1]=p.y,c[i+2]=p.z,c[i+3]=p.x,c[i+4]=p.y,c[i+5]=p.z,c[i+6]=p.x,c[i+7]=p.y,c[i+8]=p.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(void 0!==t.attributes[r])for(var i=n[r].array,o=t.attributes[r],a=o.array,s=o.itemSize*e,l=Math.min(a.length,i.length-s),c=0,u=s;c<l;c++,u++)i[u]=a[c];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){for(var t=this.attributes.normal,e=0,n=t.count;e<n;e++)en.x=t.getX(e),en.y=t.getY(e),en.z=t.getZ(e),en.normalize(),t.setXYZ(e,en.x,en.y,en.z)},toNonIndexed:function(){function t(t,e){for(var n=t.array,r=t.itemSize,i=new n.constructor(e.length*r),o=0,a=0,s=0,l=e.length;s<l;s++){o=e[s]*r;for(var c=0;c<r;c++)i[a++]=n[o++]}return new Be(i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new nn,n=this.index.array,r=this.attributes;for(var i in r){var o=t(r[i],n);e.setAttribute(i,o)}var a=this.morphAttributes;for(i in a){for(var s=[],l=a[i],c=0,u=l.length;c<u;c++)o=t(l[c],n),s.push(o);e.morphAttributes[i]=s}e.morphTargetsRelative=this.morphTargetsRelative;for(var h=this.groups,d=(c=0,h.length);c<d;c++){var p=h[c];e.addGroup(p.start,p.count,p.materialIndex)}return e},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),0<Object.keys(this.userData).length&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var r=this.index;null!==r&&(t.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var n in i){var o=(d=i[n]).toJSON();""!==d.name&&(o.name=d.name),t.data.attributes[n]=o}var a={},s=!1;for(var n in this.morphAttributes){for(var l=this.morphAttributes[n],c=[],u=0,h=l.length;u<h;u++){var d;o=(d=l[u]).toJSON(),""!==d.name&&(o.name=d.name),c.push(o)}0<c.length&&(a[n]=c,s=!0)}s&&(t.data.morphAttributes=a,t.data.morphTargetsRelative=this.morphTargetsRelative);var p=this.groups;0<p.length&&(t.data.groups=JSON.parse(JSON.stringify(p)));var f=this.boundingSphere;return null!==f&&(t.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),t},clone:function(){return(new nn).copy(this)},copy:function(t){var e,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var i=t.index;null!==i&&this.setIndex(i.clone());var o=t.attributes;for(e in o){var a=o[e];this.setAttribute(e,a.clone())}var s=t.morphAttributes;for(e in s){var l=[],c=s[e];for(n=0,r=c.length;n<r;n++)l.push(c[n].clone());this.morphAttributes[e]=l}this.morphTargetsRelative=t.morphTargetsRelative;var u=t.groups;for(n=0,r=u.length;n<r;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var d=t.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=t.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var rn=new xt,on=new ce,an=new ee,sn=new ht,ln=new ht,cn=new ht,un=new ht,hn=new ht,dn=new ht,pn=new ht,fn=new ht,mn=new ht,gn=new tt,yn=new tt,vn=new tt,xn=new ht,bn=new ht;function wn(t,e){Bt.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new nn,this.material=void 0!==e?e:new ke,this.updateMorphTargets()}function Mn(t,e,n,r,i,o,a,s){if(null===(1===e.side?r.intersectTriangle(a,o,i,!0,s):r.intersectTriangle(i,o,a,2!==e.side,s)))return null;bn.copy(s),bn.applyMatrix4(t.matrixWorld);var l=n.ray.origin.distanceTo(bn);return l<n.near||l>n.far?null:{distance:l,point:bn.clone(),object:t}}function _n(t,e,n,r,i,o,a,s,l,c,u,h){sn.fromBufferAttribute(i,c),ln.fromBufferAttribute(i,u),cn.fromBufferAttribute(i,h);var d=t.morphTargetInfluences;if(e.morphTargets&&o&&d){pn.set(0,0,0),fn.set(0,0,0),mn.set(0,0,0);for(var p=0,f=o.length;p<f;p++){var m=d[p],g=o[p];0!==m&&(un.fromBufferAttribute(g,c),hn.fromBufferAttribute(g,u),dn.fromBufferAttribute(g,h),a?(pn.addScaledVector(un,m),fn.addScaledVector(hn,m),mn.addScaledVector(dn,m)):(pn.addScaledVector(un.sub(sn),m),fn.addScaledVector(hn.sub(ln),m),mn.addScaledVector(dn.sub(cn),m)))}sn.add(pn),ln.add(fn),cn.add(mn)}var y=Mn(t,e,n,r,sn,ln,cn,xn);if(y){s&&(gn.fromBufferAttribute(s,c),yn.fromBufferAttribute(s,u),vn.fromBufferAttribute(s,h),y.uv=Ce.getUV(xn,sn,ln,cn,gn,yn,vn,new tt)),l&&(gn.fromBufferAttribute(l,c),yn.fromBufferAttribute(l,u),vn.fromBufferAttribute(l,h),y.uv2=Ce.getUV(xn,sn,ln,cn,gn,yn,vn,new tt));var v=new Le(c,u,h);Ce.getNormal(sn,ln,cn,v.normal),y.face=v}return y}wn.prototype=Object.assign(Object.create(Bt.prototype),{constructor:wn,isMesh:!0,copy:function(t){return Bt.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,e,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,o=Object.keys(i);if(0<o.length){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t<e;t++)n=a[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=r.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){var n,r=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),an.copy(r.boundingSphere),an.applyMatrix4(o),!1!==t.ray.intersectsSphere(an)&&(rn.getInverse(o),on.copy(t.ray).applyMatrix4(rn),null===r.boundingBox||!1!==on.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var a,s,l,c,u,h,d,p,f,m=r.index,g=r.attributes.position,y=r.morphAttributes.position,v=r.morphTargetsRelative,x=r.attributes.uv,b=r.attributes.uv2,w=r.groups,M=r.drawRange;if(null!==m)if(Array.isArray(i))for(c=0,h=w.length;c<h;c++)for(f=i[(p=w[c]).materialIndex],u=Math.max(p.start,M.start),d=Math.min(p.start+p.count,M.start+M.count);u<d;u+=3)a=m.getX(u),s=m.getX(u+1),l=m.getX(u+2),(n=_n(this,f,t,on,g,y,v,x,b,a,s,l))&&(n.faceIndex=Math.floor(u/3),n.face.materialIndex=p.materialIndex,e.push(n));else for(c=Math.max(0,M.start),h=Math.min(m.count,M.start+M.count);c<h;c+=3)a=m.getX(c),s=m.getX(c+1),l=m.getX(c+2),(n=_n(this,i,t,on,g,y,v,x,b,a,s,l))&&(n.faceIndex=Math.floor(c/3),e.push(n));else if(void 0!==g)if(Array.isArray(i))for(c=0,h=w.length;c<h;c++)for(f=i[(p=w[c]).materialIndex],u=Math.max(p.start,M.start),d=Math.min(p.start+p.count,M.start+M.count);u<d;u+=3)(n=_n(this,f,t,on,g,y,v,x,b,a=u,s=u+1,l=u+2))&&(n.faceIndex=Math.floor(u/3),n.face.materialIndex=p.materialIndex,e.push(n));else for(c=Math.max(0,M.start),h=Math.min(g.count,M.start+M.count);c<h;c+=3)(n=_n(this,i,t,on,g,y,v,x,b,a=c,s=c+1,l=c+2))&&(n.faceIndex=Math.floor(c/3),e.push(n))}else if(r.isGeometry){var _,C,S,T,E=Array.isArray(i),D=r.vertices,A=r.faces,O=r.faceVertexUvs[0];0<O.length&&(T=O);for(var P=0,L=A.length;P<L;P++){var R=A[P],I=E?i[R.materialIndex]:i;if(void 0!==I&&(_=D[R.a],C=D[R.b],S=D[R.c],n=Mn(this,I,t,on,_,C,S,xn))){if(T&&T[P]){var k=T[P];gn.copy(k[0]),yn.copy(k[1]),vn.copy(k[2]),n.uv=Ce.getUV(xn,_,C,S,gn,yn,vn,new tt)}n.face=R,n.faceIndex=P,e.push(n)}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Cn=0,Sn=new xt,Tn=new Bt,En=new ht;function Dn(){Object.defineProperty(this,"id",{value:Cn+=2}),this.uuid=Q.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}Dn.prototype=Object.assign(Object.create(Y.prototype),{constructor:Dn,isGeometry:!0,applyMatrix4:function(t){for(var e=(new et).getNormalMatrix(t),n=0,r=this.vertices.length;n<r;n++)this.vertices[n].applyMatrix4(t);for(n=0,r=this.faces.length;n<r;n++){var i=this.faces[n];i.normal.applyMatrix3(e).normalize();for(var o=0,a=i.vertexNormals.length;o<a;o++)i.vertexNormals[o].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(t){return Sn.makeRotationX(t),this.applyMatrix4(Sn),this},rotateY:function(t){return Sn.makeRotationY(t),this.applyMatrix4(Sn),this},rotateZ:function(t){return Sn.makeRotationZ(t),this.applyMatrix4(Sn),this},translate:function(t,e,n){return Sn.makeTranslation(t,e,n),this.applyMatrix4(Sn),this},scale:function(t,e,n){return Sn.makeScale(t,e,n),this.applyMatrix4(Sn),this},lookAt:function(t){return Tn.lookAt(t),Tn.updateMatrix(),this.applyMatrix4(Tn.matrix),this},fromBufferGeometry:function(t){var e=this,n=null!==t.index?t.index.array:void 0,r=t.attributes;if(void 0===r.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var i=r.position.array,o=void 0!==r.normal?r.normal.array:void 0,a=void 0!==r.color?r.color.array:void 0,s=void 0!==r.uv?r.uv.array:void 0,l=void 0!==r.uv2?r.uv2.array:void 0;void 0!==l&&(this.faceVertexUvs[1]=[]);for(var c=0;c<i.length;c+=3)e.vertices.push((new ht).fromArray(i,c)),void 0!==a&&e.colors.push((new De).fromArray(a,c));function u(t,n,r,i){var c=void 0===a?[]:[e.colors[t].clone(),e.colors[n].clone(),e.colors[r].clone()],u=new Le(t,n,r,void 0===o?[]:[(new ht).fromArray(o,3*t),(new ht).fromArray(o,3*n),(new ht).fromArray(o,3*r)],c,i);e.faces.push(u),void 0!==s&&e.faceVertexUvs[0].push([(new tt).fromArray(s,2*t),(new tt).fromArray(s,2*n),(new tt).fromArray(s,2*r)]),void 0!==l&&e.faceVertexUvs[1].push([(new tt).fromArray(l,2*t),(new tt).fromArray(l,2*n),(new tt).fromArray(l,2*r)])}var h=t.groups;if(0<h.length)for(c=0;c<h.length;c++)for(var d=h[c],p=d.start,f=p,m=p+d.count;f<m;f+=3)void 0!==n?u(n[f],n[f+1],n[f+2],d.materialIndex):u(f,f+1,f+2,d.materialIndex);else if(void 0!==n)for(c=0;c<n.length;c+=3)u(n[c],n[c+1],n[c+2]);else for(c=0;c<i.length/3;c+=3)u(c,c+1,c+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(En).negate(),this.translate(En.x,En.y,En.z),this},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,r=new xt;return r.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix4(r),this},computeFaceNormals:function(){for(var t=new ht,e=new ht,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],o=this.vertices[i.a],a=this.vertices[i.b],s=this.vertices[i.c];t.subVectors(s,a),e.subVectors(o,a),t.cross(e),t.normalize(),i.normal.copy(t)}},computeVertexNormals:function(t){var e,n,r,i,o,a;for(void 0===t&&(t=!0),a=new Array(this.vertices.length),e=0,n=this.vertices.length;e<n;e++)a[e]=new ht;if(t){var s,l,c,u=new ht,h=new ht;for(r=0,i=this.faces.length;r<i;r++)o=this.faces[r],s=this.vertices[o.a],l=this.vertices[o.b],c=this.vertices[o.c],u.subVectors(c,l),h.subVectors(s,l),u.cross(h),a[o.a].add(u),a[o.b].add(u),a[o.c].add(u)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)a[(o=this.faces[r]).a].add(o.normal),a[o.b].add(o.normal),a[o.c].add(o.normal);for(e=0,n=this.vertices.length;e<n;e++)a[e].normalize();for(r=0,i=this.faces.length;r<i;r++){var d=(o=this.faces[r]).vertexNormals;3===d.length?(d[0].copy(a[o.a]),d[1].copy(a[o.b]),d[2].copy(a[o.c])):(d[0]=a[o.a].clone(),d[1]=a[o.b].clone(),d[2]=a[o.c].clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var r=(n=this.faces[t]).vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for((i=this.faces[n]).__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),t=0,e=i.vertexNormals.length;t<e;t++)i.__originalVertexNormals[t]?i.__originalVertexNormals[t].copy(i.vertexNormals[t]):i.__originalVertexNormals[t]=i.vertexNormals[t].clone();var o=new Dn;for(o.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var a=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)l=new ht,c={a:new ht,b:new ht,c:new ht},a.push(l),s.push(c)}var l,c,u=this.morphNormals[t];for(o.vertices=this.morphTargets[t].vertices,o.computeFaceNormals(),o.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],l=u.faceNormals[n],c=u.vertexNormals[n],l.copy(i.normal),c.a.copy(i.vertexNormals[0]),c.b.copy(i.vertexNormals[1]),c.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)(i=this.faces[n]).normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Kt),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new ee),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var r,i=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,l=t.faces,c=this.colors,u=t.colors;void 0===n&&(n=0),void 0!==e&&(r=(new et).getNormalMatrix(e));for(var h=0,d=a.length;h<d;h++){var p=a[h].clone();void 0!==e&&p.applyMatrix4(e),o.push(p)}for(h=0,d=u.length;h<d;h++)c.push(u[h].clone());for(h=0,d=l.length;h<d;h++){var f,m,g,y=l[h],v=y.vertexNormals,x=y.vertexColors;(f=new Le(y.a+i,y.b+i,y.c+i)).normal.copy(y.normal),void 0!==r&&f.normal.applyMatrix3(r).normalize();for(var b=0,w=v.length;b<w;b++)m=v[b].clone(),void 0!==r&&m.applyMatrix3(r).normalize(),f.vertexNormals.push(m);for(f.color.copy(y.color),b=0,w=x.length;b<w;b++)g=x[b],f.vertexColors.push(g.clone());f.materialIndex=y.materialIndex+n,s.push(f)}for(h=0,d=t.faceVertexUvs.length;h<d;h++){var M=t.faceVertexUvs[h];for(void 0===this.faceVertexUvs[h]&&(this.faceVertexUvs[h]=[]),b=0,w=M.length;b<w;b++){for(var _=M[b],C=[],S=0,T=_.length;S<T;S++)C.push(_[S].clone());this.faceVertexUvs[h].push(C)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t)},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,n,r,i,o,a,s,l={},c=[],u=[],h=Math.pow(10,4);for(n=0,r=this.vertices.length;n<r;n++)t=this.vertices[n],void 0===l[e=Math.round(t.x*h)+"_"+Math.round(t.y*h)+"_"+Math.round(t.z*h)]?(l[e]=n,c.push(this.vertices[n]),u[n]=c.length-1):u[n]=u[l[e]];var d=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=u[i.a],i.b=u[i.b],i.c=u[i.c],o=[i.a,i.b,i.c];for(var p=0;p<3;p++)if(o[p]===o[(p+1)%3]){d.push(n);break}}for(n=d.length-1;0<=n;n--){var f=d[n];for(this.faces.splice(f,1),a=0,s=this.faceVertexUvs.length;a<s;a++)this.faceVertexUvs[a].splice(f,1)}var m=this.vertices.length-c.length;return this.vertices=c,m},setFromPoints:function(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var r=t[e];this.vertices.push(new ht(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,n=0;n<e;n++)t[n]._id=n;t.sort(function(t,e){return t.materialIndex-e.materialIndex});var r,i,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];for(o&&o.length===e&&(r=[]),a&&a.length===e&&(i=[]),n=0;n<e;n++){var s=t[n]._id;r&&r.push(o[s]),i&&i.push(a[s])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}for(var r=[],i=0;i<this.vertices.length;i++){var o=this.vertices[i];r.push(o.x,o.y,o.z)}var a=[],s=[],l={},c=[],u={},h=[],d={};for(i=0;i<this.faces.length;i++){var p=this.faces[i],f=void 0!==this.faceVertexUvs[0][i],m=0<p.normal.length(),g=0<p.vertexNormals.length,y=1!==p.color.r||1!==p.color.g||1!==p.color.b,v=0<p.vertexColors.length,x=0;if(x=_(x=_(x=_(x=_(x=_(x=_(x=_(x=_(x,0,0),1,!0),2,!1),3,f),4,m),5,g),6,y),7,v),a.push(x),a.push(p.a,p.b,p.c),a.push(p.materialIndex),f){var b=this.faceVertexUvs[0][i];a.push(T(b[0]),T(b[1]),T(b[2]))}if(m&&a.push(C(p.normal)),g){var w=p.vertexNormals;a.push(C(w[0]),C(w[1]),C(w[2]))}if(y&&a.push(S(p.color)),v){var M=p.vertexColors;a.push(S(M[0]),S(M[1]),S(M[2]))}}function _(t,e,n){return n?t|1<<e:t&~(1<<e)}function C(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==l[e]||(l[e]=s.length/3,s.push(t.x,t.y,t.z)),l[e]}function S(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==u[e]||(u[e]=c.length,c.push(t.getHex())),u[e]}function T(t){var e=t.x.toString()+t.y.toString();return void 0!==d[e]||(d[e]=h.length/2,h.push(t.x,t.y)),d[e]}return t.data={},t.data.vertices=r,t.data.normals=s,0<c.length&&(t.data.colors=c),0<h.length&&(t.data.uvs=[h]),t.data.faces=a,t},clone:function(){return(new Dn).copy(this)},copy:function(t){var e,n,r,i,o,a;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.name=t.name;var s=t.vertices;for(e=0,n=s.length;e<n;e++)this.vertices.push(s[e].clone());var l=t.colors;for(e=0,n=l.length;e<n;e++)this.colors.push(l[e].clone());var c=t.faces;for(e=0,n=c.length;e<n;e++)this.faces.push(c[e].clone());for(e=0,n=t.faceVertexUvs.length;e<n;e++){var u=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),r=0,i=u.length;r<i;r++){var h=u[r],d=[];for(o=0,a=h.length;o<a;o++){var p=h[o];d.push(p.clone())}this.faceVertexUvs[e].push(d)}}var f=t.morphTargets;for(e=0,n=f.length;e<n;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],r=0,i=f[e].vertices.length;r<i;r++)m.vertices.push(f[e].vertices[r].clone());if(void 0!==f[e].normals)for(m.normals=[],r=0,i=f[e].normals.length;r<i;r++)m.normals.push(f[e].normals[r].clone());this.morphTargets.push(m)}var g=t.morphNormals;for(e=0,n=g.length;e<n;e++){var y={};if(void 0!==g[e].vertexNormals)for(y.vertexNormals=[],r=0,i=g[e].vertexNormals.length;r<i;r++){var v=g[e].vertexNormals[r],x={};x.a=v.a.clone(),x.b=v.b.clone(),x.c=v.c.clone(),y.vertexNormals.push(x)}if(void 0!==g[e].faceNormals)for(y.faceNormals=[],r=0,i=g[e].faceNormals.length;r<i;r++)y.faceNormals.push(g[e].faceNormals[r].clone());this.morphNormals.push(y)}var b=t.skinWeights;for(e=0,n=b.length;e<n;e++)this.skinWeights.push(b[e].clone());var w=t.skinIndices;for(e=0,n=w.length;e<n;e++)this.skinIndices.push(w[e].clone());var M=t.lineDistances;for(e=0,n=M.length;e<n;e++)this.lineDistances.push(M[e]);var _=t.boundingBox;null!==_&&(this.boundingBox=_.clone());var C=t.boundingSphere;return null!==C&&(this.boundingSphere=C.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var An=function(t){function e(e,n,r,i,o,a){t.call(this),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:a},this.fromBufferGeometry(new On(e,n,r,i,o,a)),this.mergeVertices()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(Dn),On=function(t){function e(e,n,r,i,o,a){t.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:a};var s=this;e=e||1,n=n||1,r=r||1,i=Math.floor(i)||1,o=Math.floor(o)||1;var l=[],c=[],u=[],h=[],d=0,p=0;function f(t,e,n,r,i,o,a,f,m,g,y){var v,x,b=o/m,w=a/g,M=o/2,_=a/2,C=f/2,S=m+1,T=g+1,E=0,D=0,A=new ht;for(x=0;x<T;x++){var O=x*w-_;for(v=0;v<S;v++){var P=v*b-M;A[t]=P*r,A[e]=O*i,A[n]=C,c.push(A.x,A.y,A.z),A[t]=0,A[e]=0,A[n]=0<f?1:-1,u.push(A.x,A.y,A.z),h.push(v/m),h.push(1-x/g),E+=1}}for(x=0;x<g;x++)for(v=0;v<m;v++){var L=d+v+S*x,R=d+v+S*(x+1),I=d+(v+1)+S*(x+1),k=d+(v+1)+S*x;l.push(L,R,k),l.push(R,I,k),D+=6}s.addGroup(p,D,y),p+=D,d+=E}f("z","y","x",-1,-1,r,n,e,a=Math.floor(a)||1,o,0),f("z","y","x",1,-1,r,n,-e,a,o,1),f("x","z","y",1,1,e,r,n,i,a,2),f("x","z","y",1,-1,e,r,-n,i,a,3),f("x","y","z",1,-1,e,n,r,i,o,4),f("x","y","z",-1,-1,e,n,-r,i,o,5),this.setIndex(l),this.setAttribute("position",new We(c,3)),this.setAttribute("normal",new We(u,3)),this.setAttribute("uv",new We(h,2))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(nn);function Pn(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}return e}function Ln(t){for(var e={},n=0;n<t.length;n++){var r=Pn(t[n]);for(var i in r)e[i]=r[i]}return e}var Rn={clone:Pn,merge:Ln};function In(t){Ie.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",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))}function kn(){Bt.call(this),this.type="Camera",this.matrixWorldInverse=new xt,this.projectionMatrix=new xt,this.projectionMatrixInverse=new xt}function Fn(t,e,n,r){kn.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function Bn(t,e,n,r){Bt.call(this),this.type="CubeCamera";var i=new Fn(90,1,t,e);i.up.set(0,-1,0),i.lookAt(new ht(1,0,0)),this.add(i);var o=new Fn(90,1,t,e);o.up.set(0,-1,0),o.lookAt(new ht(-1,0,0)),this.add(o);var a=new Fn(90,1,t,e);a.up.set(0,0,1),a.lookAt(new ht(0,1,0)),this.add(a);var s=new Fn(90,1,t,e);s.up.set(0,0,-1),s.lookAt(new ht(0,-1,0)),this.add(s);var l=new Fn(90,1,t,e);l.up.set(0,-1,0),l.lookAt(new ht(0,0,1)),this.add(l);var c=new Fn(90,1,t,e);c.up.set(0,-1,0),c.lookAt(new ht(0,0,-1)),this.add(c),r=r||{format:M,magFilter:p,minFilter:p},this.renderTarget=new jn(n,r),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=t.getRenderTarget(),r=this.renderTarget,u=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,t.setRenderTarget(r,0),t.render(e,i),t.setRenderTarget(r,1),t.render(e,o),t.setRenderTarget(r,2),t.render(e,a),t.setRenderTarget(r,3),t.render(e,s),t.setRenderTarget(r,4),t.render(e,l),r.texture.generateMipmaps=u,t.setRenderTarget(r,5),t.render(e,c),t.setRenderTarget(n)},this.clear=function(t,e,n,r){for(var i=t.getRenderTarget(),o=this.renderTarget,a=0;a<6;a++)t.setRenderTarget(o,a),t.clear(e,n,r);t.setRenderTarget(i)}}function jn(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=n),at.call(this,t,t,e)}function Nn(t,e,n,r,i,o,a,s,l,c,h,d){it.call(this,null,o,a,s,l,c,r,i,h,d),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==l?l:u,this.minFilter=void 0!==c?c:u,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}((In.prototype=Object.create(Ie.prototype)).constructor=In).prototype.isShaderMaterial=!0,In.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Pn(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},In.prototype.toJSON=function(t){var e=Ie.prototype.toJSON.call(this,t);for(var n in e.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[n]={type:"m4",value:r.toArray()}:e.uniforms[n]={value:r}}0<Object.keys(this.defines).length&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var i={};for(var o in this.extensions)!0===this.extensions[o]&&(i[o]=!0);return 0<Object.keys(i).length&&(e.extensions=i),e},kn.prototype=Object.assign(Object.create(Bt.prototype),{constructor:kn,isCamera:!0,copy:function(t,e){return Bt.prototype.copy.call(this,t,e),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 ht),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Bt.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){Bt.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Fn.prototype=Object.assign(Object.create(kn.prototype),{constructor:Fn,isPerspectiveCamera:!0,copy:function(t,e){return kn.prototype.copy.call(this,t,e),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){var e=.5*this.getFilmHeight()/t;this.fov=2*Q.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Q.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Q.RAD2DEG*Math.atan(Math.tan(.5*Q.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,e,n,r,i,o){this.aspect=t/e,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=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*Q.DEG2RAD*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/a,e-=o.offsetY*n/s,r*=o.width/a,n*=o.height/s}var l=this.filmOffset;0!==l&&(i+=t*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Bt.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),(Bn.prototype=Object.create(Bt.prototype)).constructor=Bn,((jn.prototype=Object.create(at.prototype)).constructor=jn).prototype.isWebGLCubeRenderTarget=!0,jn.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;var n=new jt,r={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},i=new In({type:"CubemapFromEquirect",uniforms:Pn(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=e;var o=new wn(new On(5,5,5),i);n.add(o);var a=new Bn(1,10,1);return a.renderTarget=this,a.renderTarget.texture.name="CubeCameraTexture",a.update(t,n),o.geometry.dispose(),o.material.dispose(),this},((Nn.prototype=Object.create(it.prototype)).constructor=Nn).prototype.isDataTexture=!0;var zn=new ee,Vn=new ht;function Gn(t,e,n,r,i,o){this.planes=[void 0!==t?t:new pe,void 0!==e?e:new pe,void 0!==n?n:new pe,void 0!==r?r:new pe,void 0!==i?i:new pe,void 0!==o?o:new pe]}Object.assign(Gn.prototype,{set:function(t,e,n,r,i,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromProjectionMatrix:function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],c=n[6],u=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],y=n[14],v=n[15];return e[0].setComponents(a-r,u-s,f-h,v-m).normalize(),e[1].setComponents(a+r,u+s,f+h,v+m).normalize(),e[2].setComponents(a+i,u+l,f+d,v+g).normalize(),e[3].setComponents(a-i,u-l,f-d,v-g).normalize(),e[4].setComponents(a-o,u-c,f-p,v-y).normalize(),e[5].setComponents(a+o,u+c,f+p,v+y).normalize(),this},intersectsObject:function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),zn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(zn)},intersectsSprite:function(t){return zn.center.set(0,0,0),zn.radius=.7071067811865476,zn.applyMatrix4(t.matrixWorld),this.intersectsSphere(zn)},intersectsSphere:function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++)if(e[i].distanceToPoint(n)<r)return!1;return!0},intersectsBox:function(t){for(var e=this.planes,n=0;n<6;n++){var r=e[n];if(Vn.x=0<r.normal.x?t.max.x:t.min.x,Vn.y=0<r.normal.y?t.max.y:t.min.y,Vn.z=0<r.normal.z?t.max.z:t.min.z,r.distanceToPoint(Vn)<0)return!1}return!0},containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}});var Hn={common:{diffuse:{value:new De(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new et},uv2Transform:{value:new et},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 tt(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 De(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},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 De(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new et}},sprite:{diffuse:{value:new De(15658734)},opacity:{value:1},center:{value:new tt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new et}}};function Un(){var t=null,e=!1,n=null;function r(i,o){!1!==e&&(n(i,o),t.requestAnimationFrame(r))}return{start:function(){!0!==e&&null!==n&&(t.requestAnimationFrame(r),e=!0)},stop:function(){e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Wn(t,e,n,r){Dn.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new Jn(t,e,n,r)),this.mergeVertices()}function Jn(t,e,n,r){nn.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r};var i,o,a=(t=t||1)/2,s=(e=e||1)/2,l=Math.floor(n)||1,c=Math.floor(r)||1,u=l+1,h=c+1,d=t/l,p=e/c,f=[],m=[],g=[],y=[];for(o=0;o<h;o++){var v=o*p-s;for(i=0;i<u;i++){var x=i*d-a;m.push(x,-v,0),g.push(0,0,1),y.push(i/l),y.push(1-o/c)}}for(o=0;o<c;o++)for(i=0;i<l;i++){var b=i+u*o,w=i+u*(o+1),M=i+1+u*(o+1),_=i+1+u*o;f.push(b,w,_),f.push(w,M,_)}this.setIndex(f),this.setAttribute("position",new We(m,3)),this.setAttribute("normal",new We(g,3)),this.setAttribute("uv",new We(y,2))}(Wn.prototype=Object.create(Dn.prototype)).constructor=Wn,(Jn.prototype=Object.create(nn.prototype)).constructor=Jn;var qn={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\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\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\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\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\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\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\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\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\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\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\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\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\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\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\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\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\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;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#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#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\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 ) ); }\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#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\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\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\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\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}\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}\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 float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\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 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#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\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); }\n return mip;\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 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",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\ttransformedNormal = mat3( instanceMatrix ) * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\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}\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}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\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}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\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}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\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\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\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}\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}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\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",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\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\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\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\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\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\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\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\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\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\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\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = saturate( clearcoat );\tmaterial.clearcoatRoughness = max( clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\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\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\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\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\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\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\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\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\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\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( pointLight.shadow, directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\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#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\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\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\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\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\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\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_normalmap_pars_fragment:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\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}\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}\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}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\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 );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\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\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\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\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\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\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\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\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\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\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\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= all( bvec2( directionalLight.shadow, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= all( bvec2( spotLight.shadow, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= all( bvec2( pointLight.shadow, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\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#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\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\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\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\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\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\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\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\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\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\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\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}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\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>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",depth_vert:"#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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\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}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\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>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\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\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\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 <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\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>\nvoid main() {\n\t#include <clipping_planes_fragment>\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\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\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_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\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\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}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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 <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\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;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_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>\nvoid main() {\n\t#include <uv_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\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\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\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\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>\nvoid main() {\n\t#include <clipping_planes_fragment>\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\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\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_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#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\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\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\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>\nvoid main() {\n\t#include <clipping_planes_fragment>\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\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\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_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#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\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\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\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_normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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\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\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\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}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_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#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\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\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\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>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\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>\nvoid main() {\n\t#include <uv_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#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\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#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\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>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\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>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\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>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\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}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\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>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\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\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\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\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},Xn={basic:{uniforms:Ln([Hn.common,Hn.specularmap,Hn.envmap,Hn.aomap,Hn.lightmap,Hn.fog]),vertexShader:qn.meshbasic_vert,fragmentShader:qn.meshbasic_frag},lambert:{uniforms:Ln([Hn.common,Hn.specularmap,Hn.envmap,Hn.aomap,Hn.lightmap,Hn.emissivemap,Hn.fog,Hn.lights,{emissive:{value:new De(0)}}]),vertexShader:qn.meshlambert_vert,fragmentShader:qn.meshlambert_frag},phong:{uniforms:Ln([Hn.common,Hn.specularmap,Hn.envmap,Hn.aomap,Hn.lightmap,Hn.emissivemap,Hn.bumpmap,Hn.normalmap,Hn.displacementmap,Hn.fog,Hn.lights,{emissive:{value:new De(0)},specular:{value:new De(1118481)},shininess:{value:30}}]),vertexShader:qn.meshphong_vert,fragmentShader:qn.meshphong_frag},standard:{uniforms:Ln([Hn.common,Hn.envmap,Hn.aomap,Hn.lightmap,Hn.emissivemap,Hn.bumpmap,Hn.normalmap,Hn.displacementmap,Hn.roughnessmap,Hn.metalnessmap,Hn.fog,Hn.lights,{emissive:{value:new De(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:qn.meshphysical_vert,fragmentShader:qn.meshphysical_frag},toon:{uniforms:Ln([Hn.common,Hn.specularmap,Hn.aomap,Hn.lightmap,Hn.emissivemap,Hn.bumpmap,Hn.normalmap,Hn.displacementmap,Hn.gradientmap,Hn.fog,Hn.lights,{emissive:{value:new De(0)},specular:{value:new De(1118481)},shininess:{value:30}}]),vertexShader:qn.meshtoon_vert,fragmentShader:qn.meshtoon_frag},matcap:{uniforms:Ln([Hn.common,Hn.bumpmap,Hn.normalmap,Hn.displacementmap,Hn.fog,{matcap:{value:null}}]),vertexShader:qn.meshmatcap_vert,fragmentShader:qn.meshmatcap_frag},points:{uniforms:Ln([Hn.points,Hn.fog]),vertexShader:qn.points_vert,fragmentShader:qn.points_frag},dashed:{uniforms:Ln([Hn.common,Hn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:qn.linedashed_vert,fragmentShader:qn.linedashed_frag},depth:{uniforms:Ln([Hn.common,Hn.displacementmap]),vertexShader:qn.depth_vert,fragmentShader:qn.depth_frag},normal:{uniforms:Ln([Hn.common,Hn.bumpmap,Hn.normalmap,Hn.displacementmap,{opacity:{value:1}}]),vertexShader:qn.normal_vert,fragmentShader:qn.normal_frag},sprite:{uniforms:Ln([Hn.sprite,Hn.fog]),vertexShader:qn.sprite_vert,fragmentShader:qn.sprite_frag},background:{uniforms:{uvTransform:{value:new et},t2D:{value:null}},vertexShader:qn.background_vert,fragmentShader:qn.background_frag},cube:{uniforms:Ln([Hn.envmap,{opacity:{value:1}}]),vertexShader:qn.cube_vert,fragmentShader:qn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:qn.equirect_vert,fragmentShader:qn.equirect_frag},distanceRGBA:{uniforms:Ln([Hn.common,Hn.displacementmap,{referencePosition:{value:new ht},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:qn.distanceRGBA_vert,fragmentShader:qn.distanceRGBA_frag},shadow:{uniforms:Ln([Hn.lights,Hn.fog,{color:{value:new De(0)},opacity:{value:1}}]),vertexShader:qn.shadow_vert,fragmentShader:qn.shadow_frag}};function Yn(t,e,n,r){var i,a,s=new De(0),l=0,c=null,u=0,h=null;function d(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,r)}return{getClearColor:function(){return s},setClearColor:function(t,e){s.set(t),d(s,l=void 0!==e?e:1)},getClearAlpha:function(){return l},setClearAlpha:function(t){d(s,l=t)},render:function(e,r,p,f){var m=r.background,g=t.xr,y=g.getSession&&g.getSession();if(y&&"additive"===y.environmentBlendMode&&(m=null),null===m?d(s,l):m&&m.isColor&&(d(m,1),f=!0),(t.autoClear||f)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||m.mapping===o)){void 0===a&&((a=new wn(new On(1,1,1),new In({type:"BackgroundCubeMaterial",uniforms:Pn(Xn.cube.uniforms),vertexShader:Xn.cube.vertexShader,fragmentShader:Xn.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(a));var v=m.isWebGLCubeRenderTarget?m.texture:m;a.material.uniforms.envMap.value=v,a.material.uniforms.flipEnvMap.value=v.isCubeTexture?-1:1,c===m&&u===v.version&&h===t.toneMapping||(a.material.needsUpdate=!0,c=m,u=v.version,h=t.toneMapping),e.unshift(a,a.geometry,a.material,0,0,null)}else m&&m.isTexture&&(void 0===i&&((i=new wn(new Jn(2,2),new In({type:"BackgroundMaterial",uniforms:Pn(Xn.background.uniforms),vertexShader:Xn.background.vertexShader,fragmentShader:Xn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(i.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(i)),!0===(i.material.uniforms.t2D.value=m).matrixAutoUpdate&&m.updateMatrix(),i.material.uniforms.uvTransform.value.copy(m.matrix),c===m&&u===m.version&&h===t.toneMapping||(i.material.needsUpdate=!0,u=(c=m).version,h=t.toneMapping),e.unshift(i,i.geometry,i.material,0,0,null))}}}function Zn(){var t=this,e=null,n=0,r=!1,i=!1,o=new pe,a=new et,s={value:null,needsUpdate:!1};function l(){s.value!==e&&(s.value=e,s.needsUpdate=0<n),t.numPlanes=n,t.numIntersection=0}function c(e,n,r,i){var l=null!==e?e.length:0,c=null;if(0!==l){if(c=s.value,!0!==i||null===c){var u=r+4*l,h=n.matrixWorldInverse;a.getNormalMatrix(h),(null===c||c.length<u)&&(c=new Float32Array(u));for(var d=0,p=r;d!==l;++d,p+=4)o.copy(e[d]).applyMatrix4(h,a),o.normal.toArray(c,p),c[p+3]=o.constant}s.value=c,s.needsUpdate=!0}return t.numPlanes=l,c}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(t,i,o){var a=0!==t.length||i||0!==n||r;return r=i,e=c(t,o,0),n=t.length,a},this.beginShadows=function(){i=!0,c(null)},this.endShadows=function(){i=!1,l()},this.setState=function(t,o,a,u,h,d){if(!r||null===t||0===t.length||i&&!a)i?c(null):l();else{var p=i?0:n,f=4*p,m=h.clippingState||null;s.value=m,m=c(t,u,f,d);for(var g=0;g!==f;++g)m[g]=e[g];h.clippingState=m,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=p}}}function $n(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Kn(t,e,r,i,o,a,s,l,c,u){it.call(this,t=void 0!==t?t:[],e=void 0!==e?e:n,r,i,o,a,s=void 0!==s?s:M,l,c,u),this.flipY=!1}function Qn(t,e,n,r){it.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:r||1},this.magFilter=u,this.minFilter=u,this.wrapR=l,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function tr(t,e,n,r){it.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:r||1},this.magFilter=u,this.minFilter=u,this.wrapR=l,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}Xn.physical={uniforms:Ln([Xn.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new De(0)},clearcoatNormalScale:{value:new tt(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:qn.meshphysical_vert,fragmentShader:qn.meshphysical_frag},((Kn.prototype=Object.create(it.prototype)).constructor=Kn).prototype.isCubeTexture=!0,Object.defineProperty(Kn.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),((Qn.prototype=Object.create(it.prototype)).constructor=Qn).prototype.isDataTexture2DArray=!0,((tr.prototype=Object.create(it.prototype)).constructor=tr).prototype.isDataTexture3D=!0;var er=new it,nr=new Qn,rr=new tr,ir=new Kn,or=[],ar=[],sr=new Float32Array(16),lr=new Float32Array(9),cr=new Float32Array(4);function ur(t,e,n){var r=t[0];if(r<=0||0<r)return t;var i=e*n,o=or[i];if(void 0===o&&(o=new Float32Array(i),or[i]=o),0!==e){r.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function hr(t,e){if(t.length===e.length){for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return;return 1}}function dr(t,e){for(var n=0,r=e.length;n<r;n++)t[n]=e[n]}function pr(t,e){var n=ar[e];void 0===n&&(n=new Int32Array(e),ar[e]=n);for(var r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function fr(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function mr(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(hr(n,e))return;t.uniform2fv(this.addr,e),dr(n,e)}}function gr(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(hr(n,e))return;t.uniform3fv(this.addr,e),dr(n,e)}}function yr(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(hr(n,e))return;t.uniform4fv(this.addr,e),dr(n,e)}}function vr(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(hr(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),dr(n,e)}else{if(hr(n,r))return;cr.set(r),t.uniformMatrix2fv(this.addr,!1,cr),dr(n,r)}}function xr(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(hr(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),dr(n,e)}else{if(hr(n,r))return;lr.set(r),t.uniformMatrix3fv(this.addr,!1,lr),dr(n,r)}}function br(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(hr(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),dr(n,e)}else{if(hr(n,r))return;sr.set(r),t.uniformMatrix4fv(this.addr,!1,sr),dr(n,r)}}function wr(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(e||er,i)}function Mr(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||nr,i)}function _r(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||rr,i)}function Cr(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(e||ir,i)}function Sr(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Tr(t,e){var n=this.cache;hr(n,e)||(t.uniform2iv(this.addr,e),dr(n,e))}function Er(t,e){var n=this.cache;hr(n,e)||(t.uniform3iv(this.addr,e),dr(n,e))}function Dr(t,e){var n=this.cache;hr(n,e)||(t.uniform4iv(this.addr,e),dr(n,e))}function Ar(t,e){var n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Or(t,e){t.uniform1fv(this.addr,e)}function Pr(t,e){t.uniform1iv(this.addr,e)}function Lr(t,e){t.uniform2iv(this.addr,e)}function Rr(t,e){t.uniform3iv(this.addr,e)}function Ir(t,e){t.uniform4iv(this.addr,e)}function kr(t,e){var n=ur(e,this.size,2);t.uniform2fv(this.addr,n)}function Fr(t,e){var n=ur(e,this.size,3);t.uniform3fv(this.addr,n)}function Br(t,e){var n=ur(e,this.size,4);t.uniform4fv(this.addr,n)}function jr(t,e){var n=ur(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function Nr(t,e){var n=ur(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function zr(t,e){var n=ur(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Vr(t,e,n){var r=e.length,i=pr(n,r);t.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.safeSetTexture2D(e[o]||er,i[o])}function Gr(t,e,n){var r=e.length,i=pr(n,r);t.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.safeSetTextureCube(e[o]||ir,i[o])}function Hr(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(e.type){case 5126:return fr;case 35664:return mr;case 35665:return gr;case 35666:return yr;case 35674:return vr;case 35675:return xr;case 35676:return br;case 5124:case 35670:return Sr;case 35667:case 35671:return Tr;case 35668:case 35672:return Er;case 35669:case 35673:return Dr;case 5125:return Ar;case 35678:case 36198:case 36298:case 36306:case 35682:return wr;case 35679:case 36299:case 36307:return _r;case 35680:case 36300:case 36308:case 36293:return Cr;case 36289:case 36303:case 36311:case 36292:return Mr}}()}function Ur(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(e.type){case 5126:return Or;case 35664:return kr;case 35665:return Fr;case 35666:return Br;case 35674:return jr;case 35675:return Nr;case 35676:return zr;case 5124:case 35670:return Pr;case 35667:case 35671:return Lr;case 35668:case 35672:return Rr;case 35669:case 35673:return Ir;case 35678:case 36198:case 36298:case 36306:case 35682:return Vr;case 35680:case 36300:case 36308:case 36293:return Gr}}()}function Wr(t){this.id=t,this.seq=[],this.map={}}Ur.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),dr(e,t)},Wr.prototype.setValue=function(t,e,n){for(var r=this.seq,i=0,o=r.length;i!==o;++i){var a=r[i];a.setValue(t,e[a.id],n)}};var Jr=/([\w\d_]+)(\])?(\[|\.)?/g;function qr(t,e){t.seq.push(e),t.map[e.id]=e}function Xr(t,e,n){var r=t.name,i=r.length;for(Jr.lastIndex=0;;){var o=Jr.exec(r),a=Jr.lastIndex,s=o[1],l="]"===o[2],c=o[3];if(l&&(s|=0),void 0===c||"["===c&&a+2===i){qr(n,new(void 0===c?Hr:Ur)(s,t,e));break}var u=n.map[s];void 0===u&&qr(n,u=new Wr(s)),n=u}}function Yr(t,e){this.seq=[],this.map={};for(var n=t.getProgramParameter(e,35718),r=0;r<n;++r){var i=t.getActiveUniform(e,r);Xr(i,t.getUniformLocation(e,i.name),this)}}function Zr(t,e,n){var r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}Yr.prototype.setValue=function(t,e,n,r){var i=this.map[e];void 0!==i&&i.setValue(t,n,r)},Yr.prototype.setOptional=function(t,e,n){var r=e[n];void 0!==r&&this.setValue(t,n,r)},Yr.upload=function(t,e,n,r){for(var i=0,o=e.length;i!==o;++i){var a=e[i],s=n[a.id];!1!==s.needsUpdate&&a.setValue(t,s.value,r)}},Yr.seqWithValue=function(t,e){for(var n=[],r=0,i=t.length;r!==i;++r){var o=t[r];o.id in e&&n.push(o)}return n};var $r=0;function Kr(t){switch(t){case N:return["Linear","( value )"];case z:return["sRGB","( value )"];case G:return["RGBE","( value )"];case H:return["RGBM","( value, 7.0 )"];case U:return["RGBM","( value, 16.0 )"];case W:return["RGBD","( value, 256.0 )"];case V:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+t)}}function Qr(t,e,n){var r=t.getShaderParameter(e,35713),i=t.getShaderInfoLog(e).trim();return r&&""===i?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+i+function(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}(t.getShaderSource(e))}function ti(t,e){var n=Kr(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function ei(t){return""!==t}function ni(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function ri(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}var ii=/^[ \t]*#include +<([\w\d./]+)>/gm;function oi(t){return t.replace(ii,ai)}function ai(t,e){var n=qn[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return oi(n)}var si=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function li(t){return t.replace(si,ci)}function ci(t,e,n,r){for(var i="",o=parseInt(e);o<parseInt(n);o++)i+=r.replace(/\[ i \]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return i}function ui(t){var e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function hi(t,e,s){var l,c,u,h,d,p,f,m=t.getContext(),g=s.defines,y=s.vertexShader,v=s.fragmentShader,x=(c="SHADOWMAP_TYPE_BASIC",1===(l=s).shadowMapType?c="SHADOWMAP_TYPE_PCF":2===l.shadowMapType?c="SHADOWMAP_TYPE_PCF_SOFT":3===l.shadowMapType&&(c="SHADOWMAP_TYPE_VSM"),c),b=function(t){var e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case n:case r:e="ENVMAP_TYPE_CUBE";break;case o:case a:e="ENVMAP_TYPE_CUBE_UV";break;case 303:case i:e="ENVMAP_TYPE_EQUIREC";break;case 305:e="ENVMAP_TYPE_SPHERE"}return e}(s),w=function(t){var e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case r:case i:e="ENVMAP_MODE_REFRACTION"}return e}(s),M=function(t){var e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(s),_=0<t.gammaFactor?t.gammaFactor:1,C=s.isWebGL2?"":[(u=s).extensionDerivatives||u.envMapCubeUV||u.bumpMap||u.tangentSpaceNormalMap||u.clearcoatNormalMap||u.flatShading||"physical"===u.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(u.extensionFragDepth||u.logarithmicDepthBuffer)&&u.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",u.extensionDrawBuffers&&u.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(u.extensionShaderTextureLOD||u.envMap)&&u.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ei).join("\n"),S=function(t){var e=[];for(var n in t){var r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(g),T=m.createProgram(),E=s.numMultiviewViews;if(s.isRawShaderMaterial?(0<(h=[S].filter(ei).join("\n")).length&&(h+="\n"),0<(d=[C,S].filter(ei).join("\n")).length&&(d+="\n")):(h=[ui(s),"#define SHADER_NAME "+s.shaderName,S,s.instancing?"#define USE_INSTANCING":"",s.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+_,"#define MAX_BONES "+s.maxBones,s.useFog&&s.fog?"#define USE_FOG":"",s.useFog&&s.fogExp2?"#define FOG_EXP2":"",s.map?"#define USE_MAP":"",s.envMap?"#define USE_ENVMAP":"",s.envMap?"#define "+w:"",s.lightMap?"#define USE_LIGHTMAP":"",s.aoMap?"#define USE_AOMAP":"",s.emissiveMap?"#define USE_EMISSIVEMAP":"",s.bumpMap?"#define USE_BUMPMAP":"",s.normalMap?"#define USE_NORMALMAP":"",s.normalMap&&s.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",s.normalMap&&s.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",s.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",s.displacementMap&&s.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",s.specularMap?"#define USE_SPECULARMAP":"",s.roughnessMap?"#define USE_ROUGHNESSMAP":"",s.metalnessMap?"#define USE_METALNESSMAP":"",s.alphaMap?"#define USE_ALPHAMAP":"",s.vertexTangents?"#define USE_TANGENT":"",s.vertexColors?"#define USE_COLOR":"",s.vertexUvs?"#define USE_UV":"",s.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",s.flatShading?"#define FLAT_SHADED":"",s.skinning?"#define USE_SKINNING":"",s.useVertexTexture?"#define BONE_TEXTURE":"",s.morphTargets?"#define USE_MORPHTARGETS":"",s.morphNormals&&!1===s.flatShading?"#define USE_MORPHNORMALS":"",s.doubleSided?"#define DOUBLE_SIDED":"",s.flipSided?"#define FLIP_SIDED":"",s.shadowMapEnabled?"#define USE_SHADOWMAP":"",s.shadowMapEnabled?"#define "+x:"",s.sizeAttenuation?"#define USE_SIZEATTENUATION":"",s.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",s.logarithmicDepthBuffer&&s.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(ei).join("\n"),d=[C,ui(s),"#define SHADER_NAME "+s.shaderName,S,s.alphaTest?"#define ALPHATEST "+s.alphaTest+(s.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+_,s.useFog&&s.fog?"#define USE_FOG":"",s.useFog&&s.fogExp2?"#define FOG_EXP2":"",s.map?"#define USE_MAP":"",s.matcap?"#define USE_MATCAP":"",s.envMap?"#define USE_ENVMAP":"",s.envMap?"#define "+b:"",s.envMap?"#define "+w:"",s.envMap?"#define "+M:"",s.lightMap?"#define USE_LIGHTMAP":"",s.aoMap?"#define USE_AOMAP":"",s.emissiveMap?"#define USE_EMISSIVEMAP":"",s.bumpMap?"#define USE_BUMPMAP":"",s.normalMap?"#define USE_NORMALMAP":"",s.normalMap&&s.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",s.normalMap&&s.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",s.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",s.specularMap?"#define USE_SPECULARMAP":"",s.roughnessMap?"#define USE_ROUGHNESSMAP":"",s.metalnessMap?"#define USE_METALNESSMAP":"",s.alphaMap?"#define USE_ALPHAMAP":"",s.sheen?"#define USE_SHEEN":"",s.vertexTangents?"#define USE_TANGENT":"",s.vertexColors?"#define USE_COLOR":"",s.vertexUvs?"#define USE_UV":"",s.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",s.gradientMap?"#define USE_GRADIENTMAP":"",s.flatShading?"#define FLAT_SHADED":"",s.doubleSided?"#define DOUBLE_SIDED":"",s.flipSided?"#define FLIP_SIDED":"",s.shadowMapEnabled?"#define USE_SHADOWMAP":"",s.shadowMapEnabled?"#define "+x:"",s.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",s.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",s.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",s.logarithmicDepthBuffer&&s.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(s.extensionShaderTextureLOD||s.envMap)&&s.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==s.toneMapping?"#define TONE_MAPPING":"",0!==s.toneMapping?qn.tonemapping_pars_fragment:"",0!==s.toneMapping?function(t,e){var n;switch(e){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Uncharted2";break;case 4:n="OptimizedCineon";break;case 5:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 toneMapping( vec3 color ) { return "+n+"ToneMapping( color ); }"}(0,s.toneMapping):"",s.dithering?"#define DITHERING":"",s.outputEncoding||s.mapEncoding||s.matcapEncoding||s.envMapEncoding||s.emissiveMapEncoding||s.lightMapEncoding?qn.encodings_pars_fragment:"",s.mapEncoding?ti("mapTexelToLinear",s.mapEncoding):"",s.matcapEncoding?ti("matcapTexelToLinear",s.matcapEncoding):"",s.envMapEncoding?ti("envMapTexelToLinear",s.envMapEncoding):"",s.emissiveMapEncoding?ti("emissiveMapTexelToLinear",s.emissiveMapEncoding):"",s.lightMapEncoding?ti("lightMapTexelToLinear",s.lightMapEncoding):"",s.outputEncoding?(p=s.outputEncoding,f=Kr(p),"vec4 linearToOutputTexel( vec4 value ) { return LinearTo"+f[0]+f[1]+"; }"):"",s.depthPacking?"#define DEPTH_PACKING "+s.depthPacking:"","\n"].filter(ei).join("\n")),y=ri(y=ni(y=oi(y),s),s),v=ri(v=ni(v=oi(v),s),s),y=li(y),v=li(v),s.isWebGL2&&!s.isRawShaderMaterial){var D=!1,A=/^\s*#version\s+300\s+es\s*\n/;s.isShaderMaterial&&null!==y.match(A)&&null!==v.match(A)&&(D=!0,y=y.replace(A,""),v=v.replace(A,"")),h=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+h,d=["#version 300 es\n","#define varying in",D?"":"out highp vec4 pc_fragColor;",D?"":"#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"+d,0<E&&(h=(h=h.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","layout(num_views = "+E+") in;","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace(["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;"].join("\n"),["uniform mat4 modelViewMatrices["+E+"];","uniform mat4 projectionMatrices["+E+"];","uniform mat4 viewMatrices["+E+"];","uniform mat3 normalMatrices["+E+"];","#define modelViewMatrix modelViewMatrices[VIEW_ID]","#define projectionMatrix projectionMatrices[VIEW_ID]","#define viewMatrix viewMatrices[VIEW_ID]","#define normalMatrix normalMatrices[VIEW_ID]"].join("\n")),d=(d=d.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace("uniform mat4 viewMatrix;",["uniform mat4 viewMatrices["+E+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join("\n")))}var O,P,L=d+v,R=Zr(m,35633,h+y),I=Zr(m,35632,L);if(m.attachShader(T,R),m.attachShader(T,I),void 0!==s.index0AttributeName?m.bindAttribLocation(T,0,s.index0AttributeName):!0===s.morphTargets&&m.bindAttribLocation(T,0,"position"),m.linkProgram(T),t.debug.checkShaderErrors){var k=m.getProgramInfoLog(T).trim(),F=m.getShaderInfoLog(R).trim(),B=m.getShaderInfoLog(I).trim(),j=!0,N=!0;if(!1===m.getProgramParameter(T,35714)){j=!1;var z=Qr(m,R,"vertex"),V=Qr(m,I,"fragment");console.error("THREE.WebGLProgram: shader error: ",m.getError(),"35715",m.getProgramParameter(T,35715),"gl.getProgramInfoLog",k,z,V)}else""!==k?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",k):""!==F&&""!==B||(N=!1);N&&(this.diagnostics={runnable:j,programLog:k,vertexShader:{log:F,prefix:h},fragmentShader:{log:B,prefix:d}})}return m.deleteShader(R),m.deleteShader(I),this.getUniforms=function(){return void 0===O&&(O=new Yr(m,T)),O},this.getAttributes=function(){return void 0===P&&(P=function(t,e){for(var n={},r=t.getProgramParameter(e,35721),i=0;i<r;i++){var o=t.getActiveAttrib(e,i).name;n[o]=t.getAttribLocation(e,o)}return n}(m,T)),P},this.destroy=function(){m.deleteProgram(T),this.program=void 0},this.name=s.shaderName,this.id=$r++,this.cacheKey=e,this.usedTimes=1,this.program=T,this.vertexShader=R,this.fragmentShader=I,this.numMultiviewViews=E,this}function di(t,e,n){var r=[],i=n.isWebGL2,s=n.logarithmicDepthBuffer,l=n.floatVertexTextures,c=n.precision,u=n.maxVertexUniforms,h=n.vertexTextures,d={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"},p=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","numMultiviewViews","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","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 f(t){var e;return t?t.isTexture?e=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e=t.texture.encoding):e=N,e}this.getParameters=function(r,p,m,g,y,v,x){var b=g.fog,w=r.isMeshStandardMaterial?g.environment:null,M=r.envMap||w,_=d[r.type],C=x.isSkinnedMesh?function(t){var e=x.skeleton.bones;if(l)return 1024;var n=u,r=Math.floor((n-20)/4),i=Math.min(r,e.length);return i<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+i+"."),0):i}():0;null!==r.precision&&(c=n.getMaxPrecision(r.precision))!==r.precision&&console.warn("THREE.WebGLProgram.getParameters:",r.precision,"not supported, using",c,"instead.");var S=function(t,e){var n;if(_){var r=Xn[_];n={name:t.type,uniforms:Rn.clone(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}}else n={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};return n}(r);r.onBeforeCompile(S,t);var T=t.getRenderTarget(),E=T&&T.isWebGLMultiviewRenderTarget?T.numViews:0;return{isWebGL2:i,shaderID:_,shaderName:S.name,uniforms:S.uniforms,vertexShader:S.vertexShader,fragmentShader:S.fragmentShader,defines:r.defines,isRawShaderMaterial:r.isRawShaderMaterial,isShaderMaterial:r.isShaderMaterial,precision:c,instancing:!0===x.isInstancedMesh,supportsVertexTextures:h,numMultiviewViews:E,outputEncoding:null!==T?f(T.texture):t.outputEncoding,map:!!r.map,mapEncoding:f(r.map),matcap:!!r.matcap,matcapEncoding:f(r.matcap),envMap:!!M,envMapMode:M&&M.mapping,envMapEncoding:f(M),envMapCubeUV:!!M&&(M.mapping===o||M.mapping===a),lightMap:!!r.lightMap,lightMapEncoding:f(r.lightMap),aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,emissiveMapEncoding:f(r.emissiveMap),bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,objectSpaceNormalMap:1===r.normalMapType,tangentSpaceNormalMap:0===r.normalMapType,clearcoatNormalMap:!!r.clearcoatNormalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,gradientMap:!!r.gradientMap,sheen:!!r.sheen,combine:r.combine,vertexTangents:r.normalMap&&r.vertexTangents,vertexColors:r.vertexColors,vertexUvs:!!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap||r.displacementMap),uvsVertexOnly:!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap||!r.displacementMap),fog:!!b,useFog:r.fog,fogExp2:b&&b.isFogExp2,flatShading:r.flatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:s,skinning:r.skinning&&0<C,maxBones:C,useVertexTexture:l,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:p.directional.length,numPointLights:p.point.length,numSpotLights:p.spot.length,numRectAreaLights:p.rectArea.length,numHemiLights:p.hemi.length,numDirLightShadows:p.directionalShadowMap.length,numPointLightShadows:p.pointShadowMap.length,numSpotLightShadows:p.spotShadowMap.length,numClippingPlanes:y,numClipIntersection:v,dithering:r.dithering,shadowMapEnabled:t.shadowMap.enabled&&0<m.length,shadowMapType:t.shadowMap.type,toneMapping:r.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:2===r.side,flipSided:1===r.side,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.frawbuffers,extensionDrawbuffers:r.extensions&&r.extensions.drawbuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:i||null!==e.get("EXT_frag_depth"),rendererExtensionDrawBuffers:i||null!==e.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:i||null!==e.get("EXT_shader_texture_lod"),onBeforeCompile:r.onBeforeCompile}},this.getProgramCacheKey=function(e){var n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)n.push(r),n.push(e.defines[r]);if(void 0===e.isRawShaderMaterial){for(var i=0;i<p.length;i++)n.push(e[p[i]]);n.push(t.outputEncoding),n.push(t.gammaFactor)}return n.push(e.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(e,n){for(var i,o=0,a=r.length;o<a;o++){var s=r[o];if(s.cacheKey===n){++(i=s).usedTimes;break}}return void 0===i&&(i=new hi(t,n,e),r.push(i)),i},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=r.indexOf(t);r[e]=r[r.length-1],r.pop(),t.destroy()}},this.programs=r}function pi(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function fi(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function mi(){var t=[],e=0,n=[],r=[],i={id:-1};function o(n,r,o,a,s,l){var c=t[e];return void 0===c?(c={id:n.id,object:n,geometry:r,material:o,program:o.program||i,groupOrder:a,renderOrder:n.renderOrder,z:s,group:l},t[e]=c):(c.id=n.id,c.object=n,c.geometry=r,c.material=o,c.program=o.program||i,c.groupOrder=a,c.renderOrder=n.renderOrder,c.z=s,c.group=l),e++,c}return{opaque:n,transparent:r,init:function(){e=0,n.length=0,r.length=0},push:function(t,e,i,a,s,l){var c=o(t,e,i,a,s,l);(!0===i.transparent?r:n).push(c)},unshift:function(t,e,i,a,s,l){var c=o(t,e,i,a,s,l);(!0===i.transparent?r:n).unshift(c)},sort:function(t,e){1<n.length&&n.sort(t||pi),1<r.length&&r.sort(e||fi)}}}var gi=0;function yi(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function vi(){for(var t=new function(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new ht,color:new De,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new tt};break;case"SpotLight":n={position:new ht,direction:new ht,color:new De,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new tt};break;case"PointLight":n={position:new ht,color:new De,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new tt,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new ht,skyColor:new De,groundColor:new De};break;case"RectAreaLight":n={color:new De,position:new ht,halfWidth:new ht,halfHeight:new ht}}return t[e.id]=n}}},e={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:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},n=0;n<9;n++)e.probe.push(new ht);var r=new ht,i=new xt,o=new xt;return{setup:function(n,a,s){for(var l=0,c=0,u=0,h=0;h<9;h++)e.probe[h].set(0,0,0);var d=0,p=0,f=0,m=0,g=0,y=0,v=0,x=0,b=s.matrixWorldInverse;n.sort(yi),h=0;for(var w=n.length;h<w;h++){var M=n[h],_=M.color,C=M.intensity,S=M.distance,T=M.shadow&&M.shadow.map?M.shadow.map.texture:null;if(M.isAmbientLight)l+=_.r*C,c+=_.g*C,u+=_.b*C;else if(M.isLightProbe)for(var E=0;E<9;E++)e.probe[E].addScaledVector(M.sh.coefficients[E],C);else if(M.isDirectionalLight){if((A=t.get(M)).color.copy(M.color).multiplyScalar(M.intensity),A.direction.setFromMatrixPosition(M.matrixWorld),r.setFromMatrixPosition(M.target.matrixWorld),A.direction.sub(r),A.direction.transformDirection(b),A.shadow=M.castShadow,M.castShadow){var D=M.shadow;A.shadowBias=D.bias,A.shadowRadius=D.radius,A.shadowMapSize=D.mapSize,e.directionalShadowMap[d]=T,e.directionalShadowMatrix[d]=M.shadow.matrix,y++}e.directional[d]=A,d++}else if(M.isSpotLight)(A=t.get(M)).position.setFromMatrixPosition(M.matrixWorld),A.position.applyMatrix4(b),A.color.copy(_).multiplyScalar(C),A.distance=S,A.direction.setFromMatrixPosition(M.matrixWorld),r.setFromMatrixPosition(M.target.matrixWorld),A.direction.sub(r),A.direction.transformDirection(b),A.coneCos=Math.cos(M.angle),A.penumbraCos=Math.cos(M.angle*(1-M.penumbra)),A.decay=M.decay,A.shadow=M.castShadow,M.castShadow&&(D=M.shadow,A.shadowBias=D.bias,A.shadowRadius=D.radius,A.shadowMapSize=D.mapSize,e.spotShadowMap[f]=T,e.spotShadowMatrix[f]=M.shadow.matrix,x++),e.spot[f]=A,f++;else if(M.isRectAreaLight)(A=t.get(M)).color.copy(_).multiplyScalar(C),A.position.setFromMatrixPosition(M.matrixWorld),A.position.applyMatrix4(b),o.identity(),i.copy(M.matrixWorld),i.premultiply(b),o.extractRotation(i),A.halfWidth.set(.5*M.width,0,0),A.halfHeight.set(0,.5*M.height,0),A.halfWidth.applyMatrix4(o),A.halfHeight.applyMatrix4(o),e.rectArea[m]=A,m++;else if(M.isPointLight)(A=t.get(M)).position.setFromMatrixPosition(M.matrixWorld),A.position.applyMatrix4(b),A.color.copy(M.color).multiplyScalar(M.intensity),A.distance=M.distance,A.decay=M.decay,A.shadow=M.castShadow,M.castShadow&&(D=M.shadow,A.shadowBias=D.bias,A.shadowRadius=D.radius,A.shadowMapSize=D.mapSize,A.shadowCameraNear=D.camera.near,A.shadowCameraFar=D.camera.far,e.pointShadowMap[p]=T,e.pointShadowMatrix[p]=M.shadow.matrix,v++),e.point[p]=A,p++;else if(M.isHemisphereLight){var A;(A=t.get(M)).direction.setFromMatrixPosition(M.matrixWorld),A.direction.transformDirection(b),A.direction.normalize(),A.skyColor.copy(M.color).multiplyScalar(C),A.groundColor.copy(M.groundColor).multiplyScalar(C),e.hemi[g]=A,g++}}e.ambient[0]=l,e.ambient[1]=c,e.ambient[2]=u;var O=e.hash;O.directionalLength===d&&O.pointLength===p&&O.spotLength===f&&O.rectAreaLength===m&&O.hemiLength===g&&O.numDirectionalShadows===y&&O.numPointShadows===v&&O.numSpotShadows===x||(e.directional.length=d,e.spot.length=f,e.rectArea.length=m,e.point.length=p,e.hemi.length=g,e.directionalShadowMap.length=y,e.pointShadowMap.length=v,e.spotShadowMap.length=x,e.directionalShadowMatrix.length=y,e.pointShadowMatrix.length=v,e.spotShadowMatrix.length=x,O.directionalLength=d,O.pointLength=p,O.spotLength=f,O.rectAreaLength=m,O.hemiLength=g,O.numDirectionalShadows=y,O.numPointShadows=v,O.numSpotShadows=x,e.version=gi++)},state:e}}function xi(){var t=new vi,e=[],n=[];return{init:function(){e.length=0,n.length=0},state:{lightsArray:e,shadowsArray:n,lights:t},setupLights:function(r){t.setup(e,n,r)},pushLight:function(t){e.push(t)},pushShadow:function(t){n.push(t)}}}function bi(t){Ie.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,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 wi(t){Ie.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new ht,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)}function Mi(t,e,n){var r=new Gn,i=new tt,o=new tt,a=new ot,s=[],l=[],c={},h={0:1,1:0,2:2},d=new In({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new tt},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\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 #else\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 #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),f=d.clone();f.defines.HORIZONAL_PASS=1;var m=new nn;m.setAttribute("position",new Be(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var g=new wn(m,d),y=this;function v(n,r){var i=e.update(g);d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,i,d,g,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,i,f,g,null)}function x(t,e,n){var r=t<<0|e<<1|n<<2,i=s[r];return void 0===i&&(i=new bi({depthPacking:3201,morphTargets:t,skinning:e}),s[r]=i),i}function b(t,e,n){var r=t<<0|e<<1|n<<2,i=l[r];return void 0===i&&(i=new wi({morphTargets:t,skinning:e}),l[r]=i),i}function w(e,n,r,i,o,a){var s=e.geometry,l=null,u=x,d=e.customDepthMaterial;if(!0===r.isPointLight&&(u=b,d=e.customDistanceMaterial),void 0===d){var p=!1;!0===n.morphTargets&&(!0===s.isBufferGeometry?p=s.morphAttributes&&s.morphAttributes.position&&0<s.morphAttributes.position.length:!0===s.isGeometry&&(p=s.morphTargets&&0<s.morphTargets.length));var f=!1;!0===e.isSkinnedMesh&&(!0===n.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e)),l=u(p,f,!0===e.isInstancedMesh)}else l=d;if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var m=l.uuid,g=n.uuid,y=c[m];void 0===y&&(y={},c[m]=y);var v=y[g];void 0===v&&(v=l.clone(),y[g]=v),l=v}return l.visible=n.visible,l.wireframe=n.wireframe,l.side=3===a?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:h[n.side],l.clipShadows=n.clipShadows,l.clippingPlanes=n.clippingPlanes,l.clipIntersection=n.clipIntersection,l.wireframeLinewidth=n.wireframeLinewidth,l.linewidth=n.linewidth,!0===r.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(r.matrixWorld),l.nearDistance=i,l.farDistance=o),l}function M(n,i,o,a,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var l=e.update(n),c=n.material;if(Array.isArray(c))for(var u=l.groups,h=0,d=u.length;h<d;h++){var p=u[h],f=c[p.materialIndex];if(f&&f.visible){var m=w(n,f,a,o.near,o.far,s);t.renderBufferDirect(o,null,l,m,n,p)}}else c.visible&&(m=w(n,c,a,o.near,o.far,s),t.renderBufferDirect(o,null,l,m,n,null))}for(var g=n.children,y=0,v=g.length;y<v;y++)M(g[y],i,o,a,s)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(e,s,l){if(!1!==y.enabled&&(!1!==y.autoUpdate||!1!==y.needsUpdate)&&0!==e.length){var c=t.getRenderTarget(),h=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),f=t.state;f.setBlending(0),f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);for(var m=0,g=e.length;m<g;m++){var x=e[m],b=x.shadow;if(void 0!==b){i.copy(b.mapSize);var w=b.getFrameExtents();if(i.multiply(w),o.copy(b.mapSize),(i.x>n||i.y>n)&&(console.warn("THREE.WebGLShadowMap:",x,"has shadow exceeding max texture size, reducing"),i.x>n&&(o.x=Math.floor(n/w.x),i.x=o.x*w.x,b.mapSize.x=o.x),i.y>n&&(o.y=Math.floor(n/w.y),i.y=o.y*w.y,b.mapSize.y=o.y)),null===b.map&&!b.isPointLightShadow&&3===this.type){var C={minFilter:p,magFilter:p,format:_};b.map=new at(i.x,i.y,C),b.map.texture.name=x.name+".shadowMap",b.mapPass=new at(i.x,i.y,C),b.camera.updateProjectionMatrix()}null===b.map&&(C={minFilter:u,magFilter:u,format:_},b.map=new at(i.x,i.y,C),b.map.texture.name=x.name+".shadowMap",b.camera.updateProjectionMatrix()),t.setRenderTarget(b.map),t.clear();for(var S=b.getViewportCount(),T=0;T<S;T++){var E=b.getViewport(T);a.set(o.x*E.x,o.y*E.y,o.x*E.z,o.y*E.w),f.viewport(a),b.updateMatrices(x,T),r=b.getFrustum(),M(s,l,b.camera,x,this.type)}b.isPointLightShadow||3!==this.type||v(b,l)}else console.warn("THREE.WebGLShadowMap:",x,"has no shadow.")}y.needsUpdate=!1,t.setRenderTarget(c,h,d)}}}function _i(t,n,r){var i=r.isWebGL2,o=new function(){var e=!1,n=new ot,r=null,i=new ot(0,0,0,0);return{setMask:function(n){r===n||e||(t.colorMask(n,n,n,n),r=n)},setLocked:function(t){e=t},setClear:function(e,r,o,a,s){!0===s&&(e*=a,r*=a,o*=a),n.set(e,r,o,a),!1===i.equals(n)&&(t.clearColor(e,r,o,a),i.copy(n))},reset:function(){e=!1,r=null,i.set(-1,0,0,0)}}},a=new function(){var e=!1,n=null,r=null,i=null;return{setTest:function(t){(t?N:z)(2929)},setMask:function(r){n===r||e||(t.depthMask(r),n=r)},setFunc:function(e){if(r!==e){if(e)switch(e){case 0:t.depthFunc(512);break;case 1:t.depthFunc(519);break;case 2:t.depthFunc(513);break;case 3:default:t.depthFunc(515);break;case 4:t.depthFunc(514);break;case 5:t.depthFunc(518);break;case 6:t.depthFunc(516);break;case 7:t.depthFunc(517)}else t.depthFunc(515);r=e}},setLocked:function(t){e=t},setClear:function(e){i!==e&&(t.clearDepth(e),i=e)},reset:function(){e=!1,i=r=n=null}}},s=new function(){var e=!1,n=null,r=null,i=null,o=null,a=null,s=null,l=null,c=null;return{setTest:function(t){e||(t?N:z)(2960)},setMask:function(r){n===r||e||(t.stencilMask(r),n=r)},setFunc:function(e,n,a){r===e&&i===n&&o===a||(t.stencilFunc(e,n,a),r=e,i=n,o=a)},setOp:function(e,n,r){a===e&&s===n&&l===r||(t.stencilOp(e,n,r),a=e,s=n,l=r)},setLocked:function(t){e=t},setClear:function(e){c!==e&&(t.clearStencil(e),c=e)},reset:function(){e=!1,c=l=s=a=o=i=r=n=null}}},l=t.getParameter(34921),c=new Uint8Array(l),u=new Uint8Array(l),h=new Uint8Array(l),d={},p=null,f=null,m=null,g=null,y=null,v=null,x=null,b=null,w=null,M=!1,_=null,C=null,S=null,T=null,E=null,D=t.getParameter(35661),A=!1,O=0,P=t.getParameter(7938);-1!==P.indexOf("WebGL")?(O=parseFloat(/^WebGL\ ([0-9])/.exec(P)[1]),A=1<=O):-1!==P.indexOf("OpenGL ES")&&(O=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(P)[1]),A=2<=O);var L=null,R={},I=new ot,k=new ot;function F(e,n,r){var i=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var a=0;a<r;a++)t.texImage2D(n+a,0,6408,1,1,0,6408,5121,i);return o}var B={};function j(e,r){c[e]=1,0===u[e]&&(t.enableVertexAttribArray(e),u[e]=1),h[e]!==r&&((i?t:n.get("ANGLE_instanced_arrays"))[i?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](e,r),h[e]=r)}function N(e){!0!==d[e]&&(t.enable(e),d[e]=!0)}function z(e){!1!==d[e]&&(t.disable(e),d[e]=!1)}B[3553]=F(3553,3553,1),B[34067]=F(34067,34069,6),o.setClear(0,0,0,1),a.setClear(1),s.setClear(0),N(2929),a.setFunc(3),W(!1),J(1),N(2884),U(0);var V={100:32774,101:32778,102:32779};if(i)V[103]=32775,V[104]=32776;else{var G=n.get("EXT_blend_minmax");null!==G&&(V[103]=G.MIN_EXT,V[104]=G.MAX_EXT)}var H={};function U(n,r,i,o,a,s,l,c){if(0!==n){if(f||(N(3042),f=!0),5===n)a=a||r,s=s||i,l=l||o,r===g&&a===x||(t.blendEquationSeparate(V[r],V[a]),g=r,x=a),i===y&&o===v&&s===b&&l===w||(t.blendFuncSeparate(H[i],H[o],H[s],H[l]),y=i,v=o,b=s,w=l),m=n,M=null;else if(n!==m||c!==M){if(g===e&&x===e||(t.blendEquation(32774),x=g=e),c)switch(n){case 1:t.blendFuncSeparate(1,771,1,771);break;case 2:t.blendFunc(1,1);break;case 3:t.blendFuncSeparate(0,0,769,771);break;case 4:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",n)}else switch(n){case 1:t.blendFuncSeparate(770,771,1,771);break;case 2:t.blendFunc(770,1);break;case 3:t.blendFunc(0,769);break;case 4:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",n)}w=b=v=y=null,m=n,M=c}}else f&&(z(3042),f=!1)}function W(e){_!==e&&(e?t.frontFace(2304):t.frontFace(2305),_=e)}function J(e){0!==e?(N(2884),e!==C&&(1===e?t.cullFace(1029):2===e?t.cullFace(1028):t.cullFace(1032))):z(2884),C=e}function q(e,n,r){e?(N(32823),T===n&&E===r||(t.polygonOffset(n,r),T=n,E=r)):z(32823)}function X(e){void 0===e&&(e=33984+D-1),L!==e&&(t.activeTexture(e),L=e)}return H[200]=0,H[201]=1,H[202]=768,H[204]=770,H[210]=776,H[208]=774,H[206]=772,H[203]=769,H[205]=771,H[209]=775,H[207]=773,{buffers:{color:o,depth:a,stencil:s},initAttributes:function(){for(var t=0,e=c.length;t<e;t++)c[t]=0},enableAttribute:function(t){j(t,0)},enableAttributeAndDivisor:j,disableUnusedAttributes:function(){for(var e=0,n=u.length;e!==n;++e)u[e]!==c[e]&&(t.disableVertexAttribArray(e),u[e]=0)},enable:N,disable:z,useProgram:function(e){return p!==e&&(t.useProgram(e),p=e,!0)},setBlending:U,setMaterial:function(t,e){(2===t.side?z:N)(2884);var n=1===t.side;e&&(n=!n),W(n),1===t.blending&&!1===t.transparent?U(0):U(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),a.setFunc(t.depthFunc),a.setTest(t.depthTest),a.setMask(t.depthWrite),o.setMask(t.colorWrite);var r=t.stencilWrite;s.setTest(r),r&&(s.setMask(t.stencilWriteMask),s.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),s.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),q(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:W,setCullFace:J,setLineWidth:function(e){e!==S&&(A&&t.lineWidth(e),S=e)},setPolygonOffset:q,setScissorTest:function(t){(t?N:z)(3089)},activeTexture:X,bindTexture:function(e,n){null===L&&X();var r=R[L];void 0===r&&(r={type:void 0,texture:void 0},R[L]=r),r.type===e&&r.texture===n||(t.bindTexture(e,n||B[e]),r.type=e,r.texture=n)},unbindTexture:function(){var e=R[L];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===I.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),I.copy(e))},viewport:function(e){!1===k.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),k.copy(e))},reset:function(){for(var e=0;e<u.length;e++)1===u[e]&&(t.disableVertexAttribArray(e),u[e]=0);d={},R={},C=_=m=p=L=null,o.reset(),a.reset(),s.reset()}}}function Ci(t,e,n,r,i,o,a){var s,c=i.isWebGL2,g=i.maxTextures,T=i.maxCubemapSize,E=i.maxTextureSize,D=i.maxSamples,A=new WeakMap,O=!1;try{O="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function P(t,e){return O?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function L(t,e,n,r){var i=1;if((t.width>r||t.height>r)&&(i=r/Math.max(t.width,t.height)),i<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var o=e?Q.floorPowerOfTwo:Math.floor,a=o(i*t.width),l=o(i*t.height);void 0===s&&(s=P(a,l));var c=n?P(a,l):s;return c.width=a,c.height=l,c.getContext("2d").drawImage(t,0,0,a,l),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+a+"x"+l+")."),c}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function R(t){return Q.isPowerOfTwo(t.width)&&Q.isPowerOfTwo(t.height)}function I(t,e){return t.generateMipmaps&&e&&t.minFilter!==u&&t.minFilter!==p}function k(e,n,i,o){t.generateMipmap(e),r.get(n).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}function F(n,r,i){if(!1===c)return r;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325===o||33326===o||34842===o||34836===o?e.get("EXT_color_buffer_float"):34843!==o&&34837!==o||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),o}function B(t){return t===u||t===h||t===d?9728:9729}function j(e){var n=e.target;n.removeEventListener("dispose",j),function(e){var n=r.get(e);void 0!==n.__webglInit&&(t.deleteTexture(n.__webglTexture),r.remove(e))}(n),n.isVideoTexture&&A.delete(n),a.memory.textures--}function N(e){var n=e.target;n.removeEventListener("dispose",N),function(e){var n=r.get(e),i=r.get(e.texture);if(e){if(void 0!==i.__webglTexture&&t.deleteTexture(i.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(var o=0;o<6;o++)t.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[o]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer);if(e.isWebGLMultiviewRenderTarget){t.deleteTexture(n.__webglColorTexture),t.deleteTexture(n.__webglDepthStencilTexture),a.memory.textures-=2,o=0;for(var s=n.__webglViewFramebuffers.length;o<s;o++)t.deleteFramebuffer(n.__webglViewFramebuffers[o])}r.remove(e.texture),r.remove(e)}}(n),a.memory.textures--}var z=0;function V(t,e){var i,o,s=r.get(t);if(t.isVideoTexture&&(i=t,o=a.render.frame,A.get(i)!==o&&(A.set(i,o),i.update())),0<t.version&&s.__version!==t.version){var l=t.image;if(void 0===l)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==l.complete)return void X(s,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,s.__webglTexture)}function G(e,i){if(6===e.image.length){var a=r.get(e);if(0<e.version&&a.__version!==e.version){q(a,e),n.activeTexture(33984+i),n.bindTexture(34067,a.__webglTexture),t.pixelStorei(37440,e.flipY);for(var s=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),l=e.image[0]&&e.image[0].isDataTexture,u=[],h=0;h<6;h++)u[h]=s||l?l?e.image[h].image:e.image[h]:L(e.image[h],!1,!0,T);var d,p=u[0],f=R(p)||c,m=o.convert(e.format),g=o.convert(e.type),y=F(e.internalFormat,m,g);if(J(34067,e,f),s){for(h=0;h<6;h++){d=u[h].mipmaps;for(var v=0;v<d.length;v++){var x=d[v];e.format!==_&&e.format!==M?null!==m?n.compressedTexImage2D(34069+h,v,y,x.width,x.height,0,x.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+h,v,y,x.width,x.height,0,m,g,x.data)}}a.__maxMipLevel=d.length-1}else{for(d=e.mipmaps,h=0;h<6;h++)if(l)for(n.texImage2D(34069+h,0,y,u[h].width,u[h].height,0,m,g,u[h].data),v=0;v<d.length;v++){var b=(x=d[v]).image[h].image;n.texImage2D(34069+h,v+1,y,b.width,b.height,0,m,g,b.data)}else for(n.texImage2D(34069+h,0,y,m,g,u[h]),v=0;v<d.length;v++)x=d[v],n.texImage2D(34069+h,v+1,y,m,g,x.image[h]);a.__maxMipLevel=d.length}I(e,f)&&k(34067,e,p.width,p.height),a.__version=e.version,e.onUpdate&&e.onUpdate(e)}else n.activeTexture(33984+i),n.bindTexture(34067,a.__webglTexture)}}function H(t,e){n.activeTexture(33984+e),n.bindTexture(34067,r.get(t).__webglTexture)}var U={1000:10497,1001:33071,1002:33648},W={};function J(n,o,a){a?(t.texParameteri(n,10242,U[o.wrapS]),t.texParameteri(n,10243,U[o.wrapT]),32879!==n&&35866!==n||t.texParameteri(n,32882,U[o.wrapR]),t.texParameteri(n,10240,W[o.magFilter]),t.texParameteri(n,10241,W[o.minFilter])):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),o.wrapS===l&&o.wrapT===l||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,10240,B(o.magFilter)),t.texParameteri(n,10241,B(o.minFilter)),o.minFilter!==u&&o.minFilter!==p&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=e.get("EXT_texture_filter_anisotropic");if(s){if(o.type===x&&null===e.get("OES_texture_float_linear"))return;if(o.type===b&&null===(c||e.get("OES_texture_half_float_linear")))return;(1<o.anisotropy||r.get(o).__currentAnisotropy)&&(t.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function q(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",j),e.__webglTexture=t.createTexture(),a.memory.textures++)}function X(e,r,i){var a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),q(e,r),n.activeTexture(33984+i),n.bindTexture(a,e.__webglTexture),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment);var s,h=(s=r,!c&&(s.wrapS!==l||s.wrapT!==l||s.minFilter!==u&&s.minFilter!==p)&&!1===R(r.image)),d=L(r.image,h,!1,E),f=R(d)||c,m=o.convert(r.format),g=o.convert(r.type),b=F(r.internalFormat,m,g);J(a,r,f);var T,D=r.mipmaps;if(r.isDepthTexture){if(b=6402,r.type===x){if(!1===c)throw new Error("Float Depth Texture only supported in WebGL2.0");b=36012}else c&&(b=33189);r.format===C&&6402===b&&r.type!==y&&r.type!==v&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=y,g=o.convert(r.type)),r.format===S&&(b=34041,r.type!==w&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=w,g=o.convert(r.type))),n.texImage2D(3553,0,b,d.width,d.height,0,m,g,null)}else if(r.isDataTexture)if(0<D.length&&f){for(var A=0,O=D.length;A<O;A++)T=D[A],n.texImage2D(3553,A,b,T.width,T.height,0,m,g,T.data);r.generateMipmaps=!1,e.__maxMipLevel=D.length-1}else n.texImage2D(3553,0,b,d.width,d.height,0,m,g,d.data),e.__maxMipLevel=0;else if(r.isCompressedTexture){for(A=0,O=D.length;A<O;A++)T=D[A],r.format!==_&&r.format!==M?null!==m?n.compressedTexImage2D(3553,A,b,T.width,T.height,0,T.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,A,b,T.width,T.height,0,m,g,T.data);e.__maxMipLevel=D.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,b,d.width,d.height,d.depth,0,m,g,d.data),e.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,b,d.width,d.height,d.depth,0,m,g,d.data),e.__maxMipLevel=0;else if(0<D.length&&f){for(A=0,O=D.length;A<O;A++)T=D[A],n.texImage2D(3553,A,b,m,g,T);r.generateMipmaps=!1,e.__maxMipLevel=D.length-1}else n.texImage2D(3553,0,b,m,g,d),e.__maxMipLevel=0;I(r,f)&&k(a,r,d.width,d.height),e.__version=r.version,r.onUpdate&&r.onUpdate(r)}function Y(e,i,a,s){var l=o.convert(i.texture.format),c=o.convert(i.texture.type),u=F(i.texture.internalFormat,l,c);n.texImage2D(s,0,u,i.width,i.height,0,l,c,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,a,s,r.get(i.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function Z(e,n,r){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){if(r){var i=K(n);t.renderbufferStorageMultisample(36161,i,33189,n.width,n.height)}else t.renderbufferStorage(36161,33189,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer)r?(i=K(n),t.renderbufferStorageMultisample(36161,i,35056,n.width,n.height)):t.renderbufferStorage(36161,34041,n.width,n.height),t.framebufferRenderbuffer(36160,33306,36161,e);else{var a=o.convert(n.texture.format),s=o.convert(n.texture.type),l=F(n.texture.internalFormat,a,s);r?(i=K(n),t.renderbufferStorageMultisample(36161,i,l,n.width,n.height)):t.renderbufferStorage(36161,l,n.width,n.height)}t.bindRenderbuffer(36161,null)}function $(e){var n=r.get(e),i=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&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),V(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===C)t.framebufferTexture2D(36160,36096,3553,i,0);else{if(n.depthTexture.format!==S)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,i,0)}}(n.__webglFramebuffer,e)}else if(i){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(36160,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=t.createRenderbuffer(),Z(n.__webglDepthbuffer[o],e)}else t.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),Z(n.__webglDepthbuffer,e);t.bindFramebuffer(36160,null)}function K(t){return c&&t.isWebGLMultisampleRenderTarget?Math.min(D,t.samples):0}W[u]=9728,W[h]=9984,W[d]=9986,W[p]=9729,W[f]=9985;var tt=!(W[m]=9987),et=!1;this.allocateTextureUnit=function(){var t=z;return g<=t&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+g),z+=1,t},this.resetTextureUnits=function(){z=0},this.setTexture2D=V,this.setTexture2DArray=function(t,e){var i=r.get(t);0<t.version&&i.__version!==t.version?X(i,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(t,e){var i=r.get(t);0<t.version&&i.__version!==t.version?X(i,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=G,this.setTextureCubeDynamic=H,this.setupRenderTarget=function(i){var s=r.get(i),l=r.get(i.texture);i.addEventListener("dispose",N),l.__webglTexture=t.createTexture(),a.memory.textures++;var u=!0===i.isWebGLCubeRenderTarget,h=!0===i.isWebGLMultisampleRenderTarget,d=!0===i.isWebGLMultiviewRenderTarget,p=R(i)||c;if(u){s.__webglFramebuffer=[];for(var f=0;f<6;f++)s.__webglFramebuffer[f]=t.createFramebuffer()}else if(s.__webglFramebuffer=t.createFramebuffer(),h)if(c){s.__webglMultisampledFramebuffer=t.createFramebuffer(),s.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,s.__webglColorRenderbuffer);var m=o.convert(i.texture.format),g=o.convert(i.texture.type),y=F(i.texture.internalFormat,m,g),v=K(i);t.renderbufferStorageMultisample(36161,v,y,i.width,i.height),t.bindFramebuffer(36160,s.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,s.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),i.depthBuffer&&(s.__webglDepthRenderbuffer=t.createRenderbuffer(),Z(s.__webglDepthRenderbuffer,i,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(d){var x=i.width,b=i.height,w=i.numViews;t.bindFramebuffer(36160,s.__webglFramebuffer);var M=e.get("OVR_multiview2");a.memory.textures+=2;var _=t.createTexture();t.bindTexture(35866,_),t.texParameteri(35866,10240,9728),t.texParameteri(35866,10241,9728),t.texImage3D(35866,0,32856,x,b,w,0,6408,5121,null),M.framebufferTextureMultiviewOVR(36160,36064,_,0,0,w);var C=t.createTexture();t.bindTexture(35866,C),t.texParameteri(35866,10240,9728),t.texParameteri(35866,10241,9728),t.texImage3D(35866,0,35056,x,b,w,0,34041,34042,null),M.framebufferTextureMultiviewOVR(36160,33306,C,0,0,w);var S=new Array(w);for(f=0;f<w;++f)S[f]=t.createFramebuffer(),t.bindFramebuffer(36160,S[f]),t.framebufferTextureLayer(36160,36064,_,0,f);s.__webglColorTexture=_,s.__webglDepthStencilTexture=C,s.__webglViewFramebuffers=S,t.bindFramebuffer(36160,null),t.bindTexture(35866,null)}if(u){for(n.bindTexture(34067,l.__webglTexture),J(34067,i.texture,p),f=0;f<6;f++)Y(s.__webglFramebuffer[f],i,36064,34069+f);I(i.texture,p)&&k(34067,i.texture,i.width,i.height),n.bindTexture(34067,null)}else d||(n.bindTexture(3553,l.__webglTexture),J(3553,i.texture,p),Y(s.__webglFramebuffer,i,36064,3553),I(i.texture,p)&&k(3553,i.texture,i.width,i.height),n.bindTexture(3553,null));i.depthBuffer&&$(i)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(I(e,R(t)||c)){var i=t.isWebGLCubeRenderTarget?34067:3553,o=r.get(e).__webglTexture;n.bindTexture(i,o),k(i,e,t.width,t.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(c){var n=r.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);var i=e.width,o=e.height,a=16384;e.depthBuffer&&(a|=256),e.stencilBuffer&&(a|=1024),t.blitFramebuffer(0,0,i,o,0,0,i,o,a,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===tt&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),tt=!0),t=t.texture),V(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===et&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),et=!0),t=t.texture),(t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?G:H)(t,e)}}function Si(t,e,n){var r=n.isWebGL2;return{convert:function(t){var n;if(t===g)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(t===y)return 5123;if(1013===t)return 5124;if(t===v)return 5125;if(t===x)return 5126;if(t===b)return r?5131:null!==(n=e.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(1021===t)return 6406;if(t===M)return 6407;if(t===_)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(t===C)return 6402;if(t===S)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(t===T||t===E||t===D||t===A){if(null===(n=e.get("WEBGL_compressed_texture_s3tc")))return null;if(t===T)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===E)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===D)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===A)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===O||t===P||t===L||t===R){if(null===(n=e.get("WEBGL_compressed_texture_pvrtc")))return null;if(t===O)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===P)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===L)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===R)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}return 36196===t?null!==(n=e.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null:37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t?null!==(n=e.get("WEBGL_compressed_texture_astc"))?t:null:t===w?r?34042:null!==(n=e.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function Ti(t,e,n,r){at.call(this,t,e,r),this.depthBuffer=!1,this.stencilBuffer=!1,this.numViews=n}function Ei(t,e){var n,r,i,o,a,s,l,c=t.extensions,u=t.properties,h=0;function d(t){return t.isArrayCamera?t.cameras:(a[0]=t,a)}this.isAvailable=function(){if(void 0===l){var t=c.get("OVR_multiview2");if(l=null!==t&&!1===e.getContextAttributes().antialias){h=e.getParameter(t.MAX_VIEWS_OVR),n=new Ti(0,0,2),s=new tt,o=[],i=[],a=[];for(var r=0;r<h;r++)o[r]=new xt,i[r]=new et}}return l},this.attachCamera=function(e){!1!==function(t){if(void 0===t.isArrayCamera)return!0;var e=t.cameras;if(e.length>h)return!1;for(var n=1,r=e.length;n<r;n++)if(e[0].viewport.z!==e[n].viewport.z||e[0].viewport.w!==e[n].viewport.w)return!1;return!0}(e)&&(r=t.getRenderTarget(),function(e){if(r?s.set(r.width,r.height):t.getDrawingBufferSize(s),e.isArrayCamera){var i=e.cameras[0].viewport;n.setSize(i.z,i.w),n.setNumViews(e.cameras.length)}else n.setSize(s.x,s.y),n.setNumViews(2)}(e),t.setRenderTarget(n))},this.detachCamera=function(i){n===t.getRenderTarget()&&(t.setRenderTarget(r),function(t){var r=n,i=r.numViews,o=u.get(r).__webglViewFramebuffers,a=r.width,l=r.height;if(t.isArrayCamera)for(var c=0;c<i;c++){var h=t.cameras[c].viewport,d=h.x,p=h.y,f=d+h.z,m=p+h.w;e.bindFramebuffer(36008,o[c]),e.blitFramebuffer(0,0,a,l,d,p,f,m,16384,9728)}else e.bindFramebuffer(36008,o[0]),e.blitFramebuffer(0,0,a,l,0,0,s.x,s.y,16384,9728)}(i))},this.updateCameraProjectionMatricesUniform=function(t,n){for(var r=d(t),i=0;i<r.length;i++)o[i].copy(r[i].projectionMatrix);n.setValue(e,"projectionMatrices",o)},this.updateCameraViewMatricesUniform=function(t,n){for(var r=d(t),i=0;i<r.length;i++)o[i].copy(r[i].matrixWorldInverse);n.setValue(e,"viewMatrices",o)},this.updateObjectMatricesUniforms=function(t,n,r){for(var a=d(n),s=0;s<a.length;s++)o[s].multiplyMatrices(a[s].matrixWorldInverse,t.matrixWorld),i[s].getNormalMatrix(o[s]);r.setValue(e,"modelViewMatrices",o),r.setValue(e,"normalMatrices",i)}}function Di(t){Fn.call(this),this.cameras=t||[]}function Ai(){Bt.call(this),this.type="Group"}function Oi(t,e){var n=this,r=null,i=null,o="local-floor",a=null,s=[],l=new Map,c=new Fn;c.layers.enable(1),c.viewport=new ot;var u=new Fn;u.layers.enable(2),u.viewport=new ot;var h=new Di([c,u]);h.layers.enable(1),h.layers.enable(2);var d=null,p=null;function f(t){var e=l.get(t.inputSource);e&&(e.targetRay&&e.targetRay.dispatchEvent({type:t.type}),e.grip&&e.grip.dispatchEvent({type:t.type}))}function m(){l.forEach(function(t,e){t.targetRay&&(t.targetRay.dispatchEvent({type:"disconnected",data:e}),t.targetRay.visible=!1),t.grip&&(t.grip.dispatchEvent({type:"disconnected",data:e}),t.grip.visible=!1)}),l.clear(),t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),M.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function g(t){i=t,M.setContext(r),M.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function y(t){for(var e=r.inputSources,n=0;n<s.length;n++)l.set(e[n],s[n]);for(n=0;n<t.removed.length;n++){var i=t.removed[n];(o=l.get(i))&&(o.targetRay&&o.targetRay.dispatchEvent({type:"disconnected",data:i}),o.grip&&o.grip.dispatchEvent({type:"disconnected",data:i}),l.delete(i))}for(n=0;n<t.added.length;n++){var o;i=t.added[n],(o=l.get(i))&&(o.targetRay&&o.targetRay.dispatchEvent({type:"connected",data:i}),o.grip&&o.grip.dispatchEvent({type:"connected",data:i}))}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){var e=s[t];return void 0===e&&(e={},s[t]=e),void 0===e.targetRay&&(e.targetRay=new Ai,e.targetRay.matrixAutoUpdate=!1,e.targetRay.visible=!1),e.targetRay},this.getControllerGrip=function(t){var e=s[t];return void 0===e&&(e={},s[t]=e),void 0===e.grip&&(e.grip=new Ai,e.grip.matrixAutoUpdate=!1,e.grip.visible=!1),e.grip},this.setFramebufferScaleFactor=function(){},this.setReferenceSpaceType=function(t){o=t},this.getReferenceSpace=function(){return i},this.getSession=function(){return r},this.setSession=function(t){if(null!==(r=t)){r.addEventListener("select",f),r.addEventListener("selectstart",f),r.addEventListener("selectend",f),r.addEventListener("squeeze",f),r.addEventListener("squeezestart",f),r.addEventListener("squeezeend",f),r.addEventListener("end",m);var n=e.getContextAttributes(),i={antialias:n.antialias,alpha:n.alpha,depth:n.depth,stencil:n.stencil},a=new XRWebGLLayer(r,e,i);r.updateRenderState({baseLayer:a}),r.requestReferenceSpace(o).then(g),r.addEventListener("inputsourceschange",y)}};var v=new ht,x=new ht;function b(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}this.getCamera=function(t){h.near=u.near=c.near=t.near,h.far=u.far=c.far=t.far,d===h.near&&p===h.far||(r.updateRenderState({depthNear:h.near,depthFar:h.far}),d=h.near,p=h.far);var e=t.parent,n=h.cameras;b(h,e);for(var i=0;i<n.length;i++)b(n[i],e);t.matrixWorld.copy(h.matrixWorld);for(var o=t.children,a=(i=0,o.length);i<a;i++)o[i].updateMatrixWorld(!0);return function(t,e,n){v.setFromMatrixPosition(e.matrixWorld),x.setFromMatrixPosition(n.matrixWorld);var r=v.distanceTo(x),i=e.projectionMatrix.elements,o=n.projectionMatrix.elements,a=i[14]/(i[10]-1),s=i[14]/(i[10]+1),l=(i[9]+1)/i[5],c=(i[9]-1)/i[5],u=(i[8]-1)/i[0],h=(o[8]+1)/o[0],d=a*u,p=a*h,f=r/(h-u),m=f*-u;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var g=a+f,y=s+f,b=d-m,w=r-m+p,M=l*s/y*g,_=c*s/y*g;t.projectionMatrix.makePerspective(b,w,M,_,g,y)}(h,c,u),h};var w=null,M=new Un;M.setAnimationLoop(function(e,n){if(null!==(a=n.getViewerPose(i))){var o=a.views,l=r.renderState.baseLayer;t.setFramebuffer(l.framebuffer);for(var c=0;c<o.length;c++){var u=o[c],d=l.getViewport(u),p=h.cameras[c];p.matrix.fromArray(u.transform.matrix),p.projectionMatrix.fromArray(u.projectionMatrix),p.viewport.set(d.x,d.y,d.width,d.height),0===c&&h.matrix.copy(p.matrix)}}var f=r.inputSources;for(c=0;c<s.length;c++){var m=s[c],g=f[c],y=null,v=null;g&&(m.targetRay&&null!==(y=n.getPose(g.targetRaySpace,i))&&(m.targetRay.matrix.fromArray(y.transform.matrix),m.targetRay.matrix.decompose(m.targetRay.position,m.targetRay.rotation,m.targetRay.scale)),m.grip&&g.gripSpace&&null!==(v=n.getPose(g.gripSpace,i))&&(m.grip.matrix.fromArray(v.transform.matrix),m.grip.matrix.decompose(m.grip.position,m.grip.rotation,m.grip.scale))),m.targetRay&&(m.targetRay.visible=null!==y),m.grip&&(m.grip.visible=null!==v)}w&&w(e,n)}),this.setAnimationLoop=function(t){w=t},this.dispose=function(){}}function Pi(t){var e=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==t.context?t.context:null,r=void 0!==t.alpha&&t.alpha,i=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,a=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,c=void 0!==t.powerPreference?t.powerPreference:"default",u=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,h=null,d=null;this.domElement=e,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=N,this.physicallyCorrectLights=!1,this.toneMapping=1,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var p,f,m,y,v,w,M,C,S,T,E,D,A,O,P,L,R,I,k=this,F=!1,B=null,j=0,z=0,V=null,G=null,H=-1,U={geometry:null,program:null,wireframe:!1},W=null,J=null,q=new ot,X=new ot,Y=null,Z=e.width,$=e.height,K=1,et=null,nt=null,rt=new ot(0,0,Z,$),it=new ot(0,0,Z,$),at=!1,st=new Gn,lt=new Zn,ct=!1,ut=!1,dt=new xt,pt=new ht;function ft(){return null===V?K:1}try{var mt={alpha:r,depth:i,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u,xrCompatible:!0};e.addEventListener("webglcontextlost",Mt,!1),e.addEventListener("webglcontextrestored",_t,!1);var gt="webgl";if(!0===t.webgl2&&(gt="webgl2"),null===(p=n||e.getContext(gt,mt)||e.getContext("experimental-webgl",mt)))throw null!==e.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");t.retver=gt,void 0===p.getShaderPrecisionFormat&&(p.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function yt(){f=new function(t){var e={};return{get:function(n){if(void 0!==e[n])return e[n];var r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(n)}return null===r&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),e[n]=r}}}(p),!1===(m=new function(t,e,n){var r;function i(e){if("highp"===e){if(0<t.getShaderPrecisionFormat(35633,36338).precision&&0<t.getShaderPrecisionFormat(35632,36338).precision)return"highp";e="mediump"}return"mediump"===e&&0<t.getShaderPrecisionFormat(35633,36337).precision&&0<t.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,a=void 0!==n.precision?n.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var l=!0===n.logarithmicDepthBuffer,c=t.getParameter(34930),u=t.getParameter(35660),h=t.getParameter(3379),d=t.getParameter(34076),p=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),y=0<u,v=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=e.get("EXT_texture_filter_anisotropic");return r=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:y,floatFragmentTextures:v,floatVertexTextures:y&&v,maxSamples:o?t.getParameter(36183):0}}(p,f,t)).isWebGL2&&(f.get("WEBGL_depth_texture"),f.get("OES_texture_float"),f.get("OES_texture_half_float"),f.get("OES_texture_half_float_linear"),f.get("OES_standard_derivatives"),f.get("OES_element_index_uint"),f.get("ANGLE_instanced_arrays")),f.get("OES_texture_float_linear"),I=new Si(0,f,m),(y=new _i(p,f,m)).scissor(X.copy(it).multiplyScalar(K).floor()),y.viewport(q.copy(rt).multiplyScalar(K).floor()),v=new function(t){var e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,n,r){switch(r=r||1,e.calls++,n){case 4:e.triangles+=r*(t/3);break;case 1:e.lines+=r*(t/2);break;case 3:e.lines+=r*(t-1);break;case 2:e.lines+=r*t;break;case 0:e.points+=r*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}},w=new function(){var t=new WeakMap;return{get:function(e){var n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,r){t.get(e)[n]=r},dispose:function(){t=new WeakMap}}},M=new Ci(p,f,y,w,m,I,v),C=new function(t,e){var n=e.isWebGL2,r=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),r.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var n=r.get(e);n&&(t.deleteBuffer(n.buffer),r.delete(e))},update:function(e,i){e.isInterleavedBufferAttribute&&(e=e.data);var o,a,s,l,c,u=r.get(e);void 0===u?r.set(e,function(e,n){var r=e.array,i=e.usage,o=t.createBuffer();t.bindBuffer(n,o),t.bufferData(n,r,i),e.onUploadCallback();var a=5126;return r instanceof Float32Array?a=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?a=5123:r instanceof Int16Array?a=5122:r instanceof Uint32Array?a=5125:r instanceof Int32Array?a=5124:r instanceof Int8Array?a=5120:r instanceof Uint8Array&&(a=5121),{buffer:o,type:a,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version}}(e,i)):u.version<e.version&&(o=u.buffer,s=i,l=(a=e).array,c=a.updateRange,t.bindBuffer(s,o),-1===c.count?t.bufferSubData(s,0,l):(n?t.bufferSubData(s,c.offset*l.BYTES_PER_ELEMENT,l,c.offset,c.count):t.bufferSubData(s,c.offset*l.BYTES_PER_ELEMENT,l.subarray(c.offset,c.offset+c.count)),c.count=-1),u.version=e.version)}}}(p,m),S=new function(t,e,n){var r=new WeakMap,i=new WeakMap;function o(t){var a=t.target,s=r.get(a);for(var l in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[l]);a.removeEventListener("dispose",o),r.delete(a);var c=i.get(s);c&&(e.remove(c),i.delete(s)),n.memory.geometries--}function a(t){var n=[],r=t.index,o=t.attributes.position,a=0;if(null!==r){var s=r.array;a=r.version;for(var l=0,c=s.length;l<c;l+=3){var u=s[l+0],h=s[l+1],d=s[l+2];n.push(u,h,h,d,d,u)}}else for(s=o.array,a=o.version,l=0,c=s.length/3-1;l<c;l+=3)u=l+0,h=l+1,d=l+2,n.push(u,h,h,d,d,u);var p=new(65535<Xe(n)?Ue:Ge)(n,1);p.version=a,e.update(p,34963);var f=i.get(t);f&&e.remove(f),i.set(t,p)}return{get:function(t,e){var i=r.get(e);return i||(e.addEventListener("dispose",o),e.isBufferGeometry?i=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new nn).setFromObject(t)),i=e._bufferGeometry),r.set(e,i),n.memory.geometries++,i)},update:function(t){var n=t.index,r=t.attributes;for(var i in null!==n&&e.update(n,34963),r)e.update(r[i],34962);var o=t.morphAttributes;for(var i in o)for(var a=o[i],s=0,l=a.length;s<l;s++)e.update(a[s],34962)},getWireframeAttribute:function(t){var e=i.get(t);if(e){var n=t.index;null!==n&&e.version<n.version&&a(t)}else a(t);return i.get(t)}}}(0,C,v),T=new function(t,e,n,r){var i={};return{update:function(t){var o=r.render.frame,a=t.geometry,s=e.get(t,a);return i[s.id]!==o&&(a.isGeometry&&s.updateFromObject(t),e.update(s),i[s.id]=o),t.isInstancedMesh&&n.update(t.instanceMatrix,34962),s},dispose:function(){i={}}}}(0,S,C,v),P=new function(t){var e={},n=new Float32Array(8);return{update:function(r,i,o,a){var s=r.morphTargetInfluences,l=void 0===s?0:s.length,c=e[i.id];if(void 0===c){c=[];for(var u=0;u<l;u++)c[u]=[u,0];e[i.id]=c}var h=o.morphTargets&&i.morphAttributes.position,d=o.morphNormals&&i.morphAttributes.normal;for(u=0;u<l;u++)0!==(f=c[u])[1]&&(h&&i.deleteAttribute("morphTarget"+u),d&&i.deleteAttribute("morphNormal"+u));for(u=0;u<l;u++)(f=c[u])[0]=u,f[1]=s[u];c.sort($n);var p=0;for(u=0;u<8;u++){var f;if(f=c[u]){var m=f[0],g=f[1];if(g){h&&i.setAttribute("morphTarget"+u,h[m]),d&&i.setAttribute("morphNormal"+u,d[m]),p+=n[u]=g;continue}}n[u]=0}var y=i.morphTargetsRelative?1:1-p;a.getUniforms().setValue(t,"morphTargetBaseInfluence",y),a.getUniforms().setValue(t,"morphTargetInfluences",n)}}}(p),E=new di(k,f,m),D=new function(){var t=new WeakMap;function e(n){var r=n.target;r.removeEventListener("dispose",e),t.delete(r)}return{get:function(n,r){var i,o=t.get(n);return void 0===o?(i=new mi,t.set(n,new WeakMap),t.get(n).set(r,i),n.addEventListener("dispose",e)):void 0===(i=o.get(r))&&(i=new mi,o.set(r,i)),i},dispose:function(){t=new WeakMap}}},A=new function(){var t=new WeakMap;function e(n){var r=n.target;r.removeEventListener("dispose",e),t.delete(r)}return{get:function(n,r){var i;return!1===t.has(n)?(i=new xi,t.set(n,new WeakMap),t.get(n).set(r,i),n.addEventListener("dispose",e)):!1===t.get(n).has(r)?(i=new xi,t.get(n).set(r,i)):i=t.get(n).get(r),i},dispose:function(){t=new WeakMap}}},O=new Yn(k,y,T,s),L=new function(t,e,n,r){var i,o=r.isWebGL2;this.setMode=function(t){i=t},this.render=function(e,r){t.drawArrays(i,e,r),n.update(r,i)},this.renderInstances=function(r,a,s,l){if(0!==l){var c,u;if(o)c=t,u="drawArraysInstanced";else if(u="drawArraysInstancedANGLE",null===(c=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[u](i,a,s,l),n.update(s,i,l)}}}(p,f,v,m),R=new function(t,e,n,r){var i,o,a,s=r.isWebGL2;this.setMode=function(t){i=t},this.setIndex=function(t){o=t.type,a=t.bytesPerElement},this.render=function(e,r){t.drawElements(i,r,o,e*a),n.update(r,i)},this.renderInstances=function(r,l,c,u){if(0!==u){var h,d;if(s)h=t,d="drawElementsInstanced";else if(d="drawElementsInstancedANGLE",null===(h=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[d](i,c,o,l*a,u),n.update(c,i,u)}}}(p,f,v,m),v.programs=E.programs,k.capabilities=m,k.extensions=f,k.properties=w,k.renderLists=D,k.state=y,k.info=v}yt();var vt=new Oi(k,p);this.xr=vt;var bt=new Ei(k,p),wt=new Mi(k,T,m.maxTextureSize);function Mt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),F=!0}function _t(){console.log("THREE.WebGLRenderer: Context Restored."),F=!1,yt()}function Ct(t){var e,n=t.target;n.removeEventListener("dispose",Ct),St(e=n),w.remove(e)}function St(t){var e=w.get(t).program;(t.program=void 0)!==e&&E.releaseProgram(e)}this.shadowMap=wt,this.getContext=function(){return p},this.getContextAttributes=function(){return p.getContextAttributes()},this.forceContextLoss=function(){var t=f.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=f.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return K},this.setPixelRatio=function(t){void 0!==t&&(K=t,this.setSize(Z,$,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new tt),t.set(Z,$)},this.setSize=function(t,n,r){vt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(Z=t,$=n,e.width=Math.floor(t*K),e.height=Math.floor(n*K),!1!==r&&(e.style.width=t+"px",e.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 tt),t.set(Z*K,$*K).floor()},this.setDrawingBufferSize=function(t,n,r){Z=t,$=n,K=r,e.width=Math.floor(t*r),e.height=Math.floor(n*r),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 ot),t.copy(q)},this.getViewport=function(t){return t.copy(rt)},this.setViewport=function(t,e,n,r){t.isVector4?rt.set(t.x,t.y,t.z,t.w):rt.set(t,e,n,r),y.viewport(q.copy(rt).multiplyScalar(K).floor())},this.getScissor=function(t){return t.copy(it)},this.setScissor=function(t,e,n,r){t.isVector4?it.set(t.x,t.y,t.z,t.w):it.set(t,e,n,r),y.scissor(X.copy(it).multiplyScalar(K).floor())},this.getScissorTest=function(){return at},this.setScissorTest=function(t){y.setScissorTest(at=t)},this.setOpaqueSort=function(t){et=t},this.setTransparentSort=function(t){nt=t},this.getClearColor=function(){return O.getClearColor()},this.setClearColor=function(){O.setClearColor.apply(O,arguments)},this.getClearAlpha=function(){return O.getClearAlpha()},this.setClearAlpha=function(){O.setClearAlpha.apply(O,arguments)},this.clear=function(t,e,n){var r=0;void 0!==t&&!t||(r|=16384),void 0!==e&&!e||(r|=256),void 0!==n&&!n||(r|=1024),p.clear(r)},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(){e.removeEventListener("webglcontextlost",Mt,!1),e.removeEventListener("webglcontextrestored",_t,!1),D.dispose(),A.dispose(),w.dispose(),T.dispose(),vt.dispose(),Dt.stop()},this.renderBufferImmediate=function(t,e){y.initAttributes();var n=w.get(t);t.hasPositions&&!n.position&&(n.position=p.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=p.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=p.createBuffer()),t.hasColors&&!n.color&&(n.color=p.createBuffer());var r=e.getAttributes();t.hasPositions&&(p.bindBuffer(34962,n.position),p.bufferData(34962,t.positionArray,35048),y.enableAttribute(r.position),p.vertexAttribPointer(r.position,3,5126,!1,0,0)),t.hasNormals&&(p.bindBuffer(34962,n.normal),p.bufferData(34962,t.normalArray,35048),y.enableAttribute(r.normal),p.vertexAttribPointer(r.normal,3,5126,!1,0,0)),t.hasUvs&&(p.bindBuffer(34962,n.uv),p.bufferData(34962,t.uvArray,35048),y.enableAttribute(r.uv),p.vertexAttribPointer(r.uv,2,5126,!1,0,0)),t.hasColors&&(p.bindBuffer(34962,n.color),p.bufferData(34962,t.colorArray,35048),y.enableAttribute(r.color),p.vertexAttribPointer(r.color,3,5126,!1,0,0)),y.disableUnusedAttributes(),p.drawArrays(4,0,t.count),t.count=0};var Tt=new jt;this.renderBufferDirect=function(t,e,n,r,i,o){null===e&&(e=Tt);var a=i.isMesh&&i.matrixWorld.determinant()<0,s=Lt(t,e,r,i);y.setMaterial(r,a);var l=!1;U.geometry===n.id&&U.program===s.id&&U.wireframe===(!0===r.wireframe)||(U.geometry=n.id,U.program=s.id,U.wireframe=!0===r.wireframe,l=!0),(r.morphTargets||r.morphNormals)&&(P.update(i,n,r,s),l=!0);var c=n.index,u=n.attributes.position;if(null===c){if(void 0===u||0===u.count)return}else if(0===c.count)return;var h,d=1;!0===r.wireframe&&(c=S.getWireframeAttribute(n),d=2);var g=L;null!==c&&((h=C.get(c))?(g=R).setIndex(h):(console.log("mx attribute == null"),c=null)),l&&(function(t,e,n,r){if(!1!==m.isWebGL2||!t.isInstancedMesh&&!e.isInstancedBufferGeometry||null!==f.get("ANGLE_instanced_arrays")){y.initAttributes();var i=e.attributes,o=r.getAttributes(),a=n.defaultAttributeValues;for(var s in o){var l=o[s];if(0<=l){var c=i[s];if(void 0!==c){var u=c.normalized,h=c.itemSize;if(void 0===(M=C.get(c)))continue;var d=M.buffer,g=M.type,v=M.bytesPerElement;if(c.isInterleavedBufferAttribute){var x=c.data,b=x.stride,w=c.offset;x&&x.isInstancedInterleavedBuffer?(y.enableAttributeAndDivisor(l,x.meshPerAttribute),void 0===e.maxInstancedCount&&(e.maxInstancedCount=x.meshPerAttribute*x.count)):y.enableAttribute(l),p.bindBuffer(34962,d),p.vertexAttribPointer(l,h,g,u,b*v,w*v)}else c.isInstancedBufferAttribute?(y.enableAttributeAndDivisor(l,c.meshPerAttribute),void 0===e.maxInstancedCount&&(e.maxInstancedCount=c.meshPerAttribute*c.count)):y.enableAttribute(l),p.bindBuffer(34962,d),p.vertexAttribPointer(l,h,g,u,0,0)}else if("instanceMatrix"===s){var M;if(void 0===(M=C.get(t.instanceMatrix)))continue;d=M.buffer,g=M.type,y.enableAttributeAndDivisor(l+0,1),y.enableAttributeAndDivisor(l+1,1),y.enableAttributeAndDivisor(l+2,1),y.enableAttributeAndDivisor(l+3,1),p.bindBuffer(34962,d),p.vertexAttribPointer(l+0,4,g,!1,64,0),p.vertexAttribPointer(l+1,4,g,!1,64,16),p.vertexAttribPointer(l+2,4,g,!1,64,32),p.vertexAttribPointer(l+3,4,g,!1,64,48)}else if(void 0!==a){var _=a[s];if(void 0!==_)switch(_.length){case 2:p.vertexAttrib2fv(l,_);break;case 3:p.vertexAttrib3fv(l,_);break;case 4:p.vertexAttrib4fv(l,_);break;default:p.vertexAttrib1fv(l,_)}}}}y.disableUnusedAttributes()}}(i,n,r,s),null!==c&&p.bindBuffer(34963,h.buffer));var v=null!==c?c.count:u.count,x=n.drawRange.start*d,b=n.drawRange.count*d,w=null!==o?o.start*d:0,M=null!==o?o.count*d:1/0,_=Math.max(x,w),T=Math.min(v,x+b,w+M)-1,E=Math.max(0,T-_+1);if(0!==E){if(i.isMesh)!0===r.wireframe?(y.setLineWidth(r.wireframeLinewidth*ft()),g.setMode(1)):g.setMode(4);else if(i.isLine){var D=r.linewidth;void 0===D&&(D=1),y.setLineWidth(D*ft()),i.isLineSegments?g.setMode(1):i.isLineLoop?g.setMode(2):g.setMode(3)}else i.isPoints?g.setMode(0):i.isSprite&&g.setMode(4);i.isInstancedMesh?g.renderInstances(n,_,E,i.count):n.isInstancedBufferGeometry?g.renderInstances(n,_,E,n.maxInstancedCount):g.render(_,E)}},this.compile=function(t,e){(d=A.get(t,e)).init(),t.traverse(function(t){t.isLight&&(d.pushLight(t),t.castShadow&&d.pushShadow(t))}),d.setupLights(e);var n={};t.traverse(function(e){if(e.material)if(Array.isArray(e.material))for(var r=0;r<e.material.length;r++)e.material[r].uuid in n==0&&(Pt(e.material[r],t,e),n[e.material[r].uuid]=!0);else e.material.uuid in n==0&&(Pt(e.material,t,e),n[e.material.uuid]=!0)})};var Et=null,Dt=new Un;function At(t,e,n,r){for(var i=0,o=t.length;i<o;i++){var a=t[i],s=a.object,l=a.geometry,c=void 0===r?a.material:r,u=a.group;if(n.isArrayCamera)if(J=n,vt.enabled&&bt.isAvailable())Ot(s,e,n,l,c,u);else for(var h=n.cameras,p=0,f=h.length;p<f;p++){var m=h[p];s.layers.test(m.layers)&&(y.viewport(q.copy(m.viewport)),d.setupLights(m),Ot(s,e,m,l,c,u))}else J=null,Ot(s,e,n,l,c,u)}}function Ot(t,e,n,r,i,o){if(t.onBeforeRender(k,e,n,r,i,o),d=A.get(e,J||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){var a=Lt(n,e,i,t);y.setMaterial(i),U.geometry=null,U.program=null,U.wireframe=!1,s=a,t.render(function(t){k.renderBufferImmediate(t,s)})}else k.renderBufferDirect(n,e,r,i,t,o);var s;t.onAfterRender(k,e,n,r,i,o),d=A.get(e,J||n)}function Pt(t,e,n){var r=w.get(t),i=d.state.lights,o=d.state.shadowsArray,a=i.state.version,s=E.getParameters(t,i.state,o,e,lt.numPlanes,lt.numIntersection,n),l=E.getProgramCacheKey(s),c=r.program,u=!0;if(void 0===c)t.addEventListener("dispose",Ct);else if(c.cacheKey!==l)St(t);else if(r.lightsStateVersion!==a)r.lightsStateVersion=a,u=!1;else{if(void 0!==s.shaderID)return;u=!1}u&&(c=E.acquireProgram(s,l),r.program=c,r.uniforms=s.uniforms,r.environment=t.isMeshStandardMaterial?e.environment:null,r.outputEncoding=k.outputEncoding,t.program=c);var h=c.getAttributes();if(t.morphTargets)for(var p=t.numSupportedMorphTargets=0;p<k.maxMorphTargets;p++)0<=h["morphTarget"+p]&&t.numSupportedMorphTargets++;if(t.morphNormals)for(p=t.numSupportedMorphNormals=0;p<k.maxMorphNormals;p++)0<=h["morphNormal"+p]&&t.numSupportedMorphNormals++;var f,m=r.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(r.numClippingPlanes=lt.numPlanes,r.numIntersection=lt.numIntersection,m.clippingPlanes=lt.uniform),r.fog=e.fog,r.needsLights=(f=t).isMeshLambertMaterial||f.isMeshToonMaterial||f.isMeshPhongMaterial||f.isMeshStandardMaterial||f.isShadowMaterial||f.isShaderMaterial&&!0===f.lights,r.lightsStateVersion=a,r.needsLights&&(m.ambientLightColor.value=i.state.ambient,m.lightProbe.value=i.state.probe,m.directionalLights.value=i.state.directional,m.spotLights.value=i.state.spot,m.rectAreaLights.value=i.state.rectArea,m.pointLights.value=i.state.point,m.hemisphereLights.value=i.state.hemi,m.directionalShadowMap.value=i.state.directionalShadowMap,m.directionalShadowMatrix.value=i.state.directionalShadowMatrix,m.spotShadowMap.value=i.state.spotShadowMap,m.spotShadowMatrix.value=i.state.spotShadowMatrix,m.pointShadowMap.value=i.state.pointShadowMap,m.pointShadowMatrix.value=i.state.pointShadowMatrix);var g=r.program.getUniforms(),y=Yr.seqWithValue(g.seq,m);r.uniformsList=y}function Lt(t,e,n,r){M.resetTextureUnits();var i=e.fog,o=n.isMeshStandardMaterial?e.environment:null,a=w.get(n),s=d.state.lights;if(ct&&(ut||t!==W)){var l=t===W&&n.id===H;lt.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,a,l)}n.version===a.__version?(void 0===a.program||n.fog&&a.fog!==i||a.environment!==o||a.needsLights&&a.lightsStateVersion!==s.state.version||void 0!==a.numClippingPlanes&&(a.numClippingPlanes!==lt.numPlanes||a.numIntersection!==lt.numIntersection)||a.outputEncoding!==k.outputEncoding)&&Pt(n,e,r):(w.update(n,"uniforms",n.uniforms),Pt(n,e,r),a.__version=n.version);var c,u,h,f,g,v,b,C,S,T,E,D,A=!1,O=!1,P=!1,L=a.program,R=L.getUniforms(),I=a.uniforms;if(y.useProgram(L.program)&&(P=O=A=!0),n.id!==H&&(H=n.id,O=!0),A||W!==t){if(0<L.numMultiviewViews?bt.updateCameraProjectionMatricesUniform(t,R):R.setValue(p,"projectionMatrix",t.projectionMatrix),m.logarithmicDepthBuffer&&R.setValue(p,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),W!==t&&(W=t,P=O=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var F=R.map.cameraPosition;void 0!==F&&F.setValue(p,pt.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&R.setValue(p,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&(0<L.numMultiviewViews?bt.updateCameraViewMatricesUniform(t,R):R.setValue(p,"viewMatrix",t.matrixWorldInverse))}if(n.skinning){R.setOptional(p,r,"bindMatrix"),R.setOptional(p,r,"bindMatrixInverse");var B=r.skeleton;if(B){var j=B.bones;if(m.floatVertexTextures){if(void 0===B.boneTexture){var N=Math.sqrt(4*j.length);N=Q.ceilPowerOfTwo(N),N=Math.max(N,4);var z=new Float32Array(N*N*4);z.set(B.boneMatrices);var V=new Nn(z,N,N,_,x);B.boneMatrices=z,B.boneTexture=V,B.boneTextureSize=N}R.setValue(p,"boneTexture",B.boneTexture,M),R.setValue(p,"boneTextureSize",B.boneTextureSize)}else R.setOptional(p,B,"boneMatrices")}}return!O&&a.receiveShadow===r.receiveShadow||(a.receiveShadow=r.receiveShadow,R.setValue(p,"receiveShadow",r.receiveShadow)),O&&(R.setValue(p,"toneMappingExposure",k.toneMappingExposure),R.setValue(p,"toneMappingWhitePoint",k.toneMappingWhitePoint),a.needsLights&&(D=P,(E=I).ambientLightColor.needsUpdate=D,E.lightProbe.needsUpdate=D,E.directionalLights.needsUpdate=D,E.pointLights.needsUpdate=D,E.spotLights.needsUpdate=D,E.rectAreaLights.needsUpdate=D,E.hemisphereLights.needsUpdate=D),i&&n.fog&&(T=i,(S=I).fogColor.value.copy(T.color),T.isFog?(S.fogNear.value=T.near,S.fogFar.value=T.far):T.isFogExp2&&(S.fogDensity.value=T.density)),n.isMeshBasicMaterial?Rt(I,n):n.isMeshLambertMaterial?(Rt(I,n),b=I,(C=n).emissiveMap&&(b.emissiveMap.value=C.emissiveMap)):n.isMeshToonMaterial?(Rt(I,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.gradientMap&&(t.gradientMap.value=e.gradientMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(I,n)):n.isMeshPhongMaterial?(Rt(I,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(I,n)):n.isMeshStandardMaterial?(Rt(I,n,o),(n.isMeshPhysicalMaterial?function(t,e,n){It(t,e,n),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate()),t.transparency.value=e.transparency}:It)(I,n,o)):n.isMeshMatcapMaterial?(Rt(I,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(I,n)):n.isMeshDepthMaterial?(Rt(I,n),g=I,(v=n).displacementMap&&(g.displacementMap.value=v.displacementMap,g.displacementScale.value=v.displacementScale,g.displacementBias.value=v.displacementBias)):n.isMeshDistanceMaterial?(Rt(I,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(I,n)):n.isMeshNormalMaterial?(Rt(I,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(I,n)):n.isLineBasicMaterial?(f=n,(h=I).diffuse.value.copy(f.color),h.opacity.value=f.opacity,n.isLineDashedMaterial&&(u=n,(c=I).dashSize.value=u.dashSize,c.totalSize.value=u.dashSize+u.gapSize,c.scale.value=u.scale)):n.isPointsMaterial?function(t,e){var n;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*K,t.scale.value=.5*$,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.map?n=e.map:e.alphaMap&&(n=e.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(I,n):n.isSpriteMaterial?function(t,e){var n;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.map?n=e.map:e.alphaMap&&(n=e.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(I,n):n.isShadowMaterial&&(I.color.value.copy(n.color),I.opacity.value=n.opacity),void 0!==I.ltc_1&&(I.ltc_1.value=Hn.LTC_1),void 0!==I.ltc_2&&(I.ltc_2.value=Hn.LTC_2),Yr.upload(p,a.uniformsList,I,M),n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Yr.upload(p,a.uniformsList,I,M),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&R.setValue(p,"center",r.center),0<L.numMultiviewViews?bt.updateObjectMatricesUniforms(r,t,R):(R.setValue(p,"modelViewMatrix",r.modelViewMatrix),R.setValue(p,"normalMatrix",r.normalMatrix)),R.setValue(p,"modelMatrix",r.matrixWorld),L}function Rt(t,e,n){t.opacity.value=e.opacity,e.color&&t.diffuse.value.copy(e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap);var r,i,o=e.envMap||n;o&&(t.envMap.value=o,t.flipEnvMap.value=o.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=w.get(o).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?r=e.map:e.specularMap?r=e.specularMap:e.displacementMap?r=e.displacementMap:e.normalMap?r=e.normalMap:e.bumpMap?r=e.bumpMap:e.roughnessMap?r=e.roughnessMap:e.metalnessMap?r=e.metalnessMap:e.alphaMap?r=e.alphaMap:e.emissiveMap&&(r=e.emissiveMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix)),e.aoMap?i=e.aoMap:e.lightMap&&(i=e.lightMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uv2Transform.value.copy(i.matrix))}function It(t,e,n){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),(e.envMap||n)&&(t.envMapIntensity.value=e.envMapIntensity)}Dt.setAnimationLoop(function(t){vt.isPresenting||Et&&Et(t)}),"undefined"!=typeof window&&Dt.setContext(window),this.setAnimationLoop=function(t){Et=t,vt.setAnimationLoop(t),Dt.start()},this.render=function(t,e){var n,r;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),e&&e.isCamera){if(!F){U.geometry=null,U.program=null,U.wireframe=!1,H=-1,!(W=null)===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),vt.enabled&&vt.isPresenting&&(e=vt.getCamera(e)),(d=A.get(t,e)).init(),t.onBeforeRender(k,t,e,n||V),dt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),st.setFromProjectionMatrix(dt),ut=this.localClippingEnabled,ct=lt.init(this.clippingPlanes,ut,e),(h=D.get(t,e)).init(),function t(e,n,r,i){if(!1!==e.visible){if(e.layers.test(n.layers))if(e.isGroup)r=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(n);else if(e.isLight)d.pushLight(e),e.castShadow&&d.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||st.intersectsSprite(e)){i&&pt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(dt);var o=T.update(e);(a=e.material).visible&&h.push(e,o,a,r,pt.z,null)}}else if(e.isImmediateRenderObject)i&&pt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(dt),h.push(e,null,e.material,r,pt.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==v.render.frame&&(e.skeleton.update(),e.skeleton.frame=v.render.frame),!e.frustumCulled||st.intersectsObject(e))){i&&pt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(dt),o=T.update(e);var a=e.material;if(Array.isArray(a))for(var s=o.groups,l=0,c=s.length;l<c;l++){var u=s[l],p=a[u.materialIndex];p&&p.visible&&h.push(e,o,p,r,pt.z,u)}else a.visible&&h.push(e,o,a,r,pt.z,null)}var f=e.children;for(l=0,c=f.length;l<c;l++)t(f[l],n,r,i)}}(t,e,0,k.sortObjects),!0===k.sortObjects&&h.sort(et,nt),ct&&lt.beginShadows();var i=d.state.shadowsArray;wt.render(i,t,e),d.setupLights(e),ct&&lt.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),vt.enabled&&bt.isAvailable()&&bt.attachCamera(e),O.render(h,t,e,r);var o=h.opaque,a=h.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;o.length&&At(o,t,e,s),a.length&&At(a,t,e,s)}else o.length&&At(o,t,e),a.length&&At(a,t,e);t.onAfterRender(k,t,e),null!==V&&(M.updateRenderTargetMipmap(V),M.updateMultisampleRenderTarget(V)),y.buffers.depth.setTest(!0),y.buffers.depth.setMask(!0),y.buffers.color.setMask(!0),y.setPolygonOffset(!1),vt.enabled&&bt.isAvailable()&&bt.detachCamera(e),d=h=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.mxRenderObject=function(t,e,n,r,i){Ot(t,e,n,T.update(t),r,i)},this.setFramebuffer=function(t){B!==t&&null===V&&p.bindFramebuffer(36160,t),B=t},this.getActiveCubeFace=function(){return j},this.getActiveMipmapLevel=function(){return z},this.getRenderTarget=function(){return V},this.setRenderTarget=function(t,e,n){j=e,z=n,(V=t)&&void 0===w.get(t).__webglFramebuffer&&M.setupRenderTarget(t);var r=B,i=!1;if(t){var o=w.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=o[e||0],i=!0):r=t.isWebGLMultisampleRenderTarget?w.get(t).__webglMultisampledFramebuffer:o,q.copy(t.viewport),X.copy(t.scissor),Y=t.scissorTest}else q.copy(rt).multiplyScalar(K).floor(),X.copy(it).multiplyScalar(K).floor(),Y=at;if(G!==r&&(p.bindFramebuffer(36160,r),G=r),y.viewport(q),y.scissor(X),y.setScissorTest(Y),i){var a=w.get(t.texture);p.framebufferTexture2D(36160,36064,34069+(e||0),a.__webglTexture,n||0)}},this.readRenderTargetPixels=function(t,e,n,r,i,o,a){if(t&&t.isWebGLRenderTarget){var s=w.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){var l=!1;s!==G&&(p.bindFramebuffer(36160,s),l=!0);try{var c=t.texture,u=c.format,h=c.type;if(u!==_&&I.convert(u)!==p.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===g||I.convert(h)===p.getParameter(35738)||h===x&&(m.isWebGL2||f.get("OES_texture_float")||f.get("WEBGL_color_buffer_float"))||h===b&&(m.isWebGL2?f.get("EXT_color_buffer_float"):f.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===p.checkFramebufferStatus(36160)?0<=e&&e<=t.width-r&&0<=n&&n<=t.height-i&&p.readPixels(e,n,r,i,I.convert(u),I.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&p.bindFramebuffer(36160,G)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){void 0===n&&(n=0);var r=Math.pow(2,-n),i=Math.floor(e.image.width*r),o=Math.floor(e.image.height*r),a=I.convert(e.format);M.setTexture2D(e,0),p.copyTexImage2D(3553,n,a,t.x,t.y,i,o,0),y.unbindTexture()},this.copyTextureToTexture=function(t,e,n,r){var i=e.image.width,o=e.image.height,a=I.convert(n.format),s=I.convert(n.type);M.setTexture2D(n,0),e.isDataTexture?p.texSubImage2D(3553,r||0,t.x,t.y,i,o,a,s,e.image.data):p.texSubImage2D(3553,r||0,t.x,t.y,a,s,e.image),y.unbindTexture()},this.initTexture=function(t){M.setTexture2D(t,0),y.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Li(t,e){this.name="",this.color=new De(t),this.density=void 0!==e?e:25e-5}function Ri(t,e,n){this.name="",this.color=new De(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function Ii(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=q,this.updateRange={offset:0,count:-1},this.version=0}((bi.prototype=Object.create(Ie.prototype)).constructor=bi).prototype.isMeshDepthMaterial=!0,bi.prototype.copy=function(t){return Ie.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},((wi.prototype=Object.create(Ie.prototype)).constructor=wi).prototype.isMeshDistanceMaterial=!0,wi.prototype.copy=function(t){return Ie.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},Ti.prototype=Object.assign(Object.create(at.prototype),{constructor:Ti,isWebGLMultiviewRenderTarget:!0,copy:function(t){return at.prototype.copy.call(this,t),this.numViews=t.numViews,this},setNumViews:function(t){return this.numViews!==t&&(this.numViews=t,this.dispose()),this}}),Di.prototype=Object.assign(Object.create(Fn.prototype),{constructor:Di,isArrayCamera:!0}),Ai.prototype=Object.assign(Object.create(Bt.prototype),{constructor:Ai,isGroup:!0}),Object.assign(Oi.prototype,Y.prototype),Object.assign(Li.prototype,{isFogExp2:!0,clone:function(){return new Li(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(Ri.prototype,{isFog:!0,clone:function(){return new Ri(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(Ii.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Ii.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,e,n){t*=this.stride,n*=e.stride;for(var r=0,i=this.stride;r<i;r++)this.array[t+r]=e.array[n+r];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}});var ki,Fi=new ht;function Bi(t,e,n,r){this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===r}function ji(t){Ie.call(this),this.type="SpriteMaterial",this.color=new De(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}Object.defineProperties(Bi.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Bi.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(var e=0,n=this.data.count;e<n;e++)Fi.x=this.getX(e),Fi.y=this.getY(e),Fi.z=this.getZ(e),Fi.applyMatrix4(t),this.setXYZ(e,Fi.x,Fi.y,Fi.z);return this},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,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,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this},setXYZW:function(t,e,n,r,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=i,this}}),((ji.prototype=Object.create(Ie.prototype)).constructor=ji).prototype.isSpriteMaterial=!0,ji.prototype.copy=function(t){return Ie.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};var Ni=new ht,zi=new ht,Vi=new ht,Gi=new tt,Hi=new tt,Ui=new xt,Wi=new ht,Ji=new ht,qi=new ht,Xi=new tt,Yi=new tt,Zi=new tt;function $i(t){if(Bt.call(this),this.type="Sprite",void 0===ki){ki=new nn;var e=new Ii(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);ki.setIndex([0,1,2,0,2,3]),ki.setAttribute("position",new Bi(e,3,0,!1)),ki.setAttribute("uv",new Bi(e,2,3,!1))}this.geometry=ki,this.material=void 0!==t?t:new ji,this.center=new tt(.5,.5)}function Ki(t,e,n,r,i,o){Gi.subVectors(t,n).addScalar(.5).multiply(r),void 0!==i?(Hi.x=o*Gi.x-i*Gi.y,Hi.y=i*Gi.x+o*Gi.y):Hi.copy(Gi),t.copy(e),t.x+=Hi.x,t.y+=Hi.y,t.applyMatrix4(Ui)}$i.prototype=Object.assign(Object.create(Bt.prototype),{constructor:$i,isSprite:!0,raycast:function(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),zi.setFromMatrixScale(this.matrixWorld),Ui.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Vi.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&zi.multiplyScalar(-Vi.z);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var o=this.center;Ki(Wi.set(-.5,-.5,0),Vi,o,zi,n,r),Ki(Ji.set(.5,-.5,0),Vi,o,zi,n,r),Ki(qi.set(.5,.5,0),Vi,o,zi,n,r),Xi.set(0,0),Yi.set(1,0),Zi.set(1,1);var a=t.ray.intersectTriangle(Wi,Ji,qi,!1,Ni);if(null!==a||(Ki(Ji.set(-.5,.5,0),Vi,o,zi,n,r),Yi.set(0,1),null!==(a=t.ray.intersectTriangle(Wi,qi,Ji,!1,Ni)))){var s=t.ray.origin.distanceTo(Ni);s<t.near||s>t.far||e.push({distance:s,point:Ni.clone(),uv:Ce.getUV(Ni,Wi,Ji,qi,Xi,Yi,Zi,new tt),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return Bt.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});var Qi=new ht,to=new ht;function eo(){Bt.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function no(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),wn.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new xt,this.bindMatrixInverse=new xt}eo.prototype=Object.assign(Object.create(Bt.prototype),{constructor:eo,isLOD:!0,copy:function(t){Bt.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,r=e.length;n<r;n++){var i=e[n];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=t.autoUpdate,this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,r=0;r<n.length&&!(e<n[r].distance);r++);return n.splice(r,0,{distance:e,object:t}),this.add(t),this},getObjectForDistance:function(t){var e=this.levels;if(0<e.length){for(var n=1,r=e.length;n<r&&!(t<e[n].distance);n++);return e[n-1].object}return null},raycast:function(t,e){if(0<this.levels.length){Qi.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(Qi);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){var e=this.levels;if(1<e.length){Qi.setFromMatrixPosition(t.matrixWorld),to.setFromMatrixPosition(this.matrixWorld);var n=Qi.distanceTo(to);e[0].object.visible=!0;for(var r=1,i=e.length;r<i&&n>=e[r].distance;r++)e[r-1].object.visible=!1,e[r].object.visible=!0;for(;r<i;r++)e[r].object.visible=!1}},toJSON:function(t){var e=Bt.prototype.toJSON.call(this,t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var o=n[r];e.object.levels.push({object:o.object.uuid,distance:o.distance})}return e}}),no.prototype=Object.assign(Object.create(wn.prototype),{constructor:no,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new ot,e=this.geometry.attributes.skinWeight,n=0,r=e.count;n<r;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var i=1/t.manhattanLength();i!=1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){wn.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 ro=new xt,io=new xt;function oo(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new xt)}}function ao(){Bt.call(this),this.type="Bone"}Object.assign(oo.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new xt;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){var t,e,n;for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&(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,e=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,o=t.length;i<o;i++){var a=t[i]?t[i].matrixWorld:io;ro.multiplyMatrices(a,e[i]),ro.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)},clone:function(){return new oo(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var r=this.bones[e];if(r.name===t)return r}}}),ao.prototype=Object.assign(Object.create(Bt.prototype),{constructor:ao,isBone:!0});var so=new xt,lo=new xt,co=[],uo=new wn;function ho(t,e,n){wn.call(this,t,e),this.instanceMatrix=new Be(new Float32Array(16*n),16),this.count=n,this.frustumCulled=!1}function po(t){Ie.call(this),this.type="LineBasicMaterial",this.color=new De(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(t)}ho.prototype=Object.assign(Object.create(wn.prototype),{constructor:ho,isInstancedMesh:!0,getMatrixAt:function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},raycast:function(t,e){var n=this.matrixWorld,r=this.count;if(uo.geometry=this.geometry,uo.material=this.material,void 0!==uo.material)for(var i=0;i<r;i++)this.getMatrixAt(i,so),lo.multiplyMatrices(n,so),uo.matrixWorld=lo,uo.raycast(t,co),0<co.length&&(co[0].instanceId=i,co[0].object=this,e.push(co[0]),co.length=0)},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){}}),((po.prototype=Object.create(Ie.prototype)).constructor=po).prototype.isLineBasicMaterial=!0,po.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this};var fo=new ht,mo=new ht,go=new xt,yo=new ce,vo=new ee;function xo(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Bt.call(this),this.type="Line",this.geometry=void 0!==t?t:new nn,this.material=void 0!==e?e:new po}xo.prototype=Object.assign(Object.create(Bt.prototype),{constructor:xo,isLine:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],r=1,i=e.count;r<i;r++)fo.fromBufferAttribute(e,r-1),mo.fromBufferAttribute(e,r),n[r]=n[r-1],n[r]+=fo.distanceTo(mo);t.setAttribute("lineDistance",new We(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var o=t.vertices;for((n=t.lineDistances)[0]=0,r=1,i=o.length;r<i;r++)n[r]=n[r-1],n[r]+=o[r-1].distanceTo(o[r])}return this},raycast:function(t,e){var n=t.linePrecision,r=this.geometry,i=this.matrixWorld;if(null===r.boundingSphere&&r.computeBoundingSphere(),vo.copy(r.boundingSphere),vo.applyMatrix4(i),vo.radius+=n,!1!==t.ray.intersectsSphere(vo)){go.getInverse(i),yo.copy(t.ray).applyMatrix4(go);var o=n/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,s=new ht,l=new ht,c=new ht,u=new ht,h=this&&this.isLineSegments?2:1;if(r.isBufferGeometry){var d=r.index,p=r.attributes.position.array;if(null!==d)for(var f=d.array,m=0,g=f.length-1;m<g;m+=h){var y=f[m],v=f[m+1];s.fromArray(p,3*y),l.fromArray(p,3*v),a<yo.distanceSqToSegment(s,l,u,c)||(u.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(u))<t.near||w>t.far||e.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else for(m=0,g=p.length/3-1;m<g;m+=h)s.fromArray(p,3*m),l.fromArray(p,3*m+3),a<yo.distanceSqToSegment(s,l,u,c)||(u.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(u))<t.near||w>t.far||e.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else if(r.isGeometry){var x=r.vertices,b=x.length;for(m=0;m<b-1;m+=h){var w;a<yo.distanceSqToSegment(x[m],x[m+1],u,c)||(u.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(u))<t.near||w>t.far||e.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var bo=new ht,wo=new ht;function Mo(t,e){xo.call(this,t,e),this.type="LineSegments"}function _o(t,e){xo.call(this,t,e),this.type="LineLoop"}function Co(t){Ie.call(this),this.type="PointsMaterial",this.color=new De(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}Mo.prototype=Object.assign(Object.create(xo.prototype),{constructor:Mo,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],r=0,i=e.count;r<i;r+=2)bo.fromBufferAttribute(e,r),wo.fromBufferAttribute(e,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+bo.distanceTo(wo);t.setAttribute("lineDistance",new We(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var o=t.vertices;for(n=t.lineDistances,r=0,i=o.length;r<i;r+=2)bo.copy(o[r]),wo.copy(o[r+1]),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+bo.distanceTo(wo)}return this}}),_o.prototype=Object.assign(Object.create(xo.prototype),{constructor:_o,isLineLoop:!0}),((Co.prototype=Object.create(Ie.prototype)).constructor=Co).prototype.isPointsMaterial=!0,Co.prototype.copy=function(t){return Ie.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};var So=new xt,To=new ce,Eo=new ee,Do=new ht;function Ao(t,e){Bt.call(this),this.type="Points",this.geometry=void 0!==t?t:new nn,this.material=void 0!==e?e:new Co,this.updateMorphTargets()}function Oo(t,e,n,r,i,o,a){var s=To.distanceSqToPoint(t);if(s<n){var l=new ht;To.closestPointToPoint(t,l),l.applyMatrix4(r);var c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:e,face:null,object:a})}}function Po(t,e,n,r,i,o,a,s,l){it.call(this,t,e,n,r,i,o,a,s,l),this.format=void 0!==a?a:M,this.minFilter=void 0!==o?o:p,this.magFilter=void 0!==i?i:p,this.generateMipmaps=!1}function Lo(t,e,n,r,i,o,a,s,l,c,u,h){it.call(this,null,o,a,s,l,c,r,i,u,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Ro(t,e,n,r,i,o,a,s,l){it.call(this,t,e,n,r,i,o,a,s,l),this.needsUpdate=!0}function Io(t,e,n,r,i,o,a,s,l,c){if((c=void 0!==c?c:C)!==C&&c!==S)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===C&&(n=y),void 0===n&&c===S&&(n=w),it.call(this,null,r,i,o,a,s,c,n,l),this.image={width:t,height:e},this.magFilter=void 0!==a?a:u,this.minFilter=void 0!==s?s:u,this.flipY=!1,this.generateMipmaps=!1}function ko(t){nn.call(this),this.type="WireframeGeometry";var e,n,r,i,o,a,s,l,c,u,h=[],d=[0,0],p={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,r=m.length;e<r;e++){var g=m[e];for(n=0;n<3;n++)s=g[f[n]],l=g[f[(n+1)%3]],d[0]=Math.min(s,l),d[1]=Math.max(s,l),void 0===p[c=d[0]+","+d[1]]&&(p[c]={index1:d[0],index2:d[1]})}for(c in p)a=p[c],u=t.vertices[a.index1],h.push(u.x,u.y,u.z),u=t.vertices[a.index2],h.push(u.x,u.y,u.z)}else if(t&&t.isBufferGeometry){var y,v,x,b,w,M;if(u=new ht,null!==t.index){for(y=t.attributes.position,v=t.index,0===(x=t.groups).length&&(x=[{start:0,count:v.count,materialIndex:0}]),i=0,o=x.length;i<o;++i)for(r=(e=(b=x[i]).start)+b.count;e<r;e+=3)for(n=0;n<3;n++)s=v.getX(e+n),l=v.getX(e+(n+1)%3),d[0]=Math.min(s,l),d[1]=Math.max(s,l),void 0===p[c=d[0]+","+d[1]]&&(p[c]={index1:d[0],index2:d[1]});for(c in p)a=p[c],u.fromBufferAttribute(y,a.index1),h.push(u.x,u.y,u.z),u.fromBufferAttribute(y,a.index2),h.push(u.x,u.y,u.z)}else for(e=0,r=(y=t.attributes.position).count/3;e<r;e++)for(n=0;n<3;n++)w=3*e+n,u.fromBufferAttribute(y,w),h.push(u.x,u.y,u.z),M=3*e+(n+1)%3,u.fromBufferAttribute(y,M),h.push(u.x,u.y,u.z)}this.setAttribute("position",new We(h,3))}function Fo(t,e,n){Dn.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new Bo(t,e,n)),this.mergeVertices()}function Bo(t,e,n){nn.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var r,i,o=[],a=[],s=[],l=[],c=new ht,u=new ht,h=new ht,d=new ht,p=new ht;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var f=e+1;for(r=0;r<=n;r++){var m=r/n;for(i=0;i<=e;i++){var g=i/e;t(g,m,u),a.push(u.x,u.y,u.z),0<=g-1e-5?(t(g-1e-5,m,h),d.subVectors(u,h)):(t(1e-5+g,m,h),d.subVectors(h,u)),0<=m-1e-5?(t(g,m-1e-5,h),p.subVectors(u,h)):(t(g,1e-5+m,h),p.subVectors(h,u)),c.crossVectors(d,p).normalize(),s.push(c.x,c.y,c.z),l.push(g,m)}}for(r=0;r<n;r++)for(i=0;i<e;i++){var y=r*f+i,v=r*f+i+1,x=(r+1)*f+i+1,b=(r+1)*f+i;o.push(y,v,b),o.push(v,x,b)}this.setIndex(o),this.setAttribute("position",new We(a,3)),this.setAttribute("normal",new We(s,3)),this.setAttribute("uv",new We(l,2))}function jo(t,e,n,r){Dn.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},this.fromBufferGeometry(new No(t,e,n,r)),this.mergeVertices()}function No(t,e,n,r){nn.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},n=n||1;var i=[],o=[];function a(t,e,n,r){var i,o,a=Math.pow(2,r),l=[];for(i=0;i<=a;i++){l[i]=[];var c=t.clone().lerp(n,i/a),u=e.clone().lerp(n,i/a),h=a-i;for(o=0;o<=h;o++)l[i][o]=0===o&&i===a?c:c.clone().lerp(u,o/h)}for(i=0;i<a;i++)for(o=0;o<2*(a-i)-1;o++){var d=Math.floor(o/2);o%2==0?(s(l[i][d+1]),s(l[i+1][d]),s(l[i][d])):(s(l[i][d+1]),s(l[i+1][d+1]),s(l[i+1][d]))}}function s(t){i.push(t.x,t.y,t.z)}function l(e,n){var r=3*e;n.x=t[0+r],n.y=t[1+r],n.z=t[2+r]}function c(t,e,n,r){r<0&&1===t.x&&(o[e]=t.x-1),0===n.x&&0===n.z&&(o[e]=r/2/Math.PI+.5)}function u(t){return Math.atan2(t.z,-t.x)}!function(t){for(var n=new ht,r=new ht,i=new ht,o=0;o<e.length;o+=3)l(e[o+0],n),l(e[o+1],r),l(e[o+2],i),a(n,r,i,t)}(r=r||0),function(t){for(var e=new ht,n=0;n<i.length;n+=3)e.x=i[n+0],e.y=i[n+1],e.z=i[n+2],e.normalize().multiplyScalar(t),i[n+0]=e.x,i[n+1]=e.y,i[n+2]=e.z}(n),function(){for(var t=new ht,e=0;e<i.length;e+=3){t.x=i[e+0],t.y=i[e+1],t.z=i[e+2];var n=u(t)/2/Math.PI+.5,r=(a=t,Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5);o.push(n,1-r)}var a;(function(){for(var t=new ht,e=new ht,n=new ht,r=new ht,a=new tt,s=new tt,l=new tt,h=0,d=0;h<i.length;h+=9,d+=6){t.set(i[h+0],i[h+1],i[h+2]),e.set(i[h+3],i[h+4],i[h+5]),n.set(i[h+6],i[h+7],i[h+8]),a.set(o[d+0],o[d+1]),s.set(o[d+2],o[d+3]),l.set(o[d+4],o[d+5]),r.copy(t).add(e).add(n).divideScalar(3);var p=u(r);c(a,d+0,t,p),c(s,d+2,e,p),c(l,d+4,n,p)}})(),function(){for(var t=0;t<o.length;t+=6){var e=o[t+0],n=o[t+2],r=o[t+4],i=Math.max(e,n,r),a=Math.min(e,n,r);.9<i&&a<.1&&(e<.2&&(o[t+0]+=1),n<.2&&(o[t+2]+=1),r<.2&&(o[t+4]+=1))}}()}(),this.setAttribute("position",new We(i,3)),this.setAttribute("normal",new We(i.slice(),3)),this.setAttribute("uv",new We(o,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function zo(t,e){Dn.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Vo(t,e)),this.mergeVertices()}function Vo(t,e){No.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Go(t,e){Dn.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ho(t,e)),this.mergeVertices()}function Ho(t,e){No.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Uo(t,e){Dn.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Wo(t,e)),this.mergeVertices()}function Wo(t,e){var n=(1+Math.sqrt(5))/2;No.call(this,[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Jo(t,e){Dn.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new qo(t,e)),this.mergeVertices()}function qo(t,e){var n=(1+Math.sqrt(5))/2,r=1/n;No.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Xo(t,e,n,r,i,o){Dn.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new Yo(t,e,n,r,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function Yo(t,e,n,r,i){nn.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i},e=e||64,n=n||1,r=r||8,i=i||!1;var o=t.computeFrenetFrames(e,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,l=new ht,c=new ht,u=new tt,h=new ht,d=[],p=[],f=[],m=[];function g(i){h=t.getPointAt(i/e,h);var a=o.normals[i],u=o.binormals[i];for(s=0;s<=r;s++){var f=s/r*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);c.x=g*a.x+m*u.x,c.y=g*a.y+m*u.y,c.z=g*a.z+m*u.z,c.normalize(),p.push(c.x,c.y,c.z),l.x=h.x+n*c.x,l.y=h.y+n*c.y,l.z=h.z+n*c.z,d.push(l.x,l.y,l.z)}}!function(){for(a=0;a<e;a++)g(a);g(!1===i?e:0),function(){for(a=0;a<=e;a++)for(s=0;s<=r;s++)u.x=a/e,u.y=s/r,f.push(u.x,u.y)}(),function(){for(s=1;s<=e;s++)for(a=1;a<=r;a++){var t=(r+1)*(s-1)+(a-1),n=(r+1)*s+(a-1),i=(r+1)*s+a,o=(r+1)*(s-1)+a;m.push(t,n,o),m.push(n,i,o)}}()}(),this.setIndex(m),this.setAttribute("position",new We(d,3)),this.setAttribute("normal",new We(p,3)),this.setAttribute("uv",new We(f,2))}function Zo(t,e,n,r,i,o,a){Dn.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:i,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new $o(t,e,n,r,i,o)),this.mergeVertices()}function $o(t,e,n,r,i,o){nn.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:i,q:o},t=t||1,e=e||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,o=o||3;var a,s,l=[],c=[],u=[],h=[],d=new ht,p=new ht,f=new ht,m=new ht,g=new ht,y=new ht,v=new ht;for(a=0;a<=n;++a){var x=a/n*i*Math.PI*2;for(E(x,i,o,t,f),E(.01+x,i,o,t,m),y.subVectors(m,f),v.addVectors(m,f),g.crossVectors(y,v),v.crossVectors(g,y),g.normalize(),v.normalize(),s=0;s<=r;++s){var b=s/r*Math.PI*2,w=-e*Math.cos(b),M=e*Math.sin(b);d.x=f.x+(w*v.x+M*g.x),d.y=f.y+(w*v.y+M*g.y),d.z=f.z+(w*v.z+M*g.z),c.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),u.push(p.x,p.y,p.z),h.push(a/n),h.push(s/r)}}for(s=1;s<=n;s++)for(a=1;a<=r;a++){var _=(r+1)*(s-1)+(a-1),C=(r+1)*s+(a-1),S=(r+1)*s+a,T=(r+1)*(s-1)+a;l.push(_,C,T),l.push(C,S,T)}function E(t,e,n,r,i){var o=Math.cos(t),a=Math.sin(t),s=n/e*t,l=Math.cos(s);i.x=r*(2+l)*.5*o,i.y=r*(2+l)*a*.5,i.z=r*Math.sin(s)*.5}this.setIndex(l),this.setAttribute("position",new We(c,3)),this.setAttribute("normal",new We(u,3)),this.setAttribute("uv",new We(h,2))}function Ko(t,e,n,r,i){Dn.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new Qo(t,e,n,r,i)),this.mergeVertices()}function Qo(t,e,n,r,i){nn.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},t=t||1,e=e||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var o,a,s=[],l=[],c=[],u=[],h=new ht,d=new ht,p=new ht;for(o=0;o<=n;o++)for(a=0;a<=r;a++){var f=a/r*i,m=o/n*Math.PI*2;d.x=(t+e*Math.cos(m))*Math.cos(f),d.y=(t+e*Math.cos(m))*Math.sin(f),d.z=e*Math.sin(m),l.push(d.x,d.y,d.z),h.x=t*Math.cos(f),h.y=t*Math.sin(f),p.subVectors(d,h).normalize(),c.push(p.x,p.y,p.z),u.push(a/r),u.push(o/n)}for(o=1;o<=n;o++)for(a=1;a<=r;a++){var g=(r+1)*o+a-1,y=(r+1)*(o-1)+a-1,v=(r+1)*(o-1)+a,x=(r+1)*o+a;s.push(g,y,x),s.push(y,v,x)}this.setIndex(s),this.setAttribute("position",new We(l,3)),this.setAttribute("normal",new We(c,3)),this.setAttribute("uv",new We(u,2))}function ta(t,e,n,r,i){var o,a;if(i===0<function(t,e,n,r){for(var i=0,o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}(t,e,n,r))for(o=e;o<n;o+=r)a=ya(o,t[o],t[o+1],a);else for(o=n-r;e<=o;o-=r)a=ya(o,t[o],t[o+1],a);return a&&pa(a,a.next)&&(va(a),a=a.next),a}function ea(t,e){if(!t)return t;e=e||t;var n,r=t;do{if(n=!1,r.steiner||!pa(r,r.next)&&0!==da(r.prev,r,r.next))r=r.next;else{if(va(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function na(t,e,n,r,i,o,a){if(t){!a&&o&&function(t,e,n,r){for(var i=t;null===i.z&&(i.z=ca(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,(i=i.next)!==t;);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,l,c=1;do{for(n=t,o=t=null,a=0;n;){for(a++,r=n,e=s=0;e<c&&(s++,r=r.nextZ);e++);for(l=c;0<s||0<l&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(n=(i=n).nextZ,s--):(r=(i=r).nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(1<a)}(i)}(t,r,i,o);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,o?ia(t,r,i,o):ra(t))e.push(s.i/n),e.push(t.i/n),e.push(l.i/n),va(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?na(t=oa(t,e,n),e,n,r,i,o,2):2===a&&aa(t,e,n,r,i,o):na(ea(t),e,n,r,i,o,1);break}}}function ra(t){var e=t.prev,n=t,r=t.next;if(!(0<=da(e,n,r))){for(var i=t.next.next;i!==t.prev;){if(ha(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=da(i.prev,i,i.next))return;i=i.next}return 1}}function ia(t,e,n,r){var i=t.prev,o=t,a=t.next;if(!(0<=da(i,o,a))){for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,l=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,c=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=ca(s,l,e,n,r),d=ca(c,u,e,n,r),p=t.prevZ,f=t.nextZ;p&&p.z>=h&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&ha(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=da(p.prev,p,p.next))return;if(p=p.prevZ,f!==t.prev&&f!==t.next&&ha(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&0<=da(f.prev,f,f.next))return;f=f.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&ha(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=da(p.prev,p,p.next))return;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&ha(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&0<=da(f.prev,f,f.next))return;f=f.nextZ}return 1}}function oa(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!pa(i,o)&&fa(i,r,r.next,o)&&ma(i,o)&&ma(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),va(r),va(r.next),r=t=o),r=r.next}while(r!==t);return r}function aa(t,e,n,r,i,o){var a,s,l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&(s=c,(a=l).next.i!==s.i&&a.prev.i!==s.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&fa(n,n.next,t,e))return 1;n=n.next}while(n!==t)}(a,s)&&ma(a,s)&&ma(s,a)&&function(t,e){for(var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),(n=n.next)!==t;);return r}(a,s))){var u=ga(l,c);return l=ea(l,l.next),u=ea(u,u.next),na(l,e,n,r,i,o),void na(u,e,n,r,i,o)}c=c.next}l=l.next}while(l!==t)}function sa(t,e){return t.x-e.x}function la(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&a<s){if((a=s)===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===a)return n.prev;var l,c=n,u=n.x,h=n.y,d=1/0;for(r=n.next;r!==c;)i>=r.x&&r.x>=u&&i!==r.x&&ha(o<h?i:a,o,u,h,o<h?a:i,o,r.x,r.y)&&((l=Math.abs(o-r.y)/(i-r.x))<d||l===d&&r.x>n.x)&&ma(r,t)&&(n=r,d=l),r=r.next;return n}(t,e)){var n=ga(e,t);ea(n,n.next)}}function ca(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ua(t){for(var e=t,n=t;(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),(e=e.next)!==t;);return n}function ha(t,e,n,r,i,o,a,s){return 0<=(i-a)*(e-s)-(t-a)*(o-s)&&0<=(t-a)*(r-s)-(n-a)*(e-s)&&0<=(n-a)*(o-s)-(i-a)*(r-s)}function da(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function pa(t,e){return t.x===e.x&&t.y===e.y}function fa(t,e,n,r){return pa(t,n)&&pa(e,r)||pa(t,r)&&pa(n,e)||0<da(t,e,n)!=0<da(t,e,r)&&0<da(n,r,t)!=0<da(n,r,e)}function ma(t,e){return da(t.prev,t,t.next)<0?0<=da(t,e,t.next)&&0<=da(t,t.prev,e):da(t,e,t.prev)<0||da(t,t.next,e)<0}function ga(t,e){var n=new xa(t.i,t.x,t.y),r=new xa(e.i,e.x,e.y),i=t.next,o=e.prev;return(t.next=e).prev=t,(n.next=i).prev=n,(r.next=n).prev=r,(o.next=r).prev=o,r}function ya(t,e,n,r){var i=new xa(t,e,n);return r?(i.next=r.next,(i.prev=r).next.prev=i,r.next=i):(i.prev=i).next=i,i}function va(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 xa(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}Ao.prototype=Object.assign(Object.create(Bt.prototype),{constructor:Ao,isPoints:!0,raycast:function(t,e){var n=this.geometry,r=this.matrixWorld,i=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Eo.copy(n.boundingSphere),Eo.applyMatrix4(r),Eo.radius+=i,!1!==t.ray.intersectsSphere(Eo)){So.getInverse(r),To.copy(t.ray).applyMatrix4(So);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o;if(n.isBufferGeometry){var s=n.index,l=n.attributes.position.array;if(null!==s)for(var c=s.array,u=0,h=c.length;u<h;u++){var d=c[u];Do.fromArray(l,3*d),Oo(Do,d,a,r,t,e,this)}else{u=0;for(var p=l.length/3;u<p;u++)Do.fromArray(l,3*u),Oo(Do,u,a,r,t,e,this)}}else{var f=n.vertices;for(u=0,p=f.length;u<p;u++)Oo(f[u],u,a,r,t,e,this)}}},updateMorphTargets:function(){var t,e,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,o=Object.keys(i);if(0<o.length){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t<e;t++)n=a[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=r.morphTargets;void 0!==s&&0<s.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)}}),Po.prototype=Object.assign(Object.create(it.prototype),{constructor:Po,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),((Lo.prototype=Object.create(it.prototype)).constructor=Lo).prototype.isCompressedTexture=!0,((Ro.prototype=Object.create(it.prototype)).constructor=Ro).prototype.isCanvasTexture=!0,((Io.prototype=Object.create(it.prototype)).constructor=Io).prototype.isDepthTexture=!0,(ko.prototype=Object.create(nn.prototype)).constructor=ko,(Fo.prototype=Object.create(Dn.prototype)).constructor=Fo,(Bo.prototype=Object.create(nn.prototype)).constructor=Bo,(jo.prototype=Object.create(Dn.prototype)).constructor=jo,(No.prototype=Object.create(nn.prototype)).constructor=No,(zo.prototype=Object.create(Dn.prototype)).constructor=zo,(Vo.prototype=Object.create(No.prototype)).constructor=Vo,(Go.prototype=Object.create(Dn.prototype)).constructor=Go,(Ho.prototype=Object.create(No.prototype)).constructor=Ho,(Uo.prototype=Object.create(Dn.prototype)).constructor=Uo,(Wo.prototype=Object.create(No.prototype)).constructor=Wo,(Jo.prototype=Object.create(Dn.prototype)).constructor=Jo,(qo.prototype=Object.create(No.prototype)).constructor=qo,(Xo.prototype=Object.create(Dn.prototype)).constructor=Xo,((Yo.prototype=Object.create(nn.prototype)).constructor=Yo).prototype.toJSON=function(){var t=nn.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},(Zo.prototype=Object.create(Dn.prototype)).constructor=Zo,($o.prototype=Object.create(nn.prototype)).constructor=$o,(Ko.prototype=Object.create(Dn.prototype)).constructor=Ko,(Qo.prototype=Object.create(nn.prototype)).constructor=Qo;var ba={area:function(t){for(var e=t.length,n=0,r=e-1,i=0;i<e;r=i++)n+=t[r].x*t[i].y-t[i].x*t[r].y;return.5*n},isClockWise:function(t){return ba.area(t)<0},triangulateShape:function(t,e){var n=[],r=[],i=[];wa(t),Ma(n,t);var o=t.length;e.forEach(wa);for(var a=0;a<e.length;a++)r.push(o),o+=e[a].length,Ma(n,e[a]);var s=function(t,e,n){n=n||2;var r,i,o,a,s,l,c,u=e&&e.length,h=u?e[0]*n:t.length,d=ta(t,0,h,n,!0),p=[];if(!d||d.next===d.prev)return p;if(u&&(d=function(t,e,n,r){var i,o,a,s=[];for(i=0,o=e.length;i<o;i++)(a=ta(t,e[i]*r,i<o-1?e[i+1]*r:t.length,r,!1))===a.next&&(a.steiner=!0),s.push(ua(a));for(s.sort(sa),i=0;i<s.length;i++)la(s[i],n),n=ea(n,n.next);return n}(t,e,d,n)),t.length>80*n){r=o=t[0],i=a=t[1];for(var f=n;f<h;f+=n)(s=t[f])<r&&(r=s),(l=t[f+1])<i&&(i=l),o<s&&(o=s),a<l&&(a=l);c=0!==(c=Math.max(o-r,a-i))?1/c:0}return na(d,p,n,r,i,c),p}(n,r);for(a=0;a<s.length;a+=3)i.push(s.slice(a,a+3));return i}};function wa(t){var e=t.length;2<e&&t[e-1].equals(t[0])&&t.pop()}function Ma(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function _a(t,e){Dn.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new Ca(t,e)),this.mergeVertices()}function Ca(t,e){nn.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:e};for(var n=this,r=[],i=[],o=0,a=(t=Array.isArray(t)?t:[t]).length;o<a;o++)s(t[o]);function s(t){var o=[],a=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1,l=void 0!==e.depth?e.depth:100,c=void 0===e.bevelEnabled||e.bevelEnabled,u=void 0!==e.bevelThickness?e.bevelThickness:6,h=void 0!==e.bevelSize?e.bevelSize:u-2,d=void 0!==e.bevelOffset?e.bevelOffset:0,p=void 0!==e.bevelSegments?e.bevelSegments:3,f=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:Sa;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=e.amount);var g,y,v,x,b,w,M,_,C=!1;f&&(g=f.getSpacedPoints(s),c=!(C=!0),y=f.computeFrenetFrames(s,!1),v=new ht,x=new ht,b=new ht),c||(d=h=u=p=0);var S=t.extractPoints(a),T=S.shape,E=S.holes;if(!ba.isClockWise(T))for(T=T.reverse(),M=0,_=E.length;M<_;M++)w=E[M],ba.isClockWise(w)&&(E[M]=w.reverse());var D=ba.triangulateShape(T,E),A=T;for(M=0,_=E.length;M<_;M++)w=E[M],T=T.concat(w);function O(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var P,L,R,I,k,F,B=T.length,j=D.length;function N(t,e,n){var r,i,o,a=t.x-e.x,s=t.y-e.y,l=n.x-t.x,c=n.y-t.y,u=a*a+s*s,h=a*c-s*l;if(Math.abs(h)>Number.EPSILON){var d=Math.sqrt(u),p=Math.sqrt(l*l+c*c),f=e.x-s/d,m=e.y+a/d,g=((n.x-c/p-f)*c-(n.y+l/p-m)*l)/(a*c-s*l),y=(r=f+a*g-t.x)*r+(i=m+s*g-t.y)*i;if(y<=2)return new tt(r,i);o=Math.sqrt(y/2)}else{var v=!1;a>Number.EPSILON?l>Number.EPSILON&&(v=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(v=!0):Math.sign(s)===Math.sign(c)&&(v=!0),o=v?(r=-s,i=a,Math.sqrt(u)):(r=a,i=s,Math.sqrt(u/2))}return new tt(r/o,i/o)}for(var z=[],V=0,G=A.length,H=G-1,U=V+1;V<G;V++,H++,U++)H===G&&(H=0),U===G&&(U=0),z[V]=N(A[V],A[H],A[U]);var W,J,q=[],X=z.concat();for(M=0,_=E.length;M<_;M++){for(w=E[M],W=[],V=0,H=(G=w.length)-1,U=V+1;V<G;V++,H++,U++)H===G&&(H=0),U===G&&(U=0),W[V]=N(w[V],w[H],w[U]);q.push(W),X=X.concat(W)}for(P=0;P<p;P++){for(R=P/p,I=u*Math.cos(R*Math.PI/2),L=h*Math.sin(R*Math.PI/2)+d,V=0,G=A.length;V<G;V++)Z((k=O(A[V],z[V],L)).x,k.y,-I);for(M=0,_=E.length;M<_;M++)for(w=E[M],W=q[M],V=0,G=w.length;V<G;V++)Z((k=O(w[V],W[V],L)).x,k.y,-I)}for(L=h+d,V=0;V<B;V++)k=c?O(T[V],X[V],L):T[V],C?(x.copy(y.normals[0]).multiplyScalar(k.x),v.copy(y.binormals[0]).multiplyScalar(k.y),b.copy(g[0]).add(x).add(v),Z(b.x,b.y,b.z)):Z(k.x,k.y,0);for(J=1;J<=s;J++)for(V=0;V<B;V++)k=c?O(T[V],X[V],L):T[V],C?(x.copy(y.normals[J]).multiplyScalar(k.x),v.copy(y.binormals[J]).multiplyScalar(k.y),b.copy(g[J]).add(x).add(v),Z(b.x,b.y,b.z)):Z(k.x,k.y,l/s*J);for(P=p-1;0<=P;P--){for(R=P/p,I=u*Math.cos(R*Math.PI/2),L=h*Math.sin(R*Math.PI/2)+d,V=0,G=A.length;V<G;V++)Z((k=O(A[V],z[V],L)).x,k.y,l+I);for(M=0,_=E.length;M<_;M++)for(w=E[M],W=q[M],V=0,G=w.length;V<G;V++)k=O(w[V],W[V],L),C?Z(k.x,k.y+g[s-1].y,g[s-1].x+I):Z(k.x,k.y,l+I)}function Y(t,e){var n,r;for(V=t.length;0<=--V;){(r=(n=V)-1)<0&&(r=t.length-1);var i=0,o=s+2*p;for(i=0;i<o;i++){var a=B*i,l=B*(i+1);K(e+n+a,e+r+a,e+r+l,e+n+l)}}}function Z(t,e,n){o.push(t),o.push(e),o.push(n)}function $(t,e,i){Q(t),Q(e),Q(i);var o=r.length/3,a=m.generateTopUV(n,r,o-3,o-2,o-1);et(a[0]),et(a[1]),et(a[2])}function K(t,e,i,o){Q(t),Q(e),Q(o),Q(e),Q(i),Q(o);var a=r.length/3,s=m.generateSideWallUV(n,r,a-6,a-3,a-2,a-1);et(s[0]),et(s[1]),et(s[3]),et(s[1]),et(s[2]),et(s[3])}function Q(t){r.push(o[3*t+0]),r.push(o[3*t+1]),r.push(o[3*t+2])}function et(t){i.push(t.x),i.push(t.y)}!function(){var t=r.length/3;if(c){var e=0,i=B*e;for(V=0;V<j;V++)$((F=D[V])[2]+i,F[1]+i,F[0]+i);for(i=B*(e=s+2*p),V=0;V<j;V++)$((F=D[V])[0]+i,F[1]+i,F[2]+i)}else{for(V=0;V<j;V++)$((F=D[V])[2],F[1],F[0]);for(V=0;V<j;V++)$((F=D[V])[0]+B*s,F[1]+B*s,F[2]+B*s)}n.addGroup(t,r.length/3-t,0)}(),function(){var t=r.length/3,e=0;for(Y(A,e),e+=A.length,M=0,_=E.length;M<_;M++)Y(w=E[M],e),e+=w.length;n.addGroup(t,r.length/3-t,1)}()}this.setAttribute("position",new We(r,3)),this.setAttribute("uv",new We(i,2)),this.computeVertexNormals()}((_a.prototype=Object.create(Dn.prototype)).constructor=_a).prototype.toJSON=function(){var t=Dn.prototype.toJSON.call(this);return Ta(this.parameters.shapes,this.parameters.options,t)},((Ca.prototype=Object.create(nn.prototype)).constructor=Ca).prototype.toJSON=function(){var t=nn.prototype.toJSON.call(this);return Ta(this.parameters.shapes,this.parameters.options,t)};var Sa={generateTopUV:function(t,e,n,r,i){var o=e[3*n],a=e[3*n+1],s=e[3*r],l=e[3*r+1],c=e[3*i],u=e[3*i+1];return[new tt(o,a),new tt(s,l),new tt(c,u)]},generateSideWallUV:function(t,e,n,r,i,o){var a=e[3*n],s=e[3*n+1],l=e[3*n+2],c=e[3*r],u=e[3*r+1],h=e[3*r+2],d=e[3*i],p=e[3*i+1],f=e[3*i+2],m=e[3*o],g=e[3*o+1],y=e[3*o+2];return Math.abs(s-u)<.01?[new tt(a,1-l),new tt(c,1-h),new tt(d,1-f),new tt(m,1-y)]:[new tt(s,1-l),new tt(u,1-h),new tt(p,1-f),new tt(g,1-y)]}};function Ta(t,e,n){if(n.shapes=[],Array.isArray(t))for(var r=0,i=t.length;r<i;r++){var o=t[r];n.shapes.push(o.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function Ea(t,e){Dn.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new Da(t,e)),this.mergeVertices()}function Da(t,e){var n=(e=e||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Dn;var r=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),Ca.call(this,r,e),this.type="TextBufferGeometry"}function Aa(t,e,n,r,i,o,a){Dn.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new Oa(t,e,n,r,i,o,a)),this.mergeVertices()}function Oa(t,e,n,r,i,o,a){nn.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI,o=void 0!==o?o:0,a=void 0!==a?a:Math.PI;var s,l,c=Math.min(o+a,Math.PI),u=0,h=[],d=new ht,p=new ht,f=[],m=[],g=[],y=[];for(l=0;l<=n;l++){var v=[],x=l/n,b=0;for(0==l&&0==o?b=.5/e:l==n&&c==Math.PI&&(b=-.5/e),s=0;s<=e;s++){var w=s/e;d.x=-t*Math.cos(r+w*i)*Math.sin(o+x*a),d.y=t*Math.cos(o+x*a),d.z=t*Math.sin(r+w*i)*Math.sin(o+x*a),m.push(d.x,d.y,d.z),p.copy(d).normalize(),g.push(p.x,p.y,p.z),y.push(w+b,1-x),v.push(u++)}h.push(v)}for(l=0;l<n;l++)for(s=0;s<e;s++){var M=h[l][s+1],_=h[l][s],C=h[l+1][s],S=h[l+1][s+1];(0!==l||0<o)&&f.push(M,_,S),(l!==n-1||c<Math.PI)&&f.push(_,C,S)}this.setIndex(f),this.setAttribute("position",new We(m,3)),this.setAttribute("normal",new We(g,3)),this.setAttribute("uv",new We(y,2))}function Pa(t,e,n,r,i,o){Dn.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},this.fromBufferGeometry(new La(t,e,n,r,i,o)),this.mergeVertices()}function La(t,e,n,r,i,o){nn.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},t=t||.5,e=e||1,i=void 0!==i?i:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var a,s,l,c=[],u=[],h=[],d=[],p=t,f=(e-t)/(r=void 0!==r?Math.max(1,r):1),m=new ht,g=new tt;for(s=0;s<=r;s++){for(l=0;l<=n;l++)a=i+l/n*o,m.x=p*Math.cos(a),m.y=p*Math.sin(a),u.push(m.x,m.y,m.z),h.push(0,0,1),g.x=(m.x/e+1)/2,g.y=(m.y/e+1)/2,d.push(g.x,g.y);p+=f}for(s=0;s<r;s++){var y=s*(n+1);for(l=0;l<n;l++){var v=a=l+y,x=a+n+1,b=a+n+2,w=a+1;c.push(v,x,w),c.push(x,b,w)}}this.setIndex(c),this.setAttribute("position",new We(u,3)),this.setAttribute("normal",new We(h,3)),this.setAttribute("uv",new We(d,2))}function Ra(t,e,n,r){Dn.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},this.fromBufferGeometry(new Ia(t,e,n,r)),this.mergeVertices()}function Ia(t,e,n,r){nn.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},e=Math.floor(e)||12,n=n||0,r=r||2*Math.PI,r=Q.clamp(r,0,2*Math.PI);var i,o,a,s=[],l=[],c=[],u=1/e,h=new ht,d=new tt;for(o=0;o<=e;o++){var p=n+o*u*r,f=Math.sin(p),m=Math.cos(p);for(a=0;a<=t.length-1;a++)h.x=t[a].x*f,h.y=t[a].y,h.z=t[a].x*m,l.push(h.x,h.y,h.z),d.x=o/e,d.y=a/(t.length-1),c.push(d.x,d.y)}for(o=0;o<e;o++)for(a=0;a<t.length-1;a++){var g=i=a+o*t.length,y=i+t.length,v=i+t.length+1,x=i+1;s.push(g,y,x),s.push(y,v,x)}if(this.setIndex(s),this.setAttribute("position",new We(l,3)),this.setAttribute("uv",new We(c,2)),this.computeVertexNormals(),r===2*Math.PI){var b=this.attributes.normal.array,w=new ht,M=new ht,_=new ht;for(i=e*t.length*3,a=o=0;o<t.length;o++,a+=3)w.x=b[a+0],w.y=b[a+1],w.z=b[a+2],M.x=b[i+a+0],M.y=b[i+a+1],M.z=b[i+a+2],_.addVectors(w,M).normalize(),b[a+0]=b[i+a+0]=_.x,b[a+1]=b[i+a+1]=_.y,b[a+2]=b[i+a+2]=_.z}}function ka(t,e){Dn.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new Fa(t,e)),this.mergeVertices()}function Fa(t,e){nn.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var n=[],r=[],i=[],o=[],a=0,s=0;if(!1===Array.isArray(t))c(t);else for(var l=0;l<t.length;l++)c(t[l]),this.addGroup(a,s,l),a+=s,s=0;function c(t){var a,l,c,u=r.length/3,h=t.extractPoints(e),d=h.shape,p=h.holes;for(!1===ba.isClockWise(d)&&(d=d.reverse()),a=0,l=p.length;a<l;a++)c=p[a],!0===ba.isClockWise(c)&&(p[a]=c.reverse());var f=ba.triangulateShape(d,p);for(a=0,l=p.length;a<l;a++)c=p[a],d=d.concat(c);for(a=0,l=d.length;a<l;a++){var m=d[a];r.push(m.x,m.y,0),i.push(0,0,1),o.push(m.x,m.y)}for(a=0,l=f.length;a<l;a++){var g=f[a],y=g[0]+u,v=g[1]+u,x=g[2]+u;n.push(y,v,x),s+=3}}this.setIndex(n),this.setAttribute("position",new We(r,3)),this.setAttribute("normal",new We(i,3)),this.setAttribute("uv",new We(o,2))}function Ba(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,r=t.length;n<r;n++){var i=t[n];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}function ja(t,e){nn.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,r,i,o,a=[],s=Math.cos(Q.DEG2RAD*e),l=[0,0],c={},u=["a","b","c"];t.isBufferGeometry?(o=new Dn).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var h=o.vertices,d=o.faces,p=0,f=d.length;p<f;p++)for(var m=d[p],g=0;g<3;g++)n=m[u[g]],r=m[u[(g+1)%3]],l[0]=Math.min(n,r),l[1]=Math.max(n,r),void 0===c[i=l[0]+","+l[1]]?c[i]={index1:l[0],index2:l[1],face1:p,face2:void 0}:c[i].face2=p;for(i in c){var y=c[i];if(void 0===y.face2||d[y.face1].normal.dot(d[y.face2].normal)<=s){var v=h[y.index1];a.push(v.x,v.y,v.z),v=h[y.index2],a.push(v.x,v.y,v.z)}}this.setAttribute("position",new We(a,3))}function Na(t,e,n,r,i,o,a,s){Dn.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new za(t,e,n,r,i,o,a,s)),this.mergeVertices()}function za(t,e,n,r,i,o,a,s){nn.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s};var l=this;t=void 0!==t?t:1,e=void 0!==e?e:1,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var c=[],u=[],h=[],d=[],p=0,f=[],m=n/2,g=0;function y(n){var i,o,f,y=new tt,v=new ht,x=0,b=!0===n?t:e,w=!0===n?1:-1;for(o=p,i=1;i<=r;i++)u.push(0,m*w,0),h.push(0,w,0),d.push(.5,.5),p++;for(f=p,i=0;i<=r;i++){var M=i/r*s+a,_=Math.cos(M),C=Math.sin(M);v.x=b*C,v.y=m*w,v.z=b*_,u.push(v.x,v.y,v.z),h.push(0,w,0),y.x=.5*_+.5,y.y=.5*C*w+.5,d.push(y.x,y.y),p++}for(i=0;i<r;i++){var S=o+i,T=f+i;!0===n?c.push(T,T+1,S):c.push(T+1,T,S),x+=3}l.addGroup(g,x,!0===n?1:2),g+=x}!function(){var o,y,v=new ht,x=new ht,b=0,w=(e-t)/n;for(y=0;y<=i;y++){var M=[],_=y/i,C=_*(e-t)+t;for(o=0;o<=r;o++){var S=o/r,T=S*s+a,E=Math.sin(T),D=Math.cos(T);x.x=C*E,x.y=-_*n+m,x.z=C*D,u.push(x.x,x.y,x.z),v.set(E,w,D).normalize(),h.push(v.x,v.y,v.z),d.push(S,1-_),M.push(p++)}f.push(M)}for(o=0;o<r;o++)for(y=0;y<i;y++){var A=f[y][o],O=f[y+1][o],P=f[y+1][o+1],L=f[y][o+1];c.push(A,O,L),c.push(O,P,L),b+=6}l.addGroup(g,b,0),g+=b}(),!1===o&&(0<t&&y(!0),0<e&&y(!1)),this.setIndex(c),this.setAttribute("position",new We(u,3)),this.setAttribute("normal",new We(h,3)),this.setAttribute("uv",new We(d,2))}function Va(t,e,n,r,i,o,a){Na.call(this,0,t,e,n,r,i,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function Ga(t,e,n,r,i,o,a){za.call(this,0,t,e,n,r,i,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function Ha(t,e,n,r){Dn.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Ua(t,e,n,r)),this.mergeVertices()}function Ua(t,e,n,r){nn.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,o,a=[],s=[],l=[],c=[],u=new ht,h=new tt;for(s.push(0,0,0),l.push(0,0,1),c.push(.5,.5),o=0,i=3;o<=e;o++,i+=3){var d=n+o/e*r;u.x=t*Math.cos(d),u.y=t*Math.sin(d),s.push(u.x,u.y,u.z),l.push(0,0,1),h.x=(s[i]/t+1)/2,h.y=(s[i+1]/t+1)/2,c.push(h.x,h.y)}for(i=1;i<=e;i++)a.push(i,i+1,0);this.setIndex(a),this.setAttribute("position",new We(s,3)),this.setAttribute("normal",new We(l,3)),this.setAttribute("uv",new We(c,2))}(Ea.prototype=Object.create(Dn.prototype)).constructor=Ea,(Da.prototype=Object.create(Ca.prototype)).constructor=Da,(Aa.prototype=Object.create(Dn.prototype)).constructor=Aa,(Oa.prototype=Object.create(nn.prototype)).constructor=Oa,(Pa.prototype=Object.create(Dn.prototype)).constructor=Pa,(La.prototype=Object.create(nn.prototype)).constructor=La,(Ra.prototype=Object.create(Dn.prototype)).constructor=Ra,(Ia.prototype=Object.create(nn.prototype)).constructor=Ia,((ka.prototype=Object.create(Dn.prototype)).constructor=ka).prototype.toJSON=function(){var t=Dn.prototype.toJSON.call(this);return Ba(this.parameters.shapes,t)},((Fa.prototype=Object.create(nn.prototype)).constructor=Fa).prototype.toJSON=function(){var t=nn.prototype.toJSON.call(this);return Ba(this.parameters.shapes,t)},(ja.prototype=Object.create(nn.prototype)).constructor=ja,(Na.prototype=Object.create(Dn.prototype)).constructor=Na,(za.prototype=Object.create(nn.prototype)).constructor=za,(Va.prototype=Object.create(Na.prototype)).constructor=Va,(Ga.prototype=Object.create(za.prototype)).constructor=Ga,(Ha.prototype=Object.create(Dn.prototype)).constructor=Ha,(Ua.prototype=Object.create(nn.prototype)).constructor=Ua;var Wa=Object.freeze({__proto__:null,WireframeGeometry:ko,ParametricGeometry:Fo,ParametricBufferGeometry:Bo,TetrahedronGeometry:zo,TetrahedronBufferGeometry:Vo,OctahedronGeometry:Go,OctahedronBufferGeometry:Ho,IcosahedronGeometry:Uo,IcosahedronBufferGeometry:Wo,DodecahedronGeometry:Jo,DodecahedronBufferGeometry:qo,PolyhedronGeometry:jo,PolyhedronBufferGeometry:No,TubeGeometry:Xo,TubeBufferGeometry:Yo,TorusKnotGeometry:Zo,TorusKnotBufferGeometry:$o,TorusGeometry:Ko,TorusBufferGeometry:Qo,TextGeometry:Ea,TextBufferGeometry:Da,SphereGeometry:Aa,SphereBufferGeometry:Oa,RingGeometry:Pa,RingBufferGeometry:La,PlaneGeometry:Wn,PlaneBufferGeometry:Jn,LatheGeometry:Ra,LatheBufferGeometry:Ia,ShapeGeometry:ka,ShapeBufferGeometry:Fa,ExtrudeGeometry:_a,ExtrudeBufferGeometry:Ca,EdgesGeometry:ja,ConeGeometry:Va,ConeBufferGeometry:Ga,CylinderGeometry:Na,CylinderBufferGeometry:za,CircleGeometry:Ha,CircleBufferGeometry:Ua,BoxGeometry:An,BoxBufferGeometry:On});function Ja(t){Ie.call(this),this.type="ShadowMaterial",this.color=new De(0),this.transparent=!0,this.setValues(t)}function qa(t){In.call(this,t),this.type="RawShaderMaterial"}function Xa(t){Ie.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new De(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 De(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new tt(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.setValues(t)}function Ya(t){Xa.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoat=0,this.clearcoatRoughness=0,this.sheen=null,this.clearcoatNormalScale=new tt(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(t)}function Za(t){Ie.call(this),this.type="MeshPhongMaterial",this.color=new De(16777215),this.specular=new De(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new De(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new tt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,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 $a(t){Ie.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new De(16777215),this.specular=new De(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 De(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new tt(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 Ka(t){Ie.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new tt(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 Qa(t){Ie.call(this),this.type="MeshLambertMaterial",this.color=new De(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new De(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,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 ts(t){Ie.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new De(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new tt(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 es(t){po.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}((Ja.prototype=Object.create(Ie.prototype)).constructor=Ja).prototype.isShadowMaterial=!0,Ja.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.color.copy(t.color),this},((qa.prototype=Object.create(In.prototype)).constructor=qa).prototype.isRawShaderMaterial=!0,((Xa.prototype=Object.create(Ie.prototype)).constructor=Xa).prototype.isMeshStandardMaterial=!0,Xa.prototype.copy=function(t){return Ie.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},((Ya.prototype=Object.create(Xa.prototype)).constructor=Ya).prototype.isMeshPhysicalMaterial=!0,Ya.prototype.copy=function(t){return Xa.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearcoat=t.clearcoat,this.clearcoatRoughness=t.clearcoatRoughness,t.sheen?this.sheen=(this.sheen||new De).copy(t.sheen):this.sheen=null,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.transparency=t.transparency,this},((Za.prototype=Object.create(Ie.prototype)).constructor=Za).prototype.isMeshPhongMaterial=!0,Za.prototype.copy=function(t){return Ie.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},(($a.prototype=Object.create(Ie.prototype)).constructor=$a).prototype.isMeshToonMaterial=!0,$a.prototype.copy=function(t){return Ie.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},((Ka.prototype=Object.create(Ie.prototype)).constructor=Ka).prototype.isMeshNormalMaterial=!0,Ka.prototype.copy=function(t){return Ie.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},((Qa.prototype=Object.create(Ie.prototype)).constructor=Qa).prototype.isMeshLambertMaterial=!0,Qa.prototype.copy=function(t){return Ie.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},((ts.prototype=Object.create(Ie.prototype)).constructor=ts).prototype.isMeshMatcapMaterial=!0,ts.prototype.copy=function(t){return Ie.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},((es.prototype=Object.create(po.prototype)).constructor=es).prototype.isLineDashedMaterial=!0,es.prototype.copy=function(t){return po.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var ns=Object.freeze({__proto__:null,ShadowMaterial:Ja,SpriteMaterial:ji,RawShaderMaterial:qa,ShaderMaterial:In,PointsMaterial:Co,MeshPhysicalMaterial:Ya,MeshStandardMaterial:Xa,MeshPhongMaterial:Za,MeshToonMaterial:$a,MeshNormalMaterial:Ka,MeshLambertMaterial:Qa,MeshDepthMaterial:bi,MeshDistanceMaterial:wi,MeshBasicMaterial:ke,MeshMatcapMaterial:ts,LineDashedMaterial:es,LineBasicMaterial:po,Material:Ie}),rs={arraySlice:function(t,e,n){return rs.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,n=new Array(e),r=0;r!==e;++r)n[r]=r;return n.sort(function(e,n){return t[e]-t[n]}),n},sortedArray:function(t,e,n){for(var r=t.length,i=new t.constructor(r),o=0,a=0;a!==r;++o)for(var s=n[o]*e,l=0;l!==e;++l)i[a++]=t[s+l];return i},flattenJSON:function(t,e,n,r){for(var i=1,o=t[0];void 0!==o&&void 0===o[r];)o=t[i++];if(void 0!==o){var a=o[r];if(void 0!==a)if(Array.isArray(a))for(;void 0!==(a=o[r])&&(e.push(o.time),n.push.apply(n,a)),void 0!==(o=t[i++]););else if(void 0!==a.toArray)for(;void 0!==(a=o[r])&&(e.push(o.time),a.toArray(n,n.length)),void 0!==(o=t[i++]););else for(;void 0!==(a=o[r])&&(e.push(o.time),n.push(a)),void 0!==(o=t[i++]););}},subclip:function(t,e,n,r,i){i=i||30;var o=t.clone();o.name=e;for(var a=[],s=0;s<o.tracks.length;++s){for(var l=o.tracks[s],c=l.getValueSize(),u=[],h=[],d=0;d<l.times.length;++d){var p=l.times[d]*i;if(!(p<n||r<=p)){u.push(l.times[d]);for(var f=0;f<c;++f)h.push(l.values[d*c+f])}}0!==u.length&&(l.times=rs.convertArray(u,l.times.constructor),l.values=rs.convertArray(h,l.values.constructor),a.push(l))}o.tracks=a;var m=1/0;for(s=0;s<o.tracks.length;++s)m>o.tracks[s].times[0]&&(m=o.tracks[s].times[0]);for(s=0;s<o.tracks.length;++s)o.tracks[s].shift(-1*m);return o.resetDuration(),o}};function is(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function os(t,e,n,r){is.call(this,t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function as(t,e,n,r){is.call(this,t,e,n,r)}function ss(t,e,n,r){is.call(this,t,e,n,r)}function ls(t,e,n,r){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=rs.convertArray(e,this.TimeBufferType),this.values=rs.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function cs(t,e,n){ls.call(this,t,e,n)}function us(t,e,n,r){ls.call(this,t,e,n,r)}function hs(t,e,n,r){ls.call(this,t,e,n,r)}function ds(t,e,n,r){is.call(this,t,e,n,r)}function ps(t,e,n,r){ls.call(this,t,e,n,r)}function fs(t,e,n,r){ls.call(this,t,e,n,r)}function ms(t,e,n,r){ls.call(this,t,e,n,r)}function gs(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=Q.generateUUID(),this.duration<0&&this.resetDuration()}function ys(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return hs;case"vector":case"vector2":case"vector3":case"vector4":return ms;case"color":return us;case"quaternion":return ps;case"bool":case"boolean":return cs;case"string":return fs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var n=[],r=[];rs.flattenJSON(t.keys,n,r,"value"),t.times=n,t.values=r}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(is.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,r=e[n],i=e[n-1];t:{e:{var o;n:{r:if(!(t<r)){for(var a=n+2;;){if(void 0===r){if(t<i)break r;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,i)}if(n===a)break;if(i=r,t<(r=e[++n]))break e}o=e.length;break n}if(i<=t)break t;var s=e[1];for(t<s&&(n=2,i=s),a=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===a)break;if(r=i,(i=e[--n-1])<=t)break e}o=n,n=0}for(;n<o;){var l=n+o>>>1;t<e[l]?o=l:n=1+l}if(r=e[n],void 0===(i=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,r);if(void 0===r)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,i,t)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,t,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=t*r,o=0;o!==r;++o)e[o]=n[i+o];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(is.prototype,{beforeStart_:is.prototype.copySampleValue_,afterEnd_:is.prototype.copySampleValue_}),os.prototype=Object.assign(Object.create(is.prototype),{constructor:os,DefaultSettings_:{endingStart:F,endingEnd:F},intervalChanged_:function(t,e,n){var r=this.parameterPositions,i=t-2,o=t+1,a=r[i],s=r[o];if(void 0===a)switch(this.getSettings_().endingStart){case B:i=t,a=2*e-n;break;case j:a=e+r[i=r.length-2]-r[i+1];break;default:i=t,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case B:o=t,s=2*n-e;break;case j:s=n+r[o=1]-r[0];break;default:o=t-1,s=e}var l=.5*(n-e),c=this.valueSize;this._weightPrev=l/(e-a),this._weightNext=l/(s-n),this._offsetPrev=i*c,this._offsetNext=o*c},interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,l=s-a,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(n-e)/(r-e),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,y=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,v=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f,b=0;b!==a;++b)i[b]=g*o[c+b]+y*o[l+b]+v*o[s+b]+x*o[u+b];return i}}),as.prototype=Object.assign(Object.create(is.prototype),{constructor:as,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,l=s-a,c=(n-e)/(r-e),u=1-c,h=0;h!==a;++h)i[h]=o[l+h]*u+o[s+h]*c;return i}}),ss.prototype=Object.assign(Object.create(is.prototype),{constructor:ss,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(ls,{toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:rs.convertArray(t.times,Array),values:rs.convertArray(t.values,Array)};var r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r)}return e.type=t.ValueTypeName,e}}),Object.assign(ls.prototype,{constructor:ls,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:k,InterpolantFactoryMethodDiscrete:function(t){return new ss(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new as(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new os(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case I:e=this.InterpolantFactoryMethodDiscrete;break;case k:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0!==e)return this.createInterpolant=e,this;var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return I;case this.InterpolantFactoryMethodLinear:return k;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]*=t;return this},trim:function(t,e){for(var n=this.times,r=n.length,i=0,o=r-1;i!==r&&n[i]<t;)++i;for(;-1!==o&&n[o]>e;)--o;if(++o,0!==i||o!==r){o<=i&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=rs.arraySlice(n,i,o),this.values=rs.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&s<o){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==r&&rs.isTypedArray(r)){a=0;for(var l=r.length;a!==l;++a){var c=r[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),t=!1;break}}}return t},optimize:function(){for(var t=rs.arraySlice(this.times),e=rs.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=1,o=t.length-1,a=1;a<o;++a){var s=!1,l=t[a];if(l!==t[a+1]&&(1!==a||l!==l[0]))if(r)s=!0;else for(var c=a*n,u=c-n,h=c+n,d=0;d!==n;++d){var p=e[c+d];if(p!==e[u+d]||p!==e[h+d]){s=!0;break}}if(s){if(a!==i){t[i]=t[a];var f=a*n,m=i*n;for(d=0;d!==n;++d)e[m+d]=e[f+d]}++i}}if(0<o){for(t[i]=t[o],f=o*n,m=i*n,d=0;d!==n;++d)e[m+d]=e[f+d];++i}return i!==t.length?(this.times=rs.arraySlice(t,0,i),this.values=rs.arraySlice(e,0,i*n)):(this.times=t,this.values=e),this},clone:function(){var t=rs.arraySlice(this.times,0),e=rs.arraySlice(this.values,0),n=new this.constructor(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),cs.prototype=Object.assign(Object.create(ls.prototype),{constructor:cs,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:I,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),us.prototype=Object.assign(Object.create(ls.prototype),{constructor:us,ValueTypeName:"color"}),hs.prototype=Object.assign(Object.create(ls.prototype),{constructor:hs,ValueTypeName:"number"}),ds.prototype=Object.assign(Object.create(is.prototype),{constructor:ds,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,l=(n-e)/(r-e),c=s+a;s!==c;s+=4)lt.slerpFlat(i,0,o,s-a,o,s,l);return i}}),ps.prototype=Object.assign(Object.create(ls.prototype),{constructor:ps,ValueTypeName:"quaternion",DefaultInterpolation:k,InterpolantFactoryMethodLinear:function(t){return new ds(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),fs.prototype=Object.assign(Object.create(ls.prototype),{constructor:fs,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:I,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ms.prototype=Object.assign(Object.create(ls.prototype),{constructor:ms,ValueTypeName:"vector"}),Object.assign(gs,{parse:function(t){for(var e=[],n=t.tracks,r=1/(t.fps||1),i=0,o=n.length;i!==o;++i)e.push(ys(n[i]).scale(r));return new gs(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},i=0,o=n.length;i!==o;++i)e.push(ls.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(t,e,n,r){for(var i=e.length,o=[],a=0;a<i;a++){var s=[],l=[];s.push((a+i-1)%i,a,(a+1)%i),l.push(0,1,0);var c=rs.getKeyframeOrder(s);s=rs.sortedArray(s,1,c),l=rs.sortedArray(l,1,c),r||0!==s[0]||(s.push(i),l.push(l[0])),o.push(new hs(".morphTargetInfluences["+e[a].name+"]",s,l).scale(1/n))}return new gs(t,-1,o)},findByName:function(t,e){var n=t;Array.isArray(t)||(n=t.geometry&&t.geometry.animations||t.animations);for(var r=0;r<n.length;r++)if(n[r].name===e)return n[r];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,o=0,a=t.length;o<a;o++){var s=t[o],l=s.name.match(i);if(l&&1<l.length){var c=r[h=l[1]];c||(r[h]=c=[]),c.push(s)}}var u=[];for(var h in r)u.push(gs.CreateFromMorphTargetSequence(h,r[h],e,n));return u},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,r,i){if(0!==n.length){var o=[],a=[];rs.flattenJSON(n,o,a,r),0!==o.length&&i.push(new t(e,o,a))}},r=[],i=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.hierarchy||[],l=0;l<s.length;l++){var c=s[l].keys;if(c&&0!==c.length)if(c[0].morphTargets){for(var u={},h=0;h<c.length;h++)if(c[h].morphTargets)for(var d=0;d<c[h].morphTargets.length;d++)u[c[h].morphTargets[d]]=-1;for(var p in u){var f=[],m=[];for(d=0;d!==c[h].morphTargets.length;++d){var g=c[h];f.push(g.time),m.push(g.morphTarget===p?1:0)}r.push(new hs(".morphTargetInfluence["+p+"]",f,m))}o=u.length*(a||1)}else{var y=".bones["+e[l].name+"]";n(ms,y+".position",c,"pos",r),n(ps,y+".quaternion",c,"rot",r),n(ms,y+".scale",c,"scl",r)}}return 0===r.length?null:new gs(i,o,r)}}),Object.assign(gs.prototype,{resetDuration:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e){var r=this.tracks[e];t=Math.max(t,r.times[r.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,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].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=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new gs(this.name,this.duration,t)}});var vs={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function xs(t,e,n){var r=this,i=!1,o=0,a=0,s=void 0,l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){a++,!1===i&&void 0!==r.onStart&&r.onStart(t,o,a),i=!0},this.itemEnd=function(t){o++,void 0!==r.onProgress&&r.onProgress(t,o,a),o===a&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){var e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(var e=0,n=l.length;e<n;e+=2){var r=l[e],i=l[e+1];if(r.global&&(r.lastIndex=0),r.test(t))return i}return null}}var bs=new xs;function ws(t){this.manager=void 0!==t?t:bs,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(ws.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}});var Ms={};function _s(t){ws.call(this,t)}function Cs(t){ws.call(this,t)}function Ss(t){ws.call(this,t)}function Ts(t){ws.call(this,t)}function Es(t){ws.call(this,t)}function Ds(t){ws.call(this,t)}function As(t){ws.call(this,t)}function Os(){this.type="Curve",this.arcLengthDivisions=200}function Ps(t,e,n,r,i,o,a,s){Os.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=a||!1,this.aRotation=s||0}function Ls(t,e,n,r,i,o){Ps.call(this,t,e,n,n,r,i,o),this.type="ArcCurve"}function Rs(){var t=0,e=0,n=0,r=0;function i(i,o,a,s){n=-3*(t=i)+3*o-2*(e=a)-s,r=2*i-2*o+a+s}return{initCatmullRom:function(t,e,n,r,o){i(e,n,o*(n-t),o*(r-e))},initNonuniformCatmullRom:function(t,e,n,r,o,a,s){var l=(e-t)/o-(n-t)/(o+a)+(n-e)/a,c=(n-e)/a-(r-e)/(a+s)+(r-n)/s;i(e,n,l*=a,c*=a)},calc:function(i){var o=i*i;return t+e*i+n*o+r*(o*i)}}}_s.prototype=Object.assign(Object.create(ws.prototype),{constructor:_s,load:function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,o=vs.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout(function(){e&&e(o),i.manager.itemEnd(t)},0),o;if(void 0===Ms[t]){var a=t.match(/^data:(.*?)(;base64)?,(.*)$/);if(a){var s=a[1],l=!!a[2],c=a[3];c=decodeURIComponent(c),l&&(c=atob(c));try{var u,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var d=new Uint8Array(c.length),p=0;p<c.length;p++)d[p]=c.charCodeAt(p);u="blob"===h?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var f=new DOMParser;u=f.parseFromString(c,s);break;case"json":u=JSON.parse(c);break;default:u=c}setTimeout(function(){e&&e(u),i.manager.itemEnd(t)},0)}catch(e){setTimeout(function(){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)},0)}}else{Ms[t]=[],Ms[t].push({onLoad:e,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var g in m.open("GET",t,!0),m.addEventListener("load",function(e){var n=this.response,r=Ms[t];if(delete Ms[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),vs.add(t,n);for(var o=0,a=r.length;o<a;o++)(s=r[o]).onLoad&&s.onLoad(n);i.manager.itemEnd(t)}else{for(o=0,a=r.length;o<a;o++){var s;(s=r[o]).onError&&s.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)}},!1),m.addEventListener("progress",function(e){for(var n=Ms[t],r=0,i=n.length;r<i;r++){var o=n[r];o.onProgress&&o.onProgress(e)}},!1),m.addEventListener("error",function(e){var n=Ms[t];delete Ms[t];for(var r=0,o=n.length;r<o;r++){var a=n[r];a.onError&&a.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)},!1),m.addEventListener("abort",function(e){var n=Ms[t];delete Ms[t];for(var r=0,o=n.length;r<o;r++){var a=n[r];a.onError&&a.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)},!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return i.manager.itemStart(t),m}Ms[t].push({onLoad:e,onProgress:n,onError:r})},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}}),Cs.prototype=Object.assign(Object.create(ws.prototype),{constructor:Cs,load:function(t,e,n,r){var i=this,o=new _s(i.manager);o.setPath(i.path),o.load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},parse:function(t){for(var e=[],n=0;n<t.length;n++){var r=gs.parse(t[n]);e.push(r)}return e}}),Ss.prototype=Object.assign(Object.create(ws.prototype),{constructor:Ss,load:function(t,e,n,r){var i=this,o=[],a=new Lo;a.image=o;var s=new _s(this.manager);function l(l){s.load(t[l],function(t){var n=i.parse(t,!0);o[l]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(c+=1)&&(1===n.mipmapCount&&(a.minFilter=p),a.format=n.format,a.needsUpdate=!0,e&&e(a))},n,r)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var c=0,u=0,h=t.length;u<h;++u)l(u);else s.load(t,function(t){var n=i.parse(t,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){o[s]={mipmaps:[]};for(var l=0;l<n.mipmapCount;l++)o[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+l]),o[s].format=n.format,o[s].width=n.width,o[s].height=n.height}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=p),a.format=n.format,a.needsUpdate=!0,e&&e(a)},n,r);return a}}),Ts.prototype=Object.assign(Object.create(ws.prototype),{constructor:Ts,load:function(t,e,n,r){var i=this,o=new Nn,a=new _s(this.manager);return a.setResponseType("arraybuffer"),a.setPath(this.path),a.load(t,function(t){var n=i.parse(t);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:l,o.wrapT=void 0!==n.wrapT?n.wrapT:l,o.magFilter=void 0!==n.magFilter?n.magFilter:p,o.minFilter=void 0!==n.minFilter?n.minFilter:p,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps,o.minFilter=m),1===n.mipmapCount&&(o.minFilter=p),o.needsUpdate=!0,e&&e(o,n))},n,r),o}}),Es.prototype=Object.assign(Object.create(ws.prototype),{constructor:Es,load:function(t,e,n,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,o=vs.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout(function(){e&&e(o),i.manager.itemEnd(t)},0),o;var a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){a.removeEventListener("load",s,!1),a.removeEventListener("error",l,!1),vs.add(t,this),e&&e(this),i.manager.itemEnd(t)}function l(e){a.removeEventListener("load",s,!1),a.removeEventListener("error",l,!1),r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}return a.addEventListener("load",s,!1),a.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(t),a.src=t,a}}),Ds.prototype=Object.assign(Object.create(ws.prototype),{constructor:Ds,load:function(t,e,n,r){var i=new Kn,o=new Es(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;function s(n){o.load(t[n],function(t){i.images[n]=t,6==++a&&(i.needsUpdate=!0,e&&e(i))},void 0,r)}for(var l=0;l<t.length;++l)s(l);return i}}),As.prototype=Object.assign(Object.create(ws.prototype),{constructor:As,load:function(t,e,n,r){var i=new it,o=new Es(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,function(n){i.image=n;var r=0<t.search(/\.jpe?g($|\?)/i)||0===t.search(/^data\:image\/jpeg/);i.format=r?M:_,i.needsUpdate=!0,void 0!==e&&e(i)},n,r),i}}),Object.assign(Os.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},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 e,n,r=[],i=this.getPoint(0),o=0;for(r.push(0),n=1;n<=t;n++)o+=(e=this.getPoint(n/t)).distanceTo(i),r.push(o),i=e;return this.cacheArcLengths=r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,r=this.getLengths(),i=0,o=r.length;n=e||t*r[o-1];for(var a,s=0,l=o-1;s<=l;)if((a=r[i=Math.floor(s+(l-s)/2)]-n)<0)s=i+1;else{if(!(0<a)){l=i;break}l=i-1}if(r[i=l]===n)return i/(o-1);var c=r[i];return(i+(n-c)/(r[i+1]-c))/(o-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),1<n&&(n=1);var r=this.getPoint(e);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,r,i,o=new ht,a=[],s=[],l=[],c=new ht,u=new xt;for(n=0;n<=t;n++)r=n/t,a[n]=this.getTangentAt(r),a[n].normalize();s[0]=new ht,l[0]=new ht;var h=Number.MAX_VALUE,d=Math.abs(a[0].x),p=Math.abs(a[0].y),f=Math.abs(a[0].z);for(d<=h&&(h=d,o.set(1,0,0)),p<=h&&(h=p,o.set(0,1,0)),f<=h&&o.set(0,0,1),c.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],c),l[0].crossVectors(a[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),l[n]=l[n-1].clone(),c.crossVectors(a[n-1],a[n]),c.length()>Number.EPSILON&&(c.normalize(),i=Math.acos(Q.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(c,i))),l[n].crossVectors(a[n],s[n]);if(!0===e)for(i=Math.acos(Q.clamp(s[0].dot(s[t]),-1,1)),i/=t,0<a[0].dot(c.crossVectors(s[0],s[t]))&&(i=-i),n=1;n<=t;n++)s[n].applyMatrix4(u.makeRotationAxis(a[n],i*n)),l[n].crossVectors(a[n],s[n]);return{tangents:a,normals:s,binormals:l}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),((Ps.prototype=Object.create(Os.prototype)).constructor=Ps).prototype.isEllipseCurve=!0,Ps.prototype.getPoint=function(t,e){for(var n=e||new tt,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;r<i;)i-=r;i<Number.EPSILON&&(i=o?0:r),!0!==this.aClockwise||o||(i===r?i=-r:i-=r);var a=this.aStartAngle+t*i,s=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var c=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,d=l-this.aY;s=h*c-d*u+this.aX,l=h*u+d*c+this.aY}return n.set(s,l)},Ps.prototype.copy=function(t){return Os.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},Ps.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},Ps.prototype.fromJSON=function(t){return Os.prototype.fromJSON.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},((Ls.prototype=Object.create(Ps.prototype)).constructor=Ls).prototype.isArcCurve=!0;var Is=new ht,ks=new Rs,Fs=new Rs,Bs=new Rs;function js(t,e,n,r){Os.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=r||.5}function Ns(t,e,n,r,i){var o=.5*(r-e),a=.5*(i-n),s=t*t;return(2*n-2*r+o+a)*(t*s)+(-3*n+3*r-2*o-a)*s+o*t+n}function zs(t,e,n,r){return(a=1-t)*a*e+2*(1-(o=t))*o*n+(i=t)*i*r;var i,o,a}function Vs(t,e,n,r,i){return(c=1-t)*c*c*e+3*(l=1-(s=t))*l*s*n+3*(1-(a=t))*a*a*r+(o=t)*o*o*i;var o,a,s,l,c}function Gs(t,e,n,r){Os.call(this),this.type="CubicBezierCurve",this.v0=t||new tt,this.v1=e||new tt,this.v2=n||new tt,this.v3=r||new tt}function Hs(t,e,n,r){Os.call(this),this.type="CubicBezierCurve3",this.v0=t||new ht,this.v1=e||new ht,this.v2=n||new ht,this.v3=r||new ht}function Us(t,e){Os.call(this),this.type="LineCurve",this.v1=t||new tt,this.v2=e||new tt}function Ws(t,e){Os.call(this),this.type="LineCurve3",this.v1=t||new ht,this.v2=e||new ht}function Js(t,e,n){Os.call(this),this.type="QuadraticBezierCurve",this.v0=t||new tt,this.v1=e||new tt,this.v2=n||new tt}function qs(t,e,n){Os.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new ht,this.v1=e||new ht,this.v2=n||new ht}function Xs(t){Os.call(this),this.type="SplineCurve",this.points=t||[]}((js.prototype=Object.create(Os.prototype)).constructor=js).prototype.isCatmullRomCurve3=!0,js.prototype.getPoint=function(t,e){var n,r,i,o,a=e||new ht,s=this.points,l=s.length,c=(l-(this.closed?0:1))*t,u=Math.floor(c),h=c-u;if(this.closed?u+=0<u?0:(Math.floor(Math.abs(u)/l)+1)*l:0===h&&u===l-1&&(u=l-2,h=1),n=this.closed||0<u?s[(u-1)%l]:(Is.subVectors(s[0],s[1]).add(s[0]),Is),r=s[u%l],i=s[(u+1)%l],o=this.closed||u+2<l?s[(u+2)%l]:(Is.subVectors(s[l-1],s[l-2]).add(s[l-1]),Is),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(n.distanceToSquared(r),d),f=Math.pow(r.distanceToSquared(i),d),m=Math.pow(i.distanceToSquared(o),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),ks.initNonuniformCatmullRom(n.x,r.x,i.x,o.x,p,f,m),Fs.initNonuniformCatmullRom(n.y,r.y,i.y,o.y,p,f,m),Bs.initNonuniformCatmullRom(n.z,r.z,i.z,o.z,p,f,m)}else"catmullrom"===this.curveType&&(ks.initCatmullRom(n.x,r.x,i.x,o.x,this.tension),Fs.initCatmullRom(n.y,r.y,i.y,o.y,this.tension),Bs.initCatmullRom(n.z,r.z,i.z,o.z,this.tension));return a.set(ks.calc(h),Fs.calc(h),Bs.calc(h)),a},js.prototype.copy=function(t){Os.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},js.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},js.prototype.fromJSON=function(t){Os.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new ht).fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},((Gs.prototype=Object.create(Os.prototype)).constructor=Gs).prototype.isCubicBezierCurve=!0,Gs.prototype.getPoint=function(t,e){var n=e||new tt,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Vs(t,r.x,i.x,o.x,a.x),Vs(t,r.y,i.y,o.y,a.y)),n},Gs.prototype.copy=function(t){return Os.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},Gs.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Gs.prototype.fromJSON=function(t){return Os.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},((Hs.prototype=Object.create(Os.prototype)).constructor=Hs).prototype.isCubicBezierCurve3=!0,Hs.prototype.getPoint=function(t,e){var n=e||new ht,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Vs(t,r.x,i.x,o.x,a.x),Vs(t,r.y,i.y,o.y,a.y),Vs(t,r.z,i.z,o.z,a.z)),n},Hs.prototype.copy=function(t){return Os.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},Hs.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Hs.prototype.fromJSON=function(t){return Os.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},((Us.prototype=Object.create(Os.prototype)).constructor=Us).prototype.isLineCurve=!0,Us.prototype.getPoint=function(t,e){var n=e||new tt;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Us.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Us.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Us.prototype.copy=function(t){return Os.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Us.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Us.prototype.fromJSON=function(t){return Os.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Ws.prototype=Object.create(Os.prototype)).constructor=Ws).prototype.isLineCurve3=!0,Ws.prototype.getPoint=function(t,e){var n=e||new ht;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Ws.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Ws.prototype.copy=function(t){return Os.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ws.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Ws.prototype.fromJSON=function(t){return Os.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Js.prototype=Object.create(Os.prototype)).constructor=Js).prototype.isQuadraticBezierCurve=!0,Js.prototype.getPoint=function(t,e){var n=e||new tt,r=this.v0,i=this.v1,o=this.v2;return n.set(zs(t,r.x,i.x,o.x),zs(t,r.y,i.y,o.y)),n},Js.prototype.copy=function(t){return Os.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Js.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Js.prototype.fromJSON=function(t){return Os.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((qs.prototype=Object.create(Os.prototype)).constructor=qs).prototype.isQuadraticBezierCurve3=!0,qs.prototype.getPoint=function(t,e){var n=e||new ht,r=this.v0,i=this.v1,o=this.v2;return n.set(zs(t,r.x,i.x,o.x),zs(t,r.y,i.y,o.y),zs(t,r.z,i.z,o.z)),n},qs.prototype.copy=function(t){return Os.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},qs.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},qs.prototype.fromJSON=function(t){return Os.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Xs.prototype=Object.create(Os.prototype)).constructor=Xs).prototype.isSplineCurve=!0,Xs.prototype.getPoint=function(t,e){var n=e||new tt,r=this.points,i=(r.length-1)*t,o=Math.floor(i),a=i-o,s=r[0===o?o:o-1],l=r[o],c=r[o>r.length-2?r.length-1:o+1],u=r[o>r.length-3?r.length-1:o+2];return n.set(Ns(a,s.x,l.x,c.x,u.x),Ns(a,s.y,l.y,c.y,u.y)),n},Xs.prototype.copy=function(t){Os.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push(r.clone())}return this},Xs.prototype.toJSON=function(){var t=Os.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var r=this.points[e];t.points.push(r.toArray())}return t},Xs.prototype.fromJSON=function(t){Os.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new tt).fromArray(r))}return this};var Ys=Object.freeze({__proto__:null,ArcCurve:Ls,CatmullRomCurve3:js,CubicBezierCurve:Gs,CubicBezierCurve3:Hs,EllipseCurve:Ps,LineCurve:Us,LineCurve3:Ws,QuadraticBezierCurve:Js,QuadraticBezierCurve3:qs,SplineCurve:Xs});function Zs(){Os.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function $s(t){Zs.call(this),this.type="Path",this.currentPoint=new tt,t&&this.setFromPoints(t)}function Ks(t){$s.call(this,t),this.uuid=Q.generateUUID(),this.type="Shape",this.holes=[]}function Qs(t,e){Bt.call(this),this.type="Light",this.color=new De(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function tl(t,e,n){Qs.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Bt.DefaultUp),this.updateMatrix(),this.groundColor=new De(e)}function el(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new tt(512,512),this.map=null,this.mapPass=null,this.matrix=new xt,this._frustum=new Gn,this._frameExtents=new tt(1,1),this._viewportCount=1,this._viewports=[new ot(0,0,1,1)]}function nl(){el.call(this,new Fn(50,1,.5,500))}function rl(t,e,n,r,i,o){Qs.call(this,t,e),this.type="SpotLight",this.position.copy(Bt.DefaultUp),this.updateMatrix(),this.target=new Bt,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==o?o:1,this.shadow=new nl}function il(){el.call(this,new Fn(90,1,.5,500)),this._frameExtents=new tt(4,2),this._viewportCount=6,this._viewports=[new ot(2,1,1,1),new ot(0,1,1,1),new ot(3,1,1,1),new ot(1,1,1,1),new ot(3,0,1,1),new ot(1,0,1,1)],this._cubeDirections=[new ht(1,0,0),new ht(-1,0,0),new ht(0,0,1),new ht(0,0,-1),new ht(0,1,0),new ht(0,-1,0)],this._cubeUps=[new ht(0,1,0),new ht(0,1,0),new ht(0,1,0),new ht(0,1,0),new ht(0,0,1),new ht(0,0,-1)]}function ol(t,e,n,r){Qs.call(this,t,e),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!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new il}function al(t,e,n,r,i,o){kn.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==i?i:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function sl(){el.call(this,new al(-5,5,5,-5,.5,500))}function ll(t,e){Qs.call(this,t,e),this.type="DirectionalLight",this.position.copy(Bt.DefaultUp),this.updateMatrix(),this.target=new Bt,this.shadow=new sl}function cl(t,e){Qs.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function ul(t,e,n,r){Qs.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function hl(t){ws.call(this,t),this.textures={}}Zs.prototype=Object.assign(Object.create(Os.prototype),{constructor:Zs,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Us(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=e){var i=n[r]-e,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}r++}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=[],e=0,n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,n=[],r=0,i=this.curves;r<i.length;r++)for(var o=i[r],a=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,s=o.getPoints(a),l=0;l<s.length;l++){var c=s[l];e&&e.equals(c)||(n.push(c),e=c)}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){Os.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=Os.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var r=this.curves[e];t.curves.push(r.toJSON())}return t},fromJSON:function(t){Os.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var r=t.curves[e];this.curves.push((new Ys[r.type]).fromJSON(r))}return this}}),$s.prototype=Object.assign(Object.create(Zs.prototype),{constructor:$s,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this},moveTo:function(t,e){return this.currentPoint.set(t,e),this},lineTo:function(t,e){var n=new Us(this.currentPoint.clone(),new tt(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this},quadraticCurveTo:function(t,e,n,r){var i=new Js(this.currentPoint.clone(),new tt(t,e),new tt(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(t,e,n,r,i,o){var a=new Gs(this.currentPoint.clone(),new tt(t,e),new tt(n,r),new tt(i,o));return this.curves.push(a),this.currentPoint.set(i,o),this},splineThru:function(t){var e=new Xs([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,e,n,r,i,o){var a=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+a,e+s,n,r,i,o),this},absarc:function(t,e,n,r,i,o){return this.absellipse(t,e,n,n,r,i,o),this},ellipse:function(t,e,n,r,i,o,a,s){var l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+l,e+c,n,r,i,o,a,s),this},absellipse:function(t,e,n,r,i,o,a,s){var l=new Ps(t,e,n,r,i,o,a,s);if(0<this.curves.length){var c=l.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(l);var u=l.getPoint(1);return this.currentPoint.copy(u),this},copy:function(t){return Zs.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=Zs.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Zs.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Ks.prototype=Object.assign(Object.create($s.prototype),{constructor:Ks,getPointsHoles:function(t){for(var e=[],n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){$s.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var r=t.holes[e];this.holes.push(r.clone())}return this},toJSON:function(){var t=$s.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var r=this.holes[e];t.holes.push(r.toJSON())}return t},fromJSON:function(t){$s.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var r=t.holes[e];this.holes.push((new $s).fromJSON(r))}return this}}),Qs.prototype=Object.assign(Object.create(Bt.prototype),{constructor:Qs,isLight:!0,copy:function(t){return Bt.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=Bt.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),tl.prototype=Object.assign(Object.create(Qs.prototype),{constructor:tl,isHemisphereLight:!0,copy:function(t){return Qs.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(el.prototype,{_projScreenMatrix:new xt,_lightPositionWorld:new ht,_lookTarget:new ht,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(t){var e=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,o=this._lightPositionWorld;o.setFromMatrixPosition(t.matrixWorld),e.position.copy(o),i.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(i),e.updateMatrixWorld(),r.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)},getViewport:function(t){return this._viewports[t]},getFrameExtents:function(){return this._frameExtents},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)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),nl.prototype=Object.assign(Object.create(el.prototype),{constructor:nl,isSpotLightShadow:!0,updateMatrices:function(t){var e=this.camera,n=2*Q.RAD2DEG*t.angle,r=this.mapSize.width/this.mapSize.height,i=t.distance||e.far;n===e.fov&&r===e.aspect&&i===e.far||(e.fov=n,e.aspect=r,e.far=i,e.updateProjectionMatrix()),el.prototype.updateMatrices.call(this,t)}}),rl.prototype=Object.assign(Object.create(Qs.prototype),{constructor:rl,isSpotLight:!0,copy:function(t){return Qs.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}}),il.prototype=Object.assign(Object.create(el.prototype),{constructor:il,isPointLightShadow:!0,updateMatrices:function(t,e){void 0===e&&(e=0);var n=this.camera,r=this.matrix,i=this._lightPositionWorld,o=this._lookTarget,a=this._projScreenMatrix;i.setFromMatrixPosition(t.matrixWorld),n.position.copy(i),o.copy(n.position),o.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(o),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),a.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(a)}}),ol.prototype=Object.assign(Object.create(Qs.prototype),{constructor:ol,isPointLight:!0,copy:function(t){return Qs.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),al.prototype=Object.assign(Object.create(kn.prototype),{constructor:al,isOrthographicCamera:!0,copy:function(t,e){return kn.prototype.copy.call(this,t,e),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,e,n,r,i,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=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,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),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-t,o=n+t,a=r+e,s=r-e;if(null!==this.view&&this.view.enabled){var l=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o=(i+=l*this.view.offsetX)+l*this.view.width,s=(a-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Bt.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),sl.prototype=Object.assign(Object.create(el.prototype),{constructor:sl,isDirectionalLightShadow:!0,updateMatrices:function(t){el.prototype.updateMatrices.call(this,t)}}),ll.prototype=Object.assign(Object.create(Qs.prototype),{constructor:ll,isDirectionalLight:!0,copy:function(t){return Qs.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),cl.prototype=Object.assign(Object.create(Qs.prototype),{constructor:cl,isAmbientLight:!0}),ul.prototype=Object.assign(Object.create(Qs.prototype),{constructor:ul,isRectAreaLight:!0,copy:function(t){return Qs.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=Qs.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),hl.prototype=Object.assign(Object.create(ws.prototype),{constructor:hl,load:function(t,e,n,r){var i=this,o=new _s(i.manager);o.setPath(i.path),o.load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},parse:function(t){var e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}var r=new ns[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 De).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.vertexColors&&(r.vertexColors=t.vertexColors),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.visible&&(r.visible=t.visible),void 0!==t.toneMapped&&(r.toneMapped=t.toneMapped),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.uniforms)for(var i in t.uniforms){var o=t.uniforms[i];switch(r.uniforms[i]={},o.type){case"t":r.uniforms[i].value=n(o.value);break;case"c":r.uniforms[i].value=(new De).setHex(o.value);break;case"v2":r.uniforms[i].value=(new tt).fromArray(o.value);break;case"v3":r.uniforms[i].value=(new ht).fromArray(o.value);break;case"v4":r.uniforms[i].value=(new ot).fromArray(o.value);break;case"m3":r.uniforms[i].value=(new et).fromArray(o.value);case"m4":r.uniforms[i].value=(new xt).fromArray(o.value);break;default:r.uniforms[i].value=o.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];if(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=n(t.map)),void 0!==t.matcap&&(r.matcap=n(t.matcap)),void 0!==t.alphaMap&&(r.alphaMap=n(t.alphaMap),r.transparent=!0),void 0!==t.bumpMap&&(r.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new tt).fromArray(s)}return void 0!==t.displacementMap&&(r.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=n(t.specularMap)),void 0!==t.envMap&&(r.envMap=n(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=n(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatNormalMap&&(r.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(r.clearcoatNormalScale=(new tt).fromArray(t.clearcoatNormalScale)),r},setTextures:function(t){return this.textures=t,this}});var dl={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch(t){return e}},extractUrlBase:function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function pl(){nn.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function fl(t,e,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Be.call(this,t,e,n),this.meshPerAttribute=r||1}function ml(t){ws.call(this,t)}pl.prototype=Object.assign(Object.create(nn.prototype),{constructor:pl,isInstancedBufferGeometry:!0,copy:function(t){return nn.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t=nn.prototype.toJSON.call(this);return t.maxInstancedCount=this.maxInstancedCount,t.isInstancedBufferGeometry=!0,t}}),fl.prototype=Object.assign(Object.create(Be.prototype),{constructor:fl,isInstancedBufferAttribute:!0,copy:function(t){return Be.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){var t=Be.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),ml.prototype=Object.assign(Object.create(ws.prototype),{constructor:ml,load:function(t,e,n,r){var i=this,o=new _s(i.manager);o.setPath(i.path),o.load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},parse:function(t){var e=new(t.isInstancedBufferGeometry?pl:nn),n=t.data.index;if(void 0!==n){var r=new gl[n.type](n.array);e.setIndex(new Be(r,1))}var i=t.data.attributes;for(var o in i){var a=i[o],s=(r=new gl[a.type](a.array),new(a.isInstancedBufferAttribute?fl:Be)(r,a.itemSize,a.normalized));void 0!==a.name&&(s.name=a.name),e.setAttribute(o,s)}var l=t.data.morphAttributes;if(l)for(var o in l){for(var c=l[o],u=[],h=0,d=c.length;h<d;h++)a=c[h],s=new Be(r=new gl[a.type](a.array),a.itemSize,a.normalized),void 0!==a.name&&(s.name=a.name),u.push(s);e.morphAttributes[o]=u}t.data.morphTargetsRelative&&(e.morphTargetsRelative=!0);var p=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==p){h=0;for(var f=p.length;h!==f;++h){var m=p[h];e.addGroup(m.start,m.count,m.materialIndex)}}var g=t.data.boundingSphere;if(void 0!==g){var y=new ht;void 0!==g.center&&y.fromArray(g.center),e.boundingSphere=new ee(y,g.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e}});var gl={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function yl(t){ws.call(this,t)}yl.prototype=Object.assign(Object.create(ws.prototype),{constructor:yl,load:function(t,e,n,r){var i=this,o=""===this.path?dl.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||o;var a=new _s(i.manager);a.setPath(this.path),a.load(t,function(n){var o=null;try{o=JSON.parse(n)}catch(n){return void 0!==r&&r(n),void console.error("THREE:ObjectLoader: Can't parse "+t+".",n.message)}var a=o.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?i.parse(o,e):console.error("THREE.ObjectLoader: Can't load "+t)},n,r)},parse:function(t,e){var n=this.parseShape(t.shapes),r=this.parseGeometries(t.geometries,n),i=this.parseImages(t.images,function(){void 0!==e&&e(s)}),o=this.parseTextures(t.textures,i),a=this.parseMaterials(t.materials,o),s=this.parseObject(t.object,r,a);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var n=0,r=t.length;n<r;n++){var i=(new Ks).fromJSON(t[n]);e[i.uuid]=i}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var r=new ml,i=0,o=t.length;i<o;i++){var a,s=t[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":a=new Wa[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":a=new Wa[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":a=new Wa[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":a=new Wa[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":a=new Wa[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":a=new Wa[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":a=new Wa[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":a=new Wa[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":a=new Wa[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":a=new Wa[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":a=new Wa[s.type]((new Ys[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":a=new Wa[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":a=new Wa[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var l=[],c=0,u=s.shapes.length;c<u;c++){var h=e[s.shapes[c]];l.push(h)}a=new Wa[s.type](l,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(l=[],c=0,u=s.shapes.length;c<u;c++)h=e[s.shapes[c]],l.push(h);var d=s.options.extrudePath;void 0!==d&&(s.options.extrudePath=(new Ys[d.type]).fromJSON(d)),a=new Wa[s.type](l,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":a=r.parse(s);break;case"Geometry":"THREE"in window&&"LegacyJSONLoader"in THREE?a=(new THREE.LegacyJSONLoader).parse(s,this.resourcePath).geometry:console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),!0===a.isBufferGeometry&&void 0!==s.userData&&(a.userData=s.userData),n[s.uuid]=a}return n},parseMaterials:function(t,e){var n={},r={};if(void 0!==t){var i=new hl;i.setTextures(e);for(var o=0,a=t.length;o<a;o++){var s=t[o];if("MultiMaterial"===s.type){for(var l=[],c=0;c<s.materials.length;c++){var u=s.materials[c];void 0===n[u.uuid]&&(n[u.uuid]=i.parse(u)),l.push(n[u.uuid])}r[s.uuid]=l}else void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n],i=gs.parse(r);void 0!==r.uuid&&(i.uuid=r.uuid),e.push(i)}return e},parseImages:function(t,e){var n=this,r={};function i(t){return n.manager.itemStart(t),o.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemError(t),n.manager.itemEnd(t)})}if(void 0!==t&&0<t.length){var o=new Es(new xs(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;a<s;a++){var l=t[a],c=l.url;if(Array.isArray(c)){r[l.uuid]=[];for(var u=0,h=c.length;u<h;u++){var d=c[u],p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:n.resourcePath+d;r[l.uuid].push(i(p))}}else p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:n.resourcePath+l.url,r[l.uuid]=i(p)}}return r},parseTextures:function(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var r={};if(void 0!==t)for(var i=0,o=t.length;i<o;i++){var a,s=t[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(a=new(Array.isArray(e[s.image])?Kn:it)(e[s.image])).needsUpdate=!0,a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),void 0!==s.mapping&&(a.mapping=n(s.mapping,xl)),void 0!==s.offset&&a.offset.fromArray(s.offset),void 0!==s.repeat&&a.repeat.fromArray(s.repeat),void 0!==s.center&&a.center.fromArray(s.center),void 0!==s.rotation&&(a.rotation=s.rotation),void 0!==s.wrap&&(a.wrapS=n(s.wrap[0],bl),a.wrapT=n(s.wrap[1],bl)),void 0!==s.format&&(a.format=s.format),void 0!==s.type&&(a.type=s.type),void 0!==s.encoding&&(a.encoding=s.encoding),void 0!==s.minFilter&&(a.minFilter=n(s.minFilter,wl)),void 0!==s.magFilter&&(a.magFilter=n(s.magFilter,wl)),void 0!==s.anisotropy&&(a.anisotropy=s.anisotropy),void 0!==s.flipY&&(a.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(a.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(a.unpackAlignment=s.unpackAlignment),r[s.uuid]=a}return r},parseObject:function(t,e,n){var r;function i(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function o(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],r=0,i=t.length;r<i;r++){var o=t[r];void 0===n[o]&&console.warn("THREE.ObjectLoader: Undefined material",o),e.push(n[o])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}switch(t.type){case"Scene":r=new jt,void 0!==t.background&&Number.isInteger(t.background)&&(r.background=new De(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?r.fog=new Ri(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(r.fog=new Li(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":r=new Fn(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(r.focus=t.focus),void 0!==t.zoom&&(r.zoom=t.zoom),void 0!==t.filmGauge&&(r.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(r.filmOffset=t.filmOffset),void 0!==t.view&&(r.view=Object.assign({},t.view));break;case"OrthographicCamera":r=new al(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(r.zoom=t.zoom),void 0!==t.view&&(r.view=Object.assign({},t.view));break;case"AmbientLight":r=new cl(t.color,t.intensity);break;case"DirectionalLight":r=new ll(t.color,t.intensity);break;case"PointLight":r=new ol(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":r=new ul(t.color,t.intensity,t.width,t.height);break;case"SpotLight":r=new rl(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":r=new tl(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var a=i(t.geometry),s=o(t.material);r=new(a.bones&&0<a.bones.length?no:wn)(a,s);break;case"InstancedMesh":a=i(t.geometry),s=o(t.material);var l=t.count,c=t.instanceMatrix;(r=new ho(a,s,l)).instanceMatrix=new Be(new Float32Array(c.array),16);break;case"LOD":r=new eo;break;case"Line":r=new xo(i(t.geometry),o(t.material),t.mode);break;case"LineLoop":r=new _o(i(t.geometry),o(t.material));break;case"LineSegments":r=new Mo(i(t.geometry),o(t.material));break;case"PointCloud":case"Points":r=new Ao(i(t.geometry),o(t.material));break;case"Sprite":r=new $i(o(t.material));break;case"Group":r=new Ai;break;default:r=new Bt}if(r.uuid=t.uuid,void 0!==t.name&&(r.name=t.name),void 0!==t.matrix?(r.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(r.matrixAutoUpdate=t.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==t.position&&r.position.fromArray(t.position),void 0!==t.rotation&&r.rotation.fromArray(t.rotation),void 0!==t.quaternion&&r.quaternion.fromArray(t.quaternion),void 0!==t.scale&&r.scale.fromArray(t.scale)),void 0!==t.castShadow&&(r.castShadow=t.castShadow),void 0!==t.receiveShadow&&(r.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(r.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(r.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&r.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(r.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.frustumCulled&&(r.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(r.renderOrder=t.renderOrder),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.layers&&(r.layers.mask=t.layers),void 0!==t.children)for(var u=t.children,h=0;h<u.length;h++)r.add(this.parseObject(u[h],e,n));if("LOD"===t.type){void 0!==t.autoUpdate&&(r.autoUpdate=t.autoUpdate);for(var d=t.levels,p=0;p<d.length;p++){var f=d[p],m=r.getObjectByProperty("uuid",f.object);void 0!==m&&r.addLevel(m,f.distance)}}return r}});var vl,xl={UVMapping:300,CubeReflectionMapping:n,CubeRefractionMapping:r,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:i,SphericalReflectionMapping:305,CubeUVReflectionMapping:o,CubeUVRefractionMapping:a},bl={RepeatWrapping:s,ClampToEdgeWrapping:l,MirroredRepeatWrapping:c},wl={NearestFilter:u,NearestMipmapNearestFilter:h,NearestMipmapLinearFilter:d,LinearFilter:p,LinearMipmapNearestFilter:f,LinearMipmapLinearFilter:m};function Ml(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),ws.call(this,t),this.options=void 0}function _l(){this.type="ShapePath",this.color=new De,this.subPaths=[],this.currentPath=null}function Cl(t){this.type="Font",this.data=t}function Sl(t,e,n,r,i){var o=i.glyphs[t]||i.glyphs["?"];if(o){var a,s,l,c,u,h,d,p,f=new _l;if(o.o)for(var m=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),g=0,y=m.length;g<y;)switch(m[g++]){case"m":a=m[g++]*e+n,s=m[g++]*e+r,f.moveTo(a,s);break;case"l":a=m[g++]*e+n,s=m[g++]*e+r,f.lineTo(a,s);break;case"q":l=m[g++]*e+n,c=m[g++]*e+r,u=m[g++]*e+n,h=m[g++]*e+r,f.quadraticCurveTo(u,h,l,c);break;case"b":l=m[g++]*e+n,c=m[g++]*e+r,u=m[g++]*e+n,h=m[g++]*e+r,d=m[g++]*e+n,p=m[g++]*e+r,f.bezierCurveTo(u,h,d,p,l,c)}return{offsetX:o.ha*e,path:f}}console.error('THREE.Font: character "'+t+'" does not exists in font family '+i.familyName+".")}function Tl(t){ws.call(this,t)}Ml.prototype=Object.assign(Object.create(ws.prototype),{constructor:Ml,setOptions:function(t){return this.options=t,this},load:function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,o=vs.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout(function(){e&&e(o),i.manager.itemEnd(t)},0),o;fetch(t).then(function(t){return t.blob()}).then(function(t){return void 0===i.options?createImageBitmap(t):createImageBitmap(t,i.options)}).then(function(n){vs.add(t,n),e&&e(n),i.manager.itemEnd(t)}).catch(function(e){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}),i.manager.itemStart(t)}}),Object.assign(_l.prototype,{moveTo:function(t,e){return this.currentPath=new $s,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this},lineTo:function(t,e){return this.currentPath.lineTo(t,e),this},quadraticCurveTo:function(t,e,n,r){return this.currentPath.quadraticCurveTo(t,e,n,r),this},bezierCurveTo:function(t,e,n,r,i,o){return this.currentPath.bezierCurveTo(t,e,n,r,i,o),this},splineThru:function(t){return this.currentPath.splineThru(t),this},toShapes:function(t,e){function n(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n],o=new Ks;o.curves=i.curves,e.push(o)}return e}function r(t,e){for(var n=e.length,r=!1,i=n-1,o=0;o<n;i=o++){var a=e[i],s=e[o],l=s.x-a.x,c=s.y-a.y;if(Math.abs(c)>Number.EPSILON){if(c<0&&(a=e[o],l=-l,s=e[i],c=-c),t.y<a.y||t.y>s.y)continue;if(t.y===a.y){if(t.x===a.x)return 1}else{var u=c*(t.x-a.x)-l*(t.y-a.y);if(0==u)return 1;if(u<0)continue;r=!r}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return 1}}return r}var i=ba.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return n(o);var a,s,l,c=[];if(1===o.length)return s=o[0],(l=new Ks).curves=s.curves,c.push(l),c;var u=!i(o[0].getPoints());u=t?!u:u;var h,d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var y=0,v=o.length;y<v;y++)a=i(h=(s=o[y]).getPoints()),(a=t?!a:a)?(!u&&f[g]&&g++,f[g]={s:new Ks,p:h},f[g].s.curves=s.curves,u&&g++,m[g]=[]):m[g].push({h:s,p:h[0]});if(!f[0])return n(o);if(1<f.length){for(var x=!1,b=[],w=0,M=f.length;w<M;w++)p[w]=[];for(w=0,M=f.length;w<M;w++)for(var _=m[w],C=0;C<_.length;C++){for(var S=_[C],T=!0,E=0;E<f.length;E++)r(S.p,f[E].p)&&(w!==E&&b.push({froms:w,tos:E,hole:C}),T?(T=!1,p[E].push(S)):x=!0);T&&p[w].push(S)}0<b.length&&(x||(m=p))}y=0;for(var D=f.length;y<D;y++){l=f[y].s,c.push(l);for(var A=0,O=(d=m[y]).length;A<O;A++)l.holes.push(d[A].h)}return c}}),Object.assign(Cl.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var n=[],r=function(t,e,n){for(var r=Array.from?Array.from(t):String(t).split(""),i=e/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,a=[],s=0,l=0,c=0;c<r.length;c++){var u=r[c];if("\n"===u)s=0,l-=o;else{var h=Sl(u,i,s,l,n);s+=h.offsetX,a.push(h.path)}}return a}(t,e,this.data),i=0,o=r.length;i<o;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),Tl.prototype=Object.assign(Object.create(ws.prototype),{constructor:Tl,load:function(t,e,n,r){var i=this,o=new _s(this.manager);o.setPath(this.path),o.load(t,function(t){var n;try{n=JSON.parse(t)}catch(r){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}var r=i.parse(n);e&&e(r)},n,r)},parse:function(t){return new Cl(t)}});var El={getContext:function(){return void 0===vl&&(vl=new(window.AudioContext||window.webkitAudioContext)),vl},setContext:function(t){vl=t}};function Dl(t){ws.call(this,t)}function Al(){this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new ht)}function Ol(t,e){Qs.call(this,void 0,e),this.sh=void 0!==t?t:new Al}function Pl(t,e,n){Ol.call(this,void 0,n);var r=(new De).set(t),i=(new De).set(e),o=new ht(r.r,r.g,r.b),a=new ht(i.r,i.g,i.b),s=Math.sqrt(Math.PI),l=s*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(s),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(l)}function Ll(t,e){Ol.call(this,void 0,e);var n=(new De).set(t);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}Dl.prototype=Object.assign(Object.create(ws.prototype),{constructor:Dl,load:function(t,e,n,r){var i=new _s(this.manager);i.setResponseType("arraybuffer"),i.setPath(this.path),i.load(t,function(t){var n=t.slice(0);El.getContext().decodeAudioData(n,function(t){e(t)})},n,r)}}),Object.assign(Al.prototype,{isSphericalHarmonics3:!0,set:function(t){for(var e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},zero:function(){for(var t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},getAt:function(t,e){var n=t.x,r=t.y,i=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.282095),e.addScale(o[1],.488603*r),e.addScale(o[2],.488603*i),e.addScale(o[3],.488603*n),e.addScale(o[4],n*r*1.092548),e.addScale(o[5],r*i*1.092548),e.addScale(o[6],.315392*(3*i*i-1)),e.addScale(o[7],n*i*1.092548),e.addScale(o[8],.546274*(n*n-r*r)),e},getIrradianceAt:function(t,e){var n=t.x,r=t.y,i=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.886227),e.addScale(o[1],1.023328*r),e.addScale(o[2],1.023328*i),e.addScale(o[3],1.023328*n),e.addScale(o[4],.858086*n*r),e.addScale(o[5],.858086*r*i),e.addScale(o[6],.743125*i*i-.247708),e.addScale(o[7],.858086*n*i),e.addScale(o[8],.429043*(n*n-r*r)),e},add:function(t){for(var e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},scale:function(t){for(var e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},lerp:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this},equals:function(t){for(var e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0},copy:function(t){return this.set(t.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(t,e){void 0===e&&(e=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(t,e+3*r);return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(t,e+3*r);return t}}),Object.assign(Al,{getBasisAt:function(t,e){var n=t.x,r=t.y,i=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*i,e[3]=.488603*n,e[4]=1.092548*n*r,e[5]=1.092548*r*i,e[6]=.315392*(3*i*i-1),e[7]=1.092548*n*i,e[8]=.546274*(n*n-r*r)}}),Ol.prototype=Object.assign(Object.create(Qs.prototype),{constructor:Ol,isLightProbe:!0,copy:function(t){return Qs.prototype.copy.call(this,t),this.sh.copy(t.sh),this.intensity=t.intensity,this},toJSON:function(t){return Qs.prototype.toJSON.call(this,t)}}),Pl.prototype=Object.assign(Object.create(Ol.prototype),{constructor:Pl,isHemisphereLightProbe:!0,copy:function(t){return Ol.prototype.copy.call(this,t),this},toJSON:function(t){return Ol.prototype.toJSON.call(this,t)}}),Ll.prototype=Object.assign(Object.create(Ol.prototype),{constructor:Ll,isAmbientLightProbe:!0,copy:function(t){return Ol.prototype.copy.call(this,t),this},toJSON:function(t){return Ol.prototype.toJSON.call(this,t)}});var Rl=new xt,Il=new xt;function kl(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Fn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Fn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function Fl(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(kl.prototype,{update:function(t){var e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;var n,r,i=t.projectionMatrix.clone(),o=e.eyeSep/2,a=o*e.near/e.focus,s=e.near*Math.tan(Q.DEG2RAD*e.fov*.5)/e.zoom;Il.elements[12]=-o,Rl.elements[12]=o,n=-s*e.aspect+a,r=s*e.aspect+a,i.elements[0]=2*e.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(i),n=-s*e.aspect-a,r=s*e.aspect-a,i.elements[0]=2*e.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(Il),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(Rl)}}),Object.assign(Fl.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}});var Bl=new ht,jl=new lt,Nl=new ht,zl=new ht;function Vl(){Bt.call(this),this.type="AudioListener",this.context=El.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Fl}function Gl(t){Bt.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._pausedAt=0,this.filters=[]}Vl.prototype=Object.assign(Object.create(Bt.prototype),{constructor:Vl,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(t){Bt.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Bl,jl,Nl),zl.set(0,0,-1).applyQuaternion(jl),e.positionX){var r=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(Bl.x,r),e.positionY.linearRampToValueAtTime(Bl.y,r),e.positionZ.linearRampToValueAtTime(Bl.z,r),e.forwardX.linearRampToValueAtTime(zl.x,r),e.forwardY.linearRampToValueAtTime(zl.y,r),e.forwardZ.linearRampToValueAtTime(zl.z,r),e.upX.linearRampToValueAtTime(n.x,r),e.upY.linearRampToValueAtTime(n.y,r),e.upZ.linearRampToValueAtTime(n.z,r)}else e.setPosition(Bl.x,Bl.y,Bl.z),e.setOrientation(zl.x,zl.y,zl.z,n.x,n.y,n.z)}}),Gl.prototype=Object.assign(Object.create(Bt.prototype),{constructor:Gl,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setMediaStreamSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(t){if(void 0===t&&(t=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+t;var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._pausedAt=(this.context.currentTime-this._startedAt)*this.playbackRate,this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._pausedAt=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t=t||[],!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(t){return this.loopStart=t,this},setLoopEnd:function(t){return this.loopEnd=t,this},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}});var Hl=new ht,Ul=new lt,Wl=new ht,Jl=new ht;function ql(t){Gl.call(this,t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function Xl(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Yl(t,e,n){this.binding=t,this.valueSize=n;var r,i=Float64Array;switch(e){case"quaternion":r=this._slerp;break;case"string":case"bool":i=Array,r=this._select;break;default:r=this._lerp}this.buffer=new i(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}ql.prototype=Object.assign(Object.create(Gl.prototype),{constructor:ql,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(t){if(Bt.prototype.updateMatrixWorld.call(this,t),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(Hl,Ul,Wl),Jl.set(0,0,1).applyQuaternion(Ul);var e=this.panner;if(e.positionX){var n=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(Hl.x,n),e.positionY.linearRampToValueAtTime(Hl.y,n),e.positionZ.linearRampToValueAtTime(Hl.z,n),e.orientationX.linearRampToValueAtTime(Jl.x,n),e.orientationY.linearRampToValueAtTime(Jl.y,n),e.orientationZ.linearRampToValueAtTime(Jl.z,n)}else e.setPosition(Hl.x,Hl.y,Hl.z),e.setOrientation(Jl.x,Jl.y,Jl.z)}}}),Object.assign(Xl.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(Yl.prototype,{accumulate:function(t,e){var n=this.buffer,r=this.valueSize,i=t*r+r,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==r;++a)n[i+a]=n[a];o=e}else{var s=e/(o+=e);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=o},apply:function(t){var e=this.valueSize,n=this.buffer,r=t*e+e,i=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,i<1){var a=3*e;this._mixBufferRegion(n,r,a,1-i,e)}for(var s=e,l=e+e;s!==l;++s)if(n[s]!==n[s+e]){o.setValue(n,r);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,r=3*n;t.getValue(e,r);for(var i=n,o=r;i!==o;++i)e[i]=e[r+i%n];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,n,r,i){if(.5<=r)for(var o=0;o!==i;++o)t[e+o]=t[n+o]},_slerp:function(t,e,n,r){lt.slerpFlat(t,e,t,e,t,n,r)},_lerp:function(t,e,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=e+a;t[s]=t[s]*o+t[n+a]*r}}});var Zl="\\[\\]\\.:\\/",$l=new RegExp("["+Zl+"]","g"),Kl="[^"+Zl+"]",Ql="[^"+Zl.replace("\\.","")+"]",tc=/((?:WC+[\/:])*)/.source.replace("WC",Kl),ec=/(WCOD+)?/.source.replace("WCOD",Ql),nc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Kl),rc=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Kl),ic=new RegExp("^"+tc+ec+nc+rc+"$"),oc=["material","materials","bones"];function ac(t,e,n){var r=n||sc.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}function sc(t,e,n){this.path=e,this.parsedPath=n||sc.parseTrackName(e),this.node=sc.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function lc(){this.uuid=Q.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}function cc(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var r=e.tracks,i=r.length,o=new Array(i),a={endingStart:F,endingEnd:F},s=0;s!==i;++s){var l=r[s].createInterpolant(null);(o[s]=l).settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function uc(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function hc(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function dc(t,e,n){Ii.call(this,t,e),this.meshPerAttribute=n||1}function pc(t,e,n,r){this.ray=new ce(t,e),this.near=n||0,this.far=r||1/0,this.camera=null,this.params={Mesh:{},Line:{},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 fc(t,e){return t.distance-e.distance}function mc(t,e,n,r){if(!1!==t.visible&&(t.raycast(e,n),!0===r))for(var i=t.children,o=0,a=i.length;o<a;o++)mc(i[o],e,n,!0)}function gc(t,e,n){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==n?n:0,this}function yc(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}Object.assign(ac.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(sc,{Composite:ac,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new sc.Composite(t,e,n):new sc(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace($l,"")},parseTrackName:function(t){var e=ic.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==oc.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},findNode:function(t,e){if(!e||""===e||"root"===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){var r=function(t){for(var n=0;n<t.length;n++){var i=t[n];if(i.name===e||i.uuid===e)return i;var o=r(i.children);if(o)return o}return null},i=r(t.children);if(i)return i}return null}}),Object.assign(sc.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)t[e++]=n[r]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,r=e.propertyName,i=e.propertyIndex;if(t||(t=sc.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var o=e.objectIndex;switch(n){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);t=t.skeleton.bones;for(var a=0;a<t.length;a++)if(t[a].name===o){o=a;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}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 s=t[r];if(void 0!==s){var l=this.Versioning.None;void 0!==(this.targetObject=t).needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var c=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){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(a=0;a<this.node.geometry.morphAttributes.position.length;a++)if(t.geometry.morphAttributes.position[a].name===i){i=a;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(a=0;a<this.node.geometry.morphTargets.length;a++)if(t.geometry.morphTargets[a].name===i){i=a;break}}}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(c=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][l]}else{var u=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" 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._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(sc.prototype,{_getValue_unbound:sc.prototype.getValue,_setValue_unbound:sc.prototype.setValue}),Object.assign(lc.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,o=this._parsedPaths,a=this._bindings,s=a.length,l=void 0,c=0,u=arguments.length;c!==u;++c){var h=arguments[c],d=h.uuid,p=r[d];if(void 0===p){p=e++,r[d]=p,t.push(h);for(var f=0,m=s;f!==m;++f)a[f].push(new sc(h,i[f],o[f]))}else if(p<n){l=t[p];var g=--n,y=t[g];for(t[r[y.uuid]=p]=y,t[r[d]=g]=h,f=0,m=s;f!==m;++f){var v=a[f],x=v[g],b=v[p];v[p]=x,void 0===b&&(b=new sc(h,i[f],o[f])),v[g]=b}}else t[p]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],l=s.uuid,c=n[l];if(void 0!==c&&e<=c){var u=e++,h=t[u];t[n[h.uuid]=c]=h,t[n[l]=u]=s;for(var d=0,p=i;d!==p;++d){var f=r[d],m=f[u],g=f[c];f[c]=m,f[u]=g}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,o=i.length,a=0,s=arguments.length;a!==s;++a){var l=arguments[a].uuid,c=r[l];if(void 0!==c)if(delete r[l],c<n){var u=--n,h=t[u],d=t[y=--e];t[r[h.uuid]=c]=h,t[r[d.uuid]=u]=d,t.pop();for(var p=0,f=o;p!==f;++p){var m=(v=i[p])[u],g=v[y];v[c]=m,v[u]=g,v.pop()}}else{var y;for(t[r[(d=t[y=--e]).uuid]=c]=d,t.pop(),p=0,f=o;p!==f;++p){var v;(v=i[p])[c]=v[y],v.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,r=n[t],i=this._bindings;if(void 0!==r)return i[r];var o=this._paths,a=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,u=new Array(l);r=i.length,n[t]=r,o.push(t),a.push(e),i.push(u);for(var h=c,d=s.length;h!==d;++h){var p=s[h];u[h]=new sc(p,t,e)}return u},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var r=this._paths,i=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];o[e[t[a]]=n]=s,o.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}}),Object.assign(cc.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var r=this._clip.duration,i=t._clip.duration,o=i/r,a=r/i;t.warp(1,o,e),this.warp(a,1,e)}return this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.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._effectiveTimeScale,0,t)},warp:function(t,e,n){var r=this._mixer,i=r.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,l=o.sampleValues;return s[0]=i,s[1]=i+n,l[0]=t/a,l[1]=e/a,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var o=(t-i)*n;if(o<0||0===n)return;this._startTime=null,e=n*o}e*=this._updateTimeScale(t);var a=this._updateTime(e),s=this._updateWeight(t);if(0<s)for(var l=this._interpolants,c=this._propertyBindings,u=0,h=l.length;u!==h;++u)l[u].evaluate(a),c[u].accumulate(r,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;null!==n&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e},_updateTime:function(t){var e=this.time+t,n=this._clip.duration,r=this.loop,i=this._loopCount,o=2202===r;if(0===t)return-1!==i&&o&&1==(1&i)?n-e:e;if(2200===r){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n<=e)e=n;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===i&&(0<=t?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),n<=e||e<0){var a=Math.floor(e/n);e-=n*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=0<t?n:0,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1});else{if(1==s){var l=t<0;this._setEndings(l,!l,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=e;if(o&&1==(1&i))return n-e}return e},_setEndings:function(t,e,n){var r=this._interpolantSettings;n?(r.endingStart=B,r.endingEnd=B):(r.endingStart=t?this.zeroSlopeAtStart?B:F:j,r.endingEnd=e?this.zeroSlopeAtEnd?B:F:j)},_scheduleFading:function(t,e,n){var r=this._mixer,i=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=e,a[1]=i+t,s[1]=n,this}}),uc.prototype=Object.assign(Object.create(Y.prototype),{constructor:uc,_bindAction:function(t,e){var n=t._localRoot||this._root,r=t._clip.tracks,i=r.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,l=this._bindingsByRootAndName,c=l[s];void 0===c&&(c={},l[s]=c);for(var u=0;u!==i;++u){var h=r[u],d=h.name,p=c[d];if(void 0!==p)o[u]=p;else{if(void 0!==(p=o[u])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=e&&e._propertyBindings[u].binding.parsedPath;++(p=new Yl(sc.create(n,d,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),o[u]=p}a[u].resultBuffer=p.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,r=this._actionsByClip[n];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,n,e)}for(var i=t._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){var r=this._actions,i=this._actionsByClip,o=i[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,i[e]=o;else{var a=o.knownActions;t._byClipCacheIndex=a.length,a.push(t)}t._cacheIndex=r.length,r.push(t),o.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],r=t._cacheIndex;e[n._cacheIndex=r]=n,e.pop(),t._cacheIndex=null;var i=t._clip.uuid,o=this._actionsByClip,a=o[i],s=a.knownActions,l=s[s.length-1],c=t._byClipCacheIndex;s[l._byClipCacheIndex=c]=l,s.pop(),t._byClipCacheIndex=null,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete o[i],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,r=this._nActiveActions++,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,r=--this._nActiveActions,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_addInactiveBinding:function(t,e,n){var r=this._bindingsByRootAndName,i=r[e],o=this._bindings;void 0===i&&(i={},r[e]=i),(i[n]=t)._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,r=n.rootNode.uuid,i=n.path,o=this._bindingsByRootAndName,a=o[r],s=e[e.length-1],l=t._cacheIndex;e[s._cacheIndex=l]=s,e.pop(),delete a[i],0===Object.keys(a).length&&delete o[r]},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,r=this._nActiveBindings++,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,r=--this._nActiveBindings,i=e[r];e[t._cacheIndex=r]=t,e[i._cacheIndex=n]=i},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&(t[(n=new as(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,r=--this._nActiveControlInterpolants,i=e[r];e[t.__cacheIndex=r]=t,e[i.__cacheIndex=n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var n=e||this._root,r=n.uuid,i="string"==typeof t?gs.findByName(n,t):t,o=null!==i?i.uuid:t,a=this._actionsByClip[o],s=null;if(void 0!==a){var l=a.actionByRoot[r];if(void 0!==l)return l;s=a.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var c=new cc(this,i,e);return this._bindAction(c,s),this._addInactiveAction(c,o,r),c},existingAction:function(t,e){var n=e||this._root,r=n.uuid,i="string"==typeof t?gs.findByName(n,t):t,o=i?i.uuid:t,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[r]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,n=this._bindings,r=this._nActiveBindings;this._nActiveActions=0;for(var i=this._nActiveBindings=0;i!==e;++i)t[i].reset();for(i=0;i!==r;++i)n[i].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,r=this.time+=t,i=Math.sign(t),o=this._accuIndex^=1,a=0;a!==n;++a)e[a]._update(r,t,i,o);var s=this._bindings,l=this._nActiveBindings;for(a=0;a!==l;++a)s[a].apply(o);return this},setTime:function(t){for(var e=this.time=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(t)},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,n=t.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var o=i.knownActions,a=0,s=o.length;a!==s;++a){var l=o[a];this._deactivateAction(l);var c=l._cacheIndex,u=e[e.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,e[u._cacheIndex=c]=u,e.pop(),this._removeInactiveBindingsForAction(l)}delete r[n]}},uncacheRoot:function(t){var e=t.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[e];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var o=this._bindingsByRootAndName[e];if(void 0!==o)for(var a in o){var s=o[a];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),hc.prototype.clone=function(){return new hc(void 0===this.value.clone?this.value:this.value.clone())},dc.prototype=Object.assign(Object.create(Ii.prototype),{constructor:dc,isInstancedInterleavedBuffer:!0,copy:function(t){return Ii.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(pc.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){var r=n||[];return mc(t,this,r,e),r.sort(fc),r},intersectObjects:function(t,e,n){var r=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,o=t.length;i<o;i++)mc(t[i],this,r,e);return r.sort(fc),r}}),Object.assign(gc.prototype,{set:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,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,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(Q.clamp(e/this.radius,-1,1))),this}}),Object.assign(yc.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}});var vc=new tt;function xc(t,e){this.min=void 0!==t?t:new tt(1/0,1/0),this.max=void 0!==e?e:new tt(-1/0,-1/0)}Object.assign(xc.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){var n=vc.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},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=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new tt),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new tt),this.isEmpty()?t.set(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},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},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},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new tt),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},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)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new tt),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return vc.copy(t).clamp(this.min,this.max).sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),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 bc=new ht,wc=new ht;function Mc(t,e){this.start=void 0!==t?t:new ht,this.end=void 0!==e?e:new ht}function _c(t){Bt.call(this),this.material=t,this.render=function(){}}Object.assign(Mc.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new ht),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new ht),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new ht),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){bc.subVectors(t,this.start),wc.subVectors(this.end,this.start);var n=wc.dot(wc),r=wc.dot(bc)/n;return e&&(r=Q.clamp(r,0,1)),r},closestPointToPoint:function(t,e,n){var r=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new ht),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),((_c.prototype=Object.create(Bt.prototype)).constructor=_c).prototype.isImmediateRenderObject=!0;var Cc=new ht;function Sc(t,e){Bt.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new nn,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,o=1;i<32;i++,o++){var a=i/32*Math.PI*2,s=o/32*Math.PI*2;r.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new We(r,3));var l=new po({fog:!1});this.cone=new Mo(n,l),this.add(this.cone),this.update()}((Sc.prototype=Object.create(Bt.prototype)).constructor=Sc).prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Sc.prototype.update=function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),Cc.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Cc),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var Tc=new ht,Ec=new xt,Dc=new xt;function Ac(t){for(var e=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var r=0;r<e.children.length;r++)n.push.apply(n,t(e.children[r]));return n}(t),n=new nn,r=[],i=[],o=new De(0,0,1),a=new De(0,1,0),s=0;s<e.length;s++){var l=e[s];l.parent&&l.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(o.r,o.g,o.b),i.push(a.r,a.g,a.b))}n.setAttribute("position",new We(r,3)),n.setAttribute("color",new We(i,3));var c=new po({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});Mo.call(this,n,c),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function Oc(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;var r=new Oa(e,4,2),i=new ke({wireframe:!0,fog:!1});wn.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}((Ac.prototype=Object.create(Mo.prototype)).constructor=Ac).prototype.updateMatrixWorld=function(t){var e=this.bones,n=this.geometry,r=n.getAttribute("position");Dc.getInverse(this.root.matrixWorld);for(var i=0,o=0;i<e.length;i++){var a=e[i];a.parent&&a.parent.isBone&&(Ec.multiplyMatrices(Dc,a.matrixWorld),Tc.setFromMatrixPosition(Ec),r.setXYZ(o,Tc.x,Tc.y,Tc.z),Ec.multiplyMatrices(Dc,a.parent.matrixWorld),Tc.setFromMatrixPosition(Ec),r.setXYZ(o+1,Tc.x,Tc.y,Tc.z),o+=2)}n.getAttribute("position").needsUpdate=!0,Bt.prototype.updateMatrixWorld.call(this,t)},((Oc.prototype=Object.create(wn.prototype)).constructor=Oc).prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Oc.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var Pc=new ht,Lc=new De,Rc=new De;function Ic(t,e,n){Bt.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new Ho(e);r.rotateY(.5*Math.PI),this.material=new ke({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=2);var i=r.getAttribute("position"),o=new Float32Array(3*i.count);r.setAttribute("color",new Be(o,3)),this.add(new wn(r,this.material)),this.update()}function kc(t,e,n,r){t=t||10,e=e||10,n=new De(void 0!==n?n:4473924),r=new De(void 0!==r?r:8947848);for(var i=e/2,o=t/e,a=t/2,s=[],l=[],c=0,u=0,h=-a;c<=e;c++,h+=o){s.push(-a,0,h,a,0,h),s.push(h,0,-a,h,0,a);var d=c===i?n:r;d.toArray(l,u),u+=3,d.toArray(l,u),u+=3,d.toArray(l,u),u+=3,d.toArray(l,u),u+=3}var p=new nn;p.setAttribute("position",new We(s,3)),p.setAttribute("color",new We(l,3));var f=new po({vertexColors:2});Mo.call(this,p,f)}function Fc(t,e,n,r,i,o){t=t||10,e=e||16,n=n||8,r=r||64,i=new De(void 0!==i?i:4473924),o=new De(void 0!==o?o:8947848);var a,s,l,c,u,h,d,p=[],f=[];for(c=0;c<=e;c++)l=c/e*(2*Math.PI),a=Math.sin(l)*t,s=Math.cos(l)*t,p.push(0,0,0),p.push(a,0,s),d=1&c?i:o,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(c=0;c<=n;c++)for(d=1&c?i:o,h=t-t/n*c,u=0;u<r;u++)l=u/r*(2*Math.PI),a=Math.sin(l)*h,s=Math.cos(l)*h,p.push(a,0,s),f.push(d.r,d.g,d.b),l=(u+1)/r*(2*Math.PI),a=Math.sin(l)*h,s=Math.cos(l)*h,p.push(a,0,s),f.push(d.r,d.g,d.b);var m=new nn;m.setAttribute("position",new We(p,3)),m.setAttribute("color",new We(f,3));var g=new po({vertexColors:2});Mo.call(this,m,g)}((Ic.prototype=Object.create(Bt.prototype)).constructor=Ic).prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Ic.prototype.update=function(){var t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=t.geometry.getAttribute("color");Lc.copy(this.light.color),Rc.copy(this.light.groundColor);for(var n=0,r=e.count;n<r;n++){var i=n<r/2?Lc:Rc;e.setXYZ(n,i.r,i.g,i.b)}e.needsUpdate=!0}t.lookAt(Pc.setFromMatrixPosition(this.light.matrixWorld).negate())},kc.prototype=Object.assign(Object.create(Mo.prototype),{constructor:kc,copy:function(t){return Mo.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),(Fc.prototype=Object.create(Mo.prototype)).constructor=Fc;var Bc=new ht,jc=new ht,Nc=new ht;function zc(t,e,n){Bt.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);var r=new nn;r.setAttribute("position",new We([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var i=new po({fog:!1});this.lightPlane=new xo(r,i),this.add(this.lightPlane),(r=new nn).setAttribute("position",new We([0,0,0,0,0,1],3)),this.targetLine=new xo(r,i),this.add(this.targetLine),this.update()}((zc.prototype=Object.create(Bt.prototype)).constructor=zc).prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},zc.prototype.update=function(){Bc.setFromMatrixPosition(this.light.matrixWorld),jc.setFromMatrixPosition(this.light.target.matrixWorld),Nc.subVectors(jc,Bc),this.lightPlane.lookAt(jc),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(jc),this.targetLine.scale.z=Nc.length()};var Vc=new ht,Gc=new kn;function Hc(t){var e=new nn,n=new po({color:16777215,vertexColors:1}),r=[],i=[],o={},a=new De(16755200),s=new De(16711680),l=new De(43775),c=new De(16777215),u=new De(3355443);function h(t,e,n){d(t,n),d(e,n)}function d(t,e){r.push(0,0,0),i.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(r.length/3-1)}h("n1","n2",a),h("n2","n4",a),h("n4","n3",a),h("n3","n1",a),h("f1","f2",a),h("f2","f4",a),h("f4","f3",a),h("f3","f1",a),h("n1","f1",a),h("n2","f2",a),h("n3","f3",a),h("n4","f4",a),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",l),h("u2","u3",l),h("u3","u1",l),h("c","t",c),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u),e.setAttribute("position",new We(r,3)),e.setAttribute("color",new We(i,3)),Mo.call(this,e,n),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function Uc(t,e,n,r,i,o,a){Vc.set(i,o,a).unproject(r);var s=e[t];if(void 0!==s)for(var l=n.getAttribute("position"),c=0,u=s.length;c<u;c++)l.setXYZ(s[c],Vc.x,Vc.y,Vc.z)}((Hc.prototype=Object.create(Mo.prototype)).constructor=Hc).prototype.update=function(){var t=this.geometry,e=this.pointMap;Gc.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Uc("c",e,t,Gc,0,0,-1),Uc("t",e,t,Gc,0,0,1),Uc("n1",e,t,Gc,-1,-1,-1),Uc("n2",e,t,Gc,1,-1,-1),Uc("n3",e,t,Gc,-1,1,-1),Uc("n4",e,t,Gc,1,1,-1),Uc("f1",e,t,Gc,-1,-1,1),Uc("f2",e,t,Gc,1,-1,1),Uc("f3",e,t,Gc,-1,1,1),Uc("f4",e,t,Gc,1,1,1),Uc("u1",e,t,Gc,.7,1.1,-1),Uc("u2",e,t,Gc,-.7,1.1,-1),Uc("u3",e,t,Gc,0,2,-1),Uc("cf1",e,t,Gc,-1,0,1),Uc("cf2",e,t,Gc,1,0,1),Uc("cf3",e,t,Gc,0,-1,1),Uc("cf4",e,t,Gc,0,1,1),Uc("cn1",e,t,Gc,-1,0,-1),Uc("cn2",e,t,Gc,1,0,-1),Uc("cn3",e,t,Gc,0,-1,-1),Uc("cn4",e,t,Gc,0,1,-1),t.getAttribute("position").needsUpdate=!0};var Wc=new Kt;function Jc(t,e){this.object=t,void 0===e&&(e=16776960);var n=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]),r=new Float32Array(24),i=new nn;i.setIndex(new Be(n,1)),i.setAttribute("position",new Be(r,3)),Mo.call(this,i,new po({color:e})),this.matrixAutoUpdate=!1,this.update()}function qc(t,e){this.type="Box3Helper",this.box=t,e=e||16776960;var n=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]),r=new nn;r.setIndex(new Be(n,1)),r.setAttribute("position",new We([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),Mo.call(this,r,new po({color:e})),this.geometry.computeBoundingSphere()}function Xc(t,e,n){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var r=void 0!==n?n:16776960,i=new nn;i.setAttribute("position",new We([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),xo.call(this,i,new po({color:r}));var o=new nn;o.setAttribute("position",new We([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),o.computeBoundingSphere(),this.add(new wn(o,new ke({color:r,opacity:.2,transparent:!0,depthWrite:!1})))}((Jc.prototype=Object.create(Mo.prototype)).constructor=Jc).prototype.update=function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Wc.setFromObject(this.object),!Wc.isEmpty()){var e=Wc.min,n=Wc.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=e.x,i[4]=n.y,i[5]=n.z,i[6]=e.x,i[7]=e.y,i[8]=n.z,i[9]=n.x,i[10]=e.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=e.z,i[15]=e.x,i[16]=n.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=n.x,i[22]=e.y,i[23]=e.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}},Jc.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Jc.prototype.copy=function(t){return Mo.prototype.copy.call(this,t),this.object=t.object,this},Jc.prototype.clone=function(){return(new this.constructor).copy(this)},((qc.prototype=Object.create(Mo.prototype)).constructor=qc).prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),Bt.prototype.updateMatrixWorld.call(this,t))},((Xc.prototype=Object.create(xo.prototype)).constructor=Xc).prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?1:0,this.lookAt(this.plane.normal),Bt.prototype.updateMatrixWorld.call(this,t)};var Yc,Zc,$c=new ht;function Kc(t,e,n,r,i,o){Bt.call(this),void 0===t&&(t=new ht(0,0,1)),void 0===e&&(e=new ht(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===o&&(o=.2*i),void 0===Yc&&((Yc=new nn).setAttribute("position",new We([0,0,0,0,1,0],3)),(Zc=new za(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new xo(Yc,new po({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new wn(Zc,new ke({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,i,o)}function Qc(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new nn;n.setAttribute("position",new We(e,3)),n.setAttribute("color",new We([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new po({vertexColors:2});Mo.call(this,n,r)}((Kc.prototype=Object.create(Bt.prototype)).constructor=Kc).prototype.setDirection=function(t){if(.99999<t.y)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{$c.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle($c,e)}},Kc.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},Kc.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},Kc.prototype.copy=function(t){return Bt.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Kc.prototype.clone=function(){return(new this.constructor).copy(this)},(Qc.prototype=Object.create(Mo.prototype)).constructor=Qc;var tu,eu=Math.pow(2,8),nu=[.125,.215,.35,.446,.526,.582],ru=5+nu.length,iu=20,ou={3000:0,3001:1,3002:2,3004:3,3005:4,3006:5,3007:6},au=new al,su=((tu=new qa({defines:{n:20},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(20)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new ht(0,1,0)},inputEncoding:{value:ou[N]},outputEncoding:{value:ou[N]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tfor (int i = 0; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfor (int dir = -1; dir < 2; dir += 2) {\n\t\t\tif (i == 0 && dir == 1)\n\t\t\t\tcontinue;\n\t\t\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\t\t\tif (all(equal(axis, vec3(0.0))))\n\t\t\t\taxis = cross(vec3(0.0, 1.0, 0.0), vOutputDirection);\n\t\t\taxis = normalize(axis);\n\t\t\tfloat theta = dTheta * float(dir * i);\n\t\t\tfloat cosTheta = cos(theta);\n\t\t\t// Rodrigues' axis-angle rotation\n\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t\t\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\t\t\tgl_FragColor.rgb +=\n\t\t\t\t\tweights[i] * bilinearCubeUV(envMap, sampleDirection, mipInt);\n\t\t}\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})).type="SphericalGaussianBlur",tu),lu=null,cu=null,uu=function(){for(var t=[],e=[],n=[],r=8,i=0;i<ru;i++){var o=Math.pow(2,r);e.push(o);var a=1/o;4<i?a=nu[i-8+4-1]:0==i&&(a=0),n.push(a);for(var s=1/(o-1),l=-s/2,c=1+s/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=new Float32Array(108),d=new Float32Array(72),p=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,g=2<f?0:-1,y=[m,g,0,m+2/3,g,0,m+2/3,1+g,0,m,g,0,m+2/3,1+g,0,m,1+g,0];h.set(y,18*f),d.set(u,12*f);var v=[f,f,f,f,f,f];p.set(v,6*f)}var x=new nn;x.setAttribute("position",new Be(h,3)),x.setAttribute("uv",new Be(d,2)),x.setAttribute("faceIndex",new Be(p,1)),t.push(x),4<r&&r--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}(),hu=uu._lodPlanes,du=uu._sizeLods,pu=uu._sigmas,fu=null,mu=null,gu=null,yu=(1+Math.sqrt(5))/2,vu=1/yu,xu=[new ht(1,1,1),new ht(-1,1,1),new ht(1,1,-1),new ht(-1,1,-1),new ht(0,yu,vu),new ht(0,yu,-vu),new ht(vu,0,yu),new ht(-vu,0,yu),new ht(yu,vu,0),new ht(-yu,vu,0)];function bu(t){mu=t,_u(su)}function wu(t){var e={magFilter:u,minFilter:u,generateMipmaps:!1,type:t?t.type:g,format:t?t.format:1023,encoding:t?t.encoding:G,depthBuffer:!1,stencilBuffer:!1},n=Cu(e);return n.depthBuffer=!t,fu=Cu(e),n}function Mu(t){fu.dispose(),mu.setRenderTarget(gu),t.scissorTest=!1,t.setSize(t.width,t.height)}function _u(t){var e=new jt;e.add(new wn(hu[0],t)),mu.compile(e,au)}function Cu(t){var e=new at(3*eu,3*eu,t);return e.texture.mapping=o,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Su(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function Tu(t){var e=mu.autoClear;mu.autoClear=!1;for(var n=1;n<ru;n++)Eu(t,n-1,n,Math.sqrt(pu[n]*pu[n]-pu[n-1]*pu[n-1]),xu[(n-1)%xu.length]);mu.autoClear=e}function Eu(t,e,n,r,i){Du(t,fu,e,n,r,"latitudinal",i),Du(fu,t,n,n,r,"longitudinal",i)}function Du(t,e,n,r,i,o,a){"latitudinal"!==o&&"longitudinal"!==o&&console.error("blur direction must be either latitudinal or longitudinal!");var s=new jt;s.add(new wn(hu[r],su));var l=su.uniforms,c=du[n]-1,u=isFinite(i)?Math.PI/(2*c):2*Math.PI/39,h=i/u,d=isFinite(i)?1+Math.floor(3*h):iu;iu<d&&console.warn("sigmaRadians, "+i+", is too large and will clip, as it requested "+d+" samples when the maximum is set to "+iu);for(var p=[],f=0,m=0;m<iu;++m){var g=m/h,y=Math.exp(-g*g/2);p.push(y),0==m?f+=y:m<d&&(f+=2*y)}for(m=0;m<p.length;m++)p[m]=p[m]/f;l.envMap.value=t.texture,l.samples.value=d,l.weights.value=p,l.latitudinal.value="latitudinal"===o,a&&(l.poleAxis.value=a),l.dTheta.value=u,l.mipInt.value=8-n,l.inputEncoding.value=ou[t.texture.encoding],l.outputEncoding.value=ou[t.texture.encoding];var v=du[r];Su(e,g=3*Math.max(0,eu-2*v),(0===r?0:2*eu)+2*v*(4<r?r-8+4:0),3*v,2*v),mu.setRenderTarget(e),mu.render(s,au)}function Au(){var t=new qa({uniforms:{envMap:{value:null},texelSize:{value:new tt(1,1)},inputEncoding:{value:ou[N]},outputEncoding:{value:ou[N]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv;\n\tuv.y = asin(clamp(outputDirection.y, -1.0, 1.0)) * RECIPROCAL_PI + 0.5;\n\tuv.x = atan(outputDirection.z, outputDirection.x) * RECIPROCAL_PI2 + 0.5;\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return t.type="EquirectangularToCubeUV",t}function Ou(){var t=new qa({uniforms:{envMap:{value:null},inputEncoding:{value:ou[N]},outputEncoding:{value:ou[N]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return t.type="CubemapToCubeUV",t}function Pu(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),js.call(this,t),this.type="catmullrom",this.closed=!0}function Lu(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),js.call(this,t),this.type="catmullrom"}function Ru(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),js.call(this,t),this.type="catmullrom"}bu.prototype={constructor:bu,fromScene:function(t,e,n,r){void 0===e&&(e=0),void 0===n&&(n=.1),void 0===r&&(r=100),gu=mu.getRenderTarget();var i=wu();return function(t,e,n,r){var i=new Fn(90,1,e,n),o=[1,1,1,1,-1,1],a=[1,1,-1,-1,-1,1],s=mu.outputEncoding,l=mu.toneMapping,c=mu.toneMappingExposure,u=mu.getClearColor(),h=mu.getClearAlpha();mu.toneMapping=1,mu.toneMappingExposure=1,mu.outputEncoding=N,t.scale.z*=-1;var d=t.background;if(d&&d.isColor){d.convertSRGBToLinear();var p=Math.max(d.r,d.g,d.b),f=Math.min(Math.max(Math.ceil(Math.log2(p)),-128),127);d=d.multiplyScalar(Math.pow(2,-f));var m=(f+128)/255;mu.setClearColor(d,m),t.background=null}for(var g=0;g<6;g++){var y=g%3;0==y?(i.up.set(0,o[g],0),i.lookAt(a[g],0,0)):1==y?(i.up.set(0,0,o[g]),i.lookAt(0,a[g],0)):(i.up.set(0,o[g],0),i.lookAt(0,0,a[g])),Su(r,y*eu,2<g?eu:0,eu,eu),mu.setRenderTarget(r),mu.render(t,i)}mu.toneMapping=l,mu.toneMappingExposure=c,mu.outputEncoding=s,mu.setClearColor(u,h),t.scale.z*=-1}(t,n,r,i),0<e&&Eu(i,0,0,e),Tu(i),Mu(i),i},fromEquirectangular:function(t){return t.magFilter=u,t.minFilter=u,t.generateMipmaps=!1,this.fromCubemap(t)},fromCubemap:function(t){gu=mu.getRenderTarget();var e=wu(t);return function(t,e){var n=new jt;t.isCubeTexture?null==cu&&(cu=Ou()):null==lu&&(lu=Au());var r=t.isCubeTexture?cu:lu;n.add(new wn(hu[0],r));var i=r.uniforms;(i.envMap.value=t).isCubeTexture||i.texelSize.value.set(1/t.image.width,1/t.image.height),i.inputEncoding.value=ou[t.encoding],i.outputEncoding.value=ou[t.encoding],Su(e,0,0,3*eu,2*eu),mu.setRenderTarget(e),mu.render(n,au)}(t,e),Tu(e),Mu(e),e},compileCubemapShader:function(){null==cu&&_u(cu=Ou())},compileEquirectangularShader:function(){null==lu&&_u(lu=Au())},dispose:function(){su.dispose(),null!=cu&&cu.dispose(),null!=lu&&lu.dispose();for(var t=0;t<hu.length;t++)hu[t].dispose()}},Os.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Os.prototype),(t.prototype.constructor=t).prototype.getPoint=e,t},Object.assign(Zs.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new Dn,n=0,r=t.length;n<r;n++){var i=t[n];e.vertices.push(new ht(i.x,i.y,i.z||0))}return e}}),Object.assign($s.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Pu.prototype=Object.create(js.prototype),Lu.prototype=Object.create(js.prototype),Ru.prototype=Object.create(js.prototype),Object.assign(Ru.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),kc.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Ac.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(ws.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),dl.extractUrlBase(t)}}),ws.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(yl.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(xc.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(Kt.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Gn.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},Mc.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(Q,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Q.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Q.ceilPowerOfTwo(t)}}),Object.assign(et.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(xt.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new ht).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,r,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,r,n,i,o)}}),pe.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},lt.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(ce.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(Ce.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(Ce,{barycoordFromPoint:function(t,e,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Ce.getBarycoord(t,e,n,r,i)},normal:function(t,e,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Ce.getNormal(t,e,n,r)}}),Object.assign(Ks.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new _a(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ka(this,t)}}),Object.assign(tt.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(ht.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(ot.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Dn.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(t){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.assign(Bt.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(Bt.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(wn.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(wn.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(eo.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(oo.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),no.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Os.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Fn.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Qs.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Be.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===X},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(X)}}}),Object.assign(Be.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?X:q),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(nn.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new Be(e,arguments[2])))},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(nn.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Ii.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===X},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(Ii.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?X:q),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Ca.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(hc.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Ie.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new De}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(Za.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(In.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(Pi.prototype,{clearTarget:function(t,e,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,r)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(Pi.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?z:N}}}),Object.defineProperties(Mi.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(at.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Gl.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new Dl).load(t,function(t){e.setBuffer(t)}),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Xl.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Bn.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};var Iu={merge:function(t,e,n){var r;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),r=e.matrix,e=e.geometry),t.merge(e,r,n)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};nt.crossOrigin=void 0,nt.loadTexture=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new As;i.setCrossOrigin(this.crossOrigin);var o=i.load(t,n,void 0,r);return e&&(o.mapping=e),o},nt.loadTextureCube=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new Ds;i.setCrossOrigin(this.crossOrigin);var o=i.load(t,n,void 0,r);return e&&(o.mapping=e),o},nt.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},nt.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var ku={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"113"}})),t.ACESFilmicToneMapping=5,t.AddEquation=e,t.AddOperation=2,t.AdditiveBlending=2,t.AlphaFormat=1021,t.AlwaysDepth=1,t.AlwaysStencilFunc=519,t.AmbientLight=cl,t.AmbientLightProbe=Ll,t.AnimationClip=gs,t.AnimationLoader=Cs,t.AnimationMixer=uc,t.AnimationObjectGroup=lc,t.AnimationUtils=rs,t.ArcCurve=Ls,t.ArrayCamera=Di,t.ArrowHelper=Kc,t.Audio=Gl,t.AudioAnalyser=Xl,t.AudioContext=El,t.AudioListener=Vl,t.AudioLoader=Dl,t.AxesHelper=Qc,t.AxisHelper=function(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Qc(t)},t.BackSide=1,t.BasicDepthPacking=3200,t.BasicShadowMap=0,t.BinaryTextureLoader=function(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Ts(t)},t.Bone=ao,t.BooleanKeyframeTrack=cs,t.BoundingBoxHelper=function(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Jc(t,e)},t.Box2=xc,t.Box3=Kt,t.Box3Helper=qc,t.BoxBufferGeometry=On,t.BoxGeometry=An,t.BoxHelper=Jc,t.BufferAttribute=Be,t.BufferGeometry=nn,t.BufferGeometryLoader=ml,t.ByteType=1010,t.Cache=vs,t.Camera=kn,t.CameraHelper=Hc,t.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")},t.CanvasTexture=Ro,t.CatmullRomCurve3=js,t.CineonToneMapping=4,t.CircleBufferGeometry=Ua,t.CircleGeometry=Ha,t.ClampToEdgeWrapping=l,t.Clock=Fl,t.ClosedSplineCurve3=Pu,t.Color=De,t.ColorKeyframeTrack=us,t.CompressedTexture=Lo,t.CompressedTextureLoader=Ss,t.ConeBufferGeometry=Ga,t.ConeGeometry=Va,t.CubeCamera=Bn,t.CubeGeometry=An,t.CubeReflectionMapping=n,t.CubeRefractionMapping=r,t.CubeTexture=Kn,t.CubeTextureLoader=Ds,t.CubeUVReflectionMapping=o,t.CubeUVRefractionMapping=a,t.CubicBezierCurve=Gs,t.CubicBezierCurve3=Hs,t.CubicInterpolant=os,t.CullFaceBack=1,t.CullFaceFront=2,t.CullFaceFrontBack=3,t.CullFaceNone=0,t.Curve=Os,t.CurvePath=Zs,t.CustomBlending=5,t.CylinderBufferGeometry=za,t.CylinderGeometry=Na,t.Cylindrical=yc,t.DataTexture=Nn,t.DataTexture2DArray=Qn,t.DataTexture3D=tr,t.DataTextureLoader=Ts,t.DecrementStencilOp=7683,t.DecrementWrapStencilOp=34056,t.DefaultLoadingManager=bs,t.DepthFormat=C,t.DepthStencilFormat=S,t.DepthTexture=Io,t.DirectionalLight=ll,t.DirectionalLightHelper=zc,t.DirectionalLightShadow=sl,t.DiscreteInterpolant=ss,t.DodecahedronBufferGeometry=qo,t.DodecahedronGeometry=Jo,t.DoubleSide=2,t.DstAlphaFactor=206,t.DstColorFactor=208,t.DynamicBufferAttribute=function(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Be(t,e).setUsage(X)},t.DynamicCopyUsage=35050,t.DynamicDrawUsage=X,t.DynamicReadUsage=35049,t.EdgesGeometry=ja,t.EdgesHelper=function(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Mo(new ja(t.geometry),new po({color:void 0!==e?e:16777215}))},t.EllipseCurve=Ps,t.EqualDepth=4,t.EqualStencilFunc=514,t.EquirectangularReflectionMapping=303,t.EquirectangularRefractionMapping=i,t.Euler=Mt,t.EventDispatcher=Y,t.ExtrudeBufferGeometry=Ca,t.ExtrudeGeometry=_a,t.Face3=Le,t.Face4=function(t,e,n,r,i,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new Le(t,e,n,i,o,a)},t.FaceColors=1,t.FileLoader=_s,t.FlatShading=1,t.Float32Attribute=function(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new We(t,e)},t.Float32BufferAttribute=We,t.Float64Attribute=function(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Je(t,e)},t.Float64BufferAttribute=Je,t.FloatType=x,t.Fog=Ri,t.FogExp2=Li,t.Font=Cl,t.FontLoader=Tl,t.FrontFaceDirectionCCW=1,t.FrontFaceDirectionCW=0,t.FrontSide=0,t.Frustum=Gn,t.GammaEncoding=V,t.Geometry=Dn,t.GeometryUtils=Iu,t.GreaterDepth=6,t.GreaterEqualDepth=5,t.GreaterEqualStencilFunc=518,t.GreaterStencilFunc=516,t.GridHelper=kc,t.Group=Ai,t.HalfFloatType=b,t.HemisphereLight=tl,t.HemisphereLightHelper=Ic,t.HemisphereLightProbe=Pl,t.IcosahedronBufferGeometry=Wo,t.IcosahedronGeometry=Uo,t.ImageBitmapLoader=Ml,t.ImageLoader=Es,t.ImageUtils=nt,t.ImmediateRenderObject=_c,t.IncrementStencilOp=7682,t.IncrementWrapStencilOp=34055,t.InstancedBufferAttribute=fl,t.InstancedBufferGeometry=pl,t.InstancedInterleavedBuffer=dc,t.InstancedMesh=ho,t.Int16Attribute=function(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Ve(t,e)},t.Int16BufferAttribute=Ve,t.Int32Attribute=function(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new He(t,e)},t.Int32BufferAttribute=He,t.Int8Attribute=function(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new je(t,e)},t.Int8BufferAttribute=je,t.IntType=1013,t.InterleavedBuffer=Ii,t.InterleavedBufferAttribute=Bi,t.Interpolant=is,t.InterpolateDiscrete=I,t.InterpolateLinear=k,t.InterpolateSmooth=2302,t.InvertStencilOp=5386,t.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")},t.KeepStencilOp=J,t.KeyframeTrack=ls,t.LOD=eo,t.LatheBufferGeometry=Ia,t.LatheGeometry=Ra,t.Layers=_t,t.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")},t.LessDepth=2,t.LessEqualDepth=3,t.LessEqualStencilFunc=515,t.LessStencilFunc=513,t.Light=Qs,t.LightProbe=Ol,t.LightShadow=el,t.Line=xo,t.Line3=Mc,t.LineBasicMaterial=po,t.LineCurve=Us,t.LineCurve3=Ws,t.LineDashedMaterial=es,t.LineLoop=_o,t.LinePieces=1,t.LineSegments=Mo,t.LineStrip=0,t.LinearEncoding=N,t.LinearFilter=p,t.LinearInterpolant=as,t.LinearMipMapLinearFilter=1008,t.LinearMipMapNearestFilter=1007,t.LinearMipmapLinearFilter=m,t.LinearMipmapNearestFilter=f,t.LinearToneMapping=1,t.Loader=ws,t.LoaderUtils=dl,t.LoadingManager=xs,t.LogLuvEncoding=3003,t.LoopOnce=2200,t.LoopPingPong=2202,t.LoopRepeat=2201,t.LuminanceAlphaFormat=1025,t.LuminanceFormat=1024,t.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},t.Material=Ie,t.MaterialLoader=hl,t.Math=Q,t.MathUtils=Q,t.Matrix3=et,t.Matrix4=xt,t.MaxEquation=104,t.Mesh=wn,t.MeshBasicMaterial=ke,t.MeshDepthMaterial=bi,t.MeshDistanceMaterial=wi,t.MeshFaceMaterial=function(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t},t.MeshLambertMaterial=Qa,t.MeshMatcapMaterial=ts,t.MeshNormalMaterial=Ka,t.MeshPhongMaterial=Za,t.MeshPhysicalMaterial=Ya,t.MeshStandardMaterial=Xa,t.MeshToonMaterial=$a,t.MinEquation=103,t.MirroredRepeatWrapping=c,t.MixOperation=1,t.MultiMaterial=function(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,(t.materials=t).clone=function(){return t.slice()},t},t.MultiplyBlending=4,t.MultiplyOperation=0,t.NearestFilter=u,t.NearestMipMapLinearFilter=1005,t.NearestMipMapNearestFilter=1004,t.NearestMipmapLinearFilter=d,t.NearestMipmapNearestFilter=h,t.NeverDepth=0,t.NeverStencilFunc=512,t.NoBlending=0,t.NoColors=0,t.NoToneMapping=0,t.NormalBlending=1,t.NotEqualDepth=7,t.NotEqualStencilFunc=517,t.NumberKeyframeTrack=hs,t.Object3D=Bt,t.ObjectLoader=yl,t.ObjectSpaceNormalMap=1,t.OctahedronBufferGeometry=Ho,t.OctahedronGeometry=Go,t.OneFactor=201,t.OneMinusDstAlphaFactor=207,t.OneMinusDstColorFactor=209,t.OneMinusSrcAlphaFactor=205,t.OneMinusSrcColorFactor=203,t.OrthographicCamera=al,t.PCFShadowMap=1,t.PCFSoftShadowMap=2,t.PMREMGenerator=bu,t.ParametricBufferGeometry=Bo,t.ParametricGeometry=Fo,t.Particle=function(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new $i(t)},t.ParticleBasicMaterial=function(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Co(t)},t.ParticleSystem=function(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Ao(t,e)},t.ParticleSystemMaterial=function(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Co(t)},t.Path=$s,t.PerspectiveCamera=Fn,t.Plane=pe,t.PlaneBufferGeometry=Jn,t.PlaneGeometry=Wn,t.PlaneHelper=Xc,t.PointCloud=function(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Ao(t,e)},t.PointCloudMaterial=function(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Co(t)},t.PointLight=ol,t.PointLightHelper=Oc,t.Points=Ao,t.PointsMaterial=Co,t.PolarGridHelper=Fc,t.PolyhedronBufferGeometry=No,t.PolyhedronGeometry=jo,t.PositionalAudio=ql,t.PropertyBinding=sc,t.PropertyMixer=Yl,t.QuadraticBezierCurve=Js,t.QuadraticBezierCurve3=qs,t.Quaternion=lt,t.QuaternionKeyframeTrack=ps,t.QuaternionLinearInterpolant=ds,t.REVISION="113",t.RGBADepthPacking=3201,t.RGBAFormat=_,t.RGBAIntegerFormat=1033,t.RGBA_ASTC_10x10_Format=37819,t.RGBA_ASTC_10x5_Format=37816,t.RGBA_ASTC_10x6_Format=37817,t.RGBA_ASTC_10x8_Format=37818,t.RGBA_ASTC_12x10_Format=37820,t.RGBA_ASTC_12x12_Format=37821,t.RGBA_ASTC_4x4_Format=37808,t.RGBA_ASTC_5x4_Format=37809,t.RGBA_ASTC_5x5_Format=37810,t.RGBA_ASTC_6x5_Format=37811,t.RGBA_ASTC_6x6_Format=37812,t.RGBA_ASTC_8x5_Format=37813,t.RGBA_ASTC_8x6_Format=37814,t.RGBA_ASTC_8x8_Format=37815,t.RGBA_PVRTC_2BPPV1_Format=R,t.RGBA_PVRTC_4BPPV1_Format=L,t.RGBA_S3TC_DXT1_Format=E,t.RGBA_S3TC_DXT3_Format=D,t.RGBA_S3TC_DXT5_Format=A,t.RGBDEncoding=W,t.RGBEEncoding=G,t.RGBEFormat=1023,t.RGBFormat=M,t.RGBIntegerFormat=1032,t.RGBM16Encoding=U,t.RGBM7Encoding=H,t.RGB_ETC1_Format=36196,t.RGB_PVRTC_2BPPV1_Format=P,t.RGB_PVRTC_4BPPV1_Format=O,t.RGB_S3TC_DXT1_Format=T,t.RGFormat=1030,t.RGIntegerFormat=1031,t.RawShaderMaterial=qa,t.Ray=ce,t.Raycaster=pc,t.RectAreaLight=ul,t.RedFormat=1028,t.RedIntegerFormat=1029,t.ReinhardToneMapping=2,t.RepeatWrapping=s,t.ReplaceStencilOp=7681,t.ReverseSubtractEquation=102,t.RingBufferGeometry=La,t.RingGeometry=Pa,t.Scene=jt,t.SceneUtils=ku,t.ShaderChunk=qn,t.ShaderLib=Xn,t.ShaderMaterial=In,t.ShadowMaterial=Ja,t.Shape=Ks,t.ShapeBufferGeometry=Fa,t.ShapeGeometry=ka,t.ShapePath=_l,t.ShapeUtils=ba,t.ShortType=1011,t.Skeleton=oo,t.SkeletonHelper=Ac,t.SkinnedMesh=no,t.SmoothShading=2,t.Sphere=ee,t.SphereBufferGeometry=Oa,t.SphereGeometry=Aa,t.Spherical=gc,t.SphericalHarmonics3=Al,t.SphericalReflectionMapping=305,t.Spline=Ru,t.SplineCurve=Xs,t.SplineCurve3=Lu,t.SpotLight=rl,t.SpotLightHelper=Sc,t.SpotLightShadow=nl,t.Sprite=$i,t.SpriteMaterial=ji,t.SrcAlphaFactor=204,t.SrcAlphaSaturateFactor=210,t.SrcColorFactor=202,t.StaticCopyUsage=35046,t.StaticDrawUsage=q,t.StaticReadUsage=35045,t.StereoCamera=kl,t.StreamCopyUsage=35042,t.StreamDrawUsage=35040,t.StreamReadUsage=35041,t.StringKeyframeTrack=fs,t.SubtractEquation=101,t.SubtractiveBlending=3,t.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},t.TangentSpaceNormalMap=0,t.TetrahedronBufferGeometry=Vo,t.TetrahedronGeometry=zo,t.TextBufferGeometry=Da,t.TextGeometry=Ea,t.Texture=it,t.TextureLoader=As,t.TorusBufferGeometry=Qo,t.TorusGeometry=Ko,t.TorusKnotBufferGeometry=$o,t.TorusKnotGeometry=Zo,t.Triangle=Ce,t.TriangleFanDrawMode=2,t.TriangleStripDrawMode=1,t.TrianglesDrawMode=0,t.TubeBufferGeometry=Yo,t.TubeGeometry=Xo,t.UVMapping=300,t.Uint16Attribute=function(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Ge(t,e)},t.Uint16BufferAttribute=Ge,t.Uint32Attribute=function(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Ue(t,e)},t.Uint32BufferAttribute=Ue,t.Uint8Attribute=function(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Ne(t,e)},t.Uint8BufferAttribute=Ne,t.Uint8ClampedAttribute=function(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new ze(t,e)},t.Uint8ClampedBufferAttribute=ze,t.Uncharted2ToneMapping=3,t.Uniform=hc,t.UniformsLib=Hn,t.UniformsUtils=Rn,t.UnsignedByteType=g,t.UnsignedInt248Type=w,t.UnsignedIntType=v,t.UnsignedShort4444Type=1017,t.UnsignedShort5551Type=1018,t.UnsignedShort565Type=1019,t.UnsignedShortType=y,t.VSMShadowMap=3,t.Vector2=tt,t.Vector3=ht,t.Vector4=ot,t.VectorKeyframeTrack=ms,t.Vertex=function(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new ht(t,e,n)},t.VertexColors=2,t.VideoTexture=Po,t.WebGLCubeRenderTarget=jn,t.WebGLMultisampleRenderTarget=st,t.WebGLRenderTarget=at,t.WebGLRenderTargetCube=function(t,e,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new jn(t,n)},t.WebGLRenderer=Pi,t.WebGLUtils=Si,t.WireframeGeometry=ko,t.WireframeHelper=function(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Mo(new ko(t.geometry),new po({color:void 0!==e?e:16777215}))},t.WrapAroundEnding=j,t.XHRLoader=function(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new _s(t)},t.ZeroCurvatureEnding=F,t.ZeroFactor=200,t.ZeroSlopeEnding=B,t.ZeroStencilOp=0,t.sRGBEncoding=z,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((r=r||self).THREE={})},{}],20:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MrxDbgUtils=void 0;var r,i=t("./Operate/MxEntSelJig"),o=t("./Operate/MxJigCmdManager"),a=t("./UI/MxUiVue");(r=n.MrxDbgUtils||(n.MrxDbgUtils={})).findEntAtPoint=function(t,e,n,r,i){return void 0===n&&(n=null),void 0===r&&(r=!0),new Promise(function(o){if(t.isMxCAD())r||(e=t.screenCoord2Doc(e.x,e.y,e.z)),t.callCommand("MxCAD_FindEntAtPoint",JSON.stringify(e),function(t){if("string"!=typeof t||t.length<1)o([]);else{var e=JSON.parse(t);o(e.ids)}});else{for(var a=t.findMxEntityAtPoint(e,r,i),s=[],l=a.length,c=0;c<l;c++){var u=a[c];if(!n||!n.type||n.type==u.getTypeName()){var h=u.objectId();s.push(h)}}o(s)}})},r.selectEnt=function(t,e){return void 0===e&&(e=null),new Promise(function(n){var r=new i.MxEntSelJig;t&&a.MxUiVue.acutPrintf(t),r.filter=e,r.callRet=function(t){n(t)},o.MxJigCmdManager.runCmd(r)})}},{"./Operate/MxEntSelJig":55,"./Operate/MxJigCmdManager":58,"./UI/MxUiVue":67}],21:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADSyncDisplay=n.MxCADDisplayFun=n.MxCADDatabase=n.MxCADLayerTable=n.MxCADLayerTableRecord=n.MxCADDisplayBlockTable=n.MxCADDisplayBlockRecord=n.MxCADDisplayLayerTable=n.MxCADDisplayLayerRecord=n.MxCADDisplayMemorySections=n.MxCADDisplayMemorySection=n.MxCADDisplayMemorySectionType=n.MxCADDisplayBlockInstance=n.MxCADDisplayBlockRef=n.MxCADDisplayClipPlans=n.MxCADDisplayClipPlan=void 0;var r=t("three"),i=t("../MxFun"),o=t("../MxShader"),a=t("./MxCADNetData"),s=t("../MxManager");n.MxCADDisplayClipPlan=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0};var l=function(){this.id=1,this.clipPlanArray=new Array};n.MxCADDisplayClipPlans=l;var c,u,h=function(){this.mat=new r.Matrix4,this.blkRecId=-1,this.blkOwnerId=0,this.layerId=-1,this.color=0,this.clipPlans=new l};n.MxCADDisplayBlockRef=h,n.MxCADDisplayBlockInstance=function(){this.mat=new r.Matrix4,this.clipPlans=new l},(u=c=n.MxCADDisplayMemorySectionType||(n.MxCADDisplayMemorySectionType={}))[u.kLinesType=1]="kLinesType",u[u.kTriangleType=2]="kTriangleType";var d=function(){this.id=0,this.type=c.kLinesType,this.blockId=0,this.layerId=0,this.color=0,this.points=[]};n.MxCADDisplayMemorySection=d;var p=(f.prototype.add=function(t){this.datas.set(t.id,t)},f.prototype.get=function(t){return this.datas.get(t)},f.prototype.remove=function(t){this.datas.delete(t)},f.prototype.has=function(t){return this.datas.has(t)},f.prototype.clearAll=function(){this.datas=new Map},f);function f(){this.datas=new Map}n.MxCADDisplayMemorySections=p;var m=(g.prototype.addColorByLayerMaterial=function(t,e){this.mapColorByLayerMaterial.set(t,e)},g.prototype.upColorToByLayerMaterial=function(t){this.mapColorByLayerMaterial.forEach(function(e){e.uniformsNeedUpdate=!0,e.needsUpdate=!0,e.uniforms={color:{value:t}}})},g.prototype.getId=function(){return this.id},g.prototype.getBlockRecordId=function(){return this.blockRecId},g.prototype.createMemorySectionToEntityArray=function(t){var e=this.mapMemorySectionIdToEntity.get(t);return e||(e=new Array,this.mapMemorySectionIdToEntity.set(t,e),e)},g.prototype.show=function(t){this.mapMemorySectionIdToEntity.forEach(function(e){for(var n in e)e[n].visible=t})},g.prototype.addEntity=function(t,e){this.createMemorySectionToEntityArray(t).push(e)},g.prototype.deleteMemorySectionEntitys=function(t,e){var n=this.mapMemorySectionIdToEntity.get(t);if(!n)return!1;for(var r=n.length,o=0;o<r;o++)i.MxFun.removeThreejsObject(n[o],e);return this.mapMemorySectionIdToEntity.delete(t),this.mapColorByLayerMaterial.delete(t),!0},g.prototype.addClipMaterial=function(t){this.material_clip.push(t)},g.prototype.updataClipMaterial=function(t){for(var e=this.material_clip.length,n=.5*t.width,r=.5*t.height,i=0;i<e;i++)this.material_clip[i].uniforms.vieww.value=n,this.material_clip[i].uniforms.viewh.value=r},g);function g(t,e){this.id=0,this.blockRecId=0,this.mapMemorySectionIdToEntity=new Map,this.mapColorByLayerMaterial=new Map,this.material_clip=[],this.id=t,this.blockRecId=e}n.MxCADDisplayLayerRecord=m;var y=(v.prototype.createLayerRecord=function(t){var e=this.layers.get(t);return e||(e=new m(t,this.blockRecId),this.layers.set(t,e),e)},v.prototype.getLayerRecord=function(t){return this.layers.get(t)},v);function v(t){this.blockRecId=0,this.layers=new Map,this.blockRecId=t}n.MxCADDisplayLayerTable=y;var x=(b.prototype.getId=function(){return this.id},b.prototype.addBlkRef=function(t){this.blkRefs.set(t.id,t)},b.prototype.getAllBlkRef=function(){return this.blkRefs},b.prototype.addInstance=function(t){this.blkInstances.push(t)},b.prototype.deleteAllInstance=function(){this.blkInstances=new Array},b.prototype.deleteBlkRef=function(){this.blkRefs=new Map},b.prototype.getLayerTable=function(){return this.layerTable},b.prototype.getInstances=function(){return this.blkInstances},b.prototype.getInstances_class=function(){for(var t=[],e=new Map,n=this.blkInstances.length,r=0;r<n;r++){var i=this.blkInstances[r];if(0==i.clipPlans.clipPlanArray.length)t.push(i);else{var o=e.get(i.clipPlans.id);null==o&&(o=[],e.set(i.clipPlans.id,o)),o.push(i)}}var a={};return a.aryInstanceNoClip=t,a.mapInstanceClip=e,a},b);function b(t){this.id=0,this.blkRefs=new Map,this.blkInstances=new Array,this.id=t||0,this.layerTable=new y(this.id)}n.MxCADDisplayBlockRecord=x;var w=(M.prototype.crateBlockRecord=function(t){var e=this.blocks.get(t);return null==e&&(e=new x(t),this.blocks.set(t,e)),e},M.prototype.getBlockRecord=function(t){return this.blocks.get(t)},M.prototype.getAllBlockRecord=function(){return this.blocks},M.prototype.reInitData=function(t){this.blocks=new Map,this.curSpaceBlockRecId=t||0,this.crateBlockRecord(this.curSpaceBlockRecId)},M);function M(){this.blocks=new Map,this.curSpaceBlockRecId=0}n.MxCADDisplayBlockTable=w;var _=function(){};n.MxCADLayerTableRecord=_;var C=(S.prototype.add=function(t,e,n,r){var i=new _;i.id=t,i.name=n,i.color=e,i.off=r,this.mapData.set(t,i)},S.prototype.getAllLayerData=function(){for(var t,e=new Array,n=this.mapData.values();!(t=n.next()).done;){var r=new _;r.color=t.value.color,r.name=t.value.name,r.off=t.value.off,r.id=t.value.id,e.push(r)}return e},S.prototype.setZeroLayerId=function(t){this.zeroLayerId=t},S.prototype.getZeroLayerId=function(){return this.zeroLayerId},S.prototype.getLayerIdForName=function(t){for(var e,n=this.mapData.values();!(e=n.next()).done;)if(e.value.name==t)return e.value.id;return 0},S.prototype.getColor=function(t){var e=this.mapData.get(t);return e?e.color:0},S.prototype.getRecord=function(t){return this.mapData.get(t)},S.prototype.isOff=function(t){var e=this.mapData.get(t);return!e||e.off},S.prototype.upDisplayForLayerData=function(t,e){for(var n,r=e,i=r.length,o=!1,a=function(e){var i=r[e],a=i.id;if(0==a)return"continue";var l=s.getRecord(a);if(!l)return"continue";var c=i.color.split(",");if(c.length<3)return"continue";var u=255&parseInt(c[0])|parseInt(c[1])<<8&65280|parseInt(c[2])<<16&16711680;if((16777215&l.color)==u)return"continue";l.color=4278190080&l.color|u,(n=[]).push((255&l.color)/255,(l.color>>8&255)/255,(l.color>>16&255)/255),t.getDisplayBlockTable().getAllBlockRecord().forEach(function(t){var e=t.getLayerTable().getLayerRecord(a);e&&e.upColorToByLayerMaterial(n)}),o=!0},s=this,l=0;l<i;l++)a(l);var c=function(e){var n=r[e],i=n.id;if(0==i)return"continue";var a=u.getRecord(i);return a&&a.off!=n.off?(a.off=n.off,t.getDisplayBlockTable().getAllBlockRecord().forEach(function(t){var e=t.getLayerTable().getLayerRecord(i);e&&e.show(!a.off)}),void(o=!0)):"continue"},u=this;for(l=0;l<i;l++)c(l);return o},S);function S(){this.mapData=new Map,this.zeroLayerId=0}n.MxCADLayerTable=C;var T,E,D=(A.prototype.initRootBlockRef=function(t){t?this.dpRootBlkRef=t:(this.dpRootBlkRef=new h,this.dpRootBlkRef.mat=new r.Matrix4,this.dpRootBlkRef.blkRecId=0,this.dpRootBlkRef.blkOwnerId=-1,this.dpRootBlkRef.layerId=-1,this.dpRootBlkRef.color=16777215,this.dpRootBlkRef.id=0)},A.prototype.reInit=function(){this.dpBlockTable=new w,this.layerTable=new C,this.memSections=new p,this.initRootBlockRef()},A.prototype.getMxObj=function(){return this.mxObj},A.prototype.getDisplayRootBlockRef=function(){return this.dpRootBlkRef},A.prototype.getDisplayBlockTable=function(){return this.dpBlockTable},A.prototype.getLayerTable=function(){return this.layerTable},A.prototype.getMemSections=function(){return this.memSections},A);function A(t){this.dpBlockTable=new w,this.dpRootBlkRef=null,this.layerTable=new C,this.memSections=new p,this.mxObj=null,this.mxObj=t,this.initRootBlockRef()}n.MxCADDatabase=D,(E=T=n.MxCADDisplayFun||(n.MxCADDisplayFun={})).showLayer=function(t,e,n){t.getDisplayBlockTable().getAllBlockRecord().forEach(function(t){var r=t.getLayerTable().getLayerRecord(e);r&&r.show(n)})},E.createThreejsObjForMemData_Clip=function(t,e,n,i,a,l,u){if(0==t.length)return!1;var h=[],d=[],p=t[0].clipPlans.clipPlanArray[0];h.push(p.x1,p.y1),d.push(p.x2,p.y2);for(var f=[],m=[],g=[],y=[],v=[],x=0;x<t.length;x++){var b=t[x];f=f.concat(b.mat.elements.slice(0,4)),m=m.concat(b.mat.elements.slice(4,8)),g=g.concat(b.mat.elements.slice(8,12)),y=y.concat(b.mat.elements.slice(12,16)),v.push(0)}var w=e.color,M=16777216==(4278190080&w);M&&(w=a);var _=[];_.push(255&w,(65280&w)>>8,(16711680&w)>>16);var C=u.getCanvas(),S=.5*C.width,T=.5*C.height;if(e.type==c.kLinesType){var E=new r.RawShaderMaterial({uniforms:{color:{value:_},clippt1:{value:h},clippt2:{value:d},vieww:{value:S},viewh:{value:T}},vertexShader:o.MxShader.VSHADER_COLOR_POINT_CLIP_FORMXCAD,fragmentShader:o.MxShader.FSHADER_COLOR_POINT_CLIP_FORMXCAD,linewidth:1,transparent:!0,side:r.DoubleSide});n.addClipMaterial(E),(A=new r.InstancedBufferGeometry).maxInstancedCount=t.length,A.setAttribute("position",new r.Float32BufferAttribute(e.points,2)),A.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(f),4)),A.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(m),4)),A.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(g),4)),A.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(y),4)),A.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(v),1));var D=new r.LineSegments(A,E);D.frustumCulled=!1,D.renderOrder=s.MxData.iCADCurveRenderOrder,i.add(D),n.addEntity(e.id,D),M&&n.addColorByLayerMaterial(e.id,E)}else if(e.type==c.kTriangleType){var A;E=new r.RawShaderMaterial({uniforms:{color:{value:_},clippt1:{value:h},clippt2:{value:d},vieww:{value:S},viewh:{value:T}},vertexShader:o.MxShader.VSHADER_COLOR_POINT_CLIP_FORMXCAD,fragmentShader:o.MxShader.FSHADER_COLOR_POINT_CLIP_FORMXCAD,transparent:!0,side:r.DoubleSide}),n.addClipMaterial(E),(A=new r.InstancedBufferGeometry).maxInstancedCount=t.length,A.setAttribute("position",new r.Float32BufferAttribute(e.points,2)),A.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(f),4)),A.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(m),4)),A.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(g),4)),A.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(y),4)),A.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(v),1));var O=new r.Mesh(A,E);O.frustumCulled=!1,O.renderOrder=s.MxData.iCADMeshRenderOrder,i.add(O),n.addEntity(e.id,O),M&&n.addColorByLayerMaterial(e.id,E)}},E.createThreejsObjForMemData=function(t,e,n,i,a,l){if(0==t.length)return!1;for(var u=[],h=[],d=[],p=[],f=[],m=0;m<t.length;m++){var g=t[m];u=u.concat(g.mat.elements.slice(0,4)),h=h.concat(g.mat.elements.slice(4,8)),d=d.concat(g.mat.elements.slice(8,12)),p=p.concat(g.mat.elements.slice(12,16)),f.push(0)}var y=e.color,v=16777216==(4278190080&y);v&&(y=a);var x=[];if(x.push((255&y)/255,(y>>8&255)/255,(y>>16&255)/255),e.type==c.kLinesType){var b=new r.RawShaderMaterial({uniforms:{color:{value:x}},vertexShader:o.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:o.MxShader.FSHADER_COLOR_POINT_FORMXCAD,linewidth:1,transparent:!0,side:r.DoubleSide});(M=new r.InstancedBufferGeometry).maxInstancedCount=t.length,M.setAttribute("position",new r.Float32BufferAttribute(e.points,2)),M.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(u),4)),M.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(h),4)),M.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(d),4)),M.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(p),4)),M.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(f),1));var w=new r.LineSegments(M,b);w.frustumCulled=!1,w.renderOrder=s.MxData.iCADCurveRenderOrder,w.visible=!l,i.add(w),n.addEntity(e.id,w),v&&n.addColorByLayerMaterial(e.id,b)}else if(e.type==c.kTriangleType){var M;b=new r.RawShaderMaterial({uniforms:{color:{value:x}},vertexShader:o.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:o.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:r.DoubleSide}),(M=new r.InstancedBufferGeometry).maxInstancedCount=t.length,M.setAttribute("position",new r.Float32BufferAttribute(e.points,2)),M.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(u),4)),M.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(h),4)),M.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(d),4)),M.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(p),4)),M.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(f),1));var _=new r.Mesh(M,b);_.frustumCulled=!1,_.renderOrder=s.MxData.iCADMeshRenderOrder,_.visible=!l,i.add(_),n.addEntity(e.id,_),v&&n.addColorByLayerMaterial(e.id,b)}};var O=(P.prototype.upDisplayFromChage_memData=function(t){var e=this.database.getDisplayBlockTable().getBlockRecord(t.blockId);if(null==e)return!1;var n=this.database.getLayerTable().getColor(t.layerId),r=this.database.getLayerTable().isOff(t.layerId),i=e.getLayerTable().createLayerRecord(t.layerId),o=this.mxObj.getScene(),a=e.getInstances_class();i.deleteMemorySectionEntitys(t.id,o);var s=a.aryInstanceNoClip,l=a.mapInstanceClip;0<s.length&&T.createThreejsObjForMemData(s,t,i,o,n,r);for(var c=l.values(),u=c.next();!u.done;){var h=u.value;T.createThreejsObjForMemData_Clip(h,t,i,o,n,r,this.mxObj),u=c.next()}},P.prototype.upDisplayFromChage=function(t){for(var e=t.length,n=0;n<e;n++){var r=t[n];this.upDisplayFromChage_memData(r)}},P.prototype.OnMessageDisplayMemorySectionsFromChange=function(t){for(var e=this.database.getMemSections(),n=new a.MxCADNetData(t),r=n.getMxCADPointMemorySectionsHeadFromChange(),i=r.nOffset,o=[],s=0;s<r.datacount;s++){var l=n.getMxCADPointMemorySectionHeadFromChange(i);i=l.offset;var c=new d;c.layerId=l.layerId,c.blockId=l.blkId,c.id=l.memId,c.color=l.memColor,c.type=l.memType;var u=l.pointCount;if(!(u<1)){for(var h=[],p=0;p<u;p++){var f=t.getFloat32(i,!0);i+=4;var m=t.getFloat32(i,!0);i+=4,h.push(f,m)}c.points=h,e.add(c),o.push(c)}}this.upDisplayFromChage(o)},P.prototype.deleteMemorySectionAndEntity=function(t){var e=this.database.getMemSections(),n=e.get(t);if(!n)return!1;var r=this.database.getDisplayBlockTable().getBlockRecord(n.blockId);if(null==r)return e.remove(n.id),console.log("mx:blkrec null assert(0)"),!1;var i=r.getLayerTable().createLayerRecord(n.layerId),o=this.mxObj.getScene();return i.deleteMemorySectionEntitys(n.id,o),e.remove(n.id),!0},P.prototype.OnMessageDisplayNotUseMemorySectionsForChage=function(t){for(var e=new a.MxCADNetData(t).getMxCADNotUseMemorySectionsHeadForChage(),n=e.nCount,r=e.nOffset,i=0;i<n;i++){var o=t.getInt32(r,!0);r+=4,this.deleteMemorySectionAndEntity(o)}},P);function P(t){this.database=null,this.mxObj=null,this.database=t,this.mxObj=t.getMxObj()}n.MxCADSyncDisplay=O},{"../MxFun":34,"../MxManager":36,"../MxShader":40,"./MxCADNetData":23,three:19}],22:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADGripJig=n.MxCADGrip=n.MxCADGripData=void 0;var o=t("three"),a=t("../MxFun"),s=t("../MxThreeJS"),l=t("../Operate/MxJig"),c=t("../Operate/MxJigCmdManager"),u=t("../MxManager"),h=t("../MxDrawData"),d=function(){this.threeObject=null};n.MxCADGripData=d;var p=(f.prototype.getParentObject=function(){return this.mxObj.getTheTempDrawContainer()},f.prototype.removeAllEntity=function(){var t=this.getParentObject();this.mapGrips.forEach(function(e,n,r){for(var i=e.length,o=0;o<i;o++){var s=e[o];a.MxFun.removeThreejsObject(s.threeObject,t)}}),this.mapGrips=new Map},f.prototype.deleteGripData=function(t){var e=this.getParentObject(),n=this.mapGrips.get(t);if(n)for(var r=n.length,i=0;i<r;i++){var o=n[i];a.MxFun.removeThreejsObject(o.threeObject,e)}this.mapGrips.delete(t)},f.prototype.deleteEntityData=function(t){this.mapEntityData.delete(t)},f.prototype.addGripData=function(t,e,n,r){var i=this.mapGrips.get(t);null==i&&(i=new Array,this.mapGrips.set(t,i));var a=new d;return a.iIndex=e,a.point=new o.Vector3(n,r,0),i.push(a),a},f.prototype.createGripDisplayObject=function(t){var e=this.getParentObject();t.geometry=new o.Geometry;var n=this.mxObj.screenCoordLong2Doc(h.MxDrawData.m_dGridWidth/2);t.geometry.vertices.push(new o.Vector3(t.point.x-n,t.point.y-n,0)),t.geometry.vertices.push(new o.Vector3(t.point.x-n,t.point.y+n,0)),t.geometry.vertices.push(new o.Vector3(t.point.x+n,t.point.y+n,0)),t.geometry.vertices.push(new o.Vector3(t.point.x+n,t.point.y-n,0)),t.geometry.faces.push(new o.Face3(0,1,2)),t.geometry.faces.push(new o.Face3(2,3,0)),t.geometry.computeFaceNormals(),t.geometry.computeVertexNormals();var r=new o.MeshBasicMaterial({color:255,transparent:!0,depthTest:!1,side:o.DoubleSide,opacity:.9}),i=new o.Mesh(t.geometry,r);i.renderOrder=u.MxData.iGripRenderOrder,e.add(i),t.threeObject=i},f.prototype.clearAll=function(){return this.mapEntityData=new Map,0!=this.mapGrips.size&&(this.removeAllEntity(),!0)},f.prototype.addEntityData=function(t,e){this.mapEntityData.set(t,e)},f.prototype.onIntelliSelect=function(t){for(var e=JSON.parse(t),n=e.vecEntityData.length,r=0;r<n;r++){var i=e.vecEntityData[r],o=i.lIdIndex;this.addEntityData(o,i.entity),this.deleteGripData(o);for(var a=i.vecGrip.length,s=0;s<a;s++){var l=i.vecGrip[s],c=this.addGripData(o,l.iIndex,l.ptx,l.pty);this.createGripDisplayObject(c)}}},f.prototype.onControlsChage=function(){if(0!=this.mapGrips.size){var t=this.mxObj.screenCoordLong2Doc(8);this.mapGrips.forEach(function(e,n,r){for(var i=e.length,o=0;o<i;o++){var a=e[o];4==a.geometry.vertices.length&&(a.geometry.vertices[0].x=a.point.x-t,a.geometry.vertices[0].y=a.point.y-t,a.geometry.vertices[1].x=a.point.x-t,a.geometry.vertices[1].y=a.point.y+t,a.geometry.vertices[2].x=a.point.x+t,a.geometry.vertices[2].y=a.point.y+t,a.geometry.vertices[3].x=a.point.x+t,a.geometry.vertices[3].y=a.point.y-t,a.geometry.computeFaceNormals(),a.geometry.computeVertexNormals(),a.geometry.verticesNeedUpdate=!0)}})}},f.prototype.hitTest=function(t){var e={grips:new Array,ids:new Array,pt:t},n=new o.Vector3(t.x,t.y,0),r=this.mxObj.screenCoordLong2Doc(32);return this.mapGrips.forEach(function(t,i){for(var o=t.length,a=0;a<o;a++){var s=t[a];if(s.point.distanceTo(n)<=r){e.grips.push(s),e.ids.push(i);break}}}),e},f.prototype.onMouseLBDown=function(t){var e=this.hitTest(t);return 0!=e.grips.length&&(a.MxFun.sendStringToExecute("Mx_GripEdit",e),!0)},f.prototype.gripEditImp=function(t){var e=t.grips,n=t.ids,r=t.pt,i=new g(r,e,n,this.mapEntityData);i.setDisableDynInput(!0),i.setDisableOsnap(!0),c.MxJigCmdManager.runCmd(i)},f);function f(t){this.mxObj=null,this.mapGrips=new Map,this.mapEntityData=new Map,this.mxObj=t}n.MxCADGrip=p;var m,g=(i(y,m=l.McEdJigCommand),y.prototype.sampler=function(){var t=c.MxJigCmdManager.InType.kGetBegan,e=this.acquirePoint(t);return e.status==c.MxJigCmdManager.DragStatus.kNormal&&(this.currPt=e.pt),e.status},y.prototype.getTypeName=function(){return"MxGripEdit"},y.prototype.done=function(t){if(t==c.MxJigCmdManager.DragStatus.kNormal){var e=[];e.push(this.currPt.x,this.currPt.y);for(var n=this.getMxObject(),r=n.getMxCAD().getGrip(),i=n.getMxCAD().getSelect(),o=this.grips.length,a=0;a<o;a++){var s=this.grips[a],l=this.ids[a];e.push(l,s.iIndex),r.deleteGripData(l),r.deleteEntityData(l),i.removeAllEntity()}n.callCommand("MxCAD_GridEdit",JSON.stringify(e),function(t){r.onIntelliSelect(t)})}return c.MxJigCmdManager.DoneStatius.kExitCommand},y.prototype.upDisplay_Line=function(t,e){var n=new o.Vector3(t.pt1x,t.pt1y,0),r=new o.Vector3(t.pt2x,t.pt2y,0);if(0==e.iIndex)n.x=this.currPt.x,n.y=this.currPt.y;else if(1==e.iIndex)r.x=this.currPt.x,r.y=this.currPt.y;else if(2==e.iIndex){var i=r.x+.5*(n.x-r.x),a=r.y+.5*(n.y-r.y),l=this.currPt.x-i,c=this.currPt.y-a;n.x+=l,n.y+=c,r.x+=l,r.y+=c}var u=s.MxThreeJS.createLine(n,r,16777215);this.drawEntity(u,31)},y.prototype.upDisplay=function(){for(var t=this.grips.length,e=0;e<t;e++){var n=this.grips[e],r=this.ids[e],i=this.mapEntityData.get(r);i&&"McDbLine"==i.name&&this.upDisplay_Line(i,n)}},y);function y(t,e,n,r){var i=m.call(this)||this;return i.pt=t,i.grips=e,i.ids=n,i.currPt=t,i.mapEntityData=r,i}n.MxCADGripJig=g},{"../MxDrawData":29,"../MxFun":34,"../MxManager":36,"../MxThreeJS":44,"../Operate/MxJig":57,"../Operate/MxJigCmdManager":58,three:19}],23:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADNetData=void 0;var r=(i.prototype.getBlobHead=function(t){var e={};return e.type=this._dataView.getInt32(t,!0),t+=4,e.ver=this._dataView.getInt32(t,!0),t+=4,e.databaseIndex=this._dataView.getInt32(t,!0),t+=4,e.nOffset=t,e},i.prototype.getMxCADPointMemorySectionsHead=function(){var t=this.getBlobHead(0);return t.zeroLayerIdIndex=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datacount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},i.prototype.getMxCADPointMemorySectionsHeadFromChange=function(){var t=this.getBlobHead(0);return t.zeroLayerIdIndex=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datacount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},i.prototype.getMxCADPointMemorySectionHead=function(t){var e=this.getBlobHead(t);return t=e.nOffset,e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.memColor=this._dataView.getInt32(t,!0),t+=4,e.memId=this._dataView.getInt32(t,!0),t+=4,e.memType=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},i.prototype.getMxCADPointMemorySectionHeadFromChange=function(t){var e=this.getBlobHead(t);return t=e.nOffset,e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.memColor=this._dataView.getInt32(t,!0),t+=4,e.memId=this._dataView.getInt32(t,!0),t+=4,e.memType=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},i.prototype.getMxCADBlockRefsHead=function(){var t=this.getBlobHead(0);return t.nBlockRefCount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},i.prototype.getMxCADNotUseMemorySectionsHeadForChage=function(){var t=this.getBlobHead(0);return t.nCount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},i.prototype.getEntityDisplayDatasHead=function(){var t=this.getBlobHead(0);return t.nCount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},i.prototype.getEntityDisplayDataHead=function(t){var e=this.getBlobHead(t);return e.nCount=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.type=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize!=e.nOffset-t&&console.log("mx: sectionshead size assert(0)"),e},i);function i(t){this._dataView=t}n.MxCADNetData=r},{}],24:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADObject=void 0;var r=t("./MxCADEditDisplay"),i=t("./MxCADOpenDisplay"),o=t("./MxCADSelect"),a=t("./MxCADGrip"),s=(l.prototype.reInit=function(){this.openDisplay.reInit(),this.databsae.reInit(),this.mxObj.reInit()},l.prototype.getSelect=function(){return this.select},l.prototype.getGrip=function(){return this.grip},l.prototype.newFile=function(){this.reInit(),this.openFile("")},l.prototype.undo=function(){this.mxObj.undo()},l.prototype.openFile=function(t,e){var n=this;this.reInit(),this._openFile=t,this.mxObj.callCommand("MxCAD_OpenFile",JSON.stringify({file:t}),function(t){n.mxObj.callCommand("MxCAD_SendDisplay"),"string"!=typeof t||t.length<1?e&&e({}):e&&e(JSON.parse(t))})},l.prototype.saveFile=function(t,e){this.mxObj.callCommand("MxCAD_SaveFile",JSON.stringify({file:t}),function(t){e(JSON.parse(t))})},l.prototype.getDisplayFromServer=function(){this.reInit(),this.mxObj.callCommand("MxCAD_SendDisplay")},l.prototype.getFileName=function(){return this._openFile},l.prototype.getDatabase=function(){return this.databsae},l.prototype.getOpenDisplay=function(){return this.openDisplay},l.prototype.getSyncDisplay=function(){return this.syncDisplay},l.prototype.getAllLayerData=function(){return this.databsae.getLayerTable().getAllLayerData()},l);function l(t){this._openFile="",this.mxObj=null,this.databsae=null,this.openDisplay=null,this.syncDisplay=null,this.select=null,this.grip=null,this.mxObj=t,this.databsae=new r.MxCADDatabase(t),this.openDisplay=new i.MxCADOpenDisplay(this.databsae),this.syncDisplay=new r.MxCADSyncDisplay(this.databsae),this.select=new o.MxCADSelect(t),this.grip=new a.MxCADGrip(t)}n.MxCADObject=s},{"./MxCADEditDisplay":21,"./MxCADGrip":22,"./MxCADOpenDisplay":25,"./MxCADSelect":26}],25:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADOpenDisplay=void 0;var r=t("three"),i=t("./MxCADNetData"),o=t("./MxCADEditDisplay"),a=(s.prototype.createAllInstanceCall=function(t,e,n,i,a){if(!i.get(t.getId())){i.set(t.getId(),!0);var s=new o.MxCADDisplayBlockInstance;if(s.mat=new r.Matrix4,s.mat.copy(n),s.idBlkRef=e.id,s.mat.multiply(e.mat),0==e.clipPlans.clipPlanArray.length)s.clipPlans=a;else{s.clipPlans=e.clipPlans;for(var l=s.clipPlans.clipPlanArray.length,c=0;c<l;c++){var u=new r.Vector3(s.clipPlans.clipPlanArray[c].x1,s.clipPlans.clipPlanArray[c].y1,0),h=new r.Vector3(s.clipPlans.clipPlanArray[c].x2,s.clipPlans.clipPlanArray[c].y2,0);u.applyMatrix4(s.mat),h.applyMatrix4(s.mat),s.clipPlans.clipPlanArray[c].x1=u.x,s.clipPlans.clipPlanArray[c].y1=u.y,s.clipPlans.clipPlanArray[c].x2=h.x,s.clipPlans.clipPlanArray[c].y2=h.y}}t.addInstance(s);for(var d=this.database.getDisplayBlockTable(),p=t.getAllBlkRef().values(),f=p.next();!f.done;){var m=f.value;if(0!=m.blkRecId){var g=d.getBlockRecord(m.blkRecId);null!=g&&(this.createAllInstanceCall(g,m,s.mat,i,s.clipPlans),f=p.next())}}i.set(t.getId(),!1)}},s.prototype.deleteAllInstance=function(){for(var t=this.database.getDisplayBlockTable().getAllBlockRecord().values(),e=t.next();!e.done;)e.value.deleteAllInstance(),e=t.next()},s.prototype.createAllInstance=function(){this.deleteAllInstance();var t=this.database.getDisplayBlockTable().getBlockRecord(0);if(null==t)return!1;var e=this.database.getDisplayRootBlockRef(),n=new r.Matrix4,i=new Map,a=new o.MxCADDisplayClipPlans;return this.createAllInstanceCall(t,e,n,i,a),this.isCreateInstance=!0},s.prototype.creteDisplayForMemData=function(t){var e=this.database.getDisplayBlockTable().getBlockRecord(t.blockId);if(null==e)return!1;var n=e.getLayerTable().createLayerRecord(t.layerId),r=this.database.getLayerTable().getColor(t.layerId),i=this.database.getLayerTable().isOff(t.layerId),a=this.mxObj.getScene(),s=e.getInstances_class(),l=s.aryInstanceNoClip,c=s.mapInstanceClip;0<l.length&&o.MxCADDisplayFun.createThreejsObjForMemData(l,t,n,a,r,i);for(var u=c.values(),h=u.next();!h.done;){var d=h.value;o.MxCADDisplayFun.createThreejsObjForMemData_Clip(d,t,n,a,r,i,this.mxObj),h=u.next()}},s.prototype.creteDisplayForNewData=function(){if(this.isCreateInstance||this.isGetDisplayBlockRef&&this.isGetLayerTable&&this.createAllInstance(),this.isCreateInstance){for(var t=this.vecNewCreateDisplayData.length,e=0;e<t;e++){var n=this.vecNewCreateDisplayData[e];this.creteDisplayForMemData(n)}this.vecNewCreateDisplayData=[]}},s.prototype.reInit=function(){this.isGetDisplayBlockRef=!1,this.isCreateInstance=!1,this.isGetLayerTable=!1,this.vecNewCreateDisplayData=[]},s.prototype.getMxOb=function(){return this.mxObj},s.prototype.OnMessageLayerData=function(t){var e=this.database.getLayerTable(),n=JSON.parse(t);if(null!=n){var r=n.list;for(var i in r)e.add(r[i].id,r[i].colorvalue,r[i].name,1==r[i].off),1==r[i].zerolayer&&e.setZeroLayerId(r[i].id)}this.isGetLayerTable=!0,this.creteDisplayForNewData()},s.prototype.OnMessageDisplayBlockRef=function(t){var e=this.database.getDisplayBlockTable();e.reInitData(),this.isCreateInstance=!1;for(var n=new i.MxCADNetData(t).getMxCADBlockRefsHead(),a=n.nBlockRefCount,s=n.nOffset,l=1,c=0;c<a;c++){var u=t.getInt32(s,!0);s+=4;var h=t.getInt32(s,!0);s+=4;var d=t.getInt32(s,!0);s+=4;var p=t.getInt32(s,!0);s+=4;var f=t.getInt32(s,!0);s+=4;for(var m=new Array,g=0;g<16;g++){var y=t.getFloat32(s,!0);s+=4,m.push(y)}var v=t.getInt32(s,!0);s+=4;var x=new o.MxCADDisplayClipPlans;x.id=l,l++,x.clipPlanArray=[];for(var b=0;b<v;b++){var w=t.getFloat32(s,!0);s+=4;var M=t.getFloat32(s,!0);s+=4;var _=t.getFloat32(s,!0);s+=4;var C=t.getFloat32(s,!0);s+=4;var S=new o.MxCADDisplayClipPlan;S.x1=w,S.y1=M,S.x2=_,S.y2=C,x.clipPlanArray.push(S)}var T=new o.MxCADDisplayBlockRef;T.mat=new r.Matrix4,T.mat.fromArray(m),T.blkRecId=p,T.blkOwnerId=h,T.layerId=d,T.color=f,T.clipPlans=x,T.id=u,e.crateBlockRecord(p),e.crateBlockRecord(h);var E=e.getBlockRecord(h);E?E.addBlkRef(T):console.log("ownerBlkRec == null,assert(0)")}this.isGetDisplayBlockRef=!0,this.creteDisplayForNewData()},s.prototype.OnMessageDisplayMemorySections=function(t){for(var e=this.database.getMemSections(),n=new i.MxCADNetData(t),r=n.getMxCADPointMemorySectionsHead(),a=r.nOffset,s=0;s<r.datacount;s++){var l=n.getMxCADPointMemorySectionHead(a);a=l.offset;var c=new o.MxCADDisplayMemorySection;c.layerId=l.layerId,c.blockId=l.blkId,c.id=l.memId,c.color=l.memColor,c.type=l.memType;var u=l.pointCount;if(!(u<1)){for(var h=[],d=0;d<u;d++){var p=t.getFloat32(a,!0);a+=4;var f=t.getFloat32(a,!0);a+=4,h.push(p,f)}c.points=h,e.add(c),this.vecNewCreateDisplayData.push(c)}}this.creteDisplayForNewData()},s);function s(t){this.database=null,this.isGetDisplayBlockRef=!1,this.isCreateInstance=!1,this.isGetLayerTable=!1,this.vecNewCreateDisplayData=[],this.mxObj=null,this.database=t,this.mxObj=t.getMxObj()}n.MxCADOpenDisplay=a},{"./MxCADEditDisplay":21,"./MxCADNetData":23,three:19}],26:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADSelect=n.MxCADSelectDisplayEntityData=n.MxCADSelectDisplayEntityDataType=void 0;var r,i,o=t("three"),a=t("../MxFun"),s=t("three.meshline"),l=t("./MxCADNetData"),c=t("../MxManager");(i=r=n.MxCADSelectDisplayEntityDataType||(n.MxCADSelectDisplayEntityDataType={}))[i.kLinesType=1]="kLinesType",i[i.kTriangleType=2]="kTriangleType";var u=function(){this.type=r.kLinesType,this.points=[]};n.MxCADSelectDisplayEntityData=u;var h=(d.prototype.getParentObject=function(){return this.mxObj.getScene()},d.prototype.removeAllEntity=function(){for(var t=this.getParentObject(),e=this.aryThreeObject.length,n=0;n<e;n++)a.MxFun.removeThreejsObject(this.aryThreeObject[n],t);this.aryThreeObject=[]},d.prototype.clearAllSelect=function(t){return void 0===t&&(t=!0),t&&this.mxObj.callCommand("MxCAD_ClearSelect"),0!=this.aryThreeObject.length&&(this.removeAllEntity(),!0)},d.prototype.OnMessageEntityDisplayDatas=function(t){for(var e=new l.MxCADNetData(t),n=e.getEntityDisplayDatasHead(),i=n.nOffset,a=[],h=0;h<n.nCount;h++){var d=e.getEntityDisplayDataHead(i);i=d.nOffset,(_=new u).type=d.type;var p=d.nCount;if(!(p<1)){for(var f=[],m=0;m<p;m+=2){var g=t.getFloat32(i,!0);i+=4;var y=t.getFloat32(i,!0);i+=4,f.push(g,y)}_.points=f,a.push(_)}}var v=this.mxObj.getViewWidth(),x=this.mxObj.getViewHeight();this.material.resolution=new o.Vector2(v,x);for(var b=a.length,w=this.getParentObject(),M=0;M<b;M++){var _;if((_=a[M]).type==r.kLinesType)for(var C=_.points.length,S=0;S+3<C;S+=4){var T=new Float32Array(6);T[0]=_.points[S],T[1]=_.points[S+1],T[2]=0,T[3]=_.points[S+2],T[4]=_.points[S+3],T[5]=0;var E=new s.MeshLine;E.setGeometry(T);var D=new o.Mesh(E.geometry,this.material);D.renderOrder=c.MxData.iSelectRenderOrder,w.add(D),this.aryThreeObject.push(D)}else if(_.type==r.kTriangleType){C=_.points.length;var A=new o.Geometry,O=0;for(S=0;S+5<C;S+=6){var P=new o.Vector3(_.points[S],_.points[S+1],0),L=new o.Vector3(_.points[S+2],_.points[S+3],0),R=new o.Vector3(_.points[S+4],_.points[S+5],0);A.vertices.push(P),A.vertices.push(L),A.vertices.push(R);var I=new o.Face3(O,O+1,O+2);A.faces.push(I),O+=3}var k=new o.Mesh(A,this.materialFill);k.renderOrder=c.MxData.iSelectRenderOrder,w.add(k),this.aryThreeObject.push(k)}}},d);function d(t){this.aryThreeObject=[],this.mxObj=null,this.material=new s.MeshLineMaterial({useMap:!1,color:new o.Color(2641557),opacity:1,resolution:new o.Vector2(500,500),sizeAttenuation:!1,lineWidth:10,transparent:!0,depthTest:!1}),this.materialFill=new o.MeshBasicMaterial({color:new o.Color(2641557),opacity:.8,side:o.DoubleSide,transparent:!0,depthTest:!1}),this.mxObj=t}n.MxCADSelect=h},{"../MxFun":34,"../MxManager":36,"./MxCADNetData":23,three:19,"three.meshline":18}],27:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCadSketchLayers=n.MxCadSketchLayer=void 0;var r=(i.prototype.addEntity=function(t){this._setEntityId.add(t)},i.prototype.getId=function(){return this.id},i.prototype.setId=function(t){this.id=t},i.prototype.removeEntity=function(t){this._setEntityId.delete(t)},i.prototype.show=function(t){var e=this;this._setEntityId.forEach(function(n){var r=e._mxobj.getEntity(n);if(null!=r)for(var i=0,o=r.length;i<o;i++)r[i].visible=t})},i);function i(t){this._setEntityId=new Set,this.id=0,this._mxobj=null,this._mxobj=t}n.MxCadSketchLayer=r;var o=(a.prototype.getLayer=function(t,e){var n=this._mapId2Layers.get(t);return null==n&&((n=new r(this._mxobj)).setId(t),this._mapId2Layers.set(t,n)),n},a.prototype.addEntity=function(t,e){this.getLayer(e).addEntity(t)},a.prototype.removeEntity=function(t){this._mapId2Layers.forEach(function(e){e.removeEntity(t)})},a.prototype.removeAllEntity=function(){this._mapId2Layers.clear()},a);function a(t){this._mxobj=null,this._mapId2Layers=new Map,this._mxobj=t}n.MxCadSketchLayers=o},{}],28:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawCommands=void 0;var r=t("./MxFun"),i=t("./MxType"),o=t("./Operate/MxIntelliSelect"),a=t("./Operate/MxJigCmdManager"),s=t("./MxWindowsEvent"),l=t("./MxDrawData");function c(t){if(null!=t&&null!=t.pt1){var e=new o.MxIntelliSelectJig(t.pt1,!1);e.setDisableDynInput(!0),e.setDisableOsnap(!0);var n=t.pt1,i=r.MxFun.getCurrentMx();if(!l.MxDrawData.m_isMultipleSelect){var c=i.getMxCAD();c.getSelect().clearAllSelect(),c.getGrip().clearAll(),i.getMcObject().isValid()&&i.getMcObject().getGripManager().clearAll()}e.doPointSelect(r.MxFun.getCurrentMx(),t.pt1,function(t){if(0!=JSON.parse(t).lCount&&(i.getMxCAD().getGrip().onIntelliSelect(t),l.MxDrawData.m_isMultipleSelect)){var e=s.MxWindowsEvent.getCurrentMousePostion();if(i.screenCoord2Doc(e.x,e.y,0).distanceTo(n)<i.screenCoordLong2Doc(10)){var r=a.MxJigCmdManager.getCurCmd();r&&"MxIntelliSelect"==r.getTypeName()&&a.MxJigCmdManager.stopCmd()}}}),l.MxDrawData.m_isMultipleSelect&&a.MxJigCmdManager.runCmd(e)}}function u(t){null!=t&&null!=t.grips&&null!=t.ids&&r.MxFun.getCurrentMx().getMxCAD().getGrip().gripEditImp(t)}function h(t){null!=t&&null!=t.grips&&null!=t.ids&&r.MxFun.getCurrentMx().getMcObject().getGripManager().gripEditImp(t)}function d(t){if(null!=t&&null!=t.pt){var e=r.MxFun.getCurrentMx(),n=t.pt;if(!e.getMxDatabase().getGripManager().doPointSelect(n)){var i=!0;if(e.isValidMcObject()&&e.getMcObject().getGripManager().doPointSelect(n)&&(i=!1),i&&l.MxDrawData.m_isMultipleSelect){var s=e.screenCoord2Doc(n.x,n.y,0),c=new o.MxIntelliSelectJig(s,!0);c.setDisableDynInput(!0),c.setDisableOsnap(!0),a.MxJigCmdManager.runCmd(c)}}}}function p(t){null!=t&&null!=t.grips&&null!=t.ents&&r.MxFun.getCurrentMx().getMxDatabase().getGripManager().gripEditImp(t)}(n.MxDrawCommands||(n.MxDrawCommands={})).registerCommand=function(){r.MxFun.addCommand("Mx_IntelliSel",c,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),r.MxFun.addCommand("Mx_GripEdit",u,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),r.MxFun.addCommand("McDraw_GripEdit",h,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),r.MxFun.addCommand("Mx_FrontEndWebpageIntelliSel",d,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),r.MxFun.addCommand("Mx_FrontEndWebpageGripEdit",p,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT)}},{"./MxDrawData":29,"./MxFun":34,"./MxType":46,"./MxWindowsEvent":48,"./Operate/MxIntelliSelect":56,"./Operate/MxJigCmdManager":58}],29:[function(t,e,n){var r;Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawData=void 0,(r=n.MxDrawData||(n.MxDrawData={})).m_isEnableIntelliSelect=!1,r.m_isEnableGripEidt=!0,r.m_isMultipleSelect=!0,r.m_isAutoResetRenderer=!1,r.m_isCorrectLargeCoordinates=!1,r.m_isRequestHeaderCacheControl=!1,r.m_dGridWidth=16,r.getCursorWidthPixels=function(){return 16},r.setIniset=function(t){void 0!==t.EnableIntelliSelect&&"boolean"==typeof t.EnableIntelliSelect&&(r.m_isEnableIntelliSelect=t.EnableIntelliSelect),void 0!==t.EnableGripEidt&&"boolean"==typeof t.EnableGripEidt&&(r.m_isEnableGripEidt=t.EnableGripEidt),void 0!==t.multipleSelect&&"boolean"==typeof t.multipleSelect&&(r.m_isMultipleSelect=t.multipleSelect),void 0!==t.autoResetRenderer&&"boolean"==typeof t.autoResetRenderer&&(r.m_isAutoResetRenderer=t.autoResetRenderer),void 0!==t.correctLargeCoordinates&&"boolean"==typeof t.autoResetRenderer&&(r.m_isCorrectLargeCoordinates=t.correctLargeCoordinates),void 0!==t.requestHeaderCacheControl&&"boolean"==typeof t.requestHeaderCacheControl&&(r.m_isRequestHeaderCacheControl=t.requestHeaderCacheControl)}},{}],30:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject=n.IniSetName=n.MxRunMode=void 0;var r,i,o,a=t("three"),s=t("./MxFun"),l=t("./MxCAD/MxCadSketchLayer"),c=t("./View/MxBrowseLayerData"),u=t("./View/MxBrowseDisplay"),h=t("./MxNetData"),d=t("./MxNetData"),p=t("./MxSelect"),f=t("./MxManager"),m=t("./MxSystemVariable"),g=t("./MxCAD/MxCADObject"),y=t("./MxLocalFileLoad"),v=t("./Operate/MxDrawObjectOsnap"),x=t("./View/MxDbDatabase"),b=t("./View/MxDrawMapBox"),w=t("./MxDrawObjectEvent"),M=t("./View/MxDbEntityGrip"),_=t("./cpp/McDrawObject");(i=r=n.MxRunMode||(n.MxRunMode={}))[i.kBrowse=1]="kBrowse",i[i.kMxCAD=2]="kMxCAD",i[i.kMxCADBrowseApp=3]="kMxCADBrowseApp",i[i.kCPPMxCAD=4]="kCPPMxCAD",(o=n.IniSetName||(n.IniSetName={})).kEnableOsnapFunction="EnableOsnapFunction";var C=(S.prototype.getMcObject=function(){return this.mcObject},S.prototype.isValidMcObject=function(){return this.mcObject.isValid()},S.prototype.getId=function(){return this.id},S.prototype.getEventManager=function(){return this.eventManager},S.prototype.setCurrentLoadUrl=function(t){this._sCurrentLoadURL=t},S.prototype.getCurrentLoadUrl=function(){return this._sCurrentLoadURL},S.prototype.isWebgl2=function(){return!(!this._rendererParam||"webgl2"!=this._rendererParam.retver)},S.prototype.getMxDatabase=function(){return this.m_mxDatabase},S.prototype.updateCanvasSize=function(){this._onResizeFun&&this._onResizeFun()},S.prototype.mapBoxRender=function(t,e){this.camera.projectionMatrix=e,this.renderer.state.reset(),this.renderer.render(this.scene,this.camera)},S.prototype.mapBoxInitThreeJSObject=function(t,e,n){this.scene=t,this.camera=e,this.renderer=n},S.prototype.addMxEntity=function(t){return this.m_mxDatabase.addMxEntity(t)},S.prototype.getMxEntity=function(t){return this.m_mxDatabase.getEntity(t)},S.prototype.getMxEntityUserObject=function(t){var e=this.getMxEntity(t);return e?e.getUserObject():null},S.prototype.eraseAllMxEntity=function(){this.m_mxDatabase.eraseAllEntity()},S.prototype.eraseMxEntity=function(t){var e=this.m_mxDatabase.getEntity(t);return!!e&&e.erase()},S.prototype.getAllMxEntity=function(){var t=[];return this.m_mxDatabase.getAllEntity().forEach(function(e){e&&t.push(e.getUserObject())}),t},S.prototype.getMxAllSelect=function(){var t=this.m_mxDatabase.getSelectManager().getAllSelect(),e=this.m_mxDatabase.getGripManager().getAllSelect(),n=new Set;return t.forEach(function(t){n.add(t)}),e.forEach(function(e){n.has(e)||t.push(e)}),t},S.prototype.getPrvCommandSelect=function(){return this.m_mxDatabase.getSelectManager().getPrvCommandSelect()},S.prototype.addMxCurrentSelect=function(t){this.m_mxDatabase.getGripManager().addSelect(t)},S.prototype.clearMxCurrentSelect=function(){var t=this.m_mxDatabase.clearMxCurrentSelect();if(this._mxCAD){var e=this._mxCAD.getSelect().clearAllSelect(),n=this._mxCAD.getGrip().clearAll();(e||n)&&(t=!0)}return this.mcObject.isValid()&&this.mcObject.getGripManager().clearAll(),t},S.prototype.addViewObject=function(t){this.secenView?this.threejsselectObjectsView.add(t):console.log("this.secenView is null")},S.prototype.removeViewObject=function(t){s.MxFun.removeThreejsObject(t,this.threejsselectObjectsView)},S.prototype.setOtherRefFile=function(t){this._tzDwgStaticFile=t},S.prototype.setRequestHeader=function(t){this._requestHeader=t},S.prototype.initZoomW=function(t,e){this._initZoomwCoordPt1=t.clone(),this._initZoomWCoordPt2=e.clone()},S.prototype.getMxCAD=function(){return this._mxCAD},S.prototype.setMouseRightRotate=function(t){this._mouseRightRotate=t,null!=this.controls&&(this.controls.mouseButtons.RIGHT=t?a.MOUSE.ROTATE:a.MOUSE.PAN)},S.prototype.setZoomSpeed=function(t){var e=this.controls.zoomSpeed;return this.controls.zoomSpeed=t,e},S.prototype.resetRenderer=function(){this.renderer.info.reset()},S.prototype.setMouseMiddlePan=function(t){this._isMouseMiddlePan="boolean"==typeof t?t?1:0:t,null!=this.controls&&(1==this._isMouseMiddlePan?(this.controls.mouseButtons.LEFT=-1,this.controls.mouseButtons.RIGHT=-1,this.controls.mouseButtons.MIDDLE=a.MOUSE.PAN):2==this._isMouseMiddlePan?(this.controls.mouseButtons.LEFT=a.MOUSE.PAN,this.controls.mouseButtons.RIGHT=-1,this.controls.mouseButtons.MIDDLE=a.MOUSE.PAN):(this.controls.mouseButtons.LEFT=a.MOUSE.PAN,this._mouseRightRotate?this.controls.mouseButtons.RIGHT=a.MOUSE.ROTATE:this.controls.mouseButtons.RIGHT=a.MOUSE.PAN,this.controls.mouseButtons.MIDDLE=1))},S.prototype.resetThreeJSControls=function(){this.controls&&(this.controls.saveState(),this.controls.reset())},S.prototype.enableZoom=function(t){null!=this.controls&&(this.controls.enableZoom=t)},S.prototype.enablePan=function(t){null!=this.controls&&(this.controls.enablePan=t)},S.prototype.getOrbitControls=function(){return this.controls},S.prototype.enableViewControls=function(t){this.controls.enabled=t},S.prototype.initRunMode=function(t){this._isCreate?console.log("iniRunMode failed,mxobject already created"):this._runMode=t},S.prototype.getRunMode=function(){return this._runMode},S.prototype.setStaticLocalLoad=function(t){this._isStaticLocalLoad=t},S.prototype.isStaticLocalLoad=function(){return this._isStaticLocalLoad},S.prototype.setStaticLocalLoadPath=function(t){this._staticLocalLoadPath=t},S.prototype.addEvent=function(t,e){this._event[t]=e},S.prototype.removeEvent=function(t){this._event[t]=void 0},S.prototype.getEvent=function(){return this._event},S.prototype.sysVariable=function(){return this.m_sysVariable},S.prototype.setIniset=function(t){this.m_iniSet=t},S.prototype.getInisetValue=function(t){return this.m_iniSet[t]},S.prototype.getViewColor=function(){return this._viewcolor},S.prototype.isWhiteViewColor=function(){return 16777215==this._viewcolor},S.prototype.initUserLoginData=function(t,e){this._userIdentitySign=t,this._userRandomToken=e},S.prototype.initRendererParam=function(t){this._rendererParam=t},S.prototype.automaticInversionColor=function(t){return 16777215!=this._viewcolor||16777215!=t?t:0},S.prototype.automaticInversionColor2=function(t){return 16777215==this._viewcolor&&16777215==(16777215&t)?4278190080&t:t},S.prototype.setViewColor=function(t){this._viewcolor=t,null!=this.scene&&(this.scene.background=new a.Color(t))},S.prototype.getViewAngle=function(){return this._viewangle},S.prototype.callInitCompleteEvent=function(){null!=this._event.loadComplete&&this._event.loadComplete()},S.prototype.callInitObjectEvent=function(){null!=this._event.initObject&&this._event.initObject()},S.prototype.callOpenFileComplete=function(t){null!=this._event.openFileComplete&&this._event.openFileComplete(t)},S.prototype.hasEvent=function(t){return null!=this._event[t]},S.prototype.callEvent=function(t,e){return null!=this._event[t]&&this._event[t](e)},S.prototype.userLoginResult=function(t){null!=this._event.userLoginResult&&this._event.userLoginResult(t)},S.prototype.serverReturn=function(t){var e=JSON.parse(t);null!=this._event.serverReturn&&this._event.serverReturn(e)},S.prototype.openFileResult=function(t){JSON.parse(t).linkServer||console.log("link mx serverobj error"),null!=this._event.openFileResult&&this._event.openFileResult(t)},S.prototype.xzSize=function(t){var e=this._devicePixelRatio;if(e-1<=1e-4&&-1e-4<=e-1)return t;for(var n=9999999,r=t,i=0,o=t;i<100;i++){if((s=(a=o*e)-Math.floor(a))<=.001)return o;s<n&&(n=s,r=o),o+=1}for(o=t;i<100;i++){var a,s;if((s=(a=o*e)-Math.floor(a))<=.001)return o;s<n&&(n=s,r=o),--o}return r},S.prototype.setSize=function(t,e){this._viewWidth=t,this._viewHeight=e,null!=this._userCanvas&&(this._userCanvas.width=t,this._userCanvas.height=e,this._userCanvas.style.width=t+"px",this._userCanvas.style.height=e+"px"),this.onResizeImp(),this.updateDisplay()},S.prototype.getCurrentColor=function(){return this._color},S.prototype.setCurrentColor=function(t){this._color=t},S.prototype.getSelect=function(){return this._select},S.prototype.call=function(t,e,n){this._net.getSend().CallServerJS(t,e,n)},S.prototype.zoomAll=function(){this._is2d&&this.call("getDatabaseBoundHelp",'{"isBackground":1}',function(t){if(0!=t.length){var e=JSON.parse(t);this.zoomW(new a.Vector3(e[0],e[1],0),new a.Vector3(e[2],e[3],0))}})},S.prototype.tempDisableSelect=function(t){this._select.tmpDisable=t},S.prototype.getViewCenterDocCoord=function(){return null!=this._userCanvas?this.screenCoord2Doc(.5*this._userCanvas.clientWidth,.5*this._userCanvas.clientHeight,0):this.screenCoord2Doc(.5*this._viewWidth,.5*this._viewHeight,0)},S.prototype.closeWebSocket=function(){this._net.closeWebSocket()},S.prototype.findMxEntityAtPoint=function(t,e,n){!e&&void 0!==e||(t=this.docCoord2Screen(t.x,t.y,0));var r=[],i=this.m_mxDatabase.getIntersectObjects(t);if(0==i.length)return r;var o=new Map;return i.forEach(function(t){var e=(0,M.MxGetMxDbEntitForThreeJsObject)(t.object);if(e){var r=e.objectId();if(!o.has(r)){if(n){var i=(0,M.MxGetWordDrawxDataForThreeJsObject)(t.object);i&&n(r,i)}o.set(r,e.getUserObject())}}}),o.forEach(function(t){r.push(t)}),r},S.prototype.isMxCAD=function(){return this._runMode==r.kMxCAD},S.prototype.onLoad=function(t){if(this._runMode==r.kCPPMxCAD)this.callInitCompleteEvent();else if(this._isStaticLocalLoad)this._net=new d.MxNet,this._net.init(this,!1),0<this._openFile.length&&(this._staticLocalNet=new y.MxLocalDwgFileLoad(this._net),this._staticLocalNet.load(encodeURIComponent(this._staticLocalLoadPath),encodeURIComponent(this._openFile)));else{this._net=new d.MxNet;var e=!0;if(this._runMode==r.kMxCAD?e=!0:(e=!s.MxFun.isStaticLoad(),this._is2d||(e=!0)),"wgh"==this._openFile.substring(this._openFile.lastIndexOf(".")+1).toLowerCase()&&(e=!1),0<this._staticLoadingOpenFiles.length&&(e=!1),this._net.init(this,e),!e&&(this._staticNet=new d.MxHFileLoad(this._net),this._staticNet.setRequestHeader(this._requestHeader),this._staticNet.setUrlParam(t),this._staticNet.load(this._openFile,this._staticLoadingOpenFiles),this._tzDwgStaticFile&&0<this._tzDwgStaticFile.length)){var n=new d.MxNet;n.init(this,!1),this._extRefManager.createTzDwgExternalReferences(99999),n.setCurrentDatabaseId(99999),this._staticLoadTzNet=new d.MxHFileLoad(n),this._staticLoadTzNet.setShowloading(!1),this._staticLoadTzNet.setRequestHeader(this._requestHeader),this._staticLoadTzNet.load(this._tzDwgStaticFile,[])}}},S.prototype.stopAllLoading=function(){this._staticNet&&this._staticNet.stopAllLoading()},S.prototype.getStaticNet=function(){return this._staticNet},S.prototype.isStaticFileNet=function(){return!this._isStaticLocalLoad&&null!=this._staticNet},S.prototype.getStaticLocalNet=function(){return this._staticLocalNet},S.prototype.getStaticLoadTzNet=function(){return this._staticLoadTzNet},S.prototype.getViewWidth=function(){return null!=this._userCanvas?this._userCanvas.clientWidth:this._viewWidth},S.prototype.getViewHeight=function(){return null!=this._userCanvas?this._userCanvas.clientHeight:this._viewHeight},S.prototype.makeCurrent=function(){f.MxManager.setCurrentMx(this)},S.prototype.createCanvasImageData=function(t,e){var n=this,r=0,i=0,o=!1;e&&e.width&&e.height&&(r=this.getViewWidth(),i=this.getViewHeight(),o=!0,this.setSize(e.width,e.height)),this._callCreateCanvasImageData=function(e){o&&n.setSize(r,i),t(e)},this.updateDisplay()},S.prototype.getIntersectObjects=function(t){var e=new a.Raycaster;e.linePrecision=this.screenCoordLong2Doc(4);var n=this.getCanvas(),r=n.clientWidth,i=n.clientHeight;return t=new a.Vector2(t.x/r*2-1,-t.y/i*2+1),e.setFromCamera(t,this.camera),e.intersectObjects(this.threejsselectObjects.children,!0)},S.prototype.addObject=function(t){this.threejsselectObjects.add(t)},S.prototype.removeAllSelectObject=function(){for(;this.threejsselectObjects.children.length;)this.threejsselectObjects.remove(this.threejsselectObjects.children[0])},S.prototype.removeObject=function(t){this.threejsselectObjects.remove(t)},S.prototype.render=function(){this.secenView?(this.mcObject.updateDisplay()?(this.renderer.autoClear=!1,this.renderer.state.reset()):this.renderer.autoClear=!0,this.renderer.render(this.secenView,this.cameraView),this.renderer.autoClear=!1):this.mcObject.updateDisplay()?(this.renderer.autoClear=!1,this.renderer.state.reset()):this.renderer.autoClear=!0,this.renderer.render(this.scene,this.camera),null!=this._callCreateCanvasImageData&&(this._callCreateCanvasImageData(this.renderer.domElement.toDataURL("image/png")),this._callCreateCanvasImageData=void 0),this.callEvent("render",this.renderer)},S.prototype.updateDisplay=function(t){void 0===t&&(t=!1),this.mxdrawThreeJS.updateDisplay(t)},S.prototype.updateDisplayImplement=function(t){function e(){n.m_mxDatabase.upDirtyDisplay(),n._isAnimation?(n._isAnimationStarting=!0,requestAnimationFrame(this.needRander)):n._isWaiteCount=0,n.render()}void 0===t&&(t=!1);var n=this;!0!==t?this._isAnimationStarting||(this._isAnimation?requestAnimationFrame(e):((5<this._isWaiteCount||this._isWaiteCount<0)&&(this._isWaiteCount=0),this._isWaiteCount<=0&&requestAnimationFrame(e),this._isWaiteCount++)):e()},S.prototype.gotoLayoutOld=function(t){"Modle"==t&&(t="");var e=this._openFile;for(var n in this._iniParam)"srcname"==(a=(o=this._iniParam[n])[0])&&(e=o[1]);var r={},i="";for(var n in this._iniParam){var o,a;if(null==r[a=(o=this._iniParam[n])[0]]){r[a]=!0;var l=o[1];if("file"==a){if(l=e,0<t.length){var c=l.substring(l.lastIndexOf(".")+1);l=l.substring(0,l.lastIndexOf("."))+"%23"+t+"%23."+c}}else if("srcname"==a)continue;0==i.length?i=a+"="+l+"&srcname="+e:i+="&"+a+"="+l}}var u=s.MxFun.getLocationPageUrl()+"?"+i;window.location.href=u},S.prototype.gotoLayout=function(t){var e=!1,n=!this.isStaticFileNet();for(var r in this._iniParam)if("dwgdir"==(u=this._iniParam[r])[0]){e=!0;break}if(e||n)this.gotoLayoutOld(t);else{"Model"==t&&(t="");var i=this._openFile;if(!i)return;var o=i.lastIndexOf(".dwg");if(void 0===o||-1===o)return;if("#"==(i=i.substring(0,o))[i.length-1]){var a=i.substring(0,i.length-1),l=a.lastIndexOf("#");void 0!==l&&-1!==l&&(i=a.substring(0,l))}0<t.length?i=i+"#"+t+"#.dwg.mxb1.wgh":i+=".dwg.mxb1.wgh";var c={};for(var r in this._iniParam){var u,h=(u=this._iniParam[r])[0];if(null==c[h]){c[h]=!0;var d=u[1];"file"!=h&&"srcname"!=h&&(i+="&"+h+"="+d)}}var p=s.MxFun.getLocationPageUrl()+"?file="+i;window.location.href=encodeURI(p)}},S.prototype.addInitParam=function(t,e){var n=new Array;n.push(t),n.push(e),this._iniParam.push(n)},S.prototype.openFile=function(t,e){if(void 0===e&&(e=""),!this._isCreate)return console.log("mx: openFile Fialed mxasser(_isCreate == false)"),!1;if(this.stopAllLoading(),0==t.length)return!1;this.reInit(),this._devicePixelRatio=window.devicePixelRatio,t instanceof Array?(this._openFile=t[0],this._staticLoadingOpenFiles=t):this._openFile=t,this._openFileExtName=this._openFile.substring(this._openFile.lastIndexOf(".")+1),this._iniParam=[],this._initZoomwCoordPt1=null,this._initZoomWCoordPt2=null;var n=new Array;return n.push("file"),n.push(this._openFile),this._iniParam.push(n),this.onLoad(e),!0},S.prototype.updateCameraDisplayRange=function(t,e,n){this.mxdrawThreeJS.updateCameraDisplayRange(t,e,n)},S.prototype.newFile=function(t,e,n,r){if(!this._isCreate)return console.log("mx: openFile Fialed mxasser(_isCreate == false)"),!1;var i,o;if(o=t instanceof Object&&e instanceof Object?(i=t,e):(i=new a.Vector3(t,e,0),new a.Vector3(n,r,0)),i.x>o.x){var l=i.x;i.x=o.x,o.x=l}if(i.y>o.y){var c=i.y;i.y=o.y,o.y=c}this.reInit(),this._devicePixelRatio=window.devicePixelRatio,this._openFile="",this._openFileExtName="dwg",this._iniParam=[],this._initZoomwCoordPt1=null,this._initZoomWCoordPt2=null;var u=new a.Matrix4;u.identity(),this.intiDoc2Wold(u),this.mxdrawThreeJS.updateCameraDisplayRange(i,o,0),this.updateDisplay(!0);var h=s.MxFun.getUiObj();null!=h&&(h.SetLayoutData(this._allLayoutName),h.UpDisplayLayout())},S.prototype.calcViewsize=function(){if(null==this._userCanvas)return{viewWidth:window.innerWidth,viewHeight:window.innerHeight};var t=this._userCanvas.clientWidth,e=this._userCanvas.clientHeight;if(null!=this._event.onResize){var n=this._event.onResize();null!=n&&(t=parseInt(n.width),e=parseInt(n.height))}return{viewWidth:t,viewHeight:e}},S.prototype.initMxCpp=function(t){t&&t.imp?(this.mcObject.init(this,t.imp),null!=this.secenView?this.secenView.background=null:this.scene.background=null):console.log("mxerror: mcppObjectImp is null")},S.prototype.create=function(t,e,n,i){if(this._is2d?i?(this.mxdrawThreeJS=new b.MxDrawMapBoxThreeJS(i,this),this._viewcolor=16777215):this.mxdrawThreeJS=new b.MxDrawObject2dThreeJS(this):this.mxdrawThreeJS=new b.MxDrawObject3dThreeJS(this),this._callCreateCanvasImageData=void 0,this._devicePixelRatio=window.devicePixelRatio,this._runMode==r.kCPPMxCAD)this._mxCAD=null,this._openFile="";else{if(e instanceof Array?(this._openFile=e[0],this._staticLoadingOpenFiles=e):this._openFile=e,this._iniParam=s.MxFun.getUrlParams(),this._openFileExtName=this._openFile.substring(this._openFile.lastIndexOf(".")+1),""!=this._openFile&&this._runMode!=r.kMxCAD&&this._runMode!=r.kMxCADBrowseApp){var o=new Array;o.push("file"),o.push(this._openFile),this._iniParam.push(o)}""!=this._userIdentitySign&&(this.addInitParam("userIdentitySign",this._userIdentitySign),this.addInitParam("userRandomToken",this._userRandomToken)),this.addInitParam("runMode",this._runMode==r.kMxCAD||this._runMode==r.kMxCADBrowseApp?"mxcad":"browse"),this._runMode==r.kMxCAD||this._runMode==r.kMxCADBrowseApp?("empty"==this._openFile&&(this._openFile=""),this._mxCAD=new g.MxCADObject(this)):this._mxCAD=null}this._userCanvas=t;var l=window.innerWidth,c=window.innerHeight;if(null!=t&&(l=t.clientWidth,c=t.clientHeight),this._viewWidth=l,this._viewHeight=c,this.m_mxDatabase.getSelectManager().setCanvasSize(l,c),this.mxdrawThreeJS.onInitThreejs(),this.eventManager.registEvent(this),this.onCreate(),this.m_mxDatabase.init(this),this._parentDocObject=new a.Object3D,this.scene.add(this._parentDocObject),this.threejsselectObjects=new a.Object3D,this.scene.add(this.threejsselectObjects),this._objectsOsnap=new v.MxDrawObjectOsnap(this),this._select=new p.MxSelect(this,this.getCanvas()),this._select.enabled=s.MxFun.isEnableSelect(),this._select.init(),this._is2d||(this._select.enabled=!1),this._runMode!=r.kBrowse&&(this._select.enabled=!1),f.MxManager.add(this),f.MxManager.setCurrentMx(this),this.mxdrawThreeJS.addControlsChangeEvent(),this.updateDisplay(),this.mxdrawThreeJS.getType()==b.MxThreeJSType.kMapBox)this.mxdrawThreeJS.addWindowResizeEvent();else{var u=this;if(null==t){var h=function(){u._viewWidth=window.innerWidth,u._viewHeight=window.innerHeight,u.onResizeImp(),u.updateDisplay()};window.addEventListener("resize",h,!1),this._onResizeFun=h}else{var d=function(t){t&&t.viewWidth&&t.viewHeight||(t=u.calcViewsize()),u._viewWidth=t.viewWidth,u._viewHeight=t.viewHeight,u.onResizeImp(u._viewWidth,u._viewHeight),u.updateDisplay()};if(this._onResizeFun=d,null!=this._event.addResizeEvent?this._event.addResizeEvent(d,t):window.addEventListener("resize",d,!1),window.setTimeout(function(){d()},5),null!=this._event.onResize){var m=u.calcViewsize();d(m);var y=0,x=0,w=!0,M=window.setInterval(function(){x++;var t=u.calcViewsize();if(t.viewWidth==m.viewWidth&&t.viewHeight==m.viewHeight&&0<t.viewWidth&&0<t.viewHeight){if(8<++y)return clearInterval(M),void d(t);1<=y&&w&&(d(t),2<=y&&(w=!1))}else y=0;m=t,50<x&&(clearInterval(M),0<t.viewWidth&&0<t.viewHeight?d(t):console.log("mxassert(0) error view size"))},50)}}}this.callInitObjectEvent(),this.onLoad(n),this._isCreate=!0},S.prototype.initResize=function(){if(null==this._userCanvas)this._viewWidth=window.innerWidth,this._viewHeight=window.innerHeight,this.onResizeImp();else{if(this._viewWidth=this._userCanvas.clientWidth,this._viewHeight=this._userCanvas.clientHeight,null!=this._event.onResize){var t=this._event.onResize();null!=t&&(this._viewWidth=t.width,this._viewHeight=t.height)}this.onResizeImp(this._viewWidth,this._viewHeight)}this.updateDisplay()},S.prototype.is2D=function(){return this._is2d},S.prototype.getOpenFile=function(){return this._openFile},S.prototype.getFileTitle=function(){var t=this._openFile;if("wgh"==this._openFile.substring(this._openFile.lastIndexOf(".")+1).toLowerCase()){var e=this._openFile.substring(0,this._openFile.indexOf(".mxb1.wgh")).split("/");"$"==(t=1==e.length?e[0]:e[e.length-1])[0]&&(t=t.substring(1))}return t},S.prototype.getIniParam=function(){return this._iniParam},S.prototype.getOpenFileExtName=function(){return this._openFileExtName},S.prototype.loadCodeToServer=function(t,e){this._net.getSend().CallLoadCodeToServer(t,e)},S.prototype.userLogin=function(t,e){this._net.getSend().UserLogin(t,e)},S.prototype.getUserCanvas=function(){return this._userCanvas},S.prototype.getCanvas=function(){return null!=this._userCanvas?this._userCanvas:this.renderer.domElement},S.prototype.getScene=function(){return this.scene},S.prototype.getCamera=function(){return this.camera},S.prototype.callCommand=function(t,e,n){void 0===e&&(e=""),this._net.getSend().DoCommand(t,e,n)},S.prototype.undoMark=function(){this._runMode==r.kCPPMxCAD||this._net.getSend().UndoMark()},S.prototype.loadCodeFileToServer=function(t,e,n){var r='{"path":"'+t+'","reload":'+(null!=n?"true":"false")+"}";this._net.getSend().DoCommand("Mx_LoadCodeFormServerFile",r,e)},S.prototype.deleteAll=function(){this.removeAllEntity(),this.callCommand("Mx_ClearAll"),this.updateDisplay()},S.prototype.undo=function(){this.callCommand("Mx_Undo")},S.prototype.save=function(){this.callCommand("Mx_Save")},S.prototype.initAllLayoutName=function(t){this._allLayoutName=t},S.prototype.getAllLayoutName=function(){return this._allLayoutName},S.prototype.updataClipMaterial=function(){this._blocks.updataClipMaterial(this)},S.prototype.getSketchLayers=function(){return this._sketchLayers},S.prototype.getExtRefManager=function(){return this._extRefManager},S.prototype.showLayer=function(t,e,n){"string"==typeof t&&(t=this._layers.getLayerIdForName(t)),n?this._sketchLayers.getLayer(t).show(e):this._blocks.showLayer(t,e),this.updateDisplay()},S.prototype.addLayerInfo=function(t,e,n){e=this.automaticInversionColor(16777215&e),this._layers.add(t,e,n)},S.prototype.setZeroLayerId=function(t){this._layers.setZeroLayerId(t)},S.prototype.addLayerInfoComplete=function(){this._layers.initComplete()},S.prototype.addEntity=function(t,e){var n=this._mapId2Entity.get(t);null==n&&(n=new Array,this._mapId2Entity.set(t,n)),n.push(e)},S.prototype.getEntity=function(t){return this._mapId2Entity.get(t)},S.prototype.clearThreejsScence=function(){s.MxFun.removeThreejsObject(this.threejsselectObjects,this.scene),this.threejsselectObjects=new a.Object3D,s.MxFun.removeThreejsObject(this._parentDocObject,this.scene),this._parentDocObject=new a.Object3D,this.scene.remove(),this.scene.dispose(),this.scene=new a.Scene,this.scene.add(this.threejsselectObjects),this.scene.add(this._parentDocObject),this._objectsOsnap=new v.MxDrawObjectOsnap(this),this.m_mxDatabase.init(this),this.mxdrawThreeJS.onInitScene(),s.MxFun.removeThreejsObject(this.threejsselectObjectsView,this.secenView),this.threejsselectObjectsView=null,this.secenView.remove(),this.secenView.dispose(),this.secenView=null,this.onInitViewScene()},S.prototype.reInit=function(){this.clearThreejsScence(),this._openFile="",this._openFileExtName="",this._select.removeAll(),this._is2d||(this._select.enabled=!1),this._mapId2Entity=new Map,this._setAdyDelete=new Map,this._sketchLayers=new l.MxCadSketchLayers(this),this._layers=new c.MxBrowseLayerData,this._blocks=new u.Blocks,this._extRefManager=new u.ExternalReferenceManager,this._doc2World=new a.Matrix4,this._word2doc=new a.Matrix4,this._allLayoutName=new Array,this._tzDwgStaticFile="",this._devicePixelRatio=window.devicePixelRatio,this._blocks.initRootBlockRef()},S.prototype.removeEntity=function(t){if(null==this._setAdyDelete[t]){this._setAdyDelete[t]=!0;var e=this._mapId2Entity.get(t);if(null!=e){for(var n in e)this.scene.remove(e[n]);this._sketchLayers.removeEntity(t),this._mapId2Entity.delete(t)}}},S.prototype.removeEntityFromServer=function(t){for(var e=t.getInt32(4,!0),n=0;n<e;n++){var r=t.getInt32(4*(n+20),!0);this.removeEntity(r)}},S.prototype.removeAllEntity=function(){var t=this;this._mapId2Entity.forEach(function(e,n,r){for(var i in e)t.scene.remove(e[i])}),this._mapId2Entity.clear(),this._sketchLayers.removeAllEntity()},S.prototype.mxWebAddEntity=function(t){this._setAdyDelete.clear();var e=this.mxWebAddEntity_3DChild(t);this.mxWebAddEntity_Curve(t,e),this._setAdyDelete.clear()},S.prototype.screenCoord2World=function(t,e,n){var r=this.getCanvas(),i=r.clientWidth,o=r.clientHeight;n=.5;var s=this.camera;s&&s.isOrthographicCamera&&(n=(s.near+s.far)/(s.near-s.far));var l=new a.Vector3(t/i*2-1,-e/o*2+1,n);return l.unproject(this.camera),l},S.prototype.worldCoord2Screen=function(t,e,n){var r=new a.Vector3(t,e,n).project(this.camera),i=this.getCanvas(),o=i.clientWidth/2,s=i.clientHeight/2,l=Math.round(r.x*o+o),c=Math.round(-r.y*s+s);return new a.Vector3(l,c,0)},S.prototype.worldCoordLong2Doc=function(t){var e=this.worldCoord2Doc(0,0,0),n=this.worldCoord2Doc(t,0,0);return e.distanceTo(n)},S.prototype.docCoordLong2World=function(t){var e=this.docCoord2World(0,0,0),n=this.docCoord2World(t,0,0);return e.distanceTo(n)},S.prototype.getDoc2CADMatrix=function(){return this._doc2CAD},S.prototype.docCoord2Cad=function(t,e,n){var r=new a.Vector3(t,e,n);return r.applyMatrix4(this._doc2CAD),r},S.prototype.cadCoord2Doc=function(t,e,n){var r=new a.Vector3(t,e,n);return r.applyMatrix4(this._cad2Doc),r},S.prototype.docCoord2World=function(t,e,n){var r=new a.Vector3(t,e,n);return r.applyMatrix4(this._doc2World),r},S.prototype.getDoc2World=function(){return this._doc2World},S.prototype.getWorldToDoc=function(){return this._word2doc},S.prototype.worldCoord2Doc=function(t,e,n){var r=new a.Vector3(t,e,n);return r.applyMatrix4(this._word2doc),r},S.prototype.screenCoord2Doc=function(t,e,n){var r=this.screenCoord2World(t,e,n);return this.worldCoord2Doc(r.x,r.y,0)},S.prototype.docCoord2Screen=function(t,e,n){var r=this.docCoord2World(t,e,n);return this.worldCoord2Screen(r.x,r.y,r.z)},S.prototype.screenCoordLong2Doc=function(t){var e=this.screenCoord2Doc(0,0,0),n=this.screenCoord2Doc(t,0,0);return e.distanceTo(n)},S.prototype.screenCoordLong2DocScale=function(){var t=this.screenCoord2Doc(0,0,0),e=this.screenCoord2Doc(1,0,0);return t.distanceTo(e)},S.prototype.docCoordLong2Screen=function(t){var e=this.docCoord2Screen(0,0,0),n=this.docCoord2Screen(0<t?t:-t,0,0);return 0<=t?e.distanceTo(n):-e.distanceTo(n)},S.prototype.screenCoordLong2World=function(t){var e=this.screenCoord2World(0,0,0),n=this.screenCoord2World(0<t?t:-t,0,0);return 0<=t?e.distanceTo(n):-e.distanceTo(n)},S.prototype.worldCoordLong2Screen=function(t){var e=this.worldCoord2Screen(0,0,0),n=this.worldCoord2Screen(t,0,0);return e.distanceTo(n)},S.prototype.initCAD2Doc=function(t){t instanceof Array?this._cad2Doc.fromArray(t):this._cad2Doc=t,this._doc2CAD.getInverse(this._cad2Doc)},S.prototype.intiDoc2Wold=function(t){t instanceof Array?this._doc2World.fromArray(t):this._doc2World=t,this._word2doc.getInverse(this._doc2World),this.m_mxDatabase.intiDoc2Wold(this._doc2World),this._parentDocObject.matrix=this._doc2World,this._parentDocObject.matrixAutoUpdate=!1,this.threejsselectObjects.matrix=this._doc2World,this.threejsselectObjects.matrixAutoUpdate=!1},S.prototype.getDrawContainer=function(){return this.threejsselectObjects},S.prototype.getTheTempDrawContainer=function(){return this._parentDocObject},S.prototype.enableSingleTouchPan=function(t){this.controls.enablePan=t},S.prototype.mxWebAddEntityFor2dPointMeshBuffers=function(t,e){var n=new h.MxNetData(t),r=n.getdPointMeshBuffersHead(),i=r.zeroLayerIdIndex,o=r.databaseIndex;-1!=e&&(o=e);for(var a=r.datasize,s=0;s<r.datacount;s++){var l=n.getdPointMeshBufferDataHead(a);a=l.offset;var c=l.layerId,u=c==i,d=l.blkId,p=l.pointCount;if(!(p<1)){for(var f=[],m=[],g=[],y=[],v=[],x=0;x<p;x++){var b=t.getFloat32(a,!0);a+=4;var w=t.getFloat32(a,!0);a+=4;var M=t.getFloat32(a,!0);a+=4;var _=t.getFloat32(a,!0);a+=4;var C=t.getFloat32(a,!0);a+=4;var S=t.getFloat32(a,!0);a+=4;var T=t.getInt32(a,!0);a+=4;var E=T>>24&255;2==E?(y.push(b,w),y.push(M,_),y.push(C,S)):1==E?0!=d&&u?(v.push(b,w),v.push(M,_),v.push(C,S)):(g.push(b,w),g.push(M,_),g.push(C,S)):(T=this.automaticInversionColor(16777215&T),f.push(b,w),f.push(M,_),f.push(C,S),m.push((255&T)/255,(T>>8&255)/255,(T>>16&255)/255),m.push((255&T)/255,(T>>8&255)/255,(T>>16&255)/255),m.push((255&T)/255,(T>>8&255)/255,(T>>16&255)/255))}var D=this._blocks,A=this._layers;0!=o&&(D=this._extRefManager.getBlocks(o),A=this._extRefManager.getLayers(o));var O=D.crateBlock(d);O.addGeometryMesh(f,m,c,y,g,v),D.createThreejsObj(O,this,A)}}},S.prototype.mxWebAddEntityForMemorySections=function(t,e){var n=new h.MxNetData(t),r=n.getMemorySectionsHead(),i=(r.zeroLayerIdIndex,r.databaseIndex);-1!=e&&(i=e);var o=r.nOffset,a=this._blocks,s=this._layers;0!=i&&(a=this._extRefManager.getBlocks(i),s=this._extRefManager.getLayers(i));for(var l=0;l<r.datacount;l++){var c=n.getMemorySectionHead(o);o=c.offset;var d=new u.MxNewDisplayMemorySection;d.layerId=c.layerId,d.blockId=c.blkId,d.id=c.memId,d.color=c.memColor,d.type=c.memType;var p=!1;d.type==u.MxNewDisplayMemorySectionType.kLinesType_Float?(p=!0,d.type=u.MxNewDisplayMemorySectionType.kLinesType):d.type==u.MxNewDisplayMemorySectionType.kTriangleType_Float?(p=!0,d.type=u.MxNewDisplayMemorySectionType.kTriangleType):d.type==u.MxNewDisplayMemorySectionType.kPointType_Float&&(p=!0,d.type=u.MxNewDisplayMemorySectionType.kPointType);var f=c.pointCount;if(!(f<1)){for(var m=[],g=0;g<f;g++)if(p){var y=t.getFloat32(o,!0);o+=4;var v=t.getFloat32(o,!0);o+=4,t.getFloat32(o,!0),o+=4,m.push(y,v,0)}else y=t.getFloat64(o,!0),o+=8,v=t.getFloat64(o,!0),o+=8,t.getFloat64(o,!0),o+=8,m.push(y,v,0);d.points=m;var x=a.crateBlock(d.blockId);x.addMemorySections(d),a.createThreejsObj(x,this,s)}}},S.prototype.mxWebAddEntityFor2dPointTextureBuffers=function(t,e){var n=new h.MxNetData(t),r=n.getdPointTextureBuffersHead(),i=r.ver,o=(r.zeroLayerIdIndex,r.databaseIndex);-1!=e&&(o=e);for(var a=r.datasize,s=0;s<r.datacount;s++){var l=n.getdPointTextureBufferDataHead(a);a=l.offset;var c=l.layerId,u=l.blkId,d=l.dataCount;if(!(d<1)){var p=0,f=this._blocks,m=this._layers;0!=o&&(f=this._extRefManager.getBlocks(o),m=this._extRefManager.getLayers(o));for(var g=f.crateBlock(u);p<d;p++){var y=t.getFloat64(a,!0);a+=8;var v=t.getFloat64(a,!0);a+=8;var x=t.getFloat64(a,!0);a+=8;var b=t.getUint32(a,!0);a+=4;var w=t.getUint32(a,!0);a+=4;var M=String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(a,a+w)));a+=w;var _=[],C=[],S=[];if(!(b<1)){for(var T=0;T<b;T++){if(5<=i){var E=t.getFloat64(a,!0);a+=8;var D=t.getFloat64(a,!0);a+=8,t.getFloat64(a,!0),a+=8;var A=t.getFloat64(a,!0);a+=8;var O=t.getFloat64(a,!0);a+=8,t.getFloat64(a,!0),a+=8;var P=t.getFloat64(a,!0);a+=8;var L=t.getFloat64(a,!0);a+=8,t.getFloat64(a,!0),a+=8,_.push(E,D),_.push(A,O),_.push(P,L)}else E=t.getFloat32(a,!0),a+=4,D=t.getFloat32(a,!0),a+=4,A=t.getFloat32(a,!0),a+=4,O=t.getFloat32(a,!0),a+=4,P=t.getFloat32(a,!0),a+=4,L=t.getFloat32(a,!0),a+=4,_.push(E,D),_.push(A,O),_.push(P,L);var R=t.getInt32(a,!0);a+=4;var I=t.getFloat32(a,!0);a+=4;var k=t.getFloat32(a,!0);a+=4;var F=t.getFloat32(a,!0);a+=4;var B=t.getFloat32(a,!0);a+=4;var j=t.getFloat32(a,!0);a+=4;var N=t.getFloat32(a,!0);a+=4;var z=R>>24&255;R=2==z||1==z?16777215:this.automaticInversionColor(16777215&R),S.push(I,k),S.push(F,B),S.push(j,N),C.push((255&R)/255,(R>>8&255)/255,(R>>16&255)/255),C.push((255&R)/255,(R>>8&255)/255,(R>>16&255)/255),C.push((255&R)/255,(R>>8&255)/255,(R>>16&255)/255)}g.addGeometryTexture(_,S,C,c,M,y,v,x)}}f.createThreejsObj(g,this,m)}}},S.prototype.mxWebAddEntityFor2dPointCurveBuffers=function(t,e){var n=new h.MxNetData(t),r=n.getdPointCurveBuffersHead(),i=r.zeroLayerIdIndex,o=r.databaseIndex;-1!=e&&(o=e);for(var a=r.datasize,s=0;s<r.datacount;s++){var l=n.getdPointCurveBufferDataHead(a);a=l.offset;var c=l.layerId,u=c==i,d=l.blkId,p=l.pointCount;if(!(p<1)){for(var f=[],m=[],g=[],y=[],v=[],x=0;x<p;x++){var b=t.getFloat32(a,!0);a+=4;var w=t.getFloat32(a,!0);a+=4;var M=t.getFloat32(a,!0);a+=4;var _=t.getFloat32(a,!0);a+=4;var C=t.getInt32(a,!0);a+=4;var S=C>>24&255;2==S?(y.push(b,w),y.push(M,_)):1==S?0!=d&&u?(v.push(b,w),v.push(M,_)):(g.push(b,w),g.push(M,_)):(f.push(b,w),f.push(M,_),C=this.automaticInversionColor(16777215&C),m.push((255&C)/255,(C>>8&255)/255,(C>>16&255)/255),m.push((255&C)/255,(C>>8&255)/255,(C>>16&255)/255))}var T=this._blocks,E=this._layers;0!=o&&(T=this._extRefManager.getBlocks(o),E=this._extRefManager.getLayers(o));var D=T.crateBlock(d);D.addGeometryCurve(f,m,c,y,g,v),T.createThreejsObj(D,this,E)}}},S.prototype.mxWebAddEntityFor2dPointCurveBuffer=function(t,e){var n=new h.MxNetData(t);if(!n.getIsSketchEntity()){var r,i=n.getLayerId(),o=i==n.getZeroLayerId(),a=n.getBlockId();if(!((r=t.getInt32(20,!0)/20)<1)){for(var s=80,l=[],c=[],u=[],d=[],p=[],f=0;f<r;f++){var m=t.getFloat32(s,!0);s+=4;var g=t.getFloat32(s,!0);s+=4;var y=t.getFloat32(s,!0);s+=4;var v=t.getFloat32(s,!0);s+=4;var x=t.getInt32(s,!0);s+=4;var b=x>>24&255;2==b?(d.push(m,g),d.push(y,v)):1==b?0!=a&&o?(p.push(m,g),p.push(y,v)):(u.push(m,g),u.push(y,v)):(x=this.automaticInversionColor(16777215&x),l.push(m,g),l.push(y,v),c.push((255&x)/255,(x>>8&255)/255,(x>>16&255)/255),c.push((255&x)/255,(x>>8&255)/255,(x>>16&255)/255))}var w=n.getDatabaseIndex();-1!=e&&(w=e);var M=this._blocks,_=this._layers;0!=w&&(M=this._extRefManager.getBlocks(w),_=this._extRefManager.getLayers(w));var C=M.crateBlock(a);C.addGeometryCurve(l,c,i,d,u,p),M.createThreejsObj(C,this,_)}}},S.prototype.mxWebAddEntityFor2dPointMeshBuffer=function(t,e){var n=new h.MxNetData(t);if(!n.getIsSketchEntity()){var r,i=n.getLayerId(),o=n.getBlockId(),a=i==n.getZeroLayerId();if(!((r=t.getInt32(12,!0)/28)<1)){for(var s=80,l=[],c=[],u=[],d=[],p=[],f=0;f<r;f++){var m=t.getFloat32(s,!0);s+=4;var g=t.getFloat32(s,!0);s+=4;var y=t.getFloat32(s,!0);s+=4;var v=t.getFloat32(s,!0);s+=4;var x=t.getFloat32(s,!0);s+=4;var b=t.getFloat32(s,!0);s+=4;var w=t.getInt32(s,!0);s+=4;var M=w>>24&255;2==M?(d.push(m,g),d.push(y,v),d.push(x,b)):1==M?0!=o&&a?(p.push(m,g),p.push(y,v),p.push(x,b)):(u.push(m,g),u.push(y,v),u.push(x,b)):(l.push(m,g),l.push(y,v),l.push(x,b),w=this.automaticInversionColor(16777215&w),c.push((255&w)/255,(w>>8&255)/255,(w>>16&255)/255),c.push((255&w)/255,(w>>8&255)/255,(w>>16&255)/255),c.push((255&w)/255,(w>>8&255)/255,(w>>16&255)/255))}var _=n.getDatabaseIndex();-1!=e&&(_=e);var C=this._blocks,S=this._layers;0!=_&&(C=this._extRefManager.getBlocks(_),S=this._extRefManager.getLayers(_));var T=C.crateBlock(o);T.addGeometryMesh(l,c,i,d,u,p),C.createThreejsObj(T,this,S)}}},S.prototype.mxWebCreateAllBlocks=function(t,e){var n=new h.MxNetData(t).getDatabaseIndex();-1!=e&&(n=e);var r=this._blocks;0!=n&&(r=this._extRefManager.getBlocks(n)),r.createBlocks(t,this.scene)},S.prototype.mxWebEntitysData=function(t,e){-1==e&&this._objectsOsnap.mxWebEntitysData(t,e)},S.prototype.getObjectOsnap=function(){return this._objectsOsnap},S.prototype.saveMxEntityToJson=function(t){return this.m_mxDatabase.saveJson(t)},S.prototype.getDtabaseJsonString=function(){return JSON.stringify(this.m_mxDatabase.toJsonObject())},S.prototype.loadMxEntityFromJson=function(t){return this.m_mxDatabase.loadJson(t)},S);function S(t){this._is2d=!0,this._runMode=r.kBrowse,this._mxCAD=null,this._userCanvas=null,this._openFile="empty",this._staticLoadingOpenFiles=[],this._openFileExtName="",this._userIdentitySign="",this._rendererParam=void 0,this._userRandomToken="",this._isCreate=!1,this.m_iniSet={},this._net=null,this._staticNet=null,this._staticLoadTzNet=null,this._staticLocalNet=null,this._isStaticLocalLoad=!1,this._staticLocalLoadPath="",this._viewWidth=1,this._viewHeight=1,this.m_sysVariable=new m.MxSystemVariable,this._color="#FFFFFF",this._viewcolor=15790320,this._isAnimation=!1,this._isAnimationStarting=!1,this._isWaiteCount=0,this._callCreateCanvasImageData=void 0,this._event={},this.scene=null,this.camera=null,this.secenView=null,this.cameraView=null,this.renderer=null,this.controls=null,this.threejsselectObjectsView=null,this._mouseRightRotate=!0,this._isMouseMiddlePan=-1,this._mapId2Entity=new Map,this._setAdyDelete=new Map,this._sketchLayers=new l.MxCadSketchLayers(this),this._layers=new c.MxBrowseLayerData,this._blocks=new u.Blocks,this._extRefManager=new u.ExternalReferenceManager,this._doc2World=new a.Matrix4,this._word2doc=new a.Matrix4,this._cad2Doc=new a.Matrix4,this._doc2CAD=new a.Matrix4,this._allLayoutName=new Array,this._devicePixelRatio=1,this._tzDwgStaticFile="",this._requestHeader="",this._objectsOsnap=null,this._initZoomwCoordPt1=null,this._initZoomWCoordPt2=null,this.m_mxDatabase=null,this._parentDocObject=null,this.threejsselectObjects=null,this._onResizeFun=null,this._sCurrentLoadURL="",this.mxdrawThreeJS=null,this.eventManager=new w.MxDrawObjectEvent,this._viewangle=0,this.id=0,this.mcObject=new _.McDrawObject,this._is2d=t,this._blocks.initRootBlockRef(),this.m_iniSet[o.kEnableOsnapFunction]=!1,this.m_sysVariable.init(this),this.m_mxDatabase=new x.MxDbDatabase,this.id=f.MxManager.allocId()}n.MxDrawObject=C},{"./MxCAD/MxCADObject":24,"./MxCAD/MxCadSketchLayer":27,"./MxDrawObjectEvent":33,"./MxFun":34,"./MxLocalFileLoad":35,"./MxManager":36,"./MxNetData":38,"./MxSelect":39,"./MxSystemVariable":43,"./Operate/MxDrawObjectOsnap":54,"./View/MxBrowseDisplay":68,"./View/MxBrowseLayerData":69,"./View/MxDbDatabase":70,"./View/MxDbEntityGrip":72,"./View/MxDrawMapBox":77,"./cpp/McDrawObject":79,three:19}],31:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject2d=void 0;var o,a=t("three"),s=t("./MxFun"),l=t("./MxDrawObject"),c=t("three-orbitcontrols"),u=t("./MxNetData"),h=t("./MxMaterial"),d=t("./MxDrawData"),p=(i(f,o=l.MxDrawObject),f.prototype.set3DDraw=function(t){this.is3DDraw=t},f.prototype.getOrthographicCamera=function(){return this.camera instanceof a.OrthographicCamera?this.camera:null},f.prototype.getFullDisplayRange=function(){return{minPt:this._initMinDisplayPoint,maxPt:this._initMaxDisplayPoint}},f.prototype.zoomW=function(t,e,n){if(null!=n&&n||(t=this.docCoord2World(t.x,t.y,0),e=this.docCoord2World(e.x,e.y,0)),this._curMinDisplayPoint=t,this._curMaxDisplayPoint=e,t.x>e.x){var r=t.x;t.x=e.x,e.x=r}t.y>e.y&&(r=t.y,t.y=e.y,e.y=r);var i=this.getViewWidth(),o=this.getViewHeight(),s=Math.abs(t.x-e.x),l=Math.abs(t.y-e.y),c=this.getOrthographicCamera();if(s/l<i/o){var u=.5*l,h=i/o;c.left=-u*h,c.right=u*h,c.top=u,c.bottom=-u}else u=.5*s,h=o/i,c.left=-u,c.right=u,c.top=u*h,c.bottom=-u*h;var d=s,p=l,f=d;f<d&&(f=p),c.far<2*f&&(c.far=2*f);var m=t.x+.5*d,g=t.y+.5*p;c.zoom=1,c.position.set(m,g,.5*f),c.lookAt(new a.Vector3(m,g,0)),c.updateProjectionMatrix(),this.controls.target.x=m,this.controls.target.y=g,this.controls.target.z=0,this.controls.update()},f.prototype.zoomScale=function(t){var e=this.getOrthographicCamera();e.zoom=Math.max(this.controls.minZoom,Math.min(this.controls.maxZoom,e.zoom*t)),e.updateProjectionMatrix(),this.controls.update()},f.prototype.zoomCenter=function(t,e){var n=this.getOrthographicCamera(),r=this.docCoord2World(t,e,0);t=r.x,e=r.y,n.position.set(t,e,n.position.z),n.lookAt(new a.Vector3(t,e,0)),n.updateProjectionMatrix(),this.controls.target.x=t,this.controls.target.y=e,this.controls.target.z=0,this.controls.update()},f.prototype.calcCameraUp=function(t){var e=new a.Vector3(0,1,0),n=new a.Matrix4;return n.makeRotationZ(t),e.applyMatrix4(n),e},f.prototype.updateCameraDisplayRangeImp=function(t,e,n){null!=this._initZoomwCoordPt1&&null!=this._initZoomWCoordPt2?(this._initMinDisplayPoint=this.docCoord2World(this._initZoomwCoordPt1.x,this._initZoomwCoordPt1.y,0),this._initMaxDisplayPoint=this.docCoord2World(this._initZoomWCoordPt2.x,this._initZoomWCoordPt2.y,0)):(this._initMinDisplayPoint=t,this._initMaxDisplayPoint=e),this._viewangle=n,this.camera.up=this.calcCameraUp(n),this.cameraView.up=this.calcCameraUp(n),this.cameraView.updateProjectionMatrix(),this.zoomW(this._initMinDisplayPoint,this._initMaxDisplayPoint,!0)},f.prototype.setViewAngle=function(t){this._viewangle=t;var e=this.getOrthographicCamera();e&&(e.up=this.calcCameraUp(t),e.updateProjectionMatrix()),this.cameraView.up=this.calcCameraUp(t),this.cameraView.updateProjectionMatrix(),this.controls.update()},f.prototype.zoomInitialStates=function(){null!=this._initMinDisplayPoint&&null!=this._initMaxDisplayPoint?(this.camera.up=this.calcCameraUp(this._viewangle),this.cameraView.up=this.calcCameraUp(this._viewangle),this.cameraView.updateProjectionMatrix(),this.zoomW(this._initMinDisplayPoint,this._initMaxDisplayPoint,!0)):console.log("mx assert(0)")},f.prototype.onInitScene=function(){var t=this.getEvent(),e=0;if(null!=t.initScene&&(e=t.initScene(this.scene,this.controls,!0)),0==e){var n=new a.AmbientLight(3355443,1);this.scene.add(n);var r=new a.DirectionalLight(16777215,1);r.position.set(-2,2,3).normalize(),this.scene.add(r)}},f.prototype.updataCameraView=function(t,e){var n=t,r=e;this.cameraView.left=0,this.cameraView.right=n,this.cameraView.top=r,this.cameraView.bottom=0,this.cameraView.updateProjectionMatrix()},f.prototype.onInitViewScene=function(){if(!this.secenView){this.secenView=new a.Scene,this.secenView.background=new a.Color(this._viewcolor);var t=this.getViewWidth(),e=this.getViewHeight();t=this.xzSize(t),e=this.xzSize(e),this.cameraView=new a.OrthographicCamera(0,t,e,0,1,2e3),this.cameraView.position.set(0,0,2e3),this.cameraView.lookAt(new a.Vector3(0,0,0)),this.cameraView.updateProjectionMatrix();var n=new a.AmbientLight(3355443,1);this.secenView.add(n);var r=new a.DirectionalLight(16777215,1);r.position.set(-2,2,3).normalize(),this.secenView.add(r),this.threejsselectObjectsView=new a.Object3D,this.secenView.add(this.threejsselectObjectsView)}},f.prototype.onInitThreejs=function(){var t=this.getViewWidth(),e=this.getViewHeight(),n=(t=this.xzSize(t))/(e=this.xzSize(e))*50;this.onInitViewScene(),this.camera=new a.OrthographicCamera(n/-2,n/2,25,-25,1,1e3),this.camera.position.set(0,0,200),this.scene=new a.Scene;var r=this.getUserCanvas(),i=this._rendererParam;i=i||{},null==r?(i.antialias=!1,i.stencil=!0,this.renderer=new a.WebGLRenderer(i),this.renderer.setClearColor(0,1),this.renderer.setPixelRatio(this._devicePixelRatio),this.renderer.setSize(t,e),document.body.appendChild(this.renderer.domElement)):(i.canvas=r,i.stencil=!0,this.renderer=new a.WebGLRenderer(i),this.renderer.setClearColor(0,1),this.renderer.setPixelRatio(this._devicePixelRatio)),this.renderer.sortObjects=!0,this.renderer.info.autoReset=d.MxDrawData.m_isAutoResetRenderer,this.renderer.info.reset();var o=this.getUserCanvas();null==o&&(o=this.renderer.domElement),this.controls=new c.OrbitControls(this.camera,o),this.is3DDraw||(this.controls.enableZoom=!0),s.MxFun.isPC()?(this.controls.zoomSpeed=4,this.controls.mouseButtons.LEFT=a.MOUSE.PAN,this._mouseRightRotate?this.controls.mouseButtons.RIGHT=a.MOUSE.ROTATE:this.controls.mouseButtons.RIGHT=a.MOUSE.PAN,this.controls.screenSpacePanning=!0,-1!=this._isMouseMiddlePan&&this.setMouseMiddlePan(this._isMouseMiddlePan)):(this.controls.zoomSpeed=1.5,this.controls.touches.ONE=a.TOUCH.PAN,this.controls.screenSpacePanning=!0),this._is2d&&(this._runMode!=l.MxRunMode.kMxCAD&&this._runMode!=l.MxRunMode.kMxCADBrowseApp&&this._runMode!=l.MxRunMode.kCPPMxCAD||(this.controls.mouseButtons.LEFT=-1,this.controls.mouseButtons.RIGHT=-1,this.controls.mouseButtons.MIDDLE=a.MOUSE.PAN))},f.prototype.onCreate=function(){this._is2d=!0,this.mxdrawThreeJS.onInitScene()},f.prototype.mxWebAddEntity_3DChild=function(t){var e=new u.MxNetData(t),n=e.getMesh();if(null==n.id)return n.size;var r=new a.Mesh(n.geometry,h.MxMaterial.GetBaseColorMaterial(n.nColorIndex));return this.removeEntity(n.id),this.scene.add(r),n.isSketchEntity&&(this.addEntity(n.id,r),this.getSketchLayers().addEntity(n.id,e.getLayerId())),n.size},f.prototype.mxWebAddEntity_Curve=function(t,e){var n=new u.MxNetData(t),r=n.getCurve(e);if(null!=r.id){var i=h.MxMaterial.GetCurveColorMaterial(r.colorIndex),o=new a.LineSegments(r.geometry,i);this.removeEntity(r.id),this.scene.add(o),r.isSketchEntity&&(this.addEntity(r.id,o),this.getSketchLayers().addEntity(r.id,n.getLayerId()))}},f.prototype.onResizeImp=function(t,e){var n=this.getViewWidth();null!=t&&(n=t);var r=this.getViewHeight();null!=e&&(r=e),n=this.xzSize(n),r=this.xzSize(r);var i=this.getOrthographicCamera();if(null==this._curMinDisplayPoint||null==this._curMaxDisplayPoint){var o=50,a=n/r;i.left=o*a/-2,i.right=o*a/2,i.top=o/2,i.bottom=o/-2,i.updateProjectionMatrix()}else{var s=Math.abs(this._curMinDisplayPoint.x-this._curMaxDisplayPoint.x),l=Math.abs(this._curMinDisplayPoint.y-this._curMaxDisplayPoint.y);s/l<n/r?(o=.5*l,a=n/r,i.left=-o*a,i.right=o*a,i.top=o,i.bottom=-o):(o=.5*s,a=r/n,i.left=-o,i.right=o,i.top=o*a,i.bottom=-o*a),i.updateProjectionMatrix()}this.renderer.setSize(n,r),this.mcObject.setSize(n,r),this.updataClipMaterial(),this.updataCameraView(n,r),this.callEvent("viewsizechange",{width:n,height:r}),this.callEvent("viewchange"),this.m_mxDatabase.getSelectManager().setCanvasSize(n,r),this.m_mxDatabase.onViewChange()},f);function f(){var t=o.call(this,!0)||this;return t._initMinDisplayPoint=null,t._initMaxDisplayPoint=null,t._curMinDisplayPoint=null,t._curMaxDisplayPoint=null,t.is3DDraw=s.MxFun.is3DDwg(),t}n.MxDrawObject2d=p},{"./MxDrawData":29,"./MxDrawObject":30,"./MxFun":34,"./MxMaterial":37,"./MxNetData":38,three:19,"three-orbitcontrols":17}],32:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject3d=void 0;var o,a=t("three"),s=t("./MxDrawObject"),l=t("three-orbitcontrols"),c=t("./MxNetData"),u=t("./MxMaterial"),h=t("./MxTools"),d=(i(p,o=s.MxDrawObject),p.prototype.mxWebAddEntity_Curve=function(t,e){var n,r=new c.MxNetData(t),i=0==t.getInt32(32,!0),o=r.getIsSketchEntity();if(!((n=i?t.getInt32(20,!0)/4/3:t.getInt32(20,!0)/4/2)<2)){for(var s=new a.Geometry,l=e,d=0;d<n;d++){var p=t.getFloat32(l,!0);l+=4;var f=t.getFloat32(l,!0);l+=4;var m=0;i&&(m=t.getFloat32(l,!0),l+=4),s.vertices.push(h.MxTools.AsThreeJsPoint(p,f,m))}var g=t.getInt32(28,!0),y=u.MxMaterial.GetCurveColorMaterial(g),v=new a.LineSegments(s,y),x=t.getInt32(4,!0);this.removeEntity(x),this.scene.add(v),o&&this.addEntity(x,v)}},p.prototype.mxWebAddEntity_3DChild=function(t){var e=new c.MxNetData(t),n=e.getId(),r=(e.getColorIndex(),0==e.getBufferType()),i=e.getIsSketchEntity();this.removeEntity(n);var o=new a.Mesh(new a.Geometry),s=this.mxWebUpdateEntity_3DChild(o,t,r);return this.scene.add(o),i&&this.addEntity(n,o),o.geometry.computeBoundingBox(),o.geometry.computeBoundingSphere(),s},p.prototype.mxWebUpdateEntity_3DChild=function(t,e,n){var r=new c.MxNetData(e),i=r.getVertexBufferSize(),o=r.getIndexBufferSize(),s=r.getColorIndex();if(0===i||0===o)return r.getDrawDataOffset();var l=r.getMateria(),d=void 0,p=!0,f=!1,m=!1;0!=l.length&&(null!=(d=JSON.parse(l)).computeFaceNonmal&&(p=d.computeFaceNonmal),null!=d.castShadow&&(f=d.castShadow),null!=d.receiveShadow&&(m=d.receiveShadow)),t.material=u.MxMaterial.createMaterial(d),null==t.material&&(t.material=u.MxMaterial.GetColorMaterial(s)),t.castShadow=f,t.receiveShadow=m;var g,y=r.getDrawDataOffset();g=n?i/4/8:i/4/2;var v=t.geometry;v.vertices=[],v.faces=[];for(var x=0;x<g;x++){var b=e.getFloat32(y+0,!0),w=e.getFloat32(y+4,!0),M=0,_=0,C=0,S=0,T=0,E=0;n?(M=e.getFloat32(y+8,!0),_=e.getFloat32(y+12,!0),C=e.getFloat32(y+16,!0),S=e.getFloat32(y+20,!0),T=e.getFloat32(y+24,!0),E=e.getFloat32(y+28,!0),y+=32):y+=8;var D=h.MxTools.AsThreeJsPoint(b,w,M);v.vertices.push(D),v.vertices[x].normal=h.MxTools.AsThreeJsPoint(_,C,S),v.vertices[x].uv=new a.Vector2(T,E)}var A=o/4;for(x=0;x<A;x+=3){var O=e.getInt32(y,!0);y+=4;var P=e.getInt32(y,!0);y+=4;var L=e.getInt32(y,!0);y+=4;var R=new a.Face3(O,P,L);p||R.vertexNormals.push(v.vertices[O].normal,v.vertices[P].normal,v.vertices[L].normal),v.faces.push(R),v.faceVertexUvs[0].push([v.vertices[O].uv,v.vertices[P].uv,v.vertices[L].uv])}return p&&v.computeFaceNormals(),y},p.prototype.updateUVs=function(t){t.faceVertexUvs[0]=[],t.faces.forEach(function(e){var n=["x","y","z"].sort(function(t,n){return Math.abs(e.normal[t])-Math.abs(e.normal[n])}),r=t.vertices[e.a],i=t.vertices[e.b],o=t.vertices[e.c],s=new a.Vector2(r[n[0]],r[n[1]]),l=new a.Vector2(i[n[0]],i[n[1]]),c=new a.Vector2(o[n[0]],o[n[1]]);t.faceVertexUvs[0].push([s,l,c])}),t.uvsNeedUpdate=!0},p.prototype.onInitThreejs=function(){var t=this.getViewWidth(),e=this.getViewHeight(),n=(t=this.xzSize(t))/(e=this.xzSize(e))*50;this.camera=new a.OrthographicCamera(n/-2,n/2,25,-25,1,1e3),this.camera.position.set(-200,200,200),this.scene=new a.Scene,this.scene.background=new a.Color(this._viewcolor);var r=this.getUserCanvas();null==r?(this.renderer=new a.WebGLRenderer({antialias:!0,alpha:!0}),this.renderer.setPixelRatio(this._devicePixelRatio),this.renderer.setSize(t,e),document.body.appendChild(this.renderer.domElement)):(this.renderer=new a.WebGLRenderer({canvas:r,antialias:!0,alpha:!0}),this.renderer.setPixelRatio(this._devicePixelRatio));var i=this.getUserCanvas();null==i&&(i=this.renderer.domElement),this.controls=new l.OrbitControls(this.camera,i)},p.prototype.onInitViewScene=function(){},p.prototype.onInitScene=function(){var t=this.getEvent(),e=0;if(null!=t.initScene&&(e=t.initScene(this.scene,this.controls,!1)),0==e){var n=new a.AmbientLight(2236962);n.integrity=1,this.scene.add(n);var r=new a.DirectionalLight(16777215,1);r.position.set(-2,2,3).normalize(),this.scene.add(r);var i=new a.GridHelper(2e3,100);i.position.y=-199,i.material.opacity=.25,i.material.transparent=!0,this.scene.add(i);var o=new a.AxesHelper(20);this.scene.add(o)}},p.prototype.onCreate=function(){this._is2d=!1;var t=this.getEvent();null!=t.initRenderer&&t.initRenderer(this.renderer),this.mxdrawThreeJS.onInitScene()},p.prototype.getOrthographicCamera=function(){return this.camera instanceof a.OrthographicCamera?this.camera:null},p.prototype.onResizeImp=function(t,e){var n=this.getViewWidth();null!=t&&(n=t);var r=this.getViewHeight();null!=e&&(r=e),n=this.xzSize(n),r=this.xzSize(r);var i=this.getOrthographicCamera(),o=n/r;i.left=50*o/-2,i.right=50*o/2,i.top=25,i.bottom=-25,i.updateProjectionMatrix(),this.renderer.setSize(n,r)},p.prototype.zoomInitialStates=function(){},p.prototype.zoomScale=function(t){},p.prototype.zoomW=function(t,e,n){},p.prototype.zoomCenter=function(t,e){},p.prototype.setViewAngle=function(t){this._viewangle=t},p.prototype.getFullDisplayRange=function(){return{}},p);function p(){var t=o.call(this,!1)||this;return t._viewcolor=15790320,t}n.MxDrawObject3d=d},{"./MxDrawObject":30,"./MxMaterial":37,"./MxNetData":38,"./MxTools":45,three:19,"three-orbitcontrols":17}],33:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObjectEvent=n.MxDrawObjectEventDefautProc=void 0;var r=t("./MxFun"),i=t("./Operate/MxJigCmdManager"),o=t("three"),a=t("./UI/MxUiVue"),s=t("./MxDrawData"),l=(c.prototype.onMousemove=function(t){if(a.MxUiVue.isNull())return 0;var e=this.mxObj.screenCoord2Doc(t.offsetX,t.offsetY,0);return e=this.mxObj.docCoord2Cad(e.x,e.y,e.z),a.MxUiVue.setTipCoord(r.MxFun.formatString("{0},{1},0.000",e.x.toFixed(3),e.y.toFixed(3))),0},c.prototype.onTouchStart=function(t){if(s.MxDrawData.m_isEnableIntelliSelect&&!i.MxJigCmdManager.isRunning()){var e=t.touches[0].pageX,n=t.touches[0].pageY,a=this.mxObj,l=a.screenCoord2Doc(e,n,0);if(a.isMxCAD()){var c=a.getMxCAD();if(!c)return;var u=!0;if(c&&c.getGrip().onMouseLBDown(l)&&(u=!1),u)return r.MxFun.sendStringToExecute("Mx_IntelliSel",{pt1:l}),1}else if(!a.getMxDatabase().getGripManager().onMouseLBDown(l)){var h=new o.Vector3(e,n,0);return r.MxFun.sendStringToExecute("Mx_FrontEndWebpageIntelliSel",{pt:h}),1}}return 0},c.prototype.onMousdown=function(t){if(t.button==i.MxJigCmdManager.MouseButton.kRight&&i.MxJigCmdManager.isRunning())return i.MxJigCmdManager.stopCmd(),0;if(s.MxDrawData.m_isEnableIntelliSelect&&t.button==i.MxJigCmdManager.MouseButton.kLeft&&!i.MxJigCmdManager.isRunning()){var e=this.mxObj,n=e.screenCoord2Doc(t.offsetX,t.offsetY,0);if(e.isMxCAD()){var a=e.getMxCAD();if(!a)return;var l=!0;if(a&&a.getGrip().onMouseLBDown(n)&&(l=!1),l)return r.MxFun.sendStringToExecute("Mx_IntelliSel",{pt1:n}),1}else if(!(e.getMxDatabase().getGripManager().onMouseLBDown(n)||e.isValidMcObject()&&e.getMcObject().getGripManager().onMouseLBDown(n))){var c=new o.Vector3(t.offsetX,t.offsetY,0);return r.MxFun.sendStringToExecute("Mx_FrontEndWebpageIntelliSel",{pt:c}),1}}return 0},c.prototype.init=function(t,e){this.mxObj=t;var n=this;e.addEventListener("mousemove",function(t){return n.onMousemove(t)}),e.addEventListener("mousedown",function(t){return n.onMousdown(t)}),e.addEventListener("touchstart",function(t){return n.onTouchStart(t)})},c);function c(){}n.MxDrawObjectEventDefautProc=l;var u=(h.prototype.onMousedown=function(t){this.callEvent("mousedown",t)},h.prototype.onMousemove=function(t){this.callEvent("mousemove",t)},h.prototype.onMouseup=function(t){this.callEvent("mouseup",t)},h.prototype.registEvent=function(t){var e=t.getOrbitControls();if(!e)return!1;var n=e.domElement,i=this;r.MxFun.isPC()?(n.addEventListener("mouseup",function(t){i.onMouseup(t)},!0),n.addEventListener("mousemove",function(t){i.onMousemove(t)},!0),n.addEventListener("mousedown",function(t){i.onMousedown(t)},!0)):(n.addEventListener("touchstart",function(t){i.callEvent("touchstart",t)},!0),n.addEventListener("touchend",function(t){i.callEvent("touchend",t)},!0),n.addEventListener("touchmove",function(t){i.callEvent("touchmove",t)},!0)),this.defautProc.init(t,this)},h.prototype.getEventCall=function(t){var e;return"mousemove"==t?e=this.aryMousemoveEventCall:"mouseup"==t?e=this.aryMouseupEventCall:"mousedown"==t?e=this.aryMousedownEventCall:"touchstart"==t?e=this.aryTouchstartEventCall:"touchend"==t?e=this.aryTouchendEventCall:"touchmove"==t&&(e=this.aryTouchmoveEventCall),e},h.prototype.callEvent=function(t,e){var n=this.getEventCall(t);if(n){for(var r=n.slice(),i=0,o=r.length;i<o;i++){var a=r[i](e);if(1==a)return a}return 0}},h.prototype.addEventListener=function(t,e,n){void 0===n&&(n=!1);var r=this.getEventCall(t);return!!r&&(-1<r.indexOf(e)||(n?r.unshift(e):r.push(e)),!0)},h.prototype.removeEventListener=function(t,e){var n=this.getEventCall(t);if(!n)return!1;var r=n.indexOf(e);return-1<r&&(n.splice(r,1),!0)},h);function h(){this.aryMousedownEventCall=[],this.aryMouseupEventCall=[],this.aryMousemoveEventCall=[],this.aryTouchstartEventCall=[],this.aryTouchendEventCall=[],this.aryTouchmoveEventCall=[],this.defautProc=new l}n.MxDrawObjectEvent=u},{"./MxDrawData":29,"./MxFun":34,"./Operate/MxJigCmdManager":58,"./UI/MxUiVue":67,three:19}],34:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxFun=void 0;var r,i,o,a,s,l,c,u,h,d,p,f,m,g,y=t("three"),v=t("./MxManager"),x=t("./MxDrawObject"),b=t("./MxDrawObject2d"),w=t("./MxDrawObject3d"),M=t("./UI/MxUiObjectMobile"),_=t("./UI/MxUiObjectPC"),C=t("./Operate/MxJigCmdManager"),S=t("./Operate/MxJigGetLine"),T=t("./Operate/MxCmdRunManager"),E=t("./UI/MxUiVue"),D=t("./MxThreeJS"),A=t("./MxWindowsEvent"),O=t("./MxTools"),P=t("./MxDrawCommands"),L=t("./MxDrawData"),R=t("./MxCAD/MxCADEditDisplay"),I=t("./MxLocalFileLoad"),k=t("./TempTest/MxTestJig"),F=t("./MxVersion"),B=t("./MrxDbgUtils");function j(t){t.cmd&&U(t.cmd)}function N(t){var e=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),n=window.location.href,r=n.indexOf("?"),i=(n=-1==r?"":n.substring(r)).substr(1).match(e);return null!=i?decodeURIComponent(i[2]):""}function z(){return v.MxManager.currentMx()}function V(){return v.MxManager.currentMx()}function G(t,e){var n={};if(null!=t)if(t instanceof Array)n.is2d=!0;else{0==t.length&&(t="empty");var r=t.substring(t.lastIndexOf(".")+1).toLowerCase();if("dwg"!=r&&"dxf"!=r&&"dwf"!=r&&"mwg"!=r&&"wgh"!=r||(n.is2d=!0),1!=e&&null!=e&&"wgh"!=r){var i=void 0,o=t.split("/");"$"==(i=1==o.length?o[0]:o[o.length-1])[0]&&(i=i.substring(1));for(var a=void 0,s=0;s<o.length-1;s++)a=0==s?o[s]:a+"/"+o[s];t=a?a+"/$"+i+".mxb1.wgh":"$"+i+".mxb1.wgh"}}else t="empty";return n.sFileName=t,n}function H(t){if("string"==typeof t){var e=t.substring(t.lastIndexOf(".")+1).toLowerCase();if("dwg"!=e&&"wgh"!=e){var n=t.lastIndexOf("?");if(-1!=n){var r=t.substring(n,t.length);return{sFileName:t=t.substring(0,n),sUrlParam:r}}}}return null}function U(t,e){var n=V();return T.MxCmdRunManager.runCmd(n,t,e)}function W(t){null!=t&&(t.init(),E.MxUiVue.init(t)),p||(console.log("MxDraw Version:"+F.MxBulid.getVersion()),p=!0,g=new I.MxLocalNodeJs,C.MxJigCmdManager.init(),A.MxWindowsEvent.registEvent(),v.MxManager.init(),P.MxDrawCommands.registerCommand(),window.mxConfig_isLoadTest&&k.MxTest.registerCommand(),m.sendStringToExecute=j)}r=n.MxFun||(n.MxFun={}),i=".",c=s=a=-1,d=null,p=!(h="ws://localhost:5090"),m={},g=f=u=l=o=void 0,r.getUiObj=function(){return d},r.getNodeJs=function(){return g},r.setMxServer=function(t){h=t},r.getMxServer=function(){return h},r.isPC=function(){return!/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)},r.getClientPlatform=function(){return navigator.platform},r.getClientInfo=function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},r.curPath=function(){return i},r.setCurPath=function(t){i=t},r.getQueryString=N,r.getLocationPageUrl=function(){var t=window.location.href,e=t.lastIndexOf("?");return-1==e?t:t.substring(0,e)},r.getUrlParams=function(){var t=window.location.search,e=t.substr(1,t.length).split("&"),n=new Array;if(null!=e)for(var r=0;r<e.length;r++){var i=e[r].replace(/[=|^==]/,"&").split("&");if(1<i.length){var o=new Array;o.push(decodeURIComponent(i[0])),o.push(decodeURIComponent(i[1])),n.push(o)}}return n},r.call=function(t,e,n){null==e?e="{}":"string"==typeof e?0==e.length?e="{}":"["==e[0]&&"]"==e[e.length-1]||"{"==e[0]&&"}"==e[e.length-1]||(e='"'+(e=e.replace(/"/g,"'"))+'"'):e="object"==typeof e?JSON.stringify(e):"{}",v.MxManager.currentMx().call(t,e,n)},r.loadCodeToServer=function(t,e){v.MxManager.currentMx().loadCodeToServer(t,e)},r.getCurrentMx=z,r.getCurrentMxCAD=function(){var t=z();return t?t.getMxCAD():null},r.loadCodeFileToServer=function(t,e,n){v.MxManager.currentMx().loadCodeFileToServer(t,e,n)},r.isEnableSelect=function(){if(-1!=a)return 1==a;var t=N("select");return a=0,null!=t&&"y"==t.toLowerCase()&&(a=1),1==a},r.is3DDwg=function(){if(-1!=c)return 1==c;var t=N("3ddwg");return c=0,null!=t&&"y"==t.toLowerCase()&&(c=1),1==c},r.isStaticLoad=function(){if(-1!=s)return 1==s;var t=N("static");return s=0,null!=t&&"y"==t.toLowerCase()&&(s=1),1==s},r.enableSelect=function(t){a=t?1:0},r.enablStaticLoad=function(t){s=null==t||t?1:0},r.dwgDir=function(){return null!=l||null==(l=N("dwgdir"))&&(l=""),l},r.setDwgDir=function(t){l=t},r.getStaticServer=function(){return null!=u||null==(u=N("staticServer"))&&(u=""),u},r.setStaticServer=function(t){u=t},r.is2dParam=function(){if(null!=o)return o;var t=N("file");if(o=!1,null!=t){var e=t.substring(t.lastIndexOf(".")+1);"dwg"!=e.toLowerCase()&&"dxf"!=e.toLowerCase()&&"dwf"!=e.toLowerCase()&&"mwg"!=e.toLowerCase()||(o=!0)}return o},r.set2dParam=function(t){o=t},r.showLayer=function(t,e,n){var r=v.MxManager.currentMx().getMxCAD();if(!r)return v.MxManager.currentMx().showLayer(t,e,n);"number"==typeof t&&R.MxCADDisplayFun.showLayer(r.getDatabase(),t,e)},r.upDisplayForLayerData=function(t){var e=v.MxManager.currentMx().getMxCAD();return!!e&&e.getDatabase().getLayerTable().upDisplayForLayerData(e.getDatabase(),t)},r.screenCoord2World=function(t,e,n){return t instanceof Object?v.MxManager.currentMx().screenCoord2World(t.x,t.y,t.z):v.MxManager.currentMx().screenCoord2World(t,e,n)},r.worldCoord2Screen=function(t,e,n){return t instanceof Object?v.MxManager.currentMx().worldCoord2Screen(t.x,t.y,t.z):v.MxManager.currentMx().worldCoord2Screen(t,e,n)},r.docCoord2Cad=function(t,e,n){return t instanceof Object?v.MxManager.currentMx().docCoord2Cad(t.x,t.y,t.z):v.MxManager.currentMx().docCoord2Cad(t,e,n)},r.cadCoord2Doc=function(t,e,n){return t instanceof Object?v.MxManager.currentMx().cadCoord2Doc(t.x,t.y,t.z):v.MxManager.currentMx().cadCoord2Doc(t,e,n)},r.docCoord2World=function(t,e,n){return t instanceof Object?v.MxManager.currentMx().docCoord2World(t.x,t.y,t.z):v.MxManager.currentMx().docCoord2World(t,e,n)},r.worldCoord2Doc=function(t,e,n){return t instanceof Object?v.MxManager.currentMx().worldCoord2Doc(t.x,t.y,t.z):v.MxManager.currentMx().worldCoord2Doc(t,e,n)},r.screenCoord2Doc=function(t,e,n){return t instanceof Object?v.MxManager.currentMx().screenCoord2Doc(t.x,t.y,t.z):v.MxManager.currentMx().screenCoord2Doc(t,e,n)},r.docCoord2Screen=function(t,e,n){return t instanceof Object?v.MxManager.currentMx().docCoord2Screen(t.x,t.y,t.z):v.MxManager.currentMx().docCoord2Screen(t,e,n)},r.zoomCenter=function(t,e){v.MxManager.currentMx().is2D()&&(v.MxManager.currentMx().zoomCenter(t,e),v.MxManager.currentMx().updateDisplay())},r.zoomW=function(t,e,n,r,i){v.MxManager.currentMx().is2D()&&(v.MxManager.currentMx().zoomW(new y.Vector3(t,e,0),new y.Vector3(n,r,0),i),v.MxManager.currentMx().updateDisplay())},r.zoomScale=function(t){v.MxManager.currentMx().is2D()&&(v.MxManager.currentMx().zoomScale(t),v.MxManager.currentMx().updateDisplay())},r.zoomAll=function(){v.MxManager.currentMx().is2D()&&(v.MxManager.currentMx().zoomAll(),v.MxManager.currentMx().updateDisplay())},r.deleteAll=function(){return v.MxManager.currentMx().deleteAll()},r.callCommand=function(t,e,n){v.MxManager.currentMx().callCommand(t,e,n)},r.getCurrentColor=function(){return v.MxManager.currentMx().getCurrentColor()},r.setCurrentColor=function(t){v.MxManager.currentMx().setCurrentColor(t)},r.undo=function(){v.MxManager.currentMx().undo()},r.save=function(){v.MxManager.currentMx().save()},r.showLoading=function(){null!=d&&d.ShowLoading()},r.hideLoading=function(){null!=d&&d.HideLoading()},r.showProp=function(t){null!=d&&d.ShowObjectProperty(t)},r.hideProp=function(){null!=d&&d.HideObjectProp()},r.getUiObject=function(){return d},r.getViewCenterDocCoord=function(){return v.MxManager.currentMx().is2D()?v.MxManager.currentMx().getViewCenterDocCoord():new y.Vector3(0,0,0)},r.screenCoordLong2Doc=function(t){return v.MxManager.currentMx().is2D()?v.MxManager.currentMx().screenCoordLong2Doc(t):t},r.docCoordLong2Screen=function(t){return v.MxManager.currentMx().is2D()?v.MxManager.currentMx().docCoordLong2Screen(t):t},r.worldCoordLong2Doc=function(t){return v.MxManager.currentMx().is2D()?v.MxManager.currentMx().worldCoordLong2Doc(t):t},r.docCoordLong2World=function(t){return v.MxManager.currentMx().is2D()?v.MxManager.currentMx().docCoordLong2World(t):t},r.screenCoordLong2World=function(t){return v.MxManager.currentMx().is2D()?v.MxManager.currentMx().screenCoordLong2World(t):t},r.worldCoordLong2Screen=function(t){return v.MxManager.currentMx().is2D()?v.MxManager.currentMx().worldCoordLong2Screen(t):t},r.addSelectEvent=function(t){v.MxManager.addSelectEvent(t)},r.clearSelectEvent=function(){v.MxManager.clearSelectEvent()},r.removeThreejsObject=function(t,e,n){t&&(t.traverse(function(t){(t instanceof y.Mesh||t instanceof y.Line||t instanceof y.LineLoop)&&(t.geometry.dispose(),n&&(t.material instanceof Array?t.material.forEach(function(t){t.dispose()}):t.material.dispose()))}),e.remove(t))},r.setOutServerDebugCall=function(t){v.MxManager.setOutDebugCall(t)},r.updateDisplay=function(){v.MxManager.updateDisplay()},r.getCurrentDraw=V,r.formatString=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++)t=t.replace("{".concat(r,"}"),e[r]);return t},r.createMxUiObject=function(t){var e;return e=this.isPC()?new _.MxUiObjectPC:new M.MxUiObjectMobile,t(d=e),e.create(),e},r.openFile=function(t,e){var n="";if("string"==typeof t){var r=H(t);r&&(n=r.sUrlParam,t=r.sFileName)}null==e&&(e=!1);var i=G(t,e);return i.is2d&&(o=i.is2d),t=i.sFileName,v.MxManager.currentMx().openFile(t,n)},r.createMxObject=function(t,e,n,i,o,a,s,l){p||W(),"string"==typeof t&&(t=0==t.length?void 0:document.getElementById(t));var c=null,u="";if(l)e="",(c=new b.MxDrawObject2d).setViewColor(0),c.initRunMode(x.MxRunMode.kCPPMxCAD);else{if(null==e)e=r.getQueryString("file");else{var h=H(e);h&&(u=h.sUrlParam,e=h.sFileName)}var d=null!=i&&i,f=G(e,a);f.is2d&&(d=f.is2d),e=f.sFileName,1==o&&(e=""),d?(c=new b.MxDrawObject2d).setViewColor(0):(c=new w.MxDrawObject3d).setViewColor(15790320)}return null!=n&&n(c),c.create(t,e,u,s),c},r.getMxObjectFormElement=function(t){return v.MxManager.getMxObject(t)},r.isRunningCommand=function(){return C.MxJigCmdManager.isRunning()},r.stopRunCommand=function(){return C.MxJigCmdManager.stopCmd()},r.runCommand=function(t){return C.MxJigCmdManager.runCmd(t)},r.getTHREE=function(){return y},r.getLine=function(t){var e=new S.MxJigGetLine;e.setRetCall(t),C.MxJigCmdManager.runCmd(e)},r.addCommand=function(t,e,n){T.MxCmdRunManager.addCommand(t,e,n)},r.sendStringToExecute=U,r.getMxEntity=function(t){var e=V();return e?e.getMxEntityUserObject(t):null},r.initUiDataObject=function(t){E.MxUiVue.isNull()&&(t.init(r),E.MxUiVue.init(t))},r.init=W,r.addWindowsEvent=function(t){A.MxWindowsEvent.addEvent(t)},r.getCurrentMousePostion=function(){return A.MxWindowsEvent.getCurrentMousePostion()},r.getMxThreeJS=function(){return D.MxThreeJS},r.getMxTools=function(){return O.MxTools},r.getMxCmdRunManager=function(){return T.MxCmdRunManager},r.getMxJigCmdManager=function(){return C.MxJigCmdManager},r.initQuickCommand=function(t){T.MxCmdRunManager.InitQuickCommand(t)},r.Assert=function(t){t||console.log("MxAssert error")},r.setIniset=function(t){L.MxDrawData.setIniset(t)},r.setPostMessageToParentFrameFunction=function(t){f=t},r.postMessageToParentFrame=function(t){return null!=f&&(f(t),!0)},r.onParentFrameMessage=function(t){null!=t&&null!=t.type&&m[t.type]&&m[t.type](t)},r.acutPrintf=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!E.MxUiVue.isNull()){for(var r=arguments,i=r[0],o=0;o<r.length-1;o++){var a=new RegExp("\\{"+o+"\\}","gm");i=i.replace(a,r[o+1])}E.MxUiVue.AcutPrintfNoFormat(i,!0)}},r.loadImageMaterial=function(t,e){v.MxManager.getMxDbTextureManager().loadImage(t,e)},r.loadSVG=function(t,e,n,r){v.MxManager.getMxDbSvgManager().loadSVG(t,e,n,r)},r.initMxDbEntityType=function(t){v.MxManager.getMxDbEntityClassHierarchy().init(t)},r.initDynamicCreate=function(t){v.MxManager.getMxDbEntityClassHierarchy().initDynamic(t)},r.ceneratecursor=function(t,e,n,r){void 0===t&&(t=128),void 0===e&&(e=10),void 0===n&&(n=!0);var i=document.createElement("canvas");i.width=i.height=t,i.style.background="transparent";var o=i.getContext("2d"),a=t%2==0?-.5:0,s=e%2==0?-.5:0;o.strokeStyle=r||"#fff",n&&(o.beginPath(),o.moveTo(i.width/2+a,a),o.lineTo(i.width/2+a,i.height+a),o.stroke(),o.beginPath(),o.moveTo(a,i.height/2+a),o.lineTo(i.width+a,i.height/2+a),o.stroke()),o.beginPath(),o.strokeRect(t/2-e/2+s,t/2-e/2+s,e,e),o.stroke();var l=new Image;return l.src=i.toDataURL("image/png"),l.src},r.getMrxDbgUtilsClass=function(){return B.MrxDbgUtils}},{"./MrxDbgUtils":20,"./MxCAD/MxCADEditDisplay":21,"./MxDrawCommands":28,"./MxDrawData":29,"./MxDrawObject":30,"./MxDrawObject2d":31,"./MxDrawObject3d":32,"./MxLocalFileLoad":35,"./MxManager":36,"./MxThreeJS":44,"./MxTools":45,"./MxVersion":47,"./MxWindowsEvent":48,"./Operate/MxCmdRunManager":53,"./Operate/MxJigCmdManager":58,"./Operate/MxJigGetLine":59,"./TempTest/MxTestJig":63,"./UI/MxUiObjectMobile":65,"./UI/MxUiObjectPC":66,"./UI/MxUiVue":67,three:19}],35:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxLocalDwgFileLoad=n.MxLocalFileLoad=n.MxLocalNodeJs=void 0;var r=t("./MxFun"),i=(o.prototype.init=function(t){this.loadFileCall=t.loadFileFun},o.prototype.loadFile=function(t,e,n,r,i){null!=this.loadFileCall?this.loadFileCall(t,e,n,r,i):i(void 0)},o);function o(){this.loadFileCall=null}n.MxLocalNodeJs=i;var a=(s.prototype.setPath=function(t){this.path=t},s.prototype.setBinary=function(t){this.isBinary=t},s.prototype.load=function(t,e,n,i){r.MxFun.getNodeJs().loadFile(this.path+t,this.isBinary,e,n,i)},s);function s(){this.path="",this.isBinary=!1}n.MxLocalFileLoad=a;var l=(c.prototype.setShowloading=function(t){this._isShowLoading=t},c.prototype.load=function(t,e){var n="$"+e+".mxb1.wgh";this._path=t,this._filename=e;var r=this;this.getFile(this._path,n,!1,function(t){"string"==typeof t?r.net.onStaticHeadMessage(t):console.log("mx error h1")},function(){console.log("mx get "+n+" faild")})},c.prototype.getDatas=function(){if(this._iGet>=this._dataNum)this._isShowLoading&&r.MxFun.hideLoading();else{var t=this._dataType[this._iGet];this._iGet++;var e=this,n=this._iGet+1,i="$"+this._filename+".mxb"+n+".wgh",o=0!=t;this.getFile(this._path,i,o,function(t){e.net.onStaticMessage(t),e.getDatas()},function(){e._dataNum=0,e._iGet=0,e._isShowLoading&&r.MxFun.hideLoading(),console.log("mx get "+i+" faild")})}},c.prototype.onRenderHead=function(t){var e=JSON.parse(t);this._dataType=e.type,this._dataNum=e.count,this._iGet=0,this._isShowLoading&&r.MxFun.showLoading(),this.getDatas()},c.prototype.getFile=function(t,e,n,r,i){var o=new a;o.setPath(t),o.setBinary(n),o.load(e,r,function(){},i)},c);function c(t){this.net=null,this._dataNum=0,this._iGet=0,this._dataType=[],this._path="",this._filename="",this._isShowLoading=!0,this.net=t}n.MxLocalDwgFileLoad=l},{"./MxFun":34}],36:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxManager=n.MxData=void 0;var r,i,o,a,s,l,c,u,h,d,p=t("./View/MxDbEntity"),f=t("./View/MxDbTextureManager"),m=t("./SVGLoader/MxSVGLoader");(r=n.MxData||(n.MxData={})).iSelectRenderOrder=5,r.iCADMeshRenderOrder=10,r.iCADCurveRenderOrder=20,r.iMxEntityRenderOrder=30,r.iGripRenderOrder=110,r.iDynJigRenderOrder=120,i=n.MxManager||(n.MxManager={}),o=[],a=null,l=[],c=void(s=0),u=new f.MxDbTextureManager,h=new m.MxSvgManager,d=new p.MxDbEntityClassHierarchy,i.add=function(t){o.push(t)},i.allocId=function(){return++s},i.getMxDbEntityClassHierarchy=function(){return d},i.getMxDbTextureManager=function(){return u},i.getMxDbSvgManager=function(){return h},i.outDebugString=function(t){null==c?console.log(t):c(t)},i.setOutDebugCall=function(t){c=t},i.onLoad=function(){for(var t in o)o[t].onLoad("")},i.updateDisplay=function(){for(var t in o)o[t].updateDisplay()},i.currentMx=function(){return a},i.setCurrentMx=function(t){a=t},i.initResize=function(){for(var t in o)o[t].initResize()},i.addSelectEvent=function(t){l.push(t)},i.clearSelectEvent=function(){l=[]},i.callSelectObject=function(t){for(var e in l)if(1==l[e](t))break},i.init=function(){},i.getMxObject=function(t){if("number"==typeof t){for(var e in o)if(o[e].getId()===t)return o[e]}else for(var e in o)if(o[e].getCanvas()===t)return o[e];return null}},{"./SVGLoader/MxSVGLoader":61,"./View/MxDbEntity":71,"./View/MxDbTextureManager":76}],37:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxMaterial=void 0;var r=t("three");!function(t){t.shaderUniforms={crAmbient:{value:new r.Vector3(1,0,0)},crDiffuse:{value:new r.Vector3(1,0,0)},crSpecular:{value:new r.Vector3(1,0,0)}},t.m_arrSystemColors=new Array(0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10066176,10066252,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510272,8755532,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019904,7510348,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529536,6265164,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,39168,5019980,32512,4161343,19456,2509862,65343,8388511,52275,6737023,39206,5019999,32543,4161359,19475,2509871,65407,8388543,52326,6737049,39244,5020018,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39282,5020037,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39321,5020057,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29337,5014937,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19609,5010073,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9881,5005209,8063,4149119,4940,2502476,255,8355839,204,6710988,153,5000345,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490521,6245529,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980889,7490713,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471257,8735897,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,10027161,10046617,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,10027122,10046597,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,10027084,10046578,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,10027046,10046559,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215),t.m_arrDefUseMaterials=new Array(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null),t.m_arrDefUseCurveMaterials=new Array(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null),t.m_arrDefUseBasicMaterials=new Array(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null),t.m_selectMaterial=new r.MeshPhongMaterial({color:255,opacity:.2,transparent:!0,side:r.DoubleSide}),t.m_mouseMoveMaterial=new r.MeshPhongMaterial({color:16776960,side:r.DoubleSide}),t.m_lockedMaterial=new r.MeshPhongMaterial({color:197379,side:r.DoubleSide}),t.m_samplePoints=new r.PointsMaterial({color:255,depthTest:!1,size:8}),t.m_samplePointsMouseMove=new r.PointsMaterial({color:16711680,depthTest:!1,size:12});var e=new r.MeshBasicMaterial({color:16777215,transparent:!0,depthTest:!1,side:r.DoubleSide,opacity:1,stencilWrite:!1,colorWrite:!1});t.getStencilMaterial=function(){return e},t.GetColorByIndex=function(e){return t.m_arrSystemColors[e]},t.GetColorMaterial=function(e){var n=t.m_arrDefUseMaterials[e];return null===n&&(n=new r.MeshLambertMaterial({color:t.m_arrSystemColors[e],side:r.DoubleSide}),t.m_arrDefUseMaterials[e]=n),n},t.GetBaseColorMaterial=function(e){var n=t.m_arrDefUseBasicMaterials[e];return null===n&&(n=new r.MeshBasicMaterial({color:t.m_arrSystemColors[e],side:r.DoubleSide}),t.m_arrDefUseMaterials[e]=n),n},t.GetCurveColorMaterial=function(e){var n=t.m_arrDefUseCurveMaterials[e];return null===n&&(n=new r.LineBasicMaterial({color:t.m_arrSystemColors[e],linewidth:1}),t.m_arrDefUseCurveMaterials[e]=n),n},t.GetSelectMaterial=function(){return t.m_selectMaterial},t.GetMouseMoveMaterial=function(){return t.m_mouseMoveMaterial},t.GetLockedMaterial=function(){return t.m_lockedMaterial},t.GetSamplePointsMaterial=function(){return t.m_samplePoints},t.GetSamplePointsMouseMoveMaterial=function(){return t.m_samplePointsMouseMove},t.createMaterial=function(t){var e=void 0;if(null==t)return e;function n(t,e){if(null!=e.map){var n=e.map,i=(new r.TextureLoader).load(n);i.wrapS=i.wrapT=r.RepeatWrapping,t.map=i,t.side=r.DoubleSide}}return 0!=t.transparent?t.transparent=!0:t.transparent=!1,"MeshPhongMaterial"==t.name?n(e=new r.MeshPhongMaterial(t),t):"MeshBasicMaterial"==t.name?n(e=new r.MeshBasicMaterial(t),t):"MeshDepthMaterial"==t.name?n(e=new r.MeshDepthMaterial(t),t):"MeshNormalMaterial"==t.name?n(e=new r.MeshNormalMaterial(t),t):"MeshLambertMaterial"==t.name?n(e=new r.MeshLambertMaterial(t),t):"MeshStandardMaterial"==t.name&&n(e=new r.MeshStandardMaterial(t),t),e}}(n.MxMaterial||(n.MxMaterial={}))},{three:19}],38:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxHFileLoad=n.MxNet=n.MxNetBinMessageType=n.MxNetSend=n.MxNetMessage=n.MxNetMessageType=n.MxNetData=void 0;var r,i,o=t("three"),a=t("./MxFun"),s=t("pako"),l=t("./MxManager"),c=t("./MxDrawData"),u=(h.prototype.getId=function(){return this._dataView.getInt32(4,!0)},h.prototype.getVersion_MwBlobHead=function(){return this._dataView.getInt32(60,!0)},h.prototype.getVersion_MwBlobHeadDynLen=function(){return this._dataView.getInt32(4,!0)},h.prototype.getdPointCurveBuffersHead=function(){var t={};return t.ver=this._dataView.getInt32(4,!0),t.databaseIndex=this._dataView.getInt32(8,!0),t.zeroLayerIdIndex=this._dataView.getInt32(16,!0),t.datacount=this._dataView.getInt32(20,!0),t.datasize=this._dataView.getInt32(24,!0),t},h.prototype.getdPointMeshBuffersHead=function(){var t={};return t.ver=this._dataView.getInt32(4,!0),t.databaseIndex=this._dataView.getInt32(8,!0),t.id=this._dataView.getInt32(12,!0),t.zeroLayerIdIndex=this._dataView.getInt32(16,!0),t.datacount=this._dataView.getInt32(20,!0),t.datasize=this._dataView.getInt32(24,!0),t},h.prototype.getdPointTextureBuffersHead=function(){var t={};return t.ver=this._dataView.getInt32(4,!0),t.databaseIndex=this._dataView.getInt32(8,!0),t.zeroLayerIdIndex=this._dataView.getInt32(16,!0),t.datacount=this._dataView.getInt32(20,!0),t.datasize=this._dataView.getInt32(24,!0),t},h.prototype.getBlobHeadForMemorySectionsHead=function(t){var e={};return e.type=this._dataView.getInt32(t,!0),t+=4,e.ver=this._dataView.getInt32(t,!0),t+=4,e.databaseIndex=this._dataView.getInt32(t,!0),t+=4,e.nOffset=t,e},h.prototype.getMemorySectionsHead=function(){var t=this.getBlobHeadForMemorySectionsHead(0);return t.zeroLayerIdIndex=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datacount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},h.prototype.getMemorySectionHead=function(t){var e=this.getBlobHeadForMemorySectionsHead(t);return t=e.nOffset,e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.memColor=this._dataView.getInt32(t,!0),t+=4,e.memId=this._dataView.getInt32(t,!0),t+=4,e.memType=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},h.prototype.getdPointTextureBufferDataHead=function(t){t+=4,t+=4,t+=4;var e={};return e.dataCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},h.prototype.getdPointCurveBufferDataHead=function(t){t+=4,t+=4,t+=4;var e={};return e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},h.prototype.getdPointMeshBufferDataHead=function(t){t+=4,t+=4,t+=4;var e={};return e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},h.prototype.getDatabaseIndex=function(){return this._dataView.getInt32(8,!0)},h.prototype.getColorIndex=function(){return this._dataView.getInt32(24,!0)},h.prototype.getBufferType=function(){return this._dataView.getInt32(32,!0)},h.prototype.getIsSketchEntity=function(){return this._dataView.getInt32(40,!0)},h.prototype.getLayerId=function(){return this._dataView.getInt32(44,!0)},h.prototype.getBlockId=function(){return this._dataView.getInt32(48,!0)},h.prototype.getVertexBufferSize=function(){return this._dataView.getInt32(12,!0)},h.prototype.getIndexBufferSize=function(){return this._dataView.getInt32(16,!0)},h.prototype.getZeroLayerId=function(){return this._dataView.getInt32(52,!0)},h.prototype.getSelectMark=function(){return this._dataView.getInt32(56,!0)},h.prototype.getMateria=function(){var t=this._dataView.getInt32(36,!0);if(0==t)return"";for(var e=[],n=0;n<t;n++){var r=String.fromCharCode(this._dataView.getUint8(80+n));e.push(r)}return e.join("")},h.prototype.getDrawDataOffset=function(){return this._dataView.getInt32(36,!0)+80},h.prototype.getMesh=function(){var t=this._dataView.getInt32(4,!0),e=0==this._dataView.getInt32(32,!0),n={},r=this._dataView.getInt32(12,!0),i=this._dataView.getInt32(16,!0);if(0===r||0===i)return n.size=80,n;var a,s=new o.Geometry,l=80;a=e?r/4/8:r/4/2;for(var c=0;c<a;c++){var u=this._dataView.getFloat32(l+0,!0),h=this._dataView.getFloat32(l+4,!0),d=0;e?(d=this._dataView.getFloat32(l+8,!0),this._dataView.getFloat32(l+12,!0),this._dataView.getFloat32(l+16,!0),this._dataView.getFloat32(l+20,!0),this._dataView.getFloat32(l+24,!0),this._dataView.getFloat32(l+28,!0),l+=32):l+=8;var p=new o.Vector3(u,h,d);s.vertices.push(p)}var f=i/4;for(c=0;c<f;c+=3){var m=this._dataView.getInt32(l,!0);l+=4;var g=this._dataView.getInt32(l,!0);l+=4;var y=this._dataView.getInt32(l,!0);l+=4;var v=new o.Face3(m,g,y);s.faces.push(v)}var x=this.getIsSketchEntity();return n.size=l,n.geometry=s,n.id=t,n.isSketchEntity=x,n.nColorIndex=this._dataView.getInt32(24,!0),n},h.prototype.getCurve=function(t){var e,n=this._dataView.getInt32(32,!0),r=this.getIsSketchEntity(),i=0==n,a={};if((e=i?this._dataView.getInt32(20,!0)/4/3:this._dataView.getInt32(20,!0)/4/2)<2)return a;for(var s=new o.Geometry,l=t,c=0;c<e;c++){var u=this._dataView.getFloat32(l,!0);l+=4;var h=this._dataView.getFloat32(l,!0);l+=4;var d=0;i&&(d=this._dataView.getFloat32(l,!0),l+=4),s.vertices.push(new o.Vector3(u,h,d))}var p=this._dataView.getInt32(4,!0);return a.size=l,a.geometry=s,a.id=p,a.isSketchEntity=r,a.colorIndex=this._dataView.getInt32(28,!0),a},h);function h(t){this._dataView=t}n.MxNetData=u,(i=r=n.MxNetMessageType||(n.MxNetMessageType={})).kAddLayer="00000007",i.kClearLayer="00000008",i.kHideLayer="00000009",i.kShowLayer="00000010",i.kUpdateDisplayRange="00000011",i.kCallJsReturn="00000012",i.kLayerData="00000013",i.kSendDebugString="00000014",i.kShowLoading="00000015",i.kHideLoading="00000016",i.kSelectObject="00000017",i.kGlRenderHead="00000018",i.kUserLoginResult="00000019",i.kOpenFileResult="00000020",i.kServerReturn="00000021",i.kMxCADLayerData="00000056",i.kMxCADSystemVariable="00000057";var d=(p.prototype.setJsRetCall=function(t,e,n){this.serverJsRetCall.set(e+n,t)},p.prototype.onSocketErrort=function(){this.serverJsRetCall.forEach(function(t){t(void 0)}),this.serverJsRetCall=new Map},p.prototype.Do=function(t){var e=this.net.getCurrentDatabaseId();if(-1==e){var n=t.substring(0,4);e=parseInt(n)}var r=t.substring(4,12),i=t.substring(12);return null!=this.messageCall[r]&&(this.messageCall[r](i,e),!0)},p);function p(t,e){this.messageCall=new Map,this.serverJsRetCall=new Map,this.net=null,this.net=e;var n=this;this.messageCall[r.kUpdateDisplayRange]=function(e){if(!n.net.isTzDwgStaticFile()){e=e.replace(/\\/g,"\\\\");try{var r=JSON.parse(e);if(null!=r&&t.is2D()){t.initCAD2Doc(new o.Matrix4),r.newbrownermode?r.DToSMat?c.MxDrawData.m_isCorrectLargeCoordinates?(t.intiDoc2Wold(new o.Matrix4),t.initCAD2Doc(r.DToSMat)):t.intiDoc2Wold(r.DToSMat):t.intiDoc2Wold(new o.Matrix4):t.intiDoc2Wold(r.DToWMat),t.updateCameraDisplayRange(new o.Vector3(+r.pt1[0],+r.pt1[1],+r.pt1[2]),new o.Vector3(+r.pt2[0],+r.pt2[1],+r.pt2[2]),+r.viewangle),t.initAllLayoutName(r.layout),t.updateDisplay(!0);var i=a.MxFun.getUiObj();null!=i&&(i.SetLayoutData(r.layout),i.UpDisplayLayout())}}catch(e){console.log("UpdateDisplayRange exception")}}},this.messageCall[r.kCallJsReturn]=function(t){if(0!=t.length){var e=JSON.parse(t);0==e.cmd.length&&(e.cmd="__mx_loadcode");var r=e.cmd+e.count,i=n.serverJsRetCall.get(r);i&&(n.serverJsRetCall.delete(r),"string"==typeof e.ret&&(e.ret=e.ret.replace(/\'/g,'"')),i(e.ret))}else console.log("assert(0),kCallJsReturn return empty")},this.messageCall[r.kSendDebugString]=function(t){l.MxManager.outDebugString(t)},this.messageCall[r.kUserLoginResult]=function(e){t.userLoginResult(e)},this.messageCall[r.kOpenFileResult]=function(e){t.openFileResult(e)},this.messageCall[r.kServerReturn]=function(e){t.serverReturn(e)},this.messageCall[r.kShowLoading]=function(t){n.net.isTzDwgStaticFile()||a.MxFun.showLoading()},this.messageCall[r.kHideLoading]=function(e){n.net.isTzDwgStaticFile()||(a.MxFun.hideLoading(),t.callInitCompleteEvent())},this.messageCall[r.kSelectObject]=function(t){var e=JSON.parse(t);l.MxManager.callSelectObject(parseInt(e.id))},this.messageCall[r.kGlRenderHead]=function(e){t.isStaticLocalLoad()?t.getStaticLocalNet().onRenderHead(e):(n.net.isTzDwgStaticFile()?t.getStaticLoadTzNet():t.getStaticNet()).onRenderHead(e)},this.messageCall[r.kMxCADLayerData]=function(e,n){t.getMxCAD().getOpenDisplay().OnMessageLayerData(e)},this.messageCall[r.kMxCADSystemVariable]=function(e,n){t.sysVariable().OnMessageMxCADSystemVariable(e)},this.messageCall[r.kLayerData]=function(e,n){if(0==n){if(t.addLayerInfoComplete(),null!=(s=JSON.parse(e))){if(!s.isSketch){var r=s.list;for(var i in r)t.addLayerInfo(r[i].id,r[i].colorvalue,r[i].name),1==r[i].zerolayer&&t.setZeroLayerId(r[i].id)}s.isSketch||t.callEvent("uiSetLayerData",s.list);var o=a.MxFun.getUiObj();null!=o&&(s.isSketch?o.SetSketchLayerData(s.list):o.SetLayerData(s.list),o.UpDisplayLayer())}}else{var s,l=t.getExtRefManager().getLayers(n);if(l.initComplete(),null!=(s=JSON.parse(e)))for(var i in r=s.list)l.add(r[i].id,r[i].colorvalue,r[i].name),1==r[i].zerolayer&&l.setZeroLayerId(r[i].id)}}}n.MxNetMessage=d;var f,m,g=(y.prototype.setWebSocket=function(t){this._webSocket=t},y.prototype.UndoMark=function(){null!=this._webSocket&&this._webSocket.send(this.SendType.kUndoMark+"")},y.prototype.DoCommand=function(t,e,n){null!=this._webSocket&&(null!=n?(this._callCount++,200<this._callCount&&(this._callCount=1),this._msg.setJsRetCall(n,t,this._callCount),null==e&&(e=""),this._webSocket.send(this.SendType.kCmdEx+","+t+","+this._callCount+","+e)):null==e?this._webSocket.send(this.SendType.kCmd+","+t):this._webSocket.send(this.SendType.kCmd+","+t+","+e))},y.prototype.OpenFile=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kOpenFile+","+t)},y.prototype.UserLogin=function(t,e,n){if(null!=this._webSocket){var r={};r.IdentitySign=t,r.RandomToken=null==e?"":e,r.Init=null==n?"":n,this._webSocket.send(this.SendType.kUserLogin+","+JSON.stringify(r))}},y.prototype.Init=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kInit+","+t)},y.prototype.CallServerJS=function(t,e,n){null!=this._webSocket&&(null==n?null==e||null==e||0==e.length?this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":"{}"}'):this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":'+e+"}"):(this._callCount++,200<this._callCount&&(this._callCount=1),this._msg.setJsRetCall(n,t,this._callCount),null==e||null==e||0==e.length?this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":"{}","count":"'+this._callCount+'"}'):this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":'+e+',"count":"'+this._callCount+'"}')))},y.prototype.CallLoadCodeToServer=function(t,e){null!=this._webSocket&&(this._msg.setJsRetCall(e,"__mx_loadcode",0),null!=t&&null!=t&&0!=t.length&&this._webSocket.send(this.SendType.kCallJS+","+t))},y.prototype.DeleteObject=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kDelete+","+t)},y.prototype.SelectObject=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kSelect+","+t)},y.prototype.QuitSelectObject=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kQuitSelect+","+t)},y.prototype.SendDragDrawEntity=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kAddDragDraw+","+t)},y.prototype.SendDragDrawRequest=function(){null!=this._webSocket&&(this.SendMousePickRay(),this._webSocket.send(this.SendType.kRequestDragDraw))},y.prototype.SendDragDrawDetermine=function(){null!=this._webSocket&&(this.SendMousePickRay(),this._webSocket.send(this.SendType.kDetermineDragDraw))},y.prototype.SendDragDrawCancel=function(){null!=this._webSocket&&this._webSocket.send(this.SendType.kCancelDragDraw)},y.prototype.SendMousePickRay=function(){this._webSocket},y);function y(t,e){this.SendType={},this._callCount=1,this._webSocket=t,this._msg=e,this.SendType.kCmd=0,this.SendType.kDelete=1,this.SendType.kSelect=2,this.SendType.kOpenFile=3,this.SendType.kGetDemoList=4,this.SendType.kCallJS=5,this.SendType.kAddDragDraw=6,this.SendType.kRequestDragDraw=7,this.SendType.kMousePickRay=8,this.SendType.kDetermineDragDraw=9,this.SendType.kCancelDragDraw=10,this.SendType.kQuitSelect=11,this.SendType.kInit=12,this.SendType.kCmdEx=13,this.SendType.kUserLogin=14,this.SendType.kUndoMark=15}n.MxNetSend=g,(m=f=n.MxNetBinMessageType||(n.MxNetBinMessageType={})).eBlockRef=10,m.eEntitysData=14,m.eAddEntityFor2dPointTextureBuffers=15,m.eMxNewMemorySections=16,m.kMxCADBlockRef=56,m.kMxCADMemorySections=57,m.kMxCADMemorySectionsFromChange=59,m.kMxCADNotUseMemorySectionsForChage=61,m.kMxCADEntityDisplayDatas=62;var v=(x.prototype.setCurrentDatabaseId=function(t){this._iCurrentDatabaseId=t},x.prototype.getMxDrawObject=function(){return this._mx},x.prototype.getCurrentDatabaseId=function(){return this._iCurrentDatabaseId},x.prototype.isTzDwgStaticFile=function(){return-1!=this._iCurrentDatabaseId},x.prototype.onBinMessage=function(t){var e=this._mx,n=s.inflate(t),r=new DataView(n.buffer),i=r.getInt32(0,!0);this._binMessageCall.has(i)?this._binMessageCall.get(i)(r,this._iCurrentDatabaseId):(-1==this._iCurrentDatabaseId&&(0==i?e.mxWebAddEntity(r):2==i?e.getSelect().mxWebAddEntity(r):6==i?e.removeEntityFromServer(r):11==i&&e.getExtRefManager().createExternalReferences(r)),12==i?e.mxWebAddEntityFor2dPointCurveBuffers(r,this._iCurrentDatabaseId):13==i?e.mxWebAddEntityFor2dPointMeshBuffers(r,this._iCurrentDatabaseId):8==i?e.mxWebAddEntityFor2dPointCurveBuffer(r,this._iCurrentDatabaseId):9==i?e.mxWebAddEntityFor2dPointMeshBuffer(r,this._iCurrentDatabaseId):i==f.eBlockRef&&e.mxWebCreateAllBlocks(r,this._iCurrentDatabaseId))},x.prototype.socket_onErrort=function(){this._msg.onSocketErrort()},x.prototype.socket_onMessageImp=function(t,e){if(void 0===e&&(e=!1),"string"==typeof t)this._msg.Do(t);else if(e)this.onBinMessage(t);else{var n=new FileReader;n.readAsArrayBuffer(t);var r=this;n.onload=function(t){r._mx.updateDisplay(),r.onBinMessage(n.result)}}this._mx.updateDisplay()},x.prototype.initBinMessage=function(){var t=this._mx;this._binMessageCall.set(f.kMxCADBlockRef,function(e,n){t.getMxCAD().getOpenDisplay().OnMessageDisplayBlockRef(e)}),this._binMessageCall.set(f.kMxCADMemorySections,function(e,n){t.getMxCAD().getOpenDisplay().OnMessageDisplayMemorySections(e)}),this._binMessageCall.set(f.kMxCADMemorySectionsFromChange,function(e,n){t.getMxCAD().getSyncDisplay().OnMessageDisplayMemorySectionsFromChange(e)}),this._binMessageCall.set(f.kMxCADNotUseMemorySectionsForChage,function(e,n){t.getMxCAD().getSyncDisplay().OnMessageDisplayNotUseMemorySectionsForChage(e)}),this._binMessageCall.set(f.kMxCADEntityDisplayDatas,function(e,n){t.getMxCAD().getSelect().OnMessageEntityDisplayDatas(e)}),this._binMessageCall.set(f.eEntitysData,function(e,n){t.mxWebEntitysData(e,n)}),this._binMessageCall.set(f.eAddEntityFor2dPointTextureBuffers,function(e,n){t.mxWebAddEntityFor2dPointTextureBuffers(e,n)}),this._binMessageCall.set(f.eMxNewMemorySections,function(e,n){t.mxWebAddEntityForMemorySections(e,n)})},x.prototype.init=function(t,e){var n=this;this._mx=t,this._msg=new d(t,this),this.initBinMessage(),e&&(this._webSocket=new WebSocket(a.MxFun.getMxServer()),this._webSocket.onopen=function(){var t=n._mx.getIniParam();if(0!=t.length){for(var e="{",r=t.length,i=0;i<r;i++)e=0==i?e+'"'+t[i][0]+'":"'+t[i][1]+'"':e+',"'+t[i][0]+'":"'+t[i][1]+'"';e+="}",n._send.Init(e)}},this._webSocket.onmessage=function(t){n.socket_onMessageImp(t.data)},this._webSocket.onerror=function(){console.log("mx: socket error"),n.socket_onErrort()}),this._send=new g(this._webSocket,this._msg)},x.prototype.closeWebSocket=function(){this._webSocket&&(this._send.setWebSocket(null),this._webSocket.close(),this._webSocket=null)},x.prototype.getOnMessage=function(){return this._msg},x.prototype.getSend=function(){return this._send},x.prototype.onStaticMessage=function(t){try{return this.socket_onMessageImp(t,!0),!0}catch(t){return console.log("mx file data error!"),console.log(t),!1}},x.prototype.onStaticHeadMessage=function(t){return"string"==typeof t&&this._msg.Do(t)},x);function x(){this._webSocket=null,this._send=null,this._msg=null,this._mx=null,this._binMessageCall=new Map,this._iCurrentDatabaseId=-1}n.MxNet=v;var b=(w.prototype.stopAllLoading=function(){this._isStopLoading||(this._isStopLoading=!0,this._isShowLoading&&a.MxFun.hideLoading())},w.prototype.setShowloading=function(t){this._isShowLoading=t},w.prototype.showLoading=function(){this._isShowLoading&&a.MxFun.showLoading()},w.prototype.hideLoading=function(t){this._isStopLoading||(this._isShowLoading&&a.MxFun.hideLoading(),this.net.getMxDrawObject().callInitCompleteEvent(),this.net.getMxDrawObject().callOpenFileComplete(t))},w.prototype.setRequestHeader=function(t){this._requestHeader=t},w.prototype.setUrlParam=function(t){this._urlParam=t},w.prototype.load=function(t,e){var n=a.MxFun.curPath(),r=a.MxFun.dwgDir(),i=a.MxFun.getStaticServer(),o="/buf/";if("wgh"==t.substring(t.lastIndexOf(".")+1).toLowerCase()){o="/";var s=t.substring(0,t.indexOf(".mxb1.wgh")).split("/");"$"==(t=1==s.length?s[0]:(i=t.substring(0,t.lastIndexOf("/")),s[s.length-1]))[0]&&(t=t.substring(1))}var l="$"+(t=encodeURIComponent(t))+".mxb1.wgh";0!=i.length?n=i+o:0!=r.length?n=n+"/"+r+o:n+=o,this._path=n,this._filename=t,1<(this._staticLoadingOpenFiles=e).length&&(l=e[0],this._path=void 0);var c=this;this.getFile(this._path,l,function(t){if(!c._isStopLoading)return"string"!=typeof t?(console.log("mx error h1"),void c.hideLoading(4)):c.net.onStaticHeadMessage(t)?void 0:(console.log("mx error h1:"+t),void c.hideLoading(2))},function(){c.hideLoading(3),console.log("mx get "+l+" faild")})},w.prototype.getData=function(){if(this._isStopLoading)this.hideLoading(5);else if(this._iGet>=this._dataNum)this.hideLoading(0);else{var t=this._dataType[this._iGet];this._iGet++;var e=this,n=this._iGet+1,r="$"+this._filename+".mxb"+n+".wgh";if(1<this._staticLoadingOpenFiles.length){if(this._iGet>=this._staticLoadingOpenFiles.length)return console.log("Mx staticLoadingOpenFiles error!"),void this.hideLoading(7);r=this._staticLoadingOpenFiles[this._iGet]}var i=r;this._path&&(i=this._path+r);var o=i.substring(0,i.lastIndexOf("/")+1);if(this.net.getMxDrawObject().setCurrentLoadUrl(o),0==t)this.getFile(this._path,r,function(t){e._isStopLoading||(e.net.onStaticMessage(t)||(console.log(this._path),console.log(r)),e.getData())},function(){e._dataNum=0,e._iGet=0,e.hideLoading(8),console.log("mx get "+r+" faild")});else{var a=new XMLHttpRequest,s=r;this._path&&(s=this._path+r),0!=this._urlParam.length?a.open("GET",s+this._urlParam):a.open("GET",s),c.MxDrawData.m_isRequestHeaderCacheControl&&a.setRequestHeader("Cache-Control","max-age=7200"),0!=this._requestHeader.length&&a.setRequestHeader("usertoken",this._requestHeader),a.responseType="arraybuffer",a.onload=function(){e._isStopLoading||(e.net.onStaticMessage(a.response)||console.log(s),e.getData())},a.addEventListener("error",function(t){e._dataNum=0,e._iGet=0,e.hideLoading(9),console.log("mx get "+r+" faild")},!1),a.send()}}},w.prototype.onRenderHead=function(t){if(!this._isStopLoading){var e=JSON.parse(t);this._dataType=e.type,this._dataNum=e.count,this._iGet=0,this.showLoading(),this.getData()}},w.prototype.getFile=function(t,e,n,r){var i=new o.FileLoader(this.manager);i.setPath(t);var a=e;0!=this._urlParam.length&&(a=e+this._urlParam),0!=this._requestHeader.length&&(i.requestHeader={usertoken:this._requestHeader}),i.load(a,n,function(){},r)},w);function w(t,e){this.net=null,this.manager=null,this._dataNum=0,this._iGet=0,this._dataType=[],this._path="",this._filename="",this._staticLoadingOpenFiles=[],this._isShowLoading=!0,this._requestHeader="",this._isStopLoading=!1,this._urlParam="",this.net=t,this.manager=void 0!==e?e:o.DefaultLoadingManager}n.MxHFileLoad=b},{"./MxDrawData":29,"./MxFun":34,"./MxManager":36,pako:1,three:19}],39:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxSelect=void 0;var r=t("three"),i=t("three.meshline"),o=t("./MxFun"),a=t("./MxNetData"),s=t("./MxMaterial"),l=(c.prototype.removeAll=function(){this._mapSelectMark2Entity=new Map},c.prototype.addEntity=function(t,e){var n=this._mapSelectMark2Entity.get(t);null==n&&(n=new Array,this._mapSelectMark2Entity.set(t,n)),n.push(e)},c.prototype.removeEntity=function(t){var e=new Map,n=function(t,e){var n=this.mx.getScene(),r=e;return function(e,i,a){if(null==t||i!=t)for(var s in e)o.MxFun.removeThreejsObject(e[s],n);else{var l=e.concat();r.set(t,l)}}}.call(this,t,e);this._mapSelectMark2Entity.forEach(n),this._mapSelectMark2Entity=e},c.prototype.init=function(){var t=this;t.domElement.addEventListener("mousedown",function(e){if(!1!==t.enabled&&!t.tmpDisable&&e.button==r.MOUSE.LEFT){var n=t.mx.screenCoord2Doc(e.clientX,e.clientY,0),i=t.mx.screenCoordLong2Doc(10),a=o.MxFun.formatString("[{0},{1},{2},{3}]",n.x.toString(),n.y.toString(),"0",i.toString());t.mx.callCommand("Mx_Select",a)}},!1)},c.prototype.mxWebAddEntity=function(t){var e=new a.MxNetData(t),n=e.getSelectMark();this.removeEntity(n);var r=this.mxWebAddEntity_3DChild(e);this.mxWebAddEntity_Curve(e,r)},c.prototype.mxWebAddEntity_3DChild=function(t){var e=t.getMesh();if(null==e.id)return e.size;var n=new r.Mesh(e.geometry,s.MxMaterial.GetBaseColorMaterial(1));this.mx.getScene().add(n);var i=t.getSelectMark();return this.addEntity(i,n),e.size},c.prototype.mxWebAddEntity_Curve=function(t,e){var n=t.getCurve(e);if(null!=n.id){var o=this.mx.getViewWidth(),a=this.mx.getViewHeight();this._material.resolution=new r.Vector2(o,a);for(var s=t.getSelectMark(),l=n.geometry,c=this.mx.getScene(),u=0;u+1<l.vertices.length;u+=2){var h=l.vertices[u],d=l.vertices[u+1],p=new Float32Array(6);p[0]=h.x,p[1]=h.y,p[2]=h.z,p[3]=d.x,p[4]=d.y,p[5]=d.z;var f=new i.MeshLine;f.setGeometry(p);var m=new r.Mesh(f.geometry,this._material);c.add(m),this.addEntity(s,m)}}},c);function c(t,e){this.enabled=!0,this.tmpDisable=!1,this.mx=void 0,this.domElement=void 0,this._mapSelectMark2Entity=new Map,this._material=new i.MeshLineMaterial({useMap:!1,color:new r.Color(16711680),opacity:.5,resolution:new r.Vector2(500,500),sizeAttenuation:!1,lineWidth:10,transparent:!0}),this.mx=t,this.domElement=void 0!==e?e:document}n.MxSelect=l},{"./MxFun":34,"./MxMaterial":37,"./MxNetData":38,three:19,"three.meshline":18}],40:[function(t,e,n){var r;Object.defineProperty(n,"__esModule",{value:!0}),n.MxShader=void 0,(r=n.MxShader||(n.MxShader={})).VSHADER_COLOR_POINT=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nattribute vec2 position; \nattribute vec3 color; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.VSHADER_COLOR_POINT_BYLAYER=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT=" precision highp float; \nvarying vec4 vColor; \nvoid main() { \ngl_FragColor = vColor; \n} \n",r.VSHADER_COLOR_POINT_TEXTURE=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nattribute vec2 position; \nattribute vec2 uv; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nvarying vec2 vUv; \nvoid main(){ \nvUv = uv; \nmat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT_TEXTURE=" precision highp float; \nvarying vec2 vUv; \nuniform sampler2D texture; \nvoid main() { \ngl_FragColor = texture2D( texture, vUv ); \n} \n",r.VSHADER_COLOR_POINT_CLIP=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec2 clippt1; \nuniform vec2 clippt2; \nuniform float vieww; \nuniform float viewh; \nattribute vec2 position; \nattribute vec3 color; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nvec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 ); \nvec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 ); \nvCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh); \nvCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh); \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.VSHADER_COLOR_POINT_BYLAYER_CLIP=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nuniform vec2 clippt1; \nuniform vec2 clippt2; \nuniform float vieww; \nuniform float viewh; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nvec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 ); \nvec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 ); \nvCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh); \nvCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh); \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT_CLIP="precision highp float; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main() { \nif(gl_FragCoord.x > vCp1.x && gl_FragCoord.x < vCp2.x && gl_FragCoord.y > vCp1.y && gl_FragCoord.y < vCp2.y) \ngl_FragColor = vColor; \nelse \ndiscard; \n} \n",r.VSHADER_COLOR_POINT_FORMXCAD=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \ngl_PointSize = 1.0;\nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT_FORMXCAD=" precision highp float; \nvarying vec4 vColor; \nvoid main() { \ngl_FragColor = vColor; \n} \n",r.VSHADER_COLOR_POINT_CLIP_FORMXCAD=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nuniform vec2 clippt1; \nuniform vec2 clippt2; \nuniform float vieww; \nuniform float viewh; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nvec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 ); \nvec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 ); \nvCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh); \nvCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh); \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",r.FSHADER_COLOR_POINT_CLIP_FORMXCAD="precision highp float; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main() { \nif(gl_FragCoord.x > vCp1.x && gl_FragCoord.x < vCp2.x && gl_FragCoord.y > vCp1.y && gl_FragCoord.y < vCp2.y) \ngl_FragColor = vColor; \nelse \ndiscard; \n} \n"},{}],41:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxStencilObject=void 0;var r=t("three"),i=t("./MxMaterial"),o=(a.prototype.object_onAfterRender=function(t){var e=this.aryMeshStencil;if(e&&0<e.length){t.getContext();var n=t.state.buffers;n.stencil.setLocked(!1),n.depth.setTest(!0),n.stencil.setTest(!1)}},a.prototype.object_onBeforeRender=function(t,e,n){var r=this.aryMeshStencil;if(r&&0<r.length){var i=t.getContext(),o=t.state.buffers;o.color.setMask(!1),o.color.setLocked(!0),o.depth.setTest(!1),o.stencil.setTest(!0),o.stencil.setMask(255),o.stencil.setClear(0),t.clearStencil(),o.stencil.setLocked(!0);var a=1,s=!0;r.forEach(function(r){s?(s=!1,o.stencil.setFunc(i.ALWAYS,a,255),o.stencil.setOp(i.KEEP,i.KEEP,i.REPLACE)):(o.stencil.setFunc(i.EQUAL,a,255),o.stencil.setOp(i.KEEP,i.KEEP,i.INCR),a++),t.mxRenderObject(r,e,n,r.material,null)}),o.color.setLocked(!1),o.color.setMask(!0),o.stencil.setMask(0),o.stencil.setFunc(i.EQUAL,a,255)}},a.prototype.associateObject=function(t,e){var n=this;e.forEach(function(t){if(3<=t.length){var e=new r.Shape(t),o=new r.ShapeGeometry(e),a=new r.Mesh(o,i.MxMaterial.getStencilMaterial());n.aryMeshStencil.push(a)}});var o=this;t.onBeforeRender=function(t,e,n){o.object_onBeforeRender(t,e,n)},t.onAfterRender=function(t){o.object_onAfterRender(t)}},a);function a(){this.aryMeshStencil=[]}n.MxStencilObject=o},{"./MxMaterial":37,three:19}],42:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxString=void 0;var r=(i.prototype.Find=function(t){return this.m_val.indexOf(t)},i.prototype.Left=function(t){return this.m_val.substring(0,t)},i.prototype.Right=function(t){return this.m_val.substring(t+1,this.m_val.length)},i.prototype.TrimLeft=function(t){for(;0<this.m_val.length&&this.m_val[0]==t;)this.m_val=this.m_val.slice(1)},i.prototype.TrimRight=function(t){for(;0<this.m_val.length&&this.m_val[this.m_val.length-1]==t;)this.m_val=this.m_val.slice(0,-1)},i.prototype.AnalyzeString=function(t){return this.m_val.split(t)},i.prototype.IsEmpty=function(){return 0==this.m_val.length},i.prototype.MakeUpper=function(){this.m_val=this.m_val.toUpperCase()},i.prototype.MakeLower=function(){this.m_val=this.m_val.toLowerCase()},i.prototype.GetLength=function(){return this.m_val.length},i);function i(t){this.m_val="",null!=t&&(this.m_val=t)}n.MxString=r},{}],43:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxSystemVariable=void 0;var r=t("three"),i=t("./Operate/McEdJigOsnap"),o=(a.prototype.init=function(t){this.m_mxObj=t},a.prototype.getAllLinetypeName=function(){return this.m_vecLinetype},a.prototype.getSysVarBool=function(t){return null!=this.m_data[t]&&this.m_data[t]},a.prototype.setSysVarBool=function(t,e){this.m_data[t]=e},a.prototype.setSysVarPoint=function(t,e){this.m_data[t]=e},a.prototype.OnMessageMxCADSystemVariable=function(t){this.m_vecLinetype=[];var e=JSON.parse(t);if(null!=e){var n=e.vecLinetypeName;for(var r in n)this.m_vecLinetype.push(n[r]);this.m_data.CELTYPE=e.curLinetypeName,this.m_data.CLAYER=e.clayer,this.m_data.CECOLOR=e.cecolor,this.m_data.CECOLORINDEX=e.cecolorindex}this.m_mxObj.callEvent("loadSystmeVariableComplete")},a.prototype.getSysVarPoint=function(t){return null==this.m_data[t]?new r.Vector3(0,0,0):this.m_data[t]},a.prototype.setSysVarNumber=function(t,e){this.m_data[t]=e},a.prototype.getSysVarNumber=function(t){return null==this.m_data[t]?0:this.m_data[t]},a.prototype.getSysVar=function(t){return this.m_data[t]},a.prototype.setSysVar=function(t,e){this.m_data[t]=e},a);function a(){this.m_data={},this.m_mxObj=null,this.m_vecLinetype=[],this.m_data.DYNINPUT=!0,this.m_data.GETPOINTSTATUS=0,this.m_data.CELTYPE="Continuous",this.m_data.CLAYER="0",this.m_data.CECOLOR=67108863,this.m_data.CECOLORINDEX=7,this.m_data.OSMODE=i.MxOsnapDefine.OsModeAll}n.MxSystemVariable=o},{"./Operate/McEdJigOsnap":49,three:19}],44:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxThreeJS=void 0;var r,i=t("three"),o=t("./MxFun");function a(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}(r=n.MxThreeJS||(n.MxThreeJS={})).createLine=function(t,e,n,r){var o,a=new i.Geometry;return o=r&&1!=r||0==r?new i.LineBasicMaterial({color:n,transparent:!0,depthTest:!1,opacity:r}):new i.LineBasicMaterial({color:n,transparent:!0,depthTest:!1}),a.vertices.push(t,e),new i.Line(a,o)},r.createCircle=function(t,e,n){var r=new i.CircleGeometry(e,64,3,2*Math.PI),o=new i.LineBasicMaterial({color:n,transparent:!0,depthTest:!1});r.vertices.shift();var a=new i.LineLoop(r,o);return a.position.x=t.x,a.position.y=t.y,a.position.z=t.z,a},r.clacTextSize=function(t,e){var n=document.createElement("canvas").getContext("2d");if(null==n)return e;var r=o.MxFun.formatString("normal {0}px Arial","256");return n.font=r,n.measureText(t).width*e/256},r.clacTextSpriteSize=function(t,e,n){e<=1e-8&&(e=1);var r=document.createElement("canvas"),i=r.getContext("2d"),s=o.MxFun.formatString("normal {0}px Arial","256");i.font=s;var l=e/256,c=0,u=[],h=!0,d=0;if(n){c=n;for(var p=0,f=0,m=0;f<t.length;f++)(g=i.measureText(t.substring(p,f+1))).width*l>c&&(d+=(g.fontBoundingBoxAscent+g.fontBoundingBoxDescent)*l,u.push(t.substring(p,f)),p=f,m++);if(p<f){var g=i.measureText(t.substring(p,f));u.push(t.substring(p,f)),d+=(g.fontBoundingBoxAscent+g.fontBoundingBoxDescent)*l,m++}h=m<=1}else d=e,c=(g=i.measureText(t)).width*l,u.push(t),h=!1;var y=d/c*(r.width=1024);return r.height=a(y),r.height<y&&(r.height*=2),0==r.height&&(r.height=512),{spritewidth:c,spriteheight:c*r.height/r.width,textwidth:c,allTextHeight:d,singleline:h}},r.creatTextSprite=function(t,e,n,r,s,l,c){n<=1e-8&&(n=1);var u=document.createElement("canvas"),h=u.getContext("2d");c?(h.font=c(256),0==h.font.length&&(h.font=o.MxFun.formatString("normal {0}px Arial","256"))):h.font=o.MxFun.formatString("normal {0}px Arial","256");var d=n/256,p=0,f=[],m=[],g=0;if(l){p=l;for(var y=0,v=0;v<t.length;v++)(b=h.measureText(t.substring(y,v+1))).width*d>p&&(g+=x=(b.fontBoundingBoxAscent+b.fontBoundingBoxDescent)*d,f.push(t.substring(y,v)),m.push(x),y=v);if(y<v){var x,b=h.measureText(t.substring(y,v));f.push(t.substring(y,v)),g+=x=(b.fontBoundingBoxAscent+b.fontBoundingBoxDescent)*d,m.push(x)}}else g=n,p=(b=h.measureText(t)).width*d,f.push(t),m.push(g);var w=g/p*(u.width=1024);u.height=a(w),u.height<w&&(u.height*=2),0==u.height&&(u.height=512);var M=1024/p,_=M*n;c?(h.font=c(_),0==h.font.length&&(h.font=o.MxFun.formatString("normal {0}px Arial",""+_))):h.font=o.MxFun.formatString("normal {0}px Arial",""+_);var C=o.MxFun.formatString("rgba({0}, {1}, {2}, 1.0)",(s>>16&255)+"",(s>>8&255)+"",(255&s)+"");h.fillStyle=C,h.textAlign="left",h.textBaseline="bottom";for(var S=0,T=0;S<f.length;S++)T+=M*m[S];for(S=0,T=.5*(u.height-T);S<f.length;S++)T+=M*m[S],h.fillText(f[S],0,T);var E=new i.Texture(u);E.needsUpdate=!0;var D=new i.SpriteMaterial({transparent:!0,depthTest:!1,map:E});D.rotation=r;var A=new i.Sprite(D);return A.scale.set(p,p/u.width*u.height,1),A.position.set(e.x,e.y,e.z),A},r.createTriangle=function(t,e,n){if(!(t.length<3)){for(var r=t.length,o=new i.Geometry,a=0;a+2<r;a+=3){o.vertices.push(t[a]),o.vertices.push(t[a+1]),o.vertices.push(t[a+2]);var s=new i.Face3(a,a+1,a+2);o.faces.push(s)}o.computeFaceNormals(),o.computeVertexNormals(),null==n&&(n=1);var l=new i.MeshBasicMaterial({color:e,transparent:!0,depthTest:!1,side:i.DoubleSide,opacity:n});return new i.Mesh(o,l)}},r.createLines=function(t,e,n){var r,o=new i.Geometry;return o.vertices=t,r=n&&1!=n||0==n?new i.LineBasicMaterial({color:e,transparent:!0,depthTest:!1,opacity:n}):new i.LineBasicMaterial({color:e,transparent:!0,depthTest:!1}),new i.Line(o,r)},r.createDashedLines=function(t,e,n,r){var o=new i.Geometry;o.vertices=t;var a=new i.Line(o,new i.LineDashedMaterial({color:e,dashSize:n,gapSize:r,transparent:!0,depthTest:!1}));return a.computeLineDistances(),a}},{"./MxFun":34,three:19}],45:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxPair=n.MxTools=void 0;var r,i=t("three");(r=n.MxTools||(n.MxTools={})).AsMxWebPoint=function(t,e,n){return new i.Vector3(-t,n,e)},r.AsMxWebPoint_pt=function(t){return new i.Vector3(-t.x,t.z,t.y)},r.AsThreeJsPoint=function(t,e,n){return new i.Vector3(-t,n,e)},r.stringTrimLeftSpace=function(t){return t.replace(/^\s*/g,"")},r.stringDeleteAllSpace=function(t){return t.replace(/\s*/g,"")},r.stringTrimLeftRightSpace=function(t){return t.replace(/^\s*|\s*$/g,"")},r.stringTrimRightSpace=function(t){return t.replace(/(\s*$)/g,"")},r.IsNumerical=function(t){if("string"==typeof t){var e=/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/;return!(!/^\d+(\.\d+)?$/.test(t)&&!e.test(t))}var n=t.m_val;return e=/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/,!(!/^\d+(\.\d+)?$/.test(n)&&!e.test(n))},r.formatString=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++)t=t.replace("{".concat(r,"}"),e[r]);return t},r._tstof=function(t){return parseFloat(t)},r._tstoi=function(t){return parseInt(t)},r.IsZero=function(t){return-1e-7<t&&t<1e-7},r.MillimeterToPixels=function(t){return 10*t},r.getXYPlanDistance=function(t,e){var n=new i.Vector2(t.x,t.y),r=new i.Vector2(e.x,e.y);return n.distanceTo(r)},r.MxASSERT=function(t,e){t||console.log("MxASSERT(0):"+e)},r.generateUUID=function(){return i.MathUtils.generateUUID()},n.MxPair=function(t,e){this.first=t,this.second=e}},{three:19}],46:[function(t,e,n){var r,i,o;Object.defineProperty(n,"__esModule",{value:!0}),n.MxType=void 0,(i=(r=n.MxType||(n.MxType={})).CommandFlags||(r.CommandFlags={}))[i.MCRX_CMD_MODAL=0]="MCRX_CMD_MODAL",i[i.MCRX_CMD_TRANSPARENT=1]="MCRX_CMD_TRANSPARENT",i[i.MCRX_CMD_NO_UNDO_MARKER=2]="MCRX_CMD_NO_UNDO_MARKER",i[i.MCRX_CMD_NOPRV=4]="MCRX_CMD_NOPRV",(o=r.MxCloneType||(r.MxCloneType={}))[o.kClone=1]="kClone",o[o.kDragClone=2]="kDragClone",o[o.kMxFileClone=3]="kMxFileClone",o[o.kSaveDwgClone=4]="kSaveDwgClone"},{}],47:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxBulid=void 0,window.MxDrawVersion="1.0(2023-03-21 14:25)",(n.MxBulid||(n.MxBulid={})).getVersion=function(){return window.MxDrawVersion?window.MxDrawVersion:"inalid version"}},{}],48:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxWindowsEvent=void 0;var r,i,o,a,s=t("./MxFun"),l=t("./Operate/MxJigCmdManager"),c=t("three"),u=t("./MxDrawData");function h(t,e){for(var n=0,r=a.length;n<r;n++){var i=a[n](t,e);if(0!=i)return i}}function d(t){o.x=t.offsetX,o.y=t.offsetY,h("mousemove",t)}function p(t){h("mouseup",t)}function f(t){h("dblclick",t)}function m(t){o.x=t.offsetX,o.y=t.offsetY,h("mousedown",t)}function g(t){var e=t||window.event||arguments.callee.caller.arguments[0];if(e&&27==e.keyCode)if(u.MxDrawData.m_isEnableIntelliSelect&&!l.MxJigCmdManager.isRunning()){var n=!1,r=s.MxFun.getCurrentMx(),i=r.getMxCAD();if(i){var o=i.getSelect().clearAllSelect(),a=i.getGrip().clearAll();(o||a)&&(n=!0)}r.getMxDatabase().getGripManager().removeAllGrips()&&(n=!0),r.getMxDatabase().getSelectManager().removeAllEntity()&&(n=!0),r.isValidMcObject()&&r.getMcObject().getGripManager().clearAll()&&(n=!0),n&&r.updateDisplay()}else l.MxJigCmdManager.isRunning()&&l.MxJigCmdManager.stopCmd()}r=n.MxWindowsEvent||(n.MxWindowsEvent={}),i=!1,o=new c.Vector2(0,0),a=new Array,r.addEvent=function(t){a.push(t)},r.getCurrentMousePostion=function(){return o},r.registEvent=function(){i||(i=!0,s.MxFun.isPC()&&(document.addEventListener("mousemove",d,!1),document.addEventListener("mouseup",p,!1),document.addEventListener("mousedown",m,!1),document.addEventListener("dblclick",f,!1),document.onkeydown=g))}},{"./MxDrawData":29,"./MxFun":34,"./Operate/MxJigCmdManager":58,three:19}],49:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.McEdJigOsnap=n.McEdImpJigGlobalData=n.MxOsnapDefine=void 0;var r,i,o,a,s,l,c,u,h,d,p,f=t("three"),m=t("../MxDrawObject"),g=t("../MxFun"),y=t("./MxJigCmdManager"),v=t("../MxTools"),x=t("../MxDrawData"),b=t("../MxWindowsEvent");(i=r=n.MxOsnapDefine||(n.MxOsnapDefine={}))[i.OsModeInvalid=0]="OsModeInvalid",i[i.OsModeEnd=1]="OsModeEnd",i[i.OsModeMid=2]="OsModeMid",i[i.OsModeCen=4]="OsModeCen",i[i.OsModeNode=8]="OsModeNode",i[i.OsModeQuad=16]="OsModeQuad",i[i.OsModeInt=32]="OsModeInt",i[i.OsModeIns=64]="OsModeIns",i[i.OsModePerp=128]="OsModePerp",i[i.OsModeTan=256]="OsModeTan",i[i.OsModeNear=512]="OsModeNear",i[i.OsModeApp=2048]="OsModeApp",i[i.OsModeExt=4096]="OsModeExt",i[i.OsModePar=8192]="OsModePar",i[i.OsModeOff=16384]="OsModeOff",i[i.OsModeAll=16383]="OsModeAll",a=o=n.McEdImpJigGlobalData||(n.McEdImpJigGlobalData={}),s=!1,l=new f.Vector3,c=new f.Vector3,u=0,d=h=!1,p=new Array,a.setPrvPoint=function(t){l=t,d=!0},a.isOsnapZValue=function(){return!1},a.setIsValidPrvpoint=function(t){d=t},a.isValidPrvpoint=function(){return d},a.getPrvPoint=function(){return l},a.setIsValidBasepoint=function(t){s=t},a.isValidBasepoint=function(){return s},a.setBasepoint=function(t){s=!0,c=t},a.getBasepoint=function(){return c},a.initStartCommand=function(){h=s=!1},a.setIsTmpDisableOsmode=function(t){h=t},a.isTmpDisableOsmode=function(){return h},a.intiStartDrag=function(t){u=t.sysVariable().getSysVarNumber("OSMODE")},a.isEnableOsmode=function(){return!(0==u||u&r.OsModeOff||h)},a.getOSmode=function(){return u},a.addDynDrawObject=function(t){p.push(t)},a.clearDisplay=function(t){for(var e=p.length,n=0;n<e;n++)g.MxFun.removeThreejsObject(p[n],t);p=[]};var w=(M.prototype.drawLine=function(t,e,n){var r=new f.Geometry,i=new f.LineBasicMaterial({color:this.m_iColor});r.vertices.push(new f.Vector3(t.x,t.y,t.z),new f.Vector3(e.x,e.y,e.z));var a=new f.Line(r,i);n.add(a),o.addDynDrawObject(a)},M.prototype.drawPolyline=function(t,e){for(var n=new f.Geometry,r=new f.LineBasicMaterial({color:this.m_iColor}),i=t.length,a=0;a<i;a++)n.vertices.push(new f.Vector3(t[a].x,t[a].y,t[a].z));var s=new f.Line(n,r);e.add(s),o.addDynDrawObject(s)},M.prototype.setWidth=function(t){this.m_dOsmodeWdith=t},M.prototype.GetDrawRect=function(){var t=.5*this.m_dOsmodeWdith,e={};return e.left=this.m_pt.x-t,e.right=this.m_pt.x+t,e.top=this.m_pt.y-t,e.bottom=this.m_pt.y+t,e},M.prototype.DrawNear=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3];n[0].x=e.left,n[0].y=e.top,n[1].x=e.right,n[1].y=e.top,this.drawLine(n[0],n[1],t),n[0].x=e.left,n[0].y=e.bottom,n[1].x=e.right,n[1].y=e.bottom,this.drawLine(n[0],n[1],t),n[0].x=e.right,n[0].y=e.top,n[1].x=e.left,n[1].y=e.bottom,this.drawLine(n[0],n[1],t),n[0].x=e.right,n[0].y=e.bottom,n[1].x=e.left,n[1].y=e.top,this.drawLine(n[0],n[1],t)},M.prototype.DrawEnd=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];n[0].x=e.left,n[0].y=e.top,n[1].x=e.right,n[1].y=e.top,n[2].x=e.right,n[2].y=e.bottom,n[3].x=e.left,n[3].y=e.bottom,this.drawLine(n[0],n[1],t),this.drawLine(n[1],n[2],t),this.drawLine(n[2],n[3],t),this.drawLine(n[3],n[0],t)},M.prototype.DrawMid=function(t){var e=this.GetDrawRect(),n=1.2*(e.right-e.left),r=n/2/Math.sin(60*3.14159265/180),i=r*Math.sin(.5235987750000001),o=new f.Vector3(this.m_pt.x,this.m_pt.y,this.m_pt.z);o.y-=r;var a=new f.Vector3;a.x=this.m_pt.x+n/2,a.y=this.m_pt.y+i;var s=new f.Vector3;s.x=this.m_pt.x-n/2,s.y=this.m_pt.y+i;var l=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];l[0].x=o.x,l[0].y=o.y,l[1].x=a.x,l[1].y=a.y,l[2].x=s.x,l[2].y=s.y,l[3].x=o.x,l[3].y=o.y,this.drawLine(l[0],l[1],t),this.drawLine(l[1],l[2],t),this.drawLine(l[2],l[3],t)},M.prototype.DrawPerp=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3,new f.Vector3];n[0].x=e.left,n[0].y=e.top,n[1].x=e.left,n[1].y=e.bottom,n[2].x=e.right,n[2].y=e.bottom,this.drawPolyline(n,t),n[0].x=e.left,n[0].y=this.m_pt.y,n[1].x=this.m_pt.x,n[1].y=this.m_pt.y,n[2].x=this.m_pt.x,n[2].y=e.bottom,this.drawPolyline(n,t)},M.prototype.DrawCircle=function(t,e,n){null==n&&(n=.5*this.m_dOsmodeWdith);for(var r=[],i=0,o=3.14159265/180;i<=360;i+=15){var a=n*Math.cos(i*o)+t.x,s=n*Math.sin(i*o)+t.y;r.push(new f.Vector3(a,s))}this.drawPolyline(r,e)},M.prototype.DrawInt=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3];n[0].x=e.right,n[0].y=e.top,n[1].x=e.left,n[1].y=e.bottom,this.drawLine(n[0],n[1],t),n[0].x=e.right,n[0].y=e.bottom,n[1].x=e.left,n[1].y=e.top,this.drawLine(n[0],n[1],t)},M.prototype.DrawCen=function(t){this.DrawInt(t),this.DrawCircle(this.m_pt,t)},M.prototype.DrawTan=function(t){this.DrawEnd(t)},M.prototype.DrawIns=function(t){var e=this.GetDrawRect(),n={},r=(e.right-e.left)/1.5;n.left=this.m_pt.x-r,n.right=this.m_pt.x+r,n.top=this.m_pt.y-r,n.bottom=this.m_pt.y+r;var i=this.m_pt.x,o=this.m_pt.y,a=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];a[0].x=n.left,a[0].y=n.top,a[1].x=n.left,a[1].y=o+2,a[2].x=i,a[2].y=o+2,a[3].x=i,a[3].y=n.bottom,a[4].x=n.right,a[4].y=n.bottom,a[5].x=n.right,a[5].y=o-2,a[6].x=i,a[6].y=o-2,a[7].x=i,a[7].y=n.top,a[8].x=n.left,a[8].y=n.top,this.drawPolyline(a,t)},M.prototype.DrawNode=function(t){var e=this.GetDrawRect(),n={},r=(e.right-e.left)/1.5;n.left=this.m_pt.x-r,n.right=this.m_pt.x+r,n.top=this.m_pt.y-r,n.bottom=this.m_pt.y+r;var i=this.m_dOsmodeWdith/1.3;this.m_pt.x,this.m_pt.x,this.m_pt.y,this.m_pt.y;var o=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];o[0].x=n.left,o[0].y=n.top,o[1].x=n.right,o[1].y=n.bottom,o[2].x=n.left,o[2].y=n.bottom,o[3].x=n.right,o[3].y=n.top,this.drawLine(o[0],o[1],t),this.drawLine(o[2],o[3],t),this.DrawCircle(this.m_pt,t,i)},M.prototype.upDisplay=function(t,e,n){this.m_pt=t,this.m_osmode=e,this.clearDisplay(n);var r=n.getMxObject().getTheTempDrawContainer(),i=.5*this.m_dOsmodeWdith;if(this.m_osmode!=y.MxJigCmdManager.OsnapMode.kOsModekValid)if(this.m_osmode==y.MxJigCmdManager.OsnapMode.kOsModeNear)this.DrawNear(r);else if(this.m_osmode==y.MxJigCmdManager.OsnapMode.kOsModeEnd)this.DrawEnd(r);else if(this.m_osmode==y.MxJigCmdManager.OsnapMode.kOsModeMid)this.DrawMid(r);else if(this.m_osmode==y.MxJigCmdManager.OsnapMode.kOsModePerp)this.DrawPerp(r);else if(this.m_osmode==y.MxJigCmdManager.OsnapMode.kOsModeInt)this.DrawInt(r);else if(this.m_osmode==y.MxJigCmdManager.OsnapMode.kOsModeCen)this.DrawCen(r);else if(this.m_osmode==y.MxJigCmdManager.OsnapMode.kOsModeTan)this.DrawTan(r);else if(this.m_osmode==y.MxJigCmdManager.OsnapMode.kOsModeIns)this.DrawIns(r);else if(this.m_osmode==y.MxJigCmdManager.OsnapMode.kOsModeNode)this.DrawNode(r);else{var o=new f.Vector3(t.x-i,t.y-i,0),a=new f.Vector3(t.x+i,t.y+i,0);this.drawLine(o,a,r);var s=new f.Vector3(t.x-i,t.y+i,0),l=new f.Vector3(t.x+i,t.y-i,0);this.drawLine(s,l,r)}},M.prototype.clearDisplay=function(t){var e=t.getMxObject().getTheTempDrawContainer();o.clearDisplay(e)},M);function M(){this.m_iColor=16711935,this.m_pt=new f.Vector3,this.m_osmode=y.MxJigCmdManager.OsnapMode.kOsModekValid,this.m_dOsmodeWdith=10}var _=(C.prototype.resetData=function(){this.m_osmode=y.MxJigCmdManager.OsnapMode.kOsModekValid,this.m_isValidPrvInputPoint=!1,this.m_lOSmode=0,this.m_vecOffset.set(0,0,0),this.m_isValid=!1,this.m_iLongprogressStatus=-1},C.prototype.notifyOsnapToServer=function(){var t=this;if(this.m_isRuning){var e={ptx:this.m_pt.x,pty:this.m_pt.y,osmode:this.m_lOSmode,isValidPrvInputPoint:this.m_isValidPrvInputPoint};this.m_isValidPrvInputPoint&&(e.prvPtx=this.m_prvInputPoint.x,e.prvPty=this.m_prvInputPoint.y);var n=this.m_mxJig.getMxObject();if(n.getRunMode()==m.MxRunMode.kBrowse){var r=this,i=b.MxWindowsEvent.getCurrentMousePostion();n.getObjectOsnap().getOsnapData(i,function(t,e){t=n.worldCoord2Doc(t.x,t.y,t.z),r.m_ptSnapPoint.x=t.x,r.m_ptSnapPoint.y=t.y,r.m_ptSnapPoint.z=0,r.m_ptSnapSrcPoint.x=r.m_pt.x,r.m_ptSnapSrcPoint.y=r.m_pt.y,r.m_ptSnapSrcPoint.z=0,r.m_osmode=e,r.m_draw.setWidth(n.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels())),r.m_draw.upDisplay(new f.Vector3(t.x,t.y,0),e,r.m_mxJig)})}else if(n.getRunMode()!=m.MxRunMode.kCPPMxCAD){e.SearchRnge=n.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels());var o=this;n.callCommand("MxCAD_NotifyOsnap",JSON.stringify(e),function(e){if(!("string"!=typeof e||e.length<1)&&o.m_isRuning){var r=JSON.parse(e);t.m_ptSnapPoint.x=r.ptsx,t.m_ptSnapPoint.y=r.ptsy,t.m_ptSnapPoint.z=r.ptsz,t.m_ptSnapSrcPoint.x=r.ptx,t.m_ptSnapSrcPoint.y=r.pty,t.m_ptSnapSrcPoint.z=0,t.m_osmode=r.osmode,o.m_draw.setWidth(n.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels())),o.m_draw.upDisplay(new f.Vector3(r.ptsx,r.ptsy,r.ptsz),r.osmode,o.m_mxJig)}})}}},C.prototype.startDrag=function(t,e){this.m_mxJig=e;var n,r,i=this.m_mxJig.getMxObject();function o(){n.notifyOsnapToServer()}return e.isDisableOsnap()?this.m_isEnable=!1:this.m_isEnable=!0===i.getInisetValue(m.IniSetName.kEnableOsnapFunction),this.m_isOffsetInputPostion=t,this.m_isRuning=!0,this.m_draw.setWidth(i.screenCoordLong2Doc(x.MxDrawData.getCursorWidthPixels())),this.resetData(),this.m_notifyOsnap_delayCall=(n=this,r=null,function(){clearTimeout(r),r=setTimeout(o,100)}),!0},C.prototype.endDrag=function(){return this.m_isRuning=!1,this.m_draw.clearDisplay(this.m_mxJig),!0},C.prototype.reCompteCurrentPoint=function(t){return t},C.prototype.isEnable=function(){return this.m_isEnable&&o.isEnableOsmode()},C.prototype.notifyOsnap=function(t,e){this.m_lOSmode=t,null==e?this.m_isValidPrvInputPoint=!1:(this.m_isValidPrvInputPoint=!0,this.m_prvInputPoint=e),this.m_osmode==y.MxJigCmdManager.OsnapMode.kOsModekValid&&this.m_draw.clearDisplay(this.m_mxJig),this.m_notifyOsnap_delayCall()},C.prototype.setPoint=function(t,e){if(this.isEnable()){null==t?(this.m_isValid=!1,this.m_osmode=y.MxJigCmdManager.OsnapMode.kOsModekValid):(-1==this.m_iLongprogressStatus||this.m_iLongprogressStatus,this.m_pt=t,this.m_inPoint=t,this.m_isValid=!0,(null==e||this.m_osmode!=y.MxJigCmdManager.OsnapMode.kOsModekValid&&v.MxTools.getXYPlanDistance(this.m_ptSnapSrcPoint,t)>e)&&(this.m_osmode=y.MxJigCmdManager.OsnapMode.kOsModekValid));var n=o.getOSmode(),r=o.getPrvPoint();this.notifyOsnap(n,o.isValidPrvpoint()?r:void 0)}},C.prototype.seInValidPoint=function(){this.setPoint(void 0)},C.prototype.getCurrentOSnapPoint=function(t){var e={};return this.isEnable()?(e.pt=t,e.osmode=this.m_osmode,this.m_osmode!=y.MxJigCmdManager.OsnapMode.kOsModekValid?(e.pt.x=this.m_ptSnapPoint.x,e.pt.y=this.m_ptSnapPoint.y,e.pt.z=this.m_ptSnapPoint.z,o.isOsnapZValue()||(t.z=0)):e.pt=t):(e.pt=t,e.osmode=y.MxJigCmdManager.OsnapMode.kOsModekValid),e},C.prototype.setLongprogressStatus=function(t){this.m_iLongprogressStatus=t},C.prototype.reComputeOffset=function(){},C);function C(t){this.m_inPoint=new f.Vector3,this.m_vecOffset=new f.Vector3,this.m_pt=new f.Vector3,this.m_isValid=!1,this.m_ptSnapPoint=new f.Vector3,this.m_ptSnapSrcPoint=new f.Vector3,this.m_osmode=y.MxJigCmdManager.OsnapMode.kOsModekValid,this.m_prvInputPoint=new f.Vector3,this.m_isValidPrvInputPoint=!1,this.m_lOSmode=0,this.m_iLongprogressStatus=-1,this.m_isOffsetInputPostion=!1,this.m_mxJig=null,this.m_notifyOsnap_delayCall=void 0,this.m_isRuning=!1,this.m_isEnable=!1,this.m_mxJig=t,this.m_draw=new w}n.McEdJigOsnap=_},{"../MxDrawData":29,"../MxDrawObject":30,"../MxFun":34,"../MxTools":45,"../MxWindowsEvent":48,"./MxJigCmdManager":58,three:19}],50:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.McGiWorldDrawSelect=n.McGiWorldDraw=n.McGiWorldDrawType=void 0;var o,a,s=t("three"),l=t("../MxThreeJS"),c=t("../MxManager"),u=t("three.meshline");(a=o=n.McGiWorldDrawType||(n.McGiWorldDrawType={}))[a.kWorldDraw=1]="kWorldDraw",a[a.kDynDragDraw=2]="kDynDragDraw",a[a.kSelectDraw=3]="kSelectDraw";var h=(d.prototype.getType=function(){return this.worldDrawType},d.prototype.setXData=function(t){this.xData=t},d.prototype.setMatrix=function(t){this.matrix=t},d.prototype.getMatrix=function(){return this.matrix},d.prototype.setOpacity=function(t){this.opacity=t},d.prototype.getOpacity=function(){return this.opacity},d.prototype.setColor=function(t){this.iColor!=t&&(this.widthMaterial=null),this.iColor=t},d.prototype.setDash=function(t,e){this.dDashArray=t,this.dDashRatio=e},d.prototype.getDash=function(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}},d.prototype.setDashLineDisplay=function(t){t?(this.dDashArray=.03,this.dDashRatio=.1,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)):(this.dDashArray=0,this.dDashRatio=0)},d.prototype.isDashLineDisplay=function(){return 0<this.dDashArray&&0<this.dDashRatio},d.prototype.getColor=function(){return this.iColor},d.prototype.setRenderOrder=function(t){this.iRenderOrder=t},d.prototype.getRenderOrder=function(){return this.iRenderOrder},d.prototype.setLineWidthByPixels=function(t){this.lineWidthByPixels!=t&&(this.widthMaterial=null),this.lineWidthByPixels=t},d.prototype.getLineWidthByPixels=function(){return this.lineWidthByPixels},d.prototype.setLineWidth=function(t){this.dLineWidth!=t&&(this.widthMaterial=null),this.dLineWidth=t},d.prototype.getLineWidth=function(){return this.dLineWidth},d.prototype.drawEntity=function(t){var e=this.iRenderOrder;"Group"==t.type?t.traverse(function(t){"Group"!=t.type&&(t.renderOrder=e)}):t.renderOrder=e,null!=this.matrix&&t.applyMatrix4(this.matrix),this.aryEntity.push(t),this.xData&&(t.MxWordDrawXData=this.xData,this.xData=null)},d.prototype.getEntitys=function(){return this.aryEntity},d.prototype.getMxObject=function(){return this.mxObj},d.prototype.createWidthMaterial=function(){null==this.widthMaterial&&(0<this.dDashArray&&0<this.dDashRatio?this.widthMaterial=new u.MeshLineMaterial({useMap:!1,color:this.iColor,opacity:1,resolution:new s.Vector2(this.mxObj.getViewWidth(),this.mxObj.getViewHeight()),sizeAttenuation:!this.lineWidthByPixels,lineWidth:this.dLineWidth,transparent:!0,depthTest:!1,dashArray:this.dDashArray,dashRatio:this.dDashRatio}):this.widthMaterial=new u.MeshLineMaterial({useMap:!1,color:this.iColor,opacity:1,resolution:new s.Vector2(this.mxObj.getViewWidth(),this.mxObj.getViewHeight()),sizeAttenuation:!this.lineWidthByPixels,lineWidth:this.dLineWidth,transparent:!0,depthTest:!1}))},d.prototype.drawSolid=function(t){if(!(t.length<3)){var e=new s.Shape(t.map(function(t){var e=t.x,n=t.y;return new s.Vector2(e,n)})),n=new s.ShapeGeometry(e),r=new s.Mesh(n,new s.MeshPhongMaterial({color:this.getColor(),side:s.DoubleSide,transparent:!0,opacity:this.getOpacity()}));this.drawEntity(r)}},d.prototype.drawLines=function(t){if(!(t.length<2))if(0!=this.dLineWidth){this.createWidthMaterial();var e=new s.Geometry;e.vertices=t;var n=new u.MeshLine;n.setGeometry(e);var r=new s.Mesh(n.geometry,this.widthMaterial);this.drawEntity(r),this.drawEntity(l.MxThreeJS.createLines(t.slice(0),this.iColor,0))}else this.drawEntity(l.MxThreeJS.createLines(t.slice(0),this.iColor,this.opacity))},d.prototype.drawGeometryLines=function(t){if(!(t.vertices.length<2))if(0!=this.dLineWidth){this.createWidthMaterial();var e=new u.MeshLine;if(!(t instanceof s.Geometry)){var n=new s.Geometry;n.vertices=t.vertices,t=n}e.setGeometry(t);var r=new s.Mesh(e.geometry,this.widthMaterial);this.drawEntity(r);var i=new s.LineBasicMaterial({color:this.iColor,transparent:!0,depthTest:!1,opacity:0}),o=new s.Line(t,i);this.drawEntity(o)}else i=void 0,i=this.opacity&&1!=this.opacity||0==this.opacity?new s.LineBasicMaterial({color:this.iColor,transparent:!0,depthTest:!1,opacity:this.opacity}):new s.LineBasicMaterial({color:this.iColor,transparent:!0,depthTest:!1}),o=new s.Line(t,i),this.drawEntity(o)},d.prototype.drawSelectLine=function(t,e,n,r){t instanceof Object&&e instanceof Object?this.drawEntity(l.MxThreeJS.createLine(t,e,this.iColor,0)):"number"==typeof t&&"number"==typeof e&&this.drawEntity(l.MxThreeJS.createLine(new s.Vector3(t,e,0),new s.Vector3(n,r,0),this.iColor,0))},d.prototype.drawLine=function(t,e,n,r){var i,o;if(t instanceof Object&&e instanceof Object?(i=t,o=e):"number"==typeof t&&"number"==typeof e&&(i=new s.Vector3(t,e,0),o=new s.Vector3(n,r,0)),0!=this.dLineWidth){this.createWidthMaterial();var a=new Float32Array(6);a[0]=i.x,a[1]=i.y,a[2]=0,a[3]=o.x,a[4]=o.y,a[5]=0;var c=new u.MeshLine;c.setGeometry(a);var h=new s.Mesh(c.geometry,this.widthMaterial);h.renderOrder=this.iRenderOrder,this.drawEntity(h),this.drawSelectLine(i,o)}else this.drawEntity(l.MxThreeJS.createLine(i,o,this.iColor,this.opacity))},d.prototype.drawCircle=function(t,e){this.drawEntity(l.MxThreeJS.createCircle(t,e,this.iColor))},d.prototype.drawText=function(t,e,n,r,i,o){var a=l.MxThreeJS.creatTextSprite(t,r,e,n,this.iColor,i,o);return this.drawEntity(a),a},d.prototype.setupForEntity=function(t){this.iColor=t.getColor(),this.iRenderOrder=t.getRenderOrder(),this.opacity=t.opacity,this.dLineWidth=t.getLineWidth(),this.lineWidthByPixels=t.getLineWidthByPixels(),this.dDashArray=t.getDash().dDashArray,this.dDashRatio=t.getDash().dDashRatio},d);function d(t,e){this.aryEntity=[],this.iColor=16777215,this.dLineWidth=0,this.lineWidthByPixels=!0,this.iRenderOrder=c.MxData.iMxEntityRenderOrder,this.worldDrawType=1,this.widthMaterial=null,this.dDashArray=0,this.dDashRatio=0,this.matrix=null,this.opacity=1,this.xData=null,this.mxObj=t,this.worldDrawType=e}n.McGiWorldDraw=h;var p,f=(i(m,p=h),m.prototype.setCurEntityId=function(t){this.curEntityId=t},m.prototype.drawEntity=function(t){},m.prototype.drawText=function(t,e,n,r,i,o){return null},m.prototype.drawSelectLine=function(t,e,n,r){},m.prototype.isValid=function(){return 0!=this.curEntityId||(console.log("this.curEntityId == 0"),!1)},m.prototype.drawLine=function(t,e,n,r){var i,o;this.isValid()&&(t instanceof Object&&e instanceof Object?(i=t,o=e):"number"==typeof t&&"number"==typeof e&&(i=new s.Vector3(t,e,0),o=new s.Vector3(n,r,0)),this.selectManager.addLineDisplay(this.curEntityId,i,o))},m.prototype.drawCircle=function(t,e){this.isValid()&&this.selectManager.addCircleDisplay(this.curEntityId,t,e)},m.prototype.drawLines=function(t){if(!(t.length<2))for(var e=t.length,n=0;n<e-1;n++)this.selectManager.addLineDisplay(this.curEntityId,t[n],t[n+1])},m);function m(t,e){var n=p.call(this,t,o.kSelectDraw)||this;return n.selectManager=e,n.curEntityId=0,n}n.McGiWorldDrawSelect=f},{"../MxManager":36,"../MxThreeJS":44,three:19,"three.meshline":18}],51:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MrxDbgUiPrBase=n.MrxDbgUiPrBase_Return=n.McEdGetPointWorldDrawObject=n.McEdGetPointWorldDraw=void 0;var o=t("./MxJig"),a=t("./MxJigCmdManager"),s=t("../MxThreeJS"),l=t("../UI/MxUiVue"),c=t("../MxString"),u=t("./McGiWorldDraw"),h=(d.prototype.setMcEdJig=function(t){this.m_pJig=t},d.prototype.setColor=function(t){this.m_iColor=t},d.prototype.getColor=function(){return this.m_iColor},d.prototype.drawLine=function(t,e){this.m_pJig.drawEntity(s.MxThreeJS.createLine(t,e,this.m_iColor))},d.prototype.drawCircle=function(t,e){this.m_pJig.drawEntity(s.MxThreeJS.createCircle(t,e,this.m_iColor))},d.prototype.drawEntity=function(t,e){this.m_pJig.drawEntity(t,e)},d.prototype.drawText=function(t,e,n,r){var i=s.MxThreeJS.creatTextSprite(t,r,e,n,this.m_iColor);this.drawEntity(i)},d.prototype.drawCustomEntity=function(t,e){var n=new u.McGiWorldDraw(this.m_pJig.getMxObject(),u.McGiWorldDrawType.kDynDragDraw);n.setupForEntity(t),t.worldDraw(n);for(var r=n.getEntitys(),i=r.length,o=0;o<i;o++)this.drawEntity(r[o],e)},d);function d(){this.m_pJig=null,this.m_iColor=16777215}n.McEdGetPointWorldDraw=h;var p,f,m,g=(i(y,p=h),y.prototype.setDraw=function(t){this.m_callDraw=t},y.prototype.worldDraw=function(t){null!=this.m_callDraw&&this.m_callDraw(t,this)},y);function y(){var t=null!==p&&p.apply(this,arguments)||this;return t.m_callDraw=void 0,t}n.McEdGetPointWorldDrawObject=g,(m=f=n.MrxDbgUiPrBase_Return||(n.MrxDbgUiPrBase_Return={}))[m.kCancel=-2]="kCancel",m[m.kNone=-1]="kNone",m[m.kOk=0]="kOk",m[m.kKeyWord=1]="kKeyWord";var v,x=(i(b,v=o.McEdJigCommand),b.prototype.procInKeyword=function(t){t.status>=a.MxJigCmdManager.DragStatus.kKW1&&0<t.sKeyValue.length?this.m_keyWordPicked=t.sKeyValue.toUpperCase():this.m_keyWordPicked=""},b.prototype.getReturnStatus=function(t){switch(t){case a.MxJigCmdManager.DragStatus.kNoChange:return f.kNone;case a.MxJigCmdManager.DragStatus.kCancel:return f.kCancel;case a.MxJigCmdManager.DragStatus.kNull:return f.kNone;case a.MxJigCmdManager.DragStatus.kNormal:return f.kOk}return 1<=t?f.kKeyWord:f.kCancel},b.prototype.setInputToucheType=function(t){this.m_toucheType=t},b.prototype.getInputToucheType=function(){return this.m_toucheType},b.prototype.keyWords=function(){return this.m_keyWords},b.prototype.setKeyWords=function(t){this.m_keyWords=t},b.prototype.message=function(){return this.m_message},b.prototype.setMessage=function(t){this.m_message=t},b.prototype.keyWordPicked=function(){return this.m_keyWordPicked},b.prototype.isKeyWordPicked=function(t){return t=t.toUpperCase(),this.m_keyWordPicked==t},b.prototype.setUserDraw=function(t){t.setMcEdJig(this),this.m_pWorldDraw=t},b.prototype.printMessage=function(){var t=new c.MxString(this.m_message);t.TrimRight(":"),1<this.m_keyWords.length&&"["==this.m_keyWords[0]&&"]"==this.m_keyWords[this.m_keyWords.length-1]?l.MxUiVue.acutPrintf(t.m_val+" 或"+this.m_keyWords+":"):l.MxUiVue.acutPrintf(t.m_val+":")},b);function b(){var t=null!==v&&v.apply(this,arguments)||this;return t.m_keyWords="",t.m_message="",t.m_keyWordPicked="",t.m_pWorldDraw=null,t.m_toucheType=a.MxJigCmdManager.InType.kGetBegan,t}n.MrxDbgUiPrBase=x},{"../MxString":42,"../MxThreeJS":44,"../UI/MxUiVue":67,"./McGiWorldDraw":50,"./MxJig":57,"./MxJigCmdManager":58}],52:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MrxDbgUiPrPoint=void 0;var o,a=t("three"),s=t("./MxJigCmdManager"),l=t("../MxFun"),c=t("./MrxDbgUiPrBase"),u=t("../UI/MxUiVue"),h=t("../MxThreeJS"),d=(i(p,o=c.MrxDbgUiPrBase),p.prototype.value=function(){return new a.Vector3(this.m_value.x,this.m_value.y,0)},p.prototype.basePt=function(){return new a.Vector3(this.m_basePt.x,this.m_basePt.y,0)},p.prototype.setBasePt=function(t){null==this.m_basePt?this.m_basePt=new a.Vector3(t.x,t.y,0):(this.m_basePt.x=t.x,this.m_basePt.y=t.y)},p.prototype.setUseBasePt=function(t){this.m_useBasePt=t},p.prototype.initGo=function(){this.m_keyWordPicked="",this.m_retcall=null,this.m_retWhileCall=null,this.m_exitCall=null},p.prototype.go=function(t){this.initGo(),this.m_retcall=t,s.MxJigCmdManager.runCmd(this)},p.prototype.goWhile=function(t,e){this.initGo(),this.m_retWhileCall=t,e&&(this.m_exitCall=e),s.MxJigCmdManager.runCmd(this)},p.prototype.onExitCommand=function(){var t=this;u.MxUiVue.setCursorType(u.MxUiVue.CursorType.kNormal);var e=!1;null!=this.m_retcall&&(s.MxJigCmdManager.setRunCmdEvent(function(){o.prototype.onExitCommand.call(t,!1),e=!0}),this.m_retcall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.setRunCmdEvent(void 0)),!e&&s.MxJigCmdManager.isWaitCmdNull()&&u.MxUiVue.restoreCmdStatus(),e||o.prototype.onExitCommand.call(this,!0)},p.prototype.onStartCommand=function(){u.MxUiVue.setCursorType(u.MxUiVue.CursorType.kCross),this.printMessage(),s.MxJigCmdManager.setKeywordList(this.keyWords()),o.prototype.onStartCommand.call(this)},p.prototype.sampler=function(){var t=this.acquirePoint(this.m_toucheType);return this.procInKeyword(t),t.status==s.MxJigCmdManager.DragStatus.kNormal&&(null==this.m_value?this.m_value=new a.Vector3(t.pt.x,t.pt.y,0):(this.m_value.x=t.pt.x,this.m_value.y=t.pt.y)),t.status},p.prototype.done=function(t){if(null!=this.m_retcall)return this.m_resultDragStatus=t,this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.DoneStatius.kExitCommand;if(null!=this.m_retWhileCall){if((this.m_resultDragStatus=t)==s.MxJigCmdManager.DragStatus.kCancel)return this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.DoneStatius.kExitCommand;var e=!1;t==s.MxJigCmdManager.DragStatus.kNull&&(e=!0);var n=this.m_retWhileCall(this.getReturnStatus(this.m_resultDragStatus));return null!=n&&null!=n.exit&&(e=n.exit),e?(this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.DoneStatius.kExitCommand):(s.MxJigCmdManager.setKeywordList(this.keyWords()),this.printMessage(),s.MxJigCmdManager.DoneStatius.kContinueCommand)}l.MxFun.Assert(0)},p.prototype.upDisplay=function(){this.m_value&&(this.m_pWorldDraw&&this.m_pWorldDraw.worldDraw(this.m_value),this.m_useBasePt&&this.m_basePt&&this.drawEntity(h.MxThreeJS.createLine(this.m_value,this.m_basePt,16777215)))},p);function p(){var t=null!==o&&o.apply(this,arguments)||this;return t.m_useBasePt=!1,t.m_basePt=null,t.m_value=null,t.m_retcall=null,t.m_retWhileCall=null,t.m_exitCall=null,t.m_resultDragStatus=s.MxJigCmdManager.DragStatus.kCancel,t}n.MrxDbgUiPrPoint=d},{"../MxFun":34,"../MxThreeJS":44,"../UI/MxUiVue":67,"./MrxDbgUiPrBase":51,"./MxJigCmdManager":58,three:19}],53:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxCmdRunManager=void 0;var r,i,o,a,s,l,c,u=t("../MxFun"),h=t("../MxType"),d=t("./MxJigCmdManager"),p=t("../UI/MxUiVue"),f=t("../MxDrawData");r=n.MxCmdRunManager||(n.MxCmdRunManager={}),i={},o=new Array,a=0,s=!1,l="",c={},r.InitQuickCommand=function(t){for(var e=t.length,n=0;n<e;n++){var r=t[n];if(!(r.length<2)){var i=r[0];if(0!=i.length)for(var o=r.length,a=1;a<o;a++)0!=r[a].length&&(c[r[a].toUpperCase()]=i)}}},r.MoveUpKey=function(){return s?++a>=o.length&&(a=0):s=!0,!0},r.MoveDownKey=function(){return!!s&&(--a<0&&(a=o.length-1),!0)},r.GetListCommad=function(){return a<0||a>=o.length?"":o[a]},r.ClearPrvCmd=function(){l=""},r.GetPrvCmd=function(){return l},r.SetPrvCmd=function(t){l=t},r.runCmd=function(t,e,n){var r=e.toUpperCase(),m=i[r];if(t&&null==m){var g=c[r];if(null!=g&&(m=i[g.toUpperCase()]),null==m)return p.MxUiVue.isNull()?console.log(u.MxFun.formatString('未知命令"{0}"',e)):p.MxUiVue.acutPrintf('未知命令"{0}"。\n命令:',e),!1}if(!m)return!1;var y=o.indexOf(m.cmd);-1<y&&o.splice(y,1),s=!(a=0),o.push(m.cmd),l=m.cmd;var v=m.fun;if(t&&0==(m.flag&h.MxType.CommandFlags.MCRX_CMD_TRANSPARENT)&&p.MxUiVue.acutPrintf("{0}\n",m.cmd),d.MxJigCmdManager.stopCmd(),t&&t.undoMark(),t.callEvent("commandWillStart",{cmd:e}),t&&"Mx_GripEdit"!=e&&"Mx_IntelliSel"!=e&&"McDraw_GripEdit"!=e&&"Mx_FrontEndWebpageIntelliSel"!=e&&"Mx_FrontEndWebpageGripEdit"!=e){var x=!1,b=t.getMxCAD();if(b){t.callCommand("MxCAD_StartCommandEvent");var w=b.getSelect().clearAllSelect(!1),M=b.getGrip().clearAll();(w||M)&&(x=!0)}else{var _=t.getMxAllSelect();t.getMxDatabase().getGripManager().removeAllGrips()&&(x=!0),t.getMxDatabase().getSelectManager().removeAllEntity()&&(x=!0),t.isValidMcObject()&&t.getMcObject().getGripManager().clearAll()&&(x=!0),t.getMxDatabase().getSelectManager().setPrvCommandSelect(_)}x&&t.updateDisplay()}return v(n),t&&(d.MxJigCmdManager.isRunning()||p.MxUiVue.restoreCmdStatus(),t.updateDisplay(),f.MxDrawData.m_isAutoResetRenderer||t.resetRenderer()),!0},r.addCommand=function(t,e,n){null==n&&(n=h.MxType.CommandFlags.MCRX_CMD_MODAL);var r=t.toUpperCase();i[r]={fun:e,cmd:t,flag:n}}},{"../MxDrawData":29,"../MxFun":34,"../MxType":46,"../UI/MxUiVue":67,"./MxJigCmdManager":58}],54:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObjectOsnap=n.McDbLine=n.McDbCurve=n.McDbEntity=n.McDbType=void 0;var o,a,s=t("three"),l=t("../MxThreeJS"),c=t("../MxDrawData"),u=t("./MxJigCmdManager"),h=t("./McEdJigOsnap");(a=o=n.McDbType||(n.McDbType={}))[a.kInValid=0]="kInValid",a[a.kLine=1]="kLine";var d=(p.prototype.getType=function(){return this.m_type},p);function p(){this.m_type=o.kInValid}n.McDbEntity=d;var f,m=(i(g,f=d),g);function g(){return null!==f&&f.apply(this,arguments)||this}n.McDbCurve=m;var y,v=(i(x,y=m),x);function x(){var t=y.call(this)||this;return t.m_type=o.kLine,t}n.McDbLine=v;var b=(w.prototype.getBlobHead=function(t,e){var n={};return n.type=t.getInt32(e,!0),e+=4,n.ver=t.getInt32(e,!0),e+=4,n.databaseIndex=t.getInt32(e,!0),e+=4,n.nOffset=e,n},w.prototype.clearData=function(){this.threejsObjects=new s.Object3D},w.prototype.calculateDistance=function(t,e,n){var r=(new s.Vector3).subVectors(e,t),i=(new s.Vector3).subVectors(n,t),o=r.clone().normalize(),a=i.clone().normalize(),l=o.dot(a),c=(new s.Vector3).subVectors(n,e),u=(new s.Vector3).subVectors(t,e),h=c.clone().normalize(),d=u.clone().normalize();if(0<h.dot(d)&&0<l){var p=Math.sqrt(1-l*l),f=t.distanceTo(n),m=f*p,g=f*l,y=r.clone().normalize().multiplyScalar(g),v=t.clone().add(y),x=r.clone().normalize().multiplyScalar(200+g);return{pt1:t,pt2:e,pt:n,distance:m,targetPt:v,warningPt:t.clone().add(x)}}return null},w.prototype.getOsnapData=function(t,e){if(this.threejsObjects){var n=new s.Raycaster,r=c.MxDrawData.getCursorWidthPixels();n.linePrecision=this.mxObj.screenCoordLong2World(r);var i=this.mxObj.getCanvas(),a=i.clientWidth,l=i.clientHeight,d=this.mxObj.screenCoord2World(t.x,t.y);d.z=0,t=new s.Vector2(t.x/a*2-1,-t.y/l*2+1),n.setFromCamera(t,this.mxObj.getCamera());var p=n.intersectObjects(this.threejsObjects.children,!0),f=this.mxObj.sysVariable().getSysVarNumber("OSMODE"),m=new Map;if(p.length)for(var g=0;g<p.length;g++){var y=p[g];if(y.object.userData&&y.object.userData.obj.getType()==o.kLine){var v=y.object.userData.obj;if(f&h.MxOsnapDefine.OsModeEnd){var x=d.distanceTo(v.pt1);v.pt1.type=u.MxJigCmdManager.OsnapMode.kOsModeEnd,m.set(x,v.pt1);var b=d.distanceTo(v.pt2);v.pt2.type=u.MxJigCmdManager.OsnapMode.kOsModeEnd,m.set(b,v.pt2)}if(f&h.MxOsnapDefine.OsModeNear&&(!v.bulge||0==v.bulge)){var w=this.calculateDistance(v.pt1,v.pt2,d);w&&(w.targetPt.type=u.MxJigCmdManager.OsnapMode.kOsModeNear,m.set(w.distance,w.targetPt))}}}if(m.size){var M=this.mxObj.screenCoordLong2World(r),_=Array.from(m);_.sort(function(t,e){return t[0]-e[0]}),_[0][0]<M&&e(_[0][1],_[0][1].type)}}},w.prototype.mxWebEntitysData=function(t,e){var n=this.getBlobHead(t,0);t.getInt32(n.nOffset,!0),n.nOffset+=4;var r=t.getInt32(n.nOffset,!0);n.nOffset+=4;var i=t.getInt32(n.nOffset,!0);if(n.nOffset+=4,1<i)console.log("mx:error mxfun.js version is old!");else{var o=t.getInt32(n.nOffset,!0);if(n.nOffset+=4,o==n.nOffset){this.threejsObjects=new s.Object3D;for(var a=0;a<r;a++){var c=t.getInt8(n.nOffset);n.nOffset+=1;var u=t.getInt32(n.nOffset,!0);if(n.nOffset+=4,1==c){var h=t.getFloat32(n.nOffset,!0);n.nOffset+=4;var d=t.getFloat32(n.nOffset,!0);n.nOffset+=4;var p=t.getFloat32(n.nOffset,!0);n.nOffset+=4;var f=t.getFloat32(n.nOffset,!0);n.nOffset+=4,(_=new v).pt1=new s.Vector3(h,d,0),_.pt2=new s.Vector3(p,f,0),(C=l.MxThreeJS.createLine(_.pt1,_.pt2,16777215)).userData.obj=_,this.threejsObjects.add(C)}else if(2==c){var m=t.getInt8(n.nOffset);n.nOffset+=1;var g=t.getInt32(n.nOffset,!0);n.nOffset+=4;for(var y=new s.Vector3,x=0,b=null,w=0;w<g;w++){var M=new s.Vector3;M.x=t.getFloat32(n.nOffset,!0),n.nOffset+=4,M.y=t.getFloat32(n.nOffset,!0),n.nOffset+=4;var _,C,S=t.getFloat32(n.nOffset,!0);n.nOffset+=4,0<w&&((_=new v).pt1=y.clone(),_.pt2=M.clone(),_.bulge=S,(C=l.MxThreeJS.createLine(_.pt1,_.pt2,16777215)).userData.obj=_,this.threejsObjects.add(C)),y=M,x=S,0==w&&(b=M)}m&&2<g&&((_=new v).pt1=b.clone(),_.pt2=y.clone(),_.bulge=x,(C=l.MxThreeJS.createLine(_.pt1,_.pt2,16777215)).userData.obj=_,this.threejsObjects.add(C))}else console.log("mx:error mxWebEntitysData type"),n.nOffset=n.nOffset-5+u}}else console.log("mx: mxWebEntitysData size assert(0)")}},w);function w(t){this.threejsObjects=null,this.mxObj=null,this.mxObj=t}n.MxDrawObjectOsnap=b},{"../MxDrawData":29,"../MxThreeJS":44,"./McEdJigOsnap":49,"./MxJigCmdManager":58,three:19}],55:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxEntSelJig=void 0;var o,a=t("./MxJig"),s=t("./MxJigCmdManager"),l=t("../UI/MxUiVue"),c=t("../MrxDbgUtils"),u=(i(h,o=a.McEdJigCommand),h.prototype.sampler=function(){var t=s.MxJigCmdManager.InType.kGetBegan,e=this.acquirePoint(t);return e.status==s.MxJigCmdManager.DragStatus.kNormal&&(this.point=e.pt),e.status},h.prototype.done=function(t){if(t==s.MxJigCmdManager.DragStatus.kNormal){var e=this;c.MrxDbgUtils.findEntAtPoint(this.getMxObject(),this.point,this.filter).then(function(t){e.callRet(t)})}else this.callRet([]);return s.MxJigCmdManager.DoneStatius.kExitCommand},h.prototype.onStartCommand=function(){l.MxUiVue.setCursorType(l.MxUiVue.CursorType.kRect),o.prototype.onStartCommand.call(this)},h.prototype.onExitCommand=function(){l.MxUiVue.setCursorType(l.MxUiVue.CursorType.kNormal),s.MxJigCmdManager.isWaitCmdNull()&&l.MxUiVue.restoreCmdStatus(),o.prototype.onExitCommand.call(this,!0)},h.prototype.upDisplay=function(){},h);function h(){return null!==o&&o.apply(this,arguments)||this}n.MxEntSelJig=u},{"../MrxDbgUtils":20,"../UI/MxUiVue":67,"./MxJig":57,"./MxJigCmdManager":58}],56:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxIntelliSelectJig=void 0;var o,a=t("three"),s=t("./MxJig"),l=t("./MxJigCmdManager"),c=t("../MxThreeJS"),u=(i(h,o=s.McEdJigCommand),h.prototype.sampler=function(){var t=l.MxJigCmdManager.InType.kGetBegan,e=this.acquirePoint(t);return e.status==l.MxJigCmdManager.DragStatus.kNormal&&(this.m_pt2=e.pt),e.status},h.prototype.getTypeName=function(){return"MxIntelliSelect"},h.prototype.done=function(t){if(t==l.MxJigCmdManager.DragStatus.kNormal){var e=this.getMxObject();if(this.m_isFrontEndWebpage)e.getMxDatabase().getGripManager().doWindowsSelect(this.m_pt1,this.m_pt2);else{var n={x1:this.m_pt1.x,y1:this.m_pt1.y,x2:this.m_pt2.x,y2:this.m_pt2.y};e.callCommand("MxCAD_IntelliSelect",JSON.stringify(n),function(t){e.getMxCAD().getGrip().onIntelliSelect(t)})}}return l.MxJigCmdManager.DoneStatius.kExitCommand},h.prototype.doPointSelect=function(t,e,n){var r=t.screenCoordLong2Doc(16),i={x:e.x,y:e.y,tol:r};t.callCommand("MxCAD_IntelliSelect_Point",JSON.stringify(i),function(t){n(t)})},h.prototype.upDisplay=function(){var t=new a.Vector3(this.m_pt1.x,this.m_pt2.y,this.m_pt2.z),e=new a.Vector3(this.m_pt2.x,this.m_pt1.y,this.m_pt2.z),n=[];n.push(this.m_pt1),n.push(t),n.push(this.m_pt2),n.push(e),n.push(this.m_pt1);var r=null,i=65280;if(this.m_pt2.x>this.m_pt1.x)r=c.MxThreeJS.createLines(n,16777215),i=255;else{var o=this.getMxObject().screenCoordLong2Doc(3);r=c.MxThreeJS.createDashedLines(n,16777215,2*o,o)}var s=[];s.push(this.m_pt1),s.push(t),s.push(this.m_pt2),s.push(this.m_pt1),s.push(this.m_pt2),s.push(e);var l=c.MxThreeJS.createTriangle(s,i,.27);this.drawEntity(l,30),this.drawEntity(r,31)},h);function h(t,e){var n=o.call(this)||this;return n.m_pt1=t,n.m_pt2=t,n.m_isFrontEndWebpage=e,n}n.MxIntelliSelectJig=u},{"../MxThreeJS":44,"./MxJig":57,"./MxJigCmdManager":58,three:19}],57:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.McEdJigCommand=n.MxDynamicInput=void 0;var r=t("three"),i=t("../MxFun"),o=t("./MxJigCmdManager"),a=t("../MxManager"),s=t("../MxTools"),l=t("../UI/MxUiVue"),c=t("./McEdJigOsnap"),u=t("../MxWindowsEvent"),h=(d.prototype.onKeyDonw=function(t){if(27==t)return this.m_isInputStatus?(this.m_isInputStatus=!1,l.MxUiVue.OnMxEvent({name:"dynInputReSet"}),1):0;if(32!=t&&13!=t)return this.m_isInputStatus=!0,0;if(this.m_isInputStatus&&l.MxUiVue.DynamicInput_isShow()&&l.MxUiVue.DynamicInput_getType()==o.MxJigCmdManager.DynamicInputType.kXYCoordInput){var e,n=l.MxUiVue.DynamicInput_getValue1(),r=l.MxUiVue.DynamicInput_getValue2(),a=l.MxUiVue.DynamicInput_getFocusValue();e=s.MxTools.IsNumerical(n)&&s.MxTools.IsNumerical(r)?i.MxFun.formatString("{0},{1}",n,r):a,l.MxUiVue.setCmdText(e)}return this.m_isInputStatus=!1,0},d.prototype.isInputStatus=function(){return this.m_isInputStatus},d.prototype.initDynInput=function(t){this.m_jig=t;var e=this.m_jig.getMxObject();l.MxUiVue.DynamicInput_setType(this.m_dynType),this.m_dynType==o.MxJigCmdManager.DynamicInputType.kAutoInput&&(null!=this._dynamicInputBasePoint||e.sysVariable().getSysVarNumber("GETPOINTSTATUS")&o.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastPoint?l.MxUiVue.DynamicInput_setType(o.MxJigCmdManager.DynamicInputType.kDistanceInput):l.MxUiVue.DynamicInput_setType(o.MxJigCmdManager.DynamicInputType.kXYCoordInput))},d.prototype.setFocus=function(t){l.MxUiVue.OnMxEvent({name:"dynInputSetFocus",param:{isFocus:t}})},d.prototype.exitDynInput=function(){this._dynamicInputBasePoint=void 0,l.MxUiVue.DynamicInput_setShow(!1),l.MxUiVue.DynamicInput_upDisplay()},d.prototype.isShow=function(){return l.MxUiVue.DynamicInput_isShow()},d.prototype.upDynInput=function(){var t,e=this.m_jig.getMxObject();if(t=!this.m_jig.isDisableDynInput()&&e.sysVariable().getSysVarBool("DYNINPUT"),l.MxUiVue.DynamicInput_setShow(t),t){if(l.MxUiVue.DynamicInput_setTip(l.MxUiVue.getCmdTip()),o.MxJigCmdManager.getAcquireStatus()==o.MxJigCmdManager.AcquireStatus.kMove){var n=o.MxJigCmdManager.getAcquirePoint();if(l.MxUiVue.DynamicInput_setPos(i.MxFun.docCoord2Screen(n.x,n.y,n.z)),l.MxUiVue.DynamicInput_getType()==o.MxJigCmdManager.DynamicInputType.kXYCoordInput){var r=n;l.MxUiVue.DynamicInput_setValue1(r.x.toFixed(3)),l.MxUiVue.DynamicInput_setValue2(r.y.toFixed(3))}else l.MxUiVue.DynamicInput_getType(),o.MxJigCmdManager.DynamicInputType.kDistanceInput}l.MxUiVue.DynamicInput_upDisplay()}},d.prototype.setDynamicInputBasePoint=function(t){this._dynamicInputBasePoint=t},d.prototype.setDynamicInputType=function(t){this.m_dynType=t},d.prototype.getDynamicInputType=function(){return this.m_dynType},d);function d(t){this.m_dynType=o.MxJigCmdManager.DynamicInputType.kAutoInput,this._dynamicInputBasePoint=void 0,this.m_isInputStatus=!1,this.m_jig=t}n.MxDynamicInput=h;var p=(f.prototype.getTypeName=function(){return""},f.prototype.getSence=function(){return this._mxObject.getTheTempDrawContainer()},f.prototype.onExitCommand=function(t){t&&this.m_dynInput.exitDynInput(),this.m_osnap.endDrag()},f.prototype.getOsnap=function(){return this.m_osnap},f.prototype.isDisableDynInput=function(){return this.m_isDisableDynInput},f.prototype.setDisableDynInput=function(t){this.m_isDisableDynInput=t},f.prototype.setDisableOsnap=function(t){this.m_isDisableOsnap=t},f.prototype.isDisableOsnap=function(){return this.m_isDisableOsnap},f.prototype.onStartCommand=function(){this._isCancle=!1,this._isExit=!1,this.m_dynInput.initDynInput(this),c.McEdImpJigGlobalData.intiStartDrag(this._mxObject),this.m_osnap.startDrag(this.m_isOffsetInputPostion,this);var t=u.MxWindowsEvent.getCurrentMousePostion(),e=this._mxObject.screenCoord2Doc(t.x,t.y,0);this.m_osnap.setPoint(e),o.MxJigCmdManager.doMouseMoveImp(),this.m_dynInput.setFocus(!0)},f.prototype.getDynImput=function(){return this.m_dynInput},f.prototype.setMxObject=function(t){this._mxObject=t},f.prototype.getMxObject=function(){return this._mxObject},f.prototype.setColor=function(t){this._iColor=t},f.prototype.getColor=function(){return this._iColor},f.prototype.setDynamicInputType=function(t){this.m_dynInput.setDynamicInputType(t)},f.prototype.getDynamicInputType=function(){return this.m_dynInput.getDynamicInputType()},f.prototype.createTriangle=function(t,e,n){var i=new r.MeshBasicMaterial({color:this._iColor,side:r.DoubleSide}),o=new r.Geometry;o.vertices.push(t),o.vertices.push(e),o.vertices.push(n);var a=new r.Vector3(1,1,1),s=new r.Color(this._iColor),l=new r.Face3(0,1,2,a,s,0);return o.faces.push(l),o.computeFaceNormals(),o.computeVertexNormals(),new r.Mesh(o,i)},f.prototype.createPoint=function(t){var e=new r.Geometry;e.vertices.push(t);var n=new r.PointsMaterial({color:this._iColor,size:3});return new r.Points(e,n)},f.prototype.createLine=function(t,e){var n=new r.Geometry,i=new r.LineBasicMaterial({color:this._iColor});return n.vertices.push(t,e),new r.Line(n,i)},f.prototype.drawReserve=function(t){this.m_isReserveDrawStatus=!0,this.m_callReserveDrawAddEntity=t,this.upDisplay(),this.m_isReserveDrawStatus=!1,this.m_callReserveDrawAddEntity=null},f.prototype.drawEntity=function(t,e){if(null!=t)if(this.m_isReserveDrawStatus)t.renderOrder=null!=e?e:a.MxData.iDynJigRenderOrder,this._mxObject.addObject(t),this.m_callReserveDrawAddEntity&&this.m_callReserveDrawAddEntity(t);else{var n="MxDynDraw_"+this._DynNameId.toString();t.name=n,t.renderOrder=null!=e?e:a.MxData.iDynJigRenderOrder,null==this._aryDynDrawObjectNamesId&&(this._aryDynDrawObjectNamesId=new Array),this._aryDynDrawObjectNamesId.push(this._DynNameId),this._DynNameId++,this.getSence().add(t)}},f.prototype.floorPowerOfTwo=function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},f.prototype.makeTextSprite=function(t,e,n,o,a){var s,l=document.createElement("canvas"),c=l.getContext("2d"),u=i.MxFun.formatString("normal {0}px Arial","256");c.font=u;var h=c.measureText(t);s=2*this.floorPowerOfTwo(h.width),l.width=s,l.height=256,c.font=u,c.textAlign="center",c.textBaseline="middle";var d=i.MxFun.formatString("#{0}",a.toString(16));c.fillStyle=d,c.fillText(t,s/2,128);var p=new r.Texture(l);p.needsUpdate=!0;var f=new r.SpriteMaterial({map:p});f.transparent=!1,f.rotation=o;var m=new r.Sprite(f);return m.scale.set(s/256*n,n,1),m.position.set(e.x,e.y,0),m},f.prototype.drawText=function(t,e,n,r){var i=this.makeTextSprite(t,r,e,n,this._iColor);this.drawEntity(i)},f.prototype.drawPoints=function(t){for(var e=0;e<t.length;e++){var n=new r.Geometry;n.vertices.push(t[e]);var i=new r.PointsMaterial({color:this._iColor,size:3}),o=new r.Points(n,i);this.drawEntity(o)}},f.prototype.drawPoint=function(t){var e=new r.Geometry;e.vertices.push(t);var n=new r.PointsMaterial({color:this._iColor,size:3}),i=new r.Points(e,n);this.drawEntity(i)},f.prototype.drawPolyline=function(t){for(var e=new r.Geometry,n=0;n<t.length;n++)e.vertices.push(t[n]);var i=new r.LineBasicMaterial({color:this._iColor}),o=new r.Line(e,i);this.drawEntity(o)},f.prototype.drawSpline=function(t){},f.prototype.drawCircle=function(t,e){var n=new r.CircleGeometry(e,64,3,2*Math.PI),i=new r.LineBasicMaterial({color:this._iColor});n.vertices.shift();var o=new r.LineLoop(n,i);o.position.x=t.x,o.position.y=t.y,o.position.z=t.z,this.drawEntity(o)},f.prototype.drawArc=function(t,e,n,i){var o=new r.CircleGeometry(e,64,n,i),a=new r.LineBasicMaterial({color:this._iColor});o.vertices.shift();var s=new r.Line(o,a);s.position.x=t.x,s.position.y=t.y,s.position.z=t.z,this.drawEntity(s)},f.prototype.drawLine=function(t,e){var n=new r.Geometry,i=new r.LineBasicMaterial({color:this._iColor});n.vertices.push(t,e);var o=new r.Line(n,i);this.drawEntity(o)},f.prototype.removeDynDrawObject=function(){if(null!=this._aryDynDrawObjectNamesId){for(var t=0;t<this._aryDynDrawObjectNamesId.length;t++){var e="MxDynDraw_"+this._aryDynDrawObjectNamesId[t].toString(),n=this.getSence().getObjectByName(e);i.MxFun.removeThreejsObject(n,this.getSence())}this._aryDynDrawObjectNamesId=[]}},f.prototype.acquirePoint=function(t){var e=o.MxJigCmdManager.acquirePoint(t);return this._isExit=e.exit,e},f.prototype.notifyCancleExit=function(){this._isCancle=!0,this.removeDynDrawObject(),this.done(o.MxJigCmdManager.DragStatus.kCancel),this.onExitCommand(!0),o.MxJigCmdManager.commandRunComplete(this)},f.prototype.notifySampler=function(){var t=this.sampler();if(this.m_dynInput.upDynInput(),t==o.MxJigCmdManager.DragStatus.kNormal&&(this.removeDynDrawObject(),this.upDisplay()),this._isExit){var e=this.done(t);this._isCancle||(e==o.MxJigCmdManager.DoneStatius.kContinueCommand?(this._isExit=!1,o.MxJigCmdManager.doMouseMoveImp(),l.MxUiVue.OnMxEvent({name:"dynInputReSet"})):(this.removeDynDrawObject(),o.MxJigCmdManager.commandRunComplete(this),this.onExitCommand(!0)))}this._mxObject.updateDisplay()},f.prototype.getCurrentMouseButton=function(){return o.MxJigCmdManager.getCurrentMouseButton()},f.prototype.userInputControls=function(){return this._userInputContros},f.prototype.setUserInputControls=function(t){this._userInputContros=t},f);function f(){this._isExit=!1,this._aryDynDrawObjectNamesId=void 0,this._DynNameId=1,this._iColor=16777215,this._isCancle=!1,this.m_isDisableDynInput=!1,this.m_isDisableOsnap=!1,this.m_dynInput=new h(this),this.m_osnap=new c.McEdJigOsnap(this),this._userInputContros=o.MxJigCmdManager.UserInputControls.kNullResponseAccepted,this.m_isOffsetInputPostion=!1,this.m_isReserveDrawStatus=!1,this.m_callReserveDrawAddEntity=null,this._mxObject=null}n.McEdJigCommand=p},{"../MxFun":34,"../MxManager":36,"../MxTools":45,"../MxWindowsEvent":48,"../UI/MxUiVue":67,"./McEdJigOsnap":49,"./MxJigCmdManager":58,three:19}],58:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxJigCmdManager=n.AcquireReturn=void 0;var r,i=t("three"),o=t("../MxFun"),a=t("./MxJig"),s=t("../MxManager"),l=t("./MrxDbgUiPrPoint"),c=t("./MrxDbgUiPrBase"),u=t("../UI/MxUiVue"),h=t("../MxTools"),d=t("../MxString"),p=t("../MxWindowsEvent"),f=t("../MxDrawObject"),m=t("./McEdJigOsnap"),g=t("../MxDrawData"),y=function(){this.status=r.DragStatus.kNoChange,this.exit=!0,this.sKeyValue=""};n.AcquireReturn=y,function(t){var e,n,r,v,x,b,w,M,_,C,S,T,E,D,A,O,P,L;(n=e=t.UserInputControls||(t.UserInputControls={}))[n.kGovernedByOrthoMode=1]="kGovernedByOrthoMode",n[n.kNullResponseAccepted=2]="kNullResponseAccepted",n[n.kDontEchoCancelForCtrlC=4]="kDontEchoCancelForCtrlC",n[n.kDontUpdateLastPoint=8]="kDontUpdateLastPoint",n[n.kNoDwgLimitsChecking=16]="kNoDwgLimitsChecking",n[n.kNoZeroResponseAccepted=32]="kNoZeroResponseAccepted",n[n.kNoNegativeResponseAccepted=64]="kNoNegativeResponseAccepted",n[n.kAccept3dCoordinates=128]="kAccept3dCoordinates",n[n.kAcceptMouseUpAsPoint=256]="kAcceptMouseUpAsPoint",n[n.kAnyBlankTerminatesInput=512]="kAnyBlankTerminatesInput",n[n.kInitialBlankTerminatesInput=1024]="kInitialBlankTerminatesInput",n[n.kAcceptOtherInputString=2048]="kAcceptOtherInputString",n[n.kGovernedByUCSDetect=4096]="kGovernedByUCSDetect",n[n.kNoZDirectionOrtho=8192]="kNoZDirectionOrtho",n[n.kSpacesInAccepted=16384]="kSpacesInAccepted",(v=r=t.AcquireStatus||(t.AcquireStatus={}))[v.kNoChange=0]="kNoChange",v[v.kMove=1]="kMove",v[v.kBegan=2]="kBegan",v[v.kEnd=3]="kEnd",v[v.kMouseUp=4]="kMouseUp",v[v.kMouseDown=5]="kMouseDown",v[v.kCancle=6]="kCancle",(b=x=t.DragStatus||(t.DragStatus={}))[b.kNoChange=-6]="kNoChange",b[b.kCancel=-4]="kCancel",b[b.kOther=-3]="kOther",b[b.kNull=-1]="kNull",b[b.kNormal=0]="kNormal",b[b.kKW1=1]="kKW1",(w=t.DoneStatius||(t.DoneStatius={}))[w.kContinueCommand=0]="kContinueCommand",w[w.kExitCommand=1]="kExitCommand",(_=M=t.InType||(t.InType={}))[_.kGetBegan=1]="kGetBegan",_[_.kGetEnd=2]="kGetEnd",(S=C=t.MouseButton||(t.MouseButton={}))[S.kInvalid=-1]="kInvalid",S[S.kLeft=0]="kLeft",S[S.kMid=1]="kMid",S[S.kRight=2]="kRight",(E=T=t.COMMAND_IN||(t.COMMAND_IN={}))[E.COMMAND_IN_NO_ENTITY=0]="COMMAND_IN_NO_ENTITY",E[E.COMMAND_IN_EMTPY=1]="COMMAND_IN_EMTPY",E[E.COMMAND_IN_KEY=2]="COMMAND_IN_KEY",E[E.COMMAND_IN_STRING=3]="COMMAND_IN_STRING",E[E.COMMAND_IN_COORD=5]="COMMAND_IN_COORD",E[E.COMMAND_IN_DIST=6]="COMMAND_IN_DIST",E[E.COMMAND_IN_INVALID=7]="COMMAND_IN_INVALID",E[E.COMMAND_IN_INVALID_ZERO=8]="COMMAND_IN_INVALID_ZERO",E[E.COMMAND_IN_INVALID_NEG=9]="COMMAND_IN_INVALID_NEG",E[E.COMMAND_IN_INT=10]="COMMAND_IN_INT",(A=D=t.COMMAND_GET||(t.COMMAND_GET={}))[A.COMMAND_GET_STRING=1]="COMMAND_GET_STRING",A[A.COMMAND_GET_KEY=2]="COMMAND_GET_KEY",A[A.COMMAND_GET_DIST=4]="COMMAND_GET_DIST",A[A.COMMAND_GET_COORD=8]="COMMAND_GET_COORD",A[A.COMMAND_GET_INT=16]="COMMAND_GET_INT",(O=t.DynamicInputType||(t.DynamicInputType={}))[O.kNoInput=0]="kNoInput",O[O.kXYCoordInput=1]="kXYCoordInput",O[O.kDistanceInput=2]="kDistanceInput",O[O.kDynTip=3]="kDynTip",O[O.kAutoInput=4]="kAutoInput",O[O.kAngleInput=5]="kAngleInput",(P=t.GETPOINTSTATUS||(t.GETPOINTSTATUS={}))[P.OsModeSValidLastPoint=1]="OsModeSValidLastPoint",P[P.OsModeSTempDisable=2]="OsModeSTempDisable",P[P.OsModeOrthoTempDisable=4]="OsModeOrthoTempDisable",P[P.OsModeSInvalidLastMovePoint=8]="OsModeSInvalidLastMovePoint",P[P.OsModePoloarTempDisable=16]="OsModePoloarTempDisable",P[P.OsModeDynTraceTempDisable=32]="OsModeDynTraceTempDisable",P[P.OsModeGridSnapTempDisable=64]="OsModeGridSnapTempDisable",(L=t.OsnapMode||(t.OsnapMode={}))[L.kOsModekValid=0]="kOsModekValid",L[L.kOsModeEnd=1]="kOsModeEnd",L[L.kOsModeMid=2]="kOsModeMid",L[L.kOsModeCen=3]="kOsModeCen",L[L.kOsModeNode=4]="kOsModeNode",L[L.kOsModeQuad=5]="kOsModeQuad",L[L.kOsModeIns=7]="kOsModeIns",L[L.kOsModePerp=8]="kOsModePerp",L[L.kOsModeTan=9]="kOsModeTan",L[L.kOsModeNear=10]="kOsModeNear",L[L.kOsModeInt=11]="kOsModeInt";var R,I=void 0,k=void 0,F=r.kNoChange,B=C.kInvalid,j=-9999999,N=new i.Vector2(j,j),z=!1,V=void 0,G=!1,H=new Map,U=new Array,W=new d.MxString,J=void 0;function q(){null!=I&&I.notifySampler()}function X(t){var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==I)return;if(I.getDynImput().isInputStatus())return;N.x=t.offsetX,N.y=t.offsetY,tt(N),t.stopPropagation()}}function Y(t){if(t.button!=C.kLeft)return 0;var e=t.srcElement;return!e||"CANVAS"!=e.tagName||null==I||I.getDynImput().isInputStatus()?0:(N.x=t.offsetX,N.y=t.offsetY,R=I.getMxObject().screenCoord2Doc(t.offsetX,t.offsetY,0),F=r.kMouseUp,B=t.button,q(),t.stopPropagation(),1)}function Z(t){if(t.button!=C.kLeft)return 0;null!=I&&I.getDynImput().isShow()&&I.getDynImput().setFocus(!0);var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==I)return 0;if(I.getDynImput().isInputStatus())return 0;N.x=t.offsetX,N.y=t.offsetY;var n=I.getMxObject().screenCoord2Doc(t.offsetX,t.offsetY,0),i=I.getOsnap(),o=i.getCurrentOSnapPoint(n);return n=o.pt,o.osmode,m.McEdImpJigGlobalData.setPrvPoint(n),i.seInValidPoint(),R=n,F=r.kMouseDown,B=t.button,q(),t.stopPropagation(),1}return 0}function $(t){if(0!=t.touches.length){null!=I&&I.getDynImput().isShow()&&I.getDynImput().setFocus(!0);var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==I)return;if(I.getDynImput().isInputStatus())return;N.x=t.touches[0].pageX,N.y=t.touches[0].pageY;var n=I.getMxObject().screenCoord2Doc(t.touches[0].pageX,t.touches[0].pageY,0),i=I.getOsnap(),o=i.getCurrentOSnapPoint(n);return n=o.pt,o.osmode,m.McEdImpJigGlobalData.setPrvPoint(n),i.seInValidPoint(),R=n,F=r.kBegan,B=C.kInvalid,q(),t.stopPropagation(),1}}}function K(t){var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==I)return;if(I.getDynImput().isInputStatus())return;if(N.x==j||N.y==j)return;return R=I.getMxObject().screenCoord2Doc(N.x,N.y,0),F=r.kEnd,B=C.kInvalid,q(),t.stopPropagation(),1}}function Q(t){var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==I)return;if(I.getDynImput().isInputStatus())return;N.x=t.touches[0].pageX,N.y=t.touches[0].pageY,tt(N)}}function tt(e){if(G=!1,null==e){if(N.x==j||N.y==j)return;e=N}var n=I.getMxObject().screenCoord2Doc(e.x,e.y,0),i=I.getOsnap(),o=I.getMxObject().screenCoordLong2Doc(.5*g.MxDrawData.getCursorWidthPixels());i.setPoint(n,o),t.OsnapMode.kOsModekValid,R=n,F=r.kMove,q.call(this)}function et(){I&&(J=I.getMxObject().getEventManager(),o.MxFun.isPC()?(J.addEventListener("mouseup",Y,!0),J.addEventListener("mousemove",X,!0),J.addEventListener("mousedown",Z,!0)):(J.addEventListener("touchstart",$,!0),J.addEventListener("touchend",K,!0),J.addEventListener("touchmove",Q,!0)))}function nt(){J&&(o.MxFun.isPC()?(J.removeEventListener("mouseup",Y,!0),J.removeEventListener("mousemove",X,!0),J.removeEventListener("mousedown",Z,!0)):(J.removeEventListener("touchstart",$,!0),J.removeEventListener("touchend",K,!0),J.removeEventListener("touchmove",Q,!0)),J=void 0)}function rt(t){var e=t.getOrbitControls();o.MxFun.isPC()||(e.enabled=!1),e.resetStatusValue(),t.getRunMode()==f.MxRunMode.kBrowse&&t.enableSingleTouchPan(!1),t.tempDisableSelect(!0),t.updateDisplay()}function it(t){var e=new i.Vector3,n=!1,r=new d.MxString(t),o=r.AnalyzeString(",");if(o.length<2)for(;!r.IsEmpty()&&h.MxTools.IsNumerical(r);){var a=h.MxTools._tstof(r.m_val);if(h.MxTools.IsZero(a))break;break}else{var s=new d.MxString(o[0]),l=new d.MxString(o[1]),c=new d.MxString("0");2<o.length&&(c.m_val=o[2]),s.IsEmpty()||"@"!=s.Left(1)?h.MxTools.IsNumerical(s)&&h.MxTools.IsNumerical(l)&&h.MxTools.IsNumerical(c)?(n=!0,e.x=h.MxTools._tstof(s.m_val),e.y=h.MxTools._tstof(l.m_val),e.z=h.MxTools._tstof(c.m_val)):n=!1:(s.m_val=s.Right(s.GetLength()-1),h.MxTools.IsNumerical(s)&&h.MxTools.IsNumerical(l)&&h.MxTools.IsNumerical(c)||(n=!1))}return n?e:null}function ot(t,e){void 0===e&&(e=!1),u.MxUiVue.AcutPrintfNoFormat(t,e)}function at(t,n){if(t==T.COMMAND_IN_INVALID){var r=u.MxUiVue.getCmdTip();return ot(n),ot(r),x.kNoChange}return t==T.COMMAND_IN_INVALID_ZERO?(r=u.MxUiVue.getCmdTip(),I.userInputControls()&e.kNoNegativeResponseAccepted?ot("\n 值必须为正 且非零。 \n"):ot("\n 值必不能为零。 \n"),ot(r),x.kOther):t!=T.COMMAND_IN_INVALID_NEG?x.kNoChange:(r=u.MxUiVue.getCmdTip(),I.userInputControls()&e.kNoZeroResponseAccepted?ot("\n 值必须为正 且非零。 \n"):ot("\n 值必不能为负。 \n"),ot(r),x.kOther)}function st(t){var n={iRet:T.COMMAND_IN_NO_ENTITY,sValue:"",iKey:x.kNull,dDist:0,iVal:0,pt:null};if(!G)return n;var r=I.userInputControls(),i=u.MxUiVue.getCmdText();if(0==i.length)return r&e.kNullResponseAccepted?n.iRet=T.COMMAND_IN_EMTPY:n.iRet=T.COMMAND_IN_INVALID,n;if(t&D.COMMAND_GET_KEY&&0<H.size){var o=new d.MxString(i);o.MakeUpper(),o.TrimLeft(" "),o.TrimRight(" ");var a=H.get(o.m_val);if(null!=a)return n.iRet=T.COMMAND_IN_KEY,n.iKey=a,n.sValue=o.m_val,n}if(t&D.COMMAND_GET_DIST&&h.MxTools.IsNumerical(i))return n.dDist=h.MxTools._tstof(i),r&e.kNoZeroResponseAccepted&&h.MxTools.IsZero(n.dDist)?n.iRet=T.COMMAND_IN_INVALID_ZERO:r&e.kNoNegativeResponseAccepted&&n.dDist<0?n.iRet=T.COMMAND_IN_INVALID_NEG:(n.sValue=i,n.iRet=T.COMMAND_IN_DIST),n;if(t&D.COMMAND_GET_INT&&h.MxTools.IsNumerical(i))return n.iVal=h.MxTools._tstoi(i),r&e.kNoZeroResponseAccepted&&0==n.iiVal?n.iRet=T.COMMAND_IN_INVALID_ZERO:r&e.kNoNegativeResponseAccepted&&n.iiVal<0?n.iRet=T.COMMAND_IN_INVALID_NEG:(n.sValue=i,n.iRet=T.COMMAND_IN_INT),n;if(t&D.COMMAND_GET_COORD){var s=it(i);if(null!=s)return n.sValue=i,n.iRet=T.COMMAND_IN_COORD,n.pt=s,n}return t&D.COMMAND_GET_STRING?(n.sValue=i,n.iRet=T.COMMAND_IN_STRING):n.iRet=T.COMMAND_IN_INVALID,n}t.getInputKeyword=function(t){if(t<1)return"";for(var e,n=H.entries();!(e=n.next()).done;)if(e.value==t)return e.key;return""},t.GetKeyWordToString=function(){return U},t.keywordList=function(){return W.m_val},t.setKeywordList=function(t){if(W.m_val=t,H.clear(),U.length=0,!W.IsEmpty())if(W.TrimLeft(" "),W.TrimRight(" "),"["==W.m_val[0]&&"]"==W.m_val[W.m_val.length-1]){W.TrimLeft("["),W.TrimRight("]");for(var e=W.AnalyzeString("/"),n=1,r=0;r<e.length;r++){var i=(s=new d.MxString(e[r])).Find("(");if(-1!=i){var o=new d.MxString(s.Left(i)),a=new d.MxString(s.Right(s.GetLength()-i-1));a.TrimRight(")"),o.IsEmpty()||a.IsEmpty()||(a.MakeUpper(),H.set(a.m_val,n),n++,U.push(new h.MxPair(a.m_val,o.m_val)))}}}else for(e=W.AnalyzeString(" "),n=1,r=0;r<e.length;r++){var s;(s=new d.MxString(e[r])).IsEmpty()||(s.MakeUpper(),H.set(s.m_val,n),n++)}},t.getAcquirePoint=function(){return R},t.getAcquireStatus=function(){return F},t.doMouseMoveImp=tt,t.OnThreeControlsChage=function(){null==I||N.x!=j&&N.y!=j&&tt(N)},t.OnEnter=function(t){G=!0,F=r.kNoChange,q(),G=!1},t.Test=function(){G=!0},t.registEvent=et,t.unRegistEvent=nt,t.getCurrentMouseButton=function(){return B},t.isRunning=function(){return null!=I},t.getCurCmd=function(){return I},t.commandRunComplete=function(t){I!=t&&console.log("aseert:_curCmd == cmd");var e,n=s.MxManager.currentMx();null!=I&&(n=I.getMxObject()),null!=k?(I=k,k=void 0,B=C.kInvalid,et(),I.onStartCommand(),rt(n)):(nt(),I=void 0,e=n,o.MxFun.isPC()||(e.getOrbitControls().enabled=!0),e.getRunMode()==f.MxRunMode.kBrowse&&e.enableSingleTouchPan(!0),e.tempDisableSelect(!1),e.updateDisplay(),g.MxDrawData.m_isAutoResetRenderer||e.resetRenderer())},t.isWaitCmdNull=function(){return null==k},t.stopCmd=function(){null!=I&&(z=!0,I.notifyCancleExit(),z=!1)},t.setRunCmdEvent=function(t){V=t},t.runCmd=function(t){if(!z){var e=s.MxManager.currentMx();t.setMxObject(e),o.MxFun.isPC()?N=p.MxWindowsEvent.getCurrentMousePostion():(N.x=j,N.y=j),V&&V(),null==I?(I=t,B=C.kInvalid,et(),I.onStartCommand(),rt(e)):(k=t,z=!0,I.notifyCancleExit(),z=!1)}},t.GetAcqurePointFromStringTo=it,t.ProcCommandRetResult=at,t.GetCommandLineContent=st,t.acquirePoint=function(t){var e=new y;if(null==I)return e.status=x.kCancel,e;var n=st(D.COMMAND_GET_COORD|D.COMMAND_GET_KEY);return n.iRet==T.COMMAND_IN_EMTPY?(e.status=x.kNull,e.exit=!0):n.iRet==T.COMMAND_IN_KEY?(e.status=n.iKey,e.exit=!0,e.sKeyValue=n.sValue):n.iRet==T.COMMAND_IN_COORD?(e.status=x.kNormal,e.pt=new i.Vector3(n.pt.x,n.pt.y,n.pt.z),e.exit=!0):(at(n.iRet,"\n 需要点或选项关键字。 \n"),F==r.kMove?(e.status=x.kNormal,e.pt=R,e.exit=!1):F==r.kEnd?t&M.kGetEnd?(e.status=x.kNormal,e.pt=R,e.exit=!0):(e.status=x.kNormal,e.pt=R,e.exit=!1):F==r.kCancle?(e.status=x.kCancel,e.pt=R,e.exit=!0):F==r.kBegan?t&M.kGetBegan?(e.status=x.kNormal,e.pt=R,e.exit=!0):(e.status=x.kNormal,e.pt=R,e.exit=!1):F==r.kMouseDown?(e.status=x.kNormal,e.pt=R,e.exit=!0):(e.status=x.kNoChange,e.pt=void 0,e.exit=!1)),e},t.getMcEdJigCommandClass=function(){return a.McEdJigCommand},t.getMrxDbgUiPrPointClass=function(){return l.MrxDbgUiPrPoint},t.getMcEdGetPointWorldDrawClass=function(){return c.McEdGetPointWorldDraw},t.McEdGetPointWorldDrawObjectClass=function(){return c.McEdGetPointWorldDrawObject},t.init=function(){this._curCmd=void 0}}(r=n.MxJigCmdManager||(n.MxJigCmdManager={}))},{"../MxDrawData":29,"../MxDrawObject":30,"../MxFun":34,"../MxManager":36,"../MxString":42,"../MxTools":45,"../MxWindowsEvent":48,"../UI/MxUiVue":67,"./McEdJigOsnap":49,"./MrxDbgUiPrBase":51,"./MrxDbgUiPrPoint":52,"./MxJig":57,three:19}],59:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxJigGetLine=void 0;var o,a=t("./MxJig"),s=t("./MxJigCmdManager"),l=t("../MxFun"),c=(i(u,o=a.McEdJigCommand),u.prototype.sampler=function(){var t=s.MxJigCmdManager.InType.kGetBegan;this._isGetPt1||(t=s.MxJigCmdManager.InType.kGetEnd);var e=this.acquirePoint(t);return e.status==s.MxJigCmdManager.DragStatus.kNormal&&(this._isGetPt1?this._pt1=e.pt:this._pt2=e.pt),e.status},u.prototype.setRetCall=function(t){this._retCall=t},u.prototype.done=function(t){if(this._isGetPt1)return this._isGetPt1=!1,s.MxJigCmdManager.DoneStatius.kContinueCommand;var e={};return e.pt1=l.MxFun.worldCoord2Doc(this._pt1.x,this._pt1.y,this._pt1.z),e.pt2=l.MxFun.worldCoord2Doc(this._pt2.x,this._pt2.y,this._pt2.z),this._retCall(e),s.MxJigCmdManager.DoneStatius.kExitCommand},u.prototype.upDisplay=function(){this._isGetPt1||null==this._pt1||null==this._pt2||this.drawLine(this._pt1,this._pt2)},u);function u(){var t=null!==o&&o.apply(this,arguments)||this;return t._isGetPt1=!0,t}n.MxJigGetLine=c},{"../MxFun":34,"./MxJig":57,"./MxJigCmdManager":58}],60:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0});var r=t("./MxFun");function i(){}(i.CreateMx=function(){r.MxFun.init(),"undefined"!=typeof MxMain&&0==MxMain(t)||r.MxFun.createMxObject();var e=r.MxFun.getUiObject();null!=e&&(e.sTitle=r.MxFun.getCurrentDraw().getFileTitle(),setTimeout(function(){e.init()},400))},i.Main=function(){if("undefined"!=typeof MxUiMain){MxUiMain(t);var e=r.MxFun.getUiObject();null!=e&&e.writeUICSS()}"undefined"==typeof MxDocumentReady?$(document).ready(function(){i.CreateMx()}):MxDocumentReady(t,i.CreateMx)},i).Main()},{"./MxFun":34}],61:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxSvgManager=void 0;var r=t("three"),i=t("three"),o=t("./SVGLoader"),a=function(){this.svg=new r.Group,this.aryMeterial=[],this.boxSize=new i.Vector3(1,1,1)},s=(l.prototype.loadSVGImp=function(t,e,n,i){(new o.SVGLoader).load(t,function(a){if(a.paths.length){var s=[],l=a.paths,c=new r.Group,u=!0,h=!0,d=!1,p=!1;i&&(i.drawStrokes&&(u=i.drawStrokes),i.drawFillShapes&&(h=i.drawFillShapes),i.fillShapesWireframe&&(d=i.fillShapesWireframe),i.strokesWireframe&&(p=i.strokesWireframe));for(var f=0;f<l.length;f++){var m=l[f],g=m.userData.style.fill;if(h&&void 0!==g&&"none"!==g){for(var y=new r.MeshBasicMaterial({color:e||(new r.Color).setStyle(g),opacity:m.userData.style.fillOpacity,transparent:m.userData.style.fillOpacity<1,side:r.DoubleSide,depthWrite:!1,wireframe:d}),v=o.SVGLoader.createShapes(m),x=0;x<v.length;x++){var b=v[x],w=new r.ShapeBufferGeometry(b),M=new r.Mesh(w,y);c.add(M)}s.push(y)}var _=m.userData.style.stroke;if(u&&void 0!==_&&"none"!==_){y=new r.MeshBasicMaterial({color:e||(new r.Color).setStyle(_),opacity:m.userData.style.strokeOpacity,transparent:m.userData.style.strokeOpacity<1,side:r.DoubleSide,depthWrite:!1,wireframe:p}),x=0;for(var C=m.subPaths.length;x<C;x++){var S=m.subPaths[x];(w=o.SVGLoader.pointsToStroke(S.getPoints(),m.userData.style,12,.001))&&(M=new r.Mesh(w,y),c.add(M))}s.push(y)}}n&&n(c,s)}else console.log("mx svg:"+t+" data.paths.length == 0"),n&&n(null,null)},void 0,function(){n&&n(null,null)})},l.prototype.loadSVG=function(t,e,n,r){var o=this,s=this.mapSvgUrlToData.get(t),l=!r||!r.useBuffer||r.useBuffer;if(s&&l){if(n)if(null==s)n(null,null);else{var c=s.svg.clone();c.boxSize=s.boxSize,n(c,s.aryMeterial)}}else this.loadSVGImp(t,e,function(e,r){if(e&&r){var s=new a;s.svg=e,s.aryMeterial=r;var l=(new i.Box3).setFromObject(e);s.boxSize.x=l.max.x-l.min.x,s.boxSize.y=l.max.y-l.min.y,s.boxSize.x!==-1/0&&s.boxSize.y!==-1/0||console.log("mx svg:"+t+" boxSize invalid"),o.mapSvgUrlToData.set(t,s);var c=s.svg.clone();c.boxSize=s.boxSize,n&&n(c,s.aryMeterial)}else o.mapSvgUrlToData.set(t,null),n&&n(null,null)},r)},l);function l(){this.mapSvgUrlToData=new Map}var c=(u.prototype.loadSVG=function(t,e,n,r){n&&this.mxThreeJsBuffer.loadSVG(t,e,n,r)},u);function u(){this.mxThreeJsBuffer=new s}n.MxSvgManager=c},{"./SVGLoader":62,three:19}],62:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.SVGLoader=void 0;var o,a=t("three"),s=(i(l,o=a.Loader),l.prototype.load=function(t,e,n,r){var i=this,o=new a.FileLoader(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(t,function(n){try{e(i.parse(n))}catch(n){r?r(n):console.error(n),i.manager.itemError(t)}},n,r)},l.prototype.parse=function(t){var e=this;function n(t,e,n,i,o,a,s,l){if(0!=e&&0!=n){i=i*Math.PI/180,e=Math.abs(e),n=Math.abs(n);var c=(s.x-l.x)/2,u=(s.y-l.y)/2,h=Math.cos(i)*c+Math.sin(i)*u,d=-Math.sin(i)*c+Math.cos(i)*u,p=e*e,f=n*n,m=h*h,g=d*d,y=m/p+g/f;if(1<y){var v=Math.sqrt(y);p=(e*=v)*e,f=(n*=v)*n}var x=p*g+f*m,b=(p*f-x)/x,w=Math.sqrt(Math.max(0,b));o===a&&(w=-w);var M=w*e*d/n,_=-w*n*h/e,C=Math.cos(i)*M-Math.sin(i)*_+(s.x+l.x)/2,S=Math.sin(i)*M+Math.cos(i)*_+(s.y+l.y)/2,T=r(1,0,(h-M)/e,(d-_)/n),E=r((h-M)/e,(d-_)/n,(-h-M)/e,(-d-_)/n)%(2*Math.PI);t.currentPath.absellipse(C,S,e,n,T,T+E,0===a,i)}else t.lineTo(l.x,l.y)}function r(t,e,n,r){var i=t*n+e*r,o=Math.sqrt(t*t+e*e)*Math.sqrt(n*n+r*r),a=Math.acos(Math.max(-1,Math.min(1,i/o)));return t*r-e*n<0&&(a=-a),a}function i(t,e){e=Object.assign({},e);var n={};if(t.hasAttribute("class"))for(var r=t.getAttribute("class").split(/\s/).filter(Boolean).map(function(t){return t.trim()}),i=0;i<r.length;i++)n=Object.assign(n,d["."+r[i]]);function o(r,i,o){void 0===o&&(o=function(t){return t.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),t}),t.hasAttribute(r)&&(e[i]=o(t.getAttribute(r))),n[r]&&(e[i]=o(n[r])),t.style&&""!==t.style[r]&&(e[i]=o(t.style[r]))}function a(t){return Math.max(0,Math.min(1,u(t)))}function s(t){return Math.max(0,u(t))}return t.hasAttribute("id")&&(n=Object.assign(n,d["#"+t.getAttribute("id")])),o("fill","fill"),o("fill-opacity","fillOpacity",a),o("fill-rule","fillRule"),o("opacity","opacity",a),o("stroke","stroke"),o("stroke-opacity","strokeOpacity",a),o("stroke-width","strokeWidth",s),o("stroke-linejoin","strokeLineJoin"),o("stroke-linecap","strokeLineCap"),o("stroke-miterlimit","strokeMiterLimit",s),o("visibility","visibility"),e}function o(t,e){return t-(e-t)}function s(t,e,n){if("string"!=typeof t)throw new TypeError("Invalid input: "+typeof t);var r,i={SEPARATOR:/[ \t\r\n\,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/},o=0,a=!0,s="",l="",c=[];function u(t,e,n){var r=new SyntaxError('Unexpected character "'+t+'" at index '+e+".");throw r.partial=n,r}function h(){""!==s&&(""===l?c.push(Number(s)):c.push(Number(s)*Math.pow(10,Number(l)))),l=s=""}for(var d=t.length,p=0;p<d;p++)if(r=t[p],Array.isArray(e)&&e.includes(c.length%n)&&i.FLAGS.test(r))o=1,s=r,h();else{if(0===o){if(i.WHITESPACE.test(r))continue;if(i.DIGIT.test(r)||i.SIGN.test(r)){o=1,s=r;continue}if(i.POINT.test(r)){o=2,s=r;continue}i.COMMA.test(r)&&(a&&u(r,p,c),a=!0)}if(1===o){if(i.DIGIT.test(r)){s+=r;continue}if(i.POINT.test(r)){s+=r,o=2;continue}if(i.EXP.test(r)){o=3;continue}i.SIGN.test(r)&&1===s.length&&i.SIGN.test(s[0])&&u(r,p,c)}if(2===o){if(i.DIGIT.test(r)){s+=r;continue}if(i.EXP.test(r)){o=3;continue}i.POINT.test(r)&&"."===s[s.length-1]&&u(r,p,c)}if(3===o){if(i.DIGIT.test(r)){l+=r;continue}if(i.SIGN.test(r)){if(""===l){l+=r;continue}1===l.length&&i.SIGN.test(l)&&u(r,p,c)}}i.WHITESPACE.test(r)?(h(),o=0,a=!1):i.COMMA.test(r)?(h(),a=!(o=0)):i.SIGN.test(r)?(h(),o=1,s=r):i.POINT.test(r)?(h(),o=2,s=r):u(r,p,c)}return h(),c}var l=["mm","cm","in","pt","pc","px"],c={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1}};function u(t){var n="px";if("string"==typeof t||t instanceof String)for(var r=0,i=l.length;r<i;r++){var o=l[r];if(t.endsWith(o)){n=o,t=t.substring(0,t.length-o.length);break}}var a=void 0;return"px"===n&&"px"!==e.defaultUnit?a=c.in[e.defaultUnit]/e.defaultDPI:(a=c[n][e.defaultUnit])<0&&(a=c[n].in*e.defaultDPI),a*parseFloat(t)}var h=[],d={},p=[],f=new a.Matrix3,m=new a.Matrix3,g=new a.Matrix3,y=new a.Matrix3,v=new a.Vector2,x=new a.Vector3,b=new a.Matrix3,w=(new DOMParser).parseFromString(t,"image/svg+xml");return function t(e,r){if(1===e.nodeType){var l,c,w,M,_,C,S,T,E,D,A,O,P=function(t){if(!(t.hasAttribute("transform")||"use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))))return null;var e=function(t){var e=new a.Matrix3,n=f;if("use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))){var r=u(t.getAttribute("x")),i=u(t.getAttribute("y"));e.translate(r,i)}if(t.hasAttribute("transform"))for(var o=t.getAttribute("transform").split(")"),l=o.length-1;0<=l;l--){var c=o[l].trim();if(""!==c){var h=c.indexOf("("),d=c.length;if(0<h&&h<d){var p=c.substr(0,h),v=s(c.substr(h+1,d-h-1));switch(n.identity(),p){case"translate":1<=v.length&&(i=r=v[0],2<=v.length&&(i=v[1]),n.translate(r,i));break;case"rotate":if(1<=v.length){var x,b=0,w=0;x=-v[0]*Math.PI/180,3<=v.length&&(b=v[1],w=v[2]),m.identity().translate(-b,-w),g.identity().rotate(x),y.multiplyMatrices(g,m),m.identity().translate(b,w),n.multiplyMatrices(m,y)}break;case"scale":if(1<=v.length){var M=v[0],_=M;2<=v.length&&(_=v[1]),n.scale(M,_)}break;case"skewX":1===v.length&&n.set(1,Math.tan(v[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===v.length&&n.set(1,0,0,Math.tan(v[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===v.length&&n.set(v[0],v[2],v[4],v[1],v[3],v[5],0,0,1)}}e.premultiply(n)}}return e}(t);return 0<p.length&&e.premultiply(p[p.length-1]),b.copy(e),p.push(e),e}(e),L=!0,R=null;switch(e.nodeName){case"svg":break;case"style":!function(t){if(t.sheet&&t.sheet.cssRules&&t.sheet.cssRules.length)for(var e=0;e<t.sheet.cssRules.length;e++){var n=t.sheet.cssRules[e];if(1===n.type)for(var r=n.selectorText.split(/,/gm).filter(Boolean).map(function(t){return t.trim()}),i=0;i<r.length;i++)d[r[i]]=Object.assign(d[r[i]]||{},n.style)}}(e);break;case"g":r=i(e,r);break;case"path":r=i(e,r),e.hasAttribute("d")&&(R=function(t){for(var e=new a.ShapePath,r=new a.Vector2,i=new a.Vector2,l=new a.Vector2,c=!0,u=!1,h=t.getAttribute("d").match(/[a-df-z][^a-df-z]*/gi),d=0,p=h.length;d<p;d++){var f=h[d],m=f.charAt(0),g=f.substr(1).trim();!0===c&&(c=!(u=!0));var y=void 0;switch(m){case"M":for(var v=0,x=(y=s(g)).length;v<x;v+=2)r.x=y[v+0],r.y=y[v+1],i.x=r.x,i.y=r.y,0===v?e.moveTo(r.x,r.y):e.lineTo(r.x,r.y),0===v&&l.copy(r);break;case"H":for(v=0,x=(y=s(g)).length;v<x;v++)r.x=y[v],i.x=r.x,i.y=r.y,e.lineTo(r.x,r.y),0===v&&!0===u&&l.copy(r);break;case"V":for(v=0,x=(y=s(g)).length;v<x;v++)r.y=y[v],i.x=r.x,i.y=r.y,e.lineTo(r.x,r.y),0===v&&!0===u&&l.copy(r);break;case"L":for(v=0,x=(y=s(g)).length;v<x;v+=2)r.x=y[v+0],r.y=y[v+1],i.x=r.x,i.y=r.y,e.lineTo(r.x,r.y),0===v&&!0===u&&l.copy(r);break;case"C":for(v=0,x=(y=s(g)).length;v<x;v+=6)e.bezierCurveTo(y[v+0],y[v+1],y[v+2],y[v+3],y[v+4],y[v+5]),i.x=y[v+2],i.y=y[v+3],r.x=y[v+4],r.y=y[v+5],0===v&&!0===u&&l.copy(r);break;case"S":for(v=0,x=(y=s(g)).length;v<x;v+=4)e.bezierCurveTo(o(r.x,i.x),o(r.y,i.y),y[v+0],y[v+1],y[v+2],y[v+3]),i.x=y[v+0],i.y=y[v+1],r.x=y[v+2],r.y=y[v+3],0===v&&!0===u&&l.copy(r);break;case"Q":for(v=0,x=(y=s(g)).length;v<x;v+=4)e.quadraticCurveTo(y[v+0],y[v+1],y[v+2],y[v+3]),i.x=y[v+0],i.y=y[v+1],r.x=y[v+2],r.y=y[v+3],0===v&&!0===u&&l.copy(r);break;case"T":for(v=0,x=(y=s(g)).length;v<x;v+=2){var b=o(r.x,i.x),w=o(r.y,i.y);e.quadraticCurveTo(b,w,y[v+0],y[v+1]),i.x=b,i.y=w,r.x=y[v+0],r.y=y[v+1],0===v&&!0===u&&l.copy(r)}break;case"A":for(v=0,x=(y=s(g,[3,4],7)).length;v<x;v+=7)if(y[v+5]!=r.x||y[v+6]!=r.y){var M=r.clone();r.x=y[v+5],r.y=y[v+6],i.x=r.x,i.y=r.y,n(e,y[v],y[v+1],y[v+2],y[v+3],y[v+4],M,r),0===v&&!0===u&&l.copy(r)}break;case"m":for(v=0,x=(y=s(g)).length;v<x;v+=2)r.x+=y[v+0],r.y+=y[v+1],i.x=r.x,i.y=r.y,0===v?e.moveTo(r.x,r.y):e.lineTo(r.x,r.y),0===v&&l.copy(r);break;case"h":for(v=0,x=(y=s(g)).length;v<x;v++)r.x+=y[v],i.x=r.x,i.y=r.y,e.lineTo(r.x,r.y),0===v&&!0===u&&l.copy(r);break;case"v":for(v=0,x=(y=s(g)).length;v<x;v++)r.y+=y[v],i.x=r.x,i.y=r.y,e.lineTo(r.x,r.y),0===v&&!0===u&&l.copy(r);break;case"l":for(v=0,x=(y=s(g)).length;v<x;v+=2)r.x+=y[v+0],r.y+=y[v+1],i.x=r.x,i.y=r.y,e.lineTo(r.x,r.y),0===v&&!0===u&&l.copy(r);break;case"c":for(v=0,x=(y=s(g)).length;v<x;v+=6)e.bezierCurveTo(r.x+y[v+0],r.y+y[v+1],r.x+y[v+2],r.y+y[v+3],r.x+y[v+4],r.y+y[v+5]),i.x=r.x+y[v+2],i.y=r.y+y[v+3],r.x+=y[v+4],r.y+=y[v+5],0===v&&!0===u&&l.copy(r);break;case"s":for(v=0,x=(y=s(g)).length;v<x;v+=4)e.bezierCurveTo(o(r.x,i.x),o(r.y,i.y),r.x+y[v+0],r.y+y[v+1],r.x+y[v+2],r.y+y[v+3]),i.x=r.x+y[v+0],i.y=r.y+y[v+1],r.x+=y[v+2],r.y+=y[v+3],0===v&&!0===u&&l.copy(r);break;case"q":for(v=0,x=(y=s(g)).length;v<x;v+=4)e.quadraticCurveTo(r.x+y[v+0],r.y+y[v+1],r.x+y[v+2],r.y+y[v+3]),i.x=r.x+y[v+0],i.y=r.y+y[v+1],r.x+=y[v+2],r.y+=y[v+3],0===v&&!0===u&&l.copy(r);break;case"t":for(v=0,x=(y=s(g)).length;v<x;v+=2)b=o(r.x,i.x),w=o(r.y,i.y),e.quadraticCurveTo(b,w,r.x+y[v+0],r.y+y[v+1]),i.x=b,i.y=w,r.x=r.x+y[v+0],r.y=r.y+y[v+1],0===v&&!0===u&&l.copy(r);break;case"a":for(v=0,x=(y=s(g,[3,4],7)).length;v<x;v+=7)0==y[v+5]&&0==y[v+6]||(M=r.clone(),r.x+=y[v+5],r.y+=y[v+6],i.x=r.x,i.y=r.y,n(e,y[v],y[v+1],y[v+2],y[v+3],y[v+4],M,r),0===v&&!0===u&&l.copy(r));break;case"Z":case"z":e.currentPath.autoClose=!0,0<e.currentPath.curves.length&&(r.copy(l),e.currentPath.currentPoint.copy(r),c=!0);break;default:console.warn(f)}u=!1}return e}(e));break;case"rect":r=i(e,r),R=function(t){var e=u(t.getAttribute("x")||0),n=u(t.getAttribute("y")||0),r=u(t.getAttribute("rx")||t.getAttribute("ry")||0),i=u(t.getAttribute("ry")||t.getAttribute("rx")||0),o=u(t.getAttribute("width")),s=u(t.getAttribute("height")),l=.448084975506,c=new a.ShapePath;return c.moveTo(e+r,n),c.lineTo(e+o-r,n),0===r&&0===i||c.bezierCurveTo(e+o-r*l,n,e+o,n+i*l,e+o,n+i),c.lineTo(e+o,n+s-i),0===r&&0===i||c.bezierCurveTo(e+o,n+s-i*l,e+o-r*l,n+s,e+o-r,n+s),c.lineTo(e+r,n+s),0===r&&0===i||c.bezierCurveTo(e+r*l,n+s,e,n+s-i*l,e,n+s-i),c.lineTo(e,n+i),0===r&&0===i||c.bezierCurveTo(e,n+i*l,e+r*l,n,e+r,n),c}(e);break;case"polygon":r=i(e,r),D=e,A=new a.ShapePath,O=0,D.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,function(t,e,n){var r=u(e),i=u(n);0===O?A.moveTo(r,i):A.lineTo(r,i),O++}),A.currentPath.autoClose=!0,R=A;break;case"polyline":r=i(e,r),S=e,T=new a.ShapePath,E=0,S.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,function(t,e,n){var r=u(e),i=u(n);0===E?T.moveTo(r,i):T.lineTo(r,i),E++}),T.currentPath.autoClose=!1,R=T;break;case"circle":r=i(e,r),R=function(t){var e=u(t.getAttribute("cx")||0),n=u(t.getAttribute("cy")||0),r=u(t.getAttribute("r")||0),i=new a.Path;i.absarc(e,n,r,0,2*Math.PI,!1);var o=new a.ShapePath;return o.subPaths.push(i),o}(e);break;case"ellipse":r=i(e,r),R=function(t){var e=u(t.getAttribute("cx")||0),n=u(t.getAttribute("cy")||0),r=u(t.getAttribute("rx")||0),i=u(t.getAttribute("ry")||0),o=new a.Path;o.absellipse(e,n,r,i,0,2*Math.PI,void 0,void 0);var s=new a.ShapePath;return s.subPaths.push(o),s}(e);break;case"line":r=i(e,r),c=u((l=e).getAttribute("x1")||0),w=u(l.getAttribute("y1")||0),M=u(l.getAttribute("x2")||0),_=u(l.getAttribute("y2")||0),(C=new a.ShapePath).moveTo(c,w),C.lineTo(M,_),C.currentPath.autoClose=!1,R=C;break;case"defs":L=!1;break;case"use":r=i(e,r);var I=e.href.baseVal.substring(1),k=e.viewportElement.getElementById(I);k?t(k,r):console.warn("SVGLoader: 'use node' references non-existent node id: "+I)}if(R&&(void 0!==r.fill&&"none"!==r.fill&&R.color.setStyle(r.fill),function(t,e){function n(t){x.set(t.x,t.y,1).applyMatrix3(e),t.set(x.x,x.y)}for(var r=function(t){return 0!==t.elements[1]||0!==t.elements[3]}(e),i=t.subPaths,o=0,a=i.length;o<a;o++)for(var s=i[o].curves,l=0;l<s.length;l++){var c=s[l];c.isLineCurve?(n(c.v1),n(c.v2)):c.isCubicBezierCurve?(n(c.v0),n(c.v1),n(c.v2),n(c.v3)):c.isQuadraticBezierCurve?(n(c.v0),n(c.v1),n(c.v2)):c.isEllipseCurve&&(r&&console.warn("SVGLoader: Elliptic arc or ellipse rotation or skewing is not implemented."),v.set(c.aX,c.aY),n(v),c.aX=v.x,c.aY=v.y,c.xRadius*=(h=e.elements,Math.sqrt(h[0]*h[0]+h[1]*h[1])),c.yRadius*=(u=e.elements,Math.sqrt(u[3]*u[3]+u[4]*u[4])))}var u,h}(R,b),h.push(R),R.userData={node:e,style:r}),L)for(var F=e.childNodes,B=0;B<F.length;B++)t(F[B],r);P&&(p.pop(),0<p.length?b.copy(p[p.length-1]):b.identity())}}(w.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:h,xml:w.documentElement}},l.createShapes=function(t){var e=999999999,n=0,r=1,i=2,o=3,s=4,l=5,c=6,u={loc:n,t:0};function h(t,e,r,o){var a=t.x,s=e.x,l=r.x,c=o.x,h=t.y,p=e.y,f=r.y,m=o.y,g=(c-l)*(h-f)-(m-f)*(a-l),y=(m-f)*(s-a)-(c-l)*(p-h),v=g/y,x=((s-a)*(h-f)-(p-h)*(a-l))/y;if(0==y&&0!=g||v<=0||1<=v||x<0||1<x)return null;if(0==g&&0==y){for(var b=0;b<2;b++){if(d(0===b?r:o,t,e),u.loc==n)return{x:(w=0===b?r:o).x,y:w.y,t:u.t};if(u.loc==i)return{x:+(a+u.t*(s-a)).toPrecision(10),y:+(h+u.t*(p-h)).toPrecision(10),t:u.t}}return null}for(b=0;b<2;b++){var w;if(d(0===b?r:o,t,e),u.loc==n)return{x:(w=0===b?r:o).x,y:w.y,t:u.t}}return{x:+(a+v*(s-a)).toPrecision(10),y:+(h+v*(p-h)).toPrecision(10),t:v}}function d(t,e,a){var h,d=a.x-e.x,p=a.y-e.y,f=t.x-e.x,m=t.y-e.y,g=d*m-f*p;return t.x===e.x&&t.y===e.y?(u.loc=n,u.t=0):t.x===a.x&&t.y===a.y?(u.loc=r,u.t=1,0):void(g<-Number.EPSILON?u.loc=o:g>Number.EPSILON?u.loc=s:d*f<0||p*m<0?u.loc=l:Math.sqrt(d*d+p*p)<Math.sqrt(f*f+m*m)?u.loc=c:(h=0!=d?f/d:m/p,u.loc=i,u.t=h))}function p(t,e,n){var r=new a.Vector2;e.getCenter(r);var i=[];return n.forEach(function(e){e.boundingBox.containsPoint(r)&&function(t,e){for(var n=[],r=[],i=1;i<t.length;i++)for(var o=t[i-1],s=t[i],l=function(t){var i=e[t-1],l=e[t],c=h(o,s,i,l);null!==c&&void 0===n.find(function(t){return t.t<=c.t+Number.EPSILON&&t.t>=c.t-Number.EPSILON})&&(n.push(c),r.push(new a.Vector2(c.x,c.y)))},c=1;c<e.length;c++)l(c);return r}(t,e.points).forEach(function(t){i.push({identifier:e.identifier,isCW:e.isCW,point:t})})}),i.sort(function(t,e){return t.point.x-e.point.x}),i}var f=0,m=e,g=-e,y=t.subPaths.map(function(t){for(var n=t.getPoints(),r=-e,i=e,o=-e,s=e,l=0;l<n.length;l++){var c=n[l];c.y>r&&(r=c.y),c.y<i&&(i=c.y),c.x>o&&(o=c.x),c.x<s&&(s=c.x)}return g<=o&&(g=o+1),s<=m&&(m=s-1),{curves:t.curves,points:n,isCW:a.ShapeUtils.isClockWise(n),identifier:f++,boundingBox:new a.Box2(new a.Vector2(s,i),new a.Vector2(o,r))}});y=y.filter(function(t){return 1<t.points.length}),f=0;var v=(y=y.map(function(t){return t.identifier=f,f++,t})).map(function(e){return function(t,e,n,r,i){null!=i&&""!==i||(i="nonzero");var o=new a.Vector2;t.boundingBox.getCenter(o);var s=p([new a.Vector2(n,o.y),new a.Vector2(r,o.y)],t.boundingBox,e);s.sort(function(t,e){return t.point.x-e.point.x});var l=[],c=[];s.forEach(function(e){e.identifier===t.identifier?l.push(e):c.push(e)});for(var u=l[0].point.x,h=[],d=0;d<c.length&&c[d].point.x<u;)0<h.length&&h[h.length-1]===c[d].identifier?h.pop():h.push(c[d].identifier),d++;if(h.push(t.identifier),"evenodd"===i){var f=h.length%2==0,m=h[h.length-2];return{identifier:t.identifier,isHole:f,for:m}}if("nonzero"===i){f=!0;for(var g=m=null,y=0;y<h.length;y++){var v=h[y];f?(g=e[v].isCW,f=!1,m=v):g!==e[v].isCW&&(g=e[v].isCW,f=!0)}return{identifier:t.identifier,isHole:f,for:m}}console.warn('fill-rule: "'+i+'" is currently not implemented.')}(e,y,m,g,t.userData.style.fillRule)}),x=[];return y.forEach(function(t){if(!v[t.identifier].isHole){var e=new a.Shape;e.curves=t.curves,v.filter(function(e){return e.isHole&&e.for===t.identifier}).forEach(function(t){var n=y[t.identifier],r=new a.Path;r.curves=n.curves,e.holes.push(r)}),x.push(e)}}),x},l.getStrokeStyle=function(t,e,n,r,i){return{strokeColor:e=void 0!==e?e:"#000",strokeWidth:t=void 0!==t?t:1,strokeLineJoin:n=void 0!==n?n:"miter",strokeLineCap:r=void 0!==r?r:"butt",strokeMiterLimit:i=void 0!==i?i:4}},l.pointsToStroke=function(t,e,n,r){var i=[],o=[],s=[];if(0===l.pointsToStrokeWithBuffers(t,e,n,r,i,o,s))return null;var c=new a.BufferGeometry;return c.setAttribute("position",new a.Float32BufferAttribute(i,3)),c.setAttribute("normal",new a.Float32BufferAttribute(o,3)),c.setAttribute("uv",new a.Float32BufferAttribute(s,2)),c},l.pointsToStrokeWithBuffers=function(t,e,n,r,i,o,s,l){var c=new a.Vector2,u=new a.Vector2,h=new a.Vector2,d=new a.Vector2,p=new a.Vector2,f=new a.Vector2,m=new a.Vector2,g=new a.Vector2,y=new a.Vector2,v=new a.Vector2,x=new a.Vector2,b=new a.Vector2,w=new a.Vector2,M=new a.Vector2,_=new a.Vector2,C=new a.Vector2,S=new a.Vector2;n=void 0!==n?n:12,r=void 0!==r?r:.001,l=void 0!==l?l:0;var T=(t=function(t){for(var e=!1,n=1,i=t.length-1;n<i;n++)if(t[n].distanceTo(t[n+1])<r){e=!0;break}if(!e)return t;var o=[];for(o.push(t[0]),n=1,i=t.length-1;n<i;n++)t[n].distanceTo(t[n+1])>=r&&o.push(t[n]);return o.push(t[t.length-1]),o}(t)).length;if(T<2)return 0;var E,D,A,O,P,L,R=t[0].equals(t[T-1]),I=t[0],k=e.strokeWidth/2,F=1/(T-1),B=0,j=!1,N=0,z=3*l,V=2*l;K(t[0],t[1],c).multiplyScalar(k),g.copy(t[0]).sub(c),y.copy(t[0]).add(c),v.copy(g),x.copy(y);for(var G=1;G<T;G++){E=t[G],D=G===T-1?R?t[1]:void 0:t[G+1];var H=c;if(K(I,E,H),h.copy(H).multiplyScalar(k),b.copy(E).sub(h),w.copy(E).add(h),A=B+F,O=!1,void 0!==D){K(E,D,u),h.copy(u).multiplyScalar(k),M.copy(E).sub(h),_.copy(E).add(h),P=!0,h.subVectors(D,I),H.dot(h)<0&&(P=!1),1===G&&(j=P),h.subVectors(D,E),h.normalize();var U=Math.abs(H.dot(h));if(0!==U){var W=k/U;h.multiplyScalar(-W),d.subVectors(E,I),p.copy(d).setLength(W).add(h),C.copy(p).negate();var J=p.length(),q=d.length();d.divideScalar(q),f.subVectors(D,E);var X=f.length();switch(f.divideScalar(X),d.dot(C)<q&&f.dot(C)<X&&(O=!0),S.copy(p).add(E),C.add(E),L=!1,O?P?(_.copy(C),w.copy(C)):(M.copy(C),b.copy(C)):et(),e.strokeLineJoin){case"bevel":nt(P,O,A);break;case"round":rt(P,O),P?tt(E,b,M,A,0):tt(E,_,w,A,1);break;default:var Y=k*e.strokeMiterLimit/J;if(Y<1){if("miter-clip"!==e.strokeLineJoin){nt(P,O,A);break}rt(P,O),P?(f.subVectors(S,b).multiplyScalar(Y).add(b),m.subVectors(S,M).multiplyScalar(Y).add(M),Q(b,A,0),Q(f,A,0),Q(E,A,.5),Q(E,A,.5),Q(f,A,0),Q(m,A,0),Q(E,A,.5),Q(m,A,0),Q(M,A,0)):(f.subVectors(S,w).multiplyScalar(Y).add(w),m.subVectors(S,_).multiplyScalar(Y).add(_),Q(w,A,1),Q(f,A,1),Q(E,A,.5),Q(E,A,.5),Q(f,A,1),Q(m,A,1),Q(E,A,.5),Q(m,A,1),Q(_,A,1))}else O?(P?(Q(y,B,1),Q(g,B,0),Q(S,A,0),Q(y,B,1),Q(S,A,0),Q(C,A,1)):(Q(y,B,1),Q(g,B,0),Q(S,A,1),Q(g,B,0),Q(C,A,0),Q(S,A,1)),P?M.copy(S):_.copy(S)):P?(Q(b,A,0),Q(S,A,0),Q(E,A,.5),Q(E,A,.5),Q(S,A,0),Q(M,A,0)):(Q(w,A,1),Q(S,A,1),Q(E,A,.5),Q(E,A,.5),Q(S,A,1),Q(_,A,1)),L=!0}}else et()}else et();R||G!==T-1||it(t[0],v,x,P,!0,B),B=A,I=E,g.copy(M),y.copy(_)}if(R){if(O&&i){var Z=S,$=C;j!==P&&(Z=C,$=S),P?(L||j)&&($.toArray(i,0),$.toArray(i,9),L&&Z.toArray(i,3)):!L&&j||($.toArray(i,3),$.toArray(i,9),L&&Z.toArray(i,0))}}else it(E,b,w,P,!1,A);return N;function K(t,e,n){return n.subVectors(e,t),n.set(-n.y,n.x).normalize()}function Q(t,e,n){i&&(i[z]=t.x,i[z+1]=t.y,i[z+2]=0,o&&(o[z]=0,o[z+1]=0,o[z+2]=1),z+=3,s&&(s[V]=e,s[V+1]=n,V+=2)),N+=3}function tt(t,e,r,i,o){c.copy(e).sub(t).normalize(),u.copy(r).sub(t).normalize();var a=Math.PI,s=c.dot(u);Math.abs(s)<1&&(a=Math.abs(Math.acos(s))),a/=n,h.copy(e);for(var l=0,p=n-1;l<p;l++)d.copy(h).rotateAround(t,a),Q(h,i,o),Q(d,i,o),Q(t,i,.5),h.copy(d);Q(d,i,o),Q(r,i,o),Q(t,i,.5)}function et(){Q(y,B,1),Q(g,B,0),Q(b,A,0),Q(y,B,1),Q(b,A,1),Q(w,A,0)}function nt(t,e,n){e?(t?(Q(y,B,1),Q(g,B,0),Q(b,A,0),Q(y,B,1),Q(b,A,0),Q(C,A,1),Q(b,n,0),Q(M,n,0)):(Q(y,B,1),Q(g,B,0),Q(w,A,1),Q(g,B,0),Q(C,A,0),Q(w,A,1),Q(w,n,1),Q(_,n,0)),Q(C,n,.5)):(t?(Q(b,n,0),Q(M,n,0)):(Q(w,n,1),Q(_,n,0)),Q(E,n,.5))}function rt(t,e){e&&(t?(Q(y,B,1),Q(g,B,0),Q(b,A,0),Q(y,B,1),Q(b,A,0),Q(C,A,1),Q(b,B,0),Q(E,A,.5),Q(C,A,1),Q(E,A,.5),Q(M,B,0),Q(C,A,1)):(Q(y,B,1),Q(g,B,0),Q(w,A,1),Q(g,B,0),Q(C,A,0),Q(w,A,1),Q(w,B,1),Q(C,A,0),Q(E,A,.5),Q(E,A,.5),Q(C,A,0),Q(_,B,1)))}function it(t,n,r,o,a,s){switch(e.strokeLineCap){case"round":a?tt(t,r,n,s,.5):tt(t,n,r,s,.5);break;case"square":if(a)c.subVectors(n,t),u.set(c.y,-c.x),h.addVectors(c,u).add(t),d.subVectors(u,c).add(t),o?(h.toArray(i,3),d.toArray(i,0),d.toArray(i,9)):(h.toArray(i,3),h.toArray(i,9),d.toArray(i,0));else{c.subVectors(r,t),u.set(c.y,-c.x),h.addVectors(c,u).add(t),d.subVectors(u,c).add(t);var l=i.length;o?(h.toArray(i,l-3),d.toArray(i,l-6)):(h.toArray(i,l-6),d.toArray(i,l-3)),d.toArray(i,l-12)}}}},l);function l(t){var e=o.call(this,t)||this;return e.defaultDPI=90,e.defaultUnit="px",e}n.SVGLoader=s},{three:19}],63:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxTest=void 0;var o,a,s=t("../Operate/MrxDbgUiPrBase"),l=t("../Operate/MrxDbgUiPrPoint"),c=t("../MxThreeJS"),u=t("three"),h=t("../MxFun"),d=t("../View/MxDbEntity"),p=t("../MrxDbgUtils"),f=(i(m,o=d.MxDbEntityUserObject),m.prototype.worldDraw=function(t){var e=new u.Vector3(this.pt.x-this.r,this.pt.y-this.r,0),n=new u.Vector3(this.pt.x+this.r,this.pt.y+this.r,0);new u.Vector3(e.x,n.y);var r=new u.Vector3(n.x,e.y);t.setDashLineDisplay(!0),t.setDash(.1,.2),t.drawLine(r,e)},m.prototype.setPoint=function(t){this.pt=t},m.prototype.setR=function(t){this.r=t},m.prototype.getTypeName=function(){return"MxDbTest"},m.prototype.getGripPoints=function(){var t=[];return t.push(this.pt),t},m.prototype.moveGripPointsAt=function(t,e){return 0==t&&this.pt.add(e),!0},m.prototype.dwgIn=function(t){return o.prototype.dwgIn.call(this,t),this.pt.copy(t.pt),this.r=t.r,!0},m.prototype.dwgOut=function(t){return o.prototype.dwgOut.call(this,t),t.pt=this.pt,t.r=this.r,t},m.prototype.create=function(){return new m},m);function m(){var t=null!==o&&o.apply(this,arguments)||this;return t.pt=new u.Vector3,t.r=100,t}function g(t){var e=new l.MrxDbgUiPrPoint;e.setMessage("\n指定第一点:"),e.go(function(t){if(0==t){var n=e.value(),r=new u.Vector3;r.x=n.x,r.y=n.y;var i=new s.McEdGetPointWorldDrawObject;i.setDraw(function(t,e){e.setColor(255),e.drawLine(t,r)}),e.setUserDraw(i),e.setMessage("\n指定下一点:"),e.go(function(t){if(0==t){var r=e.value(),i=h.MxFun.getCurrentDraw(),o=c.MxThreeJS.createLine(n,r,16777215);i.addObject(o)}})}})}function y(){var t=new l.MrxDbgUiPrPoint;t.setMessage("\n指定第一点:"),t.go(function(e){if(0==e){var n=h.MxFun.getCurrentDraw(),r=new f;r.setColor(16711680),r.setPoint(t.value()),r.setR(n.screenCoordLong2Doc(100)),n.addMxEntity(r),n.addMxCurrentSelect(r.objectId())}})}function v(){p.MrxDbgUtils.selectEnt("Test").then(function(t){console.log(t)})}function x(){var t=h.MxFun.getCurrentDraw();a?(t.eraseAllMxEntity(),t.loadMxEntityFromJson(a)):(a=t.saveMxEntityToJson(),console.log(a))}function b(){h.MxFun.openFile("demo/buf/hhhh.dwg?token=123456")}(n.MxTest||(n.MxTest={})).registerCommand=function(){console.log("regist mx test"),(new f).init(),h.MxFun.addCommand("MxTest_GetPoint",g),h.MxFun.addCommand("MxTest_DrawCustomEntity",y),h.MxFun.addCommand("MxTest_EntSel",v),h.MxFun.addCommand("MxTest_SaveMxDbEntityToJson",x),h.MxFun.addCommand("MxTest_OpenFile",b),h.MxFun.addWindowsEvent(function(t,e){if("mouseup"==t){if(h.MxFun.isRunningCommand())return 0;if(0!=e.button)return 0;var n=e.srcElement;if(n&&"CANVAS"==n.tagName){var r=h.MxFun.getCurrentDraw(),i=new u.Vector3(e.offsetX,e.offsetY,0);r.findMxEntityAtPoint(i,!1).length&&e.preventDefault()}return 0}})}},{"../MrxDbgUtils":20,"../MxFun":34,"../MxThreeJS":44,"../Operate/MrxDbgUiPrBase":51,"../Operate/MrxDbgUiPrPoint":52,"../View/MxDbEntity":71,three:19}],64:[function(require,module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.MxUiObject=exports.MxToolBarItem=exports.MxMenuItem=void 0;var MxFun_1=require("../MxFun"),MxMenuItem=function(){this.id=-1,this.text="",this.evalString="",this.parentId=-1};exports.MxMenuItem=MxMenuItem;var MxToolBarItem=function(){this.isMxCommand=!1,this.itemid=""};exports.MxToolBarItem=MxToolBarItem;var MxUiObject=function(){function MxUiObject(){this.vecMenuItem=new Array,this.vecToolBarItem=new Array,this.uiPath="./ui",this.idMenuItemCount=100,this.isShowTitle=!1,this.isShowStructTree=!1,this.isEnableLoading=!0,this.isShowLayer=!1,this.isShowTakeColor=!1,this.isShowLayout=!1,this.isEnableObjectProperty=!1,this.isShowToolbar=!1,this.isShowMainMenu=!1,this.sTitle="",this.sLanguageTable={layout:"布局",layer:"图层",visible:"可见",color:"颜色",name:"名字",status:"状态",openComplete:"提示:打开图纸完成"}}return MxUiObject.prototype.SetLayoutData=function(t){this.vecLayoutData=t},MxUiObject.prototype.CallMxCommand=function(t){MxFun_1.MxFun.callCommand(t,"")},MxUiObject.prototype.EvalJs=function(value){eval(value)},MxUiObject.prototype.SetLayerData=function(t){this.vecLayerData=t},MxUiObject.prototype.SetSketchLayerData=function(t){this.vecSketchLayerData=t},MxUiObject.prototype.init=function(){this.onInit()},MxUiObject.prototype.addMenuItem=function(t,e,n,r){void 0===e&&(e=""),void 0===n&&(n=-1),void 0===r&&(r=-1);var i=new MxMenuItem;i.text=t,i.evalString=e,-1==r&&(r=this.idMenuItemCount,this.idMenuItemCount++),i.id=r,i.parentId=n,this.vecMenuItem.push(i)},MxUiObject.prototype.addToolBarItem=function(t,e,n,r,i){void 0===e&&(e=""),void 0===n&&(n=""),void 0===r&&(r=!1),void 0===i&&(i="");var o=new MxToolBarItem;o.image=t,o.evalString=n,o.text=e,o.isMxCommand=r,o.itemid=i,this.vecToolBarItem.push(o)},MxUiObject.prototype.setPath=function(t){this.uiPath=t},MxUiObject.prototype.getPath=function(){return this.uiPath},MxUiObject.prototype.create=function(){this.onCreate()},MxUiObject.prototype.writeUICSS=function(){var t=this.uiPath;MxFun_1.MxFun.isPC()?(document.write("<link rel='stylesheet' href='"+t+"/css/mxbimpcm.css'>"),this.isShowMainMenu&&(document.write("<link rel='stylesheet' href='"+t+"/css/rightfacefonts2.css'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightmnu.css'>"),document.write("<script type='text/javascript' src='"+t+"/hc-mobile-nav.js'><\/script>"))):(document.write("<link rel='stylesheet' href='"+t+"/css/mxmobile.css'>"),this.isShowMainMenu&&(document.write("<link href='"+t+"/css/font-awesome.min.css' rel='stylesheet'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightfacefonts1.css'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightfacefonts2.css'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightmnu.css'>"),document.write("<script type='text/javascript' src='"+t+"/hc-mobile-nav.js'><\/script>")))},MxUiObject}();exports.MxUiObject=MxUiObject},{"../MxFun":34}],65:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiObjectMobile=void 0;var o,a=t("./MxUiObject"),s=t("../MxFun"),l=(i(c,o=a.MxUiObject),c.prototype.onCreate=function(){this.isShowTitle&&this.WriteTitle(),this.WriteStructTree(),this.isEnableLoading&&this.WriteLoading(),this.WriteLayer(),this.WriteTakeColor(),this.WriteLayout(),this.isEnableObjectProperty&&this.WriteObjectProperty(),this.isShowToolbar&&this.WriteToolbar()},c.prototype.onInit=function(){this.InitEvent()},c.prototype.ShowLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0)"),$(".Prompt").fadeIn(100),$(".Prompt span").css("display","none"))},c.prototype.HideLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0.8)"),$(".Prompt div").fadeOut(100),$(".Prompt span").fadeIn(200),setTimeout(function(){$(".Prompt").fadeOut(1e3)},1e3))},c.prototype.ShowObjectProperty=function(t){if(0!=t.length){var e;e="string"==typeof t?JSON.parse(t):t;var n="";for(var r in e){var i=e[r];for(var o in n+='<tbody class="bf-group undefined bf-collapse">',n+='<tr class="bf-group-title">',n+='<td colspan="2"><i class="bf-icon" style=" padding: 12px;"></i>'+i.name+"</td>",n+="</tr>",i.datas){var a=i.datas[o];n+="<tr class='bf-group-content'>",n+="<td class='bf-key'>"+a.name+"</td>",n+="<td class='bf-value'>"+a.value+"</td>",n+="</tr>"}n+="</tbody>"}document.getElementById("ComponentContent").innerHTML=n,$(".bf-group").click(function(){$(this).hasClass("bf-collapse")?$(this).removeClass("bf-collapse"):$(this).addClass("bf-collapse")})}},c.prototype.HideObjectProp=function(){},c.prototype.SwitchShowLayer=function(){var t=document.getElementById("LayerInterface");"none"==t.style.display?(t.style.display="block",t.style.left="80px",t.style.top="50px"):t.style.display="none"},c.prototype.SwitchShowStructTree=function(){},c.prototype.Chosecolor=function(){document.getElementById("color-picker").click()},c.prototype.ColorChange=function(t){document.getElementById("colorbox").style.backgroundColor=t,s.MxFun.setCurrentColor(t)},c.prototype.SwitchShowLayout=function(){var t=document.getElementById("LayerOutInterface");"none"==t.style.display?t.style.display="block":t.style.display="none"},c.prototype.WriteTitle=function(){var t=this.uiPath;document.write("<div class='bar1'>"),document.write("<img src='"+t+"/image/mxcad.png' style='height: 50%;position: absolute;top: 12px;left: 10px;'>"),document.write("<span class='barspan' style='position: absolute;left: 45px;'>"),document.write("</span>"),document.write("<div id='container'>"),this.isShowMainMenu&&(document.write("<header>"),document.write("<div class='wrapper cf'style='z-index: 999'>"),document.write("<nav id='main-nav' >"),document.write("</nav>"),document.write("<a class='toggle'>"),document.write("<span></span>"),document.write("</a>"),document.write("</div>"),document.write("</header>")),document.write("</div>"),document.write("</div>")},c.prototype.WriteToolbar=function(){document.write("<div id='MainMenuContent' class='bf-toolbar bf-toolbar-bottom'>"),document.write("</div>")},c.prototype.WriteLoading=function(){var t=this.uiPath;document.write("<div class='Prompt' style='width: 100px;height:30px;position:"),document.write("absolute;top: 60px;left: 50%;margin-left: -50px;color: #fff;text-align: center;'>"),document.write("<div style='text-align: center;'>"),document.write("<img src='"+t+"/image/loading.gif' alt='' style='width:30px;height:30px;float: left'>"),document.write("<p style='color:black;vertical-align: middle;float: left; margin-top: 5px;margin-left: 5px;'>加载中.....</p>"),document.write("</div>"),document.write("<span style='vertical-align: middle;display: none'>图纸加载完毕</span>"),document.write("</div>")},c.prototype.WriteLayer=function(){var t=this.uiPath;this.isShowLayer&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' title='ModelTree' style='position: absolute; top:111px;left: 0px;' onclick='uiObj.SwitchShowLayer()'>"),document.write("<div class='bf-button mxbim-bf-tree' title='图层'>"),document.write("<img src='"+t+"/image/layer.png.gif' alt='' style='width: 24px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerInterface' title='图层'"),document.write("style='left: 0px;"),document.write("top: 0px;"),document.write("width: 100%;"),document.write("height: 100%;"),document.write("display: none;'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayer()' style='text-align: center;'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>图层</div>"),document.write("<div>"),document.write("<div class='layer-title' style='width: 12.5%;'>可见</div>"),document.write("<div class='layer-title' style='width: 12.5%;'>颜色</div>"),document.write("<div class='layer-title' style='width: 62.5%'>名字</div>"),document.write("<div class='layer-title' style='width: 12.5%'>状态</div>"),document.write("</div>"),document.write("<div id='Layer-Info' style='margin-top: 26px;height: 79%;width: 100%; position: absolute;overflow-y: auto;'>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteStructTree=function(){this.isShowStructTree&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='Fmj' title='ModelTree'"),document.write("style='position: absolute; top:60px;left: 0px;' onclick='uiObj.SwitchShowStructTree()'>"),document.write("<div class='bf-button mxbim-bf-tree' title='构件树'><i class='fa fa-sitemap' aria-hidden='true' style='font-size: 24px;'></i></div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable tree-panel' id='dv' title='目录树' style='left: 0px; top: 0px; width: 100%; height: 100%; display: none;'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowStructTree()'><i class='fa fa-times fa-2x' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>目录树</div>"),document.write("<div class='bf-panel-body' style='padding-top: 57px;overflow-y: scroll;'>"),document.write("<div class='bf-panel-header'>"),document.write("<div class='bf-panel-header'>"),document.write("<div class='bf-tree-header' style='margin-top: -57px;'>"),document.write("<div class='bf-tabs bf-tabs-tree'>"),document.write("<ul class='bf-tabs-list'>"),document.write("<li class='bf-tabs-option my-option undefined active' id='component'>构件</li>"),document.write("<li class='bf-tabs-option my-option undefined' id='area'>空间</li>"),document.write("<li class='bf-tabs-option my-option undefined' id='drawing'>图纸</li>"),document.write("</ul>"),document.write("</div>"),document.write("</div>"),document.write("</div>"),document.write("</div>"),document.write("<div class='' style='margin-bottom: 100px;' id='DirectoryContent'>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteTakeColor=function(){var t=this.uiPath;this.isShowTakeColor&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='TakeColor'"),document.write("style='position: absolute;left: 0px; top: 162px;width: 45px; '>"),document.write("<div class='bf-button' onclick='uiObj.Chosecolor()' style='opacity: 1;width: 45px;'>"),document.write("<div style='position: relative;margin-left: 10px;margin-top: -5px;'>"),document.write("<img src='"+t+"/image/color.png' alt='' style='width: 40px;margin-left: -21px;'>"),document.write("</div>"),document.write("<div id='colorbox' style='width: 30px;height: 5px;background-color: #cccccc;margin-left: -3px;margin-top: -5px;'>"),document.write("</div>"),document.write("<div style='width: 18px;height: 40px;float: right;margin-top: -38px;margin-left: 14px;position: absolute;'>"),document.write("<img src='"+t+"/image/daojiao.png' alt='' style='width: 15px;margin-top: 10px;z-index: 999;position: relative'>"),document.write("<input id='color-picker' type='color' value='#c0c0c0' style='display: none' onchange='colorChange(value)'>"),document.write("</div>"),document.write("</div>"),document.write("</div>"))},c.prototype.WriteLayout=function(){var t=this.uiPath;this.isShowLayout&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='LayerOut'"),document.write("style='position: absolute;left: 0px; top: 213px; ' onclick='uiObj.SwitchShowLayout()'>"),document.write("<div class='bf-button'>"),document.write("<img src='"+t+"/image/layout.png' alt='' style='width: 24px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerOutInterface'"),document.write("style='left: 0; top: 0; width: 100%;display:none'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayout()'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' id='buju' style='cursor: move; user-select: none;'>布局</div>"),document.write("<div>"),document.write("</div>"),document.write("<div id=''>"),document.write("<div>"),document.write("<table class='bf-table'>"),document.write("<tbody class='bf-group'>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div layer_on'></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div' ></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div' ></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div'></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("</tbody>"),document.write("</table>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteObjectProperty=function(){document.write("<div class='bf-panel bf-has-title bf-sizable property-panel' id='fmj2' title='构件详情' style='left: 0px; top: 0px; width: 100%; height: 100%;display: none;'>"),document.write("<div class='bf-close' id='close2' style='top:4.0em;'><i class='fa fa-times fa-2x' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>构件详情</div>"),document.write("<div class='bf-panel-body' style='padding-top: 41px;'>"),document.write("<div class='bf-panel-container bf-scroll-bar' style='top:0;width: 100%;height: 100%;overflow-y: auto;position: relative;'>"),document.write("<table class='bf-table' id='ComponentContent'>"),document.write("</table>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},c.prototype.UpDisplayLayout=function(){},c.prototype.UpDisplayLayer=function(){var t=this.uiPath,e=this.vecLayerData,n=this.vecSketchLayerData,r="";if(null!=n){var i=n;for(var o in i){r+="<div>";var a="hide.png";0==i[o].off&&(a="show.png");var s="unlock.png";r+="<table class='bf-table'>",r+="<tbody class='bf-group'>",r+="<tr class='bf-group-title'>",r+='<td><img class="layer-enable" sketch=1 id='+i[o].id+' src="'+t+"/image/"+a+'"/></td>',r+='<td><span class="layer-color" style="background-color:'+i[o].color+'"></span></td>',r+='<td><span class="layer-text">草图_'+i[o].name+"</span></td>",r+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',r+="</tr>",r+="</tbody>",r+="</table>",r+="</div>"}}if(null!=e)for(var o in i=e)r+="<div>",a="hide.png",0==i[o].off&&(a="show.png"),s="lock.png",r+="<table class='bf-table'>",r+="<tbody class='bf-group'>",r+="<tr class='bf-group-title'>",r+='<td><img class="layer-enable" sketch=0 id='+i[o].id+' src="'+t+"/image/"+a+'"/></td>',r+='<td><span class="layer-color" style="background-color:'+i[o].color+'"></span></td>',r+='<td><span class="layer-text">'+i[o].name+"</span></td>",r+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',r+="</tr>",r+="</tbody>",r+="</table>",r+="</div>";var l=document.getElementById("Layer-Info");null!=l&&(l.innerHTML=r)},c.prototype.WriteFooter=function(){document.write("<div class='footer' style='background: rgba(0, 0, 0, 0.7);min-width: auto;position: fixed;left: 0;bottom: 0;width: 100%;'>"),document.write("<div style='line-height: 40px;font-size: 12px;color: #999;padding: 0 10px;'>"),document.write("<p style='float: right;line-height: 15px;font-size: 12px;color: #999;display: block;'>"),document.write("<a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com/' target='_blank'>梦想CAD</a>旗下产品"),document.write("</p>"),document.write("<a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com' target='_blank'>MX3D</a> 蜀ICP备15011727号"),document.write("</div>"),document.write("</div>")},c.prototype.CreateToolBar=function(t){if(this.isShowToolbar){var e="";for(var n in t){var r=t[n],i="uiObj.CallMxCommand";r.isMxCommand||(i="uiObj.EvalJs"),0<r.itemid.length?e+='<div class="bf-button" onclick="'+i+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" id="'+r.itemid+'" src="'+this.uiPath+"\\image\\"+r.image+'" title="'+t[n].text+'"></div>':e+='<div class="bf-button" onclick="'+i+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" src="'+this.uiPath+"\\image\\"+r.image+'" title="'+t[n].text+'"></div>'}document.getElementById("MainMenuContent").innerHTML=e}},c.prototype.InitEvent=function(){var t=document.getElementById("LayerInterface");this.CreateToolBar(this.vecToolBarItem),t.style.display="none";var e=this.vecMenuItem;this.isShowMainMenu&&function(t){var n="";!function t(e,r){var i=function(t,e){var n=new Array;for(var r in e)e[r].parentId==t&&n.push(e[r]);return n}(e,r);if(0<i.length){for(var o in n+="<ul>",i)0!=i[o].evalString.length?(n+='<li><p class="li_option" ',n+="onclick=\"uiObj.EvalJs('"+i[o].evalString+"')\"",n+=">"+i[o].text+"</p>"):(n+="<li><a ",n+=">"+i[o].text+"</a>"),t(i[o].id,r),n+="</li>";n+="</br>",n+="</br>",n+="</br>",n+="</ul>"}}(-1,e),t("#main-nav").append(n);var r=t("#main-nav"),i=t(".toggle"),o={maxWidth:!1,customToggle:i,levelTitles:!0},a=null,s={};a&&a.remove(),i.off("click"),a=r.clone(),t.extend(s,{side:"right"}),a.hcMobileNav(t.extend({},o,s))}(jQuery);var n=window.location.href,r=n.length,i=n.indexOf("?"),o=n.substr(i,r).split("=")[1];$(".barspan").html(decodeURIComponent(o)),$("#close2").click(function(){$(this).parent("div").fadeOut(200)}),$(".bf-select-current").click(function(){$(this).hasClass("bf-open")?$(this).removeClass("bf-open"):$(this).addClass("bf-open")}),$(".my-option").click(function(){var t=$(this);$(".my-option").each(function(){$(this).removeClass("active")}),t.addClass("active")}),$(".bf-select-option").click(function(){$(this).parent("ul").prev("span").html($(this).text()),$(this).parent("ul").prev("span").removeClass("bf-open")}),$(document).on("click",".layer-enable",function(){var t=s.MxFun.getUiObj().getPath(),e=parseInt($(this).attr("id")),n=parseInt($(this).attr("sketch")),r=!0;$(this).attr("src")==t+"/image/show.png"?($(this).attr("src",t+"/image/hide.png"),r=!1):$(this).attr("src",t+"/image/show.png"),s.MxFun.showLayer(e,r,1==n)})},c.prototype.Fullscreen=function(){var t=document.documentElement;t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullScreen&&t.webkitRequestFullScreen(),document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),this.IsFullStatus()?($("img[title='取消全屏']").attr("src",this.uiPath+"/image\\fullscreen1.gif"),$("img[title='取消全屏']").attr("title","全屏")):($("img[title='全屏']").attr("src",this.uiPath+"/image\\escscreen1.gif"),$("img[title='全屏']").attr("title","取消全屏"))},c.prototype.IsFullStatus=function(){return null!=(document.fullscreenEnabled||document.mozFullscreenElement||document.webkitFullscreenElement)},c);function c(){return null!==o&&o.apply(this,arguments)||this}n.MxUiObjectMobile=l},{"../MxFun":34,"./MxUiObject":64}],66:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiObjectPC=void 0;var o,a=t("./MxUiObject"),s=t("../MxFun"),l=(i(c,o=a.MxUiObject),c.prototype.onCreate=function(){this.isShowTitle&&this.WriteTitle(),this.WriteStructTree(),this.isEnableLoading&&this.WriteLoading(),this.WriteLayer(),this.WriteTakeColor(),this.WriteLayout(),this.isEnableObjectProperty&&this.WriteObjectProperty(),this.isShowToolbar&&this.WriteToolbar()},c.prototype.onInit=function(){this.InitEvent()},c.prototype.WriteTitle=function(){var t=this.uiPath;document.write("<div id='all'>"),document.write(" <div class='bar1'>"),document.write(" <img src="+t+"/image/mxcad.png style='height: 50%;position: absolute;top: 12px;left: 10px;'>"),document.write(" <span class='barspan' style='position: absolute;left: 45px;'>"),document.write(" </span>"),document.write(" <div id='container'>"),this.isShowMainMenu&&(document.write(" <header>"),document.write(" <div class='wrapper cf'style='z-index: 999'>"),document.write(" <nav id='main-nav' >"),document.write(" </nav>"),document.write(" <a class='toggle'>"),document.write(" <span></span>"),document.write(" </a>"),document.write(" </div>"),document.write(" </header>")),document.write(" </div>"),document.write(" </div>")},c.prototype.WriteStructTree=function(){this.isShowStructTree&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='ModelTreeThumbnail' title='目录树'"),document.write("style='position: absolute;left: 10px; top: 97px; ' onclick='uiObj.SwitchShowStructTree()'>"),document.write("<div class='bf-button mxbim-bf-tree' title='目录树'><i class='fa fa-sitemap' aria-hidden='true'></i></div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='ModelTreeInterface' title='目录树'"),document.write("style='left:0px; top: 0px; width: 300px; height: 416px;display: none'>"),document.write(" <div class='bf-close' onclick='uiObj.SwitchShowStructTree()'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;' id='mulushu'>目录树</div>"),document.write("<div class='bf-panel-body' style='padding-top: 36px;'>"),document.write("<div class='bf-panel-header'>"),document.write("<div class='bf-tree-header' style='margin-top: -36px;'>"),document.write("<div class='bf-select bf-select-tree'>"),document.write("<span class='bf-select-current'>构件</span>"),document.write("<ul class='bf-select-list'>"),document.write("<li class='bf-select-option' id='type'>构件</li>"),document.write("<li class='bf-select-option' id='file'>文件</li>"),document.write("<li class='bf-select-option' id='area'>空间</li>"),document.write("<li class='bf-select-option' id='drawing'>图纸</li>"),document.write("</ul>"),document.write("</div>"),document.write("</div>"),document.write("</div>"),document.write("<div id='DirectoryContent' class='bf-panel-container TreeInfo'>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteLoading=function(){var t=this.uiPath;document.write("<div class='Prompt'>"),document.write("<div style='text-align: center;'>"),document.write("<img src='"+t+"/image/loading.gif' alt='' style='width:30px;height:30px;float: left'>"),document.write("<p style='color:black;vertical-align: middle;float: left; margin-top: 5px;margin-left: 5px;'>加载中.....</p>"),document.write("</div>"),document.write("<span style='display: none'>"+this.sLanguageTable.openComplete+"</span>"),document.write("</div>")},c.prototype.WriteLayer=function(){var t=this.uiPath;this.isShowLayer&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='LayerThumbnail' title='"+this.sLanguageTable.layer+"'"),document.write("style='position: absolute;left: 10px; top: 45px; ' onclick='uiObj.SwitchShowLayer()'>"),document.write("<div class='bf-button'>"),document.write("<img src='"+t+"/image/layer.png.gif' alt='' style='width: 32px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerInterface'"),document.write("style='left: 10px; top: 50px; width: 300px; height: 416px;display: none'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayer(false)'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' id='tuceng' style='cursor: move; user-select: none;'>"+this.sLanguageTable.layer+"</div>"),document.write("<div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>"+this.sLanguageTable.visible+"</div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>"+this.sLanguageTable.color+"</div>"),document.write("<div class='layer-title' style='width: 148px;font-size: 14px'>"+this.sLanguageTable.name+"</div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>"+this.sLanguageTable.status+"</div>"),document.write("</div>"),document.write("<div id='Layer-Info' style='margin-top: 25px;height: 349px;position: absolute;overflow-y: auto;'>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteTakeColor=function(){var t=this.uiPath;this.isShowTakeColor&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='TakeColor' title='选择颜色'"),document.write("style='position: absolute;left: 10px; top: 149px; '>"),document.write("<div class='bf-button' onclick='uiObj.Chosecolor()' style='opacity: 1;'>"),document.write("<img src='"+t+"/image/color.png' alt='' style='width: 40px;margin-left: -10px;'>"),document.write("<div id='colorbox' style='width: 35px;height: 5px;background-color: #cccccc;margin-left: -3px'>"),document.write("</div>"),document.write("<div style='width: 18px;height: 40px;float: right;margin-top: -42px;margin-left: 14px;'>"),document.write("<img src='"+t+"/image/daojiao.png' alt='' style='width: 15px;margin-top: 10px;z-index: 999;position: relative'>"),document.write("<input id='color-picker' type='color' value='#c0c0c0' style='display: none' onchange='uiObj.ColorChange(value)'>"),document.write("</div>"),document.write("</div>"),document.write("</div>"))},c.prototype.WriteLayout=function(){var t=this.uiPath;this.isShowLayout&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='LayerOut' title='"+this.sLanguageTable.layout+"'"),document.write("style='position: absolute;left: 10px; top: 97px; ' onclick='uiObj.SwitchShowLayout()'>"),document.write("<div class='bf-button'>"),document.write("<img src='"+t+"/image/layout.png' alt='' style='width: 32px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerOutInterface'"),document.write("style='left: 10px; top: 50px; width: 300px;display:none'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayout()'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' id='buju' style='cursor: move; user-select: none;'>"+this.sLanguageTable.layout+"</div>"),document.write("<div>"),document.write("</div>"),document.write("<div id='layout-Info'>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteObjectProperty=function(){document.write("<div class='bf-panel bf-has-title bf-sizable' id='StrcutInfoBase' title='属性'"),document.write("style='right: 10px; top: 45px; width: 300px; height: 416px;display: none'>"),document.write("<div class='bf-close' id='close2'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>属性</div>"),document.write("<div id='ComponentContent' class='bf-panel-body StructInfo'></div>"),document.write("<div class='bf-resize'></div>"),document.write("</div>")},c.prototype.WriteToolbar=function(){document.write("<div id='MainMenuContent' class='bf-toolbar bf-toolbar-bottom' style='position: fixed'></div>")},c.prototype.CreateToolBar=function(t){if(this.isShowToolbar){var e="";for(var n in t){var r=t[n],i="uiObj.CallMxCommand";r.isMxCommand||(i="uiObj.EvalJs"),0<r.itemid.length?e+='<div class="bf-button" onclick="'+i+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" id="'+r.itemid+'" src="'+this.uiPath+"\\image\\"+r.image+'" title="'+t[n].text+'"></div>':e+='<div class="bf-button" onclick="'+i+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" src="'+this.uiPath+"\\image\\"+r.image+'" title="'+t[n].text+'"></div>'}document.getElementById("MainMenuContent").innerHTML=e}},c.prototype.UpDisplayLayer=function(){var t=this.uiPath,e=this.vecLayerData,n=this.vecSketchLayerData,r="";if(null!=n){var i=n;for(var o in i){r+="<div>";var a="hide.png";0==i[o].off&&(a="show.png");var s="unlock.png";r+="<table class='bf-table'>",r+="<tbody class='bf-group'>",r+="<tr class='bf-group-title'>",r+='<td><img class="layer-enable" sketch=1 id='+i[o].id+' src="'+t+"/image/"+a+'"/></td>',r+='<td><span class="layer-color" style="background-color:'+i[o].color+'"></span></td>',r+='<td><span class="layer-text">草图_'+i[o].name+"</span></td>",r+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',r+="</tr>",r+="</tbody>",r+="</table>",r+="</div>"}}if(null!=e)for(var o in i=e)r+="<div>",a="hide.png",0==i[o].off&&(a="show.png"),s="lock.png",r+="<table class='bf-table'>",r+="<tbody class='bf-group'>",r+="<tr class='bf-group-title'>",r+='<td><img class="layer-enable" sketch=0 id='+i[o].id+' src="'+t+"/image/"+a+'"/></td>',r+='<td><span class="layer-color" style="background-color:'+i[o].color+'"></span></td>',r+='<td><span class="layer-text">'+i[o].name+"</span></td>",r+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',r+="</tr>",r+="</tbody>",r+="</table>",r+="</div>";var l=document.getElementById("Layer-Info");null!=l&&(l.innerHTML=r)},c.prototype.UpDisplayLayout=function(){var t=this.vecLayoutData,e="";if(e+="<div>",e+="<table class='bf-table'>",e+="<tbody class='bf-group'>",e+="<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>",e+="<td class='bf_layerout_td' style='width: 60px' >",e+="<div class='bf_layer_div layer_on'></div>",e+="</td>",e+="<td style='width: 238px' >",e+="<span class='layout-name' name='Model' style='color: white;cursor: pointer;'>Model</span>",e+="</td>",e+="</tr>",null!=t){var n=t;for(var r in n)e+="<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>",e+="<td class='bf_layerout_td' style='width: 60px' >",e+="<div class='bf_layer_div layer_on'></div>",e+="</td>",e+="<td style='width: 238px' >",e+="<span class='layout-name' name='"+n[r]+"' style='color: white;cursor: pointer;'>"+n[r]+"</span>",e+="</td>",e+="</tr>"}e+="</tbody>",e+="</table>",e+="</div>";var i=document.getElementById("layout-Info");null!=i&&(i.innerHTML=e)},c.prototype.InitEvent=function(){var t=document.getElementById("ModelTreeInterface"),e=document.getElementById("LayerInterface"),n=document.getElementById("LayerOutInterface"),r=document.getElementById("tuceng"),i=document.getElementById("mulushu"),o=document.getElementById("buju"),a=0,l=0,c=0,u=0,h=!1;i.onmousedown=function(e){a=e.clientX,l=e.clientY,c=t.offsetLeft,u=t.offsetTop,h=!0,t.style.cursor="move"},r.onmousedown=function(t){a=t.clientX,l=t.clientY,c=e.offsetLeft,u=e.offsetTop,h=!0,e.style.cursor="move"},o.onmousedown=function(t){a=t.clientX,l=t.clientY,c=n.offsetLeft,u=n.offsetTop,h=!0,n.style.cursor="move"},window.onmousemove=function(r){if(0!=h){var i=r.clientX,o=r.clientY,s=i-(a-c),d=o-(l-u);t.style.left=s+"px",t.style.top=d+"px",e.style.left=s+"px",e.style.top=d+"px",n.style.left=s+"px",n.style.top=d+"px"}},i.onmouseup=function(){h=!1,t.style.cursor="default"},r.onmouseup=function(){h=!1,e.style.cursor="default"},o.onmouseup=function(){h=!1,n.style.cursor="default"},$("#close2").click(function(){$(this).parent("div").fadeOut(200)}),$("#menu4").click(function(){$("#StrcutInfoBase").hasClass("hide")?($("#StrcutInfoBase").fadeIn(200),$("#StrcutInfoBase").removeClass("hide")):($("#StrcutInfoBase").fadeOut(200),$("#StrcutInfoBase").addClass("hide"))}),$(".bf-select-current").click(function(){$(this).hasClass("bf-open")?$(this).removeClass("bf-open"):$(this).addClass("bf-open")}),$(".bf-select-option").click(function(){$(this).parent("ul").prev("span").html($(this).text()),$(this).parent("ul").prev("span").removeClass("bf-open")});var d=$("#StrcutInfoBase");d.bind("mousedown",function(t){var e=$(this)[0].offsetLeft,n=$(this)[0].offsetTop,r=t.pageX,i=t.pageY;$(document).bind("mousemove",function(t){var o=t.pageX-r,a=t.pageY-i,s=e+o+"px",l=n+a+"px";d.css({top:l,left:s})})}),$(document).bind("mouseup",function(){$(this).unbind("mousemove")}),this.CreateToolBar(this.vecToolBarItem);var p=this.vecMenuItem;if(this.isShowMainMenu&&function(t){var e="";!function t(n,r){var i=function(t,e){var n=new Array;for(var r in e)e[r].parentId==t&&n.push(e[r]);return n}(n,r);if(0<i.length){for(var o in e+="<ul>",i)0!=i[o].evalString.length?(e+='<li><p class="li_option" ',e+="onclick=\"uiObj.EvalJs('"+i[o].evalString+"')\"",e+=">"+i[o].text+"</p>"):(e+="<li><a ",e+=">"+i[o].text+"</a>"),t(i[o].id,r),e+="</li>";e+="</br>",e+="</br>",e+="</br>",e+="</ul>"}}(-1,p),t("#main-nav").append(e);var n=t("#main-nav"),r=t(".toggle"),i={maxWidth:!1,customToggle:r,levelTitles:!0},o=null,a={};o&&o.remove(),r.off("click"),o=n.clone(),t.extend(a,{side:"right"}),o.hcMobileNav(t.extend({},i,a))}(jQuery),$(".li_option").click(function(){var t=$(this);$(".li_option").each(function(){$(this).removeClass("active")}),t.addClass("active")}),""==this.sTitle){var f=window.location.href,m=f.length,g=f.indexOf("?"),y=f.substr(g,m).split("=")[1];null!=y&&(this.sTitle=y)}$(".barspan").html(decodeURIComponent(this.sTitle)),$(document).on("click",".layer-enable",function(){var t=s.MxFun.getUiObj().getPath(),e=parseInt($(this).attr("id")),n=parseInt($(this).attr("sketch")),r=!0;$(this).attr("src")==t+"/image/show.png"?($(this).attr("src",t+"/image/hide.png"),r=!1):$(this).attr("src",t+"/image/show.png"),s.MxFun.showLayer(e,r,1==n)}),$(document).on("click",".layout-name",function(){var t=$(this).attr("name");"Model"==t&&(t=""),s.MxFun.getCurrentDraw().gotoLayout(t)})},c.prototype.WriteFooter=function(){document.write("<div class='footer' style='background: rgba(0, 0, 0, 0.7);position: fixed;left: 0;bottom: 0;width: 100%;'>"),document.write(" <div style='line-height: 40px;font-size: 12px;color: #999;padding: 0 10px;'>"),document.write(" <p style='float: right;line-height: 15px;font-size: 12px;color: #999;display: block;'>"),document.write(" <a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com/' target='_blank'>MxDraw </a>旗下产品"),document.write(" </p>"),document.write(" <a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com' target='_blank'>MX3D </a> 蜀ICP备15011727号"),document.write(" </div>"),document.write(" </div>")},c.prototype.ShowLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0)"),$(".Prompt").fadeIn(100),$(".Prompt span").css("display","none"))},c.prototype.HideLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0.8)"),$(".Prompt div").fadeOut(100),$(".Prompt span").fadeIn(200),setTimeout(function(){$(".Prompt").fadeOut(1e3)},1e3))},c.prototype.ShowObjectProperty=function(t){if(0!=t.length){var e;e="string"==typeof t?JSON.parse(t):t;var n="";for(var r in e){var i=e[r];for(var o in n+="<table class='bf-table'>",n+="<tbody class='bf-group'>",n+="<tr class='bf-group-title'>",n+="<td colspan='2'><i class='bf-icon'></i>"+i.name+"</td>",n+="</tr>",i.datas){var a=i.datas[o];n+="<tr class='bf-group-content'>",n+="<td class='bf-key'>"+a.name+"</td>",n+="<td class='bf-value'>"+a.value+"</td>",n+="</tr>"}n+="</tbody>",n+="</table>"}document.getElementById("ComponentContent").innerHTML=n,$(".bf-group").click(function(){$(this).hasClass("bf-collapse")?$(this).removeClass("bf-collapse"):$(this).addClass("bf-collapse")}),$("#StrcutInfoBase").fadeIn(200),$("#StrcutInfoBase").removeClass("hide")}},c.prototype.HideObjectProp=function(){$("#StrcutInfoBase").hasClass("hide")||($("#StrcutInfoBase").fadeOut(200),$("#StrcutInfoBase").addClass("hide"))},c.prototype.SwitchShowLayer=function(){var t=document.getElementById("ModelTreeInterface"),e=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),r=document.getElementById("LayerInterface"),i=document.getElementById("LayerOut"),o=document.getElementById("LayerOutInterface");t.style.display="none",(o.style.display="none")==r.style.display?(n.style.display="block",r.style.display="block",r.style.left="80px",r.style.top="50px",null!=e&&(e.style.display="block"),null!=i&&(i.style.display="block"),t.style.display="none",o.style.display="none"):(r.style.display="none",null!=e&&(e.style.display="block"),n.style.display="block",null!=i&&(i.style.display="block"))},c.prototype.SwitchShowStructTree=function(){var t=document.getElementById("ModelTreeInterface"),e=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),r=document.getElementById("LayerInterface"),i=document.getElementById("LayerOut"),o=document.getElementById("LayerOutInterface");r.style.display="none",(o.style.display="none")==t.style.display?(null!=e&&(e.style.display="block"),t.style.display="block",t.style.left="80px",t.style.top="50px",n.style.display="block",null!=i&&(i.style.display="block"),r.style.display="none",o.style.display="none"):(t.style.display="none",null!=e&&(e.style.display="block"),n.style.display="block",null!=i&&(i.style.display="block"))},c.prototype.Chosecolor=function(){document.getElementById("color-picker").click()},c.prototype.ColorChange=function(t){document.getElementById("colorbox").style.backgroundColor=t,s.MxFun.setCurrentColor(t)},c.prototype.SwitchShowLayout=function(){var t=document.getElementById("ModelTreeInterface"),e=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),r=document.getElementById("LayerInterface"),i=document.getElementById("LayerOut"),o=document.getElementById("LayerOutInterface");t.style.display="none",r.style.display="none",o&&"none"==o.style.display?(i&&(i.style.display="block"),o.style.display="block",o.style.left="80px",o.style.top="120px",null!=e&&(e.style.display="block"),n&&(n.style.display="block"),t.style.display="none",r.style.display="none"):(o&&(o.style.display="none"),null!=e&&(e.style.display="block"),n&&(n.style.display="block"),i&&(i.style.display="block"))},c.prototype.Fullscreen=function(){var t=document.documentElement;t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullScreen&&t.webkitRequestFullScreen(),document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),this.IsFullStatus()?($("img[title='取消全屏']").attr("src",this.uiPath+"/image\\fullscreen1.gif"),$("img[title='取消全屏']").attr("title","全屏")):($("img[title='全屏']").attr("src",this.uiPath+"/image\\escscreen1.gif"),$("img[title='全屏']").attr("title","取消全屏"))},c.prototype.IsFullStatus=function(){return null!=(document.fullscreenEnabled||document.mozFullscreenElement||document.webkitFullscreenElement)},c);function c(){return null!==o&&o.apply(this,arguments)||this}n.MxUiObjectPC=l},{"../MxFun":34,"./MxUiObject":64}],67:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiVue=void 0;var r,i,o,a=t("../MxFun"),s=t("../Operate/MxJigCmdManager"),l=t("../MxTools"),c=t("../Operate/MxCmdRunManager");function u(t){if(32==t||13==t)if(s.MxJigCmdManager.isRunning())s.MxJigCmdManager.OnEnter(t);else{var e=f(),n="";n=0==e.length?c.MxCmdRunManager.GetPrvCmd():e,m(""),n=l.MxTools.stringTrimLeftSpace(n),a.MxFun.sendStringToExecute(n)}else if(27==t)s.MxJigCmdManager.isRunning()?s.MxJigCmdManager.stopCmd():d(" *取消*\n命令:");else if(38==t)s.MxJigCmdManager.isRunning()||(c.MxCmdRunManager.MoveUpKey(),0!=(r=c.MxCmdRunManager.GetListCommad()).length&&(m(r),p()));else if(40==t){var r;s.MxJigCmdManager.isRunning()||(c.MxCmdRunManager.MoveDownKey(),0!=(r=c.MxCmdRunManager.GetListCommad()).length&&(m(r),p()))}}function h(t,e){void 0===e&&(e=!0);var n=t.length;if(!(n<1)){for(var r=o.getCmdLine(),i=r.getCmdTip(),a=r.getCmdText(),s=t.indexOf("\n"),l=0,c=!0;-1!=s&&(c?(r.addCmdDisplay("\n"+i+a+t.substring(l,s-l)),a=i="",c=!1):r.addCmdDisplay("\n"+t.substring(l,s-l)),(l=s+1)<n);)s=t.indexOf("\n",l);if(c){var u=t.substring(l,n-l),h=u.indexOf("\r"),d=u.length;i=-1==h?i+a+u:h+1<d?u.substring(h+1,d-h-1):""}else l<n&&(i=t.substring(l,n));a="",e&&(i+=" "),r.setCmdTip(i),r.setCmdText(a),r.upDisplay()}}function d(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(null!=o){for(var r=arguments,i=r[0],a=0;a<r.length-1;a++){var s=new RegExp("\\{"+a+"\\}","gm");i=i.replace(s,r[a+1])}h(i,!0)}}function p(){null!=o&&o.getCmdLine().upDisplay()}function f(){if(null==o)return"";var t=o.getCmdLine();return l.MxTools.stringTrimLeftRightSpace(t.getCmdText())}function m(t){if(null!=o)return o.getCmdLine().setCmdText(t)}function g(t){var e=s.MxJigCmdManager.getCurCmd();null!=e&&(e.getDynImput().onKeyDonw(t)||u(t))}r=n.MxUiVue||(n.MxUiVue={}),o=void 0,(i=r.CursorType||(r.CursorType={}))[i.kNormal=0]="kNormal",i[i.kRect=1]="kRect",i[i.kCross=2]="kCross",r.isNull=function(){return null==o},r.init=function(t){(o=t).mountKeydownEvent(u),o.getDynamicInput().mountKeydownEvent(g)},r.setTipCoord=function(t){null!=o&&o.setTipCoord(t)},r.setCursorType=function(t){null!=o&&o.setCursorType(t)},r.AcutPrintfNoFormat=h,r.acutPrintf=d,r.cmdLineUpDisplay=p,r.getCmdText=f,r.setCmdText=m,r.getCmdDisplay=function(){return null==o?"":o.getCmdLine().getCmdDisplay()},r.setCmdDisplay=function(t){if(null!=o)return o.getCmdLine().setCmdDisplay(t)},r.getCmdTip=function(){return null==o?"":o.getCmdLine().getCmdTip()},r.setCmdTip=function(t){if(null!=o)return o.getCmdLine().setCmdTip(t)},r.restoreCmdStatus=function(){if(null!=o){var t=o.getCmdLine();" "==t.getCmdTip()&&0==t.getCmdText().length?(t.setCmdTip(""),d("{0}:","命令")):d("\n{0}:","命令")}},r.DynamicInput_upDisplay=function(){null!=o&&r.OnMxEvent({name:"dynInputUpDisplay"})},r.DynamicInput_setType=function(t){null!=o&&o.getDynamicInput().setType(t)},r.DynamicInput_getType=function(){return null==o?s.MxJigCmdManager.DynamicInputType.kNoInput:o.getDynamicInput().getType()},r.DynamicInput_setPos=function(t){null!=o&&o.getDynamicInput().setPos([t.x,t.y])},r.DynamicInput_setTip=function(t){null!=o&&o.getDynamicInput().setTip(t)},r.DynamicInput_setValue1=function(t){null!=o&&o.getDynamicInput().setValue1(t)},r.DynamicInput_getValue1=function(){return null==o?"":o.getDynamicInput().getValue1()},r.DynamicInput_setValue1Pos=function(t){null!=o&&o.getDynamicInput().setValue1Pos([t.x,t.y])},r.DynamicInput_setValue2=function(t){null!=o&&o.getDynamicInput().setValue2(t)},r.DynamicInput_getValue2=function(){return null==o?"":o.getDynamicInput().getValue2()},r.DynamicInput_getFocusValue=function(){return null==o?"":o.getDynamicInput().getFocusValue()},r.DynamicInput_setValue2Pos=function(t){null!=o&&o.getDynamicInput().setValue2Pos([t.x,t.y])},r.DynamicInput_setShow=function(t){null!=o&&o.getDynamicInput().setShow(t)},r.DynamicInput_isShow=function(){return null!=o&&o.getDynamicInput().isShow()},r.OnMxEvent=function(t){if(null==o)return!1;o.OnMxEvent(t)}},{"../MxFun":34,"../MxTools":45,"../Operate/MxCmdRunManager":53,"../Operate/MxJigCmdManager":58}],68:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.ExternalReferenceManager=n.ExternalReferenceDatabase=n.Blocks=n.Block=n.Layer=n.MxNewDisplayMemorySection=n.MxNewDisplayMemorySectionType=n.TextureData=n.BlockInstance=n.BlockRef=n.ClipPlans=n.ClipPlan=void 0;var r=t("three"),i=t("../MxShader"),o=t("./MxBrowseLayerData"),a=t("../MxManager"),s=t("../MxNetData"),l=t("../MxStencilObject"),c=t("../MxFun"),u=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0};n.ClipPlan=u;var h=function(){this.ver=4,this.id=1,this.clipPlanArray=new Array,this.clipPoints=[],this.instansClipePoints=[]};n.ClipPlans=h;var d=function(){this.ver=4,this.mat=new r.Matrix4,this.blkRecId=-1,this.blkOwnerId=0,this.layerId=-1,this.color=16777215,this.clipPlans=new h};n.BlockRef=d;var p=function(){this.mat=new r.Matrix4,this.color=new Array,this.topLayerColor=new Array,this.clipPlans=new h,this.clipMat=new r.Matrix4};n.BlockInstance=p;var f,m,g=function(){};n.TextureData=g,(m=f=n.MxNewDisplayMemorySectionType||(n.MxNewDisplayMemorySectionType={}))[m.kLinesType=1]="kLinesType",m[m.kTriangleType=2]="kTriangleType",m[m.kLinesType_Float=3]="kLinesType_Float",m[m.kTriangleType_Float=4]="kTriangleType_Float",m[m.kPointType_Float=5]="kPointType_Float",m[m.kPointType=6]="kPointType",n.MxNewDisplayMemorySection=function(){this.id=0,this.type=f.kLinesType,this.blockId=0,this.layerId=0,this.color=0,this.points=[]};var y=(v.prototype.Show=function(t){for(var e=0,n=this._entitys.length;e<n;e++)this._entitys[e].visible=t},v.prototype.updataClipMaterial=function(t){for(var e=this._material_clip.length,n=.5*t.width,r=.5*t.height,i=0;i<e;i++)this._material_clip[i].uniforms.vieww.value=n,this._material_clip[i].uniforms.viewh.value=r},v.prototype.createThreejsObjForMesh_Clip=function(t,e,n){0!=t.size&&t.forEach(function(t){var o=t;if(0!=o.length){var s=[],c=[],u=o[0].clipPlans;u.ver<=3&&(s.push(u.clipPlanArray[0].x1,u.clipPlanArray[0].y1),c.push(u.clipPlanArray[0].x2,u.clipPlanArray[0].y2));for(var h=[],d=[],p=[],f=[],m=[],g=[],y=[],v=0;v<o.length;v++){var x=o[v];h=h.concat(x.mat.elements.slice(0,4)),d=d.concat(x.mat.elements.slice(4,8)),p=p.concat(x.mat.elements.slice(8,12)),f=f.concat(x.mat.elements.slice(12,16)),m.push(0),g=g.concat(o[v].color)}if(0<this._geometryMeshPositionsByBlock.length)for(v=0;v<o.length;v++)g=g.concat(o[v].color);if(0<this._geometryMeshPositionsByBlock_ZeroLayer.length)for(v=0;v<o.length;v++)y=y.concat(o[v].topLayerColor);var b,w=.5*n.width,M=.5*n.height;u.ver<=3?(b=new r.RawShaderMaterial({uniforms:{clippt1:{value:s},clippt2:{value:c},vieww:{value:w},viewh:{value:M}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_CLIP,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:r.DoubleSide}),this._material_clip.push(b)):b=new r.RawShaderMaterial({vertexShader:i.MxShader.VSHADER_COLOR_POINT,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:r.DoubleSide});for(var _=0;_<this._geometryMeshPostion.length;_++)(S=new r.InstancedBufferGeometry).maxInstancedCount=o.length,S.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPostion[_],2)),S.setAttribute("color",new r.Float32BufferAttribute(this._geometryMeshColor[_],3)),S.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(h),4)),S.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(d),4)),S.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(p),4)),S.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(f),4)),S.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(m),1)),(T=new r.Mesh(S,b)).frustumCulled=!1,T.renderOrder=a.MxData.iCADMeshRenderOrder,e.add(T),this._entitys.push(T),4<=u.ver&&0<u.instansClipePoints.length&&(new l.MxStencilObject).associateObject(T,u.instansClipePoints);for(_=0;_<this._geometryMeshPositionsByBlock.length;_++)(S=new r.InstancedBufferGeometry).maxInstancedCount=o.length,S.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByBlock[_],2)),S.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(g),3)),S.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(h),4)),S.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(d),4)),S.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(p),4)),S.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(f),4)),S.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(m),1)),(T=new r.Mesh(S,b)).frustumCulled=!1,T.renderOrder=a.MxData.iCADMeshRenderOrder,e.add(T),this._entitys.push(T),4<=u.ver&&0<u.instansClipePoints.length&&(new l.MxStencilObject).associateObject(T,u.instansClipePoints);for(_=0;_<this._geometryMeshPositionsByBlock_ZeroLayer.length;_++)(S=new r.InstancedBufferGeometry).maxInstancedCount=o.length,S.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByBlock_ZeroLayer[_],2)),S.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(y),3)),S.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(h),4)),S.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(d),4)),S.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(p),4)),S.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(f),4)),S.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(m),1)),(T=new r.Mesh(S,b)).frustumCulled=!1,T.renderOrder=a.MxData.iCADMeshRenderOrder,e.add(T),this._entitys.push(T),4<=u.ver&&0<u.instansClipePoints.length&&(new l.MxStencilObject).associateObject(T,u.instansClipePoints);var C=new r.RawShaderMaterial({uniforms:{color:{value:this._color},clippt1:{value:s},clippt2:{value:c},vieww:{value:w},viewh:{value:M}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_BYLAYER_CLIP,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:r.DoubleSide});for(this._material_clip.push(C),_=0;_<this._geometryMeshPositionsByLayer.length;_++){var S,T;(S=new r.InstancedBufferGeometry).maxInstancedCount=o.length,S.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByLayer[_],2)),S.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(h),4)),S.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(d),4)),S.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(p),4)),S.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(f),4)),S.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(m),1)),(T=new r.Mesh(S,C)).frustumCulled=!1,T.renderOrder=a.MxData.iCADMeshRenderOrder,e.add(T),this._entitys.push(T),4<=u.ver&&0<u.instansClipePoints.length&&(new l.MxStencilObject).associateObject(T,u.instansClipePoints)}}},this)},v.prototype.createThreejsObjForCurve_Clip=function(t,e,n){0!=t.size&&t.forEach(function(t,o,s){var c=t;if(0!=c.length){var u=[],h=[],d=c[0].clipPlans;d.ver<=3&&(u.push(d.clipPlanArray[0].x1,d.clipPlanArray[0].y1),h.push(d.clipPlanArray[0].x2,d.clipPlanArray[0].y2));for(var p=[],f=[],m=[],g=[],y=[],v=[],x=[],b=0;b<c.length;b++){var w=c[b];p=p.concat(w.mat.elements.slice(0,4)),f=f.concat(w.mat.elements.slice(4,8)),m=m.concat(w.mat.elements.slice(8,12)),g=g.concat(w.mat.elements.slice(12,16)),y.push(0)}if(0<this._geometryCurvePositionsByBlock.length)for(b=0;b<c.length;b++)v=v.concat(c[b].color);if(0<this._geometryCurvePositionsByBlock_ZeroLayer.length)for(b=0;b<c.length;b++)x=x.concat(c[b].topLayerColor);var M,_=.5*n.width,C=.5*n.height;d.ver<=3?(M=new r.RawShaderMaterial({uniforms:{clippt1:{value:u},clippt2:{value:h},vieww:{value:_},viewh:{value:C}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_CLIP,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:r.DoubleSide}),this._material_clip.push(M)):M=new r.RawShaderMaterial({vertexShader:i.MxShader.VSHADER_COLOR_POINT,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:r.DoubleSide});for(var S=0;S<this._geometryCurvePostion.length;S++)(E=new r.InstancedBufferGeometry).maxInstancedCount=c.length,E.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePostion[S],2)),E.setAttribute("color",new r.Float32BufferAttribute(this._geometryCurveColor[S],3)),E.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(p),4)),E.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(f),4)),E.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(m),4)),E.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(g),4)),E.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(y),1)),(D=new r.LineSegments(E,M)).frustumCulled=!1,D.renderOrder=a.MxData.iCADCurveRenderOrder,e.add(D),this._entitys.push(D),4<=d.ver&&0<d.instansClipePoints.length&&(new l.MxStencilObject).associateObject(D,d.instansClipePoints);for(S=0;S<this._geometryCurvePositionsByBlock.length;S++)(E=new r.InstancedBufferGeometry).maxInstancedCount=c.length,E.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByBlock[S],2)),E.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(v),3)),E.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(p),4)),E.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(f),4)),E.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(m),4)),E.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(g),4)),E.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(y),1)),(D=new r.LineSegments(E,M)).frustumCulled=!1,D.renderOrder=a.MxData.iCADCurveRenderOrder,e.add(D),this._entitys.push(D),4<=d.ver&&0<d.instansClipePoints.length&&(new l.MxStencilObject).associateObject(D,d.instansClipePoints);for(S=0;S<this._geometryCurvePositionsByBlock_ZeroLayer.length;S++)(E=new r.InstancedBufferGeometry).maxInstancedCount=c.length,E.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByBlock_ZeroLayer[S],2)),E.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(x),3)),E.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(p),4)),E.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(f),4)),E.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(m),4)),E.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(g),4)),E.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(y),1)),(D=new r.LineSegments(E,M)).frustumCulled=!1,D.renderOrder=a.MxData.iCADCurveRenderOrder,e.add(D),this._entitys.push(D),4<=d.ver&&0<d.instansClipePoints.length&&(new l.MxStencilObject).associateObject(D,d.instansClipePoints);var T=new r.RawShaderMaterial({uniforms:{color:{value:this._color},clippt1:{value:u},clippt2:{value:h},vieww:{value:_},viewh:{value:C}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_BYLAYER_CLIP,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0,side:r.DoubleSide});for(this._material_clip.push(T),S=0;S<this._geometryCurvePositionsByLayer.length;S++){var E,D;(E=new r.InstancedBufferGeometry).maxInstancedCount=c.length,E.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByLayer[S],2)),E.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(p),4)),E.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(f),4)),E.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(m),4)),E.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(g),4)),E.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(y),1)),(D=new r.LineSegments(E,T)).frustumCulled=!1,D.renderOrder=a.MxData.iCADCurveRenderOrder,e.add(D),this._entitys.push(D),4<=d.ver&&0<d.instansClipePoints.length&&(new l.MxStencilObject).associateObject(D,d.instansClipePoints)}}},this)},v.prototype.createThreejsObjForCurve=function(t,e){if(0!=t.length){for(var n=[],o=[],s=[],l=[],c=[],u=[],h=[],d=0;d<t.length;d++){var p=t[d];n=n.concat(p.mat.elements.slice(0,4)),o=o.concat(p.mat.elements.slice(4,8)),s=s.concat(p.mat.elements.slice(8,12)),l=l.concat(p.mat.elements.slice(12,16)),c.push(0)}if(0<this._geometryCurvePositionsByBlock.length)for(d=0;d<t.length;d++)u=u.concat(t[d].color);if(0<this._geometryCurvePositionsByBlock_ZeroLayer.length)for(d=0;d<t.length;d++)h=h.concat(t[d].topLayerColor);for(var f=new r.RawShaderMaterial({vertexShader:i.MxShader.VSHADER_COLOR_POINT,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:r.DoubleSide}),m=0;m<this._geometryCurvePostion.length;m++)(y=new r.InstancedBufferGeometry).maxInstancedCount=t.length,y.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePostion[m],2)),y.setAttribute("color",new r.Float32BufferAttribute(this._geometryCurveColor[m],3)),y.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),y.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(o),4)),y.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),y.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(v=new r.LineSegments(y,f)).frustumCulled=!1,v.renderOrder=a.MxData.iCADCurveRenderOrder,e.add(v),this._entitys.push(v);for(m=0;m<this._geometryCurvePositionsByBlock.length;m++)(y=new r.InstancedBufferGeometry).maxInstancedCount=t.length,y.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByBlock[m],2)),y.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(u),3)),y.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),y.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(o),4)),y.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),y.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(v=new r.LineSegments(y,f)).frustumCulled=!1,v.renderOrder=a.MxData.iCADCurveRenderOrder,e.add(v),this._entitys.push(v);for(m=0;m<this._geometryCurvePositionsByBlock_ZeroLayer.length;m++)(y=new r.InstancedBufferGeometry).maxInstancedCount=t.length,y.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByBlock_ZeroLayer[m],2)),y.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(h),3)),y.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),y.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(o),4)),y.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),y.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(v=new r.LineSegments(y,f)).frustumCulled=!1,v.renderOrder=a.MxData.iCADCurveRenderOrder,e.add(v),this._entitys.push(v);var g=new r.RawShaderMaterial({uniforms:{color:{value:this._color}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_BYLAYER,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0,side:r.DoubleSide});for(m=0;m<this._geometryCurvePositionsByLayer.length;m++){var y,v;(y=new r.InstancedBufferGeometry).maxInstancedCount=t.length,y.setAttribute("position",new r.Float32BufferAttribute(this._geometryCurvePositionsByLayer[m],2)),y.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),y.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(o),4)),y.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),y.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(v=new r.LineSegments(y,g)).frustumCulled=!1,v.renderOrder=a.MxData.iCADCurveRenderOrder,e.add(v),this._entitys.push(v)}}},v.prototype.createThreejsObjForMemorySections_clip=function(t,e,n){0!=t.size&&t.forEach(function(t){var o=t;if(0!=o.length){for(var s=o[0].clipPlans,c=[],u=[],h=[],d=[],p=[],m=0;m<o.length;m++){var g=o[m];c=c.concat(g.mat.elements.slice(0,4)),u=u.concat(g.mat.elements.slice(4,8)),h=h.concat(g.mat.elements.slice(8,12)),d=d.concat(g.mat.elements.slice(12,16)),p.push(0)}for(var y=this._MemorySections.length,v=0;v<y;v++){var x=this._MemorySections[v],b=n.automaticInversionColor2(x.color),w=[];if(16777216==(4278190080&b)?w=this._color:w.push((255&b)/255,(b>>8&255)/255,(b>>16&255)/255),x.type==f.kLinesType){var M=new r.RawShaderMaterial({uniforms:{color:{value:w}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_FORMXCAD,linewidth:1,transparent:!0,side:r.DoubleSide});(C=new r.InstancedBufferGeometry).maxInstancedCount=o.length,C.setAttribute("position",new r.Float32BufferAttribute(x.points,3)),C.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(c),4)),C.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(u),4)),C.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(h),4)),C.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(d),4)),C.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(p),1)),(S=new r.LineSegments(C,M)).frustumCulled=!1,S.renderOrder=a.MxData.iCADCurveRenderOrder,4<=s.ver&&0<s.instansClipePoints.length&&(new l.MxStencilObject).associateObject(S,s.instansClipePoints),e.add(S),this._entitys.push(S)}else if(x.type==f.kTriangleType){M=new r.RawShaderMaterial({uniforms:{color:{value:w}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:r.DoubleSide}),(C=new r.InstancedBufferGeometry).maxInstancedCount=o.length,C.setAttribute("position",new r.Float32BufferAttribute(x.points,3)),C.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(c),4)),C.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(u),4)),C.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(h),4)),C.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(d),4)),C.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(p),1));var _=new r.Mesh(C,M);_.frustumCulled=!1,_.renderOrder=a.MxData.iCADMeshRenderOrder,4<=s.ver&&0<s.instansClipePoints.length&&(new l.MxStencilObject).associateObject(_,s.instansClipePoints),e.add(_),this._entitys.push(_)}else if(x.type==f.kPointType){var C,S;M=new r.RawShaderMaterial({uniforms:{color:{value:w}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:r.DoubleSide}),(C=new r.InstancedBufferGeometry).maxInstancedCount=o.length,C.setAttribute("position",new r.Float32BufferAttribute(x.points,3)),C.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(c),4)),C.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(u),4)),C.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(h),4)),C.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(d),4)),C.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(p),1)),(S=new r.Points(C,M)).frustumCulled=!1,S.renderOrder=a.MxData.iCADCurveRenderOrder,4<=s.ver&&0<s.instansClipePoints.length&&(new l.MxStencilObject).associateObject(S,s.instansClipePoints),e.add(S),this._entitys.push(S)}}}},this)},v.prototype.createThreejsObjForMemorySections=function(t,e,n){if(0!=t.length){for(var o=[],s=[],l=[],c=[],u=[],h=0;h<t.length;h++){var d=t[h];o=o.concat(d.mat.elements.slice(0,4)),s=s.concat(d.mat.elements.slice(4,8)),l=l.concat(d.mat.elements.slice(8,12)),c=c.concat(d.mat.elements.slice(12,16)),u.push(0)}for(var p=this._MemorySections.length,m=0;m<p;m++){var g=this._MemorySections[m],y=n.automaticInversionColor2(g.color),v=[];if(16777216==(4278190080&y)?(v=this._color,this._colorValue):v.push((255&y)/255,(y>>8&255)/255,(y>>16&255)/255),g.type==f.kLinesType){var x=new r.RawShaderMaterial({uniforms:{color:{value:v}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_FORMXCAD,linewidth:1,transparent:!0,side:r.DoubleSide});(w=new r.InstancedBufferGeometry).maxInstancedCount=t.length,w.setAttribute("position",new r.Float32BufferAttribute(g.points,3)),w.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(o),4)),w.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(s),4)),w.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(l),4)),w.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(c),4)),w.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(u),1)),(M=new r.LineSegments(w,x)).frustumCulled=!1,M.renderOrder=a.MxData.iCADCurveRenderOrder,e.add(M),this._entitys.push(M)}else if(g.type==f.kTriangleType){x=new r.RawShaderMaterial({uniforms:{color:{value:v}},vertexShader:i.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:r.DoubleSide}),(w=new r.InstancedBufferGeometry).maxInstancedCount=t.length,w.setAttribute("position",new r.Float32BufferAttribute(g.points,3)),w.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(o),4)),w.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(s),4)),w.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(l),4)),w.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(c),4)),w.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(u),1));var b=new r.Mesh(w,x);b.frustumCulled=!1,b.renderOrder=a.MxData.iCADMeshRenderOrder,e.add(b),this._entitys.push(b)}else if(g.type==f.kPointType){var w,M;x=new r.RawShaderMaterial({uniforms:{color:{value:v},size:1},vertexShader:i.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:r.DoubleSide}),(w=new r.InstancedBufferGeometry).maxInstancedCount=t.length,w.setAttribute("position",new r.Float32BufferAttribute(g.points,3)),w.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(o),4)),w.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(s),4)),w.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(l),4)),w.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(c),4)),w.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(u),1)),(M=new r.Points(w,x)).frustumCulled=!1,M.renderOrder=a.MxData.iCADCurveRenderOrder,e.add(M),this._entitys.push(M)}}}},v.prototype.createThreejsObjForTexture=function(t,e,n){if(0!=t.length){var o=[],s=[],l=[],u=[],h=[],d=n.getCurrentLoadUrl(),p=c.MxFun.dwgDir();0!=p.length&&"/buf/"!=d.substring(d.lastIndexOf("/buf/")).toLowerCase()&&(d=d+p+"/buf/");for(var f=0;f<t.length;f++){var m=t[f];o=o.concat(m.mat.elements.slice(0,4)),s=s.concat(m.mat.elements.slice(4,8)),l=l.concat(m.mat.elements.slice(8,12)),u=u.concat(m.mat.elements.slice(12,16)),h.push(0)}for(var g=0;g<this._TextureData.length;g++){var y=this._TextureData[g],v=new r.InstancedBufferGeometry;v.maxInstancedCount=t.length,v.setAttribute("position",new r.Float32BufferAttribute(y.pos,2)),v.setAttribute("uv",new r.Float32BufferAttribute(y.textureCoord,2)),v.setAttribute("color",new r.Float32BufferAttribute(y.color,3)),v.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(o),4)),v.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(s),4)),v.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(l),4)),v.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(u),4)),v.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(h),1));var x=d+y.sFileName,b={texture:{value:(new r.TextureLoader).load(x,function(t){t&&n.updateDisplay()})}};b.texture.value.wrapS=b.texture.value.wrapT=r.RepeatWrapping;var w=new r.RawShaderMaterial({uniforms:b,vertexShader:i.MxShader.VSHADER_COLOR_POINT_TEXTURE,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_TEXTURE,transparent:!0,side:r.DoubleSide}),M=new r.Mesh(v,w);M.renderOrder=a.MxData.iCADMeshRenderOrder,M.frustumCulled=!1,e.add(M),this._entitys.push(M)}}},v.prototype.createThreejsObjForTexture_Clip=function(t,e,n){if(0!=t.size){var o=n.getCurrentLoadUrl(),s=c.MxFun.dwgDir();0!=s.length&&"/buf/"!=o.substring(o.lastIndexOf("/buf/")).toLowerCase()&&(o=o+s+"/buf/"),t.forEach(function(t){var s=t;if(0!=s.length){for(var c=s[0].clipPlans,u=[],h=[],d=[],p=[],f=[],m=0;m<s.length;m++){var g=s[m];u=u.concat(g.mat.elements.slice(0,4)),h=h.concat(g.mat.elements.slice(4,8)),d=d.concat(g.mat.elements.slice(8,12)),p=p.concat(g.mat.elements.slice(12,16)),f.push(0)}for(var y=0;y<this._TextureData.length;y++){var v=this._TextureData[y],x=new r.InstancedBufferGeometry;x.maxInstancedCount=s.length,x.setAttribute("position",new r.Float32BufferAttribute(v.pos,2)),x.setAttribute("uv",new r.Float32BufferAttribute(v.textureCoord,2)),x.setAttribute("color",new r.Float32BufferAttribute(v.color,3)),x.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(u),4)),x.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(h),4)),x.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(d),4)),x.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(p),4)),x.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(f),1));var b=o+v.sFileName,w={texture:{value:(new r.TextureLoader).load(b,function(t){t&&n.updateDisplay()})}};w.texture.value.wrapS=w.texture.value.wrapT=r.RepeatWrapping;var M=new r.RawShaderMaterial({uniforms:w,vertexShader:i.MxShader.VSHADER_COLOR_POINT_TEXTURE,fragmentShader:i.MxShader.FSHADER_COLOR_POINT_TEXTURE,transparent:!0,side:r.DoubleSide}),_=new r.Mesh(x,M);_.renderOrder=a.MxData.iCADMeshRenderOrder,_.frustumCulled=!1,4<=c.ver&&0<c.instansClipePoints.length&&(new l.MxStencilObject).associateObject(_,c.instansClipePoints),e.add(_),this._entitys.push(_)}}},this)}},v.prototype.createThreejsObjForMesh=function(t,e){if(0!=t.length){for(var n=[],o=[],s=[],l=[],c=[],u=[],h=[],d=0;d<t.length;d++){var p=t[d];n=n.concat(p.mat.elements.slice(0,4)),o=o.concat(p.mat.elements.slice(4,8)),s=s.concat(p.mat.elements.slice(8,12)),l=l.concat(p.mat.elements.slice(12,16)),c.push(0),u=u.concat(t[d].color)}if(0<this._geometryMeshPositionsByBlock.length)for(d=0;d<t.length;d++)u=u.concat(t[d].color);if(0<this._geometryMeshPositionsByBlock_ZeroLayer.length)for(d=0;d<t.length;d++)h=h.concat(t[d].topLayerColor);for(var f=new r.RawShaderMaterial({vertexShader:i.MxShader.VSHADER_COLOR_POINT,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,transparent:!0,side:r.DoubleSide}),m=0;m<this._geometryMeshPostion.length;m++)(y=new r.InstancedBufferGeometry).maxInstancedCount=t.length,y.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPostion[m],2)),y.setAttribute("color",new r.Float32BufferAttribute(this._geometryMeshColor[m],3)),y.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),y.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(o),4)),y.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),y.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(v=new r.Mesh(y,f)).frustumCulled=!1,v.renderOrder=a.MxData.iCADMeshRenderOrder,e.add(v),this._entitys.push(v);for(m=0;m<this._geometryMeshPositionsByBlock.length;m++)(y=new r.InstancedBufferGeometry).maxInstancedCount=t.length,y.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByBlock[m],2)),y.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(u),3)),y.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),y.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(o),4)),y.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),y.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(v=new r.Mesh(y,f)).frustumCulled=!1,v.renderOrder=a.MxData.iCADMeshRenderOrder,e.add(v),this._entitys.push(v);for(m=0;m<this._geometryMeshPositionsByBlock_ZeroLayer.length;m++)(y=new r.InstancedBufferGeometry).maxInstancedCount=t.length,y.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByBlock_ZeroLayer[m],2)),y.setAttribute("color",new r.InstancedBufferAttribute(new Float32Array(h),3)),y.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),y.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(o),4)),y.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),y.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(v=new r.Mesh(y,f)).frustumCulled=!1,v.renderOrder=a.MxData.iCADMeshRenderOrder,e.add(v),this._entitys.push(v);var g=new r.RawShaderMaterial({uniforms:{color:{value:this._color}},vertexShader:i.MxShader.VSHADER_COLOR_POINT,fragmentShader:i.MxShader.FSHADER_COLOR_POINT,transparent:!0,side:r.DoubleSide});for(m=0;m<this._geometryMeshPositionsByLayer.length;m++){var y,v;(y=new r.InstancedBufferGeometry).maxInstancedCount=t.length,y.setAttribute("position",new r.Float32BufferAttribute(this._geometryMeshPositionsByLayer[m],2)),y.setAttribute("tran1",new r.InstancedBufferAttribute(new Float32Array(n),4)),y.setAttribute("tran2",new r.InstancedBufferAttribute(new Float32Array(o),4)),y.setAttribute("tran3",new r.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("tran4",new r.InstancedBufferAttribute(new Float32Array(l),4)),y.setAttribute("ishide",new r.InstancedBufferAttribute(new Float32Array(c),1)),(v=new r.Mesh(y,g)).frustumCulled=!1,v.renderOrder=a.MxData.iCADMeshRenderOrder,e.add(v),this._entitys.push(v)}}},v.prototype.addGeometryCurve=function(t,e,n,r,i){0<t.length&&(this._geometryCurvePostion.push(t),this._geometryCurveColor.push(e)),0<n.length&&this._geometryCurvePositionsByBlock.push(n),0<r.length&&this._geometryCurvePositionsByLayer.push(r),0<i.length&&this._geometryCurvePositionsByBlock_ZeroLayer.push(i)},v.prototype.addGeometryMesh=function(t,e,n,r,i){0<t.length&&(this._geometryMeshPostion.push(t),this._geometryMeshColor.push(e)),0<n.length&&this._geometryMeshPositionsByBlock.push(n),0<r.length&&this._geometryMeshPositionsByLayer.push(r),0<i.length&&this._geometryMeshPositionsByBlock_ZeroLayer.push(i)},v.prototype.addGeometryTexture=function(t,e,n,r,i,o,a){var s=new g;s.pos=t,s.textureCoord=e,s.color=n,s.sFileName=r,s.dAngel=i,s.ptRotationPostionX=o,s.ptRotationPostionY=a,this._TextureData.push(s)},v.prototype.addMemorySections=function(t){this._MemorySections.push(t)},v.prototype.createThreejsObj=function(t,e,n,r,i){var o=n.getScene(),a=n.getCanvas();if(0!=t.length){if(null==this._color){var s=r.getColor(i);this._color=[],this._color.push((255&s)/255,(s>>8&255)/255,(s>>16&255)/255),this._colorValue=16777215&s}0==this._geometryCurvePostion.length&&0==this._geometryCurvePositionsByBlock.length&&0==this._geometryCurvePositionsByLayer.length&&0==this._geometryCurvePositionsByBlock_ZeroLayer.length||this.createThreejsObjForCurve(t,o),0==this._geometryMeshPostion.length&&0==this._geometryMeshPositionsByBlock.length&&0==this._geometryMeshPositionsByLayer.length&&0==this._geometryMeshPositionsByBlock_ZeroLayer.length||this.createThreejsObjForMesh(t,o),0!=this._TextureData.length&&this.createThreejsObjForTexture(t,o,n),0!=this._MemorySections.length&&this.createThreejsObjForMemorySections(t,o,n)}0!=e.size&&(null==this._color&&(s=r.getColor(i),this._color=[],this._color.push((255&s)/255,(s>>8&255)/255,(s>>16&255)/255),this._colorValue=16777215&s),0==this._geometryCurvePostion.length&&0==this._geometryCurvePositionsByBlock.length&&0==this._geometryCurvePositionsByLayer.length&&0==this._geometryCurvePositionsByBlock_ZeroLayer.length||this.createThreejsObjForCurve_Clip(e,o,a),0==this._geometryMeshPostion.length&&0==this._geometryMeshPositionsByBlock.length&&0==this._geometryMeshPositionsByLayer.length&&0==this._geometryMeshPositionsByBlock_ZeroLayer.length||this.createThreejsObjForMesh_Clip(e,o,a),0!=this._TextureData.length&&this.createThreejsObjForTexture_Clip(e,o,n),0!=this._MemorySections.length&&this.createThreejsObjForMemorySections_clip(e,o,n)),this._geometryCurvePostion=[],this._geometryCurvePositionsByBlock=[],this._geometryCurvePositionsByLayer=[],this._geometryCurvePositionsByBlock_ZeroLayer=[],this._geometryCurveColor=[],this._geometryMeshPostion=[],this._geometryMeshPositionsByBlock=[],this._geometryMeshPositionsByLayer=[],this._geometryMeshPositionsByBlock_ZeroLayer=[],this._geometryMeshColor=[],this._TextureData=[],this._MemorySections=[]},v);function v(t){this._blockRecId=0,this._TextureData=[],this._MemorySections=[],this._geometryCurvePostion=new Array,this._geometryCurveColor=new Array,this._geometryMeshPostion=new Array,this._geometryMeshColor=new Array,this._geometryCurvePositionsByBlock=new Array,this._geometryMeshPositionsByBlock=new Array,this._geometryCurvePositionsByLayer=new Array,this._geometryMeshPositionsByLayer=new Array,this._geometryCurvePositionsByBlock_ZeroLayer=new Array,this._geometryMeshPositionsByBlock_ZeroLayer=new Array,this._entitys=new Array,this._color=void 0,this._colorValue=16777215,this._material_clip=[],this._blockRecId=t}n.Layer=y;var x=(b.prototype.showLayer=function(t,e){var n=this._layerTogeometry.get(t);null!=n&&n.Show(e)},b.prototype.updataClipMaterial=function(t){var e=t.getCanvas();this._layerTogeometry.forEach(function(t,n,r){t.updataClipMaterial(e)})},b.prototype.getId=function(){return this._id},b.prototype.getBlkRef=function(){return this._blkRef},b.prototype.createThreejsObj=function(t,e){var n=this;this._layerTogeometry.forEach(function(r,i,o){r.createThreejsObj(n._instance,n._instance_clip,t,e,i)})},b.prototype.addGeometryCurve=function(t,e,n,r,i,o){var a=this._layerTogeometry.get(n);null==a&&(a=new y(this._id),this._layerTogeometry.set(n,a)),a.addGeometryCurve(t,e,r,i,o)},b.prototype.addMemorySections=function(t){var e=this._layerTogeometry.get(t.layerId);null==e&&(e=new y(this._id),this._layerTogeometry.set(t.layerId,e)),e.addMemorySections(t)},b.prototype.addGeometryTexture=function(t,e,n,r,i,o,a,s){var l=this._layerTogeometry.get(r);null==l&&(l=new y(this._id),this._layerTogeometry.set(r,l)),l.addGeometryTexture(t,e,n,i,o,a,s)},b.prototype.addGeometryMesh=function(t,e,n,r,i,o){var a=this._layerTogeometry.get(n);null==a&&(a=new y(this._id),this._layerTogeometry.set(n,a)),a.addGeometryMesh(t,e,r,i,o)},b.prototype.addInstance=function(t){var e;t.clipPlans.ver<=3?0==t.clipPlans.clipPlanArray.length?this._instance.push(t):(null==(e=this._instance_clip.get(t.clipPlans.id))&&(e=[],this._instance_clip.set(t.clipPlans.id,e)),e.push(t)):0==t.clipPlans.instansClipePoints.length||100<this._instance_clip.size?this._instance.push(t):(null==(e=this._instance_clip.get(t.clipPlans.id))&&(e=[],this._instance_clip.set(t.clipPlans.id,e)),e.push(t))},b.prototype.addBlkRef=function(t){this._blkRef.push(t)},b);function b(t){this._id=0,this._layerTogeometry=new Map,this._blkRef=[],this._instance=[],this._instance_clip=new Map,this._id=t}n.Block=x;var w=(M.prototype.crateBlock=function(t){var e=this._mapBlock.get(t);return null==e&&(e=new x(t),this._mapBlock.set(t,e)),e},M.prototype.getBlock=function(t){return this._mapBlock.get(t)},M.prototype.addBlockRef=function(t){this.crateBlock(t.blkOwnerId).addBlkRef(t)},M.prototype.showLayer=function(t,e){this._mapBlock.forEach(function(t,e){var n=t,r=e;return function(t,e,i){t.showLayer(n,r)}}.call(this,t,e))},M.prototype.createBlocks_30=function(t,e){if(!this._isCreate){this.crateBlock(0);for(var n=1,i=t.getInt32(12,!0),o=80,a=0;a<i;a++){var s=t.getInt32(o,!0);o+=4;var l=t.getInt32(o,!0);o+=4;var c=t.getInt32(o,!0);o+=4;var p=t.getInt32(o,!0);o+=4;for(var f=new Array,m=0;m<16;m++){var g=t.getFloat32(o,!0);o+=4,f.push(g)}var y=t.getInt32(o,!0);o+=4;var v=new h;v.id=n,v.ver=3,n++,v.clipPlanArray=[];for(var x=0;x<y;x++){var b=t.getFloat32(o,!0);o+=4;var w=t.getFloat32(o,!0);o+=4;var M=t.getFloat32(o,!0);o+=4;var _=t.getFloat32(o,!0);o+=4;var C=new u;C.x1=b,C.y1=w,C.x2=M,C.y2=_,v.clipPlanArray.push(C)}var S=new d;S.ver=3,S.mat=new r.Matrix4,S.mat.fromArray(f),S.blkRecId=c,S.blkOwnerId=s,S.layerId=l,S.color=p,S.clipPlans=v,this.crateBlock(c),this.addBlockRef(S)}this._isGetAllBlocks=!0,this._isCreate=!0}},M.prototype.createBlocks_40=function(t,e){if(!this._isCreate){this.crateBlock(0);for(var n=1,i=t.getInt32(12,!0),o=80,a=0;a<i;a++){var s=t.getInt32(o,!0);o+=4;var l=t.getInt32(o,!0);o+=4;var c=t.getInt32(o,!0);o+=4;var u=t.getInt32(o,!0);o+=4;for(var p=new Array,f=0;f<16;f++){var m=t.getFloat32(o,!0);o+=4,p.push(m)}var g=t.getInt32(o,!0);o+=4;var y=new h;y.id=n,y.ver=4,n++,y.clipPoints=[];for(var v=0;v<g;v++){var x=new r.Vector2;x.x=t.getFloat32(o,!0),o+=4,x.y=t.getFloat32(o,!0),o+=4,y.clipPoints.push(x)}var b=new d;b.ver=4,b.mat=new r.Matrix4,b.mat.fromArray(p),b.blkRecId=c,b.blkOwnerId=s,b.layerId=l,b.color=u,b.clipPlans=y,this.crateBlock(c),this.addBlockRef(b)}this._isGetAllBlocks=!0,this._isCreate=!0}},M.prototype.createBlocks=function(t,e){this._isCreate||(new s.MxNetData(t).getVersion_MwBlobHead()<=3?this.createBlocks_30(t,e):this.createBlocks_40(t,e))},M.prototype.updataClipMaterial=function(t){this._mapBlock.forEach(function(e,n,r){e.updataClipMaterial(t)})},M.prototype.createAllInstance=function(t){var e=this.getBlock(0);if(null==e)return!1;if(null==this._rootBlockRef)return!1;var n=new r.Matrix4,i=new Map,o=new h;return this._iClipIdCount=1,o.id=this._iClipIdCount,this._iClipIdCount++,this.createAllInstanceCall(e,this._rootBlockRef,n,i,16777215,t,void 0,o),!0},M.prototype.createThreejsObj=function(t,e,n){null==this._mapNeedCreateThreejsObj.get(t.getId())&&this._mapNeedCreateThreejsObj.set(t.getId(),t),this._isCreateAllInstance||this._isGetAllBlocks&&n.isInitComplete()&&(this._isCreateAllInstance=this.createAllInstance(n)),this._isCreateAllInstance&&(this._mapNeedCreateThreejsObj.forEach(function(t,r,i){t.createThreejsObj(e,n)}),this._mapNeedCreateThreejsObj.clear())},M.prototype.createAllInstanceCall=function(t,e,n,i,o,a,s,l){if(1!=i[t.getId()]){i[t.getId()]=!0;var c=new p;if(c.mat=new r.Matrix4,c.mat.copy(n),c.mat.multiply(e.mat),e.ver<=3)if(0==e.clipPlans.clipPlanArray.length)c.clipPlans=l;else{c.clipPlans=e.clipPlans,c.clipPlans.ver=3;for(var u,d,f,m,g=c.clipPlans.clipPlanArray.length,y=function(){u=new r.Vector3(c.clipPlans.clipPlanArray[v].x1,c.clipPlans.clipPlanArray[v].y1,0),d=new r.Vector3(c.clipPlans.clipPlanArray[v].x2,c.clipPlans.clipPlanArray[v].y2,0),f=new r.Vector3(c.clipPlans.clipPlanArray[v].x1,c.clipPlans.clipPlanArray[v].y2,0),m=new r.Vector3(c.clipPlans.clipPlanArray[v].x2,c.clipPlans.clipPlanArray[v].y1,0),u.applyMatrix4(c.mat),d.applyMatrix4(c.mat),f.applyMatrix4(c.mat),m.applyMatrix4(c.mat);var t=u.x,e=u.x,n=u.y,i=u.y,o=[];o.push(d),o.push(f),o.push(m),o.forEach(function(r){t>r.x&&(t=r.x),e<r.x&&(e=r.x),n>r.y&&(n=r.y),i<r.y&&(i=r.y)}),c.clipPlans.clipPlanArray[v].x1=t,c.clipPlans.clipPlanArray[v].y1=n,c.clipPlans.clipPlanArray[v].x2=e,c.clipPlans.clipPlanArray[v].y2=i},v=0;v<g;v++)y()}else if(0==e.clipPlans.clipPoints.length)c.clipPlans=l;else{c.clipPlans=new h,c.clipPlans.ver=4,c.clipPlans.id=this._iClipIdCount,this._iClipIdCount++,c.clipPlans.instansClipePoints=l.instansClipePoints.slice(0);var x=[],b=e.clipPlans.clipPoints;for(g=b.length,v=0;v<g;v++){var w=new r.Vector3(b[v].x,b[v].y,0);w.applyMatrix4(c.mat),x.push(new r.Vector2(w.x,w.y))}c.clipPlans.instansClipePoints.push(x)}null==s?c.topLayerColor.push(1,1,1):c.topLayerColor.push(s[0],s[1],s[2]);var M=e.color>>24&255;if(2==M)c.color.push((255&o)/255,(o>>8&255)/255,(o>>16&255)/255);else if(1==M){var _=a.getColor(e.layerId);c.color.push((255&_)/255,(_>>8&255)/255,(_>>16&255)/255),o=_}else c.color.push((255&e.color)/255,(e.color>>8&255)/255,(e.color>>16&255)/255),o=e.color;t.addInstance(c);for(var C=t.getBlkRef(),S=null==s,T=0;T<C.length;T++)if(0!=C[T].blkRecId){var E=this.getBlock(C[T].blkRecId);if(null==E)return;S&&(s=[],_=a.getColor(C[T].layerId),s.push((255&_)/255,(_>>8&255)/255,(_>>16&255)/255)),this.createAllInstanceCall(E,C[T],c.mat,i,o,a,s,c.clipPlans)}i[t.getId()]=!1}},M.prototype.initRootBlockRef=function(t){null==t&&((t=new d).mat=new r.Matrix4,t.blkRecId=0,t.blkOwnerId=-1,t.layerId=-1,t.color=16777215),this._rootBlockRef=t},M);function M(){this._mapBlock=new Map,this._mapNeedCreateThreejsObj=new Map,this._isCreate=!1,this._isGetAllBlocks=!1,this._isCreateAllInstance=!1,this._rootBlockRef=void 0,this._iClipIdCount=1}n.Blocks=w;var _=function(){this.blocks=new w,this.layers=new o.MxBrowseLayerData};n.ExternalReferenceDatabase=_;var C=(S.prototype.createTzDwgExternalReferences=function(t){this._mapId2ExternalDatabase.get(t)||this.getBlocks(t).initRootBlockRef()},S.prototype.createExternalReferences=function(t){for(var e=t.getInt32(12,!0),n=80,i=0;i<e;i++){for(var o=new Array,a=0;a<16;a++){var s=t.getFloat32(n,!0);n+=4,o.push(s)}var l=t.getInt32(n,!0);n+=4;var c=t.getInt32(n,!0);if(n+=4,t.getInt32(n,!0),n+=4,0!=l){var u=this.getBlocks(l),h=new d;h.mat=new r.Matrix4,h.mat.fromArray(o),h.blkRecId=0,h.blkOwnerId=-1,h.layerId=-1,h.color=c,u.initRootBlockRef(h)}else console.log("mx error iDatabaseIndex")}},S.prototype.getBlocks=function(t){if(0!=t){var e=this._mapId2ExternalDatabase.get(t);return null==e&&(e=new _,this._mapId2ExternalDatabase.set(t,e)),e.blocks}console.log("mx error iDatabaseIndex")},S.prototype.getLayers=function(t){if(0!=t){var e=this._mapId2ExternalDatabase.get(t);return null==e&&(e=new _,this._mapId2ExternalDatabase.set(t,e)),e.layers}console.log("mx error iDatabaseIndex")},S);function S(){this._mapId2ExternalDatabase=new Map}n.ExternalReferenceManager=C},{"../MxFun":34,"../MxManager":36,"../MxNetData":38,"../MxShader":40,"../MxStencilObject":41,"./MxBrowseLayerData":69,three:19}],69:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxBrowseLayerData=void 0;var r=(i.prototype.add=function(t,e,n){this._layerColor[t]=e,this._nametoId[n]=t},i.prototype.setZeroLayerId=function(t){this._zeroLayerId=t},i.prototype.getZeroLayerId=function(){return this._zeroLayerId},i.prototype.getLayerIdForName=function(t){return null==this._nametoId[t]?0:this._nametoId[t]},i.prototype.getColor=function(t){return null==this._layerColor[t]?16777215:this._layerColor[t]},i.prototype.initComplete=function(){this._isSetInstanceComplete=!0},i.prototype.isInitComplete=function(){return this._isSetInstanceComplete},i);function i(){this._isSetInstanceComplete=!1,this._layerColor=new Map,this._nametoId=new Map,this._zeroLayerId=0}n.MxBrowseLayerData=r},{}],70:[function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n=n||Promise)(function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=0<(i=a.trys).length&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbDatabase=void 0;var o=t("three"),a=t("../MxFun"),s=t("./MxDbEntity"),l=t("./MxDbEntityGrip"),c=t("./MxDbEntitySelect"),u=t("../MxManager"),h=t("../MxType"),d=t("./MxDbLayerTable"),p=t("./MxDbGroup"),f=t("../MxDrawData"),m=t("../MxTools"),g=(y.prototype.getAllEntity=function(){return this.mapIdToEntity},y.prototype.getGroupDictionary=function(){return this.groupDictionary},y.prototype.upDirtyDisplay=function(){var t=!1;return this.mapIdToEntity.forEach(function(e){e.getDirtyDisplay()&&(e.upDisplay(),e.setDirtyDisplay(!1),t=!0)}),t},y.prototype.onViewChange=function(){var t=!1;return this.mapIdToEntity.forEach(function(e){e.onViewChange()&&(t=!0)}),t},y.prototype.toJsonObject=function(t){var e={ver:1},n=new o.Vector3(0,0,0),r=new o.Vector3(this.mxObj.getViewWidth(),this.mxObj.getViewHeight(),0),i=h.MxType.MxCloneType.kMxFileClone;t&&(i=h.MxType.MxCloneType.kSaveDwgClone),e.correctLargeCoordinates=f.MxDrawData.m_isCorrectLargeCoordinates,f.MxDrawData.m_isCorrectLargeCoordinates&&(e.matDoc2Cad=this.mxObj.getDoc2CADMatrix());var a=this.mxObj.screenCoord2Doc(n.x,n.y,0),s=this.mxObj.screenCoord2Doc(r.x,r.y,0);e.view={ptView1:a,ptView2:s};var l=[];return this.mapNameToLayer.forEach(function(t){var e={type:i};t.dwgOut(e),e.TypeName="MxDbLayerTableRecord",l.push(e)}),e.layers=l,this.groupDictionary.dwgOut(e),e},y.prototype.saveJson=function(t){var e=this,n=this.toJsonObject(t),r=h.MxType.MxCloneType.kMxFileClone;t&&(r=h.MxType.MxCloneType.kSaveDwgClone);var i=[];return this.mapIdToEntity.forEach(function(t){var n=t.getUserObject(),o={type:r};n.dwgOut(o),o.TypeName=n.getTypeName(),o.group=e.groupDictionary.getEntityInGroupName(t.objectId()),i.push(o)}),n.entitys=i,n},y.prototype.reInit=function(){this.eraseAllEntity(),this.initLayerTable(),this.groupDictionary=new p.MxDbGroupDictionary},y.prototype.loadJson=function(t){return r(this,void 0,void 0,function(){var e,n,r,o,a,l,c,h,d,p,f=this;return i(this,function(m){switch(m.label){case 0:if(this.reInit(),(e=t).view&&(n=e.view,this.mxObj.zoomW(n.ptView1,n.ptView2,!1)),r=e.layers)for(o=r.length,p=0;p<o;p++)a=r[p],this.addLayer(a.name).dwgIn(a);this.groupDictionary.dwgIn(e),l=e.entitys,c=l.length,h=function(t){var e,n,r,o;return i(this,function(i){switch(i.label){case 0:return e=l[t],[4,u.MxManager.getMxDbEntityClassHierarchy().createMxEntity(e.TypeName)];case 1:return(n=i.sent())?(n.dwgIn(e),(r=new s.MxDbEntity).initUserObject(n),d.addEntityImp(r),(o=e.group)&&0<o.length&&o.forEach(function(t){f.groupDictionary.add(t).append(r.objectId())}),[2]):[2,"continue"]}})},d=this,p=0,m.label=1;case 1:return p<c?[5,h(p)]:[3,4];case 2:m.sent(),m.label=3;case 3:return p++,[3,1];case 4:return[2,new Promise(function(t){t(!0)})]}})})},y.prototype.getMxObject=function(){return this.mxObj},y.prototype.getGripManager=function(){return this.gripManager},y.prototype.getSelectManager=function(){return this.selectManager},y.prototype.clearMxCurrentSelect=function(){var t=!1;return this.gripManager.removeAllGrips()&&(t=!0),this.selectManager.removeAllEntity()&&(t=!0),t},y.prototype.eraseAllEntity=function(){this.mapIdToEntity.forEach(function(t){t.clearDisplayImp()}),this.mapIdToEntity=new Map,this.clearMxCurrentSelect()},y.prototype.intiDoc2Wold=function(t){this.parentObject.matrix=t,this.parentObject.matrixAutoUpdate=!1},y.prototype.initLayerTable=function(){this.mapNameToLayer=new Map,this.curLayer="0";var t=new d.MxDbLayerTableRecord;t.init(this.curLayer,this.parentObject),this.mapNameToLayer.set(this.curLayer,t)},y.prototype.init=function(t){this.mxObj=t,this.scene=t.getScene(),a.MxFun.removeThreejsObject(this.parentObject,this.scene),this.parentObject=new o.Object3D,this.parentObject.renderOrder=u.MxData.iMxEntityRenderOrder,this.scene.add(this.parentObject),this.initLayerTable()},y.prototype.getEntity=function(t){return this.mapIdToEntity.get(t)},y.prototype.isValidId=function(t){return this.mapIdToEntity.has(t)},y.prototype.setRenderOrder=function(t){var e=this.parentObject.renderOrder;return this.parentObject.renderOrder=t,e},y.prototype.eraseEntity=function(t){this.gripManager.deleteGripData(t),this.selectManager.deleteSelect(t),this.mapIdToEntity.delete(t)},y.prototype.showLayer=function(t,e){var n=this.getLayer(t);n&&n.setVisible(e)},y.prototype.setCurrentLayer=function(t){if(0!=t.length)return this.curLayer=t,this.addLayer(t)},y.prototype.addLayer=function(t){var e=this.mapNameToLayer.get(t);return e||((e=new d.MxDbLayerTableRecord).init(t,this.parentObject),this.mapNameToLayer.set(t,e),e)},y.prototype.getLayer=function(t){return this.mapNameToLayer.get(t)},y.prototype.addMxEntity=function(t){if(t.getImp())return t.objectId();var e=new s.MxDbEntity;return e.initUserObject(t),t.initGuid(m.MxTools.generateUUID()),this.addEntityImp(e)},y.prototype.addEntityImp=function(t){return this.mapIdToEntity.set(this.idCount,t),t.setMxDatabase(this),t.setObjectId(this.idCount),0==t.getLayer().length&&t.setLayer(this.curLayer),t.upDisplay(),this.idCount++},y.prototype.getThreeJSParentObject=function(){return this.parentObject},y.prototype.getIntersectObjects=function(t){var e=new o.Raycaster;e.linePrecision=this.mxObj.screenCoordLong2Doc(40);var n=this.mxObj.getCanvas(),r=n.clientWidth,i=n.clientHeight,a=new o.Vector2(t.x/r*2-1,-t.y/i*2+1);return e.setFromCamera(a,this.mxObj.getCamera()),e.intersectObjects(this.parentObject.children,!0)},y);function y(){this.mapIdToEntity=new Map,this.mxObj=null,this.scene=null,this.idCount=1,this.parentObject=null,this.mapNameToLayer=new Map,this.curLayer="0",this.gripManager=new l.MxDbEntityGrip(this),this.selectManager=new c.MxDbEntitySelect(this),this.groupDictionary=new p.MxDbGroupDictionary}n.MxDbDatabase=g},{"../MxDrawData":29,"../MxFun":34,"../MxManager":36,"../MxTools":45,"../MxType":46,"./MxDbEntity":71,"./MxDbEntityGrip":72,"./MxDbEntitySelect":73,"./MxDbGroup":74,"./MxDbLayerTable":75,three:19}],71:[function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n=n||Promise)(function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=0<(i=a.trys).length&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbEntity=n.MxDbEntityClassHierarchy=n.MxDbEntityUserObject=void 0;var o=t("three"),a=t("../Operate/McGiWorldDraw"),s=t("../MxManager"),l=t("../MxTools"),c=t("../MxType"),u=(h.prototype.getClosestPointTo=function(t,e){return null},h.prototype.getTypeName=function(){return""},h.prototype.initGuid=function(t){0<this.sGuid.length?console.log("mx: init guid error"):this.sGuid=t},h.prototype.guid=function(){return this.sGuid},h.prototype.setLayer=function(t){var e=this.getImp();e&&e.nodifySetLayer(),this.layer=t},h.prototype.getLayer=function(){return this.layer},h.prototype.setDash=function(t,e){this.dDashArray=t,this.dDashRatio=e,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)},h.prototype.getDash=function(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}},h.prototype.setDashLineDisplay=function(t){t?(this.dDashArray=.03,this.dDashRatio=.1,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)):(this.dDashArray=0,this.dDashRatio=0)},h.prototype.isDashLineDisplay=function(){return 0<this.dDashArray&&0<this.dDashRatio},h.prototype.setLineWidthByPixels=function(t){this.lineWidthByPixels=t},h.prototype.getLineWidthByPixels=function(){return this.lineWidthByPixels},h.prototype.setLineWidth=function(t){this.dLineWidth=t},h.prototype.getLineWidth=function(){return this.dLineWidth},h.prototype.getMxObject=function(){var t=this.getImp();return t?t.getMxObject():null},h.prototype.onViewChange=function(){return!1},h.prototype.getImp=function(){return this.MxDbEntityImp},h.prototype.upDisplay=function(){var t=this.getImp();return!!t&&t.upDisplay()},h.prototype.erase=function(){var t=this.getImp();return!!t&&t.erase()},h.prototype.setColor=function(t){this.iColor=t},h.prototype.getColor=function(){return this.iColor},h.prototype.setRenderOrder=function(t){this.iRenderOrder=t},h.prototype.getRenderOrder=function(){return this.iRenderOrder},h.prototype.onEndGripEidt=function(){},h.prototype.onStartGripEidt=function(){},h.prototype.dwgIn=function(t){return this.iColor=t.iColor,this.iRenderOrder=t.iRenderOrder,this.opacity=t.opacity,this.visible=t.visible,this.dLineWidth=t.lineWidth,this.lineWidthByPixels=t.lineWidthByPixels,this.dDashArray=t.dashArray,this.dDashRatio=t.dashRatio,this.layer=t.layer,t.guid&&(this.sGuid=t.guid),!0},h.prototype.dwgOut=function(t){return t.iColor=this.iColor,t.iRenderOrder=this.iRenderOrder,t.opacity=this.opacity,t.visible=this.visible,t.lineWidth=this.dLineWidth,t.lineWidthByPixels=this.lineWidthByPixels,t.dashArray=this.dDashArray,t.dashRatio=this.dDashRatio,t.layer=this.layer,t.guid=this.sGuid,t},h.prototype.clone=function(t){var e=this.create(),n={type:t||c.MxType.MxCloneType.kClone};return this.dwgOut(n),e.dwgIn(n),e.sGuid="",e},h.prototype.init=function(){s.MxManager.getMxDbEntityClassHierarchy().init(this)},h.prototype.transformBy=function(t){},h.prototype.objectId=function(){var t=this.getImp();return t?t.objectId():0},h);function h(){this.iColor=16777215,this.iRenderOrder=s.MxData.iMxEntityRenderOrder,this.opacity=1,this.visible=!0,this.dLineWidth=0,this.lineWidthByPixels=!0,this.dDashArray=0,this.dDashRatio=0,this.layer="",this.sGuid=""}n.MxDbEntityUserObject=u;var d=(p.prototype.init=function(t){var e=t.getTypeName();this.mapType2Create.get(e)&&console.log("MxError:already has this class name "+e),this.mapType2Create.set(e,{type:0,createfun:t})},p.prototype.initDynamic=function(t){this.dynmaicCreate=t},p.prototype.createMxEntity=function(t){return r(this,void 0,void 0,function(){var e,n;return i(this,function(r){switch(r.label){case 0:return(e=this.mapType2Create.get(t))?[3,3]:this.dynmaicCreate?[4,this.dynmaicCreate(t)]:[3,2];case 1:return(n=r.sent())?(this.mapType2Create.set(t,{type:1,createfun:n}),[2,new Promise(function(t,e){t(new n)})]):[2,new Promise(function(t,e){t(null)})];case 2:return[2,new Promise(function(t,e){t(null)})];case 3:return 0==e.type?[2,new Promise(function(t,n){t(e.createfun.create())})]:1==e.type?[2,new Promise(function(t,n){t(new e.createfun)})]:[2,new Promise(function(t,e){t(null)})]}})})},p);function p(){this.mapType2Create=new Map,this.dynmaicCreate=null}n.MxDbEntityClassHierarchy=d;var f=(m.prototype.setObjectId=function(t){this.id=t},m.prototype.nodifySetLayer=function(){this.layerObjectGroup&&this.clearDisplayImp()},m.prototype.setLayer=function(t){this.userObject.setLayer(t)},m.prototype.getLayer=function(){return this.userObject.getLayer()},m.prototype.setDirtyDisplay=function(t){this.isDirtyDisplay=t},m.prototype.getDirtyDisplay=function(){return this.isDirtyDisplay},m.prototype.setMxDatabase=function(t){this.mxDatabase=t},m.prototype.objectId=function(){return this.id},m.prototype.initUserObject=function(t){(this.userObject=t).MxDbEntityImp=this},m.prototype.upDisplay=function(){if(!this.mxDatabase)return console.log("mxassert(0) this.mxDatabase is null"),!1;this.updateDisplayImp(this.mxDatabase.getMxObject())},m.prototype.erase=function(){if(0==this.id)return!1;this.clearDisplayImp(),this.userObject=null,this.mxDatabase.eraseEntity(this.id),this.id=0,this.mxDatabase=null},m.prototype.clearDisplayImp=function(){this.layerObjectGroup&&(this.threeObjectGroup&&(this.threeObjectGroup.traverse(function(t){"Mesh"===t.type&&(t.geometry.dispose(),t.material.dispose())}),this.layerObjectGroup.remove(this.threeObjectGroup)),this.threeObjectGroup=null,this.layerObjectGroup=null)},m.prototype.updateDisplayImp=function(t){if(this.clearDisplayImp(),this.userObject){if(this.userObject.visible){var e=this.mxDatabase.addLayer(this.userObject.getLayer());if(!e)return console.log("mxassert(0) this.layerRecord is null"),!1;this.threeObjectGroup=new o.Group;var n=new a.McGiWorldDraw(t,a.McGiWorldDrawType.kWorldDraw);n.setupForEntity(this.userObject),this.worldDraw(n);for(var r=n.getEntitys(),i=r.length,s=0;s<i;s++){var c=r[s];(c.MxDbEntity=this).threeObjectGroup.add(c)}this.layerObjectGroup=e.getGroup(),this.layerObjectGroup.add(this.threeObjectGroup)}}else l.MxTools.MxASSERT(!1,"this.userObject == null")},m.prototype.worldDraw=function(t){this.userObject.worldDraw(t)},m.prototype.getGripPoints=function(){return this.userObject.getGripPoints()},m.prototype.getClosestPointTo=function(t,e){return this.userObject.getClosestPointTo(t,e)},m.prototype.getUserObject=function(){return this.userObject},m.prototype.clone=function(t){var e=new m;return e.initUserObject(this.userObject.clone(t)),e},m.prototype.transformBy=function(t){this.userObject.transformBy(t)},m.prototype.setColor=function(t){this.userObject.setColor(t)},m.prototype.onEndGripEidt=function(){this.userObject.onEndGripEidt()},m.prototype.onStartGripEidt=function(){return this.userObject.onStartGripEidt()},m.prototype.getColor=function(){return this.userObject.getColor()},m.prototype.getMxObject=function(){return this.mxDatabase?this.mxDatabase.getMxObject():null},m.prototype.onViewChange=function(){return!!this.userObject&&this.userObject.onViewChange()},m);function m(){this.threeObjectGroup=null,this.userObject=null,this.mxDatabase=null,this.isDirtyDisplay=!1,this.layerObjectGroup=null,this.id=0}n.MxDbEntity=f},{"../MxManager":36,"../MxTools":45,"../MxType":46,"../Operate/McGiWorldDraw":50,three:19}],72:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbEntityGrip=n.MxDbEntityGripJig=n.MxGetWordDrawxDataForThreeJsObject=n.MxGetMxDbEntitForThreeJsObject=n.MxDbEntityGripData=void 0;var o=t("three"),a=t("../MxFun"),s=t("../MxDrawData"),l=t("../Operate/MxJig"),c=t("../Operate/MxJigCmdManager"),u=t("../Operate/McGiWorldDraw"),h=t("../MxManager"),d=t("../MxType"),p=function(){this.threeObject=null};function f(t){for(var e=null;t&&!(e=t.MxDbEntity)&&t.parent;)t=t.parent;return e}n.MxDbEntityGripData=p,n.MxGetMxDbEntitForThreeJsObject=f,n.MxGetWordDrawxDataForThreeJsObject=function(t){for(var e=null;t&&!(e=t.MxWordDrawXData)&&t.parent;)t=t.parent;return e};var m,g=(i(y,m=l.McEdJigCommand),y.prototype.sampler=function(){var t=c.MxJigCmdManager.InType.kGetBegan|c.MxJigCmdManager.InType.kGetEnd,e=this.acquirePoint(t);return e.status==c.MxJigCmdManager.DragStatus.kNormal&&(this.currPt=e.pt),e.status},y.prototype.getTypeName=function(){return"MxGripEdit"},y.prototype.onStartCommand=function(){this.iscallOnStartCommand=!0,m.prototype.onStartCommand.call(this)},y.prototype.done=function(t){if(t==c.MxJigCmdManager.DragStatus.kNormal){var e=this.currPt.clone();e.sub(this.dragBasePt);for(var n=this.getMxObject(),r=n.getMxDatabase(),i=n.getMxDatabase().getGripManager(),o=this.grips.length,a=new Set,s=[],l=0;l<o;l++){var u=this.grips[l],h=this.ents[l];i.deleteGripData(h.objectId()),h.getUserObject().moveGripPointsAt(u.iIndex,e),i.addGripFromEntity(h),h.upDisplay(),a.add(h.objectId());var d={id:h.objectId(),index:u.iIndex,curentPoint:this.currPt};s.push(d)}n.updateDisplay(),0<s.length&&n.callEvent("objectGripEdit",s),r.getSelectManager().upSelectDilsplay(a)}var p=this.ents.length;for(l=0;l<p;l++)(h=this.ents[l]).onEndGripEidt(),t!=c.MxJigCmdManager.DragStatus.kNormal&&h.upDisplay();return c.MxJigCmdManager.DoneStatius.kExitCommand},y.prototype.upDisplay=function(){var t=this.currPt.clone();if(t.sub(this.dragBasePt),!(t.length()<.001)){if(this.iscallOnStartCommand){for(var e=this.ents.length,n=0;n<e;n++){var r=this.ents[n];this.aryParam.push(r.onStartGripEidt())}this.iscallOnStartCommand=!1}var i=this.getMxObject(),o=this.grips.length;for(n=0;n<o;n++){var a=this.grips[n],s=(r=this.ents[n],this.aryParam[n]),l=r.clone(d.MxType.MxCloneType.kDragClone);l.getUserObject().moveGripPointsAt(a.iIndex,t);var c=new u.McGiWorldDraw(i,u.McGiWorldDrawType.kDynDragDraw);c.setupForEntity(l.getUserObject()),l.worldDraw(c);var h=c.getEntitys(),p=h.length,f=31;s&&s.renderOrder&&(f=s.renderOrder);for(var m=0;m<p;m++)this.drawEntity(h[m],f)}}},y);function y(t,e,n){var r=m.call(this)||this;return r.aryParam=[],r.iscallOnStartCommand=!0,r.dragBasePt=t,r.grips=e,r.ents=n,r.currPt=t,r.iscallOnStartCommand=!0,r}n.MxDbEntityGripJig=g;var v=(x.prototype.getAllSelect=function(){var t=[];return this.mapGrips.forEach(function(e,n){t.push(n)}),t},x.prototype.getParentObject=function(){return this.database.getMxObject().getTheTempDrawContainer()},x.prototype.removeAllGrips=function(){if(0==this.mapGrips.size)return!1;this.database.getMxObject();var t=this.getParentObject();return this.mapGrips.forEach(function(e,n,r){for(var i=e.length,o=0;o<i;o++){var s=e[o];a.MxFun.removeThreejsObject(s.threeObject,t)}}),this.mapGrips=new Map,!0},x.prototype.deleteGripData=function(t){var e=this.getParentObject(),n=this.mapGrips.get(t);if(n)for(var r=n.length,i=0;i<r;i++){var o=n[i];a.MxFun.removeThreejsObject(o.threeObject,e)}this.mapGrips.delete(t)},x.prototype.createGripDisplayObject=function(t){var e=this.database.getMxObject(),n=this.getParentObject();t.geometry=new o.Geometry;var r=e.screenCoordLong2Doc(s.MxDrawData.m_dGridWidth/2);t.geometry.vertices.push(new o.Vector3(t.point.x-r,t.point.y-r,0)),t.geometry.vertices.push(new o.Vector3(t.point.x-r,t.point.y+r,0)),t.geometry.vertices.push(new o.Vector3(t.point.x+r,t.point.y+r,0)),t.geometry.vertices.push(new o.Vector3(t.point.x+r,t.point.y-r,0)),t.geometry.faces.push(new o.Face3(0,1,2)),t.geometry.faces.push(new o.Face3(2,3,0)),t.geometry.computeFaceNormals(),t.geometry.computeVertexNormals();var i=new o.MeshBasicMaterial({color:255,transparent:!0,depthTest:!1,side:o.DoubleSide,opacity:.9}),a=new o.Mesh(t.geometry,i);a.renderOrder=h.MxData.iGripRenderOrder,n.add(a),t.threeObject=a},x.prototype.addGripData=function(t,e,n){var r=this.mapGrips.get(t);null==r&&(r=new Array,this.mapGrips.set(t,r));var i=new p;return i.iIndex=e,i.point=new o.Vector3(n.x,n.y,0),r.push(i),i},x.prototype.hitTest=function(t){var e=this,n={grips:new Array,ents:new Array,pt:t},r=new o.Vector3(t.x,t.y,0),i=this.database.getMxObject(),a=i.screenCoordLong2Doc(2*s.MxDrawData.m_dGridWidth);return this.mapGrips.forEach(function(t,o){for(var s=t.length,l=0;l<s;l++){var c=t[l];if(c.point.distanceTo(r)<=a){var u=e.database.getEntity(o),h=!0;i.hasEvent("whetherEditTheGripPoint")&&(h=i.callEvent("whetherEditTheGripPoint",{entity:u.getUserObject(),index:c.iIndex})),h&&(n.grips.push(c),n.ents.push(u));break}}}),n},x.prototype.onMouseLBDown=function(t){if(!s.MxDrawData.m_isEnableGripEidt)return!1;var e=this.hitTest(t);return 0!=e.grips.length&&(a.MxFun.sendStringToExecute("Mx_FrontEndWebpageGripEdit",e),!0)},x.prototype.gripEditImp=function(t){var e=t.grips,n=t.ents,r=t.pt,i=new g(r,e,n);i.setDisableDynInput(!0),i.setDisableOsnap(!0),c.MxJigCmdManager.runCmd(i)},x.prototype.doWindowsSelect=function(t,e){},x.prototype.addGripFromEntity=function(t){if(s.MxDrawData.m_isEnableGripEidt){var e=t.getGripPoints(),n=t.objectId();this.deleteGripData(n);for(var r=0;r<e.length;r++){var i=this.addGripData(n,r,e[r]);this.createGripDisplayObject(i)}}},x.prototype.addSelect=function(t){var e=this.database.getSelectManager(),n=!1;if(this.getAllSelect().forEach(function(e){e==t&&(n=!0)}),!n){var r=this.database.getMxObject(),i=r.getMxEntity(t);if(i){var o=new Set;o.add(t),this.addGripFromEntity(i),e.upSelectDilsplay(o),this.isCallingMxEntitySelectChange||(this.isCallingMxEntitySelectChange=!0,r.callEvent("MxEntitySelectChange",this.getAllSelect()),this.isCallingMxEntitySelectChange=!1)}}},x.prototype.doPointSelect=function(t){for(var e=!1,n=this.database.getSelectManager(),r=this.database.getMxObject(),i=n.isEmptySelect(),o=!1,a=r.screenCoordLong2Doc(2*s.MxDrawData.m_dGridWidth),l=function(){s.MxDrawData.m_isMultipleSelect||(c.removeAllGrips(),n.removeAllEntity());var i=c.database.getIntersectObjects(t);if(0==i.length)return r.updateDisplay(),"break";var l=r.screenCoord2Doc(t.x,t.y,t.z),u=c,h=new Set;i.forEach(function(t){var e=f(t.object);if(e){var n=e.objectId();if(u.database.isValidId(n)&&!h.has(n)){var r=e.getClosestPointTo(l,1),i=!1;(!r||r.distanceTo(l)<a)&&(i=!0),i&&(h.add(n),u.addGripFromEntity(e))}}});var d=new Set,p=c.database.getGroupDictionary();return h.forEach(function(t){d.add(t),p.getEntityInGroup(t).forEach(function(t){t.getAll().forEach(function(t){u.database.isValidId(t)&&d.add(t)})})}),o=!0,n.upSelectDilsplay(d),r.updateDisplay(),e=!0,"break"},c=this;"break"!==l(););return!o&&i==n.isEmptySelect()||this.isCallingMxEntitySelectChange||(this.isCallingMxEntitySelectChange=!0,r.callEvent("MxEntitySelectChange",this.getAllSelect()),this.isCallingMxEntitySelectChange=!1),e},x);function x(t){this.database=null,this.mapGrips=new Map,this.isCallingMxEntitySelectChange=!1,this.database=t}n.MxDbEntityGrip=v},{"../MxDrawData":29,"../MxFun":34,"../MxManager":36,"../MxType":46,"../Operate/McGiWorldDraw":50,"../Operate/MxJig":57,"../Operate/MxJigCmdManager":58,three:19}],73:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbEntitySelect=void 0;var r=t("three"),i=t("../MxFun"),o=t("three.meshline"),a=t("../Operate/McGiWorldDraw"),s=t("../MxManager"),l=(c.prototype.setRenderOrder=function(t){this.iRenderOrder=t},c.prototype.getRenderOrder=function(){return this.iRenderOrder},c.prototype.setCanvasSize=function(t,e){this.canvasWidth==t&&this.canvasHeight==e||(this.canvasWidth=t,this.canvasHeight=e,this.material.resolution=new r.Vector2(this.canvasWidth,this.canvasHeight),this.material.needsUpdate=!0)},c.prototype.removeAllEntity=function(){var t=this.getParentObject();return 0!=this.mapIdToThreeObject.size&&(this.mapIdToThreeObject.forEach(function(e){for(var n=e.length,r=0;r<n;r++)i.MxFun.removeThreejsObject(e[r],t)}),this.mapIdToThreeObject.clear(),!0)},c.prototype.isEmptySelect=function(){return 0==this.mapIdToThreeObject.size},c.prototype.getParentObject=function(){return this.mxDatabase.getMxObject().getTheTempDrawContainer()},c.prototype.getAllSelect=function(){var t=[];return this.mapIdToThreeObject.forEach(function(e,n){t.push(n)}),t},c.prototype.setPrvCommandSelect=function(t){this.aryPrvCommandSelect=t},c.prototype.getPrvCommandSelect=function(){return this.aryPrvCommandSelect},c.prototype.deleteSelect=function(t){var e=this.getParentObject(),n=this.mapIdToThreeObject.get(t);if(n){for(var r=n.length,o=0;o<r;o++)i.MxFun.removeThreejsObject(n[o],e);this.mapIdToThreeObject.delete(t)}},c.prototype.upSelectDilsplayFromId=function(t){var e=new Set;e.add(t),this.upSelectDilsplay(e)},c.prototype.upSelectDilsplay=function(t){var e=this,n=new a.McGiWorldDrawSelect(this.mxDatabase.getMxObject(),this);t.forEach(function(t){e.deleteSelect(t);var r=e.mxDatabase.getEntity(t);r&&(n.setCurEntityId(t),r.worldDraw(n))})},c.prototype.addCircleDisplay=function(t,e,n){var i=new r.CircleGeometry(n,64,3,2*Math.PI);if(i.vertices.shift(),0!=i.vertices.length){i.vertices.push(i.vertices[0]);var a=3*i.vertices.length;if(0!=a){for(var s=this.getParentObject(),l=new Float32Array(a),c=0,u=0;c+2<a;c+=3,u++)l[c]=i.vertices[u].x+e.x,l[c+1]=i.vertices[u].y+e.y,l[c+2]=e.z;var h=new o.MeshLine;h.setGeometry(l);var d=new r.Mesh(h.geometry,this.material);d.renderOrder=this.iRenderOrder,s.add(d);var p=this.mapIdToThreeObject.get(t);p||(p=new Array,this.mapIdToThreeObject.set(t,p)),p.push(d)}}},c.prototype.addLineDisplay=function(t,e,n){var i=this.getParentObject(),a=new Float32Array(6);a[0]=e.x,a[1]=e.y,a[2]=0,a[3]=n.x,a[4]=n.y,a[5]=0;var s=new o.MeshLine;s.setGeometry(a);var l=new r.Mesh(s.geometry,this.material);l.renderOrder=this.iRenderOrder,i.add(l);var c=this.mapIdToThreeObject.get(t);c||(c=new Array,this.mapIdToThreeObject.set(t,c)),c.push(l)},c);function c(t){this.mapIdToThreeObject=new Map,this.canvasWidth=800,this.canvasHeight=500,this.mxDatabase=null,this.material=new o.MeshLineMaterial({useMap:!1,color:new r.Color(2641557),opacity:.8,resolution:new r.Vector2(800,500),sizeAttenuation:!1,lineWidth:10,transparent:!0,depthTest:!1}),this.iRenderOrder=s.MxData.iSelectRenderOrder,this.aryPrvCommandSelect=[],this.mxDatabase=t}n.MxDbEntitySelect=l},{"../MxFun":34,"../MxManager":36,"../Operate/McGiWorldDraw":50,three:19,"three.meshline":18}],74:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbGroupDictionary=n.MxDbGroup=void 0;var r=(i.prototype.name=function(){return this.sName},i.prototype.append=function(t){this.has(t)||this.setId.add(t)},i.prototype.clear=function(){this.setId=new Set},i.prototype.getAll=function(){var t=[];return this.setId.forEach(function(e){t.push(e)}),t},i.prototype.has=function(t){return this.setId.has(t)},i.prototype.delete=function(t){return this.setId.delete(t)},i);function i(t){this.setId=new Set,this.sName="",this.sName=t}n.MxDbGroup=r;var o=(a.prototype.getAt=function(t){return this.mapNameToGroup.get(t)},a.prototype.delete=function(t){return!!this.mapNameToGroup.has(t)&&this.mapNameToGroup.delete(t)},a.prototype.add=function(t){var e=this.mapNameToGroup.get(t);return e||(e=new r(t),this.mapNameToGroup.set(t,e),e)},a.prototype.dwgOut=function(t){var e=[];return this.mapNameToGroup.forEach(function(t,n){e.push(n)}),t.groups=e,t},a.prototype.dwgIn=function(t){var e=this;return t.groups.forEach(function(t){var n=new r(t);e.mapNameToGroup.set(t,n)}),!0},a.prototype.getEntityInGroup=function(t){var e=[];return this.mapNameToGroup.forEach(function(n){n.has(t)&&e.push(n)}),e},a.prototype.getEntityInGroupName=function(t){var e=[];return this.mapNameToGroup.forEach(function(n,r){n.has(t)&&e.push(r)}),e},a);function a(){this.mapNameToGroup=new Map}n.MxDbGroupDictionary=o},{}],75:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbLayerTableRecord=void 0;var r=t("three"),i=t("../MxManager"),o=(a.prototype.getGroup=function(){return this.group},a.prototype.getName=function(){return this.name},a.prototype.setName=function(t){this.name=t},a.prototype.setVisible=function(t){this.visible=t,this.group.visible=t},a.prototype.getVisible=function(){return this.visible},a.prototype.init=function(t,e){return this.name=t,this.group.renderOrder=i.MxData.iMxEntityRenderOrder,e.add(this.group),!0},a.prototype.dwgIn=function(t){return this.visible=t.visible,this.name=t.name,this.group.visible=this.visible,!0},a.prototype.dwgOut=function(t){return t.visible=this.visible,t.name=this.name,t},a);function a(){this.group=new r.Group,this.name="",this.visible=!0}n.MxDbLayerTableRecord=o},{"../MxManager":36,three:19}],76:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MxDbTextureManager=void 0;var r=t("three"),i=(o.prototype.loadImage=function(t,e){var n=this.mapImageUrlToMaterialTexture.get(t);if(n)e(n);else{var i=this;(new r.TextureLoader).load(t,function(n){var o=new r.MeshLambertMaterial({map:n,transparent:!0,side:r.DoubleSide});o.map&&(o.map.needsUpdate=!0),i.mapImageUrlToMaterialTexture.set(t,o),e&&e(o)},void 0,function(t){console.log(t),e&&e(null)})}},o);function o(){this.mapImageUrlToMaterialTexture=new Map}n.MxDbTextureManager=i},{three:19}],77:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject3dThreeJS=n.MxDrawObject2dThreeJS=n.MxDrawMapBoxThreeJS=n.MxDrawThreeJS=n.MxThreeJSType=void 0;var o,a,s=t("three"),l=t("../Operate/MxJigCmdManager");(a=o=n.MxThreeJSType||(n.MxThreeJSType={}))[a.k2d=0]="k2d",a[a.k3d=1]="k3d",a[a.kMapBox=2]="kMapBox";var c=(u.prototype.addControlsChangeEvent=function(){var t=this.mxObject;this.mxObject.getOrbitControls().addEventListener("change",function(){l.MxJigCmdManager.OnThreeControlsChage(),t.callEvent("viewchange"),t.getMxDatabase().onViewChange(),t.getMcObject().isValid()&&t.getMcObject().getGripManager().onControlsChage();var e=t.getMxCAD();e&&e.getGrip().onControlsChage(),t.updateDisplay()})},u.prototype.updateDisplay=function(t){void 0===t&&(t=!1),this.mxObject.updateDisplayImplement(t)},u.prototype.addWindowResizeEvent=function(){},u);function u(t){this.mxObject=t}n.MxDrawThreeJS=c;var h,d=(i(p,h=c),p.prototype.onInitThreejs=function(){var t=this,e=new s.Camera,n=new s.Scene,r=this.mapBox.canvas,i=new s.DirectionalLight(16777215);i.position.set(0,-70,100).normalize(),n.add(i);var o=new s.DirectionalLight(16777215);o.position.set(0,70,100).normalize(),n.add(o);var a=new s.WebGLRenderer({canvas:r,context:this.mapBox.gl});a.autoClear=!1,this.mxObject2d.mapBoxInitThreeJSObject(n,e,a);var l=this;this.mapBox.render=function(e,n){var r=(new s.Matrix4).fromArray(n);r.multiply(t.matCADLogicalCoordToMap);var i=new s.Vector3(0,0,0);if(i.applyMatrix4(r),1<i.z){var o=1-i.z-1e-5;r=(new s.Matrix4).makeTranslation(0,0,o).multiply(r)}l.mxObject2d.mapBoxRender(e,r)}},p.prototype.alignCoordSys=function(t,e,n,r,i){var o=1;0<e.x-t.x&&0<r.x-n.x&&(o=(r.x-n.x)/(e.x-t.x));var a=new s.Matrix4;a.makeTranslation(-t.x,-t.y,-t.z);var l=(new s.Matrix4).scale(new s.Vector3(o,-o,o));return(new s.Matrix4).makeTranslation(n.x,n.y+(r.y-n.y),i).multiply(l).multiply(a)},p.prototype.updateCameraDisplayRange=function(t,e,n){var r=new s.Matrix4;r.makeTranslation(-this.mapBox.cadOrigin.x,-this.mapBox.cadOrigin.y,-this.mapBox.cadOrigin.z);var i=new s.Matrix4;i.makeTranslation(this.mapBox.mapOrigin.x,this.mapBox.mapOrigin.y,this.mapBox.elevation);var o=new s.Matrix4;o.makeScale(this.mapBox.mapLenInCADUnits,-this.mapBox.mapLenInCADUnits,this.mapBox.mapLenInCADUnits);var a=i.multiply(o).multiply(r),l=this.mxObject2d.getWorldToDoc();this.matCADLogicalCoordToMap=a.clone().multiply(l),this.mapBox.matCadToMap=a,this.mapBox.matMapToCad=new s.Matrix4,this.mapBox.matMapToCad.getInverse(a)},p.prototype.onInitScene=function(){},p.prototype.addControlsChangeEvent=function(){},p.prototype.addWindowResizeEvent=function(){},p.prototype.updateDisplay=function(t){},p.prototype.getType=function(){return o.kMapBox},p);function p(t,e){var n=h.call(this,e)||this;return n.matCADLogicalCoordToMap=new s.Matrix4,n.mapBox=t,n.mxObject2d=e,n}n.MxDrawMapBoxThreeJS=d;var f,m=(i(g,f=c),g.prototype.onInitThreejs=function(){this.proxyObj.onInitThreejs()},g.prototype.onInitScene=function(){this.proxyObj.onInitScene()},g.prototype.getType=function(){return o.k2d},g.prototype.updateCameraDisplayRange=function(t,e,n){this.proxyObj.updateCameraDisplayRangeImp(t,e,n)},g);function g(t){var e=f.call(this,t)||this;return e.proxyObj=t,e}n.MxDrawObject2dThreeJS=m;var y,v=(i(x,y=c),x.prototype.onInitThreejs=function(){this.proxyObj.onInitThreejs()},x.prototype.onInitScene=function(){this.proxyObj.onInitScene()},x.prototype.getType=function(){return o.k3d},x.prototype.updateCameraDisplayRange=function(t,e,n){},x);function x(t){var e=y.call(this,t)||this;return e.proxyObj=t,e}n.MxDrawObject3dThreeJS=v},{"../Operate/MxJigCmdManager":58,three:19}],78:[function(t,e,n){var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.McDrawGripJig=n.McDrawGrip=n.McDrawGripData=void 0;var o=t("three"),a=t("../MxFun"),s=t("../Operate/MxJig"),l=t("../Operate/MxJigCmdManager"),c=t("../MxManager"),u=t("../MxDrawData"),h=function(){this.threeObject=null};n.McDrawGripData=h;var d=(p.prototype.getParentObject=function(){return this.mxObj.getTheTempDrawContainer()},p.prototype.removeAllEntity=function(){var t=this.getParentObject();this.mapGrips.forEach(function(e,n,r){for(var i=e.length,o=0;o<i;o++){var s=e[o];a.MxFun.removeThreejsObject(s.threeObject,t)}}),this.mapGrips=new Map},p.prototype.deleteGripData=function(t){var e=this.getParentObject(),n=this.mapGrips.get(t);if(n)for(var r=n.length,i=0;i<r;i++){var o=n[i];a.MxFun.removeThreejsObject(o.threeObject,e)}this.mapGrips.delete(t)},p.prototype.addGripData=function(t,e,n,r){var i=this.mapGrips.get(t);null==i&&(i=new Array,this.mapGrips.set(t,i));var o=new h;return o.iIndex=e,o.point=this.mxObj.cadCoord2Doc(n,r,0),i.push(o),o},p.prototype.createGripDisplayObject=function(t){var e=this.getParentObject();t.geometry=new o.Geometry;var n=this.mxObj.screenCoordLong2Doc(u.MxDrawData.m_dGridWidth/2);t.geometry.vertices.push(new o.Vector3(t.point.x-n,t.point.y-n,0)),t.geometry.vertices.push(new o.Vector3(t.point.x-n,t.point.y+n,0)),t.geometry.vertices.push(new o.Vector3(t.point.x+n,t.point.y+n,0)),t.geometry.vertices.push(new o.Vector3(t.point.x+n,t.point.y-n,0)),t.geometry.faces.push(new o.Face3(0,1,2)),t.geometry.faces.push(new o.Face3(2,3,0)),t.geometry.computeFaceNormals(),t.geometry.computeVertexNormals();var r=new o.MeshBasicMaterial({color:255,transparent:!0,depthTest:!1,side:o.DoubleSide,opacity:.9}),i=new o.Mesh(t.geometry,r);i.renderOrder=c.MxData.iGripRenderOrder,e.add(i),t.threeObject=i},p.prototype.clearAll=function(){return 0!=this.mapGrips.size&&(this.removeAllEntity(),!0)},p.prototype.onControlsChage=function(){if(0!=this.mapGrips.size){var t=this.mxObj.screenCoordLong2Doc(8),e=!1;this.mapGrips.forEach(function(n,r,i){for(var o=n.length,a=0;a<o;a++){var s=n[a];4==s.geometry.vertices.length&&(s.geometry.vertices[0].x=s.point.x-t,s.geometry.vertices[0].y=s.point.y-t,s.geometry.vertices[1].x=s.point.x-t,s.geometry.vertices[1].y=s.point.y+t,s.geometry.vertices[2].x=s.point.x+t,s.geometry.vertices[2].y=s.point.y+t,s.geometry.vertices[3].x=s.point.x+t,s.geometry.vertices[3].y=s.point.y-t,s.geometry.computeFaceNormals(),s.geometry.computeVertexNormals(),s.geometry.verticesNeedUpdate=!0,e=!0)}}),e&&this.mxObj.resetRenderer()}},p.prototype.hitTest=function(t){var e={grips:new Array,ids:new Array,pt:t},n=new o.Vector3(t.x,t.y,0),r=this.mxObj.screenCoordLong2Doc(32);return this.mapGrips.forEach(function(t,i){for(var o=t.length,a=0;a<o;a++){var s=t[a];if(s.point.distanceTo(n)<=r){e.grips.push(s),e.ids.push(i);break}}}),e},p.prototype.onMouseLBDown=function(t){var e=this.hitTest(t);return 0!=e.grips.length&&(a.MxFun.sendStringToExecute("McDraw_GripEdit",e),!0)},p.prototype.gripEditImp=function(t){var e=t.grips,n=t.ids,r=t.pt,i=new m(r,e,n,this.mcObj);i.setDisableDynInput(!0),i.setDisableOsnap(!0),l.MxJigCmdManager.runCmd(i)},p.prototype.addGridDisplay=function(t){if(t&&0!=t.length)for(var e=JSON.parse(t),n=e.vecEntityData.length,r=0;r<n;r++){var i=e.vecEntityData[r],o=i.lIdIndex;this.deleteGripData(o);for(var a=i.vecGrip.length,s=0;s<a;s++){var l=i.vecGrip[s],c=this.addGripData(o,l.iIndex,l.ptx,l.pty);this.createGripDisplayObject(c)}}},p.prototype.upEntityGridDisplay=function(t){if(0==t)return!1;var e=this.mcObj.mcObjectImp.IntelliSelect_getGridData(t);return this.addGridDisplay(e),!0},p.prototype.doPointSelect=function(t){var e=this.mxObj.screenCoord2Doc(t.x,t.y,0),n=this.mxObj.docCoord2Cad(e.x,e.y,e.z),r=this.mcObj.mcObjectImp.IntelliSelect_PointSelect(n.x,n.y);return this.upEntityGridDisplay(r)},p);function p(t,e){this.mxObj=null,this.mcObj=null,this.mapGrips=new Map,this.mxObj=t,this.mcObj=e}n.McDrawGrip=d;var f,m=(i(g,f=s.McEdJigCommand),g.prototype.onExitCommand=function(t){this.mcObj.mcObjectImp.GridEdit_EndGridEdit()},g.prototype.sampler=function(){var t=l.MxJigCmdManager.InType.kGetBegan,e=this.acquirePoint(t);if(e.status==l.MxJigCmdManager.DragStatus.kNormal){this.currPt=e.pt;var n=this.mcObj.mxObject.docCoord2Cad(e.pt.x,e.pt.y,e.pt.z);this.mcObj.mcObjectImp.GridEdit_MoveGrid(n.x,n.y)}return e.status},g.prototype.getTypeName=function(){return"McDrawGripEdit"},g.prototype.done=function(t){if(t==l.MxJigCmdManager.DragStatus.kNormal)for(var e=this.mcObj.mxObject.docCoord2Cad(this.pt.x,this.pt.y,this.pt.z),n=this.mcObj.mxObject.docCoord2Cad(this.currPt.x,this.currPt.y,this.currPt.z),r=n.x-e.x,i=n.y-e.y,o=this.getMxObject().getMcObject().getGripManager(),a=this.grips.length,s=0;s<a;s++){var c=this.grips[s],u=this.ids[s];this.mcObj.mcObjectImp.GridEdit_ModifyEntity(u,r,i,c.iIndex),o.upEntityGridDisplay(u)}return l.MxJigCmdManager.DoneStatius.kExitCommand},g.prototype.upDisplay=function(){this.mcObj.mcObjectImp.GridEdit_UpdataDisplay()},g);function g(t,e,n,r){var i=f.call(this)||this;if(i.pt=t,i.grips=e,i.ids=n,i.currPt=t,i.mcObj=r,i.ids.length){var o=r.mxObject.docCoord2Cad(t.x,t.y,t.z);r.mcObjectImp.GridEdit_StartGridEdit(i.ids[0],o.x,o.y,i.grips[0].iIndex)}return i}n.McDrawGripJig=m},{"../MxDrawData":29,"../MxFun":34,"../MxManager":36,"../Operate/MxJig":57,"../Operate/MxJigCmdManager":58,three:19}],79:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.McDrawObject=void 0;var r=t("../MxManager"),i=t("three"),o=t("../MxFun"),a=t("./McDrawGrip");window.McDrawObjectEvent_openFileComplete=function(t,e){var n=r.MxManager.getMxObject(e);n&&n.getMcObject().openFileComplete()};var s=(l.prototype.isValid=function(){return null!==this.mcObjectImp},l.prototype.init=function(t,e){this.mxObject=t,this.mcObjectImp=e,this.grip=new a.McDrawGrip(t,this);var n=this;this.mxObject.addEvent("commandWillStart",function(){n.mcObjectImp.fireEventCommandStart()})},l.prototype.setSize=function(t,e){if(!this.mcObjectImp)return!1;this.mcObjectImp.fireEventWindowSize(t,e)},l.prototype.getGripManager=function(){return this.grip},l.prototype.openFileComplete=function(){if(this.mcObjectImp){var t=this.mcObjectImp.getViewDataJsonParam();t=t.replace(/\\/g,"\\\\");try{var e=JSON.parse(t),n=this.mxObject;if(null!=e){n.intiDoc2Wold(new i.Matrix4),n.initCAD2Doc(JSON.parse(e.DToSMat)),n.updateCameraDisplayRange(new i.Vector3(e.pt1x,e.pt1y,0),new i.Vector3(e.pt2x,e.pt2y,0),e.viewangle),n.initAllLayoutName(JSON.parse(e.layout)),n.updateDisplay(!0);var r=o.MxFun.getUiObj();null!=r&&(r.SetLayoutData(e.layout),r.UpDisplayLayout())}}catch(t){console.log("getViewDataJsonParam exception")}this.mxObject.callOpenFileComplete(0)}},l.prototype.updateDisplay=function(){if(!this.mcObjectImp)return!1;var t=this.mxObject.getCamera();null!==this.mxObject.getScene().background&&console.log("mxerror: background must be empty");var e=new i.Matrix4;e.multiplyMatrices(t.matrixWorldInverse,this.mxObject.getDoc2World());var n=t.projectionMatrix;return this.mcObjectImp.updateDisplay(e.elements,n.elements)},l);function l(){this.grip=null,this.mcObjectImp=null}n.McDrawObject=s},{"../MxFun":34,"../MxManager":36,"./McDrawGrip":78,three:19}]},{},[60])}function mxcadassemblyinit(){var t,e=(t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(t=t||__filename),function(e){var n,r,i;e=e||{},n||(n=void 0!==e?e:{}),n.ready=new Promise(function(t,e){r=t,i=e});var o,a,s,l,c,u,h=Object.assign({},n),d="object"==typeof window,p="function"==typeof importScripts,f="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";f?(m=p?xxxxx("path").dirname(m)+"/":__dirname+"/",u=(()=>{c||(l=xxxxx("fs"),c=xxxxx("path"))}),o=function(t,e){var n=U(t);return n?e?n:n.toString():(u(),t=c.normalize(t),l.readFileSync(t,e?void 0:"utf8"))},s=(t=>((t=o(t,!0)).buffer||(t=new Uint8Array(t)),t)),a=((t,e,n)=>{var r=U(t);r&&e(r),u(),t=c.normalize(t),l.readFile(t,function(t,r){t?n(t):e(r.buffer)})}),1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(t){throw t}),process.on("unhandledRejection",function(t){throw t}),n.inspect=function(){return"[Emscripten Module object]"}):(d||p)&&(p?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),t&&(m=t),m=0!==m.indexOf("blob:")?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",o=(t=>{try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText}catch(i){if(t=U(t)){e=[];for(var n=0;n<t.length;n++){var r=t[n];255<r&&(r&=255),e.push(String.fromCharCode(r))}return e.join("")}throw i}}),p&&(s=(t=>{try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}catch(e){if(t=U(t))return t;throw e}})),a=((t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=(()=>{if(200==r.status||0==r.status&&r.response)e(r.response);else{var i=U(t);i?e(i.buffer):n()}}),r.onerror=n,r.send(null)})),n.print||console.log.bind(console);var g,y=n.printErr||console.warn.bind(console);Object.assign(n,h),h=null,n.wasmBinary&&(g=n.wasmBinary),n.noExitRuntime;var v=Error,x={};g=[],"object"!=typeof x&&k("no native wasm support detected");var b,w,M,_,C,S=!1,T=n.INITIAL_MEMORY||16777216;(b=n.wasmMemory?n.wasmMemory:new function(){this.buffer=new ArrayBuffer(T/65536*65536)})&&(w=b.buffer),T=w.byteLength;var E=w;w=E,n.HEAP8=M=new Int8Array(E),n.HEAP16=new Int16Array(E),n.HEAP32=C=new Int32Array(E),n.HEAPU8=_=new Uint8Array(E),n.HEAPU16=new Uint16Array(E),n.HEAPU32=new Uint32Array(E),n.HEAPF32=new Float32Array(E),n.HEAPF64=new Float64Array(E);var D,A=[],O=[],P=[];function L(){var t=n.preRun.shift();A.unshift(t)}var R=0,I=null;function k(t){throw n.onAbort&&n.onAbort(t),y(t="Aborted("+t+")"),S=!0,t=new v(t+". Build with -s ASSERTIONS=1 for more info."),i(t),t}n.preloadedImages={},n.preloadedAudios={};var F,B="data:application/octet-stream;base64,";if(!(F="mxcadassembly_min.wasm").startsWith(B)){var j=F;F=n.locateFile?n.locateFile(j,m):m+j}function N(){var t=F;try{if(t==F&&g)return new Uint8Array(g);var e=U(t);if(e)return e;if(s)return s(t);throw"both async and sync fetching of the wasm failed"}catch(t){k(t)}}function z(t){for(;0<t.length;){var e=t.shift();if("function"==typeof e)e(n);else{var r=e.U;"number"==typeof r?void 0===e.G?G(r)():G(r)(e.G):r(void 0===e.G?null:e.G)}}}var V=[];function G(t){var e=V[t];return e||(t>=V.length&&(V.length=t+1),V[t]=e=D.get(t)),e}var H="function"==typeof atob?atob:function(t){var e="",n=0;t=t.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(t.charAt(n++)),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(t.charAt(n++)),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(t.charAt(n++)),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(t.charAt(n++));r=r<<2|i>>4,i=(15&i)<<4|o>>2;var s=(3&o)<<6|a;e+=String.fromCharCode(r),64!==o&&(e+=String.fromCharCode(i)),64!==a&&(e+=String.fromCharCode(s))}while(n<t.length);return e};function U(t){if(t.startsWith(B)){if(t=t.slice(B.length),"boolean"==typeof f&&f){var e=Buffer.from(t,"base64");e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}else try{var n=H(t),r=new Uint8Array(n.length);for(t=0;t<n.length;++t)r[t]=n.charCodeAt(t);e=r}catch(t){throw Error("Converting base64 string to bytes failed.")}return e}}var W={f:function(t){return dt(t+16)+16},e:function(t,e,n){throw new function(t){this.C=t-16,this.P=function(t){C[this.C+4>>2]=t},this.M=function(t){C[this.C+8>>2]=t},this.N=function(){C[this.C>>2]=0},this.L=function(){M[this.C+12>>0]=0},this.O=function(){M[this.C+13>>0]=0},this.K=function(t,e){this.P(t),this.M(e),this.N(),this.L(),this.O()}}(t).K(e,n),t},c:function(){k("")},d:function(t,e,n){_.copyWithin(t,e,e+n)},b:function(){k("OOM")},a:b};!function(){function t(t){n.asm=t.exports,D=n.asm.A,O.unshift(n.asm.g),R--,n.monitorRunDependencies&&n.monitorRunDependencies(R),0==R&&I&&(t=I,I=null,t())}function e(e){t(e.instance)}function r(t){return function(){if(!g&&(d||p)){if("function"==typeof fetch&&!F.startsWith("file://"))return fetch(F,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw"failed to load wasm binary file at '"+F+"'";return t.arrayBuffer()}).catch(function(){return N()});if(a)return new Promise(function(t,e){a(F,function(e){t(new Uint8Array(e))},e)})}return Promise.resolve().then(function(){return N()})}().then(function(){return{then:function(t){t({instance:new function(){this.exports=function(t){for(var e,n=new Uint8Array(123),r=25;r>=0;--r)n[48+r]=52+r,n[65+r]=r,n[97+r]=26+r;function i(t,e,r){for(var i,o,a=0,s=e,l=r.length,c=e+(3*l>>2)-("="==r[l-2])-("="==r[l-1]);a<l;a+=4)i=n[r.charCodeAt(a+1)],o=n[r.charCodeAt(a+2)],t[s++]=n[r.charCodeAt(a)]<<2|i>>4,s<c&&(t[s++]=i<<4|o>>2),s<c&&(t[s++]=o<<6|n[r.charCodeAt(a+3)])}return n[43]=62,n[47]=63,function(t){var n=t.a.buffer,r=new Int8Array(n),o=new Int16Array(n),a=new Int32Array(n),s=new Uint8Array(n),l=new Uint32Array(n),c=new Float64Array(n),u=Math.imul,h=t.abort,d=t.b,p=t.c,f=t.d,m=t.e,g=t.f,y=5245008;function v(t){var e,n=0,r=0,i=0,o=0,c=0,u=0,h=0,d=0,p=0,f=0;y=e=y-16|0;t:{e:{n:{r:{i:{o:{a:{s:{l:{c:{u:{if((t|=0)>>>0<=244){if(3&(n=(o=a[404])>>>(r=(u=t>>>0<11?16:t+11&-8)>>>3|0)|0)){t=(c=a[1664+(n=(i=r+(1&(-1^n))|0)<<3)>>2])+8|0,(0|(r=a[c+8>>2]))!=(0|(n=n+1656|0))?(a[r+12>>2]=n,a[n+8>>2]=r):a[404]=A(i)&o,n=i<<3,a[c+4>>2]=3|n,a[4+(n=n+c|0)>>2]=1|a[n+4>>2];break t}if((f=a[406])>>>0>=u>>>0)break u;if(n){r=t=(n=(0-(t=(0-(t=2<<r)|t)&n<<r)&t)-1|0)>>>12&16,r|=t=(n=n>>>t|0)>>>5&8,r|=t=(n=n>>>t|0)>>>2&4,p=a[1664+(t=(r=((r|=t=(n=n>>>t|0)>>>1&2)|(t=(n=n>>>t|0)>>>1&1))+(n>>>t|0)|0)<<3)>>2],(0|(n=a[p+8>>2]))!=(0|(t=t+1656|0))?(a[n+12>>2]=t,a[t+8>>2]=n):(o=A(r)&o,a[404]=o),t=p+8|0,a[p+4>>2]=3|u,c=(n=r<<3)-u|0,a[4+(i=u+p|0)>>2]=1|c,a[n+p>>2]=c,f&&(r=1656+((n=f>>>3|0)<<3)|0,p=a[409],(n=1<<n)&o?n=a[r+8>>2]:(a[404]=n|o,n=r),a[r+8>>2]=p,a[n+12>>2]=p,a[p+12>>2]=r,a[p+8>>2]=n),a[409]=i,a[406]=c;break t}if(!(h=a[405]))break u;for(r=t=(n=(0-h&h)-1|0)>>>12&16,r|=t=(n=n>>>t|0)>>>5&8,r|=t=(n=n>>>t|0)>>>2&4,n=a[1920+(((r|=t=(n=n>>>t|0)>>>1&2)|(t=(n=n>>>t|0)>>>1&1))+(n>>>t|0)<<2)>>2],i=(-8&a[n+4>>2])-u|0,r=n;(t=a[r+16>>2])||(t=a[r+20>>2]);)i=(c=(r=(-8&a[t+4>>2])-u|0)>>>0<i>>>0)?r:i,n=c?t:n,r=t;if(d=a[n+24>>2],(0|(c=a[n+12>>2]))!=(0|n)){t=a[n+8>>2],a[t+12>>2]=c,a[c+8>>2]=t;break e}if(!(t=a[(r=n+20|0)>>2])){if(!(t=a[n+16>>2]))break c;r=n+16|0}for(;p=r,c=t,(t=a[(r=t+20|0)>>2])||(r=c+16|0,t=a[c+16>>2]););a[p>>2]=0;break e}if(u=-1,!(t>>>0>4294967231)&&(u=-8&(t=t+11|0),d=a[405])){i=0-u|0,o=0,u>>>0<256||(o=31,u>>>0>16777215||(t=t>>>8|0,t<<=p=t+1048320>>>16&8,o=28+((t=((t<<=r=t+520192>>>16&4)<<(n=t+245760>>>16&2)>>>15|0)-(n|r|p)|0)<<1|u>>>t+21&1)|0));h:{d:{if(r=a[1920+(o<<2)>>2])for(t=0,n=u<<(31==(0|o)?0:25-(o>>>1|0)|0);;){if(!((p=(h=-8&a[r+4>>2])-u|0)>>>0>=i>>>0)&&(i=p,c=r,(0|u)==(0|h))){i=0,t=r;break d}if(p=a[r+20>>2],r=a[16+((n>>>29&4)+r|0)>>2],t=p?(0|p)==(0|r)?t:p:t,n<<=1,!r)break}else t=0;if(!(t|c)){if(c=0,!(t=(0-(t=2<<o)|t)&d))break u;r=t=(n=(t&0-t)-1|0)>>>12&16,r|=t=(n=n>>>t|0)>>>5&8,r|=t=(n=n>>>t|0)>>>2&4,t=a[1920+(((r|=t=(n=n>>>t|0)>>>1&2)|(t=(n=n>>>t|0)>>>1&1))+(n>>>t|0)<<2)>>2]}if(!t)break h}for(;i=(r=(n=(-8&a[t+4>>2])-u|0)>>>0<i>>>0)?n:i,c=r?t:c,t=(n=a[t+16>>2])||a[t+20>>2];);}if(!(!c|a[406]-u>>>0<=i>>>0)){if(o=a[c+24>>2],(0|c)!=(0|(n=a[c+12>>2]))){t=a[c+8>>2],a[t+12>>2]=n,a[n+8>>2]=t;break n}if(!(t=a[(r=c+20|0)>>2])){if(!(t=a[c+16>>2]))break l;r=c+16|0}for(;p=r,n=t,(t=a[(r=t+20|0)>>2])||(r=n+16|0,t=a[n+16>>2]););a[p>>2]=0;break n}}}if((r=a[406])>>>0>=u>>>0){i=a[409],(n=r-u|0)>>>0>=16?(a[406]=n,t=i+u|0,a[409]=t,a[t+4>>2]=1|n,a[r+i>>2]=n,a[i+4>>2]=3|u):(a[409]=0,a[406]=0,a[i+4>>2]=3|r,a[4+(t=r+i|0)>>2]=1|a[t+4>>2]),t=i+8|0;break t}if((d=a[407])>>>0>u>>>0){n=d-u|0,a[407]=n,t=(r=a[410])+u|0,a[410]=t,a[t+4>>2]=1|n,a[r+4>>2]=3|u,t=r+8|0;break t}if(t=0,h=u+47|0,a[522]?r=a[524]:(a[525]=-1,a[526]=-1,a[523]=4096,a[524]=4096,a[522]=e+12&-16^1431655768,a[527]=0,a[515]=0,r=4096),(r=(p=h+r|0)&(c=0-r|0))>>>0<=u>>>0)break t;if((i=a[514])&&(o=(n=a[512])+r|0)>>>0>i>>>0|n>>>0>=o>>>0)break t;if(4&s[2060])break o;u:{h:{if(i=a[410])for(t=2064;;){if((n=a[t>>2])>>>0<=i>>>0&i>>>0<n+a[t+4>>2]>>>0)break h;if(!(t=a[t+8>>2]))break}if(-1==(0|(n=T(0))))break a;if(o=r,(t=(i=a[523])-1|0)&n&&(o=(r-n|0)+(t+n&0-i)|0),o>>>0<=u>>>0|o>>>0>2147483646)break a;if((i=a[514])&&i>>>0<(c=(t=a[512])+o|0)>>>0|t>>>0>=c>>>0)break a;if((0|n)!=(0|(t=T(o))))break u;break i}if((o=c&p-d)>>>0>2147483646)break a;if((0|(n=T(o)))==(a[t>>2]+a[t+4>>2]|0))break s;t=n}if(!(-1==(0|t)|u+48>>>0<=o>>>0)){if((n=(n=a[524])+(h-o|0)&0-n)>>>0>2147483646){n=t;break i}if(-1!=(0|T(n))){o=n+o|0,n=t;break i}T(0-o|0);break a}if(n=t,-1!=(0|t))break i;break a}c=0;break e}n=0;break n}if(-1!=(0|n))break i}a[515]=4|a[515]}if(r>>>0>2147483646)break r;if(-1==(0|(n=T(r)))|-1==(0|(t=T(0)))|t>>>0<=n>>>0)break r;if((o=t-n|0)>>>0<=u+40>>>0)break r}t=a[512]+o|0,a[512]=t,t>>>0>l[513]&&(a[513]=t);i:{o:{a:{if(h=a[410]){for(t=2064;;){if(((i=a[t>>2])+(r=a[t+4>>2])|0)==(0|n))break a;if(!(t=a[t+8>>2]))break}break o}for((t=a[408])>>>0<=n>>>0&&t||(a[408]=n),t=0,a[517]=o,a[516]=n,a[412]=-1,a[413]=a[522],a[519]=0;r=1656+(i=t<<3)|0,a[i+1664>>2]=r,a[i+1668>>2]=r,32!=(0|(t=t+1|0)););r=(i=o-40|0)-(t=n+8&7?-8-n&7:0)|0,a[407]=r,t=t+n|0,a[410]=t,a[t+4>>2]=1|r,a[4+(n+i|0)>>2]=40,a[411]=a[526];break i}if(!(8&s[t+12|0]|i>>>0>h>>>0|n>>>0<=h>>>0)){a[t+4>>2]=r+o,r=(t=h+8&7?-8-h&7:0)+h|0,a[410]=r,t=(n=a[407]+o|0)-t|0,a[407]=t,a[r+4>>2]=1|t,a[4+(n+h|0)>>2]=40,a[411]=a[526];break i}}l[408]>n>>>0&&(a[408]=n),r=n+o|0,t=2064;o:{a:{s:{l:{c:{u:{for(;;){if((0|r)!=a[t>>2]){if(t=a[t+8>>2])continue;break u}break}if(!(8&s[t+12|0]))break c}for(t=2064;;){if((r=a[t>>2])>>>0<=h>>>0&&(c=r+a[t+4>>2]|0)>>>0>h>>>0)break l;t=a[t+8>>2]}}if(a[t>>2]=n,a[t+4>>2]=a[t+4>>2]+o,a[4+(p=(n+8&7?-8-n&7:0)+n|0)>>2]=3|u,u=(o=r+(r+8&7?-8-r&7:0)|0)-(d=u+p|0)|0,(0|o)==(0|h)){a[410]=d,t=a[407]+u|0,a[407]=t,a[d+4>>2]=1|t;break a}if(a[409]==(0|o)){a[409]=d,t=a[406]+u|0,a[406]=t,a[d+4>>2]=1|t,a[t+d>>2]=t;break a}if(1==(3&(t=a[o+4>>2]))){c=-8&t;c:if(t>>>0<=255){if(r=a[o+8>>2],t=t>>>3|0,(0|(n=a[o+12>>2]))==(0|r)){a[404]=a[404]&A(t);break c}a[r+12>>2]=n,a[n+8>>2]=r}else{if(h=a[o+24>>2],(0|o)==(0|(n=a[o+12>>2])))if((i=a[(t=o+20|0)>>2])||(i=a[(t=o+16|0)>>2])){for(;r=t,(i=a[(t=(n=i)+20|0)>>2])||(t=n+16|0,i=a[n+16>>2]););a[r>>2]=0}else n=0;else t=a[o+8>>2],a[t+12>>2]=n,a[n+8>>2]=t;if(h){r=a[o+28>>2];u:{if(a[(t=1920+(r<<2)|0)>>2]==(0|o)){if(a[t>>2]=n,n)break u;a[405]=a[405]&A(r);break c}if(a[h+(a[h+16>>2]==(0|o)?16:20)>>2]=n,!n)break c}a[n+24>>2]=h,(t=a[o+16>>2])&&(a[n+16>>2]=t,a[t+24>>2]=n),(t=a[o+20>>2])&&(a[n+20>>2]=t,a[t+24>>2]=n)}}u=c+u|0,o=o+c|0}if(a[o+4>>2]=-2&a[o+4>>2],a[d+4>>2]=1|u,a[u+d>>2]=u,u>>>0<=255){n=1656+((t=u>>>3|0)<<3)|0,(r=a[404])&(t=1<<t)?t=a[n+8>>2]:(a[404]=t|r,t=n),a[n+8>>2]=d,a[t+12>>2]=d,a[d+12>>2]=n,a[d+8>>2]=t;break a}if(t=31,u>>>0<=16777215&&(t=u>>>8|0,t<<=i=t+1048320>>>16&8,t=28+((t=((t<<=r=t+520192>>>16&4)<<(n=t+245760>>>16&2)>>>15|0)-(n|r|i)|0)<<1|u>>>t+21&1)|0),a[d+28>>2]=t,a[d+16>>2]=0,a[d+20>>2]=0,i=1920+(t<<2)|0,(r=a[405])&(n=1<<t)){for(t=u<<(31==(0|t)?0:25-(t>>>1|0)|0),n=a[i>>2];;){if(r=n,(-8&a[n+4>>2])==(0|u))break s;if(n=t>>>29|0,t<<=1,!(n=a[16+(i=r+(4&n)|0)>>2]))break}a[i+16>>2]=d,a[d+24>>2]=r}else a[405]=n|r,a[i>>2]=d,a[d+24>>2]=i;a[d+12>>2]=d,a[d+8>>2]=d;break a}for(r=(i=o-40|0)-(t=n+8&7?-8-n&7:0)|0,a[407]=r,t=t+n|0,a[410]=t,a[t+4>>2]=1|r,a[4+(n+i|0)>>2]=40,a[411]=a[526],a[(r=(t=(c+(c-39&7?39-c&7:0)|0)-47|0)>>>0<h+16>>>0?h:t)+4>>2]=27,t=a[519],a[r+16>>2]=a[518],a[r+20>>2]=t,t=a[517],a[r+8>>2]=a[516],a[r+12>>2]=t,a[518]=r+8,a[517]=o,a[516]=n,a[519]=0,t=r+24|0;a[t+4>>2]=7,n=t+8|0,t=t+4|0,n>>>0<c>>>0;);if((0|r)==(0|h))break i;if(a[r+4>>2]=-2&a[r+4>>2],c=r-h|0,a[h+4>>2]=1|c,a[r>>2]=c,c>>>0<=255){n=1656+((t=c>>>3|0)<<3)|0,(r=a[404])&(t=1<<t)?t=a[n+8>>2]:(a[404]=t|r,t=n),a[n+8>>2]=h,a[t+12>>2]=h,a[h+12>>2]=n,a[h+8>>2]=t;break i}if(t=31,a[h+16>>2]=0,a[h+20>>2]=0,c>>>0<=16777215&&(t=c>>>8|0,t<<=i=t+1048320>>>16&8,t=28+((t=((t<<=r=t+520192>>>16&4)<<(n=t+245760>>>16&2)>>>15|0)-(n|r|i)|0)<<1|c>>>t+21&1)|0),a[h+28>>2]=t,i=1920+(t<<2)|0,(r=a[405])&(n=1<<t)){for(t=c<<(31==(0|t)?0:25-(t>>>1|0)|0),n=a[i>>2];;){if(r=n,(0|c)==(-8&a[n+4>>2]))break o;if(n=t>>>29|0,t<<=1,!(n=a[16+(i=r+(4&n)|0)>>2]))break}a[i+16>>2]=h,a[h+24>>2]=r}else a[405]=n|r,a[i>>2]=h,a[h+24>>2]=i;a[h+12>>2]=h,a[h+8>>2]=h;break i}t=a[r+8>>2],a[t+12>>2]=d,a[r+8>>2]=d,a[d+24>>2]=0,a[d+12>>2]=r,a[d+8>>2]=t}t=p+8|0;break t}t=a[r+8>>2],a[t+12>>2]=h,a[r+8>>2]=h,a[h+24>>2]=0,a[h+12>>2]=r,a[h+8>>2]=t}if(!((t=a[407])>>>0<=u>>>0)){n=t-u|0,a[407]=n,t=(r=a[410])+u|0,a[410]=t,a[t+4>>2]=1|n,a[r+4>>2]=3|u,t=r+8|0;break t}}a[403]=48,t=0;break t}n:if(o){r=a[c+28>>2];r:{if(a[(t=1920+(r<<2)|0)>>2]==(0|c)){if(a[t>>2]=n,n)break r;d=A(r)&d,a[405]=d;break n}if(a[o+(a[o+16>>2]==(0|c)?16:20)>>2]=n,!n)break n}a[n+24>>2]=o,(t=a[c+16>>2])&&(a[n+16>>2]=t,a[t+24>>2]=n),(t=a[c+20>>2])&&(a[n+20>>2]=t,a[t+24>>2]=n)}n:if(i>>>0<=15)t=i+u|0,a[c+4>>2]=3|t,a[4+(t=t+c|0)>>2]=1|a[t+4>>2];else if(a[c+4>>2]=3|u,a[4+(o=c+u|0)>>2]=1|i,a[o+i>>2]=i,i>>>0<=255)n=1656+((t=i>>>3|0)<<3)|0,(r=a[404])&(t=1<<t)?t=a[n+8>>2]:(a[404]=t|r,t=n),a[n+8>>2]=o,a[t+12>>2]=o,a[o+12>>2]=n,a[o+8>>2]=t;else{t=31,i>>>0<=16777215&&(t=i>>>8|0,t<<=p=t+1048320>>>16&8,t=28+((t=((t<<=r=t+520192>>>16&4)<<(n=t+245760>>>16&2)>>>15|0)-(n|r|p)|0)<<1|i>>>t+21&1)|0),a[o+28>>2]=t,a[o+16>>2]=0,a[o+20>>2]=0,n=1920+(t<<2)|0;r:{if((r=1<<t)&d){for(t=i<<(31==(0|t)?0:25-(t>>>1|0)|0),r=a[n>>2];;){if((-8&a[(n=r)+4>>2])==(0|i))break r;if(r=t>>>29|0,t<<=1,!(r=a[16+(p=(4&r)+n|0)>>2]))break}a[p+16>>2]=o}else a[405]=r|d,a[n>>2]=o;a[o+24>>2]=n,a[o+12>>2]=o,a[o+8>>2]=o;break n}t=a[n+8>>2],a[t+12>>2]=o,a[n+8>>2]=o,a[o+24>>2]=0,a[o+12>>2]=n,a[o+8>>2]=t}t=c+8|0;break t}e:if(d){r=a[n+28>>2];n:{if(a[(t=1920+(r<<2)|0)>>2]==(0|n)){if(a[t>>2]=c,c)break n;a[405]=A(r)&h;break e}if(a[d+(a[d+16>>2]==(0|n)?16:20)>>2]=c,!c)break e}a[c+24>>2]=d,(t=a[n+16>>2])&&(a[c+16>>2]=t,a[t+24>>2]=c),(t=a[n+20>>2])&&(a[c+20>>2]=t,a[t+24>>2]=c)}i>>>0<=15?(t=i+u|0,a[n+4>>2]=3|t,a[4+(t=t+n|0)>>2]=1|a[t+4>>2]):(a[n+4>>2]=3|u,a[4+(c=n+u|0)>>2]=1|i,a[i+c>>2]=i,f&&(r=1656+((t=f>>>3|0)<<3)|0,p=a[409],(t=1<<t)&o?t=a[r+8>>2]:(a[404]=t|o,t=r),a[r+8>>2]=p,a[t+12>>2]=p,a[p+12>>2]=r,a[p+8>>2]=t),a[409]=c,a[406]=i),t=n+8|0}return y=e+16|0,0|t}function x(t){var e=0,n=0,r=0,i=0,o=0,s=0,c=0;t:if(t){o=(r=t-8|0)+(t=-8&(e=a[t-4>>2]))|0;e:if(!(1&e)){if(!(3&e))break t;if((r=r-(e=a[r>>2])|0)>>>0<l[408])break t;if(t=t+e|0,a[409]==(0|r)){if(3==(3&(e=a[o+4>>2])))return a[406]=t,a[o+4>>2]=-2&e,a[r+4>>2]=1|t,void(a[t+r>>2]=t)}else{if(e>>>0<=255){if(i=a[r+8>>2],e=e>>>3|0,(0|(n=a[r+12>>2]))==(0|i)){a[404]=a[404]&A(e);break e}a[i+12>>2]=n,a[n+8>>2]=i;break e}if(c=a[r+24>>2],(0|r)==(0|(e=a[r+12>>2])))if((n=a[(i=r+20|0)>>2])||(n=a[(i=r+16|0)>>2])){for(;s=i,(n=a[(i=(e=n)+20|0)>>2])||(i=e+16|0,n=a[e+16>>2]););a[s>>2]=0}else e=0;else n=a[r+8>>2],a[n+12>>2]=e,a[e+8>>2]=n;if(!c)break e;i=a[r+28>>2];n:{if(a[(n=1920+(i<<2)|0)>>2]==(0|r)){if(a[n>>2]=e,e)break n;a[405]=a[405]&A(i);break e}if(a[c+(a[c+16>>2]==(0|r)?16:20)>>2]=e,!e)break e}if(a[e+24>>2]=c,(n=a[r+16>>2])&&(a[e+16>>2]=n,a[n+24>>2]=e),!(n=a[r+20>>2]))break e;a[e+20>>2]=n,a[n+24>>2]=e}}if(!(r>>>0>=o>>>0)&&1&(e=a[o+4>>2])){e:{if(!(2&e)){if(a[410]==(0|o)){if(a[410]=r,t=a[407]+t|0,a[407]=t,a[r+4>>2]=1|t,a[409]!=(0|r))break t;return a[406]=0,void(a[409]=0)}if(a[409]==(0|o))return a[409]=r,t=a[406]+t|0,a[406]=t,a[r+4>>2]=1|t,void(a[t+r>>2]=t);t=(-8&e)+t|0;n:if(e>>>0<=255){if(i=a[o+8>>2],e=e>>>3|0,(0|(n=a[o+12>>2]))==(0|i)){a[404]=a[404]&A(e);break n}a[i+12>>2]=n,a[n+8>>2]=i}else{if(c=a[o+24>>2],(0|o)==(0|(e=a[o+12>>2])))if((n=a[(i=o+20|0)>>2])||(n=a[(i=o+16|0)>>2])){for(;s=i,(n=a[(i=(e=n)+20|0)>>2])||(i=e+16|0,n=a[e+16>>2]););a[s>>2]=0}else e=0;else n=a[o+8>>2],a[n+12>>2]=e,a[e+8>>2]=n;if(c){i=a[o+28>>2];r:{if(a[(n=1920+(i<<2)|0)>>2]==(0|o)){if(a[n>>2]=e,e)break r;a[405]=a[405]&A(i);break n}if(a[c+(a[c+16>>2]==(0|o)?16:20)>>2]=e,!e)break n}a[e+24>>2]=c,(n=a[o+16>>2])&&(a[e+16>>2]=n,a[n+24>>2]=e),(n=a[o+20>>2])&&(a[e+20>>2]=n,a[n+24>>2]=e)}}if(a[r+4>>2]=1|t,a[t+r>>2]=t,a[409]!=(0|r))break e;return void(a[406]=t)}a[o+4>>2]=-2&e,a[r+4>>2]=1|t,a[t+r>>2]=t}if(t>>>0<=255)return e=1656+((t=t>>>3|0)<<3)|0,(n=a[404])&(t=1<<t)?t=a[e+8>>2]:(a[404]=t|n,t=e),a[e+8>>2]=r,a[t+12>>2]=r,a[r+12>>2]=e,void(a[r+8>>2]=t);i=31,a[r+16>>2]=0,a[r+20>>2]=0,t>>>0<=16777215&&(e=t>>>8|0,e<<=s=e+1048320>>>16&8,i=28+((e=((e<<=i=e+520192>>>16&4)<<(n=e+245760>>>16&2)>>>15|0)-(n|i|s)|0)<<1|t>>>e+21&1)|0),a[r+28>>2]=i,s=1920+(i<<2)|0;e:{n:{if((n=a[405])&(e=1<<i)){for(i=t<<(31==(0|i)?0:25-(i>>>1|0)|0),e=a[s>>2];;){if(n=e,(-8&a[e+4>>2])==(0|t))break n;if(e=i>>>29|0,i<<=1,!(e=a[16+(s=n+(4&e)|0)>>2]))break}a[s+16>>2]=r,a[r+24>>2]=n}else a[405]=e|n,a[s>>2]=r,a[r+24>>2]=s;a[r+12>>2]=r,a[r+8>>2]=r;break e}t=a[n+8>>2],a[t+12>>2]=r,a[n+8>>2]=r,a[r+24>>2]=0,a[r+12>>2]=n,a[r+8>>2]=t}t=a[412]-1|0,a[412]=t||-1}}}function b(t,e,n){var i,o=0,l=0;if(n>>>0>=512)return f(0|t,0|e,0|n),t;i=t+n|0;t:if(3&(t^e))if(i>>>0<4)n=t;else if((o=i-4|0)>>>0<t>>>0)n=t;else for(n=t;r[0|n]=s[0|e],r[n+1|0]=s[e+1|0],r[n+2|0]=s[e+2|0],r[n+3|0]=s[e+3|0],e=e+4|0,o>>>0>=(n=n+4|0)>>>0;);else{e:if(3&t)if(n)for(n=t;;){if(r[0|n]=s[0|e],e=e+1|0,!(3&(n=n+1|0)))break e;if(!(n>>>0<i>>>0))break}else n=t;else n=t;if(!((o=-4&i)>>>0<64||(l=o+-64|0)>>>0<n>>>0))for(;a[n>>2]=a[e>>2],a[n+4>>2]=a[e+4>>2],a[n+8>>2]=a[e+8>>2],a[n+12>>2]=a[e+12>>2],a[n+16>>2]=a[e+16>>2],a[n+20>>2]=a[e+20>>2],a[n+24>>2]=a[e+24>>2],a[n+28>>2]=a[e+28>>2],a[n+32>>2]=a[e+32>>2],a[n+36>>2]=a[e+36>>2],a[n+40>>2]=a[e+40>>2],a[n+44>>2]=a[e+44>>2],a[n+48>>2]=a[e+48>>2],a[n+52>>2]=a[e+52>>2],a[n+56>>2]=a[e+56>>2],a[n+60>>2]=a[e+60>>2],e=e- -64|0,l>>>0>=(n=n- -64|0)>>>0;);if(n>>>0>=o>>>0)break t;for(;a[n>>2]=a[e>>2],e=e+4|0,o>>>0>(n=n+4|0)>>>0;);}if(n>>>0<i>>>0)for(;r[0|n]=s[0|e],e=e+1|0,(0|i)!=(0|(n=n+1|0)););return t}function w(t,e){var n=0;if(e&&(r[0|t]=0,r[(n=t+e|0)-1|0]=0,!(e>>>0<3||(r[t+2|0]=0,r[t+1|0]=0,r[n-3|0]=0,r[n-2|0]=0,e>>>0<7||(r[t+3|0]=0,r[n-4|0]=0,e>>>0<9||(a[(t=(n=0-t&3)+t|0)>>2]=0,a[(e=(n=e-n&-4)+t|0)-4>>2]=0,n>>>0<9||(a[t+8>>2]=0,a[t+4>>2]=0,a[e-8>>2]=0,a[e-12>>2]=0,n>>>0<25||(a[t+24>>2]=0,a[t+20>>2]=0,a[t+16>>2]=0,a[t+12>>2]=0,a[e-16>>2]=0,a[e-20>>2]=0,a[e-24>>2]=0,a[e-28>>2]=0,(e=(e=n)-(n=4&t|24)|0)>>>0<32))))))))for(t=t+n|0;a[t+24>>2]=0,a[t+28>>2]=0,a[t+16>>2]=0,a[t+20>>2]=0,a[t+8>>2]=0,a[t+12>>2]=0,a[t>>2]=0,a[t+4>>2]=0,t=t+32|0,(e=e-32|0)>>>0>31;);}function M(t){var e,n=0,r=0,i=0;e=0|g(8),a[e>>2]=1348,a[e>>2]=1392;t:{e:{if(3&(n=t))for(;;){if(!s[0|n])break e;if(!(3&(n=n+1|0)))break}for(;r=n,n=n+4|0,!((-1^(i=a[r>>2]))&i-16843009&-2139062144););if(n=r-t|0,!(255&i))break t;for(;i=s[r+1|0],r=n=r+1|0,i;);}n=n-t|0}r=E(n+13|0),a[r+8>>2]=0,a[r+4>>2]=n,a[r>>2]=n,a[e+4>>2]=b(r+12|0,t,n+1|0),a[e>>2]=1440,m(0|e,1472,1),h()}function _(t,e,n,i){r[t+53|0]=1;t:if(a[t+4>>2]==(0|n)){r[t+52|0]=1;e:{if(!(n=a[t+16>>2])){if(a[t+36>>2]=1,a[t+24>>2]=i,a[t+16>>2]=e,1!=(0|i))break t;if(1==a[t+48>>2])break e;break t}if((0|e)==(0|n)){if(2==(0|(n=a[t+24>>2]))&&(a[t+24>>2]=i,n=i),1!=a[t+48>>2])break t;if(1==(0|n))break e;break t}a[t+36>>2]=a[t+36>>2]+1}r[t+54|0]=1}}function C(t,e,n){var r=0;if(!n)return a[t+4>>2]==a[e+4>>2];if((0|t)==(0|e))return 1;r=a[t+4>>2],t=s[0|r],n=a[e+4>>2];t:if(!(!t|(0|(e=s[0|n]))!=(0|t)))for(;;){if(e=s[n+1|0],!(t=s[r+1|0]))break t;if(n=n+1|0,r=r+1|0,(0|t)!=(0|e))break}return(0|t)==(0|e)}function S(t,e,n){var i;if(!(i=a[t+16>>2]))return a[t+36>>2]=1,a[t+24>>2]=n,void(a[t+16>>2]=e);t:{if((0|e)==(0|i)){if(2!=a[t+24>>2])break t;return void(a[t+24>>2]=n)}r[t+54|0]=1,a[t+24>>2]=2,a[t+36>>2]=a[t+36>>2]+1}}function T(t){var e,r;return(t=(e=a[377])+(r=t+3&-4)|0)>>>0<=e>>>0&&r||t>>>0>(n.byteLength/65536|0)<<16>>>0&&!(0|d(0|t))?(a[403]=48,-1):(a[377]=t,e)}function E(t){var e=0;t=t||1;t:{for(;;){if(e=v(t))break t;if(!(e=a[528]))break;k[0|e]()}p(),h()}return e}function D(t){var e,n;return a[(t|=0)>>2]=1392,e=a[t+4>>2]-12|0,n=a[e+8>>2]-1|0,a[e+8>>2]=n,(0|n)<0&&x(e),0|t}function A(t){var e;return(-1>>>(e=31&t)&-2)<<e|(-1<<(t=0-t&31)&-2)>>>t}function O(t){(t|=0)&&x(t)}function P(t){D(t|=0),x(t)}function L(t){return 0|t}function R(t){x(t|=0)}function I(t){}i(e=s,1024,"dmVjdG9yAHN0ZDo6ZXhjZXB0aW9uAGFsbG9jYXRvcjxUPjo6YWxsb2NhdGUoc2l6ZV90IG4pICduJyBleGNlZWRzIG1heGltdW0gc3VwcG9ydGVkIHNpemUATjEwX19jeHhhYml2MTE2X19zaGltX3R5cGVfaW5mb0UAAOgEAABaBAAA3AUAAE4xMF9fY3h4YWJpdjExN19fY2xhc3NfdHlwZV9pbmZvRQAAAOgEAACIBAAAfAQAAAAAAACsBAAAAgAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAAAAAAMAUAAAIAAAAKAAAABAAAAAUAAAAGAAAACwAAAAwAAAANAAAATjEwX19jeHhhYml2MTIwX19zaV9jbGFzc190eXBlX2luZm9FAAAAAOgEAAAIBQAArAQAAAAAAABgBQAADgAAAA8AAAAQAAAAU3Q5ZXhjZXB0aW9uAAAAAMAEAABQBQAAAAAAAIwFAAABAAAAEQAAABIAAABTdDExbG9naWNfZXJyb3IA6AQAAHwFAABgBQAAAAAAAMAFAAABAAAAEwAAABIAAABTdDEybGVuZ3RoX2Vycm9yAAAAAOgEAACsBQAAjAUAAFN0OXR5cGVfaW5mbwAAAADABAAAzAU="),i(e,1508,"UAhQ");var k=function(t){return t.grow=function(t){var e=this.length;return this.length=this.length+t,e},t.set=function(t,e){this[t]=e},t.get=function(t){return this[t]},t}([null,D,L,R,I,I,function(t,e,n){n|=0;var r,i=0,o=0,s=0,l=0;if(y=r=y+-64|0,i=1,!C(t|=0,e|=0,0)&&(i=0,e)){y=i=y+-64|0,o=a[e>>2],s=a[o-4>>2],l=a[o-8>>2],a[i+20>>2]=0,a[i+16>>2]=1148,a[i+12>>2]=e,a[i+8>>2]=1196,o=0,w(i+24|0,39),e=e+l|0;t:if(C(s,1196,0))a[i+56>>2]=1,k[a[a[s>>2]+20>>2]](s,i+8|0,e,e,1,0),o=1==a[i+32>>2]?e:0;else{k[a[a[s>>2]+24>>2]](s,i+8|0,e,1,0);e:switch(a[i+44>>2]){case 0:o=1==a[i+48>>2]&&1==a[i+36>>2]&&1==a[i+40>>2]?a[i+28>>2]:0;break t;case 1:break e;default:break t}1!=a[i+32>>2]&&a[i+48>>2]|1!=a[i+36>>2]|1!=a[i+40>>2]||(o=a[i+24>>2])}y=i- -64|0,i=0,o&&(w(4|(e=r+8|0),52),a[r+56>>2]=1,a[r+20>>2]=-1,a[r+16>>2]=t,a[r+8>>2]=o,k[a[a[o>>2]+28>>2]](o,e,a[n>>2],1),1==(0|(t=a[r+32>>2]))&&(a[n>>2]=a[r+24>>2]),i=1==(0|t))}return y=r- -64|0,0|i},function(t,e,n,r,i,o){n|=0,r|=0,i|=0,o|=0,C(t|=0,a[8+(e|=0)>>2],o)&&_(e,n,r,i)},function(t,e,n,i,o){if(n|=0,i|=0,o|=0,C(t|=0,a[8+(e|=0)>>2],o))1==a[e+28>>2]|a[e+4>>2]!=(0|n)||(a[e+28>>2]=i);else t:if(C(t,a[e>>2],o)){if(!(a[e+16>>2]!=(0|n)&a[e+20>>2]!=(0|n))){if(1!=(0|i))break t;return void(a[e+32>>2]=1)}a[e+20>>2]=n,a[e+32>>2]=i,a[e+40>>2]=a[e+40>>2]+1,1!=a[e+36>>2]|2!=a[e+24>>2]||(r[e+54|0]=1),a[e+44>>2]=4}},function(t,e,n,r){n|=0,r|=0,C(t|=0,a[8+(e|=0)>>2],0)&&S(e,n,r)},R,function(t,e,n,r,i,o){n|=0,r|=0,i|=0,o|=0,C(t|=0,a[8+(e|=0)>>2],o)?_(e,n,r,i):(t=a[t+8>>2],k[a[a[t>>2]+20>>2]](t,e,n,r,i,o))},function(t,e,n,i,l){if(n|=0,i|=0,l|=0,C(t|=0,a[8+(e|=0)>>2],l))1==a[e+28>>2]|a[e+4>>2]!=(0|n)||(a[e+28>>2]=i);else t:{if(C(t,a[e>>2],l)){if(!(a[e+16>>2]!=(0|n)&a[e+20>>2]!=(0|n))){if(1!=(0|i))break t;return void(a[e+32>>2]=1)}a[e+32>>2]=i;e:if(4!=a[e+44>>2]){if(o[e+52>>1]=0,t=a[t+8>>2],k[a[a[t>>2]+20>>2]](t,e,n,n,1,l),s[e+53|0]){if(a[e+44>>2]=3,!s[e+52|0])break e;break t}a[e+44>>2]=4}if(a[e+20>>2]=n,a[e+40>>2]=a[e+40>>2]+1,1!=a[e+36>>2]|2!=a[e+24>>2])break t;return void(r[e+54|0]=1)}t=a[t+8>>2],k[a[a[t>>2]+24>>2]](t,e,n,i,l)}},function(t,e,n,r){n|=0,r|=0,C(t|=0,a[8+(e|=0)>>2],0)?S(e,n,r):(t=a[t+8>>2],k[a[a[t>>2]+28>>2]](t,e,n,r))},L,R,function(t){return 1031},P,function(t){return a[4+(t|=0)>>2]},P]);return{g:function(){},h:O,i:function(){var t;return t=E(24),a[t>>2]=0,a[t+4>>2]=0,a[t+16>>2]=0,a[t+20>>2]=0,a[t+8>>2]=0,a[t+12>>2]=0,0|t},j:function(t,e,n){var r;return t=+t,e=+e,n=+n,r=E(24),c[r+16>>3]=n,c[r+8>>3]=e,c[r>>3]=t,0|r},k:function(t,e){e|=0,c[(t|=0)>>3]=c[t>>3]+c[e>>3],c[t+8>>3]=c[t+8>>3]+c[e+8>>3],c[t+16>>3]=c[t+16>>3]+c[e+16>>3]},l:function(t,e){e|=0,c[(t|=0)>>3]=c[t>>3]-c[e>>3],c[t+8>>3]=c[t+8>>3]-c[e+8>>3],c[t+16>>3]=c[t+16>>3]-c[e+16>>3]},m:function(t){return+c[(t|=0)>>3]},n:function(t,e){e=+e,c[(t|=0)>>3]=e},o:function(t){return+c[8+(t|=0)>>3]},p:function(t,e){e=+e,c[8+(t|=0)>>3]=e},q:function(t){return+c[16+(t|=0)>>3]},r:function(t,e){e=+e,c[16+(t|=0)>>3]=e},s:O,t:function(){var t;return t=E(12),a[t+8>>2]=0,a[t>>2]=0,a[t+4>>2]=0,0|t},u:function(t,e){e|=0;var n=0,r=0,i=0,o=0,s=0,l=0;t:if((0|(n=a[4+(t|=0)>>2]))==a[t+8>>2]){e:{if((i=1+(n=(0|(l=n-(r=a[t>>2])|0))/24|0)|0)>>>0<178956971){if(o=n<<1,i=n>>>0<89478485?i>>>0<o>>>0?o:i:178956970){if(i>>>0>=178956971)break e;o=E(u(i,24))}else o=0;n=o+u(n,24)|0,s=a[e+4>>2],a[n>>2]=a[e>>2],a[n+4>>2]=s,s=a[e+20>>2],a[n+16>>2]=a[e+16>>2],a[n+20>>2]=s,s=a[e+12>>2],a[n+8>>2]=a[e+8>>2],a[n+12>>2]=s,e=n+u((0|l)/-24|0,24)|0,(0|l)>0&&b(e,r,l),a[t+8>>2]=o+u(i,24),a[t+4>>2]=n+24,a[t>>2]=e,r&&x(r);break t}M(1024),h()}M(1046),h()}else r=a[e+4>>2],a[n>>2]=a[e>>2],a[n+4>>2]=r,r=a[e+20>>2],a[n+16>>2]=a[e+16>>2],a[n+20>>2]=r,r=a[e+12>>2],a[n+8>>2]=a[e+8>>2],a[n+12>>2]=r,a[t+4>>2]=n+24},v:function(t){var e=0;(t|=0)&&((e=a[t>>2])&&(a[t+4>>2]=e,x(e)),x(t))},w:function(){return 0|E(1)},x:function(t,e){t|=0;var n=0,r=0,i=0,o=0,s=0,l=0,h=0,d=0,p=0,f=0,m=0,g=0;if(t=a[(e|=0)>>2],(r=(0|(i=a[e+4>>2]-t|0))/24|0)>>>0>=2){if(!(i-24>>>0<24)){if(n=c[t+8>>3],e=1,m=1&(r=r-1|0),s=c[t>>3],i-48>>>0<24)l=n;else for(g=-2&r,r=0,h=s,d=n;i=t+u(e,24)|0,o=.5*((s=c[i+24>>3])-(p=c[i>>3]))*((f=c[i+8>>3]-n)+((l=c[i+32>>3])-n))+(.5*(p-h)*(d-n+f)+o),e=e+2|0,h=s,d=l,(0|g)!=(0|(r=r+2|0)););m&&(t=t+u(e,24)|0,o=.5*(c[t>>3]-s)*(l-n+(c[t+8>>3]-n))+o)}n=o<0?-o:o}else n=0;return+n},y:function(t,e,n){t|=0,e|=0;var r,i=0,o=0,s=0,l=0,h=0,d=0,p=0;if((r=((t=a[4+(n|=0)>>2])-(n=a[n>>2])|0)/24|0)>>>0>=3)for(t=r-1|0,i=c[e+8>>3],p=c[e>>3],e=0;l=n+u(t,24)|0,s=c[l+8>>3],t=e,e=n+u(e,24)|0,!(i<s&(o=c[e+8>>3])<=i)&(!(i>=s)|!(i<o))||p-(h=c[e>>3])<(i-o)*(c[l>>3]-h)/(s-o)&&(d^=1),(0|r)!=(0|(e=t+1|0)););return 1&d},z:O,A:k,B:v}}(t)}(W)}})}}}).then(function(t){return t}).then(t,function(t){y("failed to asynchronously prepare wasm: "+t),k(t)})}var o={a:W};if(R++,n.monitorRunDependencies&&n.monitorRunDependencies(R),n.instantiateWasm)try{return n.instantiateWasm(o,t)}catch(t){return y("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof x.instantiateStreaming||F.startsWith(B)||F.startsWith("file://")||"function"!=typeof fetch?r(e):fetch(F,{credentials:"same-origin"}).then(function(t){return x.instantiateStreaming(t,o).then(e,function(t){return y("wasm streaming compile failed: "+t),y("falling back to ArrayBuffer instantiation"),r(e)})})).catch(i)}(),n.___wasm_call_ctors=function(){return(n.___wasm_call_ctors=n.asm.g).apply(null,arguments)};var J,q=n._emscripten_bind_VoidPtr___destroy___0=function(){return(q=n._emscripten_bind_VoidPtr___destroy___0=n.asm.h).apply(null,arguments)},X=n._emscripten_bind_McGePoint3d_McGePoint3d_0=function(){return(X=n._emscripten_bind_McGePoint3d_McGePoint3d_0=n.asm.i).apply(null,arguments)},Y=n._emscripten_bind_McGePoint3d_McGePoint3d_3=function(){return(Y=n._emscripten_bind_McGePoint3d_McGePoint3d_3=n.asm.j).apply(null,arguments)},Z=n._emscripten_bind_McGePoint3d_op_add_1=function(){return(Z=n._emscripten_bind_McGePoint3d_op_add_1=n.asm.k).apply(null,arguments)},$=n._emscripten_bind_McGePoint3d_op_sub_1=function(){return($=n._emscripten_bind_McGePoint3d_op_sub_1=n.asm.l).apply(null,arguments)},K=n._emscripten_bind_McGePoint3d_get_x_0=function(){return(K=n._emscripten_bind_McGePoint3d_get_x_0=n.asm.m).apply(null,arguments)},Q=n._emscripten_bind_McGePoint3d_set_x_1=function(){return(Q=n._emscripten_bind_McGePoint3d_set_x_1=n.asm.n).apply(null,arguments)},tt=n._emscripten_bind_McGePoint3d_get_y_0=function(){return(tt=n._emscripten_bind_McGePoint3d_get_y_0=n.asm.o).apply(null,arguments)},et=n._emscripten_bind_McGePoint3d_set_y_1=function(){return(et=n._emscripten_bind_McGePoint3d_set_y_1=n.asm.p).apply(null,arguments)},nt=n._emscripten_bind_McGePoint3d_get_z_0=function(){return(nt=n._emscripten_bind_McGePoint3d_get_z_0=n.asm.q).apply(null,arguments)},rt=n._emscripten_bind_McGePoint3d_set_z_1=function(){return(rt=n._emscripten_bind_McGePoint3d_set_z_1=n.asm.r).apply(null,arguments)},it=n._emscripten_bind_McGePoint3d___destroy___0=function(){return(it=n._emscripten_bind_McGePoint3d___destroy___0=n.asm.s).apply(null,arguments)},ot=n._emscripten_bind_McGePoint3dArray_McGePoint3dArray_0=function(){return(ot=n._emscripten_bind_McGePoint3dArray_McGePoint3dArray_0=n.asm.t).apply(null,arguments)},at=n._emscripten_bind_McGePoint3dArray_append_1=function(){return(at=n._emscripten_bind_McGePoint3dArray_append_1=n.asm.u).apply(null,arguments)},st=n._emscripten_bind_McGePoint3dArray___destroy___0=function(){return(st=n._emscripten_bind_McGePoint3dArray___destroy___0=n.asm.v).apply(null,arguments)},lt=n._emscripten_bind_McGeTool_McGeTool_0=function(){return(lt=n._emscripten_bind_McGeTool_McGeTool_0=n.asm.w).apply(null,arguments)},ct=n._emscripten_bind_McGeTool_calcArea_1=function(){return(ct=n._emscripten_bind_McGeTool_calcArea_1=n.asm.x).apply(null,arguments)},ut=n._emscripten_bind_McGeTool_pointInPolyline_2=function(){return(ut=n._emscripten_bind_McGeTool_pointInPolyline_2=n.asm.y).apply(null,arguments)},ht=n._emscripten_bind_McGeTool___destroy___0=function(){return(ht=n._emscripten_bind_McGeTool___destroy___0=n.asm.z).apply(null,arguments)},dt=n._malloc=function(){return(dt=n._malloc=n.asm.B).apply(null,arguments)};function pt(){function t(){if(!J&&(J=!0,n.calledRun=!0,!S)){if(z(O),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;){var t=n.postRun.shift();P.unshift(t)}z(P)}}if(!(0<R)){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)L();z(A),0<R||(n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),t()},1)):t())}}if(I=function t(){J||pt(),J||(I=t)},n.run=pt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.pop()();function ft(){}function mt(t){return(t||ft).F}function gt(t,e){var n=mt(e),r=n[t];return r||((r=Object.create((e||ft).prototype)).C=t,n[t]=r)}function yt(){throw"cannot construct a VoidPtr, no constructor in IDL"}function vt(t,e,n){t&&"object"==typeof t&&(t=t.C),e&&"object"==typeof e&&(e=e.C),n&&"object"==typeof n&&(n=n.C),this.C=void 0===t?X():void 0===e?_emscripten_bind_McGePoint3d_McGePoint3d_1(t):void 0===n?_emscripten_bind_McGePoint3d_McGePoint3d_2(t,e):Y(t,e,n),mt(vt)[this.C]=this}function xt(){this.C=ot(),mt(xt)[this.C]=this}function bt(){this.C=lt(),mt(bt)[this.C]=this}return pt(),ft.prototype=Object.create(ft.prototype),ft.prototype.constructor=ft,ft.prototype.D=ft,ft.F={},n.WrapperObject=ft,n.getCache=mt,n.wrapPointer=gt,n.castObject=function(t,e){return gt(t.C,e)},n.NULL=gt(0),n.destroy=function(t){if(!t.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";t.__destroy__(),delete mt(t.D)[t.C]},n.compare=function(t,e){return t.C===e.C},n.getPointer=function(t){return t.C},n.getClass=function(t){return t.D},yt.prototype=Object.create(ft.prototype),yt.prototype.constructor=yt,yt.prototype.D=yt,yt.F={},n.VoidPtr=yt,yt.prototype.__destroy__=function(){q(this.C)},vt.prototype=Object.create(ft.prototype),vt.prototype.constructor=vt,vt.prototype.D=vt,vt.F={},n.McGePoint3d=vt,vt.prototype.op_add=function(t){var e=this.C;t&&"object"==typeof t&&(t=t.C),Z(e,t)},vt.prototype.op_sub=function(t){var e=this.C;t&&"object"==typeof t&&(t=t.C),$(e,t)},vt.prototype.get_x=vt.prototype.H=function(){return K(this.C)},vt.prototype.set_x=vt.prototype.R=function(t){var e=this.C;t&&"object"==typeof t&&(t=t.C),Q(e,t)},Object.defineProperty(vt.prototype,"x",{get:vt.prototype.H,set:vt.prototype.R}),vt.prototype.get_y=vt.prototype.I=function(){return tt(this.C)},vt.prototype.set_y=vt.prototype.S=function(t){var e=this.C;t&&"object"==typeof t&&(t=t.C),et(e,t)},Object.defineProperty(vt.prototype,"y",{get:vt.prototype.I,set:vt.prototype.S}),vt.prototype.get_z=vt.prototype.J=function(){return nt(this.C)},vt.prototype.set_z=vt.prototype.T=function(t){var e=this.C;t&&"object"==typeof t&&(t=t.C),rt(e,t)},Object.defineProperty(vt.prototype,"z",{get:vt.prototype.J,set:vt.prototype.T}),vt.prototype.__destroy__=function(){it(this.C)},xt.prototype=Object.create(ft.prototype),xt.prototype.constructor=xt,xt.prototype.D=xt,xt.F={},n.McGePoint3dArray=xt,xt.prototype.append=xt.prototype.append=function(t){var e=this.C;t&&"object"==typeof t&&(t=t.C),at(e,t)},xt.prototype.__destroy__=function(){st(this.C)},bt.prototype=Object.create(ft.prototype),bt.prototype.constructor=bt,bt.prototype.D=bt,bt.F={},n.McGeTool=bt,bt.prototype.calcArea=function(t){var e=this.C;return t&&"object"==typeof t&&(t=t.C),ct(e,t)},bt.prototype.pointInPolyline=function(t,e){var n=this.C;return t&&"object"==typeof t&&(t=t.C),e&&"object"==typeof e&&(e=e.C),!!ut(n,t,e)},bt.prototype.__destroy__=function(){ht(this.C)},e.ready});return"object"==typeof exports&&"object"==typeof module?module.exports=e:"function"==typeof define&&define.amd?define([],function(){return e}):"object"==typeof exports&&(exports.mxcadassembly=e),e()}function registerMxDbEntity(){store.events.emit("MxDbEntityRegister")}const registerList=[];function addRegisterMxDbEntity(t){const e=()=>{!t.isRegister&&t.register&&t.register(),store.events.off("stateChange",e)};registerList.push(e)}const callRegisterMxDbEntityLists=()=>{registerList.forEach(t=>{t&&t()})};function rxInitMxEntity(){var t;null===(t=store.state.MxFun)||void 0===t||t.initDynamicCreate(dynamicCreateMxObject)}function loadCoreCode(){return __awaiter(this,void 0,void 0,function*(){return new Promise((t,e)=>__awaiter(this,void 0,void 0,function*(){try{if(store.state.MxFun)return console.error("mx loadCoreCode ady call"),void t();window.$=window.jQuery=yield dynamicImport("jquery"),window.MxDocumentReady=void 0,window.MxUiMain=(t=>{const e=t("./MxFun").MxFun;window.THREE=e.getTHREE(),store.commit("setMxFun",e),store.events.emit("MxUiMain",t),window.MxUiMain=void 0}),window.MxMain=(e=>(store.events.emit("MxMain",e),window.MxMain=void 0,rxInitMxEntity(),registerMxDbEntity(),t(),0)),mxcadassemblyinit().then(function(t){store.commit("setMxassembly",t)}),mxfun()}catch(t){e({code:"error",msg:t})}}))})}function createCanvas(t="mx-canvas"){const e=document.getElementById(t)||document.createElement("canvas");return e.id=t,e}function createCanvasParent(t=createCanvas()){let e;return t||(t=createCanvas()),t.parentNode?e=t.parentNode:(e=document.createElement("div")).appendChild(t),e}store.events.on("MxDbEntityRegister",callRegisterMxDbEntityLists);var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t,e){return t(e={exports:{}},e.exports),e.exports}var lodash=createCommonjsModule(function(t,e){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,s=32,l=64,c=128,u=256,h=1/0,d=9007199254740991,p=NaN,f=4294967295,m=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",s],["partialRight",l],["rearg",u]],g="[object Arguments]",y="[object Array]",v="[object Boolean]",x="[object Date]",b="[object Error]",w="[object Function]",M="[object GeneratorFunction]",_="[object Map]",C="[object Number]",S="[object Object]",T="[object Promise]",E="[object RegExp]",D="[object Set]",A="[object String]",O="[object Symbol]",P="[object WeakMap]",L="[object ArrayBuffer]",R="[object DataView]",I="[object Float32Array]",k="[object Float64Array]",F="[object Int8Array]",B="[object Int16Array]",j="[object Int32Array]",N="[object Uint8Array]",z="[object Uint8ClampedArray]",V="[object Uint16Array]",G="[object Uint32Array]",H=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,J=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,X=RegExp(J.source),Y=RegExp(q.source),Z=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tt=/^\w*$/,et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(nt.source),it=/^\s+/,ot=/\s/,at=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,lt=/,? & /,ct=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ut=/[()=,{}\[\]\/\s]/,ht=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,ft=/^[-+]0x[0-9a-f]+$/i,mt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,yt=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,xt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,Mt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_t="a-z\\xdf-\\xf6\\xf8-\\xff",Ct="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Tt="["+St+"]",Et="["+Mt+"]",Dt="\\d+",At="["+_t+"]",Ot="[^\\ud800-\\udfff"+St+Dt+"\\u2700-\\u27bf"+_t+Ct+"]",Pt="\\ud83c[\\udffb-\\udfff]",Lt="[^\\ud800-\\udfff]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",It="[\\ud800-\\udbff][\\udc00-\\udfff]",kt="["+Ct+"]",Ft="(?:"+At+"|"+Ot+")",Bt="(?:"+kt+"|"+Ot+")",jt="(?:['](?:d|ll|m|re|s|t|ve))?",Nt="(?:['](?:D|LL|M|RE|S|T|VE))?",zt="(?:"+Et+"|"+Pt+")?",Vt="[\\ufe0e\\ufe0f]?",Gt=Vt+zt+"(?:\\u200d(?:"+[Lt,Rt,It].join("|")+")"+Vt+zt+")*",Ht="(?:"+["[\\u2700-\\u27bf]",Rt,It].join("|")+")"+Gt,Ut="(?:"+[Lt+Et+"?",Et,Rt,It,"[\\ud800-\\udfff]"].join("|")+")",Wt=RegExp("[']","g"),Jt=RegExp(Et,"g"),qt=RegExp(Pt+"(?="+Pt+")|"+Ut+Gt,"g"),Xt=RegExp([kt+"?"+At+"+"+jt+"(?="+[Tt,kt,"$"].join("|")+")",Bt+"+"+Nt+"(?="+[Tt,kt+Ft,"$"].join("|")+")",kt+"?"+Ft+"+"+jt,kt+"+"+Nt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dt,Ht].join("|"),"g"),Yt=RegExp("[\\u200d\\ud800-\\udfff"+Mt+"\\ufe0e\\ufe0f]"),Zt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$t=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Kt=-1,Qt={};Qt[I]=Qt[k]=Qt[F]=Qt[B]=Qt[j]=Qt[N]=Qt[z]=Qt[V]=Qt[G]=!0,Qt[g]=Qt[y]=Qt[L]=Qt[v]=Qt[R]=Qt[x]=Qt[b]=Qt[w]=Qt[_]=Qt[C]=Qt[S]=Qt[E]=Qt[D]=Qt[A]=Qt[P]=!1;var te={};te[g]=te[y]=te[L]=te[R]=te[v]=te[x]=te[I]=te[k]=te[F]=te[B]=te[j]=te[_]=te[C]=te[S]=te[E]=te[D]=te[A]=te[O]=te[N]=te[z]=te[V]=te[G]=!0,te[b]=te[w]=te[P]=!1;var ee={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ne=parseFloat,re=parseInt,ie="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,oe="object"==typeof self&&self&&self.Object===Object&&self,ae=ie||oe||Function("return this")(),se=e&&!e.nodeType&&e,le=se&&t&&!t.nodeType&&t,ce=le&&le.exports===se,ue=ce&&ie.process,he=function(){try{return le&&le.require&&le.require("util").types||ue&&ue.binding&&ue.binding("util")}catch(t){}}(),de=he&&he.isArrayBuffer,pe=he&&he.isDate,fe=he&&he.isMap,me=he&&he.isRegExp,ge=he&&he.isSet,ye=he&&he.isTypedArray;function ve(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function xe(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function be(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function we(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Me(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function _e(t,e){return!(null==t||!t.length)&&Re(t,e,0)>-1}function Ce(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Se(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Te(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Ee(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function De(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Oe=Be("length");function Pe(t,e,n){var r;return n(t,function(t,n,i){if(e(t,n,i))return r=n,!1}),r}function Le(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Re(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Le(t,ke,n)}function Ie(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function ke(t){return t!=t}function Fe(t,e){var n=null==t?0:t.length;return n?ze(t,e)/n:p}function Be(t){return function(e){return null==e?n:e[t]}}function je(t){return function(e){return null==t?n:t[e]}}function Ne(t,e,n,r,i){return i(t,function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)}),n}function ze(t,e){for(var r,i=-1,o=t.length;++i<o;){var a=e(t[i]);a!==n&&(r=r===n?a:r+a)}return r}function Ve(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ge(t){return t?t.slice(0,on(t)+1).replace(it,""):t}function He(t){return function(e){return t(e)}}function Ue(t,e){return Se(e,function(e){return t[e]})}function We(t,e){return t.has(e)}function Je(t,e){for(var n=-1,r=t.length;++n<r&&Re(e,t[n],0)>-1;);return n}function qe(t,e){for(var n=t.length;n--&&Re(e,t[n],0)>-1;);return n}var Xe=je({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Ye=je({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Ze(t){return"\\"+ee[t]}function $e(t){return Yt.test(t)}function Ke(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function Qe(t,e){return function(n){return t(e(n))}}function tn(t,e){for(var n=-1,r=t.length,i=0,a=[];++n<r;){var s=t[n];s!==e&&s!==o||(t[n]=o,a[i++]=n)}return a}function en(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function nn(t){return $e(t)?function(t){for(var e=qt.lastIndex=0;qt.test(t);)++e;return e}(t):Oe(t)}function rn(t){return $e(t)?function(t){return t.match(qt)||[]}(t):function(t){return t.split("")}(t)}function on(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var an=je({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),sn=function t(e){var ot,Mt=(e=null==e?ae:sn.defaults(ae.Object(),e,sn.pick(ae,$t))).Array,_t=e.Date,Ct=e.Error,St=e.Function,Tt=e.Math,Et=e.Object,Dt=e.RegExp,At=e.String,Ot=e.TypeError,Pt=Mt.prototype,Lt=St.prototype,Rt=Et.prototype,It=e["__core-js_shared__"],kt=Lt.toString,Ft=Rt.hasOwnProperty,Bt=0,jt=(ot=/[^.]+$/.exec(It&&It.keys&&It.keys.IE_PROTO||""))?"Symbol(src)_1."+ot:"",Nt=Rt.toString,zt=kt.call(Et),Vt=ae._,Gt=Dt("^"+kt.call(Ft).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ht=ce?e.Buffer:n,Ut=e.Symbol,qt=e.Uint8Array,Yt=Ht?Ht.allocUnsafe:n,ee=Qe(Et.getPrototypeOf,Et),ie=Et.create,oe=Rt.propertyIsEnumerable,se=Pt.splice,le=Ut?Ut.isConcatSpreadable:n,ue=Ut?Ut.iterator:n,he=Ut?Ut.toStringTag:n,Oe=function(){try{var t=io(Et,"defineProperty");return t({},"",{}),t}catch(t){}}(),je=e.clearTimeout!==ae.clearTimeout&&e.clearTimeout,ln=_t&&_t.now!==ae.Date.now&&_t.now,cn=e.setTimeout!==ae.setTimeout&&e.setTimeout,un=Tt.ceil,hn=Tt.floor,dn=Et.getOwnPropertySymbols,pn=Ht?Ht.isBuffer:n,fn=e.isFinite,mn=Pt.join,gn=Qe(Et.keys,Et),yn=Tt.max,vn=Tt.min,xn=_t.now,bn=e.parseInt,wn=Tt.random,Mn=Pt.reverse,_n=io(e,"DataView"),Cn=io(e,"Map"),Sn=io(e,"Promise"),Tn=io(e,"Set"),En=io(e,"WeakMap"),Dn=io(Et,"create"),An=En&&new En,On={},Pn=Lo(_n),Ln=Lo(Cn),Rn=Lo(Sn),In=Lo(Tn),kn=Lo(En),Fn=Ut?Ut.prototype:n,Bn=Fn?Fn.valueOf:n,jn=Fn?Fn.toString:n;function Nn(t){if(Ya(t)&&!ja(t)&&!(t instanceof Hn)){if(t instanceof Gn)return t;if(Ft.call(t,"__wrapped__"))return Ro(t)}return new Gn(t)}var zn=function(){function t(){}return function(e){if(!Xa(e))return{};if(ie)return ie(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function Vn(){}function Gn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function Hn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Un(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Jn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function qn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Jn;++e<n;)this.add(t[e])}function Xn(t){var e=this.__data__=new Wn(t);this.size=e.size}function Yn(t,e){var n=ja(t),r=!n&&Ba(t),i=!n&&!r&&Ga(t),o=!n&&!r&&!i&&rs(t),a=n||r||i||o,s=a?Ve(t.length,At):[],l=s.length;for(var c in t)!e&&!Ft.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ho(c,l))||s.push(c);return s}function Zn(t){var e=t.length;return e?t[Ur(0,e-1)]:n}function $n(t,e,r){(r!==n&&!Ia(t[e],r)||r===n&&!(e in t))&&nr(t,e,r)}function Kn(t,e,r){var i=t[e];Ft.call(t,e)&&Ia(i,r)&&(r!==n||e in t)||nr(t,e,r)}function Qn(t,e){for(var n=t.length;n--;)if(Ia(t[n][0],e))return n;return-1}function tr(t,e,n,r){return cr(t,function(t,i,o){e(r,t,n(t),o)}),r}function er(t,e){return t&&_i(e,Ss(e),t)}function nr(t,e,n){"__proto__"==e&&Oe?Oe(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function rr(t,e){for(var r=-1,i=e.length,o=Mt(i),a=null==t;++r<i;)o[r]=a?n:bs(t,e[r]);return o}function ir(t,e,r){return t==t&&(r!==n&&(t=t<=r?t:r),e!==n&&(t=t>=e?t:e)),t}function or(t,e,r,i,o,a){var s,l=1&e,c=2&e,u=4&e;if(r&&(s=o?r(t,i,o,a):r(t)),s!==n)return s;if(!Xa(t))return t;var h=ja(t);if(h){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Ft.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!l)return Mi(t,s)}else{var d=so(t),p=d==w||d==M;if(Ga(t))return gi(t,l);if(d==S||d==g||p&&!o){if(s=c||p?{}:co(t),!l)return c?function(t,e){return _i(t,ao(t),e)}(t,function(t,e){return t&&_i(e,Ts(e),t)}(s,t)):function(t,e){return _i(t,oo(t),e)}(t,er(s,t))}else{if(!te[d])return o?t:{};s=function(t,e,n){var r,i=t.constructor;switch(e){case L:return yi(t);case v:case x:return new i(+t);case R:return function(t,e){var n=e?yi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case I:case k:case F:case B:case j:case N:case z:case V:case G:return vi(t,n);case _:return new i;case C:case A:return new i(t);case E:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case D:return new i;case O:return r=t,Bn?Et(Bn.call(r)):{}}}(t,d,l)}}a||(a=new Xn);var f=a.get(t);if(f)return f;a.set(t,s),ts(t)?t.forEach(function(n){s.add(or(n,e,r,n,t,a))}):Za(t)&&t.forEach(function(n,i){s.set(i,or(n,e,r,i,t,a))});var m=h?n:(u?c?$i:Zi:c?Ts:Ss)(t);return be(m||t,function(n,i){m&&(n=t[i=n]),Kn(s,i,or(n,e,r,i,t,a))}),s}function ar(t,e,r){var i=r.length;if(null==t)return!i;for(t=Et(t);i--;){var o=r[i],a=e[o],s=t[o];if(s===n&&!(o in t)||!a(s))return!1}return!0}function sr(t,e,i){if("function"!=typeof t)throw new Ot(r);return So(function(){t.apply(n,i)},e)}function lr(t,e,n,r){var i=-1,o=_e,a=!0,s=t.length,l=[],c=e.length;if(!s)return l;n&&(e=Se(e,He(n))),r?(o=Ce,a=!1):e.length>=200&&(o=We,a=!1,e=new qn(e));t:for(;++i<s;){var u=t[i],h=null==n?u:n(u);if(u=r||0!==u?u:0,a&&h==h){for(var d=c;d--;)if(e[d]===h)continue t;l.push(u)}else o(e,h,r)||l.push(u)}return l}Nn.templateSettings={escape:Z,evaluate:$,interpolate:K,variable:"",imports:{_:Nn}},Nn.prototype=Vn.prototype,Nn.prototype.constructor=Nn,Gn.prototype=zn(Vn.prototype),Gn.prototype.constructor=Gn,Hn.prototype=zn(Vn.prototype),Hn.prototype.constructor=Hn,Un.prototype.clear=function(){this.__data__=Dn?Dn(null):{},this.size=0},Un.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Un.prototype.get=function(t){var e=this.__data__;if(Dn){var r=e[t];return r===i?n:r}return Ft.call(e,t)?e[t]:n},Un.prototype.has=function(t){var e=this.__data__;return Dn?e[t]!==n:Ft.call(e,t)},Un.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Dn&&e===n?i:e,this},Wn.prototype.clear=function(){this.__data__=[],this.size=0},Wn.prototype.delete=function(t){var e=this.__data__,n=Qn(e,t);return!(n<0||(n==e.length-1?e.pop():se.call(e,n,1),--this.size,0))},Wn.prototype.get=function(t){var e=this.__data__,r=Qn(e,t);return r<0?n:e[r][1]},Wn.prototype.has=function(t){return Qn(this.__data__,t)>-1},Wn.prototype.set=function(t,e){var n=this.__data__,r=Qn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Jn.prototype.clear=function(){this.size=0,this.__data__={hash:new Un,map:new(Cn||Wn),string:new Un}},Jn.prototype.delete=function(t){var e=no(this,t).delete(t);return this.size-=e?1:0,e},Jn.prototype.get=function(t){return no(this,t).get(t)},Jn.prototype.has=function(t){return no(this,t).has(t)},Jn.prototype.set=function(t,e){var n=no(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},qn.prototype.add=qn.prototype.push=function(t){return this.__data__.set(t,i),this},qn.prototype.has=function(t){return this.__data__.has(t)},Xn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Xn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Xn.prototype.get=function(t){return this.__data__.get(t)},Xn.prototype.has=function(t){return this.__data__.has(t)},Xn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!Cn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Jn(r)}return n.set(t,e),this.size=n.size,this};var cr=Ti(yr),ur=Ti(vr,!0);function hr(t,e){var n=!0;return cr(t,function(t,r,i){return n=!!e(t,r,i)}),n}function dr(t,e,r){for(var i=-1,o=t.length;++i<o;){var a=t[i],s=e(a);if(null!=s&&(l===n?s==s&&!ns(s):r(s,l)))var l=s,c=a}return c}function pr(t,e){var n=[];return cr(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function fr(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=uo),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?fr(s,e-1,n,r,i):Te(i,s):r||(i[i.length]=s)}return i}var mr=Ei(),gr=Ei(!0);function yr(t,e){return t&&mr(t,e,Ss)}function vr(t,e){return t&&gr(t,e,Ss)}function xr(t,e){return Me(e,function(e){return Wa(t[e])})}function br(t,e){for(var r=0,i=(e=di(e,t)).length;null!=t&&r<i;)t=t[Po(e[r++])];return r&&r==i?t:n}function wr(t,e,n){var r=e(t);return ja(t)?r:Te(r,n(t))}function Mr(t){return null==t?t===n?"[object Undefined]":"[object Null]":he&&he in Et(t)?function(t){var e=Ft.call(t,he),r=t[he];try{t[he]=n;var i=!0}catch(t){}var o=Nt.call(t);return i&&(e?t[he]=r:delete t[he]),o}(t):function(t){return Nt.call(t)}(t)}function _r(t,e){return t>e}function Cr(t,e){return null!=t&&Ft.call(t,e)}function Sr(t,e){return null!=t&&e in Et(t)}function Tr(t,e,r){for(var i=r?Ce:_e,o=t[0].length,a=t.length,s=a,l=Mt(a),c=1/0,u=[];s--;){var h=t[s];s&&e&&(h=Se(h,He(e))),c=vn(h.length,c),l[s]=!r&&(e||o>=120&&h.length>=120)?new qn(s&&h):n}h=t[0];var d=-1,p=l[0];t:for(;++d<o&&u.length<c;){var f=h[d],m=e?e(f):f;if(f=r||0!==f?f:0,!(p?We(p,m):i(u,m,r))){for(s=a;--s;){var g=l[s];if(!(g?We(g,m):i(t[s],m,r)))continue t}p&&p.push(m),u.push(f)}}return u}function Er(t,e,r){var i=null==(t=wo(t,e=di(e,t)))?t:t[Po(Uo(e))];return null==i?n:ve(i,t,r)}function Dr(t){return Ya(t)&&Mr(t)==g}function Ar(t,e,r,i,o){return t===e||(null==t||null==e||!Ya(t)&&!Ya(e)?t!=t&&e!=e:function(t,e,r,i,o,a){var s=ja(t),l=ja(e),c=s?y:so(t),u=l?y:so(e),h=(c=c==g?S:c)==S,d=(u=u==g?S:u)==S,p=c==u;if(p&&Ga(t)){if(!Ga(e))return!1;s=!0,h=!1}if(p&&!h)return a||(a=new Xn),s||rs(t)?Xi(t,e,r,i,o,a):function(t,e,n,r,i,o,a){switch(n){case R:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case L:return!(t.byteLength!=e.byteLength||!o(new qt(t),new qt(e)));case v:case x:case C:return Ia(+t,+e);case b:return t.name==e.name&&t.message==e.message;case E:case A:return t==e+"";case _:var s=Ke;case D:var l=1&r;if(s||(s=en),t.size!=e.size&&!l)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var u=Xi(s(t),s(e),r,i,o,a);return a.delete(t),u;case O:if(Bn)return Bn.call(t)==Bn.call(e)}return!1}(t,e,c,r,i,o,a);if(!(1&r)){var f=h&&Ft.call(t,"__wrapped__"),m=d&&Ft.call(e,"__wrapped__");if(f||m){var w=f?t.value():t,M=m?e.value():e;return a||(a=new Xn),o(w,M,r,i,a)}}return!!p&&(a||(a=new Xn),function(t,e,r,i,o,a){var s=1&r,l=Zi(t),c=l.length;if(c!=Zi(e).length&&!s)return!1;for(var u=c;u--;){var h=l[u];if(!(s?h in e:Ft.call(e,h)))return!1}var d=a.get(t),p=a.get(e);if(d&&p)return d==e&&p==t;var f=!0;a.set(t,e),a.set(e,t);for(var m=s;++u<c;){var g=t[h=l[u]],y=e[h];if(i)var v=s?i(y,g,h,e,t,a):i(g,y,h,t,e,a);if(!(v===n?g===y||o(g,y,r,i,a):v)){f=!1;break}m||(m="constructor"==h)}if(f&&!m){var x=t.constructor,b=e.constructor;x==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof x&&x instanceof x&&"function"==typeof b&&b instanceof b||(f=!1)}return a.delete(t),a.delete(e),f}(t,e,r,i,o,a))}(t,e,r,i,Ar,o))}function Or(t,e,r,i){var o=r.length,a=o,s=!i;if(null==t)return!a;for(t=Et(t);o--;){var l=r[o];if(s&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++o<a;){var c=(l=r[o])[0],u=t[c],h=l[1];if(s&&l[2]){if(u===n&&!(c in t))return!1}else{var d=new Xn;if(i)var p=i(u,h,c,t,e,d);if(!(p===n?Ar(h,u,3,i,d):p))return!1}}return!0}function Pr(t){return!(!Xa(t)||(e=t,jt&&jt in e))&&(Wa(t)?Gt:gt).test(Lo(t));var e}function Lr(t){return"function"==typeof t?t:null==t?$s:"object"==typeof t?ja(t)?Br(t[0],t[1]):Fr(t):al(t)}function Rr(t){if(!yo(t))return gn(t);var e=[];for(var n in Et(t))Ft.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Ir(t,e){return t<e}function kr(t,e){var n=-1,r=za(t)?Mt(t.length):[];return cr(t,function(t,i,o){r[++n]=e(t,i,o)}),r}function Fr(t){var e=ro(t);return 1==e.length&&e[0][2]?xo(e[0][0],e[0][1]):function(n){return n===t||Or(n,t,e)}}function Br(t,e){return fo(t)&&vo(e)?xo(Po(t),e):function(r){var i=bs(r,t);return i===n&&i===e?ws(r,t):Ar(e,i,3)}}function jr(t,e,r,i,o){t!==e&&mr(e,function(a,s){if(o||(o=new Xn),Xa(a))!function(t,e,r,i,o,a,s){var l=_o(t,r),c=_o(e,r),u=s.get(c);if(u)$n(t,r,u);else{var h=a?a(l,c,r+"",t,e,s):n,d=h===n;if(d){var p=ja(c),f=!p&&Ga(c),m=!p&&!f&&rs(c);h=c,p||f||m?ja(l)?h=l:Va(l)?h=Mi(l):f?(d=!1,h=gi(c,!0)):m?(d=!1,h=vi(c,!0)):h=[]:Ka(c)||Ba(c)?(h=l,Ba(l)?h=hs(l):Xa(l)&&!Wa(l)||(h=co(c))):d=!1}d&&(s.set(c,h),o(h,c,i,a,s),s.delete(c)),$n(t,r,h)}}(t,e,s,r,jr,i,o);else{var l=i?i(_o(t,s),a,s+"",t,e,o):n;l===n&&(l=a),$n(t,s,l)}},Ts)}function Nr(t,e){var r=t.length;if(r)return ho(e+=e<0?r:0,r)?t[e]:n}function zr(t,e,n){var r=-1;return e=Se(e=e.length?Se(e,function(t){return ja(t)?function(e){return br(e,1===t.length?t[0]:t)}:t}):[$s],He(eo())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(kr(t,function(t,n,i){return{criteria:Se(e,function(e){return e(t)}),index:++r,value:t}}),function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var l=xi(i[r],o[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)})}function Vr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=br(t,a);n(s,a)&&qr(o,di(a,t),s)}return o}function Gr(t,e,n,r){var i=r?Ie:Re,o=-1,a=e.length,s=t;for(t===e&&(e=Mi(e)),n&&(s=Se(t,He(n)));++o<a;)for(var l=0,c=e[o],u=n?n(c):c;(l=i(s,u,l,r))>-1;)s!==t&&se.call(s,l,1),se.call(t,l,1);return t}function Hr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;ho(i)?se.call(t,i,1):ii(t,i)}}return t}function Ur(t,e){return t+hn(wn()*(e-t+1))}function Wr(t,e){var n="";if(!t||e<1||e>d)return n;do{e%2&&(n+=t),(e=hn(e/2))&&(t+=t)}while(e);return n}function Jr(t,e){return To(bo(t,e,$s),t+"")}function qr(t,e,r,i){if(!Xa(t))return t;for(var o=-1,a=(e=di(e,t)).length,s=a-1,l=t;null!=l&&++o<a;){var c=Po(e[o]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(o!=s){var h=l[c];(u=i?i(h,c,l):n)===n&&(u=Xa(h)?h:ho(e[o+1])?[]:{})}Kn(l,c,u),l=l[c]}return t}var Xr=An?function(t,e){return An.set(t,e),t}:$s,Yr=Oe?function(t,e){return Oe(t,"toString",{configurable:!0,enumerable:!1,value:Xs(e),writable:!0})}:$s;function Zr(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Mt(i);++r<i;)o[r]=t[r+e];return o}function $r(t,e){var n;return cr(t,function(t,r,i){return!(n=e(t,r,i))}),!!n}function Kr(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!ns(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return Qr(t,e,$s,n)}function Qr(t,e,r,i){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var s=(e=r(e))!=e,l=null===e,c=ns(e),u=e===n;o<a;){var h=hn((o+a)/2),d=r(t[h]),p=d!==n,f=null===d,m=d==d,g=ns(d);if(s)var y=i||m;else y=u?m&&(i||p):l?m&&p&&(i||!f):c?m&&p&&!f&&(i||!g):!f&&!g&&(i?d<=e:d<e);y?o=h+1:a=h}return vn(a,4294967294)}function ti(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!Ia(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function ei(t){return"number"==typeof t?t:ns(t)?p:+t}function ni(t){if("string"==typeof t)return t;if(ja(t))return Se(t,ni)+"";if(ns(t))return jn?jn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ri(t,e,n){var r=-1,i=_e,o=t.length,a=!0,s=[],l=s;if(n)a=!1,i=Ce;else if(o>=200){var c=e?null:Gi(t);if(c)return en(c);a=!1,i=We,l=new qn}else l=e?[]:s;t:for(;++r<o;){var u=t[r],h=e?e(u):u;if(u=n||0!==u?u:0,a&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue t;e&&l.push(h),s.push(u)}else i(l,h,n)||(l!==s&&l.push(h),s.push(u))}return s}function ii(t,e){return null==(t=wo(t,e=di(e,t)))||delete t[Po(Uo(e))]}function oi(t,e,n,r){return qr(t,e,n(br(t,e)),r)}function ai(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?Zr(t,r?0:o,r?o+1:i):Zr(t,r?o+1:0,r?i:o)}function si(t,e){var n=t;return n instanceof Hn&&(n=n.value()),Ee(e,function(t,e){return e.func.apply(e.thisArg,Te([t],e.args))},n)}function li(t,e,n){var r=t.length;if(r<2)return r?ri(t[0]):[];for(var i=-1,o=Mt(r);++i<r;)for(var a=t[i],s=-1;++s<r;)s!=i&&(o[i]=lr(o[i]||a,t[s],e,n));return ri(fr(o,1),e,n)}function ci(t,e,r){for(var i=-1,o=t.length,a=e.length,s={};++i<o;){var l=i<a?e[i]:n;r(s,t[i],l)}return s}function ui(t){return Va(t)?t:[]}function hi(t){return"function"==typeof t?t:$s}function di(t,e){return ja(t)?t:fo(t,e)?[t]:Oo(ds(t))}var pi=Jr;function fi(t,e,r){var i=t.length;return r=r===n?i:r,!e&&r>=i?t:Zr(t,e,r)}var mi=je||function(t){return ae.clearTimeout(t)};function gi(t,e){if(e)return t.slice();var n=t.length,r=Yt?Yt(n):new t.constructor(n);return t.copy(r),r}function yi(t){var e=new t.constructor(t.byteLength);return new qt(e).set(new qt(t)),e}function vi(t,e){var n=e?yi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function xi(t,e){if(t!==e){var r=t!==n,i=null===t,o=t==t,a=ns(t),s=e!==n,l=null===e,c=e==e,u=ns(e);if(!l&&!u&&!a&&t>e||a&&s&&c&&!l&&!u||i&&s&&c||!r&&c||!o)return 1;if(!i&&!a&&!u&&t<e||u&&r&&o&&!i&&!a||l&&r&&o||!s&&o||!c)return-1}return 0}function bi(t,e,n,r){for(var i=-1,o=t.length,a=n.length,s=-1,l=e.length,c=yn(o-a,0),u=Mt(l+c),h=!r;++s<l;)u[s]=e[s];for(;++i<a;)(h||i<o)&&(u[n[i]]=t[i]);for(;c--;)u[s++]=t[i++];return u}function wi(t,e,n,r){for(var i=-1,o=t.length,a=-1,s=n.length,l=-1,c=e.length,u=yn(o-s,0),h=Mt(u+c),d=!r;++i<u;)h[i]=t[i];for(var p=i;++l<c;)h[p+l]=e[l];for(;++a<s;)(d||i<o)&&(h[p+n[a]]=t[i++]);return h}function Mi(t,e){var n=-1,r=t.length;for(e||(e=Mt(r));++n<r;)e[n]=t[n];return e}function _i(t,e,r,i){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var l=e[a],c=i?i(r[l],t[l],l,r,t):n;c===n&&(c=t[l]),o?nr(r,l,c):Kn(r,l,c)}return r}function Ci(t,e){return function(n,r){var i=ja(n)?xe:tr,o=e?e():{};return i(n,t,eo(r,2),o)}}function Si(t){return Jr(function(e,r){var i=-1,o=r.length,a=o>1?r[o-1]:n,s=o>2?r[2]:n;for(a=t.length>3&&"function"==typeof a?(o--,a):n,s&&po(r[0],r[1],s)&&(a=o<3?n:a,o=1),e=Et(e);++i<o;){var l=r[i];l&&t(e,l,i,a)}return e})}function Ti(t,e){return function(n,r){if(null==n)return n;if(!za(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Et(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Ei(t){return function(e,n,r){for(var i=-1,o=Et(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(!1===n(o[l],l,o))break}return e}}function Di(t){return function(e){var r=$e(e=ds(e))?rn(e):n,i=r?r[0]:e.charAt(0),o=r?fi(r,1).join(""):e.slice(1);return i[t]()+o}}function Ai(t){return function(e){return Ee(Ws(Bs(e).replace(Wt,"")),t,"")}}function Oi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=zn(t.prototype),r=t.apply(n,e);return Xa(r)?r:n}}function Pi(t){return function(e,r,i){var o=Et(e);if(!za(e)){var a=eo(r,3);e=Ss(e),r=function(t){return a(o[t],t,o)}}var s=t(e,r,i);return s>-1?o[a?e[s]:s]:n}}function Li(t){return Yi(function(e){var i=e.length,o=i,a=Gn.prototype.thru;for(t&&e.reverse();o--;){var s=e[o];if("function"!=typeof s)throw new Ot(r);if(a&&!l&&"wrapper"==Qi(s))var l=new Gn([],!0)}for(o=l?o:i;++o<i;){var c=Qi(s=e[o]),u="wrapper"==c?Ki(s):n;l=u&&mo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[Qi(u[0])].apply(l,u[3]):1==s.length&&mo(s)?l[c]():l.thru(s)}return function(){var t=arguments,n=t[0];if(l&&1==t.length&&ja(n))return l.plant(n).value();for(var r=0,o=i?e[r].apply(this,t):n;++r<i;)o=e[r].call(this,o);return o}})}function Ri(t,e,r,i,o,a,s,l,u,h){var d=e&c,p=1&e,f=2&e,m=24&e,g=512&e,y=f?n:Oi(t);return function n(){for(var c=arguments.length,v=Mt(c),x=c;x--;)v[x]=arguments[x];if(m)var b=to(n),w=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(v,b);if(i&&(v=bi(v,i,o,m)),a&&(v=wi(v,a,s,m)),c-=w,m&&c<h){var M=tn(v,b);return zi(t,e,Ri,n.placeholder,r,v,M,l,u,h-c)}var _=p?r:this,C=f?_[t]:t;return c=v.length,l?v=Mo(v,l):g&&c>1&&v.reverse(),d&&u<c&&(v.length=u),this&&this!==ae&&this instanceof n&&(C=y||Oi(C)),C.apply(_,v)}}function Ii(t,e){return function(n,r){return function(t,e,n,r){return yr(t,function(t,i,o){e(r,n(t),i,o)}),r}(n,t,e(r),{})}}function ki(t,e){return function(r,i){var o;if(r===n&&i===n)return e;if(r!==n&&(o=r),i!==n){if(o===n)return i;"string"==typeof r||"string"==typeof i?(r=ni(r),i=ni(i)):(r=ei(r),i=ei(i)),o=t(r,i)}return o}}function Fi(t){return Yi(function(e){return e=Se(e,He(eo())),Jr(function(n){var r=this;return t(e,function(t){return ve(t,r,n)})})})}function Bi(t,e){var r=(e=e===n?" ":ni(e)).length;if(r<2)return r?Wr(e,t):e;var i=Wr(e,un(t/nn(e)));return $e(e)?fi(rn(i),0,t).join(""):i.slice(0,t)}function ji(t){return function(e,r,i){return i&&"number"!=typeof i&&po(e,r,i)&&(r=i=n),e=ss(e),r===n?(r=e,e=0):r=ss(r),function(t,e,n,r){for(var i=-1,o=yn(un((e-t)/(n||1)),0),a=Mt(o);o--;)a[r?o:++i]=t,t+=n;return a}(e,r,i=i===n?e<r?1:-1:ss(i),t)}}function Ni(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=us(e),n=us(n)),t(e,n)}}function zi(t,e,r,i,o,a,c,u,h,d){var p=8&e;e|=p?s:l,4&(e&=~(p?l:s))||(e&=-4);var f=[t,e,o,p?a:n,p?c:n,p?n:a,p?n:c,u,h,d],m=r.apply(n,f);return mo(t)&&Co(m,f),m.placeholder=i,Eo(m,t,e)}function Vi(t){var e=Tt[t];return function(t,n){if(t=us(t),(n=null==n?0:vn(ls(n),292))&&fn(t)){var r=(ds(t)+"e").split("e");return+((r=(ds(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Gi=Tn&&1/en(new Tn([,-0]))[1]==h?function(t){return new Tn(t)}:nl;function Hi(t){return function(e){var n=so(e);return n==_?Ke(e):n==D?function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=[t,t]}),n}(e):function(t,e){return Se(e,function(e){return[e,t[e]]})}(e,t(e))}}function Ui(t,e,i,h,d,p,f,m){var g=2&e;if(!g&&"function"!=typeof t)throw new Ot(r);var y=h?h.length:0;if(y||(e&=-97,h=d=n),f=f===n?f:yn(ls(f),0),m=m===n?m:ls(m),y-=d?d.length:0,e&l){var v=h,x=d;h=d=n}var b=g?n:Ki(t),w=[t,e,i,h,d,v,x,p,f,m];if(b&&function(t,e){var n=t[1],r=e[1],i=n|r,a=i<131,s=r==c&&8==n||r==c&&n==u&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!a&&!s)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var l=e[3];if(l){var h=t[3];t[3]=h?bi(h,l,e[4]):l,t[4]=h?tn(t[3],o):e[4]}(l=e[5])&&(h=t[5],t[5]=h?wi(h,l,e[6]):l,t[6]=h?tn(t[5],o):e[6]),(l=e[7])&&(t[7]=l),r&c&&(t[8]=null==t[8]?e[8]:vn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(w,b),t=w[0],e=w[1],i=w[2],h=w[3],d=w[4],!(m=w[9]=w[9]===n?g?0:t.length:yn(w[9]-y,0))&&24&e&&(e&=-25),e&&1!=e)M=8==e||e==a?function(t,e,r){var i=Oi(t);return function o(){for(var a=arguments.length,s=Mt(a),l=a,c=to(o);l--;)s[l]=arguments[l];var u=a<3&&s[0]!==c&&s[a-1]!==c?[]:tn(s,c);return(a-=u.length)<r?zi(t,e,Ri,o.placeholder,n,s,u,n,n,r-a):ve(this&&this!==ae&&this instanceof o?i:t,this,s)}}(t,e,m):e!=s&&33!=e||d.length?Ri.apply(n,w):function(t,e,n,r){var i=1&e,o=Oi(t);return function e(){for(var a=-1,s=arguments.length,l=-1,c=r.length,u=Mt(c+s),h=this&&this!==ae&&this instanceof e?o:t;++l<c;)u[l]=r[l];for(;s--;)u[l++]=arguments[++a];return ve(h,i?n:this,u)}}(t,e,i,h);else var M=function(t,e,n){var r=1&e,i=Oi(t);return function e(){return(this&&this!==ae&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,i);return Eo((b?Xr:Co)(M,w),t,e)}function Wi(t,e,r,i){return t===n||Ia(t,Rt[r])&&!Ft.call(i,r)?e:t}function Ji(t,e,r,i,o,a){return Xa(t)&&Xa(e)&&(a.set(e,t),jr(t,e,n,Ji,a),a.delete(e)),t}function qi(t){return Ka(t)?n:t}function Xi(t,e,r,i,o,a){var s=1&r,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,p=!0,f=2&r?new qn:n;for(a.set(t,e),a.set(e,t);++d<l;){var m=t[d],g=e[d];if(i)var y=s?i(g,m,d,e,t,a):i(m,g,d,t,e,a);if(y!==n){if(y)continue;p=!1;break}if(f){if(!Ae(e,function(t,e){if(!We(f,e)&&(m===t||o(m,t,r,i,a)))return f.push(e)})){p=!1;break}}else if(m!==g&&!o(m,g,r,i,a)){p=!1;break}}return a.delete(t),a.delete(e),p}function Yi(t){return To(bo(t,n,No),t+"")}function Zi(t){return wr(t,Ss,oo)}function $i(t){return wr(t,Ts,ao)}var Ki=An?function(t){return An.get(t)}:nl;function Qi(t){for(var e=t.name+"",n=On[e],r=Ft.call(On,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function to(t){return(Ft.call(Nn,"placeholder")?Nn:t).placeholder}function eo(){var t=Nn.iteratee||Ks;return t=t===Ks?Lr:t,arguments.length?t(arguments[0],arguments[1]):t}function no(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function ro(t){for(var e=Ss(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,vo(i)]}return e}function io(t,e){var r=function(t,e){return null==t?n:t[e]}(t,e);return Pr(r)?r:n}var oo=dn?function(t){return null==t?[]:(t=Et(t),Me(dn(t),function(e){return oe.call(t,e)}))}:cl,ao=dn?function(t){for(var e=[];t;)Te(e,oo(t)),t=ee(t);return e}:cl,so=Mr;function lo(t,e,n){for(var r=-1,i=(e=di(e,t)).length,o=!1;++r<i;){var a=Po(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&qa(i)&&ho(a,i)&&(ja(t)||Ba(t))}function co(t){return"function"!=typeof t.constructor||yo(t)?{}:zn(ee(t))}function uo(t){return ja(t)||Ba(t)||!!(le&&t&&t[le])}function ho(t,e){var n=typeof t;return!!(e=null==e?d:e)&&("number"==n||"symbol"!=n&&vt.test(t))&&t>-1&&t%1==0&&t<e}function po(t,e,n){if(!Xa(n))return!1;var r=typeof e;return!!("number"==r?za(n)&&ho(e,n.length):"string"==r&&e in n)&&Ia(n[e],t)}function fo(t,e){if(ja(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ns(t))||tt.test(t)||!Q.test(t)||null!=e&&t in Et(e)}function mo(t){var e=Qi(t),n=Nn[e];if("function"!=typeof n||!(e in Hn.prototype))return!1;if(t===n)return!0;var r=Ki(n);return!!r&&t===r[0]}(_n&&so(new _n(new ArrayBuffer(1)))!=R||Cn&&so(new Cn)!=_||Sn&&so(Sn.resolve())!=T||Tn&&so(new Tn)!=D||En&&so(new En)!=P)&&(so=function(t){var e=Mr(t),r=e==S?t.constructor:n,i=r?Lo(r):"";if(i)switch(i){case Pn:return R;case Ln:return _;case Rn:return T;case In:return D;case kn:return P}return e});var go=It?Wa:ul;function yo(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Rt)}function vo(t){return t==t&&!Xa(t)}function xo(t,e){return function(r){return null!=r&&r[t]===e&&(e!==n||t in Et(r))}}function bo(t,e,r){return e=yn(e===n?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=yn(n.length-e,0),a=Mt(o);++i<o;)a[i]=n[e+i];i=-1;for(var s=Mt(e+1);++i<e;)s[i]=n[i];return s[e]=r(a),ve(t,this,s)}}function wo(t,e){return e.length<2?t:br(t,Zr(e,0,-1))}function Mo(t,e){for(var r=t.length,i=vn(e.length,r),o=Mi(t);i--;){var a=e[i];t[i]=ho(a,r)?o[a]:n}return t}function _o(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Co=Do(Xr),So=cn||function(t,e){return ae.setTimeout(t,e)},To=Do(Yr);function Eo(t,e,n){var r=e+"";return To(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(at,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return be(m,function(n){var r="_."+n[0];e&n[1]&&!_e(t,r)&&t.push(r)}),t.sort()}(function(t){var e=r.match(st);return e?e[1].split(lt):[]}(),n)))}function Do(t){var e=0,r=0;return function(){var i=xn(),o=16-(i-r);if(r=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(n,arguments)}}function Ao(t,e){var r=-1,i=t.length,o=i-1;for(e=e===n?i:e;++r<e;){var a=Ur(r,o),s=t[a];t[a]=t[r],t[r]=s}return t.length=e,t}var Oo=function(t){var e=Da(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(et,function(t,n,r,i){e.push(r?i.replace(ht,"$1"):n||t)}),e},function(t){return 500===n.size&&n.clear(),t}),n=e.cache;return e}();function Po(t){if("string"==typeof t||ns(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Lo(t){if(null!=t){try{return kt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ro(t){if(t instanceof Hn)return t.clone();var e=new Gn(t.__wrapped__,t.__chain__);return e.__actions__=Mi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Io=Jr(function(t,e){return Va(t)?lr(t,fr(e,1,Va,!0)):[]}),ko=Jr(function(t,e){var r=Uo(e);return Va(r)&&(r=n),Va(t)?lr(t,fr(e,1,Va,!0),eo(r,2)):[]}),Fo=Jr(function(t,e){var r=Uo(e);return Va(r)&&(r=n),Va(t)?lr(t,fr(e,1,Va,!0),n,r):[]});function Bo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ls(n);return i<0&&(i=yn(r+i,0)),Le(t,eo(e,3),i)}function jo(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i-1;return r!==n&&(o=ls(r),o=r<0?yn(i+o,0):vn(o,i-1)),Le(t,eo(e,3),o,!0)}function No(t){return null!=t&&t.length?fr(t,1):[]}function zo(t){return t&&t.length?t[0]:n}var Vo=Jr(function(t){var e=Se(t,ui);return e.length&&e[0]===t[0]?Tr(e):[]}),Go=Jr(function(t){var e=Uo(t),r=Se(t,ui);return e===Uo(r)?e=n:r.pop(),r.length&&r[0]===t[0]?Tr(r,eo(e,2)):[]}),Ho=Jr(function(t){var e=Uo(t),r=Se(t,ui);return(e="function"==typeof e?e:n)&&r.pop(),r.length&&r[0]===t[0]?Tr(r,n,e):[]});function Uo(t){var e=null==t?0:t.length;return e?t[e-1]:n}var Wo=Jr(Jo);function Jo(t,e){return t&&t.length&&e&&e.length?Gr(t,e):t}var qo=Yi(function(t,e){var n=null==t?0:t.length,r=rr(t,e);return Hr(t,Se(e,function(t){return ho(t,n)?+t:t}).sort(xi)),r});function Xo(t){return null==t?t:Mn.call(t)}var Yo=Jr(function(t){return ri(fr(t,1,Va,!0))}),Zo=Jr(function(t){var e=Uo(t);return Va(e)&&(e=n),ri(fr(t,1,Va,!0),eo(e,2))}),$o=Jr(function(t){var e=Uo(t);return e="function"==typeof e?e:n,ri(fr(t,1,Va,!0),n,e)});function Ko(t){if(!t||!t.length)return[];var e=0;return t=Me(t,function(t){if(Va(t))return e=yn(t.length,e),!0}),Ve(e,function(e){return Se(t,Be(e))})}function Qo(t,e){if(!t||!t.length)return[];var r=Ko(t);return null==e?r:Se(r,function(t){return ve(e,n,t)})}var ta=Jr(function(t,e){return Va(t)?lr(t,e):[]}),ea=Jr(function(t){return li(Me(t,Va))}),na=Jr(function(t){var e=Uo(t);return Va(e)&&(e=n),li(Me(t,Va),eo(e,2))}),ra=Jr(function(t){var e=Uo(t);return e="function"==typeof e?e:n,li(Me(t,Va),n,e)}),ia=Jr(Ko),oa=Jr(function(t){var e=t.length,r=e>1?t[e-1]:n;return Qo(t,r="function"==typeof r?(t.pop(),r):n)});function aa(t){var e=Nn(t);return e.__chain__=!0,e}function sa(t,e){return e(t)}var la=Yi(function(t){var e=t.length,r=e?t[0]:0,i=this.__wrapped__,o=function(e){return rr(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Hn&&ho(r)?((i=i.slice(r,+r+(e?1:0))).__actions__.push({func:sa,args:[o],thisArg:n}),new Gn(i,this.__chain__).thru(function(t){return e&&!t.length&&t.push(n),t})):this.thru(o)}),ca=Ci(function(t,e,n){Ft.call(t,n)?++t[n]:nr(t,n,1)}),ua=Pi(Bo),ha=Pi(jo);function da(t,e){return(ja(t)?be:cr)(t,eo(e,3))}function pa(t,e){return(ja(t)?function(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}:ur)(t,eo(e,3))}var fa=Ci(function(t,e,n){Ft.call(t,n)?t[n].push(e):nr(t,n,[e])}),ma=Jr(function(t,e,n){var r=-1,i="function"==typeof e,o=za(t)?Mt(t.length):[];return cr(t,function(t){o[++r]=i?ve(e,t,n):Er(t,e,n)}),o}),ga=Ci(function(t,e,n){nr(t,n,e)});function ya(t,e){return(ja(t)?Se:kr)(t,eo(e,3))}var va=Ci(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),xa=Jr(function(t,e){if(null==t)return[];var n=e.length;return n>1&&po(t,e[0],e[1])?e=[]:n>2&&po(e[0],e[1],e[2])&&(e=[e[0]]),zr(t,fr(e,1),[])}),ba=ln||function(){return ae.Date.now()};function wa(t,e,r){return e=r?n:e,e=t&&null==e?t.length:e,Ui(t,c,n,n,n,n,e)}function Ma(t,e){var i;if("function"!=typeof e)throw new Ot(r);return t=ls(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=n),i}}var _a=Jr(function(t,e,n){var r=1;if(n.length){var i=tn(n,to(_a));r|=s}return Ui(t,r,e,n,i)}),Ca=Jr(function(t,e,n){var r=3;if(n.length){var i=tn(n,to(Ca));r|=s}return Ui(e,r,t,n,i)});function Sa(t,e,i){var o,a,s,l,c,u,h=0,d=!1,p=!1,f=!0;if("function"!=typeof t)throw new Ot(r);function m(e){var r=o,i=a;return o=a=n,h=e,l=t.apply(i,r)}function g(t){var r=t-u;return u===n||r>=e||r<0||p&&t-h>=s}function y(){var t=ba();if(g(t))return v(t);c=So(y,function(t){var n=e-(t-u);return p?vn(n,s-(t-h)):n}(t))}function v(t){return c=n,f&&o?m(t):(o=a=n,l)}function x(){var t=ba(),r=g(t);if(o=arguments,a=this,u=t,r){if(c===n)return function(t){return h=t,c=So(y,e),d?m(t):l}(u);if(p)return mi(c),c=So(y,e),m(u)}return c===n&&(c=So(y,e)),l}return e=us(e)||0,Xa(i)&&(d=!!i.leading,s=(p="maxWait"in i)?yn(us(i.maxWait)||0,e):s,f="trailing"in i?!!i.trailing:f),x.cancel=function(){c!==n&&mi(c),h=0,o=u=a=c=n},x.flush=function(){return c===n?l:v(ba())},x}var Ta=Jr(function(t,e){return sr(t,1,e)}),Ea=Jr(function(t,e,n){return sr(t,us(e)||0,n)});function Da(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ot(r);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Da.Cache||Jn),n}function Aa(t){if("function"!=typeof t)throw new Ot(r);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Da.Cache=Jn;var Oa=pi(function(t,e){var n=(e=1==e.length&&ja(e[0])?Se(e[0],He(eo())):Se(fr(e,1),He(eo()))).length;return Jr(function(r){for(var i=-1,o=vn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return ve(t,this,r)})}),Pa=Jr(function(t,e){var r=tn(e,to(Pa));return Ui(t,s,n,e,r)}),La=Jr(function(t,e){var r=tn(e,to(La));return Ui(t,l,n,e,r)}),Ra=Yi(function(t,e){return Ui(t,u,n,n,n,e)});function Ia(t,e){return t===e||t!=t&&e!=e}var ka=Ni(_r),Fa=Ni(function(t,e){return t>=e}),Ba=Dr(function(){return arguments}())?Dr:function(t){return Ya(t)&&Ft.call(t,"callee")&&!oe.call(t,"callee")},ja=Mt.isArray,Na=de?He(de):function(t){return Ya(t)&&Mr(t)==L};function za(t){return null!=t&&qa(t.length)&&!Wa(t)}function Va(t){return Ya(t)&&za(t)}var Ga=pn||ul,Ha=pe?He(pe):function(t){return Ya(t)&&Mr(t)==x};function Ua(t){if(!Ya(t))return!1;var e=Mr(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Ka(t)}function Wa(t){if(!Xa(t))return!1;var e=Mr(t);return e==w||e==M||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ja(t){return"number"==typeof t&&t==ls(t)}function qa(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function Xa(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ya(t){return null!=t&&"object"==typeof t}var Za=fe?He(fe):function(t){return Ya(t)&&so(t)==_};function $a(t){return"number"==typeof t||Ya(t)&&Mr(t)==C}function Ka(t){if(!Ya(t)||Mr(t)!=S)return!1;var e=ee(t);if(null===e)return!0;var n=Ft.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&kt.call(n)==zt}var Qa=me?He(me):function(t){return Ya(t)&&Mr(t)==E},ts=ge?He(ge):function(t){return Ya(t)&&so(t)==D};function es(t){return"string"==typeof t||!ja(t)&&Ya(t)&&Mr(t)==A}function ns(t){return"symbol"==typeof t||Ya(t)&&Mr(t)==O}var rs=ye?He(ye):function(t){return Ya(t)&&qa(t.length)&&!!Qt[Mr(t)]},is=Ni(Ir),os=Ni(function(t,e){return t<=e});function as(t){if(!t)return[];if(za(t))return es(t)?rn(t):Mi(t);if(ue&&t[ue])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ue]());var e=so(t);return(e==_?Ke:e==D?en:Is)(t)}function ss(t){return t?(t=us(t))===h||t===-1/0?1.7976931348623157e308*(t<0?-1:1):t==t?t:0:0===t?t:0}function ls(t){var e=ss(t),n=e%1;return e==e?n?e-n:e:0}function cs(t){return t?ir(ls(t),0,f):0}function us(t){if("number"==typeof t)return t;if(ns(t))return p;if(Xa(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Xa(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ge(t);var n=mt.test(t);return n||yt.test(t)?re(t.slice(2),n?2:8):ft.test(t)?p:+t}function hs(t){return _i(t,Ts(t))}function ds(t){return null==t?"":ni(t)}var ps=Si(function(t,e){if(yo(e)||za(e))_i(e,Ss(e),t);else for(var n in e)Ft.call(e,n)&&Kn(t,n,e[n])}),fs=Si(function(t,e){_i(e,Ts(e),t)}),ms=Si(function(t,e,n,r){_i(e,Ts(e),t,r)}),gs=Si(function(t,e,n,r){_i(e,Ss(e),t,r)}),ys=Yi(rr),vs=Jr(function(t,e){t=Et(t);var r=-1,i=e.length,o=i>2?e[2]:n;for(o&&po(e[0],e[1],o)&&(i=1);++r<i;)for(var a=e[r],s=Ts(a),l=-1,c=s.length;++l<c;){var u=s[l],h=t[u];(h===n||Ia(h,Rt[u])&&!Ft.call(t,u))&&(t[u]=a[u])}return t}),xs=Jr(function(t){return t.push(n,Ji),ve(Ds,n,t)});function bs(t,e,r){var i=null==t?n:br(t,e);return i===n?r:i}function ws(t,e){return null!=t&&lo(t,e,Sr)}var Ms=Ii(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Nt.call(e)),t[e]=n},Xs($s)),_s=Ii(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Nt.call(e)),Ft.call(t,e)?t[e].push(n):t[e]=[n]},eo),Cs=Jr(Er);function Ss(t){return za(t)?Yn(t):Rr(t)}function Ts(t){return za(t)?Yn(t,!0):function(t){if(!Xa(t))return function(t){var e=[];if(null!=t)for(var n in Et(t))e.push(n);return e}(t);var e=yo(t),n=[];for(var r in t)("constructor"!=r||!e&&Ft.call(t,r))&&n.push(r);return n}(t)}var Es=Si(function(t,e,n){jr(t,e,n)}),Ds=Si(function(t,e,n,r){jr(t,e,n,r)}),As=Yi(function(t,e){var n={};if(null==t)return n;var r=!1;e=Se(e,function(e){return e=di(e,t),r||(r=e.length>1),e}),_i(t,$i(t),n),r&&(n=or(n,7,qi));for(var i=e.length;i--;)ii(n,e[i]);return n}),Os=Yi(function(t,e){return null==t?{}:function(t,e){return Vr(t,e,function(e,n){return ws(t,n)})}(t,e)});function Ps(t,e){if(null==t)return{};var n=Se($i(t),function(t){return[t]});return e=eo(e),Vr(t,n,function(t,n){return e(t,n[0])})}var Ls=Hi(Ss),Rs=Hi(Ts);function Is(t){return null==t?[]:Ue(t,Ss(t))}var ks=Ai(function(t,e,n){return e=e.toLowerCase(),t+(n?Fs(e):e)});function Fs(t){return Us(ds(t).toLowerCase())}function Bs(t){return(t=ds(t))&&t.replace(xt,Xe).replace(Jt,"")}var js=Ai(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Ns=Ai(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),zs=Di("toLowerCase"),Vs=Ai(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Gs=Ai(function(t,e,n){return t+(n?" ":"")+Us(e)}),Hs=Ai(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Us=Di("toUpperCase");function Ws(t,e,r){return t=ds(t),(e=r?n:e)===n?function(t){return Zt.test(t)}(t)?function(t){return t.match(Xt)||[]}(t):function(t){return t.match(ct)||[]}(t):t.match(e)||[]}var Js=Jr(function(t,e){try{return ve(t,n,e)}catch(t){return Ua(t)?t:new Ct(t)}}),qs=Yi(function(t,e){return be(e,function(e){e=Po(e),nr(t,e,_a(t[e],t))}),t});function Xs(t){return function(){return t}}var Ys=Li(),Zs=Li(!0);function $s(t){return t}function Ks(t){return Lr("function"==typeof t?t:or(t,1))}var Qs=Jr(function(t,e){return function(n){return Er(n,t,e)}}),tl=Jr(function(t,e){return function(n){return Er(t,n,e)}});function el(t,e,n){var r=Ss(e),i=xr(e,r);null!=n||Xa(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=xr(e,Ss(e)));var o=!(Xa(n)&&"chain"in n&&!n.chain),a=Wa(t);return be(i,function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Mi(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Te([this.value()],arguments))})}),t}function nl(){}var rl=Fi(Se),il=Fi(we),ol=Fi(Ae);function al(t){return fo(t)?Be(Po(t)):function(t){return function(e){return br(e,t)}}(t)}var sl=ji(),ll=ji(!0);function cl(){return[]}function ul(){return!1}var hl,dl=ki(function(t,e){return t+e},0),pl=Vi("ceil"),fl=ki(function(t,e){return t/e},1),ml=Vi("floor"),gl=ki(function(t,e){return t*e},1),yl=Vi("round"),vl=ki(function(t,e){return t-e},0);return Nn.after=function(t,e){if("function"!=typeof e)throw new Ot(r);return t=ls(t),function(){if(--t<1)return e.apply(this,arguments)}},Nn.ary=wa,Nn.assign=ps,Nn.assignIn=fs,Nn.assignInWith=ms,Nn.assignWith=gs,Nn.at=ys,Nn.before=Ma,Nn.bind=_a,Nn.bindAll=qs,Nn.bindKey=Ca,Nn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return ja(t)?t:[t]},Nn.chain=aa,Nn.chunk=function(t,e,r){e=(r?po(t,e,r):e===n)?1:yn(ls(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,a=0,s=Mt(un(i/e));o<i;)s[a++]=Zr(t,o,o+=e);return s},Nn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Nn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=Mt(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Te(ja(n)?Mi(n):[n],fr(e,1))},Nn.cond=function(t){var e=null==t?0:t.length,n=eo();return t=e?Se(t,function(t){if("function"!=typeof t[1])throw new Ot(r);return[n(t[0]),t[1]]}):[],Jr(function(n){for(var r=-1;++r<e;){var i=t[r];if(ve(i[0],this,n))return ve(i[1],this,n)}})},Nn.conforms=function(t){return function(t){var e=Ss(t);return function(n){return ar(n,t,e)}}(or(t,1))},Nn.constant=Xs,Nn.countBy=ca,Nn.create=function(t,e){var n=zn(t);return null==e?n:er(n,e)},Nn.curry=function t(e,r,i){var o=Ui(e,8,n,n,n,n,n,r=i?n:r);return o.placeholder=t.placeholder,o},Nn.curryRight=function t(e,r,i){var o=Ui(e,a,n,n,n,n,n,r=i?n:r);return o.placeholder=t.placeholder,o},Nn.debounce=Sa,Nn.defaults=vs,Nn.defaultsDeep=xs,Nn.defer=Ta,Nn.delay=Ea,Nn.difference=Io,Nn.differenceBy=ko,Nn.differenceWith=Fo,Nn.drop=function(t,e,r){var i=null==t?0:t.length;return i?Zr(t,(e=r||e===n?1:ls(e))<0?0:e,i):[]},Nn.dropRight=function(t,e,r){var i=null==t?0:t.length;return i?Zr(t,0,(e=i-(e=r||e===n?1:ls(e)))<0?0:e):[]},Nn.dropRightWhile=function(t,e){return t&&t.length?ai(t,eo(e,3),!0,!0):[]},Nn.dropWhile=function(t,e){return t&&t.length?ai(t,eo(e,3),!0):[]},Nn.fill=function(t,e,r,i){var o=null==t?0:t.length;return o?(r&&"number"!=typeof r&&po(t,e,r)&&(r=0,i=o),function(t,e,r,i){var o=t.length;for((r=ls(r))<0&&(r=-r>o?0:o+r),(i=i===n||i>o?o:ls(i))<0&&(i+=o),i=r>i?0:cs(i);r<i;)t[r++]=e;return t}(t,e,r,i)):[]},Nn.filter=function(t,e){return(ja(t)?Me:pr)(t,eo(e,3))},Nn.flatMap=function(t,e){return fr(ya(t,e),1)},Nn.flatMapDeep=function(t,e){return fr(ya(t,e),h)},Nn.flatMapDepth=function(t,e,r){return r=r===n?1:ls(r),fr(ya(t,e),r)},Nn.flatten=No,Nn.flattenDeep=function(t){return null!=t&&t.length?fr(t,h):[]},Nn.flattenDepth=function(t,e){return null!=t&&t.length?fr(t,e=e===n?1:ls(e)):[]},Nn.flip=function(t){return Ui(t,512)},Nn.flow=Ys,Nn.flowRight=Zs,Nn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Nn.functions=function(t){return null==t?[]:xr(t,Ss(t))},Nn.functionsIn=function(t){return null==t?[]:xr(t,Ts(t))},Nn.groupBy=fa,Nn.initial=function(t){return null!=t&&t.length?Zr(t,0,-1):[]},Nn.intersection=Vo,Nn.intersectionBy=Go,Nn.intersectionWith=Ho,Nn.invert=Ms,Nn.invertBy=_s,Nn.invokeMap=ma,Nn.iteratee=Ks,Nn.keyBy=ga,Nn.keys=Ss,Nn.keysIn=Ts,Nn.map=ya,Nn.mapKeys=function(t,e){var n={};return e=eo(e,3),yr(t,function(t,r,i){nr(n,e(t,r,i),t)}),n},Nn.mapValues=function(t,e){var n={};return e=eo(e,3),yr(t,function(t,r,i){nr(n,r,e(t,r,i))}),n},Nn.matches=function(t){return Fr(or(t,1))},Nn.matchesProperty=function(t,e){return Br(t,or(e,1))},Nn.memoize=Da,Nn.merge=Es,Nn.mergeWith=Ds,Nn.method=Qs,Nn.methodOf=tl,Nn.mixin=el,Nn.negate=Aa,Nn.nthArg=function(t){return t=ls(t),Jr(function(e){return Nr(e,t)})},Nn.omit=As,Nn.omitBy=function(t,e){return Ps(t,Aa(eo(e)))},Nn.once=function(t){return Ma(2,t)},Nn.orderBy=function(t,e,r,i){return null==t?[]:(ja(e)||(e=null==e?[]:[e]),ja(r=i?n:r)||(r=null==r?[]:[r]),zr(t,e,r))},Nn.over=rl,Nn.overArgs=Oa,Nn.overEvery=il,Nn.overSome=ol,Nn.partial=Pa,Nn.partialRight=La,Nn.partition=va,Nn.pick=Os,Nn.pickBy=Ps,Nn.property=al,Nn.propertyOf=function(t){return function(e){return null==t?n:br(t,e)}},Nn.pull=Wo,Nn.pullAll=Jo,Nn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Gr(t,e,eo(n,2)):t},Nn.pullAllWith=function(t,e,r){return t&&t.length&&e&&e.length?Gr(t,e,n,r):t},Nn.pullAt=qo,Nn.range=sl,Nn.rangeRight=ll,Nn.rearg=Ra,Nn.reject=function(t,e){return(ja(t)?Me:pr)(t,Aa(eo(e,3)))},Nn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=eo(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Hr(t,i),n},Nn.rest=function(t,e){if("function"!=typeof t)throw new Ot(r);return Jr(t,e=e===n?e:ls(e))},Nn.reverse=Xo,Nn.sampleSize=function(t,e,r){return e=(r?po(t,e,r):e===n)?1:ls(e),(ja(t)?function(t,e){return Ao(Mi(t),ir(e,0,t.length))}:function(t,e){var n=Is(t);return Ao(n,ir(e,0,n.length))})(t,e)},Nn.set=function(t,e,n){return null==t?t:qr(t,e,n)},Nn.setWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:qr(t,e,r,i)},Nn.shuffle=function(t){return(ja(t)?function(t){return Ao(Mi(t))}:function(t){return Ao(Is(t))})(t)},Nn.slice=function(t,e,r){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&po(t,e,r)?(e=0,r=i):(e=null==e?0:ls(e),r=r===n?i:ls(r)),Zr(t,e,r)):[]},Nn.sortBy=xa,Nn.sortedUniq=function(t){return t&&t.length?ti(t):[]},Nn.sortedUniqBy=function(t,e){return t&&t.length?ti(t,eo(e,2)):[]},Nn.split=function(t,e,r){return r&&"number"!=typeof r&&po(t,e,r)&&(e=r=n),(r=r===n?f:r>>>0)?(t=ds(t))&&("string"==typeof e||null!=e&&!Qa(e))&&!(e=ni(e))&&$e(t)?fi(rn(t),0,r):t.split(e,r):[]},Nn.spread=function(t,e){if("function"!=typeof t)throw new Ot(r);return e=null==e?0:yn(ls(e),0),Jr(function(n){var r=n[e],i=fi(n,0,e);return r&&Te(i,r),ve(t,this,i)})},Nn.tail=function(t){var e=null==t?0:t.length;return e?Zr(t,1,e):[]},Nn.take=function(t,e,r){return t&&t.length?Zr(t,0,(e=r||e===n?1:ls(e))<0?0:e):[]},Nn.takeRight=function(t,e,r){var i=null==t?0:t.length;return i?Zr(t,(e=i-(e=r||e===n?1:ls(e)))<0?0:e,i):[]},Nn.takeRightWhile=function(t,e){return t&&t.length?ai(t,eo(e,3),!1,!0):[]},Nn.takeWhile=function(t,e){return t&&t.length?ai(t,eo(e,3)):[]},Nn.tap=function(t,e){return e(t),t},Nn.throttle=function(t,e,n){var i=!0,o=!0;if("function"!=typeof t)throw new Ot(r);return Xa(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Sa(t,e,{leading:i,maxWait:e,trailing:o})},Nn.thru=sa,Nn.toArray=as,Nn.toPairs=Ls,Nn.toPairsIn=Rs,Nn.toPath=function(t){return ja(t)?Se(t,Po):ns(t)?[t]:Mi(Oo(ds(t)))},Nn.toPlainObject=hs,Nn.transform=function(t,e,n){var r=ja(t),i=r||Ga(t)||rs(t);if(e=eo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Xa(t)&&Wa(o)?zn(ee(t)):{}}return(i?be:yr)(t,function(t,r,i){return e(n,t,r,i)}),n},Nn.unary=function(t){return wa(t,1)},Nn.union=Yo,Nn.unionBy=Zo,Nn.unionWith=$o,Nn.uniq=function(t){return t&&t.length?ri(t):[]},Nn.uniqBy=function(t,e){return t&&t.length?ri(t,eo(e,2)):[]},Nn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?ri(t,n,e):[]},Nn.unset=function(t,e){return null==t||ii(t,e)},Nn.unzip=Ko,Nn.unzipWith=Qo,Nn.update=function(t,e,n){return null==t?t:oi(t,e,hi(n))},Nn.updateWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:oi(t,e,hi(r),i)},Nn.values=Is,Nn.valuesIn=function(t){return null==t?[]:Ue(t,Ts(t))},Nn.without=ta,Nn.words=Ws,Nn.wrap=function(t,e){return Pa(hi(e),t)},Nn.xor=ea,Nn.xorBy=na,Nn.xorWith=ra,Nn.zip=ia,Nn.zipObject=function(t,e){return ci(t||[],e||[],Kn)},Nn.zipObjectDeep=function(t,e){return ci(t||[],e||[],qr)},Nn.zipWith=oa,Nn.entries=Ls,Nn.entriesIn=Rs,Nn.extend=fs,Nn.extendWith=ms,el(Nn,Nn),Nn.add=dl,Nn.attempt=Js,Nn.camelCase=ks,Nn.capitalize=Fs,Nn.ceil=pl,Nn.clamp=function(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=(r=us(r))==r?r:0),e!==n&&(e=(e=us(e))==e?e:0),ir(us(t),e,r)},Nn.clone=function(t){return or(t,4)},Nn.cloneDeep=function(t){return or(t,5)},Nn.cloneDeepWith=function(t,e){return or(t,5,e="function"==typeof e?e:n)},Nn.cloneWith=function(t,e){return or(t,4,e="function"==typeof e?e:n)},Nn.conformsTo=function(t,e){return null==e||ar(t,e,Ss(e))},Nn.deburr=Bs,Nn.defaultTo=function(t,e){return null==t||t!=t?e:t},Nn.divide=fl,Nn.endsWith=function(t,e,r){t=ds(t),e=ni(e);var i=t.length,o=r=r===n?i:ir(ls(r),0,i);return(r-=e.length)>=0&&t.slice(r,o)==e},Nn.eq=Ia,Nn.escape=function(t){return(t=ds(t))&&Y.test(t)?t.replace(q,Ye):t},Nn.escapeRegExp=function(t){return(t=ds(t))&&rt.test(t)?t.replace(nt,"\\$&"):t},Nn.every=function(t,e,r){var i=ja(t)?we:hr;return r&&po(t,e,r)&&(e=n),i(t,eo(e,3))},Nn.find=ua,Nn.findIndex=Bo,Nn.findKey=function(t,e){return Pe(t,eo(e,3),yr)},Nn.findLast=ha,Nn.findLastIndex=jo,Nn.findLastKey=function(t,e){return Pe(t,eo(e,3),vr)},Nn.floor=ml,Nn.forEach=da,Nn.forEachRight=pa,Nn.forIn=function(t,e){return null==t?t:mr(t,eo(e,3),Ts)},Nn.forInRight=function(t,e){return null==t?t:gr(t,eo(e,3),Ts)},Nn.forOwn=function(t,e){return t&&yr(t,eo(e,3))},Nn.forOwnRight=function(t,e){return t&&vr(t,eo(e,3))},Nn.get=bs,Nn.gt=ka,Nn.gte=Fa,Nn.has=function(t,e){return null!=t&&lo(t,e,Cr)},Nn.hasIn=ws,Nn.head=zo,Nn.identity=$s,Nn.includes=function(t,e,n,r){t=za(t)?t:Is(t),n=n&&!r?ls(n):0;var i=t.length;return n<0&&(n=yn(i+n,0)),es(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Re(t,e,n)>-1},Nn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ls(n);return i<0&&(i=yn(r+i,0)),Re(t,e,i)},Nn.inRange=function(t,e,r){return e=ss(e),r===n?(r=e,e=0):r=ss(r),function(t,e,n){return t>=vn(e,n)&&t<yn(e,n)}(t=us(t),e,r)},Nn.invoke=Cs,Nn.isArguments=Ba,Nn.isArray=ja,Nn.isArrayBuffer=Na,Nn.isArrayLike=za,Nn.isArrayLikeObject=Va,Nn.isBoolean=function(t){return!0===t||!1===t||Ya(t)&&Mr(t)==v},Nn.isBuffer=Ga,Nn.isDate=Ha,Nn.isElement=function(t){return Ya(t)&&1===t.nodeType&&!Ka(t)},Nn.isEmpty=function(t){if(null==t)return!0;if(za(t)&&(ja(t)||"string"==typeof t||"function"==typeof t.splice||Ga(t)||rs(t)||Ba(t)))return!t.length;var e=so(t);if(e==_||e==D)return!t.size;if(yo(t))return!Rr(t).length;for(var n in t)if(Ft.call(t,n))return!1;return!0},Nn.isEqual=function(t,e){return Ar(t,e)},Nn.isEqualWith=function(t,e,r){var i=(r="function"==typeof r?r:n)?r(t,e):n;return i===n?Ar(t,e,n,r):!!i},Nn.isError=Ua,Nn.isFinite=function(t){return"number"==typeof t&&fn(t)},Nn.isFunction=Wa,Nn.isInteger=Ja,Nn.isLength=qa,Nn.isMap=Za,Nn.isMatch=function(t,e){return t===e||Or(t,e,ro(e))},Nn.isMatchWith=function(t,e,r){return r="function"==typeof r?r:n,Or(t,e,ro(e),r)},Nn.isNaN=function(t){return $a(t)&&t!=+t},Nn.isNative=function(t){if(go(t))throw new Ct("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Pr(t)},Nn.isNil=function(t){return null==t},Nn.isNull=function(t){return null===t},Nn.isNumber=$a,Nn.isObject=Xa,Nn.isObjectLike=Ya,Nn.isPlainObject=Ka,Nn.isRegExp=Qa,Nn.isSafeInteger=function(t){return Ja(t)&&t>=-9007199254740991&&t<=d},Nn.isSet=ts,Nn.isString=es,Nn.isSymbol=ns,Nn.isTypedArray=rs,Nn.isUndefined=function(t){return t===n},Nn.isWeakMap=function(t){return Ya(t)&&so(t)==P},Nn.isWeakSet=function(t){return Ya(t)&&"[object WeakSet]"==Mr(t)},Nn.join=function(t,e){return null==t?"":mn.call(t,e)},Nn.kebabCase=js,Nn.last=Uo,Nn.lastIndexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=ls(r))<0?yn(i+o,0):vn(o,i-1)),e==e?function(t,e,n){for(var r=o+1;r--;)if(t[r]===e)return r;return r}(t,e):Le(t,ke,o,!0)},Nn.lowerCase=Ns,Nn.lowerFirst=zs,Nn.lt=is,Nn.lte=os,Nn.max=function(t){return t&&t.length?dr(t,$s,_r):n},Nn.maxBy=function(t,e){return t&&t.length?dr(t,eo(e,2),_r):n},Nn.mean=function(t){return Fe(t,$s)},Nn.meanBy=function(t,e){return Fe(t,eo(e,2))},Nn.min=function(t){return t&&t.length?dr(t,$s,Ir):n},Nn.minBy=function(t,e){return t&&t.length?dr(t,eo(e,2),Ir):n},Nn.stubArray=cl,Nn.stubFalse=ul,Nn.stubObject=function(){return{}},Nn.stubString=function(){return""},Nn.stubTrue=function(){return!0},Nn.multiply=gl,Nn.nth=function(t,e){return t&&t.length?Nr(t,ls(e)):n},Nn.noConflict=function(){return ae._===this&&(ae._=Vt),this},Nn.noop=nl,Nn.now=ba,Nn.pad=function(t,e,n){t=ds(t);var r=(e=ls(e))?nn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Bi(hn(i),n)+t+Bi(un(i),n)},Nn.padEnd=function(t,e,n){t=ds(t);var r=(e=ls(e))?nn(t):0;return e&&r<e?t+Bi(e-r,n):t},Nn.padStart=function(t,e,n){t=ds(t);var r=(e=ls(e))?nn(t):0;return e&&r<e?Bi(e-r,n)+t:t},Nn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),bn(ds(t).replace(it,""),e||0)},Nn.random=function(t,e,r){if(r&&"boolean"!=typeof r&&po(t,e,r)&&(e=r=n),r===n&&("boolean"==typeof e?(r=e,e=n):"boolean"==typeof t&&(r=t,t=n)),t===n&&e===n?(t=0,e=1):(t=ss(t),e===n?(e=t,t=0):e=ss(e)),t>e){var i=t;t=e,e=i}if(r||t%1||e%1){var o=wn();return vn(t+o*(e-t+ne("1e-"+((o+"").length-1))),e)}return Ur(t,e)},Nn.reduce=function(t,e,n){var r=ja(t)?Ee:Ne,i=arguments.length<3;return r(t,eo(e,4),n,i,cr)},Nn.reduceRight=function(t,e,n){var r=ja(t)?De:Ne,i=arguments.length<3;return r(t,eo(e,4),n,i,ur)},Nn.repeat=function(t,e,r){return e=(r?po(t,e,r):e===n)?1:ls(e),Wr(ds(t),e)},Nn.replace=function(){var t=arguments,e=ds(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Nn.result=function(t,e,r){var i=-1,o=(e=di(e,t)).length;for(o||(o=1,t=n);++i<o;){var a=null==t?n:t[Po(e[i])];a===n&&(i=o,a=r),t=Wa(a)?a.call(t):a}return t},Nn.round=yl,Nn.runInContext=t,Nn.sample=function(t){return(ja(t)?Zn:function(t){return Zn(Is(t))})(t)},Nn.size=function(t){if(null==t)return 0;if(za(t))return es(t)?nn(t):t.length;var e=so(t);return e==_||e==D?t.size:Rr(t).length},Nn.snakeCase=Vs,Nn.some=function(t,e,r){var i=ja(t)?Ae:$r;return r&&po(t,e,r)&&(e=n),i(t,eo(e,3))},Nn.sortedIndex=function(t,e){return Kr(t,e)},Nn.sortedIndexBy=function(t,e,n){return Qr(t,e,eo(n,2))},Nn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=Kr(t,e);if(r<n&&Ia(t[r],e))return r}return-1},Nn.sortedLastIndex=function(t,e){return Kr(t,e,!0)},Nn.sortedLastIndexBy=function(t,e,n){return Qr(t,e,eo(n,2),!0)},Nn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=Kr(t,e,!0)-1;if(Ia(t[n],e))return n}return-1},Nn.startCase=Gs,Nn.startsWith=function(t,e,n){return t=ds(t),n=null==n?0:ir(ls(n),0,t.length),e=ni(e),t.slice(n,n+e.length)==e},Nn.subtract=vl,Nn.sum=function(t){return t&&t.length?ze(t,$s):0},Nn.sumBy=function(t,e){return t&&t.length?ze(t,eo(e,2)):0},Nn.template=function(t,e,r){var i=Nn.templateSettings;r&&po(t,e,r)&&(e=n),t=ds(t),e=ms({},e,i,Wi);var o,a,s=ms({},e.imports,i.imports,Wi),l=Ss(s),c=Ue(s,l),u=0,h=e.interpolate||bt,d="__p += '",p=Dt((e.escape||bt).source+"|"+h.source+"|"+(h===K?dt:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),f="//# sourceURL="+(Ft.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Kt+"]")+"\n";t.replace(p,function(e,n,r,i,s,l){return r||(r=i),d+=t.slice(u,l).replace(wt,Ze),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+e.length,e}),d+="';\n";var m=Ft.call(e,"variable")&&e.variable;if(m){if(ut.test(m))throw new Ct("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(H,""):d).replace(U,"$1").replace(W,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Js(function(){return St(l,f+"return "+d).apply(n,c)});if(g.source=d,Ua(g))throw g;return g},Nn.times=function(t,e){if((t=ls(t))<1||t>d)return[];var n=f,r=vn(t,f);e=eo(e),t-=f;for(var i=Ve(r,e);++n<t;)e(n);return i},Nn.toFinite=ss,Nn.toInteger=ls,Nn.toLength=cs,Nn.toLower=function(t){return ds(t).toLowerCase()},Nn.toNumber=us,Nn.toSafeInteger=function(t){return t?ir(ls(t),-9007199254740991,d):0===t?t:0},Nn.toString=ds,Nn.toUpper=function(t){return ds(t).toUpperCase()},Nn.trim=function(t,e,r){if((t=ds(t))&&(r||e===n))return Ge(t);if(!t||!(e=ni(e)))return t;var i=rn(t),o=rn(e);return fi(i,Je(i,o),qe(i,o)+1).join("")},Nn.trimEnd=function(t,e,r){if((t=ds(t))&&(r||e===n))return t.slice(0,on(t)+1);if(!t||!(e=ni(e)))return t;var i=rn(t);return fi(i,0,qe(i,rn(e))+1).join("")},Nn.trimStart=function(t,e,r){if((t=ds(t))&&(r||e===n))return t.replace(it,"");if(!t||!(e=ni(e)))return t;var i=rn(t);return fi(i,Je(i,rn(e))).join("")},Nn.truncate=function(t,e){var r=30,i="...";if(Xa(e)){var o="separator"in e?e.separator:o;r="length"in e?ls(e.length):r,i="omission"in e?ni(e.omission):i}var a=(t=ds(t)).length;if($e(t)){var s=rn(t);a=s.length}if(r>=a)return t;var l=r-nn(i);if(l<1)return i;var c=s?fi(s,0,l).join(""):t.slice(0,l);if(o===n)return c+i;if(s&&(l+=c.length-l),Qa(o)){if(t.slice(l).search(o)){var u,h=c;for(o.global||(o=Dt(o.source,ds(pt.exec(o))+"g")),o.lastIndex=0;u=o.exec(h);)var d=u.index;c=c.slice(0,d===n?l:d)}}else if(t.indexOf(ni(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+i},Nn.unescape=function(t){return(t=ds(t))&&X.test(t)?t.replace(J,an):t},Nn.uniqueId=function(t){var e=++Bt;return ds(t)+e},Nn.upperCase=Hs,Nn.upperFirst=Us,Nn.each=da,Nn.eachRight=pa,Nn.first=zo,el(Nn,(hl={},yr(Nn,function(t,e){Ft.call(Nn.prototype,e)||(hl[e]=t)}),hl),{chain:!1}),Nn.VERSION="4.17.21",be(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){Nn[t].placeholder=Nn}),be(["drop","take"],function(t,e){Hn.prototype[t]=function(r){r=r===n?1:yn(ls(r),0);var i=this.__filtered__&&!e?new Hn(this):this.clone();return i.__filtered__?i.__takeCount__=vn(r,i.__takeCount__):i.__views__.push({size:vn(r,f),type:t+(i.__dir__<0?"Right":"")}),i},Hn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),be(["filter","map","takeWhile"],function(t,e){var n=e+1,r=1==n||3==n;Hn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:eo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),be(["head","last"],function(t,e){var n="take"+(e?"Right":"");Hn.prototype[t]=function(){return this[n](1).value()[0]}}),be(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");Hn.prototype[t]=function(){return this.__filtered__?new Hn(this):this[n](1)}}),Hn.prototype.compact=function(){return this.filter($s)},Hn.prototype.find=function(t){return this.filter(t).head()},Hn.prototype.findLast=function(t){return this.reverse().find(t)},Hn.prototype.invokeMap=Jr(function(t,e){return"function"==typeof t?new Hn(this):this.map(function(n){return Er(n,t,e)})}),Hn.prototype.reject=function(t){return this.filter(Aa(eo(t)))},Hn.prototype.slice=function(t,e){t=ls(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Hn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(r=(e=ls(e))<0?r.dropRight(-e):r.take(e-t)),r)},Hn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Hn.prototype.toArray=function(){return this.take(f)},yr(Hn.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=Nn[i?"take"+("last"==e?"Right":""):e],a=i||/^find/.test(e);o&&(Nn.prototype[e]=function(){var e=this.__wrapped__,s=i?[1]:arguments,l=e instanceof Hn,c=s[0],u=l||ja(e),h=function(t){var e=o.apply(Nn,Te([t],s));return i&&d?e[0]:e};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=a&&!d,m=l&&!p;if(!a&&u){e=m?e:new Hn(this);var g=t.apply(e,s);return g.__actions__.push({func:sa,args:[h],thisArg:n}),new Gn(g,d)}return f&&m?t.apply(this,s):(g=this.thru(h),f?i?g.value()[0]:g.value():g)})}),be(["pop","push","shift","sort","splice","unshift"],function(t){var e=Pt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Nn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(ja(i)?i:[],t)}return this[n](function(n){return e.apply(ja(n)?n:[],t)})}}),yr(Hn.prototype,function(t,e){var n=Nn[e];if(n){var r=n.name+"";Ft.call(On,r)||(On[r]=[]),On[r].push({name:e,func:n})}}),On[Ri(n,2).name]=[{name:"wrapper",func:n}],Hn.prototype.clone=function(){var t=new Hn(this.__wrapped__);return t.__actions__=Mi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Mi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Mi(this.__views__),t},Hn.prototype.reverse=function(){if(this.__filtered__){var t=new Hn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Hn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=ja(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=vn(e,t+a);break;case"takeRight":t=yn(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,c=r?s:a-1,u=this.__iteratees__,h=u.length,d=0,p=vn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return si(t,this.__actions__);var f=[];t:for(;l--&&d<p;){for(var m=-1,g=t[c+=e];++m<h;){var y=u[m],v=y.iteratee,x=y.type,b=v(g);if(2==x)g=b;else if(!b){if(1==x)continue t;break t}}f[d++]=g}return f},Nn.prototype.at=la,Nn.prototype.chain=function(){return aa(this)},Nn.prototype.commit=function(){return new Gn(this.value(),this.__chain__)},Nn.prototype.next=function(){this.__values__===n&&(this.__values__=as(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},Nn.prototype.plant=function(t){for(var e,r=this;r instanceof Vn;){var i=Ro(r);i.__index__=0,i.__values__=n,e?o.__wrapped__=i:e=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,e},Nn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Hn){var e=t;return this.__actions__.length&&(e=new Hn(this)),(e=e.reverse()).__actions__.push({func:sa,args:[Xo],thisArg:n}),new Gn(e,this.__chain__)}return this.thru(Xo)},Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return si(this.__wrapped__,this.__actions__)},Nn.prototype.first=Nn.prototype.head,ue&&(Nn.prototype[ue]=function(){return this}),Nn}();le?((le.exports=sn)._=sn,se._=sn):ae._=sn}).call(commonjsGlobal)});function useCanvasResizeListener(t,e,n=100){return __awaiter(this,void 0,void 0,function*(){if(!store.state.MxFun)return void console.error("请先调用loadCoreCode方法! ");if(!t)return void console.error("请确保mxdrawObj参数 是通过调用MxFun.createMxObject的callback回调函数拿到的mxDraw对象");let r=t;if(!r.isLoadCanvasResizeListene){let i;r.isLoadCanvasResizeListene=!0,t.addEvent("addResizeEvent",t=>{i=t}),yield dynamicImport("element-resize-event-polyfill");let o=createCanvasParent(e);o.addEventListener?o.addEventListener("resize",lodash.throttle(function(t){i&&i()},n),!1):console.log("mx: parentdiv[addEventListener] invalid")}})}function createReandomId(t=10){return new Number(Math.random().toString().substr(3,t)+Date.now()).toString(36)}class MxCADObject{constructor(t){this._mxCAD=t}newFile(){this._mxCAD.newFile()}undo(){this._mxCAD.undo()}openFile(t,e){this._mxCAD.openFile(t,e)}saveFile(t,e){this._mxCAD.saveFile(t,e)}getDisplayFromServer(){this._mxCAD.getDisplayFromServer()}getFileName(){return this._mxCAD.getFileName()}getAllLayerData(){return this._mxCAD.getAllLayerData()}}class MxDbDatabase{constructor(t){this._mxDatabase=t}addLayer(t){return this._mxDatabase.addLayer(t)}showLayer(t,e){this._mxDatabase.showLayer(t,e)}setCurrentLayer(t){return this._mxDatabase.setCurrentLayer(t)}getLayer(t){return this._mxDatabase.getLayer(t)}addEntity(t){return this._mxDatabase.addMxEntity(t)}getGroup(t){return this._mxDatabase.getGroupDictionary().getAt(t)}addGroup(t){return this._mxDatabase.getGroupDictionary().add(t)}getEntityInGroup(t){return this._mxDatabase.getGroupDictionary().getEntityInGroup(t)}deleteGroup(t){return this._mxDatabase.getGroupDictionary().delete(t)}}function setGeometrPostion(t,e){for(let n=0;n<t.vertices.length;n++)t.vertices[n].x+=e.x,t.vertices[n].y+=e.y,t.vertices[n].z+=e.z}function repairGeometryFaceVertexUvs(t){t.computeBoundingBox();const e=t.boundingBox.min,n=t.boundingBox.max,r=new THREE.Vector2(0-e.x,0-e.y),i=new THREE.Vector2(n.x-e.x,n.y-e.y);t.faceVertexUvs[0]=[];const o=t.faces;for(let e=0;e<o.length;e++){const n=o[e],a=t.vertices[n.a],s=t.vertices[n.b],l=t.vertices[n.c];t.faceVertexUvs[0].push([new THREE.Vector2((a.x+r.x)/i.x,(a.y+r.y)/i.y),new THREE.Vector2((s.x+r.x)/i.x,(s.y+r.y)/i.y),new THREE.Vector2((l.x+r.x)/i.x,(l.y+r.y)/i.y)])}return t.uvsNeedUpdate=!0,t}function getToGenerateRoundedCorners(t,e,n=!0){if(e.length>0){const r=new THREE.CurvePath;n||t.push(t[0]);for(let i=0;i<t.length-1;i++){const o=e[i]||0;if(0===i&&!n){const e=t[0].clone().sub(t[1]);e.normalize();const n=t[1].clone();n.add(e.clone().multiplyScalar(o));const i=new THREE.LineCurve3(t[0],n);r.curves.push(i);continue}const a=!n||t[i-1]?t[i-1].clone().sub(t[i]):t[t.length-1].clone().sub(t[0]);a.normalize();const s=!n||t[i+1]?t[i+1].clone().sub(t[i]):t[1].clone().sub(t[0]);s.normalize(),t[i].clone().add(a.clone().multiplyScalar(o));const l=t[i].clone().add(a.clone().multiplyScalar(o)),c=t[i].clone(),u=t[i].clone().add(s.clone().multiplyScalar(o)),h=new THREE.QuadraticBezierCurve3(l,c,u);if(i===t.length-2){const e=t[i].clone();e.add(s.clone().multiplyScalar(o));const a=t[i+1].clone();n?a.add(s.clone().multiplyScalar(-o)):a.add(s.clone());const l=new THREE.LineCurve3(e,a);r.curves.push(h,l)}else r.curves.push(h);0===i&&t.push(t[0])}return r.getPoints(50)}return t}function computeRectPoints(t,e){return[t,t.clone().set(e.x,t.y,e.z),e,e.clone().set(t.x,e.y,t.z)]}function calculateArcOrigin(t,e,n){const r=t.x,i=e.x,o=n.x,a=t.y,s=e.y,l=n.y,c=r-i,u=a-s,h=r-o,d=a-l,p=(r*r-i*i+(a*a-s*s))/2,f=(r*r-o*o+(a*a-l*l))/2,m=u*h-c*d,g=-(d*p-u*f)/m,y=-(c*f-h*p)/m;return new THREE.Vector3(g,y,0)}function calculateRadiusArc(t,e){const n=t.x,r=t.y,i=e.x,o=e.y;return Math.sqrt((n-i)*(n-i)+(r-o)*(r-o))}function calculateArcAngle(t,e,n){const r=t.x,i=e.x;let o,a,s;return o=(t.y-e.y)/n,(a=(r-i)/n)>=.99999&&(a=.99999),a<=-.99999&&(a=-.99999),s=(s=Math.acos(a))/Math.PI*180,o<-.05&&(s=360-s),{sin:o,cos:a,angle:s}}function judgementArcRenderDirection(t,e,n){let r,i;return(i=t<e?e-t:e-t+360)>(r=t<n?n-t:n-t+360)}function createThreePointArc(t,e,n,r=!1,i=!1,o=new THREE.Color("#ff0000")){const a=calculateArcOrigin(t,e,n),s=a.x,l=a.y,c=calculateRadiusArc(t,a),u=calculateArcAngle(t,a,c),h=calculateArcAngle(e,a,c),d=calculateArcAngle(n,a,c);let p,f,m=u.angle,g=h.angle,y=d.angle,v=judgementArcRenderDirection(m,g,y);i&&(v=!0),r?(f=new THREE.ArcCurve(s,l,c,THREE.MathUtils.degToRad(m),THREE.MathUtils.degToRad(g),!v),p=v?g>m?THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle):360-Math.abs(THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle)):m>g?Math.abs(THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle)):360-THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle)):(f=new THREE.ArcCurve(s,l,c,THREE.MathUtils.degToRad(m),THREE.MathUtils.degToRad(y),v),p=v?y>m?360-THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle):Math.abs(THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle)):m>y?360+THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle):THREE.MathUtils.radToDeg(f.aEndAngle-f.aStartAngle));const x=p*Math.PI*c/180,b=(new THREE.BufferGeometry).setFromPoints(f.getPoints(50)),w=new THREE.LineBasicMaterial({color:o});return{arc:new THREE.Line(b,w),radius:c,angle:p,arcLength:x}}function computeRegularPolygonVertices(t=new THREE.Vector3,e=new THREE.Vector3,n=3){const r=[];n=Math.max(3,n),r.push(e);const i=2*Math.PI/n;for(let o=1;o<n;o++){const n=Math.cos(i*o),a=Math.sin(i*o),s=t.clone(),l=e.clone(),c=l.x-s.x,u=l.y-s.y,h=new THREE.Vector3(c*n-u*a+s.x,c*a+u*n+s.y);r.push(h)}return r}function computeBounding(t){if(0==t.length){let t=new THREE.Vector3;return{centerPoint:t,minPoint:t,maxPoint:t}}{let e=new THREE.Vector3(t[0].x,t[0].y,t[0].z||0),n=new THREE.Vector3(t[0].x,t[0].y,t[0].z||0),r=t.length;for(let i=1;i<r;i++){let r=t[i];e.x>r.x&&(e.x=r.x),e.y>r.y&&(e.y=r.y),n.x<r.x&&(n.x=r.x),n.y<r.y&&(n.y=r.y)}return{centerPoint:new THREE.Vector3(e.x+.5*(n.x-e.x),e.y+.5*(n.y-e.y),0),minPoint:e,maxPoint:n}}}function MxThreeJSMixin(t){return t.createImage=function(e,n,r,i,o){if(!o)return new Promise((o,a)=>{t.createImage.call(this,e,n,r,i,t=>o(t))});(new THREE.TextureLoader).load(i,function(t){let i=new THREE.PlaneGeometry(n,r),a=new THREE.MeshLambertMaterial({map:t,transparent:!0,side:THREE.DoubleSide});a.map&&(a.map.needsUpdate=!0),setGeometrPostion(i,e);let s=new THREE.Mesh(i,a);s.material.depthTest=!1,o&&o(s)},void 0,function(t){console.log(t),o&&o(null)})},t.loadSVG=function(t,e,n,r){return n?(store.state.MxFun.loadSVG(t,e,n,r),new Promise(t=>{t(null)})):new Promise(n=>{store.state.MxFun.loadSVG(t,e,t=>{n(t)},r)})},t.clacTextSize=((t,e)=>store.state.MxFun.getMxThreeJS().clacTextSize(t,e)),t.clacTextSpriteSize=((t,e,n)=>store.state.MxFun.getMxThreeJS().clacTextSpriteSize(t,e,n)),t.creatTextSprite=((t,e,n,r,i)=>store.state.MxFun.getMxThreeJS().creatTextSprite(t,e,n,r,i)),t}class MxThreeJS$1{createLine(t,e,n){const r=new THREE.Geometry,i=new THREE.LineBasicMaterial({color:n});return r.vertices.push(t,e),new THREE.Line(r,i)}createCircle(t,e,n){const r=new THREE.CircleGeometry(e,64,3,2*Math.PI),i=new THREE.LineBasicMaterial({color:n});r.vertices.shift();const o=new THREE.LineLoop(r,i),{x:a,y:s,z:l}=t;return o.position.set(a,s,l),o}createPoint(t,e,n=3){const r=new THREE.Geometry;r.vertices.push(t);const i=new THREE.PointsMaterial({color:e,size:n});return new THREE.Points(r,i)}createTriangle(t,e,n=1){if(t.length<3)return null;const r=t.length,i=new THREE.Geometry;for(let e=0;e+2<r;e+=3){i.vertices.push(t[e]),i.vertices.push(t[e+1]),i.vertices.push(t[e+2]);const n=new THREE.Face3(e,e+1,e+2);i.faces.push(n)}i.computeFaceNormals(),i.computeVertexNormals();const o=new THREE.MeshBasicMaterial({color:e,transparent:!0,depthTest:!1,side:THREE.DoubleSide,opacity:n});return new THREE.Mesh(i,o)}createLines(t,e){const n=new THREE.Geometry;n.vertices=t;const r=new THREE.LineBasicMaterial({color:e});return new THREE.Line(n,r)}createDashedLines(t,e,n,r){const i=new THREE.Geometry;i.vertices=t;const o=new THREE.Line(i,new THREE.LineDashedMaterial({color:e,dashSize:n,gapSize:r}));return o.computeLineDistances(),o}}const MxThreeJS=MxThreeJSMixin(new MxThreeJS$1);class MxDrawObject{constructor(t){this._mxdrawObj=t}getScene(){return this._mxdrawObj.getScene()}getCamera(){return this._mxdrawObj.getCamera()}getRenderer(){return this._mxdrawObj.renderer}setMouseRightRotate(t=!0){return this._mxdrawObj.setMouseRightRotate(t)}getFullDisplayRange(){return this._mxdrawObj.getFullDisplayRange()}getCanvas(){return this._mxdrawObj.getCanvas()}updateDisplay(){return this._mxdrawObj.updateDisplay()}createCanvasImageData(t,e){return this._mxdrawObj.createCanvasImageData(t,e)}setViewColor(t){return this._mxdrawObj.setViewColor(t)}setSize(t,e){return this._mxdrawObj.setSize(t,e)}getIntersectObjects(t){return this._mxdrawObj.getIntersectObjects(t)}addObject(t,e=!0){return this._mxdrawObj.addObject(t,e)}addViewObject(t){return this._mxdrawObj.addViewObject(t)}getViewWidth(){return this._mxdrawObj.getViewWidth()}getViewHeight(){return this._mxdrawObj.getViewHeight()}removeObject(t,e=!0){return this._mxdrawObj.removeObject(t,e)}zoomInitialStates(){return this._mxdrawObj.zoomInitialStates()}zoomScale(t){return this._mxdrawObj.zoomScale(t)}zoomW(t,e,n){return this._mxdrawObj.zoomW(t,e,n)}zoomCenter(t,e){return this._mxdrawObj.zoomCenter(t,e)}initZoomW(t,e){return this._mxdrawObj.initZoomW(t,e)}addEvent(t,e){return this._mxdrawObj.addEvent(t,e)}on(t,e){return this._mxdrawObj.addEvent(t,e)}setIniset(t){return this._mxdrawObj.setIniset(t)}screenCoord2World(t,e,n){return this._mxdrawObj.screenCoord2World(t,e,n)}worldCoord2Screen(t,e,n){return this._mxdrawObj.worldCoord2Screen(t,e,n)}screenCoord2Doc(t,e){return this._mxdrawObj.screenCoord2Doc(t,e,0)}worldCoordLong2Doc(t){return this._mxdrawObj.worldCoordLong2Doc(t)}docCoordLong2World(t){return this._mxdrawObj.docCoordLong2World(t)}docCoord2World(t,e,n){return this._mxdrawObj.docCoord2World(t,e,n)}docCoord2World2(t){return this._mxdrawObj.docCoord2World(t.x,t.y,t.z)}worldCoord2Doc(t,e,n){return this._mxdrawObj.worldCoord2Doc(t,e,n)}worldCoord2Doc2(t){return this._mxdrawObj.worldCoord2Doc(t.x,t.y,t.z)}docCoord2Screen(t,e){return this._mxdrawObj.docCoord2Screen(t,e,0)}screenCoordLong2Doc(t){return this._mxdrawObj.screenCoordLong2Doc(t)}docCoordLong2Screen(t){return this._mxdrawObj.docCoordLong2Screen(t)}screenCoordLong2World(t){return this._mxdrawObj.screenCoordLong2World(t)}worldCoordLong2Screen(t){return this._mxdrawObj.worldCoordLong2Screen(t)}initRendererParam(t){return this._mxdrawObj.initRendererParam(t)}addMxEntity(t){return this._mxdrawObj.addMxEntity(t)}getMxCurrentSelect(){let t=this._mxdrawObj.getMxAllSelect();return 0==t.length&&(t=this._mxdrawObj.getPrvCommandSelect()),t}addMxCurrentSelect(t){return this._mxdrawObj.addMxCurrentSelect(t)}clearMxCurrentSelect(){return this._mxdrawObj.clearMxCurrentSelect()}getMxEntity(t){return this._mxdrawObj.getMxEntityUserObject(t)}findMxEntityAtPoint(t,e,n){return this._mxdrawObj.findMxEntityAtPoint(t,e,n)}getAllMxEntity(){return this._mxdrawObj.getAllMxEntity()}setMouseMiddlePan(t){return this._mxdrawObj.setMouseMiddlePan(t)}resetThreeJSControls(){return this._mxdrawObj.resetThreeJSControls()}enableZoom(t){return this._mxdrawObj.enableZoom(t)}enablePan(t){return this._mxdrawObj.enablePan(t)}eraseMxEntity(t){return this._mxdrawObj.eraseMxEntity(t)}removeViewObject(t){this._mxdrawObj.removeViewObject(t)}saveMxEntityToJson(t){return JSON.stringify(this._mxdrawObj.saveMxEntityToJson(t))}saveMxEntityToObject(t){return this._mxdrawObj.saveMxEntityToJson(t)}loadMxEntityFromJson(t,e=null){return __awaiter(this,void 0,void 0,function*(){if(e){let t=e.length;for(let n=0;n<t;n++)yield MxThreeJS.loadSVG(e[n])}return this.getAllMxEntity().forEach(t=>{for(let e in t)Reflect.deleteProperty(t,e)}),"string"==typeof t?this._mxdrawObj.loadMxEntityFromJson(JSON.parse(t)):this._mxdrawObj.loadMxEntityFromJson(t)})}eraseAllMxEntity(){return this._mxdrawObj.eraseAllMxEntity()}makeCurrent(){this._mxdrawObj.makeCurrent()}getViewCenterDocCoord(){return this._mxdrawObj.getViewCenterDocCoord()}updateCanvasSize(){this._mxdrawObj.updateCanvasSize()}newFile(t,e,n,r){return this._mxdrawObj.newFile(t,e,n,r)}stopAllLoading(){this._mxdrawObj.stopAllLoading()}getOrbitControls(){return this._mxdrawObj.getOrbitControls()}enableViewControls(t){return this._mxdrawObj.enableViewControls(t)}getMxDatabase(){return new MxDbDatabase(this._mxdrawObj.getMxDatabase())}setZoomSpeed(t){return this._mxdrawObj.setZoomSpeed(t)}getMxCAD(){let t=this._mxdrawObj.getMxCAD();return new MxCADObject(t)}resetRenderer(){return this._mxdrawObj.resetRenderer()}setRequestHeader(t){return this._mxdrawObj.setRequestHeader(t)}closeWebSocket(){return this._mxdrawObj.closeWebSocket()}cadCoord2Doc(t,e,n){return this._mxdrawObj.cadCoord2Doc(t,e,n)}docCoord2Cad(t,e,n){return this._mxdrawObj.docCoord2Cad(t,e,n)}setViewAngle(t){return this._mxdrawObj.setViewAngle(t)}getViewAngle(){return this._mxdrawObj.getViewAngle()}getSysVar(t){return this._mxdrawObj.sysVariable().getSysVar()}setSysVar(t,e){return this._mxdrawObj.sysVariable().setSysVar(t,e)}isMxCAD(){return this._mxdrawObj.isMxCAD()}getMxObjectImplement(){return this._mxdrawObj}getAllLayoutName(){return this._mxdrawObj.getAllLayoutName()}getDtabaseJsonString(){return this._mxdrawObj.getDtabaseJsonString()}gotoLayout(t){return this._mxdrawObj.gotoLayout(t)}initMxCpp(t){return this._mxdrawObj.initMxCpp(t)}isWebgl2(){return this._mxdrawObj.isWebgl2()}getId(){return this._mxdrawObj.getId()}}class McEdGetPointWorldDrawObject{constructor(){var t;this._McEdGetPointWorldDraw=new(null===(t=store.state.MxFun)||void 0===t?void 0:t.getMxJigCmdManager().McEdGetPointWorldDrawObjectClass()),this._get=(()=>this._McEdGetPointWorldDraw)}drawCircle(t,e){return this._McEdGetPointWorldDraw.drawCircle(t,e)}drawLine(t,e){return this._McEdGetPointWorldDraw.drawLine(t,e)}drawEntity(t,e){return this._McEdGetPointWorldDraw.drawEntity(t,e)}drawText(t,e,n,r){return this._McEdGetPointWorldDraw.drawText(t,e,n,r)}setDraw(t){return this._McEdGetPointWorldDraw.setDraw(t)}setColor(t){return this._McEdGetPointWorldDraw.setColor(t)}getColor(){return this._McEdGetPointWorldDraw.getColor()}drawCustomEntity(t,e){return this._McEdGetPointWorldDraw.drawCustomEntity(t,e)}}let _MrxDbgUiPrPoint;class MrxDbgUiPrPoint{constructor(){var t;_MrxDbgUiPrPoint=new(null===(t=store.state.MxFun)||void 0===t?void 0:t.getMxJigCmdManager().getMrxDbgUiPrPointClass())}keyWords(){return _MrxDbgUiPrPoint.keyWords()}setKeyWords(t){return _MrxDbgUiPrPoint.setKeyWords(t)}message(){return _MrxDbgUiPrPoint.message()}setMessage(t){return _MrxDbgUiPrPoint.setMessage(t)}keyWordPicked(){return _MrxDbgUiPrPoint.keyWordPicked()}isKeyWordPicked(t){return _MrxDbgUiPrPoint.isKeyWordPicked(t)}setUserDraw(t){if("function"!=typeof t)return _MrxDbgUiPrPoint.setUserDraw(t._get?t._get():t);{const e=new McEdGetPointWorldDrawObject;e.setDraw(t),_MrxDbgUiPrPoint.setUserDraw(e._get())}}value(){return _MrxDbgUiPrPoint.value()}valueDocCoord(){return _MrxDbgUiPrPoint.valueDocCoord()}basePt(){return _MrxDbgUiPrPoint.basePt()}setBasePt(t){return _MrxDbgUiPrPoint.setBasePt(t)}setUseBasePt(t){return _MrxDbgUiPrPoint.setUseBasePt(t)}go(t){return t?(_MrxDbgUiPrPoint.go(t),new Promise((t,e)=>{t(null)})):new Promise((t,e)=>{_MrxDbgUiPrPoint.go(e=>{t(0!=e?null:_MrxDbgUiPrPoint.value())})})}goWhile(t,e){return _MrxDbgUiPrPoint.goWhile(t,e)}drawReserve(t){return _MrxDbgUiPrPoint.drawReserve(t)}setInputToucheType(t){return _MrxDbgUiPrPoint.setInputToucheType(t)}getInputToucheType(){return _MrxDbgUiPrPoint.getInputToucheType()}}class MxVueComandLine{constructor(){this.msCmdText="",this.msCmdDisplay="",this.msCmdTip="",this.mUpDisplayFun=void 0,this.mxFunObject=void 0,this.mountUpDisplayFun=(t=>{this.mUpDisplayFun=t}),this.setCmdText=(t=>{this.msCmdText=t}),this.getCmdText=(()=>this.msCmdText),this.getCmdDisplay=(()=>this.msCmdDisplay),this.setCmdDisplay=(t=>{this.msCmdDisplay=t}),this.addCmdDisplay=(t=>{this.msCmdDisplay.length>1024?(this.msCmdDisplay=this.msCmdDisplay.substring(this.msCmdDisplay.length-1024,this.msCmdDisplay.length),this.msCmdDisplay=this.msCmdDisplay+t):this.msCmdDisplay=this.msCmdDisplay+t}),this.setCmdTip=(t=>{this.msCmdTip=t}),this.getCmdTip=(()=>this.msCmdTip)}upDisplay(){const{msCmdTip:t,msCmdDisplay:e,msCmdText:n}=this;null!=this.mUpDisplayFun&&this.mUpDisplayFun({msCmdTip:t,msCmdDisplay:e,msCmdText:n})}}const MxInputType={kNoInput:0,kXYCoordInput:1,kDistanceInput:2,kDynTip:3},MxInputPostionType={kRelative:0,kAbsolutely:1};class MxDynamicInput{constructor(){this.mType=MxInputType.kNoInput,this.mPos=[0,0],this.mTip="",this.mValue1="",this.mValue1Pos=[0,0],this.mValue2="",this.mValue2Pos=[0,0],this.misShow=!1,this.mOnKeydownEvent=void 0,this.mFocusValue="",this.setFocusValue=(t=>{this.mFocusValue=t}),this.getFocusValue=(()=>this.mFocusValue),this.mountKeydownEvent=(t=>{this.mOnKeydownEvent=t}),this.onKeydown=(t=>{null!=this.mOnKeydownEvent&&this.mOnKeydownEvent(t)}),this.setType=(t=>{this.mType=t}),this.getType=(()=>this.mType),this.isShow=(()=>this.misShow),this.setPos=(t=>{this.mPos=t}),this.setTip=(t=>{this.mTip=t}),this.setValue1=(t=>{this.mValue1=t}),this.getValue1=(()=>this.mValue1),this.setValue1Pos=(t=>{this.mValue1Pos=t}),this.setValue2=(t=>{this.mValue2=t}),this.getValue2=(()=>this.mValue2),this.setValue2Pos=(t=>{this.mValue2Pos=t}),this.setShow=(t=>{this.misShow=t}),this.getData=(()=>{if(!this.misShow)return;let t={list:[{value:"",readonly:!0},{value:"",readonly:!1},{value:"",readonly:!1}],pos:this.mPos,postype:MxInputPostionType.kRelative};return this.mType!=MxInputType.kNoInput?(this.mType==MxInputType.kXYCoordInput?(t.list[0].show=!0,t.list[0].value=this.mTip,t.list[0].readonly=!0,t.list[1].show=!0,t.list[1].value=this.mValue1,t.list[1].readonly=!1,t.list[2].show=!0,t.list[2].value=this.mValue2,t.list[2].readonly=!1):this.mType==MxInputType.kDistanceInput?(t.list[0].show=!0,t.list[0].value=this.mTip,t.list[0].readonly=!0,t.list[1].show=!0,t.list[1].value=this.mValue1,t.list[1].readonly=!1,t.list[1].pos=this.mValue1Pos,t.list[2].show=!0,t.list[2].value=this.mValue2,t.list[2].readonly=!0,t.list[2].pos=this.mValue2Pos,t.postype=MxInputPostionType.kAbsolutely):this.mType==MxInputType.kDynTip?(t.list[0].show=!0,t.list[0].value=this.mTip,t.list[0].readonly=!0,t.list[1].show=!1,t.list[2].show=!1):t=void 0,t):void 0})}}const CursorType={kNormal:"Normal",kRect:"Rect",kCross:"Cross"};class MxVueInterface{constructor(){this.mSetCoordFun=void 0,this.mUpdateCursorFun=void 0,this.mOnKeydownEvent=void 0,this.mCursorType=CursorType.kNormal,this.mComandLine=new MxVueComandLine,this.mdynamicInput=new MxDynamicInput,this.mMxEvents={},this.mountSetCoordFun=(t=>{this.mSetCoordFun=t}),this.mountUpdateCursorFun=(t=>{this.mUpdateCursorFun=t}),this.mountKeydownEvent=(t=>{this.mOnKeydownEvent=t}),this.onKeydown=(t=>{null!=this.mOnKeydownEvent&&this.mOnKeydownEvent(t)}),this.setTipCoord=(t=>{null!=this.mSetCoordFun&&this.mSetCoordFun(t)}),this.getCursorType=(()=>this.mCursorType),this.setCursorType=(t=>{if("number"==typeof t)switch(t){case 0:this.mCursorType=CursorType.kNormal;break;case 1:this.mCursorType=CursorType.kRect;break;case 2:this.mCursorType=CursorType.kCross}else this.mCursorType=t;null!=this.mUpdateCursorFun&&this.mUpdateCursorFun(this.mCursorType)}),this.getTitle=(()=>this.mTitle),this.getTopButtonBarData=(()=>this.mTopButtonBarData),this.getMenuBarData=(()=>this.mMenuBarData),this.getRighButtonBarData=(()=>this.mRighButtonBarData),this.getLeftButtonBarData=(()=>this.mLeftButtonBarData),this.getTitleButtonBarData=(()=>this.mTitleButtonBarData),this.getLayerComboxData=(()=>this.mLayerComboxData),this.getColorComboxData=(()=>this.mColorComboxData),this.getLinetypeComboxData=(()=>this.mLinetypeComboxData),this.getFooterData=(()=>this.mFooterData),this.sendStringToExecute=(t=>{this.mxFunObject.sendStringToExecute(t)}),this.getCmdLine=(()=>this.mComandLine),this.getDynamicInput=(()=>this.mdynamicInput),this.init=(t=>{this.mxFunObject=t}),this.OnMxEvent=(t=>{const e=t.name;if(null==e)return;const n=this.mMxEvents[e];null!=n&&n(t.param)}),this.mountMxEvent=((t,e)=>{this.mMxEvents[t]=e})}}const mxUiData$1=new MxVueInterface;let mxUiData=mxUiData$1;class MxFunClass{constructor(){this.listenForUpdateCursor=(t=>{mxUiData.mountUpdateCursorFun(t)})}createMxObject({canvasId:t=createReandomId(),cadFile:e="",callback:n,isNewFile:r=!1,useWebsocket:i=!1,isAutoResize:o=!0,mapBox:a,isMxCAD:s=!1,userIdentitySign:l="emptyUserIdentity",isCPPMxCAD:c=!1}){if(this.initUiDataObject(mxUiData),!i&&r&&(r=!1),a){const t=a.canvas;store.state.MxFun.createMxObject(t,e,e=>{let r=new MxDrawObject(e);e.setIniset({EnableOsnapFunction:!0}),n&&n(r,{canvas:t,canvasParent:void 0})},void 0,r,i,a)}else if(c){const e=createCanvas(t),r=createCanvasParent(e);r.parentNode&&11!=r.parentNode.nodeType||document.body.appendChild(r);let i=!0;store.state.MxFun.createMxObject(t,"",t=>{let i=new MxDrawObject(t);t.setMouseRightRotate(!1),t.setIniset({EnableOsnapFunction:!0}),t.addEvent("onResize",()=>(r.tabindex=3,{width:r.clientWidth,height:r.clientHeight})),o&&useCanvasResizeListener(i,e),n&&n(i,{canvas:e,canvasParent:r})},i,!1,!1,void 0,c)}else{const a=createCanvas(t),c=createCanvasParent(a);let u;c.parentNode&&11!=c.parentNode.nodeType||document.body.appendChild(c),s&&(u=!0,i=!0),store.state.MxFun.createMxObject(t,e,t=>{let e=new MxDrawObject(t);if(s){const e=2;0==l.length&&(l="invalidUserIdentity"),t.initRunMode(e),t.initUserLoginData(l,"")}t.setMouseRightRotate(!1),t.setIniset({EnableOsnapFunction:!0}),t.addEvent("onResize",()=>(c.tabindex=3,{width:c.clientWidth,height:c.clientHeight})),o&&useCanvasResizeListener(e,a),n&&n(e,{canvas:a,canvasParent:c})},u,r,i,void 0)}}setMxServer(t="ws://localhost:5090"){store.state.MxFun.setMxServer(t)}enablStaticLoad(t){store.state.MxFun.enablStaticLoad(t)}setStaticServer(t){store.state.MxFun.setStaticServer(t)}addCommand(t,e){store.state.MxFun.addCommand(t,e)}sendStringToExecute(t,...e){return store.state.MxFun.sendStringToExecute(t,...e)}call(t,e,n){return store.state.MxFun.call(t,e,n)}getCurrentDraw(){return new MxDrawObject(store.state.MxFun.getCurrentDraw())}getCurrentDatabase(){let t=store.state.MxFun.getCurrentDraw();return new MxDbDatabase(t.getMxDatabase())}screenCoordLong2World(t){return store.state.MxFun.screenCoordLong2World(t)}screenCoordLong2Doc(t){return store.state.MxFun.screenCoordLong2Doc(t)}docCoordLong2Screen(t){return store.state.MxFun.docCoordLong2Screen(t)}worldCoordLong2Doc(t){return store.state.MxFun.worldCoordLong2Doc(t)}docCoordLong2World(t){return store.state.MxFun.docCoordLong2World(t)}screenCoord2World(t,e,n){return store.state.MxFun.screenCoord2World(t,e,n)}worldCoord2Screen(t,e,n){return store.state.MxFun.worldCoord2Screen(t,e,n)}docCoord2World(t,e,n){return store.state.MxFun.docCoord2World(t,e,n)}worldCoord2Doc(t,e,n){return store.state.MxFun.worldCoord2Doc(t,e,n)}screenCoord2Doc(t,e){return store.state.MxFun.screenCoord2Doc(t,e,0)}docCoord2Screen(t,e){return store.state.MxFun.docCoord2Screen(t,e,0)}updateDisplay(){return store.state.MxFun.updateDisplay()}addWindowsEvent(t){return store.state.MxFun.addWindowsEvent(t)}isRunningCommand(){return store.state.MxFun.isRunningCommand()}zoomW(t,e,n,r,i){return store.state.MxFun.zoomW(t,e,n,r,i)}showLayer(t,e,n){return store.state.MxFun.showLayer(t,e,n)}getCurrentMxCAD(){let t=store.state.MxFun.getCurrentMxCAD();return new MxCADObject(t)}getQueryString(t){return store.state.MxFun.getQueryString(t)}setIniset(t){return store.state.MxFun.setIniset(t)}upDisplayForLayerData(t){return store.state.MxFun.upDisplayForLayerData(t)}initUiDataObject(t){return mxUiData=t,store.state.MxFun.initUiDataObject(t)}getUIData(){return mxUiData}testMX(t){return 11}loadImageMaterial(t,e){return e?(store.state.MxFun.loadImageMaterial(t,e),new Promise((t,e)=>{t(null)})):new Promise((e,n)=>{store.state.MxFun.loadImageMaterial(t,t=>{e(t||null)})})}openFile(t,e=!1){return store.state.MxFun.openFile(t,e)}addToCurrentSpace(t){return this.getCurrentDraw().addMxEntity(t)}selectEnt(t,e=null){return new Promise((n,r)=>{const i=new MrxDbgUiPrPoint;i.setMessage(t),i.go(t=>{if(0!=t)return void n(0);const r=i.value();let o=this.getCurrentDraw().findMxEntityAtPoint(r),a=0;for(;0!=o.length;){let t=o.length;for(let n=0;n<t;n++){let t=o[n];if(!e||!e.type||e.type==t.getTypeName()){a=t.objectId();break}}break}n(a)})})}listenForCommandLineInput(t){mxUiData.getCmdLine().mountUpDisplayFun(t)}setCommandLineInputData(t,e){mxUiData.getCmdLine().setCmdText(t),mxUiData.onKeydown(e)}listenForCoordTip(t){mxUiData.mountSetCoordFun(t)}getMxFunTHREE(){return store.state.MxFun.getTHREE()}getMxFunThreeTool(){return store.state.MxFun.getMxThreeJS()}ceneratecursor(t=128,e=10,n=!0,r){return store.state.MxFun.ceneratecursor(t,e,n,r)}callCommand(t,e,n){return store.state.MxFun.callCommand(t,e,n)}cadCoord2Doc(t,e,n){return store.state.MxFun.cadCoord2Doc(t,e,n)}docCoord2Cad(t,e,n){return store.state.MxFun.docCoord2Cad(t,e,n)}getMxEntity(t){return store.state.MxFun.getMxEntity(t)}getCurrentMousePostion(){let t=store.state.MxFun.getCurrentMousePostion();return new THREE.Vector3(t.x,t.y,0)}stopRunCommand(){return store.state.MxFun.stopRunCommand()}}const MxFun=new MxFunClass;var MxCloneType,MxDefaultRenderOrder,InputToucheType;!function(t){t[t.kClone=1]="kClone",t[t.kDragClone=2]="kDragClone",t[t.kMxFileClone=3]="kMxFileClone",t[t.kSaveDwgClone=4]="kSaveDwgClone"}(MxCloneType||(MxCloneType={})),function(t){t[t.kCADMeshRenderOrder=10]="kCADMeshRenderOrder",t[t.kCADCurveRenderOrder=20]="kCADCurveRenderOrder",t[t.kMxEntityRenderOrder=30]="kMxEntityRenderOrder",t[t.kGripRenderOrder=110]="kGripRenderOrder",t[t.kDynJigRenderOrder=120]="kDynJigRenderOrder"}(MxDefaultRenderOrder||(MxDefaultRenderOrder={})),function(t){t[t.kGetBegan=1]="kGetBegan",t[t.kGetEnd=2]="kGetEnd"}(InputToucheType||(InputToucheType={}));var MxType=Object.freeze({__proto__:null,get MxCloneType(){return MxCloneType},get MxDefaultRenderOrder(){return MxDefaultRenderOrder},get InputToucheType(){return InputToucheType}});class MxassemblyClass{constructor(){this.mxassembly=null}initImp(){this.mxassembly||store.state.Mxassembly&&(this.mxassembly=store.state.Mxassembly)}NewMcGePoint3d(t,e,n){this.initImp();let r=new this.mxassembly.McGePoint3d;return t&&(r.x=t),e&&(r.y=e),n&&(r.z=n),r}NewMcGePoint3dArray(t){this.initImp();let e=new this.mxassembly.McGePoint3dArray;return t&&t.forEach(t=>{let n=this.NewMcGePoint3d();n.x=t.x,n.y=t.y,n.z=t.z,e.append(n)}),e}}const Mxassembly=new MxassemblyClass;class McGeToolClass{constructor(){this.mxgeTool=null}initImp(){this.mxgeTool||store.state.Mxassembly&&(this.mxgeTool=new store.state.Mxassembly.McGeTool)}calcArea(t){if(this.initImp(),t instanceof Array){let e=Mxassembly.NewMcGePoint3dArray(t);return this.mxgeTool.calcArea(e)}return this.mxgeTool.calcArea(t)}pointInPolyline(t,e){this.initImp();let n=e;e instanceof Array&&(n=Mxassembly.NewMcGePoint3dArray(e));let r=Mxassembly.NewMcGePoint3d(t.x,t.y,t.z);return this.mxgeTool.pointInPolyline(r,n)}}const McGeTool=new McGeToolClass;class MrxDbgUtilsClass{constructor(){this.imp=null}initImp(){if(!this.imp&&store.state.MxFun){let t=store.state.MxFun;this.imp=new t.getMrxDbgUtilsClass}}findEntAtPoint(t,e=null,n,r=!0,i){return this.initImp(),n||(n=MxFun.getCurrentDraw()),this.imp.findEntAtPoint(n.getMxObjectImplement(),t,e,r,i)}selectEnt(t,e){return this.initImp(),this.imp.selectEnt(t)}}const MrxDbgUtils=new MrxDbgUtilsClass,MxPaintBrushProps={},MxPaintBrush={getProps:()=>MxPaintBrushProps,setProps:t=>Object.assign(MxPaintBrushProps,t),use:t=>Object.assign(t,MxPaintBrushProps)};var MrxDbgUiPrBaseReturn;!function(t){t[t.kCancel=-2]="kCancel",t[t.kNone=-1]="kNone",t[t.kOk=0]="kOk",t[t.kKeyWord=1]="kKeyWord"}(MrxDbgUiPrBaseReturn||(MrxDbgUiPrBaseReturn={}));var MrxDbgUiPrBaseReturn$1=MrxDbgUiPrBaseReturn,DataType;!function(t){t[t.Default=0]="Default",t[t.Color=1]="Color",t[t.Vector2=2]="Vector2",t[t.Vector3=3]="Vector3",t[t.Vector4=4]="Vector4",t[t.Matrix3=5]="Matrix3",t[t.Matrix4=6]="Matrix4"}(DataType||(DataType={}));const MXDBDATATYPE="datatype";function getDwgKeyVal(t,e){let n,r="";return lodash.isObject(e)?(n=e.default,r=e.key):"string"==typeof e&&(r=e),[r,void 0===t[r]?n:t[r]]}class MxDbEntity{constructor(){this.color=16777215,this.renderOrder=30,this.opacity=1,this.visible=!0,this.userData={},this.sGuid="",this.dLineWidth=0,this.lineWidthByPixels=!0,this.dDashArray=0,this.dDashRatio=0,this.layer="",this._event={};const t=this.constructor;t.isPaintBrushDraw&&(MxPaintBrush.use(this),t.isPaintBrushDraw=!1)}static register(){const t=this;t.isRegister||(t.cmd&&t.draw&&MxFun.addCommand(t.cmd,t.draw),(new t).rxInit(),t.isRegister=!0)}static use(){return __awaiter(this,void 0,void 0,function*(){const t=this;t.register(),t.isPaintBrushDraw=!0,t.cmd&&MxFun.sendStringToExecute(t.cmd)})}initGuid(t){this.sGuid.length>0?console.log("mx: init guid error"):this.sGuid=t}dwgInHelp(t,e,n){let r=this;const i=t.type===MxType.MxCloneType.kMxFileClone||t.type===MxType.MxCloneType.kSaveDwgClone,o=t=>{if(!t)return;const{value:e,[MXDBDATATYPE]:r}=t;switch(r){case DataType.Color:return new THREE.Color(...e);case DataType.Vector2:return new THREE.Vector2(...e);case DataType.Vector3:return new THREE.Vector3(...e);case DataType.Vector4:return new THREE.Vector4(...e);case DataType.Matrix3:return(new THREE.Matrix3).fromArray(e);case DataType.Matrix4:return(new THREE.Matrix4).fromArray(e)}return n&&n.getCacheVal?n.getCacheVal(t):void 0};function a(t){return t instanceof THREE.Color||t instanceof THREE.Vector2||t instanceof THREE.Vector3||t instanceof THREE.Vector4||t instanceof THREE.Matrix3||t instanceof THREE.Matrix4?t.clone():n&&n.getVal?n.getVal(t):void 0}return e.forEach(e=>{const[n,s]=getDwgKeyVal(t,e);r[n]=lodash.cloneDeepWith(s,i?o:a)}),!0}dwgOutHelp(t,e){const n=t=>t instanceof THREE.Color?{[MXDBDATATYPE]:DataType.Color,value:t.toArray()}:t instanceof THREE.Vector2?{[MXDBDATATYPE]:DataType.Vector2,value:t.toArray()}:t instanceof THREE.Vector3?{[MXDBDATATYPE]:DataType.Vector3,value:t.toArray()}:t instanceof THREE.Vector4?{[MXDBDATATYPE]:DataType.Vector4,value:t.toArray()}:t instanceof THREE.Matrix3?{[MXDBDATATYPE]:DataType.Matrix3,value:t.toArray()}:t instanceof THREE.Matrix4?{[MXDBDATATYPE]:DataType.Matrix4,value:t.toArray()}:void 0;let r=this;const i=t.type===MxType.MxCloneType.kMxFileClone||t.type===MxType.MxCloneType.kSaveDwgClone;return e.forEach(e=>{const[o,a]=getDwgKeyVal(r,e);t[o]=i?lodash.cloneDeepWith(a,n):a}),t}callEvent(t,e){return null!=this._event[t]?this._event[t](e):void 0}create(t){return new(0,this.constructor)(t)}transformBy(t){}getGeomExtents(){return null}getClosestPointTo(t,e=0){return null}getImp(){return this.MxDbEntityImp}setNeedUpdateDisplay(t){let e=this.getImp();return!!e&&(t?e.upDisplay():e.setDirtyDisplay(!0),!0)}getMxObject(){let t=this.getImp();return t?t.getMxObject():null}onViewChange(){return!1}objectId(){let t=this.getImp();return t?t.objectId():0}erase(){let t=this.getImp();return!!t&&t.erase()}setLayer(t){let e=this.getImp();e&&e.nodifySetLayer(),this.layer=t}getLayer(){return this.layer}setColor(t){return this.color=t,this}getColor(){return this.color||16777215}clone(t){let e=this.create(),n={type:t||MxType.MxCloneType.kClone};return this.dwgOut(n),e.dwgIn(n),e.sGuid="",e}onDwgIn(t){this.color=t.color,this.renderOrder=t.renderOrder,this.opacity=t.opacity,this.visible=t.visible,t.userData?this.userData=JSON.parse(JSON.stringify(t.userData)):this.userData={},this.dLineWidth=t.lineWidth,this.lineWidthByPixels=t.lineWidthByPixels,this.dDashArray=t.dashArray,this.dDashRatio=t.dashRatio,this.layer=t.layer,t.guid&&(this.sGuid=t.guid)}onDwgOut(t){t.color=this.color,t.renderOrder=this.renderOrder,t.opacity=this.opacity,t.visible=this.visible,t.lineWidth=this.dLineWidth,t.lineWidthByPixels=this.lineWidthByPixels,t.dashArray=this.dDashArray,t.dashRatio=this.dDashRatio,t.layer=this.layer,t.guid=this.sGuid,Object.keys(this.userData).length>0&&(t.userData=this.userData)}rxInit(){store.state.MxFun.initMxDbEntityType(this)}setRenderOrder(t){this.renderOrder=t}getRenderOrder(){return this.renderOrder}setLineWidthByPixels(t){return this.lineWidthByPixels=t,this}getLineWidthByPixels(){return this.lineWidthByPixels}setLineWidth(t){return this.dLineWidth=t,this}getLineWidth(){return this.dLineWidth}getGetLength(){return 0}setDashLen(t){let e=this.getGetLength();if(e<1e-6||t<1e-6)return this;let n=Math.floor(e/t);return n<1e-6&&(this.dDashRatio=0),this.dDashArray=1/n,this}setDashRatio(t){return this.dDashRatio=t,this}setDashArray(t){return this.dDashArray=t,this}setDash(t,e){return this.dDashArray=t,this.dDashRatio=e,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0),this}getDash(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}}setDashLineDisplay(t){return t?(this.dDashArray<1e-5&&(this.dDashArray=.03),this.dDashRatio<1e-5&&(this.dDashRatio=.1),0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)):(this.dDashArray=0,this.dDashRatio=0),this}isDashLineDisplay(){return this.dDashArray>0&&this.dDashRatio>0}guid(){return this.sGuid}onEndGripEidt(){this.callEvent("onEndGripEidt")}onStartGripEidt(){return this.callEvent("onStartGripEidt")}addEvent(t,e){this._event[t]=e}removeEvent(t){this._event[t]=void 0}toJsonString(t=MxType.MxCloneType.kMxFileClone){let e={type:t};return this.dwgOut(e),e.TypeName=this.getTypeName(),JSON.stringify(e)}fromJsonString(t){let e=JSON.parse(t);return(e.type==MxType.MxCloneType.kMxFileClone||e.type==MxType.MxCloneType.kClone)&&this.dwgIn(e)}}function drawMxDbImage(){const t=new MrxDbgUiPrPoint;t.setMessage("\n指定插入点:");let e=MxFun.getCurrentDraw();t.go(n=>{if(0!=n)return;let r=MxFun.screenCoordLong2Doc(300),i=MxFun.screenCoordLong2Doc(200);const o=t.value();let a=MxFun.screenCoord2Doc(10,10);o.z=a.z;let s=new MxDbImage;s.setRenderOrder(MxType.MxDefaultRenderOrder.kCADMeshRenderOrder-1),s.setPoint1(o);let l=new THREE.Vector3(o.x+r,o.y+i,o.z);s.setPoint2(l);let c=prompt("请填写图片网络地址","https://cdn.pixabay.com/photo/2022/11/15/12/23/winter-7593872_960_720.jpg");c&&(s.setImagePath(c),e.addMxEntity(s),s.addEvent("onStartGripEidt",()=>(s.visible=!1,s.setNeedUpdateDisplay(),{renderOrder:MxType.MxDefaultRenderOrder.kCADMeshRenderOrder-1})),s.addEvent("onEndGripEidt",()=>{s.visible=!0,s.setNeedUpdateDisplay()}))})}MxDbEntity.isRegister=!1;class MxDbImage extends MxDbEntity{constructor(){super(...arguments),this.pt1=new THREE.Vector3,this.pt2=new THREE.Vector3,this.imagePath="",this.isLoadMaterialFromPath=!0,this.material=null,this.angle=0}getTypeName(){return"MxDbImage"}getAngle(){return this.angle}setAngle(t){this.angle=t}worldDraw(t){let e=new THREE.Vector3(this.pt1.x,this.pt2.y),n=new THREE.Vector3(this.pt2.x,this.pt1.y);if(Math.abs(this.angle)>1e-5){let e=new THREE.Vector3(.5*(this.pt1.x-this.pt2.x)+this.pt2.x,.5*(this.pt1.y-this.pt2.y)+this.pt2.y),n=new THREE.Matrix4;n.makeRotationZ(this.angle);let r=(new THREE.Matrix4).makeTranslation(e.x,e.y,e.z).multiply(n).multiply((new THREE.Matrix4).makeTranslation(-e.x,-e.y,-e.z));t.setMatrix(r)}if(1==t.getType()){if(t.drawSelectLine(this.pt1,e),t.drawSelectLine(e,this.pt2),t.drawSelectLine(this.pt2,n),t.drawSelectLine(n,this.pt1),this.material){let e=Math.abs(this.pt1.x-this.pt2.x),n=Math.abs(this.pt1.y-this.pt2.y),r=new THREE.PlaneGeometry(e,n),i=Math.min(this.pt1.x,this.pt2.x),o=Math.min(this.pt1.y,this.pt2.y);for(let t=0;t<r.vertices.length;t++)r.vertices[t].x+=i+.5*e,r.vertices[t].y+=o+.5*n,r.vertices[t].z=0;let a=new THREE.Mesh(r,this.material);a.material.depthTest=!1,t.drawEntity(a)}else if(this.imagePath.length>0&&this.isLoadMaterialFromPath){let e=this,n=t.getMxObject();MxFun.loadImageMaterial(this.imagePath,t=>{this.isLoadMaterialFromPath=!1,t&&(e.setMaterial(t),e.setNeedUpdateDisplay(),n.updateDisplay())})}}else if(this.material){let e=Math.abs(this.pt1.x-this.pt2.x),n=Math.abs(this.pt1.y-this.pt2.y),r=new THREE.PlaneGeometry(e,n),i=Math.min(this.pt1.x,this.pt2.x),o=Math.min(this.pt1.y,this.pt2.y);for(let t=0;t<r.vertices.length;t++)r.vertices[t].x+=i+.5*e,r.vertices[t].y+=o+.5*n,r.vertices[t].z=0;let a=new THREE.Mesh(r,this.material);a.material.depthTest=!1,t.drawEntity(a)}else t.drawLine(this.pt1,e),t.drawLine(e,this.pt2),t.drawLine(this.pt2,n),t.drawLine(n,this.pt1);t.setMatrix(null)}setImagePath(t){this.imagePath=t,this.isLoadMaterialFromPath=!0,this.material=null}getImagePath(){return this.imagePath}setMaterial(t){this.material=t}loadMaterial(t){t&&(this.imagePath=t),this.isLoadMaterialFromPath=!1,this.material=null;let e=this;MxFun.loadImageMaterial(this.imagePath,t=>{this.isLoadMaterialFromPath=!1,e.setMaterial(t)})}setPoint1(t){this.pt1=t}getPoint1(){return this.pt1}setPoint2(t){this.pt2=t}getPoint2(){return this.pt2}getGripPoints(){let t=[];t.push(this.pt1),t.push(this.pt2);let e=new THREE.Vector3(this.pt1.x+.5*(this.pt2.x-this.pt1.x),this.pt1.y+.5*(this.pt2.y-this.pt1.y));return t.push(e),t}moveGripPointsAt(t,e){return 0==t?this.pt1.add(e):1==t?this.pt2.add(e):2==t&&(this.pt1.add(e),this.pt2.add(e)),!0}dwgIn(t){return this.onDwgIn(t),this.pt1.copy(t.pt1),this.pt2.copy(t.pt2),this.imagePath=t.imagePath.substr(0),this.isLoadMaterialFromPath=!0,t.angle&&(this.angle=t.angle),t.material&&(this.material=t.material),!0}dwgOut(t){return this.onDwgOut(t),t.pt1=this.pt1,t.pt2=this.pt2,t.imagePath=this.imagePath,t.angle=this.angle,t.type==MxType.MxCloneType.kDragClone&&(t.material=this.material),t}create(){return new MxDbImage}}MxDbImage.cmd="Mx_DrawImage",MxDbImage.draw=drawMxDbImage,addRegisterMxDbEntity(MxDbImage);var index$i=Object.freeze({__proto__:null,default:MxDbImage}),McGiWorldDrawType;!function(t){t[t.kWorldDraw=1]="kWorldDraw",t[t.kDynDragDraw=2]="kDynDragDraw",t[t.kSelectDraw=3]="kSelectDraw"}(McGiWorldDrawType||(McGiWorldDrawType={}));var McGiWorldDrawType$1=McGiWorldDrawType;class MxDbSVGText{constructor(){this.txtPos=new THREE.Vector3,this.txt="",this.txtHeight=1,this.color=void 0,this._txtObject=null,this._txtAspectRatio=-1,this.move=!1,this.drawConnectingLine=!1,this._connectingLine=null,this.fontStyle="",this.underline=!1,this._underLine=null}}var index$h=Object.freeze({__proto__:null,default:MxDbSVGText});function drawMxDbSVG(){return __awaiter(this,void 0,void 0,function*(){const t=new MrxDbgUiPrPoint;t.setMessage("\n指定一点:");let e=yield t.go();if(!e)return;let n=new MxDbSVG,r=prompt("请输入svg图片网络或本地地址","https://img.alicdn.com/imgextra/i2/O1CN01FF1t1g1Q3PDWpSm4b_!!6000000001920-55-tps-508-135.svg");if(!r)return;n.setSvgPath(r),n.setSvgPostion(e),n.svgReverse=!0,n.svgMargin.x=.2,n.setSvgAlignmentRatio(new THREE.Vector2(.5,-1)),n.setRenderOrder(100),n.setSvgSize(new THREE.Vector2(50,0));let i=new MxDbSVGText;i.txt="A1",i.txtPos=new THREE.Vector3(0,-30,0),i.txtHeight=30,n.addText(i),n.fixedSize=!0,n.color=65297,MxFun.addToCurrentSpace(n)})}class MxDbSVG extends MxDbEntity{constructor(){super(...arguments),this.svgPos=new THREE.Vector3,this.svg=null,this.svgPath="",this.svgSize=new THREE.Vector2(50,50),this.svgAlignmentRatio=new THREE.Vector2(0,0),this.imagePath="",this.isLoadMaterialFromPath=!0,this.material=null,this.svgRotate=0,this.svgReverse=!1,this.svgMirror=!1,this.svgChildColor=[],this.svgMargin=new THREE.Vector2(0,0),this.isSvgDirtyLocation=!1,this.isLoadFromPath=!0,this.aryText=[],this.svgBoxSize=null,this.fixedSize=!1,this.useSvgColor=!1}setSvgChildColor(t){if(this.svgChildColor=t,!this.useSvgColor&&this.svg){let t=new THREE.Color(this.getColor()),e=0,n=this;this.svg.traverse(function(r){r.material&&(e<n.svgChildColor.length?r.material.color=new THREE.Color(n.svgChildColor[e]):r.material.color=t,e++)}),this.setNeedUpdateDisplay(!0)}}getSvgChildColor(){return this.svgChildColor}calcVewSize(t){let e=this.svgSize.x,n=this.svgSize.y;return n<=0&&(n=this.svgBoxSize?this.svgBoxSize.y/this.svgBoxSize.x*e:e),this.fixedSize&&(e=t.screenCoordLong2Doc(e),n=t.screenCoordLong2Doc(n)),[e,n]}calcSvgDrawRect(t){if(!t)return;this.calcSvgPosition(t);let[e,n]=this.calcVewSize(t),r=new THREE.Matrix4;r.makeScale(this.svgMirror?-1:1,this.svgReverse?-1:1,1);let i=new THREE.Matrix4;i.makeRotationZ(this.svgRotate);let o=new THREE.Matrix4,a=new THREE.Vector3(this.svgPos.x-e*this.svgAlignmentRatio.x,this.svgPos.y-n*this.svgAlignmentRatio.y,0);o.makeTranslation(a.x,a.y,a.z),i.multiply(r),i.premultiply(o);let s=new THREE.Vector3(0,0,0),l=new THREE.Vector3(e,0,0),c=new THREE.Vector3(e,n,0),u=new THREE.Vector3(0,n,0);return s.applyMatrix4(i),l.applyMatrix4(i),c.applyMatrix4(i),u.applyMatrix4(i),{pt1:s,pt2:c,pt3:l,pt4:u,cenpt:c.clone().add(s.clone().sub(c).multiplyScalar(.5)),sizew:e,sizeh:n}}calcImageDrawRect(t){if(!t)return;this.calcSvgPosition(t);let[e,n]=this.calcVewSize(t),r=new THREE.Matrix4;r.makeScale(this.svgMirror?-1:1,this.svgReverse?-1:1,1);let i=new THREE.Matrix4,o=new THREE.Matrix4,a=new THREE.Vector3(this.svgPos.x-e*this.svgAlignmentRatio.x,this.svgPos.y-n*this.svgAlignmentRatio.y,0);o.makeTranslation(a.x,a.y,a.z),i.multiply(r),i.premultiply(o);let s=new THREE.Vector3(0,0,0),l=new THREE.Vector3(e,0,0),c=new THREE.Vector3(e,n,0),u=new THREE.Vector3(0,n,0);return s.applyMatrix4(i),l.applyMatrix4(i),c.applyMatrix4(i),u.applyMatrix4(i),{pt1:s,pt2:c,pt3:l,pt4:u,cenpt:c.clone().add(s.clone().sub(c).multiplyScalar(.5)),sizew:e,sizeh:n}}worldDraw(t){let e,n=t.getMxObject();if(this.imagePath.length>0){if(e=this.calcImageDrawRect(n),Math.abs(this.svgRotate)>1e-5){let n=new THREE.Vector3(.5*(e.pt1.x-e.pt2.x)+e.pt2.x,.5*(e.pt1.y-e.pt2.y)+e.pt2.y),r=new THREE.Matrix4;r.makeRotationZ(this.svgRotate);let i=(new THREE.Matrix4).makeTranslation(n.x,n.y,n.z).multiply(r).multiply((new THREE.Matrix4).makeTranslation(-n.x,-n.y,-n.z));t.setMatrix(i)}}else e=this.calcSvgDrawRect(n);let r=e.pt1,i=e.pt2,o=e.pt3,a=e.pt4,s=e.cenpt,l=e.sizew,c=this;if(t.getType()!=McGiWorldDrawType$1.kSelectDraw&&this.aryText.forEach((e,r)=>{if(e.txt.length>0){let a,u=new THREE.Vector3(e.txtPos.x,e.txtPos.y,0);this.fixedSize&&(e.txtPos.x>0?u.x=this.svgPos.x+n.screenCoordLong2Doc(e.txtPos.x):u.x=this.svgPos.x-n.screenCoordLong2Doc(e.txtPos.x),e.txtPos.y>0?u.y=this.svgPos.y+n.screenCoordLong2Doc(e.txtPos.y):u.y=this.svgPos.y-n.screenCoordLong2Doc(e.txtPos.y)),e.color&&(a=t.getColor(),t.setColor(e.color));let h=e.txtHeight;c.fixedSize&&(h=n.screenCoordLong2Doc(e.txtHeight)),t.setXData({type:"text",txt:e.txt,index:r});let d=t.drawText(e.txt,h,0,u,void 0,t=>{let n="";return n=e.fontStyle.length>0?`${e.fontStyle} ${t}px Arial`:`normal ${t}px Arial`});if(t.getType()==McGiWorldDrawType$1.kWorldDraw&&(e._txtObject=d),e.underline&&e._txtObject){const n=new THREE.Box3;n.expandByObject(e._txtObject);let r=new THREE.Vector3(n.min.x,n.min.y+.1*h,0),a=new THREE.Vector3(n.max.x,n.min.y+.1*h,0);var i=new THREE.Geometry;let s=new THREE.LineBasicMaterial({color:t.getColor(),transparent:!0,depthTest:!1});i.vertices.push(r,a);var o=new THREE.Line(i,s);t.drawEntity(o),t.getType()==McGiWorldDrawType$1.kWorldDraw&&(e._underLine=o)}if(e._txtAspectRatio=-1,a&&t.setColor(a),e.drawConnectingLine){let n=s.clone().sub(u);if(n.length()>h+l){n.normalize();let r=s.clone().sub(n.clone().multiplyScalar(l)),a=u.clone().add(n.clone().multiplyScalar(h));i=new THREE.Geometry;let c=new THREE.LineBasicMaterial({color:t.getColor(),transparent:!0,depthTest:!1});i.vertices.push(r,a),o=new THREE.Line(i,c),t.setXData({type:"line"}),t.drawEntity(o),t.getType()==McGiWorldDrawType$1.kWorldDraw&&(e._connectingLine=o)}}}}),1==t.getType()){if(this.svg)t.setXData({type:"svg"}),t.drawEntity(this.svg);else if(this.svgPath.length>0&&this.isLoadFromPath){let e=this,r=t.getMxObject();MxThreeJS.loadSVG(this.svgPath,void 0,i=>{if(i){let o=i;if(o.boxSize)e.svgBoxSize=o.boxSize.clone();else{let t=(new THREE.Box3).setFromObject(i);e.svgBoxSize||(e.svgBoxSize=new THREE.Vector3),e.svgBoxSize.x=t.max.x-t.min.x,e.svgBoxSize.y=t.max.y-t.min.y}let[a,s]=e.calcVewSize(n);e.svgBoxSize&&(i.scale.x=a/e.svgBoxSize.x,i.scale.y=s/e.svgBoxSize.y),i.scale.z=i.scale.x,e.svgReverse&&(i.scale.y*=-1),e.svgMirror&&(i.scale.x*=-1),i.rotateZ(e.svgRotate),e.isSvgDirtyLocation=!0;let l=new THREE.Color(t.getColor()),c=0;i.traverse(function(t){t.material&&(t.material=t.material.clone(),t.material.transparent=!0,t.material.depthTest=!1,e.useSvgColor||(c<e.svgChildColor.length?t.material.color=new THREE.Color(e.svgChildColor[c]):t.material.color=l),c++)}),e.svg=i,e.setNeedUpdateDisplay(),r.updateDisplay()}else console.log("mx LoadSVG:"+e.svgPath+" failed");e.isLoadFromPath=!1})}else if(this.material){let e=Math.abs(r.x-i.x),n=Math.abs(r.y-i.y),o=new THREE.PlaneGeometry(e,n),a=Math.min(r.x,i.x),s=Math.min(r.y,i.y);for(let t=0;t<o.vertices.length;t++)o.vertices[t].x+=a+.5*e,o.vertices[t].y+=s+.5*n,o.vertices[t].z=0;let l=new THREE.Mesh(o,this.material);l.material.depthTest=!1,t.drawEntity(l)}else if(this.isLoadMaterialFromPath&&this.imagePath.length>0){let e=this,n=t.getMxObject();MxFun.loadImageMaterial(this.imagePath,t=>{this.isLoadMaterialFromPath=!1,t&&(e.material=t,e.setNeedUpdateDisplay(),n.updateDisplay())})}this.fixedSize||(t.drawSelectLine(r,i),t.drawSelectLine(o,a),t.drawSelectLine(r,o),t.drawSelectLine(o,i),t.drawSelectLine(i,a),t.drawSelectLine(a,r))}else t.drawLine(r,o),t.drawLine(o,i),t.drawLine(i,a),t.drawLine(a,r);this.imagePath.length>0&&t.setMatrix(null)}setSvgPath(t,e=!1){return __awaiter(this,void 0,void 0,function*(){this.svgPath=t,this.svg=null,this.isLoadFromPath=!0,this.svgBoxSize=null,e&&(yield MxThreeJS.loadSVG(t))})}getSvgPath(){return this.svgPath}setSvgPostion(t){this.svgPos=t.clone(),this.isSvgDirtyLocation=!0}setImagePath(t,e){this.imagePath=t,e?(this.material=e,this.isLoadMaterialFromPath=!1):(this.material=null,this.isLoadMaterialFromPath=!0)}getImagePath(){return this.imagePath}getSvgPostion(){return this.svgPos}setSvgSize(t){this.svgSize=t,this.isSvgDirtyLocation=!0}getSvgSize(){return this.svgSize}setSvgAlignmentRatio(t){this.svgAlignmentRatio=t,this.isSvgDirtyLocation=!0}getSvgAlignmentRatio(){return this.svgAlignmentRatio}getText(t){return t<this.aryText.length?this.aryText[t]:null}addText(t){this.aryText.push(t)}getGripPoints(){let t=[];t.push(this.svgPos);let e=0;for(;e<this.aryText.length;e++){let n=this.aryText[e];if(n.move){let e=new THREE.Vector3(n.txtPos.x,n.txtPos.y,0);if(this.fixedSize){let t=MxFun.getCurrentDraw();n.txtPos.x>0?e.x=this.svgPos.x+t.screenCoordLong2Doc(n.txtPos.x):e.x=this.svgPos.x-t.screenCoordLong2Doc(n.txtPos.x),n.txtPos.y>0?e.y=this.svgPos.y+t.screenCoordLong2Doc(n.txtPos.y):e.y=this.svgPos.y-t.screenCoordLong2Doc(n.txtPos.y)}t.push(e)}}return t}moveGripPointsAt(t,e){if(0==t)this.svgPos.add(e),this.fixedSize||this.aryText.forEach(t=>{t.txtPos.add(e)});else if(t-1>=0&&t-1<this.aryText.length){let n=this.aryText[t-1];if(n.move)if(this.fixedSize){let t=MxFun.getCurrentDraw();n.txtPos.x+=t.docCoordLong2Screen(e.x),n.txtPos.y+=t.docCoordLong2Screen(e.y)}else n.txtPos.add(e)}return this.isSvgDirtyLocation=!0,!0}calcSvgPosition(t){if(!this.svg||!this.isSvgDirtyLocation)return;this.isSvgDirtyLocation=!1;let[e,n]=this.calcVewSize(t);this.svg.position.x=this.svgPos.x-e*this.svgAlignmentRatio.x-this.svgMargin.x*e,this.svg.position.y=this.svgPos.y-n*this.svgAlignmentRatio.y-this.svgMargin.y*n}dwgIn(t){this.onDwgIn(t),this.fixedSize=t.fixedSize,this.fixedSize?this.svg=null:t.type==MxType.MxCloneType.kClone&&t.svg&&(this.svg=t.svg.clone()),this.svgPos.copy(t.svgPos),this.svgPath=t.svgPath.substr(0),this.svgSize.copy(t.svgSize),this.svgAlignmentRatio.copy(t.svgAlignmentRatio),this.isSvgDirtyLocation=!0,this.svg||(this.isLoadFromPath=!0),this.svgBoxSize=null;let e=t.txts;return this.aryText=[],e.forEach(t=>{let e=new MxDbSVGText;e.txt=t.txt,e.txtHeight=t.txtHeight,e.txtPos.copy(t.txtPos),e.move=t.move,e.drawConnectingLine=t.drawConnectingLine,this.aryText.push(e)}),this.svgRotate=t.svgRotate,this.useSvgColor=t.useSvgColor,this.svgReverse=t.svgReverse,this.svgMirror=t.svgMirror,this.svgMargin=t.svgMargin,t.svgChildColor?this.svgChildColor=t.svgChildColor:this.svgChildColor=[],this.imagePath=t.imagePath.substr(0),this.isLoadMaterialFromPath=!0,t.material&&(this.material=t.material),!0}dwgOut(t){this.onDwgOut(t);let e,n=this.getMxObject();return t.type==MxType.MxCloneType.kClone&&(t.svg=this.svg),t.svgPath=this.svgPath,t.svgPos=this.svgPos,t.svgSize=this.svgSize,t.svgAlignmentRatio=this.svgAlignmentRatio,t.txts=[],t.type==MxType.MxCloneType.kSaveDwgClone&&n&&(e=this.calcSvgDrawRect(n)),this.aryText.forEach(e=>{let n={txtPos:e.txtPos,txt:e.txt,txtHeight:e.txtHeight,color:e.color,_txtAspectRatio:e._txtAspectRatio,move:e.move,drawConnectingLine:e.drawConnectingLine};t.type==MxType.MxCloneType.kSaveDwgClone&&(e._connectingLine&&(n.connectingLine=e._connectingLine.geometry.vertice),e._underLine&&(n._underLine=e._underLine.geometry.vertice)),t.txts.push(n)}),t.fixedSize=this.fixedSize,t.svgRotate=this.svgRotate,t.useSvgColor=this.useSvgColor,t.svgReverse=this.svgReverse,t.svgMirror=this.svgMirror,t.svgMargin=this.svgMargin,t.svgChildColor=this.svgChildColor,t.type==MxType.MxCloneType.kSaveDwgClone&&(t.svgRect=e),t.imagePath=this.imagePath,t.type==MxType.MxCloneType.kDragClone&&(t.material=this.material),t}create(){return new MxDbSVG}transformBy(t){this.svgPos.applyMatrix4(t),this.isSvgDirtyLocation=!0,this.fixedSize||this.aryText.forEach(e=>{e.txtPos.applyMatrix4(t)})}getTypeName(){return"MxDbSVG"}setColor(t){if(super.setColor(t),this.svg){let t=new THREE.Color(this.color);this.svg.traverse(function(e){e.material&&(e.material.color=t)})}return this}setSvg(t){this.svg=t,this.isLoadFromPath=!1,this.svgBoxSize=null}calcSvgBoxSize(t){if(!this.svgBoxSize)if(t.boxSize)this.svgBoxSize=t.boxSize.clone();else{let e=(new THREE.Box3).setFromObject(t);this.svgBoxSize||(this.svgBoxSize=new THREE.Vector3),this.svgBoxSize.x=e.max.x-e.min.x,this.svgBoxSize.y=e.max.y-e.min.y}}reComputeSVG(){if(!this.svg)return;let t=this.getMxObject();if(!t)return;this.calcSvgBoxSize(this.svg);let[e,n]=this.calcVewSize(t);this.svgBoxSize&&(this.svg.scale.x=e/this.svgBoxSize.x,this.svg.scale.y=n/this.svgBoxSize.y),this.svg.scale.z=this.svg.scale.x,this.svgReverse&&(this.svg.scale.y*=-1),this.svgMirror&&(this.svg.scale.x*=-1),this.isSvgDirtyLocation=!0,this.calcSvgPosition(t)}onViewChange(){if(!this.fixedSize)return!1;if(this.imagePath.length>0)return this.setNeedUpdateDisplay(!1),!0;let t=this.getMxObject();if(null==t)return!1;if(this.svg){this.calcSvgBoxSize(this.svg);let[e,n]=this.calcVewSize(t);this.svgBoxSize&&(this.svg.scale.x=e/this.svgBoxSize.x,this.svg.scale.y=n/this.svgBoxSize.y),this.svg.scale.z=this.svg.scale.x,this.svgReverse&&(this.svg.scale.y*=-1),this.svgMirror&&(this.svg.scale.x*=-1),this.isSvgDirtyLocation=!0,this.calcSvgPosition(t)}let e=this.calcSvgDrawRect(t),n=e.cenpt,r=e.sizew,i=this;return this.aryText.forEach(e=>{if(e._txtObject&&t){let a=t.screenCoordLong2Doc(e.txtHeight);if(a>1e-5){e._txtAspectRatio<=0&&(e._txtAspectRatio=e._txtObject.scale.x/e._txtObject.scale.y),e._txtObject.scale.set(e._txtAspectRatio*a*1.5,1.5*a,1),e.txtPos.x>0?e._txtObject.position.x=i.svgPos.x+t.screenCoordLong2Doc(e.txtPos.x):e._txtObject.position.x=i.svgPos.x-t.screenCoordLong2Doc(e.txtPos.x),e.txtPos.y>0?e._txtObject.position.y=i.svgPos.y+t.screenCoordLong2Doc(e.txtPos.y):e._txtObject.position.y=i.svgPos.y-t.screenCoordLong2Doc(e.txtPos.y);let s=e._txtObject.position;if(e._txtObject.updateMatrix(),e._underLine){const t=new THREE.Box3;let n=e._txtObject.parent;e._txtObject.parent=null,t.expandByObject(e._txtObject),e._txtObject.parent=n;let r=new THREE.Vector3(t.min.x,t.min.y+.1*a,0),i=new THREE.Vector3(t.max.x,t.min.y+.1*a,0);(o=new THREE.Geometry).vertices.push(r,i),e._underLine.geometry=o}if(e._connectingLine){let t=n.clone().sub(s);t.normalize();let i=n.clone().sub(t.clone().multiplyScalar(r)),l=s.clone().add(t.clone().multiplyScalar(a));var o;(o=new THREE.Geometry).vertices.push(i,l),e._connectingLine.geometry=o}}}}),!0}}MxDbSVG.cmd="Mx_ModelFixedSvg",MxDbSVG.draw=drawMxDbSVG,addRegisterMxDbEntity(MxDbSVG);var index$g=Object.freeze({__proto__:null,default:MxDbSVG});function drawMxDbPolyline(){const t=new MrxDbgUiPrPoint;t.setMessage("\n指定第一点:");let e,n=new MxDbPolyline;t.go(r=>{if(0!=r)return;let i=t.value();e||(e=i.clone());let o=i;const a=new McEdGetPointWorldDrawObject;a.setDraw((t,e)=>{e.setColor(16711680),e.drawLine(o,t),e.drawCustomEntity(n)}),t.setUserDraw(a),t.setMessage("\n指定下一点:");let s=0;n.addVertexAt(i),t.goWhile(e=>{if(0==e)o=t.value(),n.addVertexAt(o),++s>=2?(t.setMessage("\n指定下一点:"),t.setKeyWords("[闭合(C)/放弃(U)]")):s>0?(t.setMessage("\n指定下一点:"),t.setKeyWords("[放弃(U)]")):(t.setMessage("\n指定第一点:"),t.setKeyWords(""));else if(1==e){if(t.isKeyWordPicked("C"))return{exit:!0};t.isKeyWordPicked("U")&&console.log("Mx_Line undo....")}},()=>{MxFun.getCurrentDraw().addMxEntity(n)})})}class MxDbPolyline extends MxDbEntity{constructor(){super(...arguments),this.points=[]}getTypeName(){return"MxDbPolyline"}worldDraw(t){this.points.length<2||t.drawLines(this.points)}getGripPoints(){return this.points}moveGripPointsAt(t,e){return!(t>=this.points.length||(this.points[t].add(e),0))}create(){return new MxDbPolyline}dwgIn(t){this.onDwgIn(t);let e=t.points;return this.points=[],e.forEach(t=>{this.points.push(new THREE.Vector3(t.x,t.y,t.z))}),!0}dwgOut(t){return this.onDwgOut(t),t.points=this.points,t}addVertexAt(t){this.points.push(t)}numVerts(){return this.points.length}getPointAt(t){return t<this.points.length?this.points[t]:null}setPointAt(t,e){return t<this.points.length&&(this.points[t]=e,!0)}}MxDbPolyline.cmd="Mx_Lines",MxDbPolyline.draw=drawMxDbPolyline,addRegisterMxDbEntity(MxDbPolyline);var index$f=Object.freeze({__proto__:null,default:MxDbPolyline});function drawMxDb2LineAngularDimension(){const t=new MrxDbgUiPrPoint,e=MxFun.getCurrentDraw(),n=new MxDb2LineAngularDimension,r=new McEdGetPointWorldDrawObject;return t.setMessage("\n指定第一点:"),t.go(i=>{0===i&&(t.setMessage("\n指定第二个角度点:"),n.point1=t.value(),r.setDraw((t,e)=>{n.point2=t,r.drawLine(n.point1,t)}),t.setUserDraw(r),t.go(i=>{t.setMessage("\n指定最后一个点:"),0===i&&(n.point2=t.value(),r.setDraw((t,e)=>{n.point3=t,r.drawCustomEntity(n)}),t.go(t=>{0===t&&e.addMxEntity(n)}))}))}),n}const propertyDbKeys$5=["colors","point1","point2","point3"];class MxDb2LineAngularDimension extends MxDbEntity{constructor(t){if(super(),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.point3=new THREE.Vector3,this.colors=[],t){const{points:e,colors:n}=t;e&&this.setPoints(e),n&&this.setColor(n)}}calculateLineAngle(t,e,n){const r=2*Math.PI/360;return{startAngle:180*Math.atan2(e.y-t.y,e.x-t.x)/Math.PI*r,endAngle:180*Math.atan2(n.y-t.y,n.x-t.x)/Math.PI*r}}setPoints(t){const[e,n,r]=t;return e&&(this.point1=e),n&&(this.point2=n),r&&(this.point3=r),this}setColor(t){return lodash.isArray(t)?this.colors=t:this.color=t,this}worldDraw(t){if(t.getType()==McGiWorldDrawType$1.kWorldDraw||t.getType()==McGiWorldDrawType$1.kDynDragDraw){const[e,n,r,i]=this.colors||[],o=this.getColor(),a=t.getMxObject();t.setColor(e||o),t.drawLine(this.point1,this.point2),t.setColor(n||o),t.drawLine(this.point2,this.point3);const{startAngle:s,endAngle:l}=this.calculateLineAngle(this.point2,this.point1,this.point3),c=this.point2.distanceTo(this.point1),u=this.point2.distanceTo(this.point3),h=Math.min(c,u)/4;let d=THREE.MathUtils.radToDeg(s-l);d<0&&(d+=360);let p=a.screenCoordLong2Doc(50);const f=new THREE.ArcCurve(this.point2.x,this.point2.y,h,s,l,!0),m=(new THREE.Geometry).setFromPoints(f.getPoints(50));t.setColor(r||o),t.drawGeometryLines(m);const g=f.getPoint(.5);let y=new THREE.Vector3(g.x,g.y,0);const v=y.sub(this.point2),x=v.length()+.5*p;v.normalize().multiplyScalar(x),y=this.point2.clone().add(v),t.setColor(i||o),t.drawText(d.toFixed(3)+"°",.5*p,0,y)}else t.drawLine(this.point1,this.point2),t.drawLine(this.point3,this.point2)}getGripPoints(){return[this.point1,this.point2,this.point3]}moveGripPointsAt(t,e){return 0===t?this.point1.add(e):1===t?this.point2.add(e):2===t&&this.point3.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.dwgInHelp(t,propertyDbKeys$5),!0}dwgOut(t){return this.onDwgOut(t),this.dwgOutHelp(t,propertyDbKeys$5),t}create(){return new MxDb2LineAngularDimension}transformBy(t){this.point1.applyMatrix4(t),this.point2.applyMatrix4(t)}getTypeName(){return"MxDb2LineAngularDimension"}}MxDb2LineAngularDimension.cmd="Mx_AngleSurveying",MxDb2LineAngularDimension.draw=drawMxDb2LineAngularDimension,addRegisterMxDbEntity(MxDb2LineAngularDimension);var index$e=Object.freeze({__proto__:null,default:MxDb2LineAngularDimension});class MxFilters{constructor(){this.uniformObj={},this.filtersStr="",this.filtersTypes="",this.VSHADER_SOURCE="\n varying vec2 v_Uv; \n void main () {\n v_Uv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",this.FSHADER_SOURCE=`\n varying vec2 v_Uv;\n uniform sampler2D e_Texture;\n uniform mat4 colorMatrix;\n ${this.filtersStr}\n void main () {\n vec4 color = texture2D( e_Texture, v_Uv );\n color = color * colorMatrix;\n ${this.filtersTypes}\n gl_FragColor = color;\n }`,this._matrix=new THREE.Matrix4}channel({r:t=1,g:e=1,b:n=1}){return this._matrix=(new THREE.Matrix4).set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1).multiply(this._matrix),this}brightness(t){return this._matrix=(new THREE.Matrix4).set(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1).multiply(this._matrix),this}saturate(t){const e=.2126*(1-t),n=.7152*(1-t),r=.0722*(1-t);return this._matrix=(new THREE.Matrix4).set(e+t,n,r,0,e,n+t,r,0,e,n,r+t,0,0,0,0,1).multiply(this._matrix),this}contrast(t){const e=.5*(1-t);return this._matrix=(new THREE.Matrix4).set(t,0,0,0,0,t,0,0,0,0,t,0,e,e,e,1).multiply(this._matrix),this}opacity(t){return this._matrix=(new THREE.Matrix4).set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,t).multiply(this._matrix),this}invert(t){const e=1-2*t;return this._matrix=(new THREE.Matrix4).set(e,0,0,0,0,e,0,0,0,0,e,0,t,t,t,1).multiply(this._matrix),this}grayscale(t=1){const e=.2126*t,n=.7152*t,r=.0722*t;return this._matrix=(new THREE.Matrix4).set(e+1-t,n,r,0,e,n+1-t,r,0,e,n,r+1-t,0,0,0,0,1).multiply(this._matrix),this}sepia(t=1){return this._matrix=(new THREE.Matrix4).set(1-.607*t,.769*t,.189*t,0,.349*t,1-.314*t,.168*t,0,.272*t,.534*t,1-.869*t,0,0,0,0,1).multiply(this._matrix),this}hueRotate(t){const e=t/180*Math.PI,n=Math.cos(e),r=Math.sin(e),i=.2126,o=.7152,a=.0722;return this._matrix=(new THREE.Matrix4).set(i+.7874*n+r*-i,o+n*-o+r*-o,a+n*-a+.9278*r,0,i+n*-i+.143*r,o+n*(1-o)+.14*r,a+n*-a+-.283*r,0,i+n*-i+-.7874*r,o+n*-o+r*o,a+.9278*n+r*a,0,0,0,0,1).multiply(this._matrix),this}convolution(t,e=1/9,n=521){return this.uniformObj=Object.assign(Object.assign({},this.uniformObj),{cKernel:{value:t.toArray()},stStep:{value:e},scaleFactor:{value:n}}),this.filtersTypes.indexOf("convolutionTextureColor")<0&&(this.filtersStr+="\n uniform float cKernel[9];\n uniform float stStep;\n uniform float scaleFactor;\n vec4 convolutionTextureColor(vec4 color) {\n vec2 offsets[9];\n offsets[0] = vec2(-1.0,-1.0);\n offsets[1] = vec2(0.0,-1.0);\n offsets[2] = vec2(1.0,-1.0);\n offsets[3] = vec2(-1.0,0.0);\n offsets[4] = vec2(0.0,0.0);\n offsets[5] = vec2(1.0,0.0);\n offsets[6] = vec2(-1.0,1.0);\n offsets[7] = vec2(0.0,1.0);\n offsets[8] = vec2(1.0,1.0);\n \n vec4 sum = color;\n for(int i = 0; i < 9; i++) {\n sum = sum + cKernel[i] * scaleFactor * texture2D(e_Texture, v_Uv + offsets[i] / stStep);\n };\n return sum;\n }",this.filtersTypes+="color = convolutionTextureColor(color);\n"),this}reset(){return this.uniformObj={},this.filtersStr="",this.filtersTypes="",this._matrix=new THREE.Matrix4,this}_getFilterShaderData(t){return{uniforms:Object.assign({e_Texture:{value:t},colorMatrix:{value:this._matrix}},this.uniformObj),vertexShader:this.VSHADER_SOURCE,fragmentShader:this.FSHADER_SOURCE}}_getFilterColor(t="#000000",e=1){t=new THREE.Color(t);let{r:n,g:r,b:i}=t;const o=this._matrix.toArray();o[12],o[13],o[14],o[15];const a=o[0]*n+o[1]*n+o[2]*n+o[3]*e,s=o[4]*r+o[5]*r+o[6]*r+o[7]*e,l=o[8]*i+o[9]*i+o[10]*i+o[11]*e;return t.setRGB(a,s,l),t}toJSON(){return JSON.stringify({matrix:this._matrix.toArray(),uniformObj:this.uniformObj,filtersStr:this.filtersStr,filtersTypes:this.filtersTypes})}static fromJSON(t){const{matrix:e,uniformObj:n,filtersStr:r,filtersTypes:i}=JSON.parse(t),o=new MxFilters;return o._matrix=(new THREE.Matrix4).fromArray(e),o.uniformObj=n,o.filtersStr=r,o.filtersTypes=i,o}}class MxDbShape extends MxDbEntity{constructor(){super(...arguments),this.isLoadMaterialFromPath=!0,this.strokeLineWidth=2,this.isStrokeDashLine=!1,this.isFill=!1,this.curveSegments=50,this.closed=!0,this.cornerRadius=[],this._propertyDbKeys=["isFill","stroke","strokeLineWidth","isStrokeDashLine","closed","cornerRadius","fillImageSrc","fillImageParam"]}setStroke(t){return this.stroke=t,this}setStrokeLineWidth(t){return this.strokeLineWidth=t,this}setIsStrokeDashLine(t){return this.isStrokeDashLine=t,this}setIsFill(t){return this.isFill=t,this}get fillImageSrc(){return this._fillImageSrc}set fillImageSrc(t){this._fillImageSrc=t,this.isLoadMaterialFromPath=!0,this.material=null}setFillImageSrc(t){return this.fillImageSrc=t,this}setCurveSegments(t){return this.curveSegments=t,this}setClosed(t){return this.closed=t,this}setCornerRadius(t,e=!0){this.cornerRadius=t instanceof Array?t.map(t=>e?MxFun.screenCoordLong2Doc(t):t):e?MxFun.screenCoordLong2Doc(t):t}getTypeName(){return"MxDbShape"}getShapePoints(t){const{curveSegments:e}=this;return this.points=t.getPoints(e).map(t=>t instanceof THREE.Vector2?new THREE.Vector3(t.x,t.y,0):t),this.points}createPaths(t){return this._paths=new THREE.CurvePath,Array.isArray(t)?t.forEach(t=>this._paths.add(t)):this._paths.add(t),this._paths}_draw(t,e){let{isFill:n,closed:r}=this;const i=t.getColor();t.setColor(this.filter?this.filter._getFilterColor(this.color,this.opacity):this.color);const o=this.getCornerRadiusPoints(r||n?this.getClosedPoints(e):e);n?!this.fillImageSrc&&t.drawSolid(o):t.drawLines(o),this._fillImg(t,o),t.setColor(i)}getCornerRadiusPoints(t){const{cornerRadius:e}=this;if(!e)return t;const n="number"==typeof e?t.map(()=>e):e;return n.length>0?getToGenerateRoundedCorners(t,n):t}_drawStoreLine(t,e,n){const{isFill:r,stroke:i,strokeLineWidth:o}=this,a=t.getLineWidth(),s=t.getColor(),l=t.isDashLineDisplay();i&&r&&(t.setDashLineDisplay(this.isStrokeDashLine),t.setColor(i),t.setLineWidth(o),n?n(t):t.drawLines(this.getCornerRadiusPoints(this.getClosedPoints(e))),t.setColor(s),t.setLineWidth(a),t.setDashLineDisplay(l))}getClosedPoints(t){return[...t,t[0]]}getTotalLength(){return this._paths?this._paths.getLength()+(this.closedLine?this.closedLine.getLength():0):0}getArea(){return this.points?McGeTool.calcArea(this.closed?this.getClosedPoints(this.points):this.points):0}worldDraw(t){const e=this.createPaths(new THREE.Curve),n=this.getShapePoints(e);this._draw(t,n),this._drawStoreLine(t,n)}_fillImg(t,e){const n={transparent:!0,depthTest:!1,opacity:this.opacity,visible:this.visible};if(!this.isFill||!this.fillImageSrc)return;if(!this.material){let t=this;return void MxFun.loadImageMaterial(this.fillImageSrc,e=>{t.isLoadMaterialFromPath=!1,e&&(t.material=e,t.setNeedUpdateDisplay(),MxFun.updateDisplay())})}const r=e.map(({x:t,y:e})=>new THREE.Vector2(t,e));let i=this.material,o=new THREE.ShapeGeometry(new THREE.Shape(r));if(o=repairGeometryFaceVertexUvs(o),this.filter){const t=i.map,e=this.filter._getFilterShaderData(t);i=new THREE.ShaderMaterial(Object.assign(Object.assign({},e),n))}if(i.depthTest=!1,i.transparent=!0,i.opacity=this.opacity,i.visible=this.visible,this.fillImageParam){const t=this.fillImageParam;for(let e in this.fillImageParam)this.material.map[e]=t[e]}let a=new THREE.Mesh(o,i);t.drawEntity(a)}getGripPoints(){return[]}moveGripPointsAt(t,e){return!0}dwgIn(t){return this.onDwgIn(t),this.dwgInHelp(t,this._propertyDbKeys),this.isLoadMaterialFromPath=!0,this.material=null,t.type===MxType.MxCloneType.kMxFileClone?t.filter&&(this.filter=MxFilters.fromJSON(t.filter)):t.filter&&(this.filter=t.filter),!0}dwgOut(t){var e;return this.onDwgOut(t),this.dwgOutHelp(t,this._propertyDbKeys),t.type===MxType.MxCloneType.kMxFileClone?this.filter&&(t.filter=null===(e=this.filter)||void 0===e?void 0:e.toJSON()):t.filter=this.filter,t}}class MxDbEllipseShape extends MxDbShape{constructor(){super(),this.center=new THREE.Vector3,this.xRadius=10,this.yRadius=10,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!1,this.rotation=0,this.isClosedToCenter=!0,this._propertyDbKeys=[...this._propertyDbKeys,"center","xRadius","yRadius","startAngle","endAngle","clockwise","rotation","isClosedToCenter"]}getTypeName(){return"MxDbEllipseShape"}setCenter(t){return this.center=t,this}setXRadius(t){return this.xRadius=t,this}setYRadius(t){return this.yRadius=t,this}setStartAngle(t){return this.startAngle=t,this}setEndAngle(t){return this.endAngle=t,this}setClockwise(t){return this.clockwise=t,this}setRotation(t){return this.rotation=t,this}setIsClosedToCenter(t){return this.isClosedToCenter=t,this}worldDraw(t){this.drawEllipseShape(t)}drawEllipseShape(t){let{startAngle:e,endAngle:n,clockwise:r}=this;const i=this.createEllipseCurve(),o=this.createPaths(i);let a,s=this.getShapePoints(o);return this._draw(t,s),this._drawStoreLine(t,s),{centralAngle:a=r?n>e?THREE.MathUtils.radToDeg(i.aEndAngle-i.aStartAngle):360-Math.abs(THREE.MathUtils.radToDeg(i.aEndAngle-i.aStartAngle)):e>n?Math.abs(THREE.MathUtils.radToDeg(i.aEndAngle-i.aStartAngle)):360-THREE.MathUtils.radToDeg(i.aEndAngle-i.aStartAngle),curve:i,points:s}}createEllipseCurve(t=this.center.x,e=this.center.y,n=this.xRadius,r=this.yRadius,i=this.startAngle,o=this.endAngle,a=this.clockwise,s=this.rotation){return new THREE.EllipseCurve(t,e,n,r,i,o,a,s)}getCornerRadiusPoints(t){return t}getClosedPoints(t){try{let e=(this._paths||new THREE.CatmullRomCurve3(t,!1,"catmullrom",0)).getLength();this.closedLine=this.getClosedLine(t);const n=this.closedLine.getLength();let r=this.curveSegments/e,i=2.5*(e>this.curveSegments?n*r:1);if(i>20*this.curveSegments&&(i=20*this.curveSegments),i<=0)return t;const o=this.closedLine.getPoints(i);return[...t,...o]}catch(e){return[...t,t[0]]}}getClosedLine(t){const{isClosedToCenter:e,center:n}=this;let r=e?[t[t.length-1],n,t[0]]:[t[t.length-1],t[0]];return new THREE.CatmullRomCurve3(r,!1,"catmullrom",.01)}getGripPoints(){return[this.center]}moveGripPointsAt(t,e){return 0===t&&this.center.add(e),!0}}class MxDbCircleShape extends MxDbEllipseShape{getTypeName(){return"MxDbCircleShape"}get radius(){return this.xRadius}set radius(t){this.xRadius=t,this.yRadius=t}setRadius(t){return this.radius=t,this}setXRadius(t){return this.setRadius(t),this}setYRadius(t){return this.setRadius(t),this}}function drawMx3PointArc(){const t=new MrxDbgUiPrPoint,e=new McEdGetPointWorldDrawObject,n=new Mx3PointArc;n.closed=!1,n.setColor("#ff0000").setLineWidth(10),t.setUserDraw(e),t.setMessage("\n确定圆弧开始点:"),t.go(r=>{r===MrxDbgUiPrBaseReturn$1.kOk&&(n.point1=t.value(),e.setDraw(t=>{e.drawLine(n.point1,t)})),t.setMessage("\n确定圆弧结束点:"),t.go(r=>{r===MrxDbgUiPrBaseReturn$1.kOk&&(n.point2=t.value(),e.setDraw(t=>{n.point3=t,e.drawCustomEntity(n)})),t.setMessage("\n确定圆弧上任意一点:"),t.go(t=>{if(t===MrxDbgUiPrBaseReturn$1.kOk){MxFun.getCurrentDraw().addMxEntity(n);const{radius:t,angle:e,arcLength:r}=createThreePointArc(n.point1,n.point2,n.point3,!0);console.log("半径:",t),console.log("圆弧圆心角度:",e),console.log("圆弧弧长:",r)}})})})}class Mx3PointArc extends MxDbCircleShape{constructor(){super(),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.point3=new THREE.Vector3,this.autoClockwise=!0,this._propertyDbKeys=[...this._propertyDbKeys,"point1","point2","point3","autoClockwise"]}getTypeName(){return"Mx3PointArc"}create(){return new Mx3PointArc}worldDraw(t){let{point1:e,point2:n,point3:r}=this;this.upDateCenter(e,n,r),this.upDateRadius(e);const[i,o,a]=this.compute3PointAngle();this.upDataClockwise(i,o,a),this.startAngle=THREE.MathUtils.degToRad(i),this.endAngle=THREE.MathUtils.degToRad(o),this.drawEllipseShape(t)}getGripPoints(){return[this.point1,this.point2,this.point3,this.center]}compute3PointAngle(){const{point1:t,point2:e,point3:n}=this,r=calculateArcAngle(t,this.center,this.radius),i=calculateArcAngle(e,this.center,this.radius),o=calculateArcAngle(n,this.center,this.radius);return[r.angle,i.angle,o.angle]}upDateCenter(t,e,n){return this.center=calculateArcOrigin(t,e,n),this.center}upDateRadius(t){return this.radius=calculateRadiusArc(t,this.center),this.radius}upDataClockwise(t,e,n){const{autoClockwise:r}=this;r&&(this.clockwise=judgementArcRenderDirection(e,t,n))}moveGripPointsAt(t,e){return 0===t?this.point1.add(e):1===t?this.point2.add(e):2===t?this.point3.add(e):3===t&&(this.point1.add(e),this.point2.add(e),this.point3.add(e)),this.upDateCenter(this.point1,this.point2,this.point3),!0}}Mx3PointArc.cmd="Mx_3PointArc",Mx3PointArc.draw=drawMx3PointArc,addRegisterMxDbEntity(Mx3PointArc);var index$d=Object.freeze({__proto__:null,default:Mx3PointArc});function drawMxDbCoord(){const t=new MrxDbgUiPrPoint;t.setMessage("\n指定坐标点:"),t.go(e=>{if(0!=e)return;const n=t.value();let r=new MxDbCoord;r.point1=n,r.point2=n.clone(),t.setBasePt(n),t.setUseBasePt(!0),t.setUserDraw((t,e)=>{r.point2=t,e.drawCustomEntity(r)}),t.setMessage("\n指定标注点:"),t.go(e=>{0==e?(r.point2=t.value(),MxFun.addToCurrentSpace(r)):console.log(e)})})}class MxDbCoord extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3}worldDraw(t){let e=t.getMxObject();t.drawLine(this.point1,this.point2);let n=this.point2.clone();var r=e.screenCoordLong2Doc(20),i=6*r;n.x=n.x+i,t.drawLine(this.point2,n);var o=new THREE.Vector3,a=new THREE.Vector3;let s=e.docCoord2Cad(this.point1.x,this.point1.y,this.point1.z),l=s.x.toFixed(3),c=s.y.toFixed(3);o.x=this.point2.x+.3*r+.5*i,o.y=this.point2.y+.1*r+.5*r,t.drawText(l,r,0,o),a.x=this.point2.x+.3*r+.5*i,a.y=this.point2.y-.1*r-.5*r,t.drawText(c,r,0,a)}getGripPoints(){let t=[];return t.push(this.point1),t.push(this.point2),t}moveGripPointsAt(t,e){return 0==t?this.point1.add(e):1==t&&this.point2.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),!0}dwgOut(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t}create(){return new MxDbCoord}transformBy(t){this.point1.applyMatrix4(t),this.point2.applyMatrix4(t)}getTypeName(){return"MxDbCoord"}}MxDbCoord.cmd="Mx_Coord",MxDbCoord.draw=drawMxDbCoord,addRegisterMxDbEntity(MxDbCoord);var index$c=Object.freeze({__proto__:null,default:MxDbCoord});function drawMxDbLine(){return __awaiter(this,void 0,void 0,function*(){const t=new MrxDbgUiPrPoint;t.setMessage("\n指定第一点:");let e=yield t.go();if(null==e)return;t.setBasePt(e.clone()),t.setUseBasePt(!0),t.setMessage("\n指定第二点:");let n=yield t.go();if(null==n)return;let r=new MxDbLine;r.pt1=e,r.pt2=n,MxFun.addToCurrentSpace(r)})}class MxDbLine extends MxDbEntity{constructor(){super(...arguments),this.pt1=new THREE.Vector3,this.pt2=new THREE.Vector3}getTypeName(){return"MxDbLine"}worldDraw(t){t.drawLine(this.pt1,this.pt2)}setPoint1(t){this.pt1=t}getPoint1(){return this.pt1}setPoint2(t){this.pt2=t}getPoint2(){return this.pt2}getGripPoints(){let t=[];t.push(this.pt1),t.push(this.pt2);let e=new THREE.Vector3(this.pt1.x+.5*(this.pt2.x-this.pt1.x),this.pt1.y+.5*(this.pt2.y-this.pt1.y),0);return t.push(e),t}moveGripPointsAt(t,e){return 0==t?this.pt1.add(e):1==t?this.pt2.add(e):2==t&&(this.pt1.add(e),this.pt2.add(e)),!0}dwgIn(t){return this.onDwgIn(t),this.pt1.copy(t.pt1),this.pt2.copy(t.pt2),!0}dwgOut(t){return this.onDwgOut(t),t.pt1=this.pt1,t.pt2=this.pt2,t}create(){return new MxDbLine}getGeomExtents(){return new THREE.Box3(this.pt1,this.pt2)}getGetLength(){return this.pt1.distanceTo(this.pt2)}}function drawMxDbRect(){return __awaiter(this,void 0,void 0,function*(){const t=new MrxDbgUiPrPoint;t.setMessage("\n指定第一点:");let e=yield t.go();if(!e)return;let n=new MxDbRect;n.pt1=e;const r=new McEdGetPointWorldDrawObject;r.setDraw(t=>{n.pt2=t,r.drawCustomEntity(n)}),t.setBasePt(e),t.setUseBasePt(!0),t.setUserDraw(r),t.setMessage("\n指定第二点:"),(yield t.go())&&(n.pt2=t.value(),MxFun.getCurrentDraw().addMxEntity(n))})}MxDbLine.cmd="Mx_Line",MxDbLine.draw=drawMxDbLine,addRegisterMxDbEntity(MxDbLine);class MxDbRect extends MxDbEntity{constructor(){super(...arguments),this.cornerRadius=[],this.pt1=new THREE.Vector3,this.pt2=new THREE.Vector3,this.isSolidColorFill=!1,this.isLoadMaterialFromPath=!0,this.material=null}worldDraw(t){let e=computeRectPoints(this.pt1,this.pt2);if(this.cornerRadius.length>0&&(e=getToGenerateRoundedCorners(e,this.cornerRadius)),t.getType()!=McGiWorldDrawType$1.kWorldDraw)return e.push(e[0]),void t.drawLines(e);const n={transparent:!0,depthTest:!1,opacity:this.opacity,visible:this.visible};if(this.isSolidColorFill){let r;e=e.map(({x:t,y:e})=>new THREE.Vector2(t,e)),r=new THREE.ShapeGeometry(new THREE.Shape(e));let i=new THREE.MeshBasicMaterial(Object.assign({color:this.filter?this.filter._getFilterColor(this.color,this.opacity):new THREE.Color(this.color)},n)),o=new THREE.Mesh(r,i);t.drawEntity(o)}else if(this.fillImageSrc){if(this.material){e=e.map(({x:t,y:e})=>new THREE.Vector2(t,e));let r=this.material,i=new THREE.ShapeGeometry(new THREE.Shape(e));if(i=repairGeometryFaceVertexUvs(i),this.filter){const t=r.map;this.fillImageParam&&(this.fillImageParam.center&&(t.center=this.fillImageParam.center),this.fillImageParam.offset&&(t.offset=this.fillImageParam.offset),this.fillImageParam.repeat&&(t.repeat=this.fillImageParam.repeat),this.fillImageParam.rotation&&(t.rotation=this.fillImageParam.rotation));const e=this.filter._getFilterShaderData(t);r=new THREE.ShaderMaterial(Object.assign(Object.assign({},e),n))}r.depthTest=!1,r.transparent=!0,r.opacity=this.opacity,r.visible=this.visible;let o=new THREE.Mesh(i,r);t.drawEntity(o)}else if(this.fillImageSrc.length>0&&this.isLoadMaterialFromPath){let t=this;MxFun.loadImageMaterial(this.fillImageSrc,e=>{this.isLoadMaterialFromPath=!1,e&&(t.material=e,t.setNeedUpdateDisplay(),MxFun.updateDisplay())})}}else{let r=(new THREE.BufferGeometry).setFromPoints(e),i=new THREE.LineBasicMaterial(Object.assign({color:this.getColor()},n)),o=new THREE.LineLoop(r,i);t.drawEntity(o)}}getGripPoints(){let t=[];t.push(this.pt1);const e=new THREE.Line3(this.pt1,this.pt2);let n=new THREE.Vector3;return e.getCenter(n),t.push(n),t.push(this.pt2),t}moveGripPointsAt(t,e){return 0==t?this.pt1.add(e):1==t?(this.pt1.add(e),this.pt2.add(e)):2==t&&this.pt2.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.pt1.copy(t.pt1),this.pt2.copy(t.pt2),this.isSolidColorFill=t.isSolidColorFill,this.fillImageSrc=t.fillImageSrc,this.fillImageParam=t.fillImageParam,this.cornerRadius=t.cornerRadius,this.filter=t.filter,this.isLoadMaterialFromPath=!0,this.material=null,!0}dwgOut(t){return this.onDwgOut(t),t.pt1=this.pt1,t.pt2=this.pt2,t.isSolidColorFill=this.isSolidColorFill,t.fillImageSrc=this.fillImageSrc,t.fillImageParam=this.fillImageParam,t.cornerRadius=this.cornerRadius,t.filter=this.filter,t}create(){return new MxDbRect}transformBy(t){this.pt1.applyMatrix4(t),this.pt2.applyMatrix4(t)}setRadius(t,e=!0){this.cornerRadius=t instanceof Array?t.map(t=>e?MxFun.screenCoordLong2Doc(t):t):t>0?e?[MxFun.screenCoordLong2Doc(t),MxFun.screenCoordLong2Doc(t),MxFun.screenCoordLong2Doc(t),MxFun.screenCoordLong2Doc(t)]:[t,t,t,t]:[]}getTypeName(){return"MxDbRect"}getFilter(){return this.filter}setFilter(t){this.filter=t,this.isLoadMaterialFromPath=!0,this.material=null}setFillImagePath(t){this.fillImageSrc=t,this.isLoadMaterialFromPath=!0,this.material=null,this.fillImageSrc&&(this.isSolidColorFill=!1)}getFillImagePath(){return this.fillImageSrc}}MxDbRect.cmd="Mx_DrawRect",MxDbRect.draw=drawMxDbRect,addRegisterMxDbEntity(MxDbRect);var index$b=Object.freeze({__proto__:null,default:MxDbRect});function drawMxDbAlignedDimension(){let t=new MxDbAlignedDimension;const e=new MrxDbgUiPrPoint;return e.setMessage("\n指定第一点:"),e.go(n=>{if(0!=n)return;const r=e.value();t.setPoint1(r),t.setColor(65314);const i=new McEdGetPointWorldDrawObject;i.setDraw(e=>{t.setPoint2(e),i.drawCustomEntity(t)}),e.setBasePt(r),e.setUseBasePt(!0),e.setUserDraw(i),e.setMessage("\n指定第二点:"),e.setInputToucheType(MxType.InputToucheType.kGetEnd),e.go(n=>{if(0!=n)return void console.log(n);const r=e.value();t.setPoint2(r),MxFun.getCurrentDraw().addMxEntity(t)})}),t}const propertyDbKeys$4=["point1","point2","fontColor"];class MxDbAlignedDimension extends MxDbEntity{constructor(t){if(super(),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,t){const{points:e,fontColor:n}=t;e&&this.setPoints(e),n&&(this.fontColor=n)}}setPoints(t){const[e,n]=t;e&&(this.point1=e),n&&(this.point2=n)}getTypeName(){return"MxDbAlignedDimension"}getDirection(t,e,n){const r=new THREE.Vector3(t.x,t.y,0),i=new THREE.Vector3(1,0,0),o=t.angleTo(i);let a=-1;(o<7*Math.PI/18||o>10*Math.PI/18)&&e.x>n.x&&(a=1);const s=new THREE.Matrix4;return s.makeRotationZ(Math.PI/2*a),r.applyMatrix4(s),r}getDimText(){return new THREE.Vector3(this.point1.x-this.point2.x,this.point1.y-this.point2.y,0).length().toFixed(3)}worldDraw(t){if(t.getType()==McGiWorldDrawType$1.kWorldDraw||t.getType()==McGiWorldDrawType$1.kDynDragDraw){const e=this.point1,n=this.point2;let r,i,o,a,s,l,c;const u=new THREE.Vector3(e.x-n.x,e.y-n.y,0),h=this.getDirection(u,e,n),d=new THREE.Matrix4;d.makeScale(.01,.01,.01);const p=new THREE.Vector3(h.x,h.y,0);p.applyMatrix4(d);const f=new THREE.Vector3(e.x+p.x,e.y+p.y,0),m=new THREE.Vector3(n.x+p.x,n.y+p.y,0),g=this.getColor();l=MxThreeJS.createPoint(e,g),c=MxThreeJS.createPoint(n,g);{d.identity(),d.makeScale(.2,.2,0),new THREE.Vector3(h.x,h.y,0).applyMatrix4(d),d.identity(),d.makeScale(.02,.02,0);const o=new THREE.Vector3(h.x,h.y,0);o.applyMatrix4(d),t.drawLine(f,m),r=MxThreeJS.createLine(new THREE.Vector3(f.x+2*o.x,f.y+2*o.y,0),new THREE.Vector3(e.x+o.x,e.y+o.y,0),g),i=MxThreeJS.createLine(new THREE.Vector3(m.x+2*o.x,m.y+2*o.y,0),new THREE.Vector3(n.x+o.x,n.y+o.y,0),g)}{const r=new THREE.Vector3(1,0,0);let i=u.angleTo(r);const a=new THREE.Vector3(h.x,h.y,0);a.normalize();const s=e.distanceTo(n);u.y<0?i=i<Math.PI/2?2*Math.PI-i:Math.PI-i:i>Math.PI/2&&(i=Math.PI+i);const l=t.getMxObject();l&&(i-=l.getViewAngle());const c=this.getDimText();null!=(o=MxThreeJS.creatTextSprite(c,new THREE.Vector3(m.x+u.x/2+a.x*s/30,m.y+u.y/2+a.y*s/30,0),.07*s,i,this.fontColor||g))&&t.drawEntity(o)}{d.identity(),d.makeScale(.08,.08,.08);const t=new THREE.Matrix4;t.makeRotationZ(17*Math.PI/18);let e=new THREE.Vector3(u.x,u.y,0);e.applyMatrix4(d),e.applyMatrix4(t),t.identity(),t.makeRotationZ(17*-Math.PI/18);let n=new THREE.Vector3(u.x,u.y,0);n.applyMatrix4(d),n.applyMatrix4(t);const r=new Array;r.push(new THREE.Vector3(f.x,f.y,0),new THREE.Vector3(f.x+e.x,f.y+e.y,0),new THREE.Vector3(f.x+n.x,f.y+n.y,0)),a=MxThreeJS.createTriangle(r,g),t.identity(),t.makeRotationZ(Math.PI/18),(e=new THREE.Vector3(u.x,u.y,0)).applyMatrix4(d),e.applyMatrix4(t),t.identity(),t.makeRotationZ(-Math.PI/18),(n=new THREE.Vector3(u.x,u.y,0)).applyMatrix4(d),n.applyMatrix4(t);const i=new Array;i.push(new THREE.Vector3(m.x,m.y,0),new THREE.Vector3(m.x+e.x,m.y+e.y,0),new THREE.Vector3(m.x+n.x,m.y+n.y,0)),s=MxThreeJS.createTriangle(i,g)}t.drawEntity(r),t.drawEntity(i),a&&t.drawEntity(a),s&&t.drawEntity(s),t.drawEntity(l),t.drawEntity(c)}else t.drawLine(this.point1,this.point2)}setPoint1(t){this.point1=t}setPoint2(t){this.point2=t}setColor(t){return lodash.isArray(t)?([this.color=this.color,this.fontColor=this.fontColor||this.color]=t,console.log("this.fontColor : ",this.fontColor)):this.color=t,this}getGripPoints(){let t=[];return t.push(this.point1),t.push(this.point2),t}moveGripPointsAt(t,e){return 0==t?this.point1.add(e):(t=1)&&this.point2.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.dwgInHelp(t,propertyDbKeys$4),!0}dwgOut(t){return this.onDwgOut(t),this.dwgOutHelp(t,propertyDbKeys$4),t}create(){return new MxDbAlignedDimension}}MxDbAlignedDimension.cmd="Mx_DimensionMeasurement",MxDbAlignedDimension.draw=drawMxDbAlignedDimension,addRegisterMxDbEntity(MxDbAlignedDimension);var index$a=Object.freeze({__proto__:null,default:MxDbAlignedDimension});class MxDbHatch extends MxDbEntity{constructor(){super(...arguments),this.points=[]}worldDraw(t){t.getType()===McGiWorldDrawType$1.kWorldDraw?t.drawSolid(this.points):t.drawLines([...this.points,this.points[0]])}getTypeName(){return"MxDbHatch"}moveGripPointsAt(t,e){return 0===t?this.points.forEach(t=>{t.add(e)}):this.points[t-1]&&this.points[t-1].add(e),!0}setPoints(t){this.points=t.map(t=>t.clone())}getGripPoints(){if(this.points.length>0){const{centerPoint:t}=computeBounding(this.points);return[t,...this.points]}return[]}dwgIn(t){this.onDwgIn(t);const e=t.points;return this.points=e.map(({x:t,y:e,z:n})=>new THREE.Vector3(t,e,n)),!0}dwgOut(t){return this.onDwgOut(t),t.points=this.points,t}}addRegisterMxDbEntity(MxDbHatch);var index$9=Object.freeze({__proto__:null,default:MxDbHatch});function drawMxDbArea(){const t=new MrxDbgUiPrPoint;t.setMessage("\n指定第一点:"),t.go(e=>{if(0!=e)return;const n=t.value();let r=new MxDbArea;r.addPoint(n);const i=new McEdGetPointWorldDrawObject;i.setDraw((t,e)=>{let n=r.clone();n.addPoint(t),i.drawCustomEntity(n)}),t.setUserDraw(i),t.setMessage("\n指定下一点:"),t.goWhile(e=>{if(0==e){const e=t.value();r.addPoint(e)}},t=>{r.isFill=!0,r.fillOpacity=.7,r.fillColor=6697540,MxFun.getCurrentDraw().addMxEntity(r)})})}class MxDbArea extends MxDbEntity{constructor(){super(...arguments),this.points=[],this.isFill=!1,this.fillColor=6697540,this.fillOpacity=.7}getTypeName(){return"MxDbArea"}create(){return new MxDbArea}getDimText(){return McGeTool.calcArea(this.points).toFixed(2)}worldDraw(t){if(this.points.length<3)return void(2==this.points.length&&t.drawLine(this.points[0],this.points[1]));let e=this.points[0],n=e.clone(),r=e.clone(),i=this.points.length;for(let o=1;o<i;o++){let i=this.points[o];n.x>i.x&&(n.x=i.x),n.y>i.y&&(n.y=i.y),r.x<i.x&&(r.x=i.x),r.y<i.y&&(r.y=i.y),t.drawLine(e,i),e=i}t.drawLine(e,this.points[0]);let o=new THREE.Vector3(n.x+.5*(r.x-n.x),n.y+.5*(r.y-n.y));const a=t.getColor();let s=MxFun.screenCoordLong2Doc(20),l=MxThreeJS.creatTextSprite(this.getDimText(),o,s,0,a);if(null!=l&&t.drawEntity(l),t.getType()==McGiWorldDrawType$1.kWorldDraw&&this.isFill){t.setColor(this.fillColor),t.setOpacity(this.fillOpacity),t.setRenderOrder(t.getRenderOrder()-1);const e=new MxDbHatch;e.points=this.points,e.worldDraw(t)}}getGripPoints(){return this.points}moveGripPointsAt(t,e){return!(t>=this.points.length||(this.points[t].add(e),0))}dwgIn(t){this.onDwgIn(t);let e=t.points;return this.points=[],e.forEach(t=>{this.points.push(new THREE.Vector3(t.x,t.y,t.z))}),this.dwgInHelp(t,["isFill","fillColor","fillOpacity"]),!0}dwgOut(t){return this.onDwgOut(t),t.points=this.points,this.dwgOutHelp(t,["isFill","fillColor","fillOpacity"]),t}addPoint(t){this.points.push(t.clone())}getPoints(){return this.points}clearPoint(){this.points=[]}}MxDbArea.cmd="Mx_Area",MxDbArea.draw=drawMxDbArea,addRegisterMxDbEntity(MxDbArea);var index$8=Object.freeze({__proto__:null,default:MxDbArea});function drawMxDbLeadTag(){return __awaiter(this,void 0,void 0,function*(){let t=yield(new MrxDbgUiPrPoint).go();if(!t)return;let e=prompt("请输入文字批注","批注");if(!e)return;const n=new MxDbLeadTag;n.point=t,n.text=e,MxFun.addToCurrentSpace(n)})}class MxDbLeadTag extends MxDbEntity{constructor(){super(...arguments),this.point=new THREE.Vector3,this.leadLen=88,this.text="",this.textHeight=24}getTypeName(){return"MxDbLeadTag"}createDots(t,e){const{x:n,y:r,z:i}=t,o=new THREE.Shape;o.arc(n,r,e.screenCoordLong2Doc(6),0,2*Math.PI,!0);const a=new THREE.Path;a.arc(n,r,e.screenCoordLong2Doc(3),0,2*Math.PI,!0),o.holes.push(a);const s=new THREE.ShapeGeometry(o),l=new THREE.MeshPhongMaterial({color:"#ff0000",transparent:!0}),c=new THREE.Shape;c.arc(n,r,e.screenCoordLong2Doc(3),0,2*Math.PI,!0);const u=new THREE.ShapeGeometry(c),h=new THREE.MeshPhongMaterial({color:"#e2da8f",transparent:!0}),d=new THREE.Mesh(s,l),p=new THREE.Mesh(u,h);return d.add(p),d}worldDraw(t){let e=t.getMxObject();const n=this.createDots(this.point,e);if(t.drawEntity(n),n.geometry.computeBoundingBox(),t.drawSelectLine(n.geometry.boundingBox.max,n.geometry.boundingBox.min),2===t.getType())return;let r=t.getMxObject().screenCoordLong2Doc(this.leadLen),i=new THREE.Vector3(this.point.x+2*r,this.point.y+r,0);const o=i.x-r,a=new THREE.Vector3(o,i.y,i.z);t.setLineWidth(4),t.setColor("#ffe605"),t.drawLines([this.point,a,i]);const s=t.getMxObject().screenCoordLong2Doc(this.textHeight),l=i.clone().setX(i.x);t.setColor(16744448);const c=MxThreeJS.creatTextSprite(this.text,l,s,0,t.getColor());if(c){const e=new THREE.Box3,n=new THREE.Vector3;e.expandByObject(c),e.getSize(n),c.position.setX(c.position.x+n.x/2);const r=t.getMxObject().screenCoordLong2Doc(5),i=e.min.clone().setX(e.min.x+n.x/2).setY(e.min.y-r),o=e.max.clone().setX(e.max.x+n.x/2).setY(e.min.y+r);o.setY(e.max.y+r);const a=new THREE.Vector3(i.x,o.y),s=new THREE.Vector3(o.x,i.y);t.setColor("#ffffff"),t.setLineWidth(0),t.drawLine(i,a),t.drawLine(o,s),t.drawLine(i,s),t.drawLine(a,o);const l=r/2,u=[],h=[];u.push(new THREE.Vector3(a.x+l,a.y-r,a.z),new THREE.Vector3(a.x+l,a.y-l,a.z),new THREE.Vector3(a.x+r,a.y-l,a.z)),h.push(new THREE.Vector3(s.x-l,s.y+r,s.z),new THREE.Vector3(s.x-l,s.y+l,s.z),new THREE.Vector3(s.x-r,s.y+l,s.z)),t.drawLines(u),t.drawLines(h),t.setOpacity(.5),t.setColor("#663244"),t.setRenderOrder(-100),t.drawSolid([i,a,o,s]),t.setRenderOrder(100),t.drawEntity(c)}}getGripPoints(){return[this.point]}onViewChange(){return this.setNeedUpdateDisplay(),!0}moveGripPointsAt(t,e){return 0===t&&this.point.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.dwgInHelp(t,["point","text","textHeight","leadLen"]),!0}dwgOut(t){return this.onDwgOut(t),this.dwgOutHelp(t,["point","text","textHeight","leadLen"]),t}}MxDbLeadTag.cmd="Mx_LeadTag",MxDbLeadTag.draw=drawMxDbLeadTag,addRegisterMxDbEntity(MxDbLeadTag);var index$7=Object.freeze({__proto__:null,default:MxDbLeadTag});function drawMxDbAnyLine(){const t=new MrxDbgUiPrPoint,e=MxFun.getCurrentDraw(),n=new McEdGetPointWorldDrawObject,r=new MxDbAnyLine;t.setUserDraw(n),t.setMessage("\n点击开始画线:"),t.go(i=>{i===MrxDbgUiPrBaseReturn$1.kOk&&(r.points.push(t.value()),n.setDraw(t=>{r.points.push(t.clone()),n.drawCustomEntity(r)})),t.setMessage("\n再次点击结束画线:"),t.go(t=>{t===MrxDbgUiPrBaseReturn$1.kOk&&e.addMxEntity(r)})})}const propertyDbKeys$3=["points"];class MxDbAnyLine extends MxDbEntity{constructor(){super(...arguments),this.points=[]}getTypeName(){return"MxDbAnyLine"}create(){return new MxDbAnyLine}worldDraw(t){let e=t.getMxObject();const n=(new THREE.Box3).setFromPoints(this.points);let r=new THREE.Vector3;if(n.getCenter(r),t.drawLines(this.points),t.getType()===McGiWorldDrawType$1.kSelectDraw){const i=new THREE.Vector3;n.getSize(i),i.addScalar(e.screenCoordLong2Doc(20));const o=i.x/2,a=i.y/2,s={x:r.x-o,y:r.y-a},l={x:r.x+o,y:r.y-a},c={x:r.x+o,y:r.y+a},u={x:r.x-o,y:r.y+a};t.drawLine(s.x,s.y,l.x,l.y),t.drawLine(l.x,l.y,c.x,c.y),t.drawLine(c.x,c.y,u.x,u.y),t.drawLine(u.x,u.y,s.x,s.y)}}setPoints(t){return this.points=t,this}getCenter(){const t=new THREE.Geometry;t.vertices=this.points;const e=new THREE.Vector3;return t.computeBoundingBox(),t.boundingBox.getCenter(e),e}getGripPoints(){return[this.getCenter()]}moveGripPointsAt(t,e){return 0===t&&this.points.forEach(t=>{t.add(e)}),!0}dwgIn(t){return this.onDwgIn(t),this.dwgInHelp(t,propertyDbKeys$3),!0}dwgOut(t){return this.onDwgOut(t),this.dwgOutHelp(t,propertyDbKeys$3),t}}MxDbAnyLine.cmd="Mx_AnyLine",MxDbAnyLine.draw=drawMxDbAnyLine,addRegisterMxDbEntity(MxDbAnyLine);var index$6=Object.freeze({__proto__:null,default:MxDbAnyLine});function drawMxDbCloudLine(){const t=new MrxDbgUiPrPoint,e=MxFun.getCurrentDraw(),n=new McEdGetPointWorldDrawObject;t.setMessage("\n点击开启绘制云线:"),t.go(()=>{const r=MxFun.screenCoordLong2Doc(16);let i=t.value();const o=new MxDbCloudLine;o.setRadius(r),o.addPoint(i),n.setDraw(t=>{i.distanceTo(t)>r&&(i=t.clone(),o.addPoint(t,!0)),n.drawCustomEntity(o)}),t.setUserDraw(n),t.setMessage("\n再次点击结束绘制云线:"),t.go(()=>{e.addMxEntity(o)})})}const propertyDbKeys$2=["points","radius"];class MxDbCloudLine extends MxDbEntity{constructor(){super(...arguments),this.points=[],this.radius=16,this.cachePoint=null}getTypeName(){return"MxDbCloudLine"}create(){return new MxDbCloudLine}setRadius(t){this.radius=t}getRadius(){return this.radius}getCachePoint(){return this.cachePoint}clacNewArcDiameterPoint(t){if(0==this.points.length)return t;let e=this.points[this.points.length-1];const n=2*this.radius,r=e.distanceTo(t);if(r<n)return null;const i=n*(t.x-e.x)/r+e.x,o=n*(t.y-e.y)/r+e.y;return new THREE.Vector3(i,o,e.z)}createCloudArcCurvePoints(t,e,n){const r=new THREE.Vector3((t.x+e.x)/2,(t.y+e.y)/2,0);n||(n=r.distanceTo(t));const{startAngle:i,endAngle:o}=function(t,e,n){const r=2*Math.PI/360;return{startAngle:180*Math.atan2(e.y-t.y,e.x-t.x)/Math.PI*r,endAngle:180*Math.atan2(n.y-t.y,n.x-t.x)/Math.PI*r}}(r,t,e);return new THREE.ArcCurve(r.x,r.y,n,i,o,!0).getPoints(10)}addPoint(t,e){let n=this.clacNewArcDiameterPoint(t);n&&(this.points.push(n),this.cachePoint=null,e&&(this.cachePoint=this.reCalculateDrawGeometryPoint()))}addLine(t,e){this.addPoint(t);const n=2*this.radius;let r=this.points[this.points.length-1],i=r.distanceTo(e);const o=Math.round(i/n);for(let t=0;t<o;t++){i=r.distanceTo(e);const t=n*(e.x-r.x)/i+r.x,o=n*(e.y-r.y)/i+r.y;let a=new THREE.Vector3(t,o,e.z);this.addPoint(a),r=a}return this.points[this.points.length-1]}reCalculateDrawGeometryPoint(){if(this.points.length<2)return null;let t=this.points[0],e=this.points.length,n=[];for(let r=1;r<e;r++){let e=this.points[r];this.createCloudArcCurvePoints(t,e).forEach(t=>{n.push(new THREE.Vector3(t.x,t.y,0))}),t=e}return n}worldDraw(t){if(this.cachePoint||(this.cachePoint=this.reCalculateDrawGeometryPoint()),this.cachePoint)if(t.getType()===McGiWorldDrawType$1.kSelectDraw){let e=new THREE.Geometry;this.cachePoint.forEach(t=>{e.vertices.push(new THREE.Vector3(t.x,t.y,0))}),e.computeBoundingBox();const n=new THREE.Vector3;e.boundingBox.getSize(n);let r=new THREE.Vector3;e.boundingBox.getCenter(r);const i=n.x/2,o=n.y/2,a={x:r.x-i,y:r.y-o},s={x:r.x+i,y:r.y-o},l={x:r.x+i,y:r.y+o},c={x:r.x-i,y:r.y+o};t.drawLine(a.x,a.y,s.x,s.y),t.drawLine(s.x,s.y,l.x,l.y),t.drawLine(l.x,l.y,c.x,c.y),t.drawLine(c.x,c.y,a.x,a.y)}else t.drawLines(this.cachePoint)}getCenter(){const t=new THREE.Geometry;t.vertices=this.points;let e=new THREE.Vector3;return t.computeBoundingBox(),t.boundingBox.getCenter(e),e}getGripPoints(){return[this.getCenter()]}moveGripPointsAt(t,e){return this.points.forEach(t=>{t.add(e)}),this.cachePoint=null,!0}dwgIn(t){return this.onDwgIn(t),this.dwgInHelp(t,propertyDbKeys$2),this.cachePoint=null,!0}dwgOut(t){return this.onDwgOut(t),this.dwgOutHelp(t,propertyDbKeys$2),t.type===MxType.MxCloneType.kSaveDwgClone&&this.dwgOutHelp(t,["cachePoint"]),t}}MxDbCloudLine.isRegister=!1,MxDbCloudLine.cmd="Mx_CloudLine",MxDbCloudLine.draw=drawMxDbCloudLine,addRegisterMxDbEntity(MxDbCloudLine);var index$5=Object.freeze({__proto__:null,default:MxDbCloudLine});function drawMxDbRegularPolygon(){const t=new MrxDbgUiPrPoint,e=MxFun.getCurrentDraw(),n=new McEdGetPointWorldDrawObject,r=new MxDbRegularPolygon;t.setMessage("\n点击开始绘制多边形:"),t.go(()=>{let i=prompt("请输入多边形的边数","8");i&&(r.sidesNumber=Number(i),r.centerPoint=t.value(),t.setUserDraw(n),n.setDraw(t=>{r.otherPoint=t,n.drawCustomEntity(r)}),t.setMessage("\n再次点击结束绘制多边形:"),t.go(()=>{e.addMxEntity(r)}))})}class MxDbRegularPolygon extends MxDbShape{constructor(){super(),this.centerPoint=new THREE.Vector3,this.otherPoint=new THREE.Vector3,this.sidesNumber=5,this._propertyDbKeys=[...this._propertyDbKeys,"centerPoint","otherPoint","sidesNumber"]}getTypeName(){return"MxDbRegularPolygon"}worldDraw(t){const e=computeRegularPolygonVertices(this.centerPoint,this.otherPoint,this.sidesNumber);this.closed=!1,e.push(e[0]),this._draw(t,e),this._drawStoreLine(t,e)}getGripPoints(){return[this.centerPoint,this.otherPoint]}moveGripPointsAt(t,e){return 0===t?(this.centerPoint.add(e),this.otherPoint.add(e)):1===t&&this.otherPoint.add(e),!0}}MxDbRegularPolygon.cmd="Mx_RegularPolygon",MxDbRegularPolygon.draw=drawMxDbRegularPolygon,addRegisterMxDbEntity(MxDbRegularPolygon);var index$4=Object.freeze({__proto__:null,default:MxDbRegularPolygon});function drawMxDbLeadComment(){const t=new MrxDbgUiPrPoint;t.setMessage("\n指定第一点:"),t.go(e=>{if(0!=e)return;const n=t.value();let r=new MxDbLeadComment;r.point1=n.clone(),r.textHeight=MxFun.screenCoordLong2Doc(50);let i=prompt("请输入文字批注","批注");if(!i)return;r.text=i,r.textWidth=MxFun.screenCoordLong2Doc(10*i.length),r.fixedSize=!0,r.fixedSize&&(r.textHeight=50,r.textWidth=50*i.length);const o=new McEdGetPointWorldDrawObject;o.setDraw((t,e)=>{r.point2=t,e.drawCustomEntity(r)}),t.setBasePt(n),t.setUseBasePt(!0),t.setUserDraw(o),t.setMessage("\n指定第二点:"),t.go(e=>{if(0!=e)return void console.log(e);const n=t.value();r.point2=n,MxFun.addToCurrentSpace(r)})})}class MxDbLeadComment extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.text="",this.textHeight=20,this.textWidth=0,this.fixedSize=!1}getTypeName(){return"MxDbLeadComment"}create(){return new MxDbLeadComment}worldDraw(t){if(t.drawLine(this.point1,this.point2),this.text.length>0){const e=new THREE.Vector3;let n=this.textHeight,r=this.textWidth,i=t.getMxObject();this.fixedSize&&(n=i.screenCoordLong2Doc(n),r=i.screenCoordLong2Doc(r));let o=MxThreeJS.clacTextSpriteSize(this.text,n,r);e.x=this.point2.x+.5*o.textwidth,e.y=this.point2.y+.5*o.allTextHeight,t.drawText(this.text,n,0,e,r);const a=new THREE.Vector3;a.x=this.point2.x+o.textwidth,a.y=this.point2.y,t.drawLine(a,this.point2)}}getGripPoints(){let t=[];return t.push(this.point1),t.push(this.point2),t}moveGripPointsAt(t,e){return 0==t?this.point1.add(e):1==t&&this.point2.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),this.text=t.text.substr(0),this.textHeight=t.textHeight,t.textWidth&&(this.textWidth=t.textWidth),this.fixedSize=t.fixedSize,!0}dwgOut(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t.textHeight=this.textHeight,t.text=this.text,t.textWidth=this.textWidth,t.fixedSize=this.fixedSize,t}onViewChange(){return!!this.fixedSize&&(this.setNeedUpdateDisplay(!1),!0)}}MxDbLeadComment.cmd="Mx_Comment",MxDbLeadComment.draw=drawMxDbLeadComment,addRegisterMxDbEntity(MxDbLeadComment);var index$3=Object.freeze({__proto__:null,default:MxDbLeadComment});function drawMxDbRectBoxLeadComment(){const t=new MrxDbgUiPrPoint,e=MxFun.getCurrentDraw(),n=new McEdGetPointWorldDrawObject,r=new MxDbRectBoxLeadComment;r.setLineWidth(3),r.setLineWidthByPixels(!0),t.setMessage("\n云线框起始点:"),t.go(i=>{r.radius=MxFun.screenCoordLong2Doc(8),i==MrxDbgUiPrBaseReturn$1.kOk&&(r.point1=t.value(),n.setDraw(t=>{r.point2=t,n.drawCustomEntity(r)}),t.setUserDraw(n),t.setMessage("\n云线框结束点:"),t.go(i=>{if(i!=MrxDbgUiPrBaseReturn$1.kOk)return;r.point2=t.value(),n.setDraw(t=>{r.point3=t,n.drawCustomEntity(r)});let o=prompt("请输入文字批注","批注");o||(o="默认批注文字"),r.text=o,r.textWidth=MxFun.screenCoordLong2Doc(10*o.length),r.textHeight=MxFun.screenCoordLong2Doc(5*o.length),r.fixedSize=!0,r.fixedSize&&(r.textHeight=20,r.textWidth=20*o.length),t.setMessage("\n审图标注点:"),t.go(n=>{n==MrxDbgUiPrBaseReturn$1.kOk&&(r.point3=t.value(),e.addMxEntity(r))})}))})}class MxDbRectBoxLeadComment extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.point3=new THREE.Vector3,this.text="",this.textHeight=20,this.radius=16,this.textWidth=0,this.fixedSize=!1}getTypeName(){return"MxDbRectBoxLeadComment"}create(){return new MxDbRectBoxLeadComment}getCloudLine(){let t=new MxDbCloudLine;t.setRadius(this.radius);let e=this.point1.clone(),n=this.point2.clone();if(e.x>n.x){let t=e.x;e.x=n.x,n.x=t}if(e.y>n.y){let t=e.y;e.y=n.y,n.y=t}let r=new THREE.Vector3(e.x,n.y,e.z);r=t.addLine(e,r),n=new THREE.Vector3(n.x,r.y,n.z),n=t.addLine(r,n);let i=new THREE.Vector3(n.x,e.y,e.z);i=t.addLine(n,i);let o=e=t.addLine(i,e),a=e.distanceTo(this.point3);return a>r.distanceTo(this.point3)&&(o=r,a=r.distanceTo(this.point3)),a>n.distanceTo(this.point3)&&(o=n,a=n.distanceTo(this.point3)),a>i.distanceTo(this.point3)&&(o=i,a=i.distanceTo(this.point3)),{cloudLine:t,pt1:e,pt2:r,pt3:n,pt4:i,leadPt:o}}worldDraw(t){let e=this.getCloudLine();if(e.cloudLine.worldDraw(t),this.text.length>0){let n=e.leadPt,r=new MxDbLeadComment;r.point1=n,r.point2=this.point3,r.text=this.text,r.textHeight=this.textHeight,r.textWidth=this.textWidth,r.fixedSize=this.fixedSize,r.worldDraw(t)}}getGripPoints(){let t=[];return t.push(this.point1),t.push(this.point2),t.push(this.point3),t}moveGripPointsAt(t,e){return 0==t?this.point1.add(e):1==t?this.point2.add(e):2==t&&this.point3.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),this.point3.copy(t.point3),this.text=t.text.substr(0),this.textHeight=t.textHeight,this.radius=t.radius,t.textWidth&&(this.textWidth=t.textWidth),this.fixedSize=t.fixedSize,!0}dwgOut(t){if(this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t.point3=this.point3,t.textHeight=this.textHeight,t.text=this.text,t.radius=this.radius,t.textWidth=this.textWidth,t.fixedSize=this.fixedSize,t.type===MxType.MxCloneType.kSaveDwgClone){let e=this.getCloudLine(),n=e.cloudLine.reCalculateDrawGeometryPoint();t.cachePoint=n||[],t.leadPt=e.leadPt}return t}onViewChange(){return!!this.fixedSize&&(this.setNeedUpdateDisplay(!1),!0)}}MxDbRectBoxLeadComment.cmd="Mx_CheckDraw",MxDbRectBoxLeadComment.draw=drawMxDbRectBoxLeadComment,addRegisterMxDbEntity(MxDbRectBoxLeadComment);var index$2=Object.freeze({__proto__:null,default:MxDbRectBoxLeadComment});function drawMxDbEllipse(){const t=new MrxDbgUiPrPoint,e=MxFun.getCurrentDraw(),n=new McEdGetPointWorldDrawObject,r=new MxDbEllipse;t.setMessage("\n点击开始绘制椭圆:"),t.go(()=>{r.point1=t.value(),n.setDraw(t=>{r.point2=t,n.drawCustomEntity(r)}),t.setUserDraw(n),t.setMessage("\n再次点击结束绘制椭圆:"),t.go(()=>{e.addMxEntity(r)})})}class MxDbEllipse extends MxDbEllipseShape{constructor(){super(),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.isClosedToCenter=!1,this.closed=!1,this._propertyDbKeys=[...this._propertyDbKeys,"point1","point2"]}getTypeName(){return"MxDbEllipse"}create(){return new MxDbEllipse}setPoint1(t){return this.point1=t,this}setPoint2(t){return this.point2=t,this}worldDraw(t){const{point1:e,point2:n}=this,r=e.clone().set(n.x,e.y,n.z),i=n.clone().set(e.x,n.y,e.z);this.xRadius=e.distanceTo(r)/2,this.yRadius=e.distanceTo(i)/2;const o=e.x>n.x,a=e.y>n.y,s=o?e.x-this.xRadius:e.x+this.xRadius,l=a?e.y-this.yRadius:e.y+this.yRadius;this.center=new THREE.Vector3(s,l,0),this.drawEllipseShape(t),t.getType()===McGiWorldDrawType$1.kSelectDraw&&t.drawLines([e,new THREE.Vector3(e.x,n.y),n,new THREE.Vector3(n.x,e.y),e])}getGripPoints(){let t=new THREE.Vector3(.5*(this.point2.x+this.point1.x),.5*(this.point2.y+this.point1.y),0);return[this.point1,this.point2,t]}moveGripPointsAt(t,e){return 0===t?this.point1.add(e):1===t?this.point2.add(e):2===t&&(this.point1.add(e),this.point2.add(e)),!0}}MxDbEllipse.cmd="Mx_Ellipse",MxDbEllipse.draw=drawMxDbEllipse,addRegisterMxDbEntity(MxDbEllipse);var index$1=Object.freeze({__proto__:null,default:MxDbEllipse});function drawMxDbText(){return __awaiter(this,void 0,void 0,function*(){const t=new MrxDbgUiPrPoint;t.setMessage("\n 点取文字插入点:");let e=yield t.go();if(null==e)return;let n=prompt("请输入文字");if(!n)return;let r=new MxDbText;r.position=e,r.height=MxFun.screenCoordLong2Doc(50),r.text=n,MxFun.addToCurrentSpace(r)})}let _SpriteText;function getSpriteTextColor(t){return t?t instanceof THREE.Color?t.getStyle():"number"==typeof t?new THREE.Color(t).getStyle():t:"#fff"}function toCSSFont(t,e,n,r,i){let o=document.createElement("span");return o.style.font="1px serif",o.style.fontFamily=t,o.style.fontSize=`${e}px`,o.style.fontStyle=n,o.style.fontVariant=r,o.style.fontWeight=i,o.style.font}function getSpriteTextClass(){if(!_SpriteText){class t extends THREE.Sprite{constructor(t){super(new THREE.SpriteMaterial);const{text:e,textHeight:n,color:r,backgroundColor:i,padding:o,borderWidth:a,borderRadius:s,borderColor:l,strokeWidth:c,strokeColor:u,fontFace:h,fontSize:d,fontWeight:p,textAlign:f,textShadowBlur:m,textShadowColor:g,textShadowOffsetX:y,textShadowOffsetY:v,angle:x,scale:b,underline:w,fontStyle:M,fontVariant:_}=t||{};this._text=`${e}`,this._textHeight=n||10,this._color=r,this._backgroundColor=i,this._padding=o||0,this._borderWidth=a||0,this._borderRadius=s||0,this._borderColor=l||"white",this._strokeWidth=c||0,this._strokeColor=u||"white",this._fontFace=h||"Arial",this._fontSize=d||90,this._fontWeight=(null==p?void 0:p.toString())||"normal",this._textAlign=f||"start",this._fontStyle=M||"normal",this._fontVariant=_||"normal",this._textShadowBlur=m||0,this._textShadowColor=g,this._textShadowOffsetX=y||0,this._textShadowOffsetY=v||0,this._angle=x||0,this._textScale=b||1,this._underline=w||!1,this._canvas=document.createElement("canvas"),this._genCanvas()}get text(){return this._text}set text(t){this._text=t,this._genCanvas()}get textHeight(){return this._textHeight}set textHeight(t){this._textHeight=t,this._genCanvas()}get color(){return this._color}set color(t){this._color=t,this._genCanvas()}get backgroundColor(){return this._backgroundColor}set backgroundColor(t){this._backgroundColor=t,this._genCanvas()}get padding(){return this._padding}set padding(t){this._padding=t,this._genCanvas()}get borderWidth(){return this._borderWidth}set borderWidth(t){this._borderWidth=t,this._genCanvas()}get borderRadius(){return this._borderRadius}set borderRadius(t){this._borderRadius=t,this._genCanvas()}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t,this._genCanvas()}get fontFace(){return this._fontFace}set fontFace(t){this._fontFace=t,this._genCanvas()}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t,this._genCanvas()}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t,this._genCanvas()}get strokeWidth(){return this._strokeWidth}set strokeWidth(t){this._strokeWidth=t,this._genCanvas()}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t,this._genCanvas()}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t,this._genCanvas()}get textShadowBlur(){return this._textShadowBlur}set textShadowBlur(t){this._textShadowBlur=t,this._genCanvas()}get textShadowColor(){return this._textShadowColor}set textShadowColor(t){this._textShadowColor=t,this._genCanvas()}get textShadowOffsetX(){return this._textShadowOffsetX}set textShadowOffsetX(t){this._textShadowOffsetX=t,this._genCanvas()}get textShadowOffsetY(){return this._textShadowOffsetY}set textShadowOffsetY(t){this._textShadowOffsetY=t,this._genCanvas()}get angle(){return this._angle}set angle(t){this._angle=t,this._genCanvas()}get textScale(){return this._textScale}set textScale(t){this._textScale=t,this._genCanvas()}get underline(){return this._underline}set underline(t){this._underline=t,this._genCanvas()}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t,this._genCanvas()}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t,this._genCanvas()}_genCanvas(){const t=this._canvas,e=t.getContext("2d"),n=Array.isArray(this.borderWidth)?this.borderWidth:[this.borderWidth,this.borderWidth],r=n.map(t=>t*this.fontSize*.1),i=(Array.isArray(this.borderRadius)?this.borderRadius:[this.borderRadius,this.borderRadius,this.borderRadius,this.borderRadius]).map(t=>t*this.fontSize*.1),o=Array.isArray(this.padding)?this.padding:[this.padding,this.padding],a=o.map(t=>t*this.fontSize*.1),s=this.text.split("\n"),l=this.font;e.font=l;const c=Math.max(...s.map(t=>e.measureText(t).width)),u=4*this.strokeWidth+(this.underline?this.fontSize/15*4:this.fontSize/15),h=(this.fontSize+u)*s.length;if(t.width=c+2*r[0]+2*a[0],t.height=h+2*r[1]+2*a[1],this.borderWidth){if(e.strokeStyle=getSpriteTextColor(this.borderColor),r[0]){const n=r[0]/2;e.lineWidth=r[0],e.beginPath(),e.moveTo(n,i[0]),e.lineTo(n,t.height-i[3]),e.moveTo(t.width-n,i[1]),e.lineTo(t.width-n,t.height-i[2]),e.stroke()}if(r[1]){const n=r[1]/2;e.lineWidth=r[1],e.beginPath(),e.moveTo(Math.max(r[0],i[0]),n),e.lineTo(t.width-Math.max(r[0],i[1]),n),e.moveTo(Math.max(r[0],i[3]),t.height-n),e.lineTo(t.width-Math.max(r[0],i[2]),t.height-n),e.stroke()}if(this.borderRadius){const n=Math.max(...r),o=n/2;e.lineWidth=n,e.beginPath(),[!!i[0]&&[i[0],o,o,i[0]],!!i[1]&&[t.width-i[1],t.width-o,o,i[1]],!!i[2]&&[t.width-i[2],t.width-o,t.height-o,t.height-i[2]],!!i[3]&&[i[3],o,t.height-o,t.height-i[3]]].filter(t=>t).forEach(t=>{const[n,r,i,o]=t;e.moveTo(n,i),e.quadraticCurveTo(r,i,r,o)}),e.stroke()}}this.backgroundColor&&(e.fillStyle=getSpriteTextColor(this.backgroundColor),this.borderRadius?(e.beginPath(),e.moveTo(r[0],i[0]),[[r[0],i[0],t.width-i[1],r[1],r[1],r[1]],[t.width-r[0],t.width-r[0],t.width-r[0],r[1],i[1],t.height-i[2]],[t.width-r[0],t.width-i[2],i[3],t.height-r[1],t.height-r[1],t.height-r[1]],[r[0],r[0],r[0],t.height-r[1],t.height-i[3],i[0]]].forEach(([t,n,r,i,o,a])=>{e.quadraticCurveTo(t,i,n,o),e.lineTo(r,a)}),e.closePath(),e.fill()):e.fillRect(r[0],r[1],t.width-2*r[0],t.height-2*r[1])),e.translate(r[0],r[1]),e.translate(a[0],a[1]),e.font=l,e.fillStyle=getSpriteTextColor(this.color),e.textBaseline="bottom",e.shadowBlur=this.textShadowBlur,e.shadowColor=new THREE.Color(this.textShadowColor).getStyle(),e.shadowOffsetX=this.textShadowOffsetX,e.shadowOffsetY=this.textShadowOffsetY;const d=this.strokeWidth>0;d&&(e.lineWidth=this.strokeWidth*this.fontSize/10,e.strokeStyle=getSpriteTextColor(this.strokeColor));const p="center"===this.textAlign,f="start"===this.textAlign||"left"===this.textAlign;s.forEach((n,r)=>__awaiter(this,void 0,void 0,function*(){let i=p?2:1;const o=e.measureText(n).width,a=f?0:(c-o)/i,s=(r+1)*(this.fontSize+u);d&&e.strokeText(n,a,s),e.fillText(n,a,s),this.underline&&e.fillRect(a,t.height-this.fontSize/25,o,this.fontSize/25)})),this.material.map&&this.material.map.dispose();const m=this.material.map=new THREE.Texture(t);m.minFilter=THREE.LinearFilter,m.needsUpdate=!0;const g=this.textHeight*s.length+2*n[1]+2*o[1],y=g*t.width/t.height;this.scale.set(y,g,this.scale.z),this.material.rotation=this.angle,this.scale.applyMatrix4((new THREE.Matrix4).makeScale(this.textScale,this.textScale,1))}clone(){return new(0,this.constructor)(this.text,this.textHeight,this.color).copy(this)}copy(t){return THREE.Sprite.prototype.copy.call(this,t),this.color=t.color,this.backgroundColor=t.backgroundColor,this.padding=t.padding,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.fontFace=t.fontFace,this.fontSize=t.fontSize,this.fontWeight=t.fontWeight,this.strokeWidth=t.strokeWidth,this.strokeColor=t.strokeColor,this.textAlign=t.textAlign,this.textShadowBlur=t.textShadowBlur,this.textShadowColor=t.textShadowColor,this.textShadowOffsetX=t.textShadowOffsetX,this.textShadowOffsetY=t.textShadowOffsetY,this.angle=t.angle,this.textScale=t.textScale,this}get font(){return toCSSFont(this.fontFace,this.fontSize,this.fontStyle,this.fontVariant,this.fontWeight)}checkFontFace(){try{const{fontFace:t}=this;return document.fonts.check(t)}catch(t){}return!0}loadFontFace(){return __awaiter(this,void 0,void 0,function*(){try{const{fontFace:t}=this;yield document.fonts.load(t)}catch(t){}})}dispose(){var t;null===(t=this.material.map)||void 0===t||t.dispose(),this.material.dispose(),this.geometry.dispose(),this.dispatchEvent({type:"dispose"})}}_SpriteText=t}return _SpriteText}const propertyDbKeys$1=["text","position","height","backgroundColor","padding","borderWidth","borderRadius","borderColor","fontFace","fontSize","fontWeight","strokeWidth","strokeColor","angle","textAlign","textShadowBlur","textShadowColor","textShadowOffsetX","textShadowOffsetY","scale","underline"];class MxDbText extends MxDbEntity{constructor(){super(...arguments),this.position=new THREE.Vector3,this._text="",this._height=16,this._angle=0,this._scale=1,this._underline=!1}setPosition(t){return this.position=t,this}get text(){return this.spriteText?this.spriteText.text:this._text}set text(t){this.spriteText?this.spriteText.text=t:this._text=t}setText(t){return this.text=t,this}get height(){return this.spriteText?this.spriteText.textHeight:this._height}set height(t){this.spriteText?this.spriteText.textHeight=t:this._height=t}setHeight(t){return this.height=t,this}get backgroundColor(){return this.spriteText?this.spriteText.backgroundColor:this._backgroundColor}set backgroundColor(t){this.spriteText?this.spriteText.backgroundColor=t:this._backgroundColor=t}setBackgroundColor(t){return this.backgroundColor=t,this}get padding(){return this.spriteText?this.spriteText.padding:this._padding}set padding(t){this.spriteText?this.spriteText.padding=t:this._padding=t}setPadding(t){return this.padding=t,this}get borderWidth(){return this.spriteText?this.spriteText.borderWidth:this._borderWidth}set borderWidth(t){this.spriteText?this.spriteText.borderWidth=t:this._borderWidth=t}setBorderWidth(t){return this.borderWidth=t,this}get borderRadius(){return this.spriteText?this.spriteText.borderRadius:this._borderRadius}set borderRadius(t){this.spriteText?this.spriteText.borderRadius=t:this._borderRadius=t}setBorderRadius(t){return this.borderRadius=t,this}get borderColor(){return this.spriteText?this.spriteText.borderColor:this._borderColor}set borderColor(t){this.spriteText?this.spriteText.borderColor=t:this._borderColor=t}setBorderColor(t){return this.borderColor=t,this}get fontFace(){return this.spriteText?this.spriteText.fontFace:this._fontFace}set fontFace(t){this.spriteText?this.spriteText.fontFace=t:this._fontFace=t}setFontFace(t){return this.fontFace=t,this}get fontSize(){return this.spriteText?this.spriteText.fontSize:this._fontSize}set fontSize(t){this.spriteText?this.spriteText.fontSize=t:this._fontSize=t}setFontSize(t){return this.fontSize=t,this}get fontWeight(){return this.spriteText?this.spriteText.fontWeight:this._fontWeight}set fontWeight(t){this.spriteText?this.spriteText.fontWeight=t:this._fontWeight=t}setFontWeight(t){return this.fontWeight=t,this}get strokeWidth(){return this.spriteText?this.spriteText.strokeWidth:this._strokeWidth}set strokeWidth(t){this.spriteText?this.spriteText.strokeWidth=t:this._strokeWidth=t}setStrokeWidth(t){return this.strokeWidth=t,this}get strokeColor(){return this.spriteText?this.spriteText.strokeColor:this._strokeColor}set strokeColor(t){this.spriteText?this.spriteText.strokeColor=t:this._strokeColor=t}setStrokeColor(t){return this.strokeColor=t,this}get textAlign(){return this.spriteText?this.spriteText.textAlign:this._textAlign}set textAlign(t){this.spriteText?this.spriteText.textAlign=t:this._textAlign=t}setTextAlign(t){return this.textAlign=t,this}get textShadowBlur(){return this.spriteText?this.spriteText.textShadowBlur:this._textShadowBlur}set textShadowBlur(t){this.spriteText?this.spriteText.textShadowBlur=t:this._textShadowBlur=t}setTextShadowBlur(t){return this.textShadowBlur=t,this}get textShadowColor(){return this.spriteText?this.spriteText.textShadowColor:this._textShadowColor}set textShadowColor(t){this.spriteText?this.spriteText.textShadowColor=t:this._textShadowColor=t}setTextShadowColor(t){return this.textShadowColor=t,this}get textShadowOffsetX(){return this.spriteText?this.spriteText.textShadowOffsetX:this._textShadowOffsetX}set textShadowOffsetX(t){this.spriteText?this.spriteText.textShadowOffsetX=t:this._textShadowOffsetX=t}setTextShadowOffsetX(t){return this.textShadowOffsetX=t,this}get textShadowOffsetY(){return this.spriteText?this.spriteText.textShadowOffsetY:this._textShadowOffsetY}set textShadowOffsetY(t){this.spriteText?this.spriteText.textShadowOffsetY=t:this._textShadowOffsetY=t}setTextShadowOffsetY(t){return this.textShadowOffsetY=t,this}get angle(){return this.spriteText?this.spriteText.angle:this._angle}set angle(t){this.spriteText?this.spriteText.angle=t:this._angle=t}setAngle(t){return this.angle=t,this}get scale(){return this.spriteText?this.spriteText.textScale:this._scale}set scale(t){this.spriteText?this.spriteText.textScale=t:this._scale=t}setScale(t){return this.scale=t,this}get underline(){return this.spriteText?this.spriteText.underline:this._underline}set underline(t){this.spriteText?this.spriteText.underline=t:this._underline=t}setUnderline(t){this.underline=t}getTypeName(){return"MxDbText"}worldDraw(t){if(this.text.length>0){t.getType()!==McGiWorldDrawType$1.kWorldDraw||this.spriteText||this.createSpriteText(),this.color!==this.spriteText.color&&(this.spriteText.color=this.color),this.spriteText.material.setValues({opacity:this.opacity,visible:this.visible});const{x:e,y:n,z:r}=this.position;this.spriteText.position.set(e,n,r),t.drawEntity(this.spriteText)}}createSpriteText(){const t=getSpriteTextClass(),{text:e,height:n,color:r,backgroundColor:i,padding:o,borderWidth:a,borderRadius:s,borderColor:l,strokeWidth:c,strokeColor:u,fontFace:h,fontSize:d,fontWeight:p,textAlign:f,textShadowBlur:m,textShadowColor:g,textShadowOffsetX:y,textShadowOffsetY:v,angle:x,scale:b,underline:w}=this;this.spriteText=new t({text:e,textHeight:n,color:r,backgroundColor:i,padding:o,borderWidth:a,borderRadius:s,borderColor:l,strokeWidth:c,strokeColor:u,fontFace:h,fontSize:d,fontWeight:p,textAlign:f,textShadowBlur:m,textShadowColor:g,textShadowOffsetX:y,textShadowOffsetY:v,angle:x,scale:b,underline:w})}getGripPoints(){return[this.position]}moveGripPointsAt(t,e){return 0===t&&this.position.add(e),!0}create(){return new MxDbText}dwgIn(t){return this.onDwgIn(t),this.dwgInHelp(t,propertyDbKeys$1),t.type===MxType.MxCloneType.kMxFileClone||t.type===MxType.MxCloneType.kSaveDwgClone?this.createSpriteText():this.spriteText=t.spriteText,!0}dwgOut(t){return this.onDwgOut(t),this.dwgOutHelp(t,propertyDbKeys$1),t.type===MxType.MxCloneType.kMxFileClone||t.type===MxType.MxCloneType.kSaveDwgClone?t.spriteText=void 0:t.spriteText=this.spriteText,t}getGeomExtents(){return(new THREE.Box3).expandByObject(this.spriteText)}erase(){return super.erase(),this.spriteText&&this.spriteText.dispose(),!0}}MxDbText.cmd="Mx_Text",MxDbText.draw=drawMxDbText,addRegisterMxDbEntity(MxDbText);var index=Object.freeze({__proto__:null,default:MxDbText});function createCurvePath(t=!1){const e=new THREE.CurvePath;return e.autoClose=t,e}function createQuadraticBezierCurve3(t){let e=0,n=[];for(let r=0;r<t.length;r++){const r=t[e],i=t[++e]||r,o=t[++e]||i;if(!r||!i||!o)break;n.push(new THREE.QuadraticBezierCurve3(r,i,o))}return n}function createCubicBezierCurve3(t){let e=0,n=[];for(let r=0;r<t.length;r++){const r=t[e],i=t[++e]||r,o=t[++e]||i,a=t[++e]||o;if(!(r&&i&&o&&a))break;n.push(new THREE.CubicBezierCurve3(r,i,o,a))}return n}function getCurveColorGradientData(t,e){let n=0,r=[],i=[];const o=Number((1/e.length).toFixed(2));let a=new THREE.Color(e[n]),s=new THREE.Color(e[n+1]);for(let l=0,c=t.length;l<c;l++){const c=t[l],u=l/t.length;u/n>=o&&(n++,s.set(new THREE.Color(e[n]||e[--n]))),r.push(c.x,c.y,c.z||0),a.lerpHSL(s,u),i.push(a.r,a.g,a.b)}return[r,i]}function getColorGradientData(t,e){let n=[],r=[];for(let i=0,o=t.length;i<o;i++){const o=t[i];n.push(o.x,o.y,o.z||0);const a=new THREE.Color(e[i]);r.push(a.r,a.g,a.b)}return[n,r]}const propertyDbKeys=["points","colors","linecap","linejoin","closed","curveType","tension","bezierType"];class MxDbGradientLine extends MxDbEntity{constructor(){super(...arguments),this.linecap="round",this.linejoin="round",this.closed=!1,this.curveType="centripetal",this.tension=0,this.bezierType="quadratic"}create(){return new MxDbGradientLine}getTypeName(){return"MxDbGradientLine"}setPoints(t){return this.points=t,this}setColors(t){return this.colors=t,this}addColor(t){return this.colors.push(t),this}setLinecap(t){this.linecap=t}setClosed(t){this.closed=t}setCurveType(t){this.curveType=t}setTension(t){this.tension=t}setBezierType(t){this.bezierType=t}worldDraw(t){const e=t.getType();let n=this.getPoints();const{closed:r,curveType:i,tension:o,bezierType:a}=this,s=new THREE.BufferGeometry;let l=[],c=[];const u="cubic"===a,h="quadratic"===a;0!==o?this.curve=new THREE.CatmullRomCurve3(n,r,i,o):a?(this.curve=createCurvePath(r),u?this.curve.curves=createCubicBezierCurve3(n):h?this.curve.curves=createQuadraticBezierCurve3(n):this.curve=void 0):this.curve=void 0,this.curve&&(n=this.curve.getPoints(50));const{linecap:d,linejoin:p}=this;let f;if(this.colors&&this.colors.length>1){const t=r?[...this.colors,this.colors[0]]:this.colors;[l,c]=this.curve?getCurveColorGradientData(n,t):getColorGradientData(n,t),s.setAttribute("position",new THREE.Float32BufferAttribute(l,3)),s.setAttribute("color",new THREE.Float32BufferAttribute(c,3)),f=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors,linecap:d,linejoin:p})}else s.setFromPoints(n),f=new THREE.LineBasicMaterial({color:this.color,linecap:d,linejoin:p});const m=r?new THREE.LineLoop(s,f):new THREE.Line(s,f);if(t.drawEntity(m),(e===McGiWorldDrawType$1.kSelectDraw||e===McGiWorldDrawType$1.kDynDragDraw)&&this.curve){let e=this.getPoints();const n=t.getLineWidth();t.setLineWidth(1),t.drawLines(e),t.setLineWidth(n)}}getGripPoints(){return this.getPoints()}getPoints(){return this.closed?[...this.points,this.points[0]]:this.points}moveGripPointsAt(t,e){return this.move(t,e),!0}move(t,e){return this.points[t].add(e),this}dwgIn(t){return this.dwgInHelp(t,propertyDbKeys),this.curve=t.curve,!0}dwgOut(t){return this.dwgOutHelp(t,propertyDbKeys),t.curve=this.curve,t}}function drawMxDbEllipseArc(){const t=new MrxDbgUiPrPoint,e=MxFun.getCurrentDraw(),n=new McEdGetPointWorldDrawObject;let r=new MxDbEllipseArc;t.setUserDraw(n),t.go(()=>__awaiter(this,void 0,void 0,function*(){r.center=t.value(),n.setDraw((t,e)=>{r.startPoint=t,r.yRadius=r.center.distanceTo(t),e.drawCustomEntity(r)}),r.startPoint=(yield t.go())||new THREE.Vector3,n.setDraw((t,e)=>{r.endPoint=t,e.drawCustomEntity(r)}),r.endPoint=(yield t.go())||new THREE.Vector3,e.addMxEntity(r)}))}addRegisterMxDbEntity(MxDbGradientLine);class MxDbEllipseArc extends MxDbEllipseShape{constructor(){super(),this._propertyDbKeys=[...this._propertyDbKeys,"startPoint","endPoint"]}getTypeName(){return"MxDbEllipseArc"}setStartPoint(t){return this.startPoint=t,this}setEndPoint(t){return this.endPoint=t,this}worldDraw(t){let{center:e,startPoint:n,endPoint:r}=this;n&&(this.xRadius=e.distanceTo(n),this.startAngle=THREE.MathUtils.degToRad(calculateArcAngle(n,e,this.xRadius).angle)),r&&(this.yRadius=e.distanceTo(r),this.endAngle=THREE.MathUtils.degToRad(calculateArcAngle(r,e,this.yRadius).angle)),this.drawEllipseShape(t)}getGripPoints(){return[this.center,this.startPoint,this.endPoint]}moveGripPointsAt(t,e){return 0===t&&(this.center.add(e),this.startPoint.add(e),this.endPoint.add(e)),1===t&&this.startPoint.add(e),2===t&&this.endPoint.add(e),!0}}function drawMxDbCircleArc(){const t=new MrxDbgUiPrPoint,e=MxFun.getCurrentDraw(),n=new McEdGetPointWorldDrawObject;let r=new MxDbCircleArc;r.stroke="#ff0000",t.setUserDraw(n),t.setMessage("\n确定圆弧中点:"),t.go(()=>__awaiter(this,void 0,void 0,function*(){r.center=t.value(),n.setDraw(t=>{n.drawLine(r.center,t)}),t.setMessage("\n确定圆弧开始点:"),r.startPoint=(yield t.go())||new THREE.Vector3,n.setDraw(t=>{r.endPoint=t,n.drawCustomEntity(r)}),t.setMessage("\n确定圆弧结束点:"),r.endPoint=(yield t.go())||new THREE.Vector3,n.setDraw(()=>{}),e.addMxEntity(r)}))}MxDbEllipseArc.cmd="Mx_MxDbEllipseArc",MxDbEllipseArc.draw=drawMxDbEllipseArc,addRegisterMxDbEntity(MxDbEllipseArc);class MxDbCircleArc extends MxDbCircleShape{constructor(){super(),this._propertyDbKeys=[...this._propertyDbKeys,"startPoint","endPoint"]}getTypeName(){return"MxDbCircleArc"}setStartPoint(t){return this.startPoint=t,this}setEndPoint(t){return this.endPoint=t,this}worldDraw(t){let{startPoint:e,endPoint:n}=this;if(e&&(this.startAngle=this.computePointAngle(e)),n&&(this.endAngle=this.computePointAngle(n)),e&&n){const{points:e}=this.drawEllipseShape(t);this.startPoint=e[0]}}computePointAngle(t){return this.radius=this.center.distanceTo(t),THREE.MathUtils.degToRad(calculateArcAngle(t,this.center,this.radius).angle)}getGripPoints(){return[this.center,this.startPoint,this.endPoint]}moveGripPointsAt(t,e){return 0===t?(this.center.add(e),this.startPoint.add(e),this.endPoint.add(e)):1===t?this.startPoint.add(e):2===t&&this.endPoint.add(e),!0}}MxDbCircleArc.cmd="Mx_MxDbCircleArc",MxDbCircleArc.draw=drawMxDbCircleArc,addRegisterMxDbEntity(MxDbCircleArc);class MxDbArcShape extends MxDbCircleArc{constructor(){super(),this.center=new THREE.Vector3,this.innerRadius=10,this.outerRadius=20,this._propertyDbKeys=[...this._propertyDbKeys,"center","innerRadius","outerRadius"]}getTypeName(){return"MxDbArcShape"}worldDraw(t){t.getType()===McGiWorldDrawType$1.kDynDragDraw?(t.drawCircle(this.center,this.innerRadius),t.drawCircle(this.center,this.outerRadius)):this.drawArcShape(t)}drawArcShape(t){const{center:e,startAngle:n,endAngle:r,clockwise:i}=this,{x:o,y:a}=e;this.isClosedToCenter=!1;const s=this.createEllipseCurve(o,a,this.innerRadius,this.innerRadius,n,r,i),l=this.createEllipseCurve(o,a,this.outerRadius,this.outerRadius,r,n,!i),c=this.createPaths([s,l]);let u=this.getShapePoints(c);this._draw(t,u),this._drawStoreLine(t,u)}getGripPoints(){return[this.center]}moveGripPointsAt(t,e){return 0===t&&this.center.add(e),!0}}function drawMxDbArcShape(){const t=new MrxDbgUiPrPoint,e=MxFun.getCurrentDraw(),n=new McEdGetPointWorldDrawObject;let r=new MxDbArcShapeDraw;t.setMessage("\n确定圆弧中点:"),t.setUserDraw(n),t.go(()=>__awaiter(this,void 0,void 0,function*(){t.setMessage("\n确定圆弧开始点:"),r.center=t.value(),n.setDraw(t=>{r.interRadiusPoint=t,n.drawCircle(r.center,t.distanceTo(r.center))}),r.interRadiusPoint=(yield t.go())||new THREE.Vector3,n.setDraw(t=>{r.outerRadiusPoint=t,n.drawCustomEntity(r)}),r.outerRadiusPoint=(yield t.go())||new THREE.Vector3,e.addMxEntity(r)}))}class MxDbArcShapeDraw extends MxDbArcShape{constructor(){super(),this.outerRadiusPoint=new THREE.Vector3,this.interRadiusPoint=new THREE.Vector3,this._propertyDbKeys=[...this._propertyDbKeys,"interRadiusPoint","outerRadiusPoint"]}getTypeName(){return"MxDbArcShapeDraw"}worldDraw(t){this.innerRadius=this.center.distanceTo(this.interRadiusPoint),this.outerRadius=this.center.distanceTo(this.outerRadiusPoint),this.startAngle=THREE.MathUtils.degToRad(calculateArcAngle(this.interRadiusPoint,this.center,this.innerRadius).angle),this.endAngle=THREE.MathUtils.degToRad(calculateArcAngle(this.outerRadiusPoint,this.center,this.outerRadius).angle),this.drawArcShape(t)}getGripPoints(){return[this.center,this.interRadiusPoint,this.outerRadiusPoint]}moveGripPointsAt(t,e){return 0===t&&(this.center.add(e),this.interRadiusPoint.add(e),this.outerRadiusPoint.add(e)),1===t&&this.interRadiusPoint.add(e),2===t&&this.outerRadiusPoint.add(e),!0}}function drawMxDbRingShape(){const t=new MrxDbgUiPrPoint,e=MxFun.getCurrentDraw(),n=new McEdGetPointWorldDrawObject;t.setUserDraw(n);const r=new McEdGetPointWorldDrawObject,i=new MxDbRingShapeDraw;t.setUserDraw(r),t.setMessage("\n确定圆弧开始点:"),t.go(n=>__awaiter(this,void 0,void 0,function*(){console.log(123),i.center=t.value(),r.setDraw(t=>{r.drawCircle(i.center,i.center.distanceTo(t))}),i.innerPoint=(yield t.go())||new THREE.Vector3,r.setDraw(t=>{i.outerPoint=t,r.drawCustomEntity(i)}),i.outerPoint=(yield t.go())||new THREE.Vector3,e.addMxEntity(i)}))}MxDbArcShapeDraw.isRegister=!1,MxDbArcShapeDraw.cmd="Mx_MxDbArcShape",MxDbArcShapeDraw.draw=drawMxDbArcShape,addRegisterMxDbEntity(MxDbArcShapeDraw);class MxDbRingShape extends MxDbArcShape{getTypeName(){return"MxDbRingShape"}worldDraw(t){const{center:e,startAngle:n,endAngle:r,clockwise:i}=this,{x:o,y:a}=e;this.isClosedToCenter=!1;const s=this.createEllipseCurve(o,a,this.innerRadius,this.innerRadius,n,r,i),l=this.createEllipseCurve(o,a,this.outerRadius,this.outerRadius,n,r,!i),c=this.createPaths([s,l]);let u=this.getShapePoints(c);const h=this.createPaths(s);let d=this.getShapePoints(h);const p=this.createPaths(l);let f=this.getShapePoints(p);this.isFill?(this._draw(t,u),this._drawStoreLine(t,d),this._drawStoreLine(t,f)):(this._draw(t,d),this._drawStoreLine(t,d),this._draw(t,f),this._drawStoreLine(t,f))}}MxDbRingShape.isRegister=!1,MxDbRingShape.cmd="Mx_MxDbRingShape",MxDbRingShape.draw=drawMxDbRingShape;class MxDbRingShapeDraw extends MxDbRingShape{constructor(){super(),this.innerPoint=new THREE.Vector3,this.outerPoint=new THREE.Vector3,this._propertyDbKeys=[...this._propertyDbKeys,"innerPoint","outerPoint"]}getGripPoints(){return[this.center,this.innerPoint,this.outerPoint]}moveGripPointsAt(t,e){return 0===t&&(this.center.add(e),this.innerPoint.add(e),this.outerPoint.add(e)),1===t&&this.innerPoint.add(e),2===t&&this.outerPoint.add(e),!0}worldDraw(t){this.innerPoint&&(this.innerRadius=this.center.distanceTo(this.innerPoint)),this.outerPoint&&(this.outerRadius=this.center.distanceTo(this.outerPoint)),super.worldDraw(t)}}function drawMxDbStarShape(){const t=new MrxDbgUiPrPoint,e=MxFun.getCurrentDraw(),n=new McEdGetPointWorldDrawObject;t.setUserDraw(n);const r=new McEdGetPointWorldDrawObject,i=new MxDbStarShapeDraw;t.setUserDraw(r),t.setMessage("\n确定圆弧开始点:"),t.go(n=>__awaiter(this,void 0,void 0,function*(){i.center=t.value(),r.setDraw(t=>{i.innerPoint=t,r.drawCircle(i.center,i.center.distanceTo(t))}),i.innerPoint=(yield t.go())||new THREE.Vector3,r.setDraw(t=>{i.outerPoint=t,r.drawCustomEntity(i)}),i.outerPoint=(yield t.go())||new THREE.Vector3,e.addMxEntity(i)}))}addRegisterMxDbEntity(MxDbRingShape);class MxDbStarShape extends MxDbShape{constructor(){super(),this.center=new THREE.Vector3,this.numPoints=10,this.innerRadius=10,this.outerRadius=10,this._propertyDbKeys=[...this._propertyDbKeys,"center","numPoints","innerRadius","outerRadius"]}getTypeName(){return"MxDbStarShape"}worldDraw(t){const{x:e,y:n}=this.center,r=new THREE.Path;r.moveTo(e,n-this.outerRadius);for(let t=1;t<2*this.numPoints;t++){const i=t%2==0?this.outerRadius:this.innerRadius,o=i*Math.sin(t*Math.PI/this.numPoints)+e,a=-1*i*Math.cos(t*Math.PI/this.numPoints)+n;r.lineTo(o,a)}r.closePath();const i=this.createPaths(r),o=this.getShapePoints(i);this._draw(t,o),this._drawStoreLine(t,o)}getGripPoints(){return[this.center]}moveGripPointsAt(t,e){return 0===t&&this.center.add(e),!0}}MxDbStarShape.cmd="Mx_MxDbStarShape",MxDbStarShape.draw=drawMxDbStarShape;class MxDbStarShapeDraw extends MxDbStarShape{constructor(){super(),this.innerPoint=new THREE.Vector3,this.outerPoint=new THREE.Vector3,this._propertyDbKeys=[...this._propertyDbKeys,"innerPoint","outerPoint"]}getGripPoints(){return[this.center,this.innerPoint,this.outerPoint]}moveGripPointsAt(t,e){return 0===t&&(this.center.add(e),this.innerPoint.add(e),this.outerPoint.add(e)),1===t&&this.innerPoint.add(e),2===t&&this.outerPoint.add(e),!0}worldDraw(t){this.innerPoint&&(this.innerRadius=this.center.distanceTo(this.innerPoint)),this.outerPoint&&(this.outerRadius=this.center.distanceTo(this.outerPoint)),super.worldDraw(t)}}addRegisterMxDbEntity(MxDbStarShape);class MxDbRegularPolygonShape extends MxDbShape{constructor(){super(),this.center=new THREE.Vector3,this.sidesNumber=6,this.radius=70,this._propertyDbKeys=[...this._propertyDbKeys,"center","sidesNumber","radius"]}getTypeName(){return"MxDbRegularPolygonShape"}worldDraw(t){this._drawPolygonShape(t)}_drawPolygonShape(t){const e=this._getPoints(),n=new THREE.Path;n.moveTo(e[0].x,e[0].y);for(let t=0;t<e.length;t++)n.lineTo(e[t].x,e[t].y);n.closePath();const r=this.createPaths(n),i=this.getShapePoints(r);this._draw(t,i),this._drawStoreLine(t,i)}_getPoints(){const{sidesNumber:t,radius:e}=this,{x:n,y:r}=this.center,i=[];for(let o=0;o<t;o++)i.push({x:e*Math.sin(2*o*Math.PI/t)+n,y:-1*e*Math.cos(2*o*Math.PI/t)+r});return i}getGripPoints(){return[this.center]}moveGripPointsAt(t,e){return 0===t&&this.center.add(e),!0}}function getScreenPixel(t,e){let n=MxFun.screenCoordLong2World(e?t:t-t/3);return n=MxFun.worldCoordLong2Doc(n)}function drawMxDbArrow(){const t=new McEdGetPointWorldDrawObject,e=new MxDbArrow,n=MxFun.getCurrentDraw(),r=new MrxDbgUiPrPoint;r.setUserDraw(t),e.setLineWidth(10),r.go(()=>{e.innerOffset=getScreenPixel(10),e.outerOffset=getScreenPixel(22),e.topOffset=getScreenPixel(36),e.startPoint=r.value(),t.setDraw(n=>{e.endPoint=n,t.drawCustomEntity(e)}),r.go(t=>__awaiter(this,void 0,void 0,function*(){e.endPoint=r.value(),n.addMxEntity(e)}))})}addRegisterMxDbEntity(MxDbRegularPolygonShape);class MxDbArrow extends MxDbShape{constructor(){super(),this.isSharpCorner=!0,this.innerOffset=10,this.outerOffset=22,this.topOffset=36,this.startPoint=new THREE.Vector3,this.endPoint=new THREE.Vector3,this._propertyDbKeys=[...this._propertyDbKeys,"outerOffset","topOffset","innerOffset","isSharpCorner","startPoint","endPoint"]}worldDraw(t){const e=this.getArrowVertex(this.startPoint,this.endPoint);e&&(this._draw(t,e),this._drawStoreLine(t,e))}getArrowVertex(t,e,n=this.isSharpCorner){let{innerOffset:r,topOffset:i,outerOffset:o}=this;const a=[];a[3]=e;const s=Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y));if(0===s)return;const l=-(e.x-t.x)/s,c=(e.y-t.y)/s,u=t.x+r,h=t.y+s-i,d=t.x+o,p=t.y+s-i,f=t.x-r,m=t.y+s-i,g=t.x-o,y=t.y+s-i;return n?(a[0]=t,a[6]=a[0]):(a[0]=new THREE.Vector3(t.x-(f-t.x)*c,t.y-(f-t.x)*l),a[6]=new THREE.Vector3(t.x+(f-t.x)*c,t.y+(f-t.x)*l),a[7]=a[0]),a[1]=new THREE.Vector3(t.x+(u-t.x)*c-(h-t.y)*l,t.y+(u-t.x)*l+(h-t.y)*c),a[2]=new THREE.Vector3(t.x+(d-t.x)*c-(p-t.y)*l,t.y+(d-t.x)*l+(p-t.y)*c),a[4]=new THREE.Vector3(t.x+(g-t.x)*c-(y-t.y)*l,t.y+(g-t.x)*l+(y-t.y)*c),a[5]=new THREE.Vector3(t.x+(f-t.x)*c-(m-t.y)*l,t.y+(f-t.x)*l+(m-t.y)*c),a}getGripPoints(){const t=new THREE.Vector3;return new THREE.Line3(this.startPoint,this.endPoint).getCenter(t),[this.startPoint,t,this.endPoint]}moveGripPointsAt(t,e){return 0===t&&this.startPoint.add(e),1===t&&(this.startPoint.add(e),this.endPoint.add(e)),2===t&&this.endPoint.add(e),!0}}MxDbArrow.cmd="Mx_MxDbArrow",MxDbArrow.draw=drawMxDbArrow,addRegisterMxDbEntity(MxDbArrow);class MxDbLineShape extends MxDbShape{constructor(){super(),this.points=[],this._propertyDbKeys=[...this._propertyDbKeys,"points"]}setPoints(t){return this.points=t,this}addPoint(t){return this.points.push(t),this}removePoint(t){return this.points.splice(t,1),this}getTypeName(){return"MxDbLineShape"}worldDraw(t){this._draw(t,this.points),this._drawStoreLine(t,this.points)}getGripPoints(){return this.points}moveGripPointsAt(t,e){return this.points[t].add(e),!0}getGeomExtents(){return(new THREE.Box3).setFromPoints(this.points)}getGetLength(){let t=0;for(let e=0;e++;e<this.points.length)this.points[e+1]&&(t+=this.points[e].distanceTo(this.points[e+1]));return t}}addRegisterMxDbEntity(MxDbLineShape);var Mx=Object.freeze({__proto__:null,loadCoreCode:loadCoreCode,useCanvasResizeListener:useCanvasResizeListener,store:store,MxFun:MxFun,MxThreeJS:MxThreeJS,MxType:MxType,Mxassembly:Mxassembly,McGeTool:McGeTool,MrxDbgUtils:MrxDbgUtils,MxPaintBrush:MxPaintBrush,MrxDbgUiPrPoint:MrxDbgUiPrPoint,McEdGetPointWorldDrawObject:McEdGetPointWorldDrawObject,MrxDbgUiPrBaseReturn:MrxDbgUiPrBaseReturn$1,MxDbEntity:MxDbEntity,MxDbImage:MxDbImage,MxDbSVG:MxDbSVG,MxDbSVGText:MxDbSVGText,MxDbPolyline:MxDbPolyline,MxDb2LineAngularDimension:MxDb2LineAngularDimension,Mx3PointArc:Mx3PointArc,MxDbCoord:MxDbCoord,MxDbLine:MxDbLine,MxDbRect:MxDbRect,MxDbAlignedDimension:MxDbAlignedDimension,MxFilters:MxFilters,McGiWorldDrawType:McGiWorldDrawType$1,MxDbArea:MxDbArea,MxDbLeadTag:MxDbLeadTag,MxDbAnyLine:MxDbAnyLine,MxDbCloudLine:MxDbCloudLine,MxDbRegularPolygon:MxDbRegularPolygon,MxDbLeadComment:MxDbLeadComment,MxDbRectBoxLeadComment:MxDbRectBoxLeadComment,MxDbEllipse:MxDbEllipse,MxDbText:MxDbText,MxDrawObject:MxDrawObject,MxDbHatch:MxDbHatch,MxDbDatabase:MxDbDatabase,MxCADObject:MxCADObject,MxDbGradientLine:MxDbGradientLine,MxDbShape:MxDbShape,MxDbEllipseShape:MxDbEllipseShape,MxDbEllipseArc:MxDbEllipseArc,MxDbCircleShape:MxDbCircleShape,MxDbCircleArc:MxDbCircleArc,MxDbArcShapeDraw:MxDbArcShapeDraw,MxDbRingShape:MxDbRingShape,MxDbStarShape:MxDbStarShape,MxDbRegularPolygonShape:MxDbRegularPolygonShape,MxDbArrow:MxDbArrow,MxDbLineShape:MxDbLineShape}),elementResizeEventPolyfill_umd_min=createCommonjsModule(function(t,e){"undefined"!=typeof self&&self,t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fae3")}({"6dd8":function(t,e,n){(function(t){var n=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some(function(t,r){return t[0]===e&&(n=r,!0)}),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];t.call(e,i[1],i[0])}},e}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,i=void 0!==t&&t.Math===Math?t:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),o="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)},a=2;var s=20,l=["top","right","bottom","left","width","height","size","weight"],c="undefined"!=typeof MutationObserver,u=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,r=!1,i=0;function s(){n&&(n=!1,t()),r&&c()}function l(){o(s)}function c(){var t=Date.now();if(n){if(t-i<a)return;r=!0}else n=!0,r=!1,setTimeout(l,e);i=t}return c}(this.refresh.bind(this),s)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return t.forEach(function(t){return t.broadcastActive()}),t.length>0},t.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),c?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;l.some(function(t){return!!~n.indexOf(t)})&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),h=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},d=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||i},p=x(0,0,0,0);function f(t){return parseFloat(t)||0}function m(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(e,n){return e+f(t["border-"+n+"-width"])},0)}function g(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return p;var r=d(t).getComputedStyle(t),i=function(t){for(var e={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],o=t["padding-"+i];e[i]=f(o)}return e}(r),o=i.left+i.right,a=i.top+i.bottom,s=f(r.width),l=f(r.height);if("border-box"===r.boxSizing&&(Math.round(s+o)!==e&&(s-=m(r,"left","right")+o),Math.round(l+a)!==n&&(l-=m(r,"top","bottom")+a)),!function(t){return t===d(t).document.documentElement}(t)){var c=Math.round(s+o)-e,u=Math.round(l+a)-n;1!==Math.abs(c)&&(s-=c),1!==Math.abs(u)&&(l-=u)}return x(i.left,i.top,s,l)}var y="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof d(t).SVGGraphicsElement}:function(t){return t instanceof d(t).SVGElement&&"function"==typeof t.getBBox};function v(t){return r?y(t)?function(t){var e=t.getBBox();return x(0,0,e.width,e.height)}(t):g(t):p}function x(t,e,n,r){return{x:t,y:e,width:n,height:r}}var b=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=x(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=v(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),w=function(){return function(t,e){var n=function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(o.prototype);return h(a,{x:e,y:n,width:r,height:i,top:n,right:e+r,bottom:i+n,left:e}),a}(e);h(this,{target:t,contentRect:n})}}(),M=function(){function t(t,e,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=r}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof d(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new b(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof d(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(t){return new w(t.target,t.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),_="undefined"!=typeof WeakMap?new WeakMap:new n,C=function(){return function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=u.getInstance(),r=new M(e,n,this);_.set(this,r)}}();["observe","unobserve","disconnect"].forEach(function(t){C.prototype[t]=function(){var e;return(e=_.get(this))[t].apply(e,arguments)}});var S=void 0!==i.ResizeObserver?i.ResizeObserver:C;e.a=S}).call(this,n("c8ba"))},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},f6fd:function(t,e){!function(t){var e="currentScript",n=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(r){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(t in n)if(n[t].src==e||"interactive"==n[t].readyState)return n[t];return null}}})}(document)},fae3:function(t,e,n){var r;n.r(e),n.d(e,"EventListenerWrapper",function(){return s}),"undefined"!=typeof window&&(n("f6fd"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=r[1]));var i=n("6dd8");const o=EventTarget.prototype.addEventListener,a=function(t){const e=document.createEvent("HTMLEvents");return e.initEvent(t),e},s=function(t){"resize"===t&&c(this),o.apply(this,arguments)};function l(t){const e=l.observer=l.observer||new i.a(t);return e.initialized=!0,e}function c(t){const e=l(t=>{if(e.initialized)e.initialized=!1;else for(let e of t){const t=a("resize");e.target.dispatchEvent(t),e&&e.target&&"function"==typeof e.target.onresize&&e.target.onresize(t)}});e.observe(t)}HTMLElement.prototype.addEventListener=s,Reflect.defineProperty(HTMLElement.prototype,"onresize",{set(t){this._onresize=t,"function"==typeof t&&c(this)},get(){return this._onresize||null}})}})}),elementResizeEventPolyfill_umd_min$1=unwrapExports(elementResizeEventPolyfill_umd_min),elementResizeEventPolyfill_umd_min$2=Object.freeze({__proto__:null,default:elementResizeEventPolyfill_umd_min$1,__moduleExports:elementResizeEventPolyfill_umd_min}),jquery=createCommonjsModule(function(t){var e,n;e="undefined"!=typeof window?window:commonjsGlobal,n=function(t,e){var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(t){return n.flat.call(t)}:function(t){return n.concat.apply([],t)},a=n.push,s=n.indexOf,l={},c=l.toString,u=l.hasOwnProperty,h=u.toString,d=h.call(Object),p={},f=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},m=function(t){return null!=t&&t===t.window},g=t.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function v(t,e,n){var r,i,o=(n=n||g).createElement("script");if(o.text=t,e)for(r in y)(i=e[r]||e.getAttribute&&e.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?l[c.call(t)]||"object":typeof t}var b="3.6.0",w=function(t,e){return new w.fn.init(t,e)};function M(t){var e=!!t&&"length"in t&&t.length,n=x(t);return!f(t)&&!m(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}w.fn=w.prototype={jquery:b,constructor:w,length:0,toArray:function(){return i.call(this)},get:function(t){return null==t?i.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=w.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return w.each(this,t)},map:function(t){return this.pushStack(w.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(w.grep(this,function(t,e){return(e+1)%2}))},odd:function(){return this.pushStack(w.grep(this,function(t,e){return e%2}))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:a,sort:n.sort,splice:n.splice},w.extend=w.fn.extend=function(){var t,e,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[s]||{},s++),"object"==typeof a||f(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(t=arguments[s]))for(e in t)r=t[e],"__proto__"!==e&&a!==r&&(c&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[e],o=i&&!Array.isArray(n)?[]:i||w.isPlainObject(n)?n:{},i=!1,a[e]=w.extend(c,o,r)):void 0!==r&&(a[e]=r));return a},w.extend({expando:"jQuery"+(b+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==c.call(t)||(e=r(t))&&("function"!=typeof(n=u.call(e,"constructor")&&e.constructor)||h.call(n)!==d))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){v(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,r=0;if(M(t))for(n=t.length;r<n&&!1!==e.call(t[r],r,t[r]);r++);else for(r in t)if(!1===e.call(t[r],r,t[r]))break;return t},makeArray:function(t,e){var n=e||[];return null!=t&&(M(Object(t))?w.merge(n,"string"==typeof t?[t]:t):a.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:s.call(e,t,n)},merge:function(t,e){for(var n=+e.length,r=0,i=t.length;r<n;r++)t[i++]=e[r];return t.length=i,t},grep:function(t,e,n){for(var r=[],i=0,o=t.length,a=!n;i<o;i++)!e(t[i],i)!==a&&r.push(t[i]);return r},map:function(t,e,n){var r,i,a=0,s=[];if(M(t))for(r=t.length;a<r;a++)null!=(i=e(t[a],a,n))&&s.push(i);else for(a in t)null!=(i=e(t[a],a,n))&&s.push(i);return o(s)},guid:1,support:p}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=n[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){l["[object "+e+"]"]=e.toLowerCase()});var _=function(t){var e,n,r,i,o,a,s,l,c,u,h,d,p,f,m,g,y,v,x,b="sizzle"+1*new Date,w=t.document,M=0,_=0,C=lt(),S=lt(),T=lt(),E=lt(),D=function(t,e){return t===e&&(h=!0),0},A={}.hasOwnProperty,O=[],P=O.pop,L=O.push,R=O.push,I=O.slice,k=function(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},F="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",B="[\\x20\\t\\r\\n\\f]",j="(?:\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",N="\\[[\\x20\\t\\r\\n\\f]*("+j+")(?:"+B+"*([*^$|!~]?=)"+B+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+j+"))|)"+B+"*\\]",z=":("+j+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",V=new RegExp(B+"+","g"),G=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),H=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),U=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),W=new RegExp(B+"|>"),J=new RegExp(z),q=new RegExp("^"+j+"$"),X={ID:new RegExp("^#("+j+")"),CLASS:new RegExp("^\\.("+j+")"),TAG:new RegExp("^("+j+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Z=/^(?:input|select|textarea|button)$/i,$=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"<22>":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){d()},at=bt(function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{R.apply(O=I.call(w.childNodes),w.childNodes),O[w.childNodes.length].nodeType}catch(t){R={apply:O.length?function(t,e){L.apply(t,I.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function st(t,e,r,i){var o,s,c,u,h,f,y,v=e&&e.ownerDocument,w=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return r;if(!i&&(d(e),e=e||p,m)){if(11!==w&&(h=Q.exec(t)))if(o=h[1]){if(9===w){if(!(c=e.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(v&&(c=v.getElementById(o))&&x(e,c)&&c.id===o)return r.push(c),r}else{if(h[2])return R.apply(r,e.getElementsByTagName(t)),r;if((o=h[3])&&n.getElementsByClassName&&e.getElementsByClassName)return R.apply(r,e.getElementsByClassName(o)),r}if(n.qsa&&!E[t+" "]&&(!g||!g.test(t))&&(1!==w||"object"!==e.nodeName.toLowerCase())){if(y=t,v=e,1===w&&(W.test(t)||U.test(t))){for((v=tt.test(t)&&yt(e.parentNode)||e)===e&&n.scope||((u=e.getAttribute("id"))?u=u.replace(rt,it):e.setAttribute("id",u=b)),s=(f=a(t)).length;s--;)f[s]=(u?"#"+u:":scope")+" "+xt(f[s]);y=f.join(",")}try{return R.apply(r,v.querySelectorAll(y)),r}catch(e){E(t,!0)}finally{u===b&&e.removeAttribute("id")}}}return l(t.replace(G,"$1"),e,r,i)}function lt(){var t=[];return function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function ct(t){return t[b]=!0,t}function ut(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ht(t,e){for(var n=t.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=e}function dt(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ft(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function mt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function gt(t){return ct(function(e){return e=+e,ct(function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function yt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=st.support={},o=st.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!Y.test(e||n&&n.nodeName||"HTML")},d=st.setDocument=function(t){var e,i,a=t?t.ownerDocument||t:w;return a!=p&&9===a.nodeType&&a.documentElement?(f=(p=a).documentElement,m=!o(p),w!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ot,!1):i.attachEvent&&i.attachEvent("onunload",ot)),n.scope=ut(function(t){return f.appendChild(t).appendChild(p.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length}),n.attributes=ut(function(t){return t.className="i",!t.getAttribute("className")}),n.getElementsByTagName=ut(function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length}),n.getElementsByClassName=K.test(p.getElementsByClassName),n.getById=ut(function(t){return f.appendChild(t).id=b,!p.getElementsByName||!p.getElementsByName(b).length}),n.getById?(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n,r,i,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(i=e.getElementsByName(t),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&m)return e.getElementsByClassName(t)},y=[],g=[],(n.qsa=K.test(p.querySelectorAll))&&(ut(function(t){var e;f.appendChild(t).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+F+")"),t.querySelectorAll("[id~="+b+"-]").length||g.push("~="),(e=p.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||g.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]"),t.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")}),ut(function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),f.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=K.test(v=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ut(function(t){n.disconnectedMatch=v.call(t,"*"),v.call(t,"[s!='']:x"),y.push("!=",z)}),g=g.length&&new RegExp(g.join("|")),y=y.length&&new RegExp(y.join("|")),e=K.test(f.compareDocumentPosition),x=e||K.test(f.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},D=e?function(t,e){if(t===e)return h=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t==p||t.ownerDocument==w&&x(w,t)?-1:e==p||e.ownerDocument==w&&x(w,e)?1:u?k(u,t)-k(u,e):0:4&r?-1:1)}:function(t,e){if(t===e)return h=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!i||!o)return t==p?-1:e==p?1:i?-1:o?1:u?k(u,t)-k(u,e):0;if(i===o)return dt(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?dt(a[r],s[r]):a[r]==w?-1:s[r]==w?1:0},p):p},st.matches=function(t,e){return st(t,null,null,e)},st.matchesSelector=function(t,e){if(d(t),n.matchesSelector&&m&&!E[e+" "]&&(!y||!y.test(e))&&(!g||!g.test(e)))try{var r=v.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){E(e,!0)}return st(e,p,null,[t]).length>0},st.contains=function(t,e){return(t.ownerDocument||t)!=p&&d(t),x(t,e)},st.attr=function(t,e){(t.ownerDocument||t)!=p&&d(t);var i=r.attrHandle[e.toLowerCase()],o=i&&A.call(r.attrHandle,e.toLowerCase())?i(t,e,!m):void 0;return void 0!==o?o:n.attributes||!m?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},st.escape=function(t){return(t+"").replace(rt,it)},st.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},st.uniqueSort=function(t){var e,r=[],i=0,o=0;if(h=!n.detectDuplicates,u=!n.sortStable&&t.slice(0),t.sort(D),h){for(;e=t[o++];)e===t[o]&&(i=r.push(o));for(;i--;)t.splice(r[i],1)}return u=null,t},i=st.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=i(e);return n},(r=st.selectors={cacheLength:50,createPseudo:ct,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||st.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&st.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return X.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&J.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=C[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+B+"|$)"))&&C(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(r){var i=st.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(V," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,l){var c,u,h,d,p,f,m=o!==a?"nextSibling":"previousSibling",g=e.parentNode,y=s&&e.nodeName.toLowerCase(),v=!l&&!s,x=!1;if(g){if(o){for(;m;){for(d=e;d=d[m];)if(s?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;f=m="only"===t&&!f&&"nextSibling"}return!0}if(f=[a?g.firstChild:g.lastChild],a&&v){for(x=(p=(c=(u=(h=(d=g)[b]||(d[b]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]||[])[0]===M&&c[1])&&c[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(x=p=0)||f.pop();)if(1===d.nodeType&&++x&&d===e){u[t]=[M,p,x];break}}else if(v&&(x=p=(c=(u=(h=(d=e)[b]||(d[b]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]||[])[0]===M&&c[1]),!1===x)for(;(d=++p&&d&&d[m]||(x=p=0)||f.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++x||(v&&((u=(h=d[b]||(d[b]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]=[M,x]),d!==e)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||st.error("unsupported pseudo: "+t);return i[b]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?ct(function(t,n){for(var r,o=i(t,e),a=o.length;a--;)t[r=k(t,o[a])]=!(n[r]=o[a])}):function(t){return i(t,0,n)}):i}},pseudos:{not:ct(function(t){var e=[],n=[],r=s(t.replace(G,"$1"));return r[b]?ct(function(t,e,n,i){for(var o,a=r(t,null,i,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))}):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}}),has:ct(function(t){return function(e){return st(t,e).length>0}}),contains:ct(function(t){return t=t.replace(et,nt),function(e){return(e.textContent||i(e)).indexOf(t)>-1}}),lang:ct(function(t){return q.test(t||"")||st.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===f},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:mt(!1),disabled:mt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return $.test(t.nodeName)},input:function(t){return Z.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:gt(function(){return[0]}),last:gt(function(t,e){return[e-1]}),eq:gt(function(t,e,n){return[n<0?n+e:n]}),even:gt(function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t}),odd:gt(function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t}),lt:gt(function(t,e,n){for(var r=n<0?n+e:n>e?e:n;--r>=0;)t.push(r);return t}),gt:gt(function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[e]=pt(e);for(e in{submit:!0,reset:!0})r.pseudos[e]=ft(e);function vt(){}function xt(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function bt(t,e,n){var r=e.dir,i=e.next,o=i||r,a=n&&"parentNode"===o,s=_++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||a)return t(e,n,i);return!1}:function(e,n,l){var c,u,h,d=[M,s];if(l){for(;e=e[r];)if((1===e.nodeType||a)&&t(e,n,l))return!0}else for(;e=e[r];)if(1===e.nodeType||a)if(u=(h=e[b]||(e[b]={}))[e.uniqueID]||(h[e.uniqueID]={}),i&&i===e.nodeName.toLowerCase())e=e[r]||e;else{if((c=u[o])&&c[0]===M&&c[1]===s)return d[2]=c[2];if(u[o]=d,d[2]=t(e,n,l))return!0}return!1}}function wt(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function Mt(t,e,n,r,i){for(var o,a=[],s=0,l=t.length,c=null!=e;s<l;s++)(o=t[s])&&(n&&!n(o,r,i)||(a.push(o),c&&e.push(s)));return a}function _t(t,e,n,r,i,o){return r&&!r[b]&&(r=_t(r)),i&&!i[b]&&(i=_t(i,o)),ct(function(o,a,s,l){var c,u,h,d=[],p=[],f=a.length,m=o||function(t,e,n){for(var r=0,i=e.length;r<i;r++)st(t,e[r],n);return n}(e||"*",s.nodeType?[s]:s,[]),g=!t||!o&&e?m:Mt(m,d,t,s,l),y=n?i||(o?t:f||r)?[]:a:g;if(n&&n(g,y,s,l),r)for(c=Mt(y,p),r(c,[],s,l),u=c.length;u--;)(h=c[u])&&(y[p[u]]=!(g[p[u]]=h));if(o){if(i||t){if(i){for(c=[],u=y.length;u--;)(h=y[u])&&c.push(g[u]=h);i(null,y=[],c,l)}for(u=y.length;u--;)(h=y[u])&&(c=i?k(o,h):d[u])>-1&&(o[c]=!(a[c]=h))}}else y=Mt(y===a?y.splice(f,y.length):y),i?i(null,a,y,l):R.apply(a,y)})}function Ct(t){for(var e,n,i,o=t.length,a=r.relative[t[0].type],s=a||r.relative[" "],l=a?1:0,u=bt(function(t){return t===e},s,!0),h=bt(function(t){return k(e,t)>-1},s,!0),d=[function(t,n,r){var i=!a&&(r||n!==c)||((e=n).nodeType?u(t,n,r):h(t,n,r));return e=null,i}];l<o;l++)if(n=r.relative[t[l].type])d=[bt(wt(d),n)];else{if((n=r.filter[t[l].type].apply(null,t[l].matches))[b]){for(i=++l;i<o&&!r.relative[t[i].type];i++);return _t(l>1&&wt(d),l>1&&xt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(G,"$1"),n,l<i&&Ct(t.slice(l,i)),i<o&&Ct(t=t.slice(i)),i<o&&xt(t))}d.push(n)}return wt(d)}return vt.prototype=r.filters=r.pseudos,r.setFilters=new vt,a=st.tokenize=function(t,e){var n,i,o,a,s,l,c,u=S[t+" "];if(u)return e?0:u.slice(0);for(s=t,l=[],c=r.preFilter;s;){for(a in n&&!(i=H.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),n=!1,(i=U.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(G," ")}),s=s.slice(n.length)),r.filter)!(i=X[a].exec(s))||c[a]&&!(i=c[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return e?s.length:s?st.error(t):S(t,l).slice(0)},s=st.compile=function(t,e){var n,i=[],o=[],s=T[t+" "];if(!s){for(e||(e=a(t)),n=e.length;n--;)(s=Ct(e[n]))[b]?i.push(s):o.push(s);(s=T(t,function(t,e){var n=e.length>0,i=t.length>0,o=function(o,a,s,l,u){var h,f,g,y=0,v="0",x=o&&[],b=[],w=c,_=o||i&&r.find.TAG("*",u),C=M+=null==w?1:Math.random()||.1,S=_.length;for(u&&(c=a==p||a||u);v!==S&&null!=(h=_[v]);v++){if(i&&h){for(f=0,a||h.ownerDocument==p||(d(h),s=!m);g=t[f++];)if(g(h,a||p,s)){l.push(h);break}u&&(M=C)}n&&((h=!g&&h)&&y--,o&&x.push(h))}if(y+=v,n&&v!==y){for(f=0;g=e[f++];)g(x,b,a,s);if(o){if(y>0)for(;v--;)x[v]||b[v]||(b[v]=P.call(l));b=Mt(b)}R.apply(l,b),u&&!o&&b.length>0&&y+e.length>1&&st.uniqueSort(l)}return u&&(M=C,c=w),x};return n?ct(o):o}(o,i))).selector=t}return s},l=st.select=function(t,e,n,i){var o,l,c,u,h,d="function"==typeof t&&t,p=!i&&a(t=d.selector||t);if(n=n||[],1===p.length){if((l=p[0]=p[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===e.nodeType&&m&&r.relative[l[1].type]){if(!(e=(r.find.ID(c.matches[0].replace(et,nt),e)||[])[0]))return n;d&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(o=X.needsContext.test(t)?0:l.length;o--&&(c=l[o],!r.relative[u=c.type]);)if((h=r.find[u])&&(i=h(c.matches[0].replace(et,nt),tt.test(l[0].type)&&yt(e.parentNode)||e))){if(l.splice(o,1),!(t=i.length&&xt(l)))return R.apply(n,i),n;break}}return(d||s(t,p))(i,e,!m,n,!e||tt.test(t)&&yt(e.parentNode)||e),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!h,d(),n.sortDetached=ut(function(t){return 1&t.compareDocumentPosition(p.createElement("fieldset"))}),ut(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||ht("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),n.attributes&&ut(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||ht("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),ut(function(t){return null==t.getAttribute("disabled")})||ht(F,function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null}),st}(t);w.find=_,w.expr=_.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=_.uniqueSort,w.text=_.getText,w.isXMLDoc=_.isXML,w.contains=_.contains,w.escapeSelector=_.escape;var C=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&w(t).is(n))break;r.push(t)}return r},S=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},T=w.expr.match.needsContext;function E(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(t,e,n){return f(e)?w.grep(t,function(t,r){return!!e.call(t,r,t)!==n}):e.nodeType?w.grep(t,function(t){return t===e!==n}):"string"!=typeof e?w.grep(t,function(t){return s.call(e,t)>-1!==n}):w.filter(e,t,n)}w.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?w.find.matchesSelector(r,t)?[r]:[]:w.find.matches(t,w.grep(e,function(t){return 1===t.nodeType}))},w.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(w(t).filter(function(){for(e=0;e<r;e++)if(w.contains(i[e],this))return!0}));for(n=this.pushStack([]),e=0;e<r;e++)w.find(t,i[e],n);return r>1?w.uniqueSort(n):n},filter:function(t){return this.pushStack(A(this,t||[],!1))},not:function(t){return this.pushStack(A(this,t||[],!0))},is:function(t){return!!A(this,"string"==typeof t&&T.test(t)?w(t):t||[],!1).length}});var O,P=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||O,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:P.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof w?e[0]:e,w.merge(this,w.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:g,!0)),D.test(r[1])&&w.isPlainObject(e))for(r in e)f(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=g.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):f(t)?void 0!==n.ready?n.ready(t):t(w):w.makeArray(t,this)}).prototype=w.fn,O=w(g);var L=/^(?:parents|prev(?:Until|All))/,R={children:!0,contents:!0,next:!0,prev:!0};function I(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}w.fn.extend({has:function(t){var e=w(t,this),n=e.length;return this.filter(function(){for(var t=0;t<n;t++)if(w.contains(this,e[t]))return!0})},closest:function(t,e){var n,r=0,i=this.length,o=[],a="string"!=typeof t&&w(t);if(!T.test(t))for(;r<i;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?s.call(w(t),this[0]):s.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),w.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return C(t,"parentNode")},parentsUntil:function(t,e,n){return C(t,"parentNode",n)},next:function(t){return I(t,"nextSibling")},prev:function(t){return I(t,"previousSibling")},nextAll:function(t){return C(t,"nextSibling")},prevAll:function(t){return C(t,"previousSibling")},nextUntil:function(t,e,n){return C(t,"nextSibling",n)},prevUntil:function(t,e,n){return C(t,"previousSibling",n)},siblings:function(t){return S((t.parentNode||{}).firstChild,t)},children:function(t){return S(t.firstChild)},contents:function(t){return null!=t.contentDocument&&r(t.contentDocument)?t.contentDocument:(E(t,"template")&&(t=t.content||t),w.merge([],t.childNodes))}},function(t,e){w.fn[t]=function(n,r){var i=w.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(R[t]||w.uniqueSort(i),L.test(t)&&i.reverse()),this.pushStack(i)}});var k=/[^\x20\t\r\n\f]+/g;function F(t){return t}function B(t){throw t}function j(t,e,n,r){var i;try{t&&f(i=t.promise)?i.call(t).done(e).fail(n):t&&f(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}w.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return w.each(t.match(k)||[],function(t,n){e[n]=!0}),e}(t):w.extend({},t);var e,n,r,i,o=[],a=[],s=-1,l=function(){for(i=i||t.once,r=e=!0;a.length;s=-1)for(n=a.shift();++s<o.length;)!1===o[s].apply(n[0],n[1])&&t.stopOnFalse&&(s=o.length,n=!1);t.memory||(n=!1),e=!1,i&&(o=n?[]:"")},c={add:function(){return o&&(n&&!e&&(s=o.length-1,a.push(n)),function e(n){w.each(n,function(n,r){f(r)?t.unique&&c.has(r)||o.push(r):r&&r.length&&"string"!==x(r)&&e(r)})}(arguments),n&&!e&&l()),this},remove:function(){return w.each(arguments,function(t,e){for(var n;(n=w.inArray(e,o,n))>-1;)o.splice(n,1),n<=s&&s--}),this},has:function(t){return t?w.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||e||(o=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},w.extend({Deferred:function(e){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return w.Deferred(function(e){w.each(n,function(n,r){var i=f(t[r[4]])&&t[r[4]];o[r[1]](function(){var t=i&&i.apply(this,arguments);t&&f(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[r[0]+"With"](this,i?[t]:arguments)})}),t=null}).promise()},then:function(e,r,i){var o=0;function a(e,n,r,i){return function(){var s=this,l=arguments,c=function(){var t,c;if(!(e<o)){if((t=r.apply(s,l))===n.promise())throw new TypeError("Thenable self-resolution");c=t&&("object"==typeof t||"function"==typeof t)&&t.then,f(c)?i?c.call(t,a(o,n,F,i),a(o,n,B,i)):(o++,c.call(t,a(o,n,F,i),a(o,n,B,i),a(o,n,F,n.notifyWith))):(r!==F&&(s=void 0,l=[t]),(i||n.resolveWith)(s,l))}},u=i?c:function(){try{c()}catch(t){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(t,u.stackTrace),e+1>=o&&(r!==B&&(s=void 0,l=[t]),n.rejectWith(s,l))}};e?u():(w.Deferred.getStackHook&&(u.stackTrace=w.Deferred.getStackHook()),t.setTimeout(u))}}return w.Deferred(function(t){n[0][3].add(a(0,t,f(i)?i:F,t.notifyWith)),n[1][3].add(a(0,t,f(e)?e:F)),n[2][3].add(a(0,t,f(r)?r:B))}).promise()},promise:function(t){return null!=t?w.extend(t,i):i}},o={};return w.each(n,function(t,e){var a=e[2],s=e[5];i[e[1]]=a.add,s&&a.add(function(){r=s},n[3-t][2].disable,n[3-t][3].disable,n[0][2].lock,n[0][3].lock),a.add(e[3].fire),o[e[0]]=function(){return o[e[0]+"With"](this===o?void 0:this,arguments),this},o[e[0]+"With"]=a.fireWith}),i.promise(o),e&&e.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),o=i.call(arguments),a=w.Deferred(),s=function(t){return function(n){r[t]=this,o[t]=arguments.length>1?i.call(arguments):n,--e||a.resolveWith(r,o)}};if(e<=1&&(j(t,a.done(s(n)).resolve,a.reject,!e),"pending"===a.state()||f(o[n]&&o[n].then)))return a.then();for(;n--;)j(o[n],s(n),a.reject);return a.promise()}});var N=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(e,n){t.console&&t.console.warn&&e&&N.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,n)},w.readyException=function(e){t.setTimeout(function(){throw e})};var z=w.Deferred();function V(){g.removeEventListener("DOMContentLoaded",V),t.removeEventListener("load",V),w.ready()}w.fn.ready=function(t){return z.then(t).catch(function(t){w.readyException(t)}),this},w.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==t&&--w.readyWait>0||z.resolveWith(g,[w]))}}),w.ready.then=z.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?t.setTimeout(w.ready):(g.addEventListener("DOMContentLoaded",V),t.addEventListener("load",V));var G=function(t,e,n,r,i,o,a){var s=0,l=t.length,c=null==n;if("object"===x(n))for(s in i=!0,n)G(t,e,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,f(r)||(a=!0),c&&(a?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(w(t),n)})),e))for(;s<l;s++)e(t[s],n,a?r:r.call(t[s],s,e(t[s],n)));return i?t:c?e.call(t):l?e(t[0],n):o},H=/^-ms-/,U=/-([a-z])/g;function W(t,e){return e.toUpperCase()}function J(t){return t.replace(H,"ms-").replace(U,W)}var q=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function X(){this.expando=w.expando+X.uid++}X.uid=1,X.prototype={cache:function(t){var e=t[this.expando];return e||(e={},q(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var r,i=this.cache(t);if("string"==typeof e)i[J(e)]=n;else for(r in e)i[J(r)]=e[r];return i},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][J(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r=t[this.expando];if(void 0!==r){if(void 0!==e){n=(e=Array.isArray(e)?e.map(J):(e=J(e))in r?[e]:e.match(k)||[]).length;for(;n--;)delete r[e[n]]}(void 0===e||w.isEmptyObject(r))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!w.isEmptyObject(e)}};var Y=new X,Z=new X,$=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Q(t,e,n){var r;if(void 0===n&&1===t.nodeType)if(r="data-"+e.replace(K,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(r))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:$.test(t)?JSON.parse(t):t)}(n)}catch(t){}Z.set(t,e,n)}else n=void 0;return n}w.extend({hasData:function(t){return Z.hasData(t)||Y.hasData(t)},data:function(t,e,n){return Z.access(t,e,n)},removeData:function(t,e){Z.remove(t,e)},_data:function(t,e,n){return Y.access(t,e,n)},_removeData:function(t,e){Y.remove(t,e)}}),w.fn.extend({data:function(t,e){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===t){if(this.length&&(i=Z.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=J(r.slice(5)),Q(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof t?this.each(function(){Z.set(this,t)}):G(this,function(e){var n;if(o&&void 0===e)return void 0!==(n=Z.get(o,t))||void 0!==(n=Q(o,t))?n:void 0;this.each(function(){Z.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){Z.remove(this,t)})}}),w.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=Y.get(t,e),n&&(!r||Array.isArray(n)?r=Y.access(t,e,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=w.queue(t,e),r=n.length,i=n.shift(),o=w._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,function(){w.dequeue(t,e)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return Y.get(t,n)||Y.access(t,n,{empty:w.Callbacks("once memory").add(function(){Y.remove(t,[e+"queue",n])})})}}),w.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?w.queue(this[0],t):void 0===e?this:this.each(function(){var n=w.queue(this,t,e);w._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&w.dequeue(this,t)})},dequeue:function(t){return this.each(function(){w.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,i=w.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";a--;)(n=Y.get(o[a],t+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(e)}});var tt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,et=new RegExp("^(?:([+-])=|)("+tt+")([a-z%]*)$","i"),nt=["Top","Right","Bottom","Left"],rt=g.documentElement,it=function(t){return w.contains(t.ownerDocument,t)},ot={composed:!0};rt.getRootNode&&(it=function(t){return w.contains(t.ownerDocument,t)||t.getRootNode(ot)===t.ownerDocument});var at=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&it(t)&&"none"===w.css(t,"display")};function st(t,e,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return w.css(t,e,"")},l=s(),c=n&&n[3]||(w.cssNumber[e]?"":"px"),u=t.nodeType&&(w.cssNumber[e]||"px"!==c&&+l)&&et.exec(w.css(t,e));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;a--;)w.style(t,e,u+c),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),u/=o;u*=2,w.style(t,e,u+c),n=n||[]}return n&&(u=+u||+l||0,i=n[1]?u+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=u,r.end=i)),i}var lt={};function ct(t){var e,n=t.ownerDocument,r=t.nodeName,i=lt[r];return i||(e=n.body.appendChild(n.createElement(r)),i=w.css(e,"display"),e.parentNode.removeChild(e),"none"===i&&(i="block"),lt[r]=i,i)}function ut(t,e){for(var n,r,i=[],o=0,a=t.length;o<a;o++)(r=t[o]).style&&(n=r.style.display,e?("none"===n&&(i[o]=Y.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&at(r)&&(i[o]=ct(r))):"none"!==n&&(i[o]="none",Y.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(t[o].style.display=i[o]);return t}w.fn.extend({show:function(){return ut(this,!0)},hide:function(){return ut(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){at(this)?w(this).show():w(this).hide()})}});var ht,dt,pt=/^(?:checkbox|radio)$/i,ft=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,mt=/^$|^module$|\/(?:java|ecma)script/i;ht=g.createDocumentFragment().appendChild(g.createElement("div")),(dt=g.createElement("input")).setAttribute("type","radio"),dt.setAttribute("checked","checked"),dt.setAttribute("name","t"),ht.appendChild(dt),p.checkClone=ht.cloneNode(!0).cloneNode(!0).lastChild.checked,ht.innerHTML="<textarea>x</textarea>",p.noCloneChecked=!!ht.cloneNode(!0).lastChild.defaultValue,ht.innerHTML="<option></option>",p.option=!!ht.lastChild;var gt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function yt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&E(t,e)?w.merge([t],n):n}function vt(t,e){for(var n=0,r=t.length;n<r;n++)Y.set(t[n],"globalEval",!e||Y.get(e[n],"globalEval"))}gt.tbody=gt.tfoot=gt.colgroup=gt.caption=gt.thead,gt.th=gt.td,p.option||(gt.optgroup=gt.option=[1,"<select multiple='multiple'>","</select>"]);var xt=/<|&#?\w+;/;function bt(t,e,n,r,i){for(var o,a,s,l,c,u,h=e.createDocumentFragment(),d=[],p=0,f=t.length;p<f;p++)if((o=t[p])||0===o)if("object"===x(o))w.merge(d,o.nodeType?[o]:o);else if(xt.test(o)){for(a=a||h.appendChild(e.createElement("div")),s=(ft.exec(o)||["",""])[1].toLowerCase(),l=gt[s]||gt._default,a.innerHTML=l[1]+w.htmlPrefilter(o)+l[2],u=l[0];u--;)a=a.lastChild;w.merge(d,a.childNodes),(a=h.firstChild).textContent=""}else d.push(e.createTextNode(o));for(h.textContent="",p=0;o=d[p++];)if(r&&w.inArray(o,r)>-1)i&&i.push(o);else if(c=it(o),a=yt(h.appendChild(o),"script"),c&&vt(a),n)for(u=0;o=a[u++];)mt.test(o.type||"")&&n.push(o);return h}var wt=/^([^.]*)(?:\.(.+)|)/;function Mt(){return!0}function _t(){return!1}function Ct(t,e){return t===function(){try{return g.activeElement}catch(t){}}()==("focus"===e)}function St(t,e,n,r,i,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof n&&(r=r||n,n=void 0),e)St(t,s,n,r,e[s],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=_t;else if(!i)return t;return 1===o&&(a=i,(i=function(t){return w().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),t.each(function(){w.event.add(this,e,i,r,n)})}function Tt(t,e,n){n?(Y.set(t,e,!1),w.event.add(t,e,{namespace:!1,handler:function(t){var r,o,a=Y.get(this,e);if(1&t.isTrigger&&this[e]){if(a.length)(w.event.special[e]||{}).delegateType&&t.stopPropagation();else if(a=i.call(arguments),Y.set(this,e,a),r=n(this,e),this[e](),a!==(o=Y.get(this,e))||r?Y.set(this,e,!1):o={},a!==o)return t.stopImmediatePropagation(),t.preventDefault(),o&&o.value}else a.length&&(Y.set(this,e,{value:w.event.trigger(w.extend(a[0],w.Event.prototype),a.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===Y.get(t,e)&&w.event.add(t,e,Mt)}w.event={global:{},add:function(t,e,n,r,i){var o,a,s,l,c,u,h,d,p,f,m,g=Y.get(t);if(q(t))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(rt,i),n.guid||(n.guid=w.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(e){return void 0!==w&&w.event.triggered!==e.type?w.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(k)||[""]).length;c--;)p=m=(s=wt.exec(e[c])||[])[1],f=(s[2]||"").split(".").sort(),p&&(h=w.event.special[p]||{},p=(i?h.delegateType:h.bindType)||p,h=w.event.special[p]||{},u=w.extend({type:p,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:f.join(".")},o),(d=l[p])||((d=l[p]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(t,r,f,a)||t.addEventListener&&t.addEventListener(p,a)),h.add&&(h.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,u):d.push(u),w.event.global[p]=!0)},remove:function(t,e,n,r,i){var o,a,s,l,c,u,h,d,p,f,m,g=Y.hasData(t)&&Y.get(t);if(g&&(l=g.events)){for(c=(e=(e||"").match(k)||[""]).length;c--;)if(p=m=(s=wt.exec(e[c])||[])[1],f=(s[2]||"").split(".").sort(),p){for(h=w.event.special[p]||{},d=l[p=(r?h.delegateType:h.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)u=d[o],!i&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(d.splice(o,1),u.selector&&d.delegateCount--,h.remove&&h.remove.call(t,u));a&&!d.length&&(h.teardown&&!1!==h.teardown.call(t,f,g.handle)||w.removeEvent(t,p,g.handle),delete l[p])}else for(p in l)w.event.remove(t,p+e[c],n,r,!0);w.isEmptyObject(l)&&Y.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,a,s=new Array(arguments.length),l=w.event.fix(t),c=(Y.get(this,"events")||Object.create(null))[l.type]||[],u=w.event.special[l.type]||{};for(s[0]=l,e=1;e<arguments.length;e++)s[e]=arguments[e];if(l.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,l)){for(a=w.event.handlers.call(this,l,c),e=0;(i=a[e++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(r=((w.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,l),l.result}},handlers:function(t,e){var n,r,i,o,a,s=[],l=e.delegateCount,c=t.target;if(l&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(o=[],a={},n=0;n<l;n++)void 0===a[i=(r=e[n]).selector+" "]&&(a[i]=r.needsContext?w(i,this).index(c)>-1:w.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,l<e.length&&s.push({elem:c,handlers:e.slice(l)}),s},addProp:function(t,e){Object.defineProperty(w.Event.prototype,t,{enumerable:!0,configurable:!0,get:f(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[w.expando]?t:new w.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return pt.test(e.type)&&e.click&&E(e,"input")&&Tt(e,"click",Mt),!1},trigger:function(t){var e=this||t;return pt.test(e.type)&&e.click&&E(e,"input")&&Tt(e,"click"),!0},_default:function(t){var e=t.target;return pt.test(e.type)&&e.click&&E(e,"input")&&Y.get(e,"click")||E(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},w.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},w.Event=function(t,e){if(!(this instanceof w.Event))return new w.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Mt:_t,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&w.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:_t,isPropagationStopped:_t,isImmediatePropagationStopped:_t,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Mt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Mt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Mt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},w.event.addProp),w.each({focus:"focusin",blur:"focusout"},function(t,e){w.event.special[t]={setup:function(){return Tt(this,t,Ct),!1},trigger:function(){return Tt(this,t),!0},_default:function(){return!0},delegateType:e}}),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){w.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=t.relatedTarget,i=t.handleObj;return r&&(r===this||w.contains(this,r))||(t.type=i.origType,n=i.handler.apply(this,arguments),t.type=e),n}}}),w.fn.extend({on:function(t,e,n,r){return St(this,t,e,n,r)},one:function(t,e,n,r){return St(this,t,e,n,r,1)},off:function(t,e,n){var r,i;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,w(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof t){for(i in t)this.off(i,e,t[i]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=_t),this.each(function(){w.event.remove(this,t,n,e)})}});var Et=/<script|<style|<link/i,Dt=/checked\s*(?:[^=]|=\s*.checked.)/i,At=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ot(t,e){return E(t,"table")&&E(11!==e.nodeType?e:e.firstChild,"tr")&&w(t).children("tbody")[0]||t}function Pt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Lt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Rt(t,e){var n,r,i,o,a,s;if(1===e.nodeType){if(Y.hasData(t)&&(s=Y.get(t).events))for(i in Y.remove(e,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)w.event.add(e,i,s[i][n]);Z.hasData(t)&&(o=Z.access(t),a=w.extend({},o),Z.set(e,a))}}function It(t,e){var n=e.nodeName.toLowerCase();"input"===n&&pt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function kt(t,e,n,r){e=o(e);var i,a,s,l,c,u,h=0,d=t.length,m=d-1,g=e[0],y=f(g);if(y||d>1&&"string"==typeof g&&!p.checkClone&&Dt.test(g))return t.each(function(i){var o=t.eq(i);y&&(e[0]=g.call(this,i,o.html())),kt(o,e,n,r)});if(d&&(a=(i=bt(e,t[0].ownerDocument,!1,t,r)).firstChild,1===i.childNodes.length&&(i=a),a||r)){for(l=(s=w.map(yt(i,"script"),Pt)).length;h<d;h++)c=i,h!==m&&(c=w.clone(c,!0,!0),l&&w.merge(s,yt(c,"script"))),n.call(t[h],c,h);if(l)for(u=s[s.length-1].ownerDocument,w.map(s,Lt),h=0;h<l;h++)c=s[h],mt.test(c.type||"")&&!Y.access(c,"globalEval")&&w.contains(u,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?w._evalUrl&&!c.noModule&&w._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},u):v(c.textContent.replace(At,""),c,u))}return t}function Ft(t,e,n){for(var r,i=e?w.filter(e,t):t,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||w.cleanData(yt(r)),r.parentNode&&(n&&it(r)&&vt(yt(r,"script")),r.parentNode.removeChild(r));return t}w.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var r,i,o,a,s=t.cloneNode(!0),l=it(t);if(!(p.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||w.isXMLDoc(t)))for(a=yt(s),r=0,i=(o=yt(t)).length;r<i;r++)It(o[r],a[r]);if(e)if(n)for(o=o||yt(t),a=a||yt(s),r=0,i=o.length;r<i;r++)Rt(o[r],a[r]);else Rt(t,s);return(a=yt(s,"script")).length>0&&vt(a,!l&&yt(t,"script")),s},cleanData:function(t){for(var e,n,r,i=w.event.special,o=0;void 0!==(n=t[o]);o++)if(q(n)){if(e=n[Y.expando]){if(e.events)for(r in e.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,e.handle);n[Y.expando]=void 0}n[Z.expando]&&(n[Z.expando]=void 0)}}}),w.fn.extend({detach:function(t){return Ft(this,t,!0)},remove:function(t){return Ft(this,t)},text:function(t){return G(this,function(t){return void 0===t?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return kt(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ot(this,t).appendChild(t)})},prepend:function(){return kt(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Ot(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return kt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return kt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(w.cleanData(yt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return w.clone(this,t,e)})},html:function(t){return G(this,function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Et.test(t)&&!gt[(ft.exec(t)||["",""])[1].toLowerCase()]){t=w.htmlPrefilter(t);try{for(;n<r;n++)1===(e=this[n]||{}).nodeType&&(w.cleanData(yt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=[];return kt(this,arguments,function(e){var n=this.parentNode;w.inArray(this,t)<0&&(w.cleanData(yt(this)),n&&n.replaceChild(e,this))},t)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){w.fn[t]=function(t){for(var n,r=[],i=w(t),o=i.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),w(i[s])[e](n),a.apply(r,n.get());return this.pushStack(r)}});var Bt=new RegExp("^("+tt+")(?!px)[a-z%]+$","i"),jt=function(e){var n=e.ownerDocument.defaultView;return n&&n.opener||(n=t),n.getComputedStyle(e)},Nt=function(t,e,n){var r,i,o={};for(i in e)o[i]=t.style[i],t.style[i]=e[i];for(i in r=n.call(t),e)t.style[i]=o[i];return r},zt=new RegExp(nt.join("|"),"i");function Vt(t,e,n){var r,i,o,a,s=t.style;return(n=n||jt(t))&&(""!==(a=n.getPropertyValue(e)||n[e])||it(t)||(a=w.style(t,e)),!p.pixelBoxStyles()&&Bt.test(a)&&zt.test(e)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Gt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function e(){if(u){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",rt.appendChild(c).appendChild(u);var e=t.getComputedStyle(u);r="1%"!==e.top,l=12===n(e.marginLeft),u.style.right="60%",a=36===n(e.right),i=36===n(e.width),u.style.position="absolute",o=12===n(u.offsetWidth/3),rt.removeChild(c),u=null}}function n(t){return Math.round(parseFloat(t))}var r,i,o,a,s,l,c=g.createElement("div"),u=g.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",p.clearCloneStyle="content-box"===u.style.backgroundClip,w.extend(p,{boxSizingReliable:function(){return e(),i},pixelBoxStyles:function(){return e(),a},pixelPosition:function(){return e(),r},reliableMarginLeft:function(){return e(),l},scrollboxSize:function(){return e(),o},reliableTrDimensions:function(){var e,n,r,i;return null==s&&(e=g.createElement("table"),n=g.createElement("tr"),r=g.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",rt.appendChild(e).appendChild(n).appendChild(r),i=t.getComputedStyle(n),s=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,rt.removeChild(e)),s}}))}();var Ht=["Webkit","Moz","ms"],Ut=g.createElement("div").style,Wt={};function Jt(t){return w.cssProps[t]||Wt[t]||(t in Ut?t:Wt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=Ht.length;n--;)if((t=Ht[n]+e)in Ut)return t}(t)||t)}var qt=/^(none|table(?!-c[ea]).+)/,Xt=/^--/,Yt={position:"absolute",visibility:"hidden",display:"block"},Zt={letterSpacing:"0",fontWeight:"400"};function $t(t,e,n){var r=et.exec(e);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):e}function Kt(t,e,n,r,i,o){var a="width"===e?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=w.css(t,n+nt[a],!0,i)),r?("content"===n&&(l-=w.css(t,"padding"+nt[a],!0,i)),"margin"!==n&&(l-=w.css(t,"border"+nt[a]+"Width",!0,i))):(l+=w.css(t,"padding"+nt[a],!0,i),"padding"!==n?l+=w.css(t,"border"+nt[a]+"Width",!0,i):s+=w.css(t,"border"+nt[a]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-s-.5))||0),l}function Qt(t,e,n){var r=jt(t),i=(!p.boxSizingReliable()||n)&&"border-box"===w.css(t,"boxSizing",!1,r),o=i,a=Vt(t,e,r),s="offset"+e[0].toUpperCase()+e.slice(1);if(Bt.test(a)){if(!n)return a;a="auto"}return(!p.boxSizingReliable()&&i||!p.reliableTrDimensions()&&E(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===w.css(t,"display",!1,r))&&t.getClientRects().length&&(i="border-box"===w.css(t,"boxSizing",!1,r),(o=s in t)&&(a=t[s])),(a=parseFloat(a)||0)+Kt(t,e,n||(i?"border":"content"),o,r,a)+"px"}function te(t,e,n,r,i){return new te.prototype.init(t,e,n,r,i)}w.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Vt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,a,s=J(e),l=Xt.test(e),c=t.style;if(l||(e=Jt(s)),a=w.cssHooks[e]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(t,!1,r))?i:c[e];"string"==(o=typeof n)&&(i=et.exec(n))&&i[1]&&(n=st(t,e,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),p.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,r){var i,o,a,s=J(e);return Xt.test(e)||(e=Jt(s)),(a=w.cssHooks[e]||w.cssHooks[s])&&"get"in a&&(i=a.get(t,!0,n)),void 0===i&&(i=Vt(t,e,r)),"normal"===i&&e in Zt&&(i=Zt[e]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(t,e){w.cssHooks[e]={get:function(t,n,r){if(n)return!qt.test(w.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?Qt(t,e,r):Nt(t,Yt,function(){return Qt(t,e,r)})},set:function(t,n,r){var i,o=jt(t),a=!p.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===w.css(t,"boxSizing",!1,o),l=r?Kt(t,e,r,s,o):0;return s&&a&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-Kt(t,e,"border",!1,o)-.5)),l&&(i=et.exec(n))&&"px"!==(i[3]||"px")&&(t.style[e]=n,n=w.css(t,e)),$t(0,n,l)}}}),w.cssHooks.marginLeft=Gt(p.reliableMarginLeft,function(t,e){if(e)return(parseFloat(Vt(t,"marginLeft"))||t.getBoundingClientRect().left-Nt(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(t,e){w.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[t+nt[r]+e]=o[r]||o[r-2]||o[0];return i}},"margin"!==t&&(w.cssHooks[t+e].set=$t)}),w.fn.extend({css:function(t,e){return G(this,function(t,e,n){var r,i,o={},a=0;if(Array.isArray(e)){for(r=jt(t),i=e.length;a<i;a++)o[e[a]]=w.css(t,e[a],!1,r);return o}return void 0!==n?w.style(t,e,n):w.css(t,e)},t,e,arguments.length>1)}}),w.Tween=te,te.prototype={constructor:te,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||w.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var t=te.propHooks[this.prop];return t&&t.get?t.get(this):te.propHooks._default.get(this)},run:function(t){var e,n=te.propHooks[this.prop];return this.options.duration?this.pos=e=w.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):te.propHooks._default.set(this),this}},te.prototype.init.prototype=te.prototype,te.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=w.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){w.fx.step[t.prop]?w.fx.step[t.prop](t):1!==t.elem.nodeType||!w.cssHooks[t.prop]&&null==t.elem.style[Jt(t.prop)]?t.elem[t.prop]=t.now:w.style(t.elem,t.prop,t.now+t.unit)}}},te.propHooks.scrollTop=te.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},w.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},w.fx=te.prototype.init,w.fx.step={};var ee,ne,re=/^(?:toggle|show|hide)$/,ie=/queueHooks$/;function oe(){ne&&(!1===g.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(oe):t.setTimeout(oe,w.fx.interval),w.fx.tick())}function ae(){return t.setTimeout(function(){ee=void 0}),ee=Date.now()}function se(t,e){var n,r=0,i={height:t};for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=nt[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function le(t,e,n){for(var r,i=(ce.tweeners[e]||[]).concat(ce.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,e,t))return r}function ce(t,e,n){var r,i,o=0,a=ce.prefilters.length,s=w.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var e=ee||ae(),n=Math.max(0,c.startTime+c.duration-e),r=1-(n/c.duration||0),o=0,a=c.tweens.length;o<a;o++)c.tweens[o].run(r);return s.notifyWith(t,[c,r,n]),r<1&&a?n:(a||s.notifyWith(t,[c,1,0]),s.resolveWith(t,[c]),!1)},c=s.promise({elem:t,props:w.extend({},e),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:e,originalOptions:n,startTime:ee||ae(),duration:n.duration,tweens:[],createTween:function(e,n){var r=w.Tween(t,c.opts,e,n,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(r),r},stop:function(e){var n=0,r=e?c.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)c.tweens[n].run(1);return e?(s.notifyWith(t,[c,1,0]),s.resolveWith(t,[c,e])):s.rejectWith(t,[c,e]),this}}),u=c.props;for(function(t,e){var n,r,i,o,a;for(n in t)if(i=e[r=J(n)],o=t[n],Array.isArray(o)&&(i=o[1],o=t[n]=o[0]),n!==r&&(t[r]=o,delete t[n]),(a=w.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete t[r],o)n in t||(t[n]=o[n],e[n]=i);else e[r]=i}(u,c.opts.specialEasing);o<a;o++)if(r=ce.prefilters[o].call(c,t,u,c.opts))return f(r.stop)&&(w._queueHooks(c.elem,c.opts.queue).stop=r.stop.bind(r)),r;return w.map(u,le,c),f(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),w.fx.timer(w.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}w.Animation=w.extend(ce,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return st(n.elem,t,et.exec(e),n),n}]},tweener:function(t,e){f(t)?(e=t,t=["*"]):t=t.match(k);for(var n,r=0,i=t.length;r<i;r++)n=t[r],ce.tweeners[n]=ce.tweeners[n]||[],ce.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var r,i,o,a,s,l,c,u,h="width"in e||"height"in e,d=this,p={},f=t.style,m=t.nodeType&&at(t),g=Y.get(t,"fxshow");for(r in n.queue||(null==(a=w._queueHooks(t,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,d.always(function(){d.always(function(){a.unqueued--,w.queue(t,"fx").length||a.empty.fire()})})),e)if(i=e[r],re.test(i)){if(delete e[r],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=!0}p[r]=g&&g[r]||w.style(t,r)}if((l=!w.isEmptyObject(e))||!w.isEmptyObject(p))for(r in h&&1===t.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],null==(c=g&&g.display)&&(c=Y.get(t,"display")),"none"===(u=w.css(t,"display"))&&(c?u=c:(ut([t],!0),c=t.style.display||c,u=w.css(t,"display"),ut([t]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===w.css(t,"float")&&(l||(d.done(function(){f.display=c}),null==c&&(u=f.display,c="none"===u?"":u)),f.display="inline-block")),n.overflow&&(f.overflow="hidden",d.always(function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]})),l=!1,p)l||(g?"hidden"in g&&(m=g.hidden):g=Y.access(t,"fxshow",{display:c}),o&&(g.hidden=!m),m&&ut([t],!0),d.done(function(){for(r in m||ut([t]),Y.remove(t,"fxshow"),p)w.style(t,r,p[r])})),l=le(m?g[r]:0,r,d),r in g||(g[r]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?ce.prefilters.unshift(t):ce.prefilters.push(t)}}),w.speed=function(t,e,n){var r=t&&"object"==typeof t?w.extend({},t):{complete:n||!n&&e||f(t)&&t,duration:t,easing:n&&e||e&&!f(e)&&e};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){f(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.fn.extend({fadeTo:function(t,e,n,r){return this.filter(at).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var i=w.isEmptyObject(t),o=w.speed(e,n,r),a=function(){var e=ce(this,w.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each(function(){var e=!0,i=null!=t&&t+"queueHooks",o=w.timers,a=Y.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&ie.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=t&&o[i].queue!==t||(o[i].anim.stop(n),e=!1,o.splice(i,1));!e&&n||w.dequeue(this,t)})},finish:function(t){return!1!==t&&(t=t||"fx"),this.each(function(){var e,n=Y.get(this),r=n[t+"queue"],i=n[t+"queueHooks"],o=w.timers,a=r?r.length:0;for(n.finish=!0,w.queue(this,t,[]),i&&i.stop&&i.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<a;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish})}}),w.each(["toggle","show","hide"],function(t,e){var n=w.fn[e];w.fn[e]=function(t,r,i){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(se(e,!0),t,r,i)}}),w.each({slideDown:se("show"),slideUp:se("hide"),slideToggle:se("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){w.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}}),w.timers=[],w.fx.tick=function(){var t,e=0,n=w.timers;for(ee=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||w.fx.stop(),ee=void 0},w.fx.timer=function(t){w.timers.push(t),w.fx.start()},w.fx.interval=13,w.fx.start=function(){ne||(ne=!0,oe())},w.fx.stop=function(){ne=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(e,n){return e=w.fx&&w.fx.speeds[e]||e,n=n||"fx",this.queue(n,function(n,r){var i=t.setTimeout(n,e);r.stop=function(){t.clearTimeout(i)}})},function(){var t=g.createElement("input"),e=g.createElement("select").appendChild(g.createElement("option"));t.type="checkbox",p.checkOn=""!==t.value,p.optSelected=e.selected,(t=g.createElement("input")).value="t",t.type="radio",p.radioValue="t"===t.value}();var ue,he=w.expr.attrHandle;w.fn.extend({attr:function(t,e){return G(this,w.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){w.removeAttr(this,t)})}}),w.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?w.prop(t,e,n):(1===o&&w.isXMLDoc(t)||(i=w.attrHooks[e.toLowerCase()]||(w.expr.match.bool.test(e)?ue:void 0)),void 0!==n?null===n?void w.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:null==(r=w.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!p.radioValue&&"radio"===e&&E(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,i=e&&e.match(k);if(i&&1===t.nodeType)for(;n=i[r++];)t.removeAttribute(n)}}),ue={set:function(t,e,n){return!1===e?w.removeAttr(t,n):t.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(t,e){var n=he[e]||w.find.attr;he[e]=function(t,e,r){var i,o,a=e.toLowerCase();return r||(o=he[a],he[a]=i,i=null!=n(t,e,r)?a:null,he[a]=o),i}});var de=/^(?:input|select|textarea|button)$/i,pe=/^(?:a|area)$/i;function fe(t){return(t.match(k)||[]).join(" ")}function me(t){return t.getAttribute&&t.getAttribute("class")||""}function ge(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(k)||[]}w.fn.extend({prop:function(t,e){return G(this,w.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[w.propFix[t]||t]})}}),w.extend({prop:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(t)||(e=w.propFix[e]||e,i=w.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=w.find.attr(t,"tabindex");return e?parseInt(e,10):de.test(t.nodeName)||pe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),p.optSelected||(w.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this}),w.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,l=0;if(f(t))return this.each(function(e){w(this).addClass(t.call(this,e,me(this)))});if((e=ge(t)).length)for(;n=this[l++];)if(i=me(n),r=1===n.nodeType&&" "+fe(i)+" "){for(a=0;o=e[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=fe(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,l=0;if(f(t))return this.each(function(e){w(this).removeClass(t.call(this,e,me(this)))});if(!arguments.length)return this.attr("class","");if((e=ge(t)).length)for(;n=this[l++];)if(i=me(n),r=1===n.nodeType&&" "+fe(i)+" "){for(a=0;o=e[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=fe(r))&&n.setAttribute("class",s)}return this},toggleClass:function(t,e){var n=typeof t,r="string"===n||Array.isArray(t);return"boolean"==typeof e&&r?e?this.addClass(t):this.removeClass(t):f(t)?this.each(function(n){w(this).toggleClass(t.call(this,n,me(this),e),e)}):this.each(function(){var e,i,o,a;if(r)for(i=0,o=w(this),a=ge(t);e=a[i++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==n||((e=me(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Y.get(this,"__className__")||""))})},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+fe(me(n))+" ").indexOf(e)>-1)return!0;return!1}});var ye=/\r/g;w.fn.extend({val:function(t){var e,n,r,i=this[0];return arguments.length?(r=f(t),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?t.call(this,n,w(this).val()):t)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(t){return null==t?"":t+""})),(e=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))})):i?(e=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(ye,""):null==n?"":n:void 0}}),w.extend({valHooks:{option:{get:function(t){var e=w.find.attr(t,"value");return null!=e?e:fe(w.text(t))}},select:{get:function(t){var e,n,r,i=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],l=a?o+1:i.length;for(r=o<0?l:a?o:0;r<l;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!E(n.parentNode,"optgroup"))){if(e=w(n).val(),a)return e;s.push(e)}return s},set:function(t,e){for(var n,r,i=t.options,o=w.makeArray(e),a=i.length;a--;)((r=i[a]).selected=w.inArray(w.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=w.inArray(w(t).val(),e)>-1}},p.checkOn||(w.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}),p.focusin="onfocusin"in t;var ve=/^(?:focusinfocus|focusoutblur)$/,xe=function(t){t.stopPropagation()};w.extend(w.event,{trigger:function(e,n,r,i){var o,a,s,l,c,h,d,p,y=[r||g],v=u.call(e,"type")?e.type:e,x=u.call(e,"namespace")?e.namespace.split("."):[];if(a=p=s=r=r||g,3!==r.nodeType&&8!==r.nodeType&&!ve.test(v+w.event.triggered)&&(v.indexOf(".")>-1&&(v=(x=v.split(".")).shift(),x.sort()),c=v.indexOf(":")<0&&"on"+v,(e=e[w.expando]?e:new w.Event(v,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=x.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),n=null==n?[e]:w.makeArray(n,[e]),d=w.event.special[v]||{},i||!d.trigger||!1!==d.trigger.apply(r,n))){if(!i&&!d.noBubble&&!m(r)){for(l=d.delegateType||v,ve.test(l+v)||(a=a.parentNode);a;a=a.parentNode)y.push(a),s=a;s===(r.ownerDocument||g)&&y.push(s.defaultView||s.parentWindow||t)}for(o=0;(a=y[o++])&&!e.isPropagationStopped();)p=a,e.type=o>1?l:d.bindType||v,(h=(Y.get(a,"events")||Object.create(null))[e.type]&&Y.get(a,"handle"))&&h.apply(a,n),(h=c&&a[c])&&h.apply&&q(a)&&(e.result=h.apply(a,n),!1===e.result&&e.preventDefault());return e.type=v,i||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(y.pop(),n)||!q(r)||c&&f(r[v])&&!m(r)&&((s=r[c])&&(r[c]=null),w.event.triggered=v,e.isPropagationStopped()&&p.addEventListener(v,xe),r[v](),e.isPropagationStopped()&&p.removeEventListener(v,xe),w.event.triggered=void 0,s&&(r[c]=s)),e.result}},simulate:function(t,e,n){var r=w.extend(new w.Event,n,{type:t,isSimulated:!0});w.event.trigger(r,null,e)}}),w.fn.extend({trigger:function(t,e){return this.each(function(){w.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return w.event.trigger(t,e,n,!0)}}),p.focusin||w.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){w.event.simulate(e,t.target,w.event.fix(t))};w.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,i=Y.access(r,e);i||r.addEventListener(t,n,!0),Y.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=Y.access(r,e)-1;i?Y.access(r,e,i):(r.removeEventListener(t,n,!0),Y.remove(r,e))}}});var be=t.location,we={guid:Date.now()},Me=/\?/;w.parseXML=function(e){var n,r;if(!e||"string"!=typeof e)return null;try{n=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||w.error("Invalid XML: "+(r?w.map(r.childNodes,function(t){return t.textContent}).join("\n"):e)),n};var _e=/\[\]$/,Ce=/\r?\n/g,Se=/^(?:submit|button|image|reset|file)$/i,Te=/^(?:input|select|textarea|keygen)/i;function Ee(t,e,n,r){var i;if(Array.isArray(e))w.each(e,function(e,i){n||_e.test(t)?r(t,i):Ee(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,n,r)});else if(n||"object"!==x(e))r(t,e);else for(i in e)Ee(t+"["+i+"]",e[i],n,r)}w.param=function(t,e){var n,r=[],i=function(t,e){var n=f(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!w.isPlainObject(t))w.each(t,function(){i(this.name,this.value)});else for(n in t)Ee(n,t[n],e,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=w.prop(this,"elements");return t?w.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!w(this).is(":disabled")&&Te.test(this.nodeName)&&!Se.test(t)&&(this.checked||!pt.test(t))}).map(function(t,e){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(t){return{name:e.name,value:t.replace(Ce,"\r\n")}}):{name:e.name,value:n.replace(Ce,"\r\n")}}).get()}});var De=/%20/g,Ae=/#.*$/,Oe=/([?&])_=[^&]*/,Pe=/^(.*?):[ \t]*([^\r\n]*)$/gm,Le=/^(?:GET|HEAD)$/,Re=/^\/\//,Ie={},ke={},Fe="*/".concat("*"),Be=g.createElement("a");function je(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(k)||[];if(f(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Ne(t,e,n,r){var i={},o=t===ke;function a(s){var l;return i[s]=!0,w.each(t[s]||[],function(t,s){var c=s(e,n,r);return"string"!=typeof c||o||i[c]?o?!(l=c):void 0:(e.dataTypes.unshift(c),a(c),!1)}),l}return a(e.dataTypes[0])||!i["*"]&&a("*")}function ze(t,e){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&w.extend(!0,t,r),t}Be.href=be.href,w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:be.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(be.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Fe,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?ze(ze(t,w.ajaxSettings),e):ze(w.ajaxSettings,t)},ajaxPrefilter:je(Ie),ajaxTransport:je(ke),ajax:function(e,n){"object"==typeof e&&(n=e,e=void 0),n=n||{};var r,i,o,a,s,l,c,u,h,d,p=w.ajaxSetup({},n),f=p.context||p,m=p.context&&(f.nodeType||f.jquery)?w(f):w.event,y=w.Deferred(),v=w.Callbacks("once memory"),x=p.statusCode||{},b={},M={},_="canceled",C={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=Pe.exec(o);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(t,e){return null==c&&(t=M[t.toLowerCase()]=M[t.toLowerCase()]||t,b[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)C.always(t[C.status]);else for(e in t)x[e]=[x[e],t[e]];return this},abort:function(t){var e=t||_;return r&&r.abort(e),S(0,e),this}};if(y.promise(C),p.url=((e||p.url||be.href)+"").replace(Re,be.protocol+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(k)||[""],null==p.crossDomain){l=g.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Be.protocol+"//"+Be.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=w.param(p.data,p.traditional)),Ne(Ie,p,n,C),c)return C;for(h in(u=w.event&&p.global)&&0==w.active++&&w.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Le.test(p.type),i=p.url.replace(Ae,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(De,"+")):(d=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(Me.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(Oe,"$1"),d=(Me.test(i)?"&":"?")+"_="+we.guid+++d),p.url=i+d),p.ifModified&&(w.lastModified[i]&&C.setRequestHeader("If-Modified-Since",w.lastModified[i]),w.etag[i]&&C.setRequestHeader("If-None-Match",w.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Fe+"; q=0.01":""):p.accepts["*"]),p.headers)C.setRequestHeader(h,p.headers[h]);if(p.beforeSend&&(!1===p.beforeSend.call(f,C,p)||c))return C.abort();if(_="abort",v.add(p.complete),C.done(p.success),C.fail(p.error),r=Ne(ke,p,n,C)){if(C.readyState=1,u&&m.trigger("ajaxSend",[C,p]),c)return C;p.async&&p.timeout>0&&(s=t.setTimeout(function(){C.abort("timeout")},p.timeout));try{c=!1,r.send(b,S)}catch(t){if(c)throw t;S(-1,t)}}else S(-1,"No Transport");function S(e,n,a,l){var h,d,g,b,M,_=n;c||(c=!0,s&&t.clearTimeout(s),r=void 0,o=l||"",C.readyState=e>0?4:0,h=e>=200&&e<300||304===e,a&&(b=function(t,e,n){for(var r,i,o,a,s=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||t.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(p,C,a)),!h&&w.inArray("script",p.dataTypes)>-1&&w.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),b=function(t,e,n,r){var i,o,a,s,l,c={},u=t.dataTypes.slice();if(u[1])for(a in t.converters)c[a.toLowerCase()]=t.converters[a];for(o=u.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=c[l+" "+o]||c["* "+o]))for(i in c)if((s=i.split(" "))[1]===o&&(a=c[l+" "+s[0]]||c["* "+s[0]])){!0===a?a=c[i]:!0!==c[i]&&(o=s[0],u.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}(p,b,C,h),h?(p.ifModified&&((M=C.getResponseHeader("Last-Modified"))&&(w.lastModified[i]=M),(M=C.getResponseHeader("etag"))&&(w.etag[i]=M)),204===e||"HEAD"===p.type?_="nocontent":304===e?_="notmodified":(_=b.state,d=b.data,h=!(g=b.error))):(g=_,!e&&_||(_="error",e<0&&(e=0))),C.status=e,C.statusText=(n||_)+"",h?y.resolveWith(f,[d,_,C]):y.rejectWith(f,[C,_,g]),C.statusCode(x),x=void 0,u&&m.trigger(h?"ajaxSuccess":"ajaxError",[C,p,h?d:g]),v.fireWith(f,[C,_]),u&&(m.trigger("ajaxComplete",[C,p]),--w.active||w.event.trigger("ajaxStop")))}return C},getJSON:function(t,e,n){return w.get(t,e,n,"json")},getScript:function(t,e){return w.get(t,void 0,e,"script")}}),w.each(["get","post"],function(t,e){w[e]=function(t,n,r,i){return f(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:t,type:e,dataType:i,data:n,success:r},w.isPlainObject(t)&&t))}}),w.ajaxPrefilter(function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")}),w._evalUrl=function(t,e,n){return w.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){w.globalEval(t,e,n)}})},w.fn.extend({wrapAll:function(t){var e;return this[0]&&(f(t)&&(t=t.call(this[0])),e=w(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return f(t)?this.each(function(e){w(this).wrapInner(t.call(this,e))}):this.each(function(){var e=w(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=f(t);return this.each(function(n){w(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(t){return!w.expr.pseudos.visible(t)},w.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Ve={0:200,1223:204},Ge=w.ajaxSettings.xhr();p.cors=!!Ge&&"withCredentials"in Ge,p.ajax=Ge=!!Ge,w.ajaxTransport(function(e){var n,r;if(p.cors||Ge&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);n=function(t){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Ve[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&t.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(e.hasContent&&e.data||null)}catch(t){if(n)throw t}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return w.globalEval(t),t}}}),w.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),w.ajaxTransport("script",function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,i){e=w("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&i("error"===t.type?404:200,t.type)}),g.head.appendChild(e[0])},abort:function(){n&&n()}}});var He,Ue=[],We=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ue.pop()||w.expando+"_"+we.guid++;return this[t]=!0,t}}),w.ajaxPrefilter("json jsonp",function(e,n,r){var i,o,a,s=!1!==e.jsonp&&(We.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&We.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=f(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(We,"$1"+i):!1!==e.jsonp&&(e.url+=(Me.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=t[i],t[i]=function(){a=arguments},r.always(function(){void 0===o?w(t).removeProp(i):t[i]=o,e[i]&&(e.jsonpCallback=n.jsonpCallback,Ue.push(i)),a&&f(o)&&o(a[0]),a=o=void 0}),"script"}),p.createHTMLDocument=((He=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===He.childNodes.length),w.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(p.createHTMLDocument?((r=(e=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,e.head.appendChild(r)):e=g),o=!n&&[],(i=D.exec(t))?[e.createElement(i[1])]:(i=bt([t],e,o),o&&o.length&&w(o).remove(),w.merge([],i.childNodes)));var r,i,o},w.fn.load=function(t,e,n){var r,i,o,a=this,s=t.indexOf(" ");return s>-1&&(r=fe(t.slice(s)),t=t.slice(0,s)),f(e)?(n=e,e=void 0):e&&"object"==typeof e&&(i="POST"),a.length>0&&w.ajax({url:t,type:i||"GET",dataType:"html",data:e}).done(function(t){o=arguments,a.html(r?w("<div>").append(w.parseHTML(t)).find(r):t)}).always(n&&function(t,e){a.each(function(){n.apply(this,o||[t.responseText,e,t])})}),this},w.expr.pseudos.animated=function(t){return w.grep(w.timers,function(e){return t===e.elem}).length},w.offset={setOffset:function(t,e,n){var r,i,o,a,s,l,c=w.css(t,"position"),u=w(t),h={};"static"===c&&(t.style.position="relative"),s=u.offset(),o=w.css(t,"top"),l=w.css(t,"left"),("absolute"===c||"fixed"===c)&&(o+l).indexOf("auto")>-1?(a=(r=u.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),f(e)&&(e=e.call(t,n,w.extend({},s))),null!=e.top&&(h.top=e.top-s.top+a),null!=e.left&&(h.left=e.left-s.left+i),"using"in e?e.using.call(t,h):u.css(h)}},w.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){w.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))e=r.getBoundingClientRect();else{for(e=this.offset(),n=r.ownerDocument,t=r.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===w.css(t,"position");)t=t.parentNode;t&&t!==r&&1===t.nodeType&&((i=w(t).offset()).top+=w.css(t,"borderTopWidth",!0),i.left+=w.css(t,"borderLeftWidth",!0))}return{top:e.top-i.top-w.css(r,"marginTop",!0),left:e.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===w.css(t,"position");)t=t.offsetParent;return t||rt})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var n="pageYOffset"===e;w.fn[t]=function(r){return G(this,function(t,r,i){var o;if(m(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===i)return o?o[e]:t[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):t[r]=i},t,r,arguments.length)}}),w.each(["top","left"],function(t,e){w.cssHooks[e]=Gt(p.pixelPosition,function(t,n){if(n)return n=Vt(t,e),Bt.test(n)?w(t).position()[e]+"px":n})}),w.each({Height:"height",Width:"width"},function(t,e){w.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return G(this,function(e,n,i){var o;return m(e)?0===r.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===i?w.css(e,n,s):w.style(e,n,i,s)},e,a?i:void 0,a)}})}),w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){w.fn[e]=function(t){return this.on(e,t)}}),w.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){w.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}});var Je=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.proxy=function(t,e){var n,r,o;if("string"==typeof e&&(n=t[e],e=t,t=n),f(t))return r=i.call(arguments,2),(o=function(){return t.apply(e||this,r.concat(i.call(arguments)))}).guid=t.guid=t.guid||w.guid++,o},w.holdReady=function(t){t?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=E,w.isFunction=f,w.isWindow=m,w.camelCase=J,w.type=x,w.now=Date.now,w.isNumeric=function(t){var e=w.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},w.trim=function(t){return null==t?"":(t+"").replace(Je,"")};var qe=t.jQuery,Xe=t.$;return w.noConflict=function(e){return t.$===w&&(t.$=Xe),e&&t.jQuery===w&&(t.jQuery=qe),w},void 0===e&&(t.jQuery=t.$=w),w},t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}}),jquery$1=Object.freeze({__proto__:null,default:jquery,__moduleExports:jquery});export{McEdGetPointWorldDrawObject,McGeTool,McGiWorldDrawType$1 as McGiWorldDrawType,MrxDbgUiPrBaseReturn$1 as MrxDbgUiPrBaseReturn,MrxDbgUiPrPoint,MrxDbgUtils,Mx3PointArc,MxCADObject,MxDb2LineAngularDimension,MxDbAlignedDimension,MxDbAnyLine,MxDbArcShapeDraw,MxDbArea,MxDbArrow,MxDbCircleArc,MxDbCircleShape,MxDbCloudLine,MxDbCoord,MxDbDatabase,MxDbEllipse,MxDbEllipseArc,MxDbEllipseShape,MxDbEntity,MxDbGradientLine,MxDbHatch,MxDbImage,MxDbLeadComment,MxDbLeadTag,MxDbLine,MxDbLineShape,MxDbPolyline,MxDbRect,MxDbRectBoxLeadComment,MxDbRegularPolygon,MxDbRegularPolygonShape,MxDbRingShape,MxDbSVG,MxDbSVGText,MxDbShape,MxDbStarShape,MxDbText,MxDrawObject,MxFilters,MxFun,MxPaintBrush,MxThreeJS,MxType,Mxassembly,Mx as default,loadCoreCode,store,useCanvasResizeListener};